Bug 191884

Summary: [PATCH] teach chown and chmod about SIGINFO
Product: Base System Reporter: Dan McGregor <dan.mcgregor>
Component: binAssignee: Conrad Meyer <cem>
Status: Closed FIXED    
Severity: Affects Some People CC: bdrewery, cem, mjg
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to add siginfo support to chmod and chgrp.
none
chmod patch with updated makefile
none
chown patch with updated manage none

Description Dan McGregor 2014-07-15 18:45:57 UTC
Created attachment 144693 [details]
Patch to add siginfo support to chmod and chgrp.

This is a patch that adds support for the SIGINFO to chmod and chown. Its output is just like the output that would have been shown if -v were specified.

New output:

shadrach:/usr/src% chown -R dan:wsrc *

load: 0.18  cmd: chown 32763 [zio->io_cv] 0.73r 0.00u 0.03s 0% 1816k
cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c: 1001:999 -> 1001:980
load: 0.17  cmd: chown 32763 [zio->io_cv] 4.16r 0.02u 0.15s 1% 1880k
contrib/libarchive/cpio/cpio.c: 1001:980 -> 1001:980
load: 0.15  cmd: chown 32763 [zio->io_cv] 7.07r 0.02u 0.28s 2% 1880k
crypto/heimdal/appl/ftp/common/Makefile.in: 1001:980 -> 1001:980

shadrach:/usr/src% chmod -R g+rw *

load: 0.16  cmd: chmod 32805 [running] 1.10r 0.06u 0.99s 10% 1772k
sys/contrib/ngatm/netnatm/api/ccatm.h: 0100644 [-rw-r--r-- ] -> 0100664 [-rw-rw-r-- ]
Comment 1 Mateusz Guzik freebsd_committer freebsd_triage 2014-07-15 19:37:36 UTC
I have only small nits to add.

for both tools:
- no signal.h included
- manual pages not updated to reflect new functionality

chown:
- if (vflag) { verbose(p, vflag); } should loose braces
- 'verbose' is not the best name, maybe 'print_info'?

Patches for both utils should be attached separately.

Care to plug these problems?

Other than that looks good to me.
Comment 2 Dan McGregor 2014-07-15 21:59:05 UTC
I shall fix both problems later today.
Comment 3 Dan McGregor 2014-07-16 03:38:44 UTC
Created attachment 144710 [details]
chmod patch with updated makefile
Comment 4 Dan McGregor 2014-07-16 03:39:30 UTC
Created attachment 144711 [details]
chown patch with updated manage
Comment 5 Dan McGregor 2014-07-16 03:40:14 UTC
(In reply to Dan McGregor from comment #3)
> Created attachment 144710 [details]
> chmod patch with updated makefile

And apparently I don't proofread; that's updated man page not makefile.
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-01-08 06:51:10 UTC
A commit references this bug:

Author: cem
Date: Sun Jan  8 06:50:53 UTC 2017
New revision: 311668
URL: https://svnweb.freebsd.org/changeset/base/311668

Log:
  chmod: Add SIGINFO handler

  PR:		191884
  Submitted by:	Dan McGregor <dan.mcgregor at usask.ca>
  Reviewed by:	mjg@ (earlier version)

Changes:
  head/bin/chmod/chmod.1
  head/bin/chmod/chmod.c
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-01-08 06:59:18 UTC
A commit references this bug:

Author: cem
Date: Sun Jan  8 06:58:43 UTC 2017
New revision: 311669
URL: https://svnweb.freebsd.org/changeset/base/311669

Log:
  chown/chgrp: Add SIGINFO handler

  PR:		191884
  Submitted by:	Dan McGregor <dan.mcgregor at usask.ca>
  Reviewed by:	mjg@ (earlier version)

Changes:
  head/usr.sbin/chown/chgrp.1
  head/usr.sbin/chown/chown.8
  head/usr.sbin/chown/chown.c
Comment 8 Conrad Meyer freebsd_committer freebsd_triage 2017-01-08 06:59:38 UTC
Thanks, committed!
Comment 9 Bryan Drewery freebsd_committer freebsd_triage 2018-03-07 01:57:06 UTC
FYI I've just added the same support to chflags.