From owner-freebsd-questions@FreeBSD.ORG Mon Apr 11 14:17:30 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D17016A4CE for ; Mon, 11 Apr 2005 14:17:30 +0000 (GMT) Received: from mail28.sea5.speakeasy.net (mail28.sea5.speakeasy.net [69.17.117.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5E4E43D31 for ; Mon, 11 Apr 2005 14:17:29 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 23808 invoked from network); 11 Apr 2005 14:17:29 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail28.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 11 Apr 2005 14:17:29 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id 73AC252; Mon, 11 Apr 2005 10:17:28 -0400 (EDT) Sender: lowell@be-well.ilk.org To: tim@tjstephens.com References: <20050411135117.GA5816@tjstephens.com> From: Lowell Gilbert Date: 11 Apr 2005 10:17:28 -0400 In-Reply-To: <20050411135117.GA5816@tjstephens.com> Message-ID: <44oeclqtxj.fsf@be-well.ilk.org> Lines: 12 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-questions@freebsd.org Subject: Re: set-uid bit: where am I going wrong? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2005 14:17:30 -0000 Tim Stephens writes: > I'm trying to use a script I wrote to copy files from one directory to another (as part of my backup regime). Unfortunately, because they are in my webserver directory, some of the files don't belong to the user that I run the script as (via cron). I can run the script with sudo, so I know that it's a permission problem. > > My initial thought is that I can use the set-uid bit and chown the script to root, but this still balks. Here is the relevant output of ls -l. > > -rwsr-xr-x 1 root admin 283 Nov 23 15:58 buprep.yuri > > Clearly the file is owned by root, and I kept it as part of my group. I've read the man pages, and believe that when I call the script, it will assume root's permissions. It doesn't, so where am I going wrong? The kernel ignores the setuid bit on interpreted files, for security reasons.