Perl help: I want to be me

Brad Smith usernamenumber at gmail.com
Wed Sep 29 10:11:28 PDT 2004


Actually, strike the single-quotes from that. It's more likely to work as:

$cicmd = "ls RCS/*,v | xargs su - lbarnes -c \ci -l -j -m\"As of
$label\" -N\"$tag\"";

...but again, I'm not in a position to test it at the moment and it's
early, so use at your own risk. =;)

--Brad

On Wed, 29 Sep 2004 10:08:39 -0700, Brad Smith <usernamenumber at gmail.com> wrote:
> I'm sure these aren't qute what you're looking for, but two solutions
> occur to me:
> 
> 1) Put the script in lbarnes' crontab instead of a root crontab like cron.hourly
> 2) Have the script run something like this:
> 
> $cicmd = "ls RCS/*,v | xargs su - lbarnes -c \'ci -l -j -m\"As of
> $label\" -N\"$tag\"\'";
> 
> Note the addition of "su - lbarnes -c...". That should cause the ci
> command to run as lbarnes, though I haven't tested it.
> 
> --Brad
> 
> 
> 
> On Wed, 29 Sep 2004 09:47:50 -0700, Lan Barnes <lan at falleagle.net> wrote:
> > I learned some time ago that I couldn't run perl scripts that became
> > root when they ran. It's apparently a Linux thing, and everyone told me
> > it was a Good Thing, although it put a spike in some grandiose plans I
> > had.
> >
> > Now I want to write a script where root becomes an ordinary user in the
> > script.  Why? I want to have a script in /etc/cron.hourly archive some
> > files in rcs that are locked by a user. When root runs the script, rcs
> > quite reasonably points out that root doesn't have a lock on those
> > files.
> >
> > Now, dammit, perl has $< and $> and it allows them to be assigned, and
> > there must be a reason for that. But when I run my script, I get:
> >
> > [lbarnes at oz rcs-tst]$ su -
> > Password:
> > [root at oz root]# cd /home/lbarnes/rcs-tst/
> > [root at oz rcs-tst]# ./wiki-archive.pl
> > EUID = 502 0 502
> > Insecure dependency in system while running setuid at ./wiki-archive.pl
> > line 14.
> >
> > I will include my script at the end.
> >
> > What gives? Can I get around this? Am I forgetting something (like the
> > suid bit)? Help help!
> >
> > --
> > Lan Barnes                    lan at falleagle.net
> > Linux Guy, SCM Specialist     858-354-0616
> >
> >
> > 
> > --
> >   http://www.kernel-panic.org
> >   list archives http://www.kernel-panic.org/cgi-bin/ezmlm-cgi?4
> >   To unsubscribe, send a message to the address shown in the list-unsubscribe
> >   header of this message.
> >
> >
> >
> >
>



More information about the KPLUG-List mailing list