aboutsummaryrefslogtreecommitdiff
path: root/telem.c
diff options
context:
space:
mode:
authorYargo <yargo@circumlunar.space>2019-05-08 16:38:00 +0000
committerYargo <yargo@circumlunar.space>2019-05-08 16:38:00 +0000
commit91b12918a968c04de119d2193a966ca0f1ea1c9f (patch)
tree4f02a68711e479b5252c086475f7a2ceb23f64d7 /telem.c
parentRemove the last unimplemented feature, which was another gboard-ism we don't ... (diff)
add LICENSE and telem.c to repo
Diffstat (limited to '')
-rw-r--r--telem.c26
1 files changed, 26 insertions, 0 deletions
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 <pwd.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+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);
+ }
+}