LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Broken X - Only works for root (https://www.linuxquestions.org/questions/slackware-14/broken-x-only-works-for-root-73559/)

BigBadPenguin 07-17-2003 10:47 AM

Broken X - Only works for root
 
Hello everyone, I've managed to break my X for everyone apart from root, and i'm not entirely sure how. The problem seems to be one of permissions. Running startx as a user gives the error:
Quote:

xf86OpenConsole: Server must be suid root
I can get in through gdm, but then some progs don't work (including xterm and aterm which i NEED).
Looking through ~/.xsession-errors
Quote:

pt_chown: needs to be installed setuid `root'
aterm: can't open slave tty /dev/ttyp1
pt_chown: needs to be installed setuid `root'
xterm: Error 18, errno 13: Permission denied
Reason: spawn: open() failed on ptsname
/var/log/messages: Permission denied
Apart from, obviously, how to fix it, i can't work out at all how i managed to break it. I've just been installing new fonts, so all i've done is changed some fontpaths in XF86Config and run ttmkfdir and mkfontdir, which ran without errors and couldn't really have done anything... it's very strange.
Oh yeah, and there was a previous error with startx from a user, about moving log files. I had to delete them and make /var/log world rwxable. I can't do this with xf86OpenConsole cos it isn't an external prog, and anyway, this seems to be a fundamental problem, which should have a fundamental solution...
Anyway, if you make any sense out of that minddump, and have any ideas I'd be very grateful. I have no idea where to go from here, and running everything as root just scares me.
Cheers!
-BBP

teamstatic84 07-17-2003 12:20 PM

I would install Yellow Dog linux if I were you and give up on a good distro like Slackware.

ghostdancer 07-17-2003 11:03 PM

Is your XFree86 with permission:

-rws--x--x

Run: ls -l /usr/X11/bin/XFree86 to find this out. If not, suggest set the permission correctly for this binary.

Hope this help...

BigBadPenguin 07-18-2003 10:43 AM

Cheers Ghostdancer, that's actually something i didn't get round to checking. Unfortunately XFree86 already world x-ecutable (i assume you meant -rwx--x--x, right?) as are aterm and xterm. Back to square 1.
But suddenly ptsname and pt_chown in the error message are ringing a bell.. I'm getting a problem with /dev/pts at startup... I'll google it and check it out. But if anyone has any ideas... Thanks anyway ghostdancer.
And teamstatic, why would i want to ditch slackware? It's my fault, not slack's. Slack is the best distro i've used yet.

BigBadPenguin 07-18-2003 12:05 PM

well, that worked. Recompiled kernel with pts support on and everything's cool. Guess the fact that it was v. terminals not working should have given me a clue. Weird error msgs tho... anyway, thanks for your help.

uxpx 07-18-2003 04:45 PM

X is traditionally set-uid root, as ghostdancer pointed out.
(-rws--x--x root ...) When you run a binary as a normal user, it executes as a process with your id, so it can't write to any files that you don't have write access to.
Setting other files to be world-writable is not a good solution to the problem, as other users may be able to exploit the system in various ways.
When X runs set-uid root, it has permission to manipulate various files and devices that unpriviledged users can't (and shouldn't) modify.

BigBadPenguin 07-19-2003 06:32 AM

Ah, i see... sorry, there's another gap in my knowledge plugged ;)
So it turns out I had two problems, and i only discovered the second when i tried to fix the first. Thanks guys!
By the way, its safe to have full access to /var/log isn't it? Or should i put things back?

grym 07-19-2003 10:27 AM

full access to /var/log allows an intruder to change files to hide themselves better.

BigBadPenguin 07-20-2003 02:47 PM

ha, very good point. Sorry for being such a retard, I'll go fix it.

just_Hum 02-21-2008 02:30 PM

Quote:

Originally Posted by BigBadPenguin (Post 379952)
Hello everyone, I've managed to break my X for everyone apart from root, and i'm not entirely sure how. The problem seems to be one of permissions. Running startx as a user gives the error:

I can get in through gdm, but then some progs don't work (including xterm and aterm which i NEED).
Looking through ~/.xsession-errors

Apart from, obviously, how to fix it, i can't work out at all how i managed to break it. I've just been installing new fonts, so all i've done is changed some fontpaths in XF86Config and run ttmkfdir and mkfontdir, which ran without errors and couldn't really have done anything... it's very strange.
Oh yeah, and there was a previous error with startx from a user, about moving log files. I had to delete them and make /var/log world rwxable. I can't do this with xf86OpenConsole cos it isn't an external prog, and anyway, this seems to be a fundamental problem, which should have a fundamental solution...
Anyway, if you make any sense out of that minddump, and have any ideas I'd be very grateful. I have no idea where to go from here, and running everything as root just scares me.
Cheers!
-BBP

<<pt_chown: needs to be installed setuid `root'
aterm: can't open slave tty /dev/ttyp1
pt_chown: needs to be installed setuid `root'
xterm: Error 18, errno 13: Permission denied

>>

chmod 4755 /usr/libexec/pt_chown

OR
#chown root xterm
#chmod 4755 xterm
Do the same for aterm

Kool,
just_Hum

jong357 02-22-2008 02:23 AM

Wow... Resurecting a 5 year old post to add another reply. That HAS to be some kind of a record or something...

just_Hum 02-25-2008 08:08 PM

Quote:

Originally Posted by jong357 (Post 3065868)
Wow... Resurecting a 5 year old post to add another reply. That HAS to be some kind of a record or something...

It is not for record , people may get the same error if they are using this particular version .. So I thought this will help them. Also will try to find the posts which are older than this :)

kool,
just_Hum


All times are GMT -5. The time now is 04:26 AM.