Re: SUID on Solaris versus Linux

  • From: Matthew Zito <matt@xxxxxxxxxxxxxxxxx>
  • To: Amir.Hameed@xxxxxxxxx
  • Date: Tue, 27 Nov 2012 16:15:49 -0500

Ah-ha - you've hit a fun quirk of Linux.  Linux does not support the setuid
bit on anything with a magic number that references an external executable,
i.e. that starts with #!.
http://unix.stackexchange.com/questions/364/allow-setuid-on-shell-scripts

That stackexchange article has a really good summary of the issue, and some
ideas for working around it.

Also, I'm pretty sure that newer versions of Solaris behave similarly, so
perhaps it's best to take this approach for both OSes going forward and
insure forward compatibility.

Thanks,
Matt


On Tue, Nov 27, 2012 at 4:03 PM, Hameed, Amir <Amir.Hameed@xxxxxxxxx> wrote:

> Folks,
> I am trying to understand why the SUID is behaving differently on Solaris
> versus Linux. It is working fine on Solaris and not working on Linux.
> I have a test script that I am running on both Solaris and Linux. The
> storage is NAS based and "suid" is set in the mount command. Here are the
> contents of the script:
> -----------
> cat /tmp/t1
> #!/bin/sh
> touch /home/oracle/1
> -----------
>
> $ ls -ltr /tmp/t1
> -rwsr-xr-x   1 oracle   oinstall      31 Nov 27 13:39 /tmp/t1
>
>
> Any idea why SUID is not working on Linux the way it is on Solaris.
>
> Thanks
> Amir
>
> --
> //www.freelists.org/webpage/oracle-l
>
>
>


--
//www.freelists.org/webpage/oracle-l


Other related posts: