@ -184,97 +184,130 @@ int main (int argc, char *argv[])
boolctrl_down=false;
boolalt_down=false;
boolhide_event=false;
boolestablished=false;
booltestrun=false;
// Create the output pipe
PipeHandlercontrolpipe;
if((getuid())!=0){
printf("You are not root! This WILL NOT WORK!\nDO NOT attempt to bypass security restrictions, e.g. by changing keyboard permissions or owner, if you want the SAK system to remain secure...\n");
fprintf(stderr,"Unable to open /dev/uinput or /dev/misc/uinput (char device 10:223).\nPossible causes: Device node inexistent or kernel not compiled with evdev user level driver support or permission denied.\n");
fprintf(stderr,"Unable to create input device with UI_DEV_CREATE\n");
return2;
}
else{
fprintf(stderr,"Device created.\n");
}
if(ioctl(fd,EVIOCGRAB,2)<0){
close(fd);
fprintf(stderr,"Failed to grab exclusive input device lock");
return1;
}
// Create the output pipe
PipeHandlercontrolpipe;
while(1){
if((rd=read(fd,ev,size*2))<size){
fprintf(stderr,"Read failed.\n");
return1;
if((getuid())!=0){
printf("You are not root! This WILL NOT WORK!\nDO NOT attempt to bypass security restrictions, e.g. by changing keyboard permissions or owner, if you want the SAK system to remain secure...\n");
return5;
}
value=ev[0].value;
if(value!=''&&ev[1].value==0&&ev[1].type==1){// Read the key release event
fprintf(stderr,"Unable to open /dev/uinput or /dev/misc/uinput (char device 10:223).\nPossible causes: Device node inexistent or kernel not compiled with evdev user level driver support or permission denied.\n");