summaryrefslogtreecommitdiff
path: root/.local/bin/autobuild.c
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/autobuild.c')
-rw-r--r--.local/bin/autobuild.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/.local/bin/autobuild.c b/.local/bin/autobuild.c
index 48ff48d..c8a319d 100644
--- a/.local/bin/autobuild.c
+++ b/.local/bin/autobuild.c
@@ -37,8 +37,13 @@ mysetenv(const char *name, const char *value)
int
main(int argc, char **argv)
{
+ errno = 0;
struct passwd *user = getpwuid(geteuid());
- setreuid(geteuid(), -1);
+ if (!user)
+ error(127, errno, "could not look up effective user (%ld) info", (long)geteuid());
+
+ if (setreuid(geteuid(), -1) < 0)
+ error(127, errno, "could not set real UID to match effective UID (%ld)", (long)geteuid());
const char *env_term = getenv("TERM");
const char *env_lang = getenv("LANG");