diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-08-31 13:46:34 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-08-31 13:46:34 +0000 |
commit | c7953da22dea1ac96234f0a9682a307a74ae4e85 (patch) | |
tree | 4b87c37f36665d67febd487c793171e2c439fb80 | |
parent | 1a33a5c6d3d4c4713a89950470002f5f9ef11159 (diff) | |
download | cygnal-c7953da22dea1ac96234f0a9682a307a74ae4e85.tar.gz cygnal-c7953da22dea1ac96234f0a9682a307a74ae4e85.tar.bz2 cygnal-c7953da22dea1ac96234f0a9682a307a74ae4e85.zip |
* getfacl.c (usage): Add flags description.
(main): Print suid/sgid/vtx flags if available.
-rw-r--r-- | winsup/utils/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/utils/getfacl.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 6289c27f9..932972684 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * getfacl.c (usage): Add flags description. + (main): Print suid/sgid/vtx flags if available. + 2014-08-15 Corinna Vinschen <corinna@vinschen.de> * configure.ac: Convert to new AC_INIT style. diff --git a/winsup/utils/getfacl.c b/winsup/utils/getfacl.c index cbde4668a..ed1adfce7 100644 --- a/winsup/utils/getfacl.c +++ b/winsup/utils/getfacl.c @@ -1,6 +1,6 @@ /* getfacl.c - Copyright 2000, 2001, 2002, 2003, 2004, 2009, 2011 Red Hat Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2009, 2011, 2014 Red Hat Inc. Written by Corinna Vinschen <vinschen@redhat.com> @@ -87,13 +87,15 @@ usage (FILE * stream) "For directories getfacl displays additionally the default ACL.\n" "\n" "With no options specified, getfacl displays the filename, the\n" - "owner, the group, and both the ACL and the default ACL, if it\n" + "owner, the group, the setuid (s), setgid (s), and sticky (t)\n" + "bits if available, and both the ACL and the default ACL, if it\n" "exists.\n" "\n" "The format for ACL output is as follows:\n" " # file: filename\n" " # owner: name or uid\n" " # group: name or uid\n" + " # flags: sst\n" " user::perm\n" " user:name or uid:perm\n" " group::perm\n" @@ -196,6 +198,10 @@ main (int argc, char **argv) printf ("# owner: %s\n", username (st.st_uid)); printf ("# group: %s\n", groupname (st.st_gid)); } + if (st.st_mode & (S_ISUID | S_ISGID | S_ISVTX)) + printf ("# flags: %c%c%c\n", (st.st_mode & S_ISUID) ? 's' : '-', + (st.st_mode & S_ISGID) ? 's' : '-', + (st.st_mode & S_ISVTX) ? 't' : '-'); for (i = 0; i < num_acls; ++i) { if (acls[i].a_type & ACL_DEFAULT) |