summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-08-25 01:51:58 -0500
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-08-25 01:51:58 -0500
commit1e023da47a5d0248808e33fb5feac18df6df3585 (patch)
treee2b3064440ca9f0174561f84acb583d5c4b42697
parent0c9ea86d2e00ccb13d81ea0623927be86be3adf2 (diff)
downloadsegfault-1e023da47a5d0248808e33fb5feac18df6df3585.tar.gz
segfault-1e023da47a5d0248808e33fb5feac18df6df3585.zip
fixed shitty #define MYUSER
-rw-r--r--segfault.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/segfault.c b/segfault.c
index 389424c..5df074a 100644
--- a/segfault.c
+++ b/segfault.c
@@ -14,7 +14,7 @@
#define SERVER "127.0.0.1"
#define PORT "6667"
#define NICK "SegFault" //override with argv[0]
-#define MYUSER getenv("seguser")?getenv("seguser"):"segfault"
+#define MYUSER "segfault"
#define LINES_SENT_LIMIT 1
#define LINELEN 400
#define RAWLOG "./files/rawlog"
@@ -1133,7 +1133,8 @@ int main(int argc,char *argv[]) {
myuser->host="I_dunno";
printf("starting segfault...\n");
if(!getuid() || !geteuid()) {
- pwd=getpwnam(MYUSER);
+ s=getenv("seguser");
+ pwd=getpwnam(s?s:MYUSER);
if(!pwd) { printf("I'm running with euid or uid of 0 and I can't find myself."); return 0; }
setgroups(0,0);
setgid(pwd->pw_gid);