SETEUID(3P)

πŸ’– SETEUID πŸ’– (that's SETEUID(3P) bestie, from the POSIX Programmer's Manual, page 3P)

🌸 PROLOG 🌸

okay so real talk first: this page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” so if you're on Linux, go peek at the corresponding Linux manual page for the actual tea β˜•. Or honestly? The interface might just not be implemented on Linux at all. Vibe check accordingly. πŸ’€


✨ NAME ✨

seteuid β€” set effective user ID 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <unistd.h>

int seteuid(uid_t uid);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the deal, bestie. If uid is equal to the real user ID or the saved set-user-ID, or if the process has appropriate privileges, then seteuid() shall set the effective user ID of the calling process to uid. Periodt. πŸ’…

And the way that the real user ID and the saved set-user-ID just… stay unchanged? Iconic. They don't move. They're not involved. They said "not my business."

Also seteuid() shall not affect the supplementary group list in any way. Not even a little. Zero. Nada. It leaves that list completely alone πŸ™ˆ


⭐ RETURN VALUE ⭐

Slayed? You get 0 back. πŸ’–

Didn't slay? You get -1, and errno gets set to tell you what went wrong. 😭


πŸ”₯ ERRORS πŸ”₯

The seteuid() function shall fail if:

  • EINVAL β€” the value of the uid argument is invalid and is not supported by the implementation. Like… it's just not a thing here, bestie.
  • EPERM β€” the process does not have appropriate privileges and uid does not match the real user ID or the saved set-user-ID. So you tried it and the system said no πŸ’€

The following sections are informative. (Yes really, we're in the chill zone now 🌈)


🌸 EXAMPLES 🌸

None. That's it. That's the section. Moving on 🧚


πŸ’œ APPLICATION USAGE πŸ’œ

None. Also empty. We love a low-effort section, no cap.


πŸ‘‘ RATIONALE πŸ‘‘

Refer to the RATIONALE section in setuid(). Go read that one, it's got the lore πŸ“–βœ¨


🌈 FUTURE DIRECTIONS 🌈

None. The future is… unchanged. Very demure.


πŸ’… SEE ALSO πŸ’…

  • exec
  • getegid()
  • geteuid()
  • getgid()
  • getuid()
  • setegid()
  • setgid()
  • setregid()
  • setreuid()
  • setuid()

The Base Definitions volume of POSIX.1‐2017, <sys_types.h>, <unistd.h> πŸŽ€


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


okay that's the whole thing, every last detail, nothing skipped, we ate and left no crumbs πŸ“

IEEE/The Open Group, 2017 β€” SETEUID(3P) πŸ’– bye bestie, go set some effective user IDs responsibly 🫢✨

πŸ“¦ where this page comes from