git: f04e79a28a14 - stable/15 - Add CAP_PDDUPFD capability

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a812497.44493.73e83fe__19336.5086380922$1786848615$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=f04e79a28a14ddae9bf1781432a020ef3466d236

commit f04e79a28a14ddae9bf1781432a020ef3466d236
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-05-21 19:12:22 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-08-16 02:41:26 +0000

    Add CAP_PDDUPFD capability
    
    (cherry picked from commit 046a4efe78addafcd4810974d6c71c1cdd591b6b)
---
 sys/kern/subr_capability.c | 1 +
 sys/sys/caprights.h        | 1 +
 sys/sys/capsicum.h         | 6 ++++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sys/kern/subr_capability.c b/sys/kern/subr_capability.c
index 6e23525186ea..55d6225fd67a 100644
--- a/sys/kern/subr_capability.c
+++ b/sys/kern/subr_capability.c
@@ -88,6 +88,7 @@ const cap_rights_t cap_mmap_rights = CAP_RIGHTS_INITIALIZER(CAP_MMAP);
 const cap_rights_t cap_mkdirat_rights = CAP_RIGHTS_INITIALIZER(CAP_MKDIRAT);
 const cap_rights_t cap_mkfifoat_rights = CAP_RIGHTS_INITIALIZER(CAP_MKFIFOAT);
 const cap_rights_t cap_mknodat_rights = CAP_RIGHTS_INITIALIZER(CAP_MKNODAT);
+const cap_rights_t cap_pddupfd_rights = CAP_RIGHTS_INITIALIZER(CAP_PDDUPFD);
 const cap_rights_t cap_pdgetpid_rights = CAP_RIGHTS_INITIALIZER(CAP_PDGETPID);
 const cap_rights_t cap_pdkill_rights = CAP_RIGHTS_INITIALIZER(CAP_PDKILL);
 const cap_rights_t cap_pdwait_rights = CAP_RIGHTS_INITIALIZER(CAP_PDWAIT);
diff --git a/sys/sys/caprights.h b/sys/sys/caprights.h
index 904d9b4e843a..296fac3b6231 100644
--- a/sys/sys/caprights.h
+++ b/sys/sys/caprights.h
@@ -90,6 +90,7 @@ extern const cap_rights_t cap_mkfifoat_rights;
 extern const cap_rights_t cap_mknodat_rights;
 extern const cap_rights_t cap_mmap_rights;
 extern const cap_rights_t cap_no_rights;
+extern const cap_rights_t cap_pddupfd_rights;
 extern const cap_rights_t cap_pdgetpid_rights;
 extern const cap_rights_t cap_pdkill_rights;
 extern const cap_rights_t cap_pdwait_rights;
diff --git a/sys/sys/capsicum.h b/sys/sys/capsicum.h
index 803804a38734..aa3f2f1bccdf 100644
--- a/sys/sys/capsicum.h
+++ b/sys/sys/capsicum.h
@@ -296,7 +296,9 @@
 #define	CAP_INOTIFY_ADD		CAPRIGHT(1, 0x0000000000200000ULL)
 #define	CAP_INOTIFY_RM		CAPRIGHT(1, 0x0000000000400000ULL)
 
-#define	CAP_UNUSED1_24		CAPRIGHT(1, 0x0000000000800000ULL)
+/* Allows pddupfd(2). */
+#define	CAP_PDDUPFD		CAPRIGHT(1, 0x0000000000800000ULL)
+
 #define	CAP_UNUSED1_25		CAPRIGHT(1, 0x0000000001000000ULL)
 #define	CAP_UNUSED1_26		CAPRIGHT(1, 0x0000000002000000ULL)
 #define	CAP_UNUSED1_27		CAPRIGHT(1, 0x0000000004000000ULL)
@@ -332,7 +334,7 @@
 #define	CAP_UNUSED1_57		CAPRIGHT(1, 0x0100000000000000ULL)
 
 /* All used bits for index 1. */
-#define	CAP_ALL1		CAPRIGHT(1, 0x00000000007FFFFFULL)
+#define	CAP_ALL1		CAPRIGHT(1, 0x0000000000FFFFFFULL)
 
 /* Backward compatibility. */
 #define	CAP_POLL_EVENT		CAP_EVENT
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.