Date: Wed, 27 Jun 2007 20:30:39 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Roman Divacky <rdivacky@FreeBSD.org> Cc: Perforce Change Reviews <perforce@FreeBSD.org> Subject: Re: PERFORCE change 122077 for review Message-ID: <20070627183039.GC4821@garage.freebsd.pl> In-Reply-To: <200706211001.l5LA16H4021185@repoman.freebsd.org> References: <200706211001.l5LA16H4021185@repoman.freebsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Thu, Jun 21, 2007 at 10:01:06AM +0000, Roman Divacky wrote: > http://perforce.freebsd.org/chv.cgi?CH=122077 > > Change 122077 by rdivacky@rdivacky_witten on 2007/06/21 10:00:59 > > Introduce kern_absolute_path which checks whether a given path is absolute or > not by checking first char for being '/'. > > 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 == UIO_SYSSPACE) { > + return (path[0] == '/'); > + } else { > + error = 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] == '/'); > + } > +} -- Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGgqzPForvXbEpPzQRAhFvAJ4xFx5gYTm/dOCcV6Mhj6jTc/XpeACg2YMg Q5s4iVSBuRNsh1ZbAGUBkGk= =9fr8 -----END PGP SIGNATURE-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070627183039.GC4821>
