[PATCH 2/2] cpio: add missing initialization for cpio__owner

Aaro Koskinen aaro.koskinen at iki.fi
Wed Nov 2 22:25:06 UTC 2016


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 */
-- 
2.9.2



More information about the busybox mailing list