From owner-p4-projects@FreeBSD.ORG Wed Jun 27 18:30:57 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F167E16A46B; Wed, 27 Jun 2007 18:30:56 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9199716A421 for ; Wed, 27 Jun 2007 18:30:56 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id 28B9913C45E for ; Wed, 27 Jun 2007 18:30:53 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 3479E45CD9; Wed, 27 Jun 2007 20:30:51 +0200 (CEST) Received: from localhost (154.81.datacomsa.pl [195.34.81.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 887FE45696; Wed, 27 Jun 2007 20:30:42 +0200 (CEST) Date: Wed, 27 Jun 2007 20:30:39 +0200 From: Pawel Jakub Dawidek To: Roman Divacky Message-ID: <20070627183039.GC4821@garage.freebsd.pl> References: <200706211001.l5LA16H4021185@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W5WqUoFLvi1M7tJE" Content-Disposition: inline In-Reply-To: <200706211001.l5LA16H4021185@repoman.freebsd.org> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r804 (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: Perforce Change Reviews Subject: Re: PERFORCE change 122077 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2007 18:30:57 -0000 --W5WqUoFLvi1M7tJE Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 21, 2007 at 10:01:06AM +0000, Roman Divacky wrote: > http://perforce.freebsd.org/chv.cgi?CH=3D122077 >=20 > Change 122077 by rdivacky@rdivacky_witten on 2007/06/21 10:00:59 >=20 > Introduce kern_absolute_path which checks whether a given path is absolu= te or > not by checking first char for being '/'. > =09 > Use this function to implement BADF semantic of *at syscalls. [...] > +/* Check whether a path is an absolute path. */ > +static int kern_absolute_path(char *path, enum uio_seg pathseg) > +{ > + int error, len; > + char buf[PATH_MAX]; > + > + if (pathseg =3D=3D UIO_SYSSPACE) { > + return (path[0] =3D=3D '/'); =09 > + } else { > + error =3D copyinstr(path, buf, PATH_MAX, &len); > + if (error) > + return 1; /* we want to fail */ When you cannot copy the data do you really want to return TRUE? > + return (buf[0] =3D=3D '/');=09 > + } > +} --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --W5WqUoFLvi1M7tJE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGgqzPForvXbEpPzQRAhFvAJ4xFx5gYTm/dOCcV6Mhj6jTc/XpeACg2YMg Q5s4iVSBuRNsh1ZbAGUBkGk= =9fr8 -----END PGP SIGNATURE----- --W5WqUoFLvi1M7tJE--