*BSD News Article 37297


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!ihnp4.ucsd.edu!agate!howland.reston.ans.net!pipex!bt!usenet
From: alex@mlbg79.btlabsmh.bt.co.uk (Alex Barclay)
Newsgroups: comp.os.386bsd.questions
Subject: Re: xload and access to load average
Date: 2 Nov 1994 10:36:28 GMT
Organization: BT
Lines: 30
Message-ID: <397q3c$27l@pheidippides.axion.bt.co.uk>
References: <3976mm$i8i@lynx.unm.edu>
NNTP-Posting-Host: abpc.mavericks.bt.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Newsreader: WinVN 0.92.6

In article <3976mm$i8i@lynx.unm.edu>, ahvezda@jemez.eece.unm.edu (Ales Vaclav Hvezda) says:
> when I try to run it as a
>regular user I get:
>
>        xload: couldn't obtain load average 
>
>(There are some binary chars printed after that)
>
>The file, xload, has the following permissions:
>
> -rwsr-xr-x    1 bin      kmem       12288 Sep 28 08:07 /usr/X11R6/bin/xload
>

It seems to me that xload is running SUID so therefore /dev/kmem would need to
be accessable to "bin". If you make xload SGID then kmem and /dev/kmem would
have a common group and the access will work. You need the perms:

  -rwxr-sr-x    1 bin      kmem   etc.....  xload

and for /dev/kmem:

  crw-r-----	1 root	   kmem	   etc....  kmem

This is a secure way of doing things as the SGID will only ever give xload 
"read" access to kmem which is all that it needs. "write" access may be a
bad idea if you have buggy code accessing it.

Hope this helps,

Alex.