Hello Monks,

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

#!/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";
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...

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.


In reply to suid on solaris?? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.