What does 'plus' in ls -Z mean?

Stephen Smalley sds at epoch.ncsc.mil
Mon Jun 7 12:52:29 UTC 2004


On Mon, 2004-06-07 at 08:36, Russell Coker wrote:
> >From the SE Linux patch to ls.c:
> +    modebuf[10] = (FILE_HAS_ACL (f) ? '+' : ' ');

That is copied from the corresponding code for computing the mode string
in print_long_format.  In turn, FILE_HAS_ACL is based on the f->have_acl
flag.  But f->have_acl is only assigned a value if format == long_format
in gobble_file().  Hence, the flag is not getting initialized properly
for the security_format.  Patch below should fix.

--- ls.c.old	2004-06-07 08:51:24.000000000 -0400
+++ ls.c	2004-06-07 08:51:34.000000000 -0400
@@ -2528,7 +2528,7 @@
 	}
 
 #if HAVE_ACL || USE_ACL
-      if (format == long_format)
+      if (format == long_format || format == security_format)
 	{
 	  int n = file_has_acl (path, &f->stat);
 	  f->have_acl = (0 < n);

-- 
Stephen Smalley <sds at epoch.ncsc.mil>
National Security Agency




More information about the fedora-selinux-list mailing list