aboutsummaryrefslogtreecommitdiff
path: root/telem.c
blob: a57a18984f8ee676b7d5daf7c31f29517115f7f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
	}
}