From owner-freebsd-current Sat Sep 11 9:31:21 1999 Delivered-To: freebsd-current@freebsd.org Received: from mta1.rcsntx.swbell.net (mta1.rcsntx.swbell.net [151.164.30.25]) by hub.freebsd.org (Postfix) with ESMTP id 6535214DE5 for ; Sat, 11 Sep 1999 09:31:19 -0700 (PDT) (envelope-from chris@holly.dyndns.org) Received: from holly.dyndns.org (adsl-216-62-157-60.dsl.hstntx.swbell.net) by mta1.rcsntx.swbell.net (Sun Internet Mail Server sims.3.5.1999.05.19.16.06.p6) with ESMTP id <0FHW00IFALVQ89@mta1.rcsntx.swbell.net> for freebsd-current@FreeBSD.ORG; Sat, 11 Sep 1999 11:31:02 -0500 (CDT) Received: (from chris@localhost) by holly.dyndns.org (8.9.3/8.9.3) id LAA08311; Sat, 11 Sep 1999 11:31:05 -0500 (CDT envelope-from chris) Date: Sat, 11 Sep 1999 11:31:04 -0500 From: Chris Costello Subject: Re: ps doesn't need privileges? In-reply-to: To: Blaz Zupan Cc: freebsd-current@FreeBSD.ORG Reply-To: chris@calldei.com Message-id: <19990911113104.H906@holly.dyndns.org> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii User-Agent: Mutt/0.96.6i References: <19990911111820.G906@holly.dyndns.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, Sep 11, 1999, Blaz Zupan wrote: > /home/blaz> id > uid=1000(blaz) gid=1000(users) groups=1000(users) > /home/blaz> ls -l /dev/kmem > crw-r----- 1 root kmem 2, 1 May 23 15:26 /dev/kmem Oh. ps doesn't use /dev/kmem. Look at a ktrace of it; it works just as it should. /tmp/ps auwwx prints what it should and the ktrace output shows it opens the processes whose memory it can read (as ``nobody'' I could read httpd processes, my ksh process and my ps process) and errors for those it cannot: 8290 ps CALL __sysctl(0xbfbfc944,0x4,0xbfbfc954,0xbfbfc940,0,0) 8290 ps RET __sysctl 0 8290 ps CALL open(0xbfbfc878,0,0) 8290 ps NAMI "/proc/7997/mem" 8290 ps RET open -1 errno 13 Permission denied 8290 ps CALL close(0xffffffff) 8290 ps RET close -1 errno 9 Bad file descriptor -- |Chris Costello |CCITT - Can't Conceive Intelligent Thoughts Today `------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message