Bug 51

Summary: sudo 1.6.3p7 and cron - Solaris 8 04/01 SPARC
Product: Sudo Reporter: Peter Bray <Peter.Bray>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal CC: Peter.Bray
Priority: high    
Version: 1.6.3   
Hardware: Sun   
OS: Solaris 2.x   

Description Peter Bray 2001-09-20 01:48:01 MDT
I have setup a standard sudo installation (--prefix=/pkgs/sudo-1.6.3p7 was the
only configure option - Sun Workshop 6update1 C Compiler - GNU make) and have a
simple NOPASSWD: configuration for one user which works a treat on the command
line.

The script which the sudo is embedded in also works fine if run from the command
line. But the sudo fails with return code 1 when the script is run from cron.

Sudo being suid makes it impossible to truss as truss would need to be run as
root to truss an suid execuatable, and there is not any info in syslog or in
the mail sent from cron to suggest why the sudo is failing in this environment.

Any Fix / Pointers or internal debugging options would be greatly appreciated to
help track down the problem.

Many Thanks in Advance
Peter

Backround: We have create a wrapper for "mtx" (tape changer) called L280 (after
the Sun tape unit we have). Commands such as "sudo L280 load 5" work fine on the
command line, and even in scripts run from ther command line. But this script
"backupController" fails if run from cron. My guess is its a "no controlling
terminal" issue. I have tried both sudo and sudo -S without success, remembering
that the user has a single valid sudo-able command /pkgs/bin/L280 which has a
working NOPASSWD: option prefixing it.
Comment 1 Peter Bray 2001-09-23 08:22:59 MDT
On another system (Solaris 8 04/01 via MU4 INTEL - my home system) 1.6.3p5 works
fine under cron (as expected) - when I get time - I'll try the combinations and
report back on the results
Comment 2 Todd C. Miller 2001-12-17 17:02:59 MST
Are you sure that it is sudo that is exiting with a value of 1 and not the program you are running via
sudo?  Sudo prints an error message whenever it exits with an error and, in most cases, logs the
error as well.
Comment 3 Peter Bray 2002-01-17 15:13:59 MST
While I have not had achance to verifiy this - mtx's latest release is suppose
to fix an issue related to cron use.