Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2012 21:18:52 +0100
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Marco Steinbach <coco@executive-computing.de>
Cc:        ports@FreeBSD.org
Subject:   Re: [HEADSUP][CFT] pkgng beta1 is out
Message-ID:  <20120131201852.GB64311@azathoth.lan>
In-Reply-To: <alpine.BSF.2.00.1201312028470.2558@s560x.c0c0.intra>
References:  <20120130123930.GB40244@azathoth.lan> <alpine.BSF.2.00.1201312028470.2558@s560x.c0c0.intra>

next in thread | previous in thread | raw e-mail | index | archive | help

--p4qYPpj5QlsIQJ0K
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jan 31, 2012 at 09:09:47PM +0100, Marco Steinbach wrote:
> On Mon, 30 Jan 2012, Baptiste Daroussin wrote:
>=20
> > Hi,
> >
> > pkgng has just reached the beta phase, and has now found its way to the
> > ports tree (disabled by default).
>=20
> [...]
>=20
> > cd /usr/ports/
> > touch abc
> touch: abc: Permission denied
> > pkg create net/ifstat
> Creating package for ifstat-1.1_5
> Segmentation fault
>=20
>=20
> The attached patch tries to enable pkg(1) to stay on top of things by add=
ing
> error handling around archive_write_open_filename.
>=20
> > pkg create net/ifstat
> Creating package for ifstat-1.1_5
> pkg: archive_write_open_filename(.//ifstat-1.1_5.txz): Permission denied
> pkg: unable to create archive
>=20
> MfG CoCo

> diff --git a/libpkg/packing.c b/libpkg/packing.c
> index e536eb8..9543c32 100644
> --- a/libpkg/packing.c
> +++ b/libpkg/packing.c
> @@ -49,7 +49,15 @@ packing_init(struct packing **pack, const char *path, =
pkg_formats format)
>  		}
>  		snprintf(archive_path, sizeof(archive_path), "%s.%s", path, ext);
> =20
> -		archive_write_open_filename((*pack)->awrite, archive_path);
> +		if (archive_write_open_filename(
> +		    (*pack)->awrite, archive_path) !=3D ARCHIVE_OK ) {
> +			pkg_emit_errno("archive_write_open_filename",
> +			    archive_path);
> +			archive_read_finish((*pack)->aread);
> +			archive_write_finish((*pack)->awrite);
> +			*pack =3D NULL;
> +			return EPKG_FATAL;
> +		}
>  	} else { /* pass mode directly write to the disk */
>  		(*pack)->awrite =3D archive_write_disk_new();
>  		archive_write_disk_set_options((*pack)->awrite, EXTRACT_ARCHIVE_FLAGS);


Thanks for spotting this, can you:
send a git format-patch diff
or send a pull-request on github?

if not I'll integrate the patch as-is

regards,
Bapt

--p4qYPpj5QlsIQJ0K
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk8oTKwACgkQ8kTtMUmk6EwDVACfTk5mgFZRVv1q8jM5juthjgDn
q98AoKfOhMxMYgEiXLLfcRwY8zDP9OGk
=3+0L
-----END PGP SIGNATURE-----

--p4qYPpj5QlsIQJ0K--



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