Newsgroup: it.comp.os.linux.iniziare
Titolo: cron.allow e cron.deny

Non sono riuscito a capire bene dove vanno messi i file in oggetto. Sotto
solaris sono in /etc/cron.d/, sotto linux dove vanno?
Il mio scopo è negare il crontab a tutti (senza aggiungere uno ad uno gli
utenti in cron.deny, man mano che li creo) tranne quelli che si trovano in
cron.allow
Il problema è che dando un strace di crontab -l, non vedo proprio che vada a
cercare questi file
root@portmat:/etc# strace crontab -l  2>&1 |grep cron
execve("/usr/bin/crontab", ["crontab", "-l"], [/* 34 vars */]) = 0
readlink("/proc/self/exe", "/usr/bin/crontab", 4095) = 16
chdir("/var/spool/cron/crontabs")       = 0
write(1, "# If you don\'t want the output o"..., 1094# If you don't want the
output of a cron job mailed to you, you have to direct
# Run the hourly, daily, weekly, and monthly cron jobs.
# Jobs that need different timing may be entered into the crontab as before,
root@portmat:/etc# strace crontab -l  2>&1 |grep open
open("/etc/ld.so.preload", O_RDONLY)    = 3
open("/lib/libsafe.so.2", O_RDONLY)     = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
open("/lib/tls/libdl.so.2", O_RDONLY)   = 3
open("/etc/libsafe.exclude", O_RDONLY)  = -1 ENOENT (No such file or
directory)
open("/etc/nsswitch.conf", O_RDONLY)    = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/tls/libnss_compat.so.2", O_RDONLY) = 3
open("/lib/tls/libnsl.so.1", O_RDONLY)  = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/tls/libnss_nis.so.2", O_RDONLY) = 3
open("/lib/tls/libnss_files.so.2", O_RDONLY) = 3
open("/etc/passwd", O_RDONLY)           = 3
open("/etc/passwd", O_RDONLY)           = 3
open("root", O_RDONLY)                  = 3
Come si fa?
Matteo

 vada a cercare questi file
Se provi senza il -l (per editare), vedi che va a cercarli.
-- 
  |   \    \  | ___|_  |_  |  ianezz a casa sua... :-)
  |  _ \  | \ | _|    /   /   Verba volant, scripta
 _|_/  _\_|  _|____|___|___|  manent, data corrupted

 
Negativo:
# strace crontab -e 2>&1|grep open > /tmp/bb
open("/etc/ld.so.preload", O_RDONLY)    = 3
open("/lib/libsafe.so.2", O_RDONLY)     = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
open("/lib/tls/libdl.so.2", O_RDONLY)   = 3
open("/etc/libsafe.exclude", O_RDONLY)  = -1 ENOENT (No such file or
directory)
open("/etc/nsswitch.conf", O_RDONLY)    = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/tls/libnss_compat.so.2", O_RDONLY) = 3
open("/lib/tls/libnsl.so.1", O_RDONLY)  = 3
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/tls/libnss_nis.so.2", O_RDONLY) = 3
open("/lib/tls/libnss_files.so.2", O_RDONLY) = 3
open("/etc/passwd", O_RDONLY)           = 3
open("/etc/passwd", O_RDONLY)           = 3
open("/var/spool/cron/crontab.5036", O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 0600) =
3
open("root", O_RDONLY)                  = 4
open("root.new", O_WRONLY|O_APPEND|O_CREAT|O_TRUNC, 0600) = 5
open("cron.update", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3
# strace crontab -e 2>&1|grep cron
execve("/usr/bin/crontab", ["crontab", "-e"], [/* 33 vars */]) = 0
readlink("/proc/self/exe", "/usr/bin/crontab", 4095) = 16
chdir("/var/spool/cron/crontabs")       = 0
open("/var/spool/cron/crontab.5031", O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 0600) =
3
chown32("/var/spool/cron/crontab.5031", 0, 0) = 0
reading /var/spool/cron/crontab.5031
unlink("/var/spool/cron/crontab.5031")  = 0
open("cron.update", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3
Comunque, dove vanno questi file?
Matteo

 Negativo:
Strano. Su Debian unstable:
$ strace crontab -e 2>&1 | grep -E "allow|deny"
open("/etc/cron.allow", O_RDONLY)       = -1 ENOENT (No such file or directory)
open("/etc/cron.deny", O_RDONLY)        = -1 ENOENT (No such file or
directory)
Io ho su il Vixie cron, tu che hai su?



Ora non ho la macchina sottomano, ma su SuSE (le prove le avevo fatte su 
slackware e non ricordo se anche su redhat; io ne ho bisogno su 
quest'ultimo) ho effettivamente notato:
# strace crontab -e 2>&1 | grep cron
execve("/usr/bin/crontab", ["crontab", "-e"], [/* 57 vars */]) = 0
stat64("/var/spool/cron", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
chdir("/var/spool/cron")                = 0
# strace crontab -e 2>&1 | grep -E "allow|deny"
open("allow", O_RDONLY)                 = -1 ENOENT (No such file or 
directory)
open("deny", O_RDONLY)                  = 3
Farņ altre prove... al rientro delle ferie, perņ.
Matteo 


Ho notato anche questo messaggio qualche riga sopra:
chdir("/var/spool/cron")
infatti in SuSE (ho provato e funzionano) sono
/var/spool/cron/allow
/var/spool/cron/deny
non /etc/cron.allow /etc/cron.deny
o /etc/cron.d/cron.allow /etc/cron.d/cron.deny
Matteo