summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2024-08-02 22:14:55 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2024-08-02 22:14:55 +0000
commit57ccfa2a3d0f6388a6bff4556bdbd6512c4f5efe (patch)
tree992798fa29b2391e75059e126f14772444f11dee
parentf7338a1dda63d06fb94419bbdab22399365bff45 (diff)
The {get,set}res[ug]id(2) family are in POSIX-2024's XSI option,
so adjust the #include visibility and update the manpage. ok millert@
-rw-r--r--include/unistd.h12
-rw-r--r--lib/libc/sys/setresuid.218
2 files changed, 17 insertions, 13 deletions
diff --git a/include/unistd.h b/include/unistd.h
index 04972072f96..4242ab01461 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.110 2024/08/02 01:53:21 guenther Exp $ */
+/* $OpenBSD: unistd.h,v 1.111 2024/08/02 22:14:54 guenther Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@@ -474,6 +474,12 @@ int unlinkat(int, const char *, int);
#if __POSIX_VISIBLE >= 202405 || __BSD_VISIBLE
int getentropy(void *, size_t);
#endif
+#if __XPG_VISIBLE >= 800 || __BSD_VISIBLE
+int getresgid(gid_t *, gid_t *, gid_t *);
+int getresuid(uid_t *, uid_t *, uid_t *);
+int setresgid(gid_t, gid_t, gid_t);
+int setresuid(uid_t, uid_t, uid_t);
+#endif
#if __BSD_VISIBLE
int dup3(int, int, int);
@@ -492,8 +498,6 @@ int getdomainname(char *, size_t)
int getdtablecount(void);
int getgrouplist(const char *, gid_t, gid_t *, int *);
mode_t getmode(const void *, mode_t);
-int getresgid(gid_t *, gid_t *, gid_t *);
-int getresuid(uid_t *, uid_t *, uid_t *);
pid_t getthrid(void);
int getthrname(pid_t, char *, size_t);
char *getusershell(void);
@@ -523,8 +527,6 @@ int sethostname(const char *, size_t);
int setlogin(const char *);
void *setmode(const char *);
int setpgrp(pid_t _pid, pid_t _pgrp); /* BSD compat version */
-int setresgid(gid_t, gid_t, gid_t);
-int setresuid(uid_t, uid_t, uid_t);
int setthrname(pid_t, const char *);
void setusershell(void);
int strtofflags(char **, u_int32_t *, u_int32_t *);
diff --git a/lib/libc/sys/setresuid.2 b/lib/libc/sys/setresuid.2
index 7268f77caaf..43e2dde19df 100644
--- a/lib/libc/sys/setresuid.2
+++ b/lib/libc/sys/setresuid.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: setresuid.2,v 1.9 2015/09/10 17:55:21 schwarze Exp $
+.\" $OpenBSD: setresuid.2,v 1.10 2024/08/02 22:14:54 guenther Exp $
.\"
.\" Copyright (c) 2000
.\" Sheldon Hearn. All rights reserved.
@@ -21,7 +21,7 @@
.\"
.\" $FreeBSD: src/lib/libc/sys/setresuid.2,v 1.12 2001/10/01 16:09:02 ru Exp $
.\"
-.Dd $Mdocdate: September 10 2015 $
+.Dd $Mdocdate: August 2 2024 $
.Dt SETRESUID 2
.Os
.Sh NAME
@@ -31,7 +31,6 @@
.Nm setresuid
.Nd get or set real, effective and saved user or group ID
.Sh SYNOPSIS
-.In sys/types.h
.In unistd.h
.Ft int
.Fn getresgid "gid_t *rgid" "gid_t *egid" "gid_t *sgid"
@@ -89,10 +88,13 @@ was invalid.
.Xr setreuid 2 ,
.Xr setuid 2
.Sh STANDARDS
-These functions are not part of the
-.St -p1003.1
-specification.
-While they are not completely portable, they are the least ambiguous way to
-manage user and group IDs.
+The
+.Fn getresgid ,
+.Fn getresuid ,
+.Fn setresgid ,
+and
+.Fn setresuid
+functions conform to the X/Open System Interfaces option of
+.St -p1003.1-2024 .
.Sh HISTORY
These functions first appeared in HP-UX.