aboutsummaryrefslogblamecommitdiff
path: root/telem.c
blob: 19e6cc2e9a2e59121aa3e822bc952225d02dcdda (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                           





                                                                                      
#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 (pw) {
		strncpy(command, "/usr/bin/lua /usr/local/src/telem/telem.lua ", 127);
		strncat(command, pw->pw_name, 127);
		system(command);
	}
}