diff options
| author | Julian Elischer <julian@FreeBSD.org> | 1997-06-02 06:24:52 +0000 | 
|---|---|---|
| committer | Julian Elischer <julian@FreeBSD.org> | 1997-06-02 06:24:52 +0000 | 
| commit | 50dab48a5b79db0d1d10e5d8a3527763cb1cae63 (patch) | |
| tree | 271fc558356e392a58d9249d3b3eba7d3ff6ffc1 /lib/libc | |
| parent | e4676ba603826ca933e03f6d4154cf8e1ea88c3c (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/gen/setflags.c | 10 | ||||
| -rw-r--r-- | lib/libc/gen/setflagsbyname.c | 10 | ||||
| -rw-r--r-- | lib/libc/gen/strtofflags.c | 10 | ||||
| -rw-r--r-- | lib/libc/sys/chflags.2 | 12 | 
4 files changed, 37 insertions, 5 deletions
| diff --git a/lib/libc/gen/setflags.c b/lib/libc/gen/setflags.c index f0092fed9c49..b1e70628e527 100644 --- a/lib/libc/gen/setflags.c +++ b/lib/libc/gen/setflags.c @@ -30,7 +30,7 @@   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF   * SUCH DAMAGE.   * - *	$Id$ + *	$Id: stat_flags.c,v 1.5 1997/02/22 14:04:02 peter Exp $   */  #ifndef lint @@ -69,6 +69,8 @@ flags_to_string(flags, def)  		SAPPEND("uappnd");  	if (flags & UF_IMMUTABLE)  		SAPPEND("uchg"); +	if (flags & UF_NOUNLINK) +		SAPPEND("uunlnk");  	if (flags & UF_NODUMP)  		SAPPEND("nodump");  	if (flags & UF_OPAQUE) @@ -79,6 +81,8 @@ flags_to_string(flags, def)  		SAPPEND("arch");  	if (flags & SF_IMMUTABLE)  		SAPPEND("schg"); +	if (flags & SF_NOUNLINK) +		SAPPEND("sunlnk");  	return (prefix == NULL && def != NULL ? def : string);  } @@ -139,6 +143,8 @@ string_to_flags(stringp, setp, clrp)  			TEST(p, "schg", SF_IMMUTABLE);  			TEST(p, "schange", SF_IMMUTABLE);  			TEST(p, "simmutable", SF_IMMUTABLE); +			TEST(p, "sunlnk", SF_NOUNLINK); +			TEST(p, "sunlink", SF_NOUNLINK);  			return (1);  		case 'u':  			TEST(p, "uappnd", UF_APPEND); @@ -146,6 +152,8 @@ string_to_flags(stringp, setp, clrp)  			TEST(p, "uchg", UF_IMMUTABLE);  			TEST(p, "uchange", UF_IMMUTABLE);  			TEST(p, "uimmutable", UF_IMMUTABLE); +			TEST(p, "uunlnk", UF_NOUNLINK); +			TEST(p, "uunlink", UF_NOUNLINK);  			/* FALLTHROUGH */  		default:  			return (1); diff --git a/lib/libc/gen/setflagsbyname.c b/lib/libc/gen/setflagsbyname.c index f0092fed9c49..b1e70628e527 100644 --- a/lib/libc/gen/setflagsbyname.c +++ b/lib/libc/gen/setflagsbyname.c @@ -30,7 +30,7 @@   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF   * SUCH DAMAGE.   * - *	$Id$ + *	$Id: stat_flags.c,v 1.5 1997/02/22 14:04:02 peter Exp $   */  #ifndef lint @@ -69,6 +69,8 @@ flags_to_string(flags, def)  		SAPPEND("uappnd");  	if (flags & UF_IMMUTABLE)  		SAPPEND("uchg"); +	if (flags & UF_NOUNLINK) +		SAPPEND("uunlnk");  	if (flags & UF_NODUMP)  		SAPPEND("nodump");  	if (flags & UF_OPAQUE) @@ -79,6 +81,8 @@ flags_to_string(flags, def)  		SAPPEND("arch");  	if (flags & SF_IMMUTABLE)  		SAPPEND("schg"); +	if (flags & SF_NOUNLINK) +		SAPPEND("sunlnk");  	return (prefix == NULL && def != NULL ? def : string);  } @@ -139,6 +143,8 @@ string_to_flags(stringp, setp, clrp)  			TEST(p, "schg", SF_IMMUTABLE);  			TEST(p, "schange", SF_IMMUTABLE);  			TEST(p, "simmutable", SF_IMMUTABLE); +			TEST(p, "sunlnk", SF_NOUNLINK); +			TEST(p, "sunlink", SF_NOUNLINK);  			return (1);  		case 'u':  			TEST(p, "uappnd", UF_APPEND); @@ -146,6 +152,8 @@ string_to_flags(stringp, setp, clrp)  			TEST(p, "uchg", UF_IMMUTABLE);  			TEST(p, "uchange", UF_IMMUTABLE);  			TEST(p, "uimmutable", UF_IMMUTABLE); +			TEST(p, "uunlnk", UF_NOUNLINK); +			TEST(p, "uunlink", UF_NOUNLINK);  			/* FALLTHROUGH */  		default:  			return (1); diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c index f0092fed9c49..b1e70628e527 100644 --- a/lib/libc/gen/strtofflags.c +++ b/lib/libc/gen/strtofflags.c @@ -30,7 +30,7 @@   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF   * SUCH DAMAGE.   * - *	$Id$ + *	$Id: stat_flags.c,v 1.5 1997/02/22 14:04:02 peter Exp $   */  #ifndef lint @@ -69,6 +69,8 @@ flags_to_string(flags, def)  		SAPPEND("uappnd");  	if (flags & UF_IMMUTABLE)  		SAPPEND("uchg"); +	if (flags & UF_NOUNLINK) +		SAPPEND("uunlnk");  	if (flags & UF_NODUMP)  		SAPPEND("nodump");  	if (flags & UF_OPAQUE) @@ -79,6 +81,8 @@ flags_to_string(flags, def)  		SAPPEND("arch");  	if (flags & SF_IMMUTABLE)  		SAPPEND("schg"); +	if (flags & SF_NOUNLINK) +		SAPPEND("sunlnk");  	return (prefix == NULL && def != NULL ? def : string);  } @@ -139,6 +143,8 @@ string_to_flags(stringp, setp, clrp)  			TEST(p, "schg", SF_IMMUTABLE);  			TEST(p, "schange", SF_IMMUTABLE);  			TEST(p, "simmutable", SF_IMMUTABLE); +			TEST(p, "sunlnk", SF_NOUNLINK); +			TEST(p, "sunlink", SF_NOUNLINK);  			return (1);  		case 'u':  			TEST(p, "uappnd", UF_APPEND); @@ -146,6 +152,8 @@ string_to_flags(stringp, setp, clrp)  			TEST(p, "uchg", UF_IMMUTABLE);  			TEST(p, "uchange", UF_IMMUTABLE);  			TEST(p, "uimmutable", UF_IMMUTABLE); +			TEST(p, "uunlnk", UF_NOUNLINK); +			TEST(p, "uunlink", UF_NOUNLINK);  			/* FALLTHROUGH */  		default:  			return (1); diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2 index 94b744ca9c80..3305b3a2aef5 100644 --- a/lib/libc/sys/chflags.2 +++ b/lib/libc/sys/chflags.2 @@ -65,6 +65,8 @@ Do not dump the file.  The file may not be changed.  .It UF_APPEND  The file may only be appended to. +.It UF_NOUNLINK +The file may not be renamed or deleted.  .It UF_OPAQUE  The directory is opaque when viewed through a union stack.  .\".It ARCHIVED @@ -73,18 +75,24 @@ The directory is opaque when viewed through a union stack.  The file may not be changed.  .It SF_APPEND  The file may only be appended to. +.It SF_NOUNLINK +The file may not be renamed or deleted.  .El  .Pp  The  .Dq UF_IMMUTABLE -and +,  .Dq UF_APPEND +and +.Dq UF_NOUNLINK  flags may be set or unset by either the owner of a file or the super-user.  .Pp  The  .Dq SF_IMMUTABLE -and +,  .Dq SF_APPEND +and +.Dq SF_NOUNLINK  flags may only be set or unset by the super-user.  Attempts by the non-super-user to set the super-user only flags  are silently ignored. | 
