You can use the dash with kdesu as well I think. Also, do some reading "man cron" and I think you will find that cron actually uses a particular restricted environment, hence your errors. I have got around this in the past by putting the job in a script file that sets the environment and which is called by cron.
BillK On Thu, 2001-11-15 at 08:34, bascule wrote: > thanks, > i sort of see what you mean, this might explian why kdesu doesn't do it, > though > #su > <password> > #./somescript > does work without the dash, unfortunately, it's not a reason that might > explain why a cron job run as root (setup with webmin) that calls the script > would fail, would it? > i have wondered if the problem lies with calling one script - urpmi - from > another, but since my knowledge of perl is slightly less than my knowledge of > bash i.e. zero i couldn't possibly investigate this! > > bascule > > p.s. is that 'defanged' thing some sort of unixy joke, or is quoting scripts > in mails a genuine security risk? > > On Thursday 15 Nov 2001 12:05 am, you wrote: > > Try su - -c 'command' Normal su (and kdesu I think) inherit the current > > user environment, the dash tells it to spawn a new one based on root. > > There are differences in the default path etc when running programs in > > this way which can cause obscure failures. > > > > BillK > > > > > > ---- > > This message has been 'sanitized'. This means that potentially > dangerous content has been rewritten or removed. The following > log describes which actions were taken. > > Sanitizer (start="1005784787"): > Part (pos="2813"): > SanitizeFile (filename="unnamed.txt", mimetype="text/plain"): > Match (rule="2"): > Enforced policy: accept > > Part (pos="3880"): > SanitizeFile (filename="message.footer", mimetype="text/plain"): > Match (rule="default"): > Enforced policy: defang > > Replaced mime type with: application/DEFANGED-18 > Replaced file name with: message_footer.DEFANGED-18 > > Total modifications so far: 1 > > > Anomy 0.0.0 : Sanitizer.pm > $Id: Sanitizer.pm,v 1.32 2001/10/11 19:27:15 bre Exp $
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
