svn commit: r231300 - head/usr.sbin/pkg_install/create

Andrey Chernov ache at FreeBSD.ORG
Fri Feb 10 00:26:28 UTC 2012


On Thu, Feb 09, 2012 at 08:51:03PM +0000, Eitan Adler wrote:
>      /* Prefix should add an @cwd to the packing list */
> -    if (Prefix)
> -	add_plist_top(&plist, PLIST_CWD, Prefix);
> +    if (Prefix) {
> +        char resolved_prefix[PATH_MAX];
> +        if (realpath(Prefix, resolved_prefix) != 0)
> +	    err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix);
> +	add_plist_top(&plist, PLIST_CWD, resolved_prefix);
> +    }

This change cause 
"pkg_create: couldn't resolve path for prefix: /usr/local: No such file or 
directory"
because test condition should really be:
	if (realpath(Prefix, resolved_prefix) == NULL)
(and realpath(3) returns char *)

-- 
http://ache.vniz.net/


More information about the svn-src-head mailing list