Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 1996 13:43:48 -0700
From:      "Scott Overholser (Volt Computer) (Exchange)" <a-scotov@exchange.microsoft.com>
To:        "'questions@FreeBSD.ORG'" <questions@FreeBSD.ORG>, "'Andy Smith'" <andy.smith@reuters.com>
Subject:   RE: FreeBSD 2.1 SUID
Message-ID:  <c=US%a=_%p=Microsoft%l=DABONE-960415204348Z-7320@yuri.microsoft.com>

next in thread | raw e-mail | index | archive | help
>The problem is I have a C program, that runs as user operator, with
>UID 3. I need this user to be able to modify some files in /etc, so I
>have a sh script that should run suid root. This script is simply 
>
>#! /bin/sh
>#
>cp /usr/local/proto/weekly /etc/weekly
>cp /usr/local/proto/daily /etc/daily
>cp /usr/local/proto/security /etc/security
>...
>Plus more of the same
>
>This script is called on exit from the C program. The sh script is
>owned by root.wheel and has permissions -rwsr-----. So that it
>'should' suid to root as it runs, unfortunately this is not the case,
>and it runs with uid 3, the operator.
>
>How can I get this (or any) shell script to run SUID root??

some un*ces refuse to run suid root shell scripts.  i don't know if this
is true for freebsd.  in any case, don't do it - even if you can.  there
is no way to make a shell script secure enough for such use.  you could
write a c wrapper though.  or, consider using perl.

scotto
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c=US%a=_%p=Microsoft%l=DABONE-960415204348Z-7320>