summaryrefslogtreecommitdiffstats
path: root/sys/sys/stat.h
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1997-06-02 06:24:52 +0000
committerjulian <julian@FreeBSD.org>1997-06-02 06:24:52 +0000
commit68081e32bccab743c4962c5ca40d1acef554a858 (patch)
treec88072dbc126f0bd1bc7114bc5797aff4b4fa2bb /sys/sys/stat.h
parent18750f03542b6c804f678f3b4fc1d4b4405fa79a (diff)
downloadFreeBSD-src-68081e32bccab743c4962c5ca40d1acef554a858.zip
FreeBSD-src-68081e32bccab743c4962c5ca40d1acef554a858.tar.gz
Submitted by: Whistle Communications (archie Cobbs)
These changes add the ability to specify that a UFS file/directory cannot be unlinked. This is basically a scaled back version of the IMMUTABLE flag. The reason is to allow an administrator to create a directory hierarchy that a group of users can arbitrarily add/delete files from, but that the hierarchy itself is safe from removal by them. If the NOUNLINK definition is set to 0 then this results in no change to what happens normally. (and results in identical binary (in the kernel)). It can be proven that if this bit is never set by the admin, no new behaviour is introduced.. Several "good idea" comments from reviewers plus one grumble about creeping featurism. This code is in production in 2.2 based systems
Diffstat (limited to 'sys/sys/stat.h')
-rw-r--r--sys/sys/stat.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index e017fd0..fb15604 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)stat.h 8.12 (Berkeley) 6/16/95
- * $Id: stat.h,v 1.11 1997/02/22 09:45:58 peter Exp $
+ * $Id: stat.h,v 1.12 1997/04/09 16:32:23 bde Exp $
*/
#ifndef _SYS_STAT_H_
@@ -175,6 +175,7 @@ struct stat {
#define UF_IMMUTABLE 0x00000002 /* file may not be changed */
#define UF_APPEND 0x00000004 /* writes to file may only append */
#define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */
+#define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */
/*
* Super-user changeable flags.
*/
@@ -182,6 +183,7 @@ struct stat {
#define SF_ARCHIVED 0x00010000 /* file is archived */
#define SF_IMMUTABLE 0x00020000 /* file may not be changed */
#define SF_APPEND 0x00040000 /* writes to file may only append */
+#define SF_NOUNLINK 0x00100000 /* file may not be removed or renamed */
#ifdef KERNEL
/*
@@ -190,6 +192,7 @@ struct stat {
#define OPAQUE (UF_OPAQUE)
#define APPEND (UF_APPEND | SF_APPEND)
#define IMMUTABLE (UF_IMMUTABLE | SF_IMMUTABLE)
+#define NOUNLINK (UF_NOUNLINK | SF_NOUNLINK)
#endif
#endif /* !_POSIX_SOURCE */
OpenPOWER on IntegriCloud