Sticky/sgid/suid bits safe on regular files?

From: Clifton Royston (cliftonr_at_lava.net)
Date: 06/17/04

  • Next message: Cyrille Lefevre: "Re: why timeradd() and co are hidden from the kernel space ?"
    Date: Thu, 17 Jun 2004 10:55:49 -1000
    To: hackers@freebsd.org
    
    

      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
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Cyrille Lefevre: "Re: why timeradd() and co are hidden from the kernel space ?"

    Relevant Pages

    • FreeBSD as large NFS Server w/LDAP
      ... I expect the FreeBSD NFS implementation to be at least as good as RedHat's, ... Is FreeBSD 4.x in a NFS Server role going to be able to utilize the dual HT ... Is it possible to expand the filesystems 'on the fly' or ... I expect to increase the SAN volumes from within the SAN config, ...
      (comp.unix.bsd.freebsd.misc)
    • [FreeBSD-Announce] FreeBSD Errata Notice FreeBSD-EN-07:01.nfs
      ... For general information regarding FreeBSD Errata Notices and Security ... the NFS server subsystem can cause a system ... # fetch http://security.FreeBSD.org/patches/EN-07:01/nfs60.patch.asc ...
      (freebsd-announce)
    • Re: FreeBSD vs Solaris 10
      ... > particularly as an NFS server. ... Since we have replaced our Solaris box ... > Linux or FreeBSD, it is really a wonderful OS, and coupled with the cheap ... FreeBSD NFS performance and reliability far exceeds that of Linux. ...
      (comp.unix.bsd.freebsd.misc)
    • NFS with ipfw
      ... I've a NFS server running FreeBSD 6-Stable. ... On every server I've install ipfw and iptable. ...
      (freebsd-questions)