From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 17 20:57:35 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7776716A4CE for ; Thu, 17 Jun 2004 20:57:35 +0000 (GMT) Received: from malasada.lava.net (malasada.lava.net [64.65.64.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3954943D1F for ; Thu, 17 Jun 2004 20:57:35 +0000 (GMT) (envelope-from cliftonr@lava.net) Received: by malasada.lava.net (Postfix, from userid 102) id C36A8153882; Thu, 17 Jun 2004 10:55:49 -1000 (HST) Date: Thu, 17 Jun 2004 10:55:49 -1000 From: Clifton Royston To: hackers@freebsd.org Message-ID: <20040617205549.GA19254@lava.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2i Subject: Sticky/sgid/suid bits safe on regular files? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2004 20:57:35 -0000 I need to add a feature to an application where it can keep tabs on whether one specific action has ever been taken on any given file, one of possibly hundreds of thousands of a dynamically changing file set. The files might reside either on an NFS server or on local storage, and may ultimately be accessed by multiple servers; we also don't want to alter the contents of the file. It's essentially a mail-queue type of situation. It would be very convenient if we can simply set some unused mode bit on the file when we perform this action, so it doesn't need to be tracked in a shared database. I've verified that the chmods can be performed over a FreeBSD mount of the NFS server. AFAICT from the FreeBSD docs and man pages, the sticky bit would be safe to use for this, and has no hidden side effects for a non-directory; in this case, the sgid or suid bits should also be OK to use given that the file is non-executable. However, I have a nagging memory that there have been some Unices where the sticky bit did various poorly-documented implementation- specific "magic" things on regular files, e.g. causing them to be hardwired into the buffer cache, or locked out of the buffer cache. Can anybody confirm for me that the suid, sgid, and sticky bit are in fact no-ops for FreeBSD on regular non-executable files, as it appears they should be? -- Clifton -- Clifton Royston -- cliftonr@tikitechnologies.com Tiki Technologies Lead Programmer/Software Architect Did you ever fly a kite in bed? Did you ever walk with ten cats on your head? Did you ever milk this kind of cow? Well we can do it. We know how. If you never did, you should. These things are fun, and fun is good. -- Dr. Seuss