*BSD News Article 51256


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.kei.com!news.mathworks.com!tank.news.pipex.net!pipex!lade.news.pipex.net!pipex!sunic!sunic.sunet.se!news1.transpac.net!news2.transpac.net!advocaat.dd.sigma.se!usenet
From: Olof.Franksson@dd.sigma.se (Olof Franksson)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: "chmod u+s" problem
Date: 12 Sep 1995 12:13:53 GMT
Organization: Sigma Design & Development
Lines: 26
Message-ID: <433ti2$96r@advocaat.dd.sigma.se>
NNTP-Posting-Host: porter.dd.sigma.se
X-Newsreader: WinVN 0.92.6+

I have a problem when trying to execute a shell-script as root
on a FreeBSD system. The shell script is not allowed to access 
directories for which root-priviledges are neccessary, in spite of
the "chown/chmod"-commands I have applied. The setup works on a 
HP-UX system, but probably (?) there something in addition needed on 
the FreeBSD system. Is there anyone who knows?
 
What I created was a shell script (foo, see below) owned by root (chown 
root foo), with the execution flags set (chmod a+rx foo), and with "set 
ID on execution" flag set (chmod u+s foo).

foo:
	#!/bin/sh
	/bin/cp /dev/null /usr/junk

The "cp /dev/null /usr/junk" command works as it should when executed
as root directly from the command line.



       Olof Franksson
       
SIGMA Design & Development         Voice:  +46-8-404 1101
Svetsarvagen 8                     Fax:    +46-8-764 7264
S-171 41 Solna                     URL:    http://www.dd.sigma.se/~olof/
Sweden                             E-mail: Olof.Franksson@dd.sigma.se