From 5469d5ec00f9e5cb88af9414ea9448b2e4b15c98 Mon Sep 17 00:00:00 2001 From: Petar Kapris Date: Sat, 2 Jan 2021 20:54:17 +0100 Subject: [PATCH] Remove getusr function This function was only used to check if the special case for ssh ended up properly, since it's not a special case anymore, the function isn't called anywhere, and has been removed. --- timeoutd.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/timeoutd.c b/timeoutd.c index 6f2ba4c..108df30 100644 --- a/timeoutd.c +++ b/timeoutd.c @@ -96,7 +96,6 @@ void logoff_msg(); void killit(); int chk_xsession(); /* seppy: is it a X-Session? */ void killit_xsession(); /* seppy: kill the X-Session */ -char *getusr(pid_t pid); /*seppy: get the owner of a running process */ void segfault(); /* seppy: catch segfault and log them */ int chk_xterm(); /* seppy: is it a xterm? */ @@ -1129,24 +1128,6 @@ char *host, *user; #endif } - - -char *getusr(pid) /*seppy; returns the name of the user owning process with the Process ID pid */ -pid_t pid; -{ - char uid[99]; - sprintf(path, "/proc/%d/status", pid); - proc_file = fopen(path, "r"); - if (!proc_file) { - syslog(LOG_NOTICE, "getusr(): PID %d does not exist. Ignoring.", pid); - return "unknown"; - } - while (!fscanf(proc_file, "Uid: %s", uid)) - fgets(uid, 98, proc_file); - fclose(proc_file); - return getpwuid(atoi(uid))->pw_name; -} - #ifdef TIMEOUTDX11 Time get_xidle(user, display) /*seppy; returns millicecs since last input event */ char *user;