From owner-freebsd-questions Thu Nov 6 01:54:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA04424 for questions-outgoing; Thu, 6 Nov 1997 01:54:48 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from gatekeeper.barcode.co.il (gatekeeper.barcode.co.il [192.116.93.17]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id BAA04414 for ; Thu, 6 Nov 1997 01:54:41 -0800 (PST) (envelope-from nadav@barcode.co.il) Received: (from smap@localhost) by gatekeeper.barcode.co.il (8.8.5/8.6.12) id LAA18100; Thu, 6 Nov 1997 11:54:39 +0200 (IST) X-Authentication-Warning: gatekeeper.barcode.co.il: smap set sender to using -f Received: from localhost.barcode.co.il(127.0.0.1) by gatekeeper.barcode.co.il via smap (V1.3) id sma018095; Thu Nov 6 11:54:11 1997 Message-ID: <34619382.2896@barcode.co.il> Date: Thu, 06 Nov 1997 11:53:06 +0200 From: Nadav Eiron X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.6 sun4u) MIME-Version: 1.0 To: hmin@public.cq.sc.cn CC: FreeBSD Subject: Re: TO access the PROTO_RAW. References: <3280477C.3DF1@public.cq.sc.cn> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Huang Min wrote: > > Hi, sir, > > Doing some basic programming, I know PROTO_RAW can only access by > the root user. Then I know the "ping" program is also using RAW, and > can be used by normal user, how does this happen? Can anyone explain > this to me? thanks > > Huang Min Ping has the suid bit on. This means that while it runs, its effective UID is changed to that of its owner, which happens to be root. This is the case with many utilities (with the classic(?) example being passwd - since it writes to the master passwd file /etc/master.passwd, which should, undoubtably, be inaccessible to non-root users). Nadav