From e60d770734170e77ac2d3afd940b2ab06e48e3f5 Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Tue, 13 Jun 2023 08:21:15 -0300 Subject: librc: disallow user scripts as root Signed-off-by: Anna (navi) Figueiredo Gomes --- src/librc/librc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/librc/librc.c') diff --git a/src/librc/librc.c b/src/librc/librc.c index fa2df683..68d09156 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -369,6 +369,9 @@ rc_set_user(void) { char *path, *tmp; + if (getuid() == 0) + eerrorx("Attempted to run user scripts as root."); + setenv("RC_USER_SERVICES", "YES", 1); /* Setting the sysconf path to XDG_CONFIG_HOME, or ~/.config/, so subdirectories would go: -- cgit v1.2.3