View previous topic :: View next topic |
Author |
Message |
Guest
|
Posted: Wed May 22, 2002 10:59 pm Post subject: fixing an interesting segfault by su when run in rxvt |
|
|
When I switched from xterm to rxvt, I noticed a small problem: su would segfault whenever I tried to run it. This was a problem.
Coincidentally, I noticed that when I ran an xterm, I could see myself logged in if I ran w. This was not the case with rxvt.
So, I checked some permissions. Here's what's relevant:
Code: | -rws--x--x 1 root root 243K May 15 09:02 /usr/X11R6/bin/xterm
-rwxr-xr-x 1 root root 3.3K May 18 18:13 /usr/bin/rxvt
-rw-r--r-- 1 root root 7.5K May 22 13:07 /var/run/utmp |
As you can see, these are all chown root.root. Xterm can write to utmp by virtue of it being installed setuid root, but rxvt cannot, hence my problem. So I ran chgrp utmp on the relevant files, made utmp and /var/log/wtmp g+w and rxvt and xterm g+s. Now my permissions look like this, and all is good:
Code: | -rwxr-s--x 1 root utmp 243K May 15 09:02 /usr/X11R6/bin/xterm
-rwxr-sr-x 1 root utmp 3.3K May 18 18:13 /usr/bin/rxvt
-rw-rw-r-- 1 root utmp 8.6K May 22 15:47 /var/run/utmp |
My first question: is there a more elegant/correct way to address this issue than what I have done here?
My second question: why is xterm installed setuid root and utmp not in the utmp group? All my friends' first responses were some sarcastic comment about the distro, so if there is a reason Gentoo installs them like this, I'd like to hear it. Otherwise perhaps it's something that could be fixed for the future... |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Tue Oct 22, 2002 6:40 am Post subject: |
|
|
Interesting. I've not had any segfault issues, but the permissions/w info is still accurate. Anyone have any insights? _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
n0n Guru
Joined: 13 Jun 2002 Posts: 355
|
Posted: Tue Oct 22, 2002 8:06 pm Post subject: |
|
|
Interesting indeed. Just FYI, my rxvt is NOT set[gu]id at all, and I can su from it just fine. Did changing the permissions on rxvt really fix the problem for you? Crazy. I've never had su segfault on me.
About being logged in, make sure that you weren't passing in extra options to xterm. My xterm button uses the "-ls" argument, which makes the xterm run a login shell, so I can see myself in the logged-in-users list. My old Debian machine didn't have that; all the xterms I ran were basically still logged in as the user who started X, so I was typically only logged in once, as opposed to the eight times I'm logged in now. |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Tue Oct 22, 2002 8:38 pm Post subject: |
|
|
I've not had the segfault issue, I just thought the permissions part was interesting. To my knowledge, my xterms aren't running with the -ls option. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
n0n Guru
Joined: 13 Jun 2002 Posts: 355
|
Posted: Tue Oct 22, 2002 8:45 pm Post subject: |
|
|
Yeah, I had to add the "-ls" option personally; Gentoo didn't do that for me or anything. I had just found out about the option and had always wanted my xterms to behave that way, so I added it. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|