diff options
-rw-r--r-- | bin/chmod/chmod.1 | 9 | ||||
-rw-r--r-- | bin/chmod/chmod.c | 11 | ||||
-rw-r--r-- | usr.sbin/chown/chgrp.1 | 9 | ||||
-rw-r--r-- | usr.sbin/chown/chown.8 | 10 | ||||
-rw-r--r-- | usr.sbin/chown/chown.c | 14 |
5 files changed, 47 insertions, 6 deletions
diff --git a/bin/chmod/chmod.1 b/bin/chmod/chmod.1 index 9726006..4fbf255 100644 --- a/bin/chmod/chmod.1 +++ b/bin/chmod/chmod.1 @@ -47,6 +47,7 @@ .Fl f .Fl R .Op Fl H | Fl L | Fl P +.Fl v .Oc .Ar mode .Ar file ... @@ -80,6 +81,10 @@ instead of just the files themselves. Do not display a diagnostic message if .Nm could not modify the mode for +.It Fl v +Cause +.Nm +to be verbose, showing files as the mode is modified. .Va file . .El .Pp @@ -307,6 +312,10 @@ set the group bits equal to the user bits, but clear the group write bit. There's no .Ar perm option for the naughty bits. +.Sh COMPATIBILITY +The +.Fl v +option is non-standard and its use in scripts is not recommended. .Sh SEE ALSO .Xr chflags 1 , .Xr install 1 , diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c index 21841c6..4c06407 100644 --- a/bin/chmod/chmod.c +++ b/bin/chmod/chmod.c @@ -70,12 +70,13 @@ main(argc, argv) long val; int oct, omode; int Hflag, Lflag, Pflag, Rflag, ch, fflag, fts_options, hflag, rval; + int vflag; char *ep, *mode; set = NULL; omode = 0; Hflag = Lflag = Pflag = Rflag = fflag = hflag = 0; - while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != -1) + while ((ch = getopt(argc, argv, "HLPRXfgorstuvwx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -118,6 +119,9 @@ main(argc, argv) argv[optind - 1][2] == '\0') --optind; goto done; + case 'v': + vflag = 1; + break; case '?': default: usage(); @@ -191,6 +195,9 @@ done: argv += optind; getmode(set, p->fts_statp->st_mode)) && !fflag) { warn(p->fts_path); rval = 1; + } else { + if (vflag) + (void)printf("%s\n", p->fts_accpath); } } if (errno) @@ -203,6 +210,6 @@ void usage() { (void)fprintf(stderr, - "usage: chmod [-f -R [-H | -L | -P]] mode file ...\n"); + "usage: chmod [-f -R [-H | -L | -P] -v] mode file ...\n"); exit(1); } diff --git a/usr.sbin/chown/chgrp.1 b/usr.sbin/chown/chgrp.1 index bbba069..6852092 100644 --- a/usr.sbin/chown/chgrp.1 +++ b/usr.sbin/chown/chgrp.1 @@ -49,6 +49,7 @@ .Oc .Op Fl f .Op Fl h +.Op Fl v .Ar group .Ar .Sh DESCRIPTION @@ -84,6 +85,10 @@ query about strange modes (unless the user does not have proper permissions). .It Fl h If the file is a symbolic link, the group ID of the link itself is changed rather than the file that is pointed to. +.It Fl v +Cause +.Nm +to be verbose, showing files as the group is modified. .El .Pp The @@ -114,6 +119,10 @@ The utility exits 0 on success, and >0 if an error occurs. .Sh COMPATIBILITY In previous versions of this system, symbolic links did not have groups. +.Pp +The +.Fl v +option is non-standard and its use in scripts is not recommended. .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group diff --git a/usr.sbin/chown/chown.8 b/usr.sbin/chown/chown.8 index 4081e2b..143c774 100644 --- a/usr.sbin/chown/chown.8 +++ b/usr.sbin/chown/chown.8 @@ -46,6 +46,7 @@ .Oc .Op Fl f .Op Fl h +.Op Fl v .Ar owner Ns Op Ar :group .Ar file ... .Nm chown @@ -55,6 +56,7 @@ .Oc .Op Fl f .Op Fl h +.Op Fl v .Ar :group .Ar .Sh DESCRIPTION @@ -85,6 +87,10 @@ the exit status to reflect such failures. .It Fl h If the file is a symbolic link, change the user ID and/or the group ID of the link itself rather than the file that the link points to. +.It Fl v +Cause +.Nm +to be verbose, showing files as the owner is modified. .El .Pp The @@ -133,6 +139,10 @@ group names may contain the dot character. .Pp On previous versions of this system, symbolic links did not have owners. +.Pp +The +.Fl v +option is non-standard and its use in scripts is not recommended. .Sh SEE ALSO .Xr chgrp 1 , .Xr find 1 , diff --git a/usr.sbin/chown/chown.c b/usr.sbin/chown/chown.c index e414416..4e7fea5 100644 --- a/usr.sbin/chown/chown.c +++ b/usr.sbin/chown/chown.c @@ -69,7 +69,7 @@ void usage __P((void)); uid_t uid; gid_t gid; -int Rflag, ischown, fflag, hflag; +int Rflag, ischown, fflag, hflag, vflag; char *gname, *myname; int @@ -183,11 +183,17 @@ main(argc, argv) if (lchown(p->fts_accpath, uid, gid) && !fflag) { chownerr(p->fts_path); rval = 1; + } else { + if (vflag) + (void)printf("%s\n", p->fts_accpath); } } else { if (chown(p->fts_accpath, uid, gid) && !fflag) { chownerr(p->fts_path); rval = 1; + } else { + if (vflag) + (void)printf("%s\n", p->fts_accpath); } } } @@ -266,8 +272,8 @@ void usage() { (void)fprintf(stderr, "%s\n%s\n%s\n", - "usage: chown [-R [-H | -L | -P]] [-f] [-h] owner[:group] file ...", - " chown [-R [-H | -L | -P]] [-f] [-h] :group file ...", - " chgrp [-R [-H | -L | -P]] [-f] [-h] group file ..."); + "usage: chown [-R [-H | -L | -P]] [-f] [-h] [-v] owner[:group] file ...", + " chown [-R [-H | -L | -P]] [-f] [-h] [-v] :group file ...", + " chgrp [-R [-H | -L | -P]] [-f] [-h] [-v] group file ..."); exit(1); } |