[PATCH 2/2] cpio: add missing initialization for cpio__owner
Denys Vlasenko
vda.linux at googlemail.com
Fri Nov 4 21:34:46 UTC 2016
On Wed, Nov 2, 2016 at 11:25 PM, Aaro Koskinen <aaro.koskinen at iki.fi> wrote:
> From: Marc Smith <marc.smith at mcc.edu>
>
> Add missing initialization for cpio__owner. Otherwise all files are owned
> by root.
>
> The patch fixes the failing test cases added in the previous patch.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen at iki.fi>
> ---
> archival/cpio.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/archival/cpio.c b/archival/cpio.c
> index 540218c..34830a7 100644
> --- a/archival/cpio.c
> +++ b/archival/cpio.c
> @@ -383,6 +383,8 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
> archive_handle = init_handle();
> /* archive_handle->src_fd = STDIN_FILENO; - done by init_handle */
> archive_handle->ah_flags = ARCHIVE_EXTRACT_NEWER;
> + archive_handle->cpio__owner.uid = -1L;
> + archive_handle->cpio__owner.gid = -1L;
>
> /* As of now we do not enforce this: */
> /* -i,-t,-o,-p are mutually exclusive */
This seems to be fixed already?
commit 85100a7067a51c5e6720c0a738317cc2144ab219
Author: Denys Vlasenko <vda.linux at googlemail.com>
Date: Wed Oct 12 20:56:46 2016 +0200
cpio: fix restoration of file ownership, closes 9306
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
diff --git a/archival/libarchive/init_handle.c
b/archival/libarchive/init_handle.c
index cbae06a..dcba666 100644
--- a/archival/libarchive/init_handle.c
+++ b/archival/libarchive/init_handle.c
@@ -17,6 +17,10 @@ archive_handle_t* FAST_FUNC init_handle(void)
archive_handle->action_data = data_skip;
archive_handle->filter = filter_accept_all;
archive_handle->seek = seek_by_jump;
+#if ENABLE_CPIO || ENABLE_RPM2CPIO || ENABLE_RPM
+ archive_handle->cpio__owner.uid = (uid_t)-1L;
+ archive_handle->cpio__owner.gid = (gid_t)-1L;
+#endif
More information about the busybox
mailing list