Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am facing a strange problem in which i am having a suid script working on linux, but the same suid script not working on solaris.DOes soalris support suid?? I have the following lines im my script
This script is kept in an area /home/private with its suid bit set.Hence the script will run having the permission to of the user "private" and will be able to write in that area...#!/usr/bin/perl $ENV{PATH}="/bin:/usr/ucb"; my $uid = $<; my $euid = $>; print "\n$uid $euid\n"; mkdir "/home/private/database/mydir", 0777; print "\n$uid $euid\n";
Now , when i run the script from linux, i get the real user id and effective user id different ie
something like
2204 2224
and i am able to create the directory mydir, as it is to be created by the permissions of effective user id.(The permission of the user who owns the script, not the one who runs it)
But if i run the same on solaris, i get an error saying mkdir "permission denied" and the real uid and the effective user id are the same and that of the user who has run the script, not of the owner of the script!!!
I am not able to understand this behavior on solaris... If any of you has faced such a prob , pls let me know your comments..
Thanks in advance
Edited by Chady -- code tags and minor formatting.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: suid on solaris??
by rdm (Hermit) on Jun 24, 2004 at 08:36 UTC | |
|
Re: suid on solaris??
by tbone1 (Monsignor) on Jun 24, 2004 at 12:54 UTC | |
|
Re: suid on solaris??
by pelagic (Priest) on Jun 24, 2004 at 08:35 UTC |