From owner-freebsd-current Mon Feb 17 17:19:22 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DB8037B401 for ; Mon, 17 Feb 2003 17:19:21 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id C539643FAF for ; Mon, 17 Feb 2003 17:19:14 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a072.otenet.gr [212.205.215.72]) by mailsrv.otenet.gr (8.12.6/8.12.6) with ESMTP id h1I1IfpU015590; Tue, 18 Feb 2003 03:18:55 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.7/8.12.7) with ESMTP id h1I1IbdC063784; Tue, 18 Feb 2003 03:18:37 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.7/8.12.7/Submit) id h1I1IKBi063492; Tue, 18 Feb 2003 03:18:20 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 18 Feb 2003 03:18:20 +0200 From: Giorgos Keramidas To: Wiktor Niesiobedzki Cc: current@FreeBSD.ORG Subject: Re: IPFW/socheckuid() patch Message-ID: <20030218011820.GB23002@gothmog.gr> References: <20030217224732.GC2315@mail.evip.pl> <20030217230227.GD2315@mail.evip.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030217230227.GD2315@mail.evip.pl> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2003-02-18 00:02, Wiktor Niesiobedzki wrote: > On Mon, Feb 17, 2003 at 11:47:32PM +0100, Wiktor Niesiobedzki wrote: > There is an obvious mistake in patch (or change in ip_fw2.c should > be considered). > [...] > --- sys/kern/uipc_socket.c 2003/02/17 22:37:58 1.144 > +++ sys/kern/uipc_socket.c 2003/02/17 22:56:41 > @@ -1846,8 +1846,8 @@ > { > > if (so == NULL) > - return (EPERM); > - if (so->so_cred->cr_uid == uid) > return (0); > - return (EPERM); > + if (so->so_cred->cr_uid == uid) > + return (1); > + return (0); > } The rest of the uipc_socket.c functions (socreate, sobind, solisten, soclose, soabort, ...) that return int's use zero as a "success" value, and return errno based errors otherwise. I'm thinking if the error is ipfw2's fault and should be fixed there. It seems slightly preferable to me. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message