svn commit: r362634 - head/lib/libutil

David Bright dab at FreeBSD.org
Thu Jun 25 21:34:44 UTC 2020


Author: dab
Date: Thu Jun 25 21:34:43 2020
New Revision: 362634
URL: https://svnweb.freebsd.org/changeset/base/362634

Log:
  Add CAP_EVENT to pidfiles.
  
  CAP_EVENT was omitted on pidfiles (in
  pidfile_open()). There seems no reason why a process that creates
  and writes a pidfile cannot monitor events on that file. This mod adds
  the capability.
  
  Reviewed by:	cem@
  MFC after:	2 weeks
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D25363

Modified:
  head/lib/libutil/pidfile.c

Modified: head/lib/libutil/pidfile.c
==============================================================================
--- head/lib/libutil/pidfile.c	Thu Jun 25 20:43:21 2020	(r362633)
+++ head/lib/libutil/pidfile.c	Thu Jun 25 21:34:43 2020	(r362634)
@@ -196,7 +196,7 @@ pidfile_open(const char *pathp, mode_t mode, pid_t *pi
 	}
 
 	if (cap_rights_limit(fd, cap_rights_init(&caprights, CAP_PWRITE,
-	    CAP_FSTAT, CAP_FTRUNCATE)) < 0 &&
+	    CAP_FSTAT, CAP_FTRUNCATE, CAP_EVENT)) < 0 &&
 	    errno != ENOSYS) {
 		goto failed;
 	}


More information about the svn-src-all mailing list