🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.2bsd
Article #255

Re: Cuserid() is a security hole

#255
From: Mike Taylor
Date: Thu, 08 Jun 1989 16:36
12 lines
1152 bytes
[Someone (original reference lost) says:]
> If this [cuserid()'s behaviour]is indeed a bug on other versions of
> Unix ... 

The fact that it doesn't do what you want it to do doesn't make it a
bug -- it's only a bug if it doesn't do what it *says* it does.  If
you want the login name of the user running the process, then you
should use getpwuid(getuid())->pw_name.  Cuserid() is specifically
designed to do this only if its attempt to look up the name in
/etc/utmp fails.
______________________________________________________________________________
Mike Taylor - {Christ,M{athemat,us}ic}ian ...  Email to: mirk@uk.ac.warwick.cs
Technical Details
Message-ID: <129@orchid.warwick.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!warwick!maujf
References: <289@levels.sait.edu.au> <472@imokay.dec.com> <1768@auspex.auspex.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!warwick!maujf
From: maujf@warwick.ac.uk (Mike Taylor)
Newsgroups: comp.bugs.2bsd,comp.bugs.4bsd,comp.bugs.sys5,comp.unix.wizards
Subject: Re: Cuserid() is a security hole
Summary: It ain't a bug!
Message-ID: <129@orchid.warwick.ac.uk>
Date: 8 Jun 89 16:36:16 GMT
References: <289@levels.sait.edu.au> <472@imokay.dec.com> <1768@auspex.auspex.com>
Reply-To: mirk@uk.ac.warwick.cs (Mike Taylor)
Organization: Computing Services, Warwick University, UK
Lines: 12