On Jul 26 08:42:52, fluca1...@infinito.it wrote: > On Wed, Jul 24, 2013 at 8:32 AM, Jan Stary <h...@stare.cz> wrote: > > >> Could someone please provide an example > >> where su(1) confuses crontab(1)? > > If I get it right the problem is not running crontab, rather modifying > the crontrab files. > In such case the following could be an example: I ask su(1) to become > another user without modifying the environment, therefore I'm another > user running in the same environment of the former (than there's a > privilege problem, of course). Crontab searches for the current uid > while I would like to see the old one. > > > % id > ~ > uid=1001(luca) gid=1001(luca) groups=1001(luca),0(wheel) > % su -m pgsql
%id > % echo $USER > ~ > luca > % crontab -l > ~ > crontab: no crontab for pgsql You have su'd to pgsql, and crontab -l is showing you the (nonexistent) crontab of pgsql. That's intended. I was asking for an example of su being "confused" by su.