Re: set-uid on shell scripts in Solaris
Posted in 1994
Topics: Platform-Specific Issues
: Yogen Sanghani (yogen@astro.ocis.temple.edu) wrote: : : Is there any difference in the way set-uid bit works in Solaris from SunOS? : : I need a shell script with set-uid, owned by root and to be executed by : operators. I could not run that script, so I tried following simple script. : : ############################################################# : cat /etc/shadow : ############################################################ : : this script is owned by root, group other and the permissions are : "rws r-s r-x". I could not cat /etc/shadow file through script, logged : in as ordinay user. Generally shell scripts do not have full set-user-id semantics. It must be an executable. At least this is true for DG/UX and other System V based unix operating systems. I'm not sure about BSD based systems. It has to do with a security hole. You can compile a C-program or other executable to make it set-user-id. Also, you can make Perl programs that are set-user-id, and Perl is as flexible as a shell script. Basically, Perl arranges to run a special version of Perl with set-user-id root permissions to do things for you. See "Programming Perl" by O'Reilly and Associates for more information if this interests you. (p. 374) Hope this helps, -Eric +----------------------------------+--------------------------------------+ | Eric Vook ( vook@dg-rtp.dg.com ) | Data General Corporation | | Voice: (919) 248-6071 | 62 TW Alexander Dr | | FAX: (919) 248-6108 | Research Triangle Park, NC 27709 | +----------------------------------+--------------------------------------+