SCCS-vsn: sys/sys/stat.h 7.19
SCCS-vsn: lib/libc/sys/chflags.2 6.9
SCCS-vsn: sys/ufs/ffs/ufs_vnops.c 7.114
SCCS-vsn: sys/ufs/ufs/ufs_vnops.c 7.114
SCCS-vsn: bin/ls/stat_flags.c 5.2
-static char sccsid[] = "@(#)stat_flags.c 5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)stat_flags.c 5.2 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
string[0] = '\0';
prefix = NULL;
string[0] = '\0';
prefix = NULL;
- if (flags & ARCHIVED)
- SAPPEND("arch");
- if (flags & NODUMP)
- SAPPEND("nodump");
- if (flags & USR_IMMUTABLE)
- SAPPEND("uchg");
- if (flags & USR_APPEND)
- if (flags & SYS_IMMUTABLE)
- SAPPEND("schg");
- if (flags & SYS_APPEND)
+ if (flags & UF_IMMUTABLE)
+ SAPPEND("uchg");
+ if (flags & UF_NODUMP)
+ SAPPEND("nodump");
+ if (flags & SF_APPEND)
+ if (flags & SF_ARCHIVED)
+ SAPPEND("arch");
+ if (flags & SF_IMMUTABLE)
+ SAPPEND("schg");
return (prefix == NULL && def != NULL ? def : string);
}
return (prefix == NULL && def != NULL ? def : string);
}
}
switch (p[0]) {
case 'a':
}
switch (p[0]) {
case 'a':
- TEST(p, "arch", ARCHIVED);
- TEST(p, "archived", ARCHIVED);
+ TEST(p, "arch", SF_ARCHIVED);
+ TEST(p, "archived", SF_ARCHIVED);
return (1);
case 'd':
clear = !clear;
return (1);
case 'd':
clear = !clear;
- TEST(p, "dump", NODUMP);
+ TEST(p, "dump", UF_NODUMP);
- TEST(p, "sappnd", SYS_APPEND);
- TEST(p, "sappend", SYS_APPEND);
- TEST(p, "schg", SYS_IMMUTABLE);
- TEST(p, "schange", SYS_IMMUTABLE);
- TEST(p, "simmutable", SYS_IMMUTABLE);
+ TEST(p, "sappnd", SF_APPEND);
+ TEST(p, "sappend", SF_APPEND);
+ TEST(p, "schg", SF_IMMUTABLE);
+ TEST(p, "schange", SF_IMMUTABLE);
+ TEST(p, "simmutable", SF_IMMUTABLE);
- TEST(p, "uappnd", USR_APPEND);
- TEST(p, "uappend", USR_APPEND);
- TEST(p, "uchg", USR_IMMUTABLE);
- TEST(p, "uchange", USR_IMMUTABLE);
- TEST(p, "uimmutable", SYS_IMMUTABLE);
+ TEST(p, "uappnd", UF_APPEND);
+ TEST(p, "uappend", UF_APPEND);
+ TEST(p, "uchg", UF_IMMUTABLE);
+ TEST(p, "uchange", UF_IMMUTABLE);
+ TEST(p, "uimmutable", UF_IMMUTABLE);
/* FALLTHROUGH */
default:
return (1);
/* FALLTHROUGH */
default:
return (1);
.\"
.\" %sccs.include.redist.roff%
.\"
.\"
.\" %sccs.include.redist.roff%
.\"
-.\" @(#)chflags.2 6.8 (Berkeley) %G%
+.\" @(#)chflags.2 6.9 (Berkeley) %G%
.Em or Ns 'ing
the following values
.Pp
.Em or Ns 'ing
the following values
.Pp
-.Bl -tag -width "SYS_IMMUTABLE" -compact -offset indent
-.It NODUMP
+.Bl -tag -width "SF_IMMUTABLE" -compact -offset indent
+.It UF_NODUMP
The file may not be changed.
The file may not be changed.
The file may only be appended to.
.\".It ARCHIVED
.\"File is archived.
The file may only be appended to.
.\".It ARCHIVED
.\"File is archived.
The file may not be changed.
The file may not be changed.
The file may only be appended to.
.El
.Pp
The
The file may only be appended to.
.El
.Pp
The
flags may be set or unset by either the owner of a file or the super-user.
.Pp
The
flags may be set or unset by either the owner of a file or the super-user.
.Pp
The
flags may only be set or unset by the super-user.
They may be set at any time, but normally may only be unset when
the system is in single-user mode.
flags may only be set or unset by the super-user.
They may be set at any time, but normally may only be unset when
the system is in single-user mode.
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)stat.h 7.18 (Berkeley) %G%
+ * @(#)stat.h 7.19 (Berkeley) %G%
*
* Low 16-bits: super-user and owner settable.
*/
*
* Low 16-bits: super-user and owner settable.
*/
-#define NODUMP 0x00000001 /* do not dump file */
-#define USR_IMMUTABLE 0x00000002 /* file may not be changed */
-#define USR_APPEND 0x00000004 /* writes to file may only append */
+#define UF_NODUMP 0x00000001 /* do not dump file */
+#define UF_IMMUTABLE 0x00000002 /* file may not be changed */
+#define UF_APPEND 0x00000004 /* writes to file may only append */
/*
* High 16-bits: super-user settable.
*/
/*
* High 16-bits: super-user settable.
*/
-#define ARCHIVED 0x00010000 /* file is archived */
-#define SYS_IMMUTABLE 0x00020000 /* file may not be changed */
-#define SYS_APPEND 0x00040000 /* writes to file may only append */
+#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 */
+
+#ifdef KERNEL
/*
* Shorthand abbreviations of above.
*/
/*
* Shorthand abbreviations of above.
*/
-#define IMMUTABLE (USR_IMMUTABLE | SYS_IMMUTABLE)
-#define APPEND (USR_APPEND | SYS_APPEND)
+#define APPEND (UF_APPEND | SF_APPEND)
+#define IMMUTABLE (UF_IMMUTABLE | SF_IMMUTABLE)
+#endif
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_vnops.c 7.113 (Berkeley) %G%
+ * @(#)ufs_vnops.c 7.114 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
(error = suser(cred, &p->p_acflag)))
return (error);
if (cred->cr_uid == 0) {
(error = suser(cred, &p->p_acflag)))
return (error);
if (cred->cr_uid == 0) {
- if ((ip->i_flags & (SYS_IMMUTABLE | SYS_APPEND)) &&
+ if ((ip->i_flags & (SF_IMMUTABLE | SF_APPEND)) &&
securelevel > 0)
return (EPERM);
ip->i_flags = vap->va_flags;
} else {
securelevel > 0)
return (EPERM);
ip->i_flags = vap->va_flags;
} else {
- if (ip->i_flags & (SYS_IMMUTABLE | SYS_APPEND))
+ if (ip->i_flags & (SF_IMMUTABLE | SF_APPEND))
return (EPERM);
ip->i_flags &= 0xffff0000;
ip->i_flags |= (vap->va_flags & 0xffff);
return (EPERM);
ip->i_flags &= 0xffff0000;
ip->i_flags |= (vap->va_flags & 0xffff);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_vnops.c 7.113 (Berkeley) %G%
+ * @(#)ufs_vnops.c 7.114 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
(error = suser(cred, &p->p_acflag)))
return (error);
if (cred->cr_uid == 0) {
(error = suser(cred, &p->p_acflag)))
return (error);
if (cred->cr_uid == 0) {
- if ((ip->i_flags & (SYS_IMMUTABLE | SYS_APPEND)) &&
+ if ((ip->i_flags & (SF_IMMUTABLE | SF_APPEND)) &&
securelevel > 0)
return (EPERM);
ip->i_flags = vap->va_flags;
} else {
securelevel > 0)
return (EPERM);
ip->i_flags = vap->va_flags;
} else {
- if (ip->i_flags & (SYS_IMMUTABLE | SYS_APPEND))
+ if (ip->i_flags & (SF_IMMUTABLE | SF_APPEND))
return (EPERM);
ip->i_flags &= 0xffff0000;
ip->i_flags |= (vap->va_flags & 0xffff);
return (EPERM);
ip->i_flags &= 0xffff0000;
ip->i_flags |= (vap->va_flags & 0xffff);