[illumos-Developer] Webrev for bug 864: at(1) should not popen /usr/bin/pwd

Garrett D'Amore garrett at damore.org
Sat May 14 11:56:29 PDT 2011


Line 677 seteuid(0) assumes that this is running as setid root, which
may or may not be the case.  I'd prefer to see a call at line 667 to
geteuid(), and then use that as the argument to seteuid() at line 677.

Otherwise it looks pretty good.

If you can, I'd like to see how this does with autofs mounted
directories, and compare that with its current use.  (I think it will be
fine, but autofs can do weird things to getcwd().)

	- Garrett

On Sat, 2011-05-14 at 08:58 -0500, Gary Mills wrote:
> This is for illumos bug 864: at(1) should not popen /usr/bin/pwd.
> My webrev is at:
> 
>     http://cr.illumos.org/view/rcb94hjq/illumos864/
> 
> It passes cstyle and lint.
> 
> Most of my testing was done on OI 148.  Here's an example, after
> installing it in /usr/local/bin and making it setuid root:
> 
>     $ /usr/local/bin/at now+1min
>     at> echo "This is the fixed at"
>     at> <EOT>
>     commands will be executed using /bin/ksh
>     job 1305319632.a at Fri May 13 15:47:12 2011
>     $ /usr/local/bin/at -l      
>     user = mills	  1305319632.a	    Fri May 13 15:47:12 2011
> 
> This is an example on an NFS-mounted home directory, with the OI 148
> executable running on Solaris 10:
> 
>     $ /opt/bin/at now+1min                           
>     at> echo "This is in a restricted directory"
>     at> pwd
>     at> <EOT>
>     commands will be executed using /bin/ksh
>     job 1305320993.a at Fri May 13 16:09:53 2011
>     $ root
>     Password: 
>     cannot access parent directories
>     # pwd
>     cannot access parent directories
> 
> The e-mail said:
> 
>     Your "at" job on eltanin
>     "/var/spool/cron/atjobs/1305320993.a"
>     
>     produced the following output:
>     
>     This is in a restricted directory
>     /home/uadmin/mills/restrict
>     





More information about the Developer mailing list