isidore has asked for the wisdom of the Perl Monks concerning the following question:
I have setuid-perl installed and run chmod ugo+xs <script>. The file is owned by a user with uid 15001 When I run this script from a different user account (with uid 1020) with Ubuntu 8.04 I get:#!/usr/bin/perl -w use strict; print "Perl version: $]\n"; print "UIDs real $< \t effective $>\n"; ($>, $<) = ($<, $>); # swap real uid and effective uid print "UIDs real $< \t effective $>\n"; ($>, $<) = ($<, $>); # swap real uid and effective uid print "UIDs real $< \t effective $>\n"; ($>, $<) = ($<, $>); # swap real uid and effective uid print "UIDs real $< \t effective $>\n";
All hunky dory and just what I want: the uid and euid swap quite nicely. However when I run this from a new Ubuntu with perl 5.10 I get:Perl version: 5.008008 UIDs real 1020 effective 15001 UIDs real 15001 effective 1020 UIDs real 1020 effective 15001 UIDs real 15001 effective 1020
Not what I want :( Once the ids have been set to one value it becomes impossible to get the other value back. Does anyone know what is going on here - or know of a workaround? I've googled every combination of terms I can think of, but not found any suggestions. Thanks, I.Perl version: 5.010000 UIDs real 1020 effective 15001 UIDs real 1020 effective 1020 UIDs real 1020 effective 1020 UIDs real 1020 effective 1020
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: setuid script won't behave in 5.10, but did in 5.8
by moritz (Cardinal) on Mar 22, 2010 at 14:53 UTC | |
by isidore (Initiate) on Mar 22, 2010 at 15:32 UTC | |
by Corion (Patriarch) on Mar 22, 2010 at 15:48 UTC | |
by isidore (Initiate) on Mar 23, 2010 at 07:11 UTC | |
by Corion (Patriarch) on Mar 23, 2010 at 08:24 UTC | |
by Anonymous Monk on Mar 23, 2010 at 07:21 UTC | |
|