Subject: FVWM: fvwm 2.0.42/Solaris 2.5

From: Daniel R Ehrlich <[email-masked]>
Date: Thu, 20 Jun 1996 11:50:55 -0400

Hello all,

I am experiencing a weird problem with FvwmButtons/fvwm-2.0.42 and xlock under
Solaris 2.5.  If I have the following in my .fvwm2rc file:

*FvwmButtons Lock       xlock.xpm       Exec /usr/openwin/bin/xlock -mode random

xlock does not execute and emits the following error message:

xlock: can't get the user password. Exiting ...
        You need to run xlock in setuid root mode on your local machine.
        Contact your system administrator.

But, if I run the command

/usr/openwin/bin/xlock -mode random

from the shell prompt it works just fine.  And xlock is already suid root:

daneel:15> ls -gl /usr/openwin/bin/xlock
-rwsrwxr-x   1 root     bin         94484 Oct  2  1995 /usr/openwin/bin/xlock*

and /usr/openwin/bin is on the local disk, so NFS is not stripping the suid
bits for me:

daneel:16> df -k /usr/openwin/bin
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t3d0s6     242431  195109   44898    82%    /usr

Has anyone else seen this problem?  Does anyone have a solution to it?  Any
help or hints would be appreciated.

Thanks,
Dan Ehrlich

Software Configuration:

Everything was compiled with SunPRO C 4.1.

daneel:19> uname -a
SunOS daneel 5.5 Generic sun4m sparc SUNW,SPARCstation-5
daneel:20> fvwm2 -version
[FVWM][main]:  Fvwm Version 2.0.42 compiled on Jun 18 1996 at 14:22:59
daneel:30> FvwmButtons -XXX
FvwmButtons v2.0.42 should only be executed by fvwm!

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Cameron Simpson <[email-masked]>
Date: Fri, 21 Jun 1996 10:04:45 +1000 (EST)

Daniel R Ehrlich <[email-masked]> writes:
| I am experiencing a weird problem with FvwmButtons/fvwm-2.0.42 and xlock under
| Solaris 2.5.  If I have the following in my .fvwm2rc file:
| 
| *FvwmButtons Lock       xlock.xpm       Exec /usr/openwin/bin/xlock -mode random
| xlock does not execute and emits the following error message:
| xlock: can't get the user password. Exiting ...
|         You need to run xlock in setuid root mode on your local machine.
|         Contact your system administrator.
| 
| But, if I run the command
| 
| /usr/openwin/bin/xlock -mode random
| 
| from the shell prompt it works just fine.  And xlock is already suid root:
| 
| daneel:15> ls -gl /usr/openwin/bin/xlock
| -rwsrwxr-x   1 root     bin         94484 Oct  2  1995 /usr/openwin/bin/xlock*
| 
| and /usr/openwin/bin is on the local disk, so NFS is not stripping the suid
| bits for me:

I have a theory.
Suppose the author of xlock was an idiot and used getlogin() to find the
user's login name - fvwm will not have a controlling terminal or utmp entry
and getlogin() will fail.

Try this test:
	rsh yourhost /usr/openwin/bin/xlock -mode random
If it fails the same way it's almost certainly a controlling tty problem.

Best solution (assuming I'm right - I may not be):
	- Fix xlock to use getuid(), not getlogin().

Workaround:
	- Get your shell startup (.env for ksh, cshrc for csh, etc)
	  or your first xterm to write the tty name (if any) to a well known
	  file.load the name when you invoke xlock and attach
		#!/bin/sh
		# attach to a useful tty
		tty=`cat well-known-file`
		if [ ! -c "$tty" ]
		then  echo "$0: $tty: not a tty" >&2; exit 1
		fi
		exec "$@" <"$tty" >"$tty" 2>&1
	  and say
		Exec the-wrapper-above /usr/openwin/bin/xlock -mode rand

Let me know how you go,
	- Cameron Simpson
	  [email-masked], DoD#743
	  http://www.dap.csiro.au/~cameron/
--
The peever can look at the best day in his life and sneer at it.
	- Jim Hill, JennyGfest '95
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Emilio Lopes)
Date: Thu, 20 Jun 96 21:32 EST

>>>>> "CS" == Cameron Simpson <[email-masked]> wrote:

CS> Daniel R Ehrlich <[email-masked]> writes:
CS> | I am experiencing a weird problem with FvwmButtons/fvwm-2.0.42 and xlock under
CS> | Solaris 2.5.  If I have the following in my .fvwm2rc file:
CS> | 
CS> | *FvwmButtons Lock       xlock.xpm       Exec /usr/openwin/bin/xlock -mode random
CS> | xlock does not execute and emits the following error message:
CS> | xlock: can't get the user password. Exiting ...
CS> |         You need to run xlock in setuid root mode on your local machine.
CS> |         Contact your system administrator.
CS> | 
CS> | But, if I run the command
CS> | 
CS> | /usr/openwin/bin/xlock -mode random
CS> | 
CS> | from the shell prompt it works just fine.  And xlock is already suid root:
CS> | 
CS> | daneel:15> ls -gl /usr/openwin/bin/xlock
CS> | -rwsrwxr-x   1 root     bin         94484 Oct  2  1995 /usr/openwin/bin/xlock*
CS> | 
CS> | and /usr/openwin/bin is on the local disk, so NFS is not stripping the suid
CS> | bits for me:

CS> I have a theory.
CS> Suppose the author of xlock was an idiot and used getlogin() to find the
CS> user's login name - fvwm will not have a controlling terminal or utmp entry
CS> and getlogin() will fail.

Sorry folks, but I have an icon for xlock (v3.8) in my FvwmButtons
that works nicely (HP-UX 9.07, X11R6.1, fvwm-2.0.42, gcc-2.7.2).

Emilio.

-- 
 Emilio C. Lopes <mailto:[email-masked]>
 FINPE, Instituto de Fisica      E-mail: [email-masked]
 Universidade de Sao Paulo       Phone : (+55 11) 818-6724 (Voice)
 Caixa Postal 66318                      (+55 11) 818-6715 (Fax)
 05389-970  Sao Paulo - SP
 BRAZIL
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Elmar Kurgpold <[email-masked]>
Date: Thu, 20 Jun 1996 18:01:14 -0700 (PDT)

> CS> | xlock does not execute and emits the following error message:

[yadda yadda yadda]

Maybe it's the way you define it.  Try adding an "exec" before xlock.  My
xlock works fine, under an AddToMenu command: 

+       "XLock%mini.xlock.xpm%"         Exec  exec xlock -mode random &

I didn't experiment much with it, and don't know if you need the "&" on
the end, for example, but this works for me.  BTW, my xlock is the same
path and permissions and so on. 

Cheers.

	--Elmar

  ___  ____ __
 | _ \/ __/|  \  Pencom            |  Elmar Kurgpold
 |  _/\__ \| \ \  Systems          |  Email: [email-masked]
 |_|  /___/|_|__\  Administration  |  Pager: 800/SKYPAGE Pin: 352-4668
 http://www.pencom.com             |  Phone: 415/528-7060 (BBN Planet)