From 91b12918a968c04de119d2193a966ca0f1ea1c9f Mon Sep 17 00:00:00 2001 From: Yargo Date: Wed, 8 May 2019 16:38:00 +0000 Subject: add LICENSE and telem.c to repo --- telem.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 telem.c (limited to 'telem.c') diff --git a/telem.c b/telem.c new file mode 100644 index 0000000..a57a189 --- /dev/null +++ b/telem.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +int main() { + struct passwd *pw; + uid_t uid; + char username[32]; + char command[128]; + + uid = getuid(); + pw = getpwuid(uid); + + if(strcmp(pw->pw_name, "krixano") == 0) { + printf("Sorry, krixano, no BBS for you!"); + exit(1); + } + + if (pw) { + strncpy(command, "/usr/bin/lua /usr/local/src/telem/telem.lua ", 127); + strncat(command, pw->pw_name, 127); + system(command); + } +} -- cgit v1.2.3