Patreon Logo Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal Logo PayPal. You can also buy games using our partner links for GOG and Humble Store.
Latest Comments by Nevertheless
Get your terminal ready to hack the planet in Off Grid with a new trailer, confirmed for same-day Linux release
23 Apr 2018 at 4:41 pm UTC

Quoting: richmetson
Quoting: Nevertheless
Quoting: richmetson
Quoting: Nevertheless
Quoting: Eike
Quoting: Nevertheless
Quoting: richmetson
Quoting: NeverthelessDoes it support Kali Linux?
I can test that in a VM pretty easily to say if it throws errors or not, but I have no idea how much effort Kali devs put into supporting graphics cards!

Will let you know later down the line :P
But don't put too much efforts into it! :D
... as it was a joke. :)

Some young kewl haxors having watched a certain TV series want to run Steam on Kali - and don't have the abilities to make it work.
Of course it was! Gaming on Kali is like Rallye racing with farming machines. :)
Well there is an entire sport dedicated to that!
https://www.youtube.com/watch?v=9yHl24QynOM [External Link]

Lol yeah I figured it was a joke, but that it would be a funny gimmick to see if it ran, if nothing else to be able to say that it does! :P
You could integrate the game into a Kali live CD as a physical special edition. ;-)
lol and then name it after a classic 90's album in permanent marker ;P
:D There are fans for everything!

Get your terminal ready to hack the planet in Off Grid with a new trailer, confirmed for same-day Linux release
23 Apr 2018 at 1:33 pm UTC Likes: 2

Quoting: richmetson
Quoting: Nevertheless
Quoting: Eike
Quoting: Nevertheless
Quoting: richmetson
Quoting: NeverthelessDoes it support Kali Linux?
I can test that in a VM pretty easily to say if it throws errors or not, but I have no idea how much effort Kali devs put into supporting graphics cards!

Will let you know later down the line :P
But don't put too much efforts into it! :D
... as it was a joke. :)

Some young kewl haxors having watched a certain TV series want to run Steam on Kali - and don't have the abilities to make it work.
Of course it was! Gaming on Kali is like Rallye racing with farming machines. :)
Well there is an entire sport dedicated to that!
https://www.youtube.com/watch?v=9yHl24QynOM [External Link]

Lol yeah I figured it was a joke, but that it would be a funny gimmick to see if it ran, if nothing else to be able to say that it does! :P
You could integrate the game into a Kali live CD as a physical special edition. ;-)

Get your terminal ready to hack the planet in Off Grid with a new trailer, confirmed for same-day Linux release
20 Apr 2018 at 4:32 pm UTC Likes: 3

Quoting: Eike
Quoting: Nevertheless
Quoting: richmetson
Quoting: NeverthelessDoes it support Kali Linux?
I can test that in a VM pretty easily to say if it throws errors or not, but I have no idea how much effort Kali devs put into supporting graphics cards!

Will let you know later down the line :P
But don't put too much efforts into it! :D
... as it was a joke. :)

Some young kewl haxors having watched a certain TV series want to run Steam on Kali - and don't have the abilities to make it work.
Of course it was! Gaming on Kali is like Rallye racing with farming machines. :)

Get your terminal ready to hack the planet in Off Grid with a new trailer, confirmed for same-day Linux release
20 Apr 2018 at 3:53 pm UTC Likes: 3

Quoting: richmetson
Quoting: NeverthelessDoes it support Kali Linux?
I can test that in a VM pretty easily to say if it throws errors or not, but I have no idea how much effort Kali devs put into supporting graphics cards!

Will let you know later down the line :P
But don't put too much efforts into it! :D

Get your terminal ready to hack the planet in Off Grid with a new trailer, confirmed for same-day Linux release
19 Apr 2018 at 4:38 am UTC Likes: 5

Quoting: elmapultake a look at the minimum requirements
for the windows and mac versions, you need 6GB of ram, 6GB of HD space
for the linux version, you need 16MB of ram, 100MB of HD space...

what is that? an game runing in a virtual machine?

LOL look the recomended requirements
I love it already!

Feral Interactive have released an open source tool that’ll help get the most performance out of Linux games
12 Apr 2018 at 4:28 pm UTC

Quoting: marcus
Quoting: NeverthelessEasier... just try setting the cpu governor without it :)
Interesting ... learned something new ...

(all binaries with setuid-root)

It works without the setuid call:

#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>

int main() { 
        printf("EUID: %i\n",geteuid());
        printf("UID: %i\n",getuid());
        FILE* file = fopen("/sys/devices/system/cpu/cpu1/online","w");
        if (!file) {
                perror("Error opening: \n");
                return -1;
        }
        if (fprintf(file,"0\n") < 0) {
                perror("Error writing: \n");
                return -2;
        }
}


(Sorry, have no governors to set, so I just used cpu1/online for the same effect).

However, it does not work if you use system (which you should not do to begin with ^^, see also Caveats section in man 3 system and https://stackoverflow.com/questions/27461936/system-vs-execve [External Link]. This is because the EUID is not propagated to the program called by system, while the UID is.

steam@SteamBox ~ $ cat test2.c
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main() { 
        printf("EUID: %i\n",geteuid());
        printf("UID: %i\n",getuid());
        system("echo EUID_System: $EUID");
}
steam@SteamBox ~ $ ./test2 
EUID: 0
UID: 1000
EUID_System: 1000
steam@SteamBox ~ $


steam@SteamBox ~ $ ./test3 
EUID: 0
UID: 0
EUID_System: 0
steam@SteamBox ~ $ cat test3.c 
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main() { 
        setuid(0);
        printf("EUID: %i\n",geteuid());
        printf("UID: %i\n",getuid());
        system("echo EUID_System: $EUID");
}
steam@SteamBox ~ $ 


Bottom line: Please don't use system in a setuid-root binary. This is broken and a serious security hole.
This was not a serious solution for a problem, it was just a hack, a thought if you like. Of course it doesn't even make much sense to have "system" call echo to write into a file, when you can do it with c itself. I still don't see a big security risk in this special case, but with the possibility to replace "system", or better use sudo for the same effect, we can now just completely forget about the idea anyway.

Feral Interactive have released an open source tool that’ll help get the most performance out of Linux games
12 Apr 2018 at 7:57 am UTC

Quoting: marcus
Quoting: NeverthelessI forgot about the "setuid( 0 );" in the file. It's nessessary. Try for yourself (with owner root and suid root):

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
system( "whoami" );
setuid( 0 );
system( "whoami" );
return 0;
}
No its not :) You are confusing uid and euid (effective user id). Whoami is the wrong command to show what you want to show since it outputs the username based on the UID. But the UID is not what is used to check privileges. (See man credentials for the difference between user id and effective user id.)

Try with this code snippet instead:

#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
int main() { 
    printf("EUID: %i\n",geteuid());
    printf("UID: %i\n",getuid());
}


The EUID is what matters when you write to files. Unless you want to use setuid() to change the apparent username to root (and then output it using whoami) it is useless. You can NOT elevate privileges this way.

Hmm ... @Liam: Indentation is somehow broken for code blocks or I'm too stupid ;)
Easier... just try setting the cpu governor without it :)
Don't get me wrong.. what you say makes sense! I don't know really why a suid file owned by root needs this... Maybe it's some security measure, checking if a program is really wanted to be started as suid-root. I don't know! All I know is, that on may system I have add the line to make it work.

Feral Interactive have released an open source tool that’ll help get the most performance out of Linux games
11 Apr 2018 at 2:35 pm UTC

Quoting: KetilYou can setup sudo to work without password for certain commands even if they are written in bash. I prefer that over setuid.
## In sudoers, edited with visudo
myuser ALL = (ALL) NOPASSWD: /usr/local/bin/mysudocommand
Wow, I didn't know that. That's definitely better!

Feral Interactive have released an open source tool that’ll help get the most performance out of Linux games
11 Apr 2018 at 1:53 pm UTC

Quoting: marcus
Quoting: Nevertheless
Quoting: mike44Good but I would prefer not to install anything. Could we simply run a command before and after playing?
I found a simple suid program on the net, which I just had to change a bit to do the right things.

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
setuid( 0 );
system( "echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor" );

return 0;
}

and to set it back to powersave:

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
setuid( 0 );
system( "echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor" );

return 0;
}
This is really bogus, broken code ...
The setuid command is useless since
  • a) you are already root (per chmod u+s)

  • b) you would not be able to elevate your privileges like that if you were not. That would be a security hole. The purpose of setuid is to drop privileges when you are already root. Not to elevate them (see man setuid).



Using sudo in the system commandline makes no sense as well. It is benign if you have a setuid root binary (i.e. does nothing, just leave it out). If you are not yet root it will ask of course but then you can really just use the commandline directly. Skip the c and use bash.
I forgot about the "setuid( 0 );" in the file. It's nessessary. Try for yourself (with owner root and suid root):

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
system( "whoami" );
setuid( 0 );
system( "whoami" );
return 0;
}