PDA

View Full Version : Weird user problem


Kevin Smith
2004-09-14, 17:03 PM
I am trying to help somebody out that is having what appears to be some type of permissions problem, but I cannot nail it down.

He is on a VPN of some sort and has root access..

He is trying to run a game server...he can start the game via root login, but cannot run the game via another user.

THE WHOLE game folder is chmod 755 and is user:user, wont start..I have checked EVERY file to make sure something didnt get left root...now if he sets it as root:user it works fine...but he cant be running a game server as root...

My thought is that only root is allowed to run on certain ports...but the ports of this game fall WAY out of the normal root-only ports...I mean its like 7777 and 78^^^...so it is above 1024...nothing in iptables:bang:

markm
2004-09-14, 23:05 PM
have you already used strace?

Kevin Smith
2004-09-15, 00:52 AM
Never used strace before....

can I use it with a ./startserver file....

tried strace ./startserver

didnt work of course

ArCh3r
2004-09-15, 11:14 AM
Consider if you have started it as root - then possibly some configs or log files were created as root and the user may not have permissions to modify them. The logs may not be in the game folder hierarchy. I know for quake3, the logs are written to ~/.q3a/[MOD]/file.log

Just a thought.

chris.

markm
2004-09-15, 12:04 PM
Originally posted by markm
have you already used strace?

you should look at the output and see what system calls fail. My guess is that a write or an open will fail; it may say permission denied, or no such file or directory, or something like that.

Kevin Smith
2004-09-15, 13:54 PM
What is the correct format...for a script like ./startserver for strace...

markm
2004-09-16, 00:07 AM
Originally posted by Kevin Smith
What is the correct format...for a script like ./startserver for strace...

Yeah . . . you may want to do something like:

strace ./startserver 2>&1 |less

so you can see all of your output.

knightfoo
2004-09-16, 21:28 PM
The first question you need to answer is what happens when he tries to run it as a non-root user. You said it doesn't work, but that doesn't tell us much. Does it spit out an error, or does it simply return to a shell prompt without doing anything obvious? It is very unusual for a *NIX program to simply "do nothing". If the program doesn't output some debug information on the terminal, it will nearly always write something to a log file. Check startserver and see if it has any debug options (./startserver --help or ./startserver -h).

An easy way to make sure permissions are set properly is:

# chown -R user:user gamedir
# find gamedir -type d -exec chmod 755 {} ';'
# find gamedir -type f -exec chmod +r {} ';'

There won't be a port restriction unless a non-root user attempts to bind a port below 1024.

-knightfoo