Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2012 04:26:24 +0400
From:      Andrey Chernov <ache@FreeBSD.ORG>
To:        Eitan Adler <eadler@FreeBSD.ORG>
Cc:        svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG
Subject:   Re: svn commit: r231300 - head/usr.sbin/pkg_install/create
Message-ID:  <20120210002623.GA79894@vniz.net>
In-Reply-To: <201202092051.q19Kp3pj028436@svn.freebsd.org>
References:  <201202092051.q19Kp3pj028436@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120210002623.GA79894>