From owner-freebsd-hackers Sun Jul 11 11:13: 5 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from janus.syracuse.net (janus.syracuse.net [205.232.47.15]) by hub.freebsd.org (Postfix) with ESMTP id 6213014BD6 for ; Sun, 11 Jul 1999 11:13:03 -0700 (PDT) (envelope-from green@FreeBSD.org) Received: from localhost (green@localhost) by janus.syracuse.net (8.9.2/8.8.7) with ESMTP id OAA25459; Sun, 11 Jul 1999 14:13:00 -0400 (EDT) X-Authentication-Warning: janus.syracuse.net: green owned process doing -bs Date: Sun, 11 Jul 1999 14:13:00 -0400 (EDT) From: "Brian F. Feldman" X-Sender: green@janus.syracuse.net To: Niall Smart Cc: hackers@FreeBSD.org Subject: Re: a BSD identd In-Reply-To: <3788A49D.69D6DB6A@pobox.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 11 Jul 1999, Niall Smart wrote: > > > I don't see a point to that. However, I am finished. Please go to > > http://www.FreeBSD.org/~green/ and get getcred.patch and inetd_ident.patch. > > Hmm, > > +#ifdef FAKEID > + snprintf(fakeid_path, sizeof(fakeid_path), "%s/.fakeid", > pw->pw_dir); > + fakeid = fopen(fakeid_path, "r"); > + if (fakeid) { > > $ ln -s /etc/master.passwd ~/.fakeid > > Ouch. (One possible saving grace here is that you truncate > after 16 characters). Good idea. I'll have it check to see that it's a regular file. > > + if (!*cp || getpwnam(cp)) { > + pw = getpwuid(uc.cr_uid); > + cp = pw->pw_name; > + goto printit; > + } > > What is this code trying to do? If the ~/.fakeid file is invalid > or the user is attempting to impersonate another then revert? A > comment would be nice. You forget to check for pw == NULL here > (but you don't earlier ;) and I don't think the goto is necessary. If pw lookup for that uid succeeded before, why won't it succeed now? In fact, I didn't even need the "pw = ", but that would be depending on current static behavior... > > Regards, > > Niall > Brian Fundakowski Feldman _ __ ___ ____ ___ ___ ___ green@FreeBSD.org _ __ ___ | _ ) __| \ FreeBSD: The Power to Serve! _ __ | _ \._ \ |) | http://www.FreeBSD.org/ _ |___/___/___/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message