From 8fce80df332eaa743fad6e587127715320b3e7c8 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Sat, 2 Dec 2017 12:58:06 -0300 Subject: [PATCH] add uid to the thing --- rsudo.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rsudo.c b/rsudo.c index dbb5a44..074f570 100644 --- a/rsudo.c +++ b/rsudo.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "log.h" @@ -114,6 +115,15 @@ int main(int argc, char **argv) if(i != argc - 1) tot = join(tot, " "); } + // convert uid to string + int uid = getuid(); + char uid_str[6]; + + sprintf(uid_str, "%d", uid); + + tot = join(tot, ","); + tot = join(tot, uid_str); + printf("sending command: %s\n", tot); // encode our data