[Filesystems-devel] Bug#794096: squashfs-tools: please add --numeric-uid-gid to unsquashfs

Maria Valentina Marin marivalenm at gmail.com
Mon Aug 3 15:13:26 UTC 2015


Control: tag -1 + patch

Hi,

On Thu, 30 Jul 2015 15:38:37 +0200 =?iso-8859-1?B?Suly6W15?= Bobbio
<lunar at debian.org> wrote:
> Adding a `--numeric-uid-gid` (like cpio) or `--numeric-owner` (like Tar) option
> would be greatly appreciated.
                                     `-
Attached patch fixes this by introducing a new option 'lns' which works
like 'lls' but instead of working like 'ls -l' it works like 'ls -n'.

Example output:

$ unsquashfs -lns ~/testfile.squashfs
Parallel unsquashfs: Using 4 processors
2 inodes (2 blocks) to write

drwxr-xr-x 1000/1000        48 2015-08-03 14:53 squashfs-root
-rw-r--r-- 1000/1000        5 2015-08-03 14:52 squashfs-root/testfile
-rw-r--r-- 1000/1000        4 2015-08-03 14:53 squashfs-root/testfile2

Kind regards,
akira
-------------- next part --------------
diff -Nru squashfs-tools-4.2+20130409/debian/changelog squashfs-tools-4.2+20130409/debian/changelog
--- squashfs-tools-4.2+20130409/debian/changelog	2013-09-18 10:22:27.000000000 +0200
+++ squashfs-tools-4.2+20130409/debian/changelog	2015-08-03 16:15:27.000000000 +0200
@@ -1,3 +1,10 @@
+squashfs-tools (1:4.2+20130409-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Adding lns option to unsquashfs
+
+ -- akira <marivalenm at gmail.com>  Mon, 03 Aug 2015 16:12:14 +0200
+
 squashfs-tools (1:4.2+20130409-2) unstable; urgency=low
 
   * New maintainer (closes: #723600).
diff -Nru squashfs-tools-4.2+20130409/debian/manpages/unsquashfs.1 squashfs-tools-4.2+20130409/debian/manpages/unsquashfs.1
--- squashfs-tools-4.2+20130409/debian/manpages/unsquashfs.1	2013-05-09 22:22:49.000000000 +0200
+++ squashfs-tools-4.2+20130409/debian/manpages/unsquashfs.1	2015-08-03 16:39:56.000000000 +0200
@@ -32,6 +32,8 @@
 list filesystem, but don't unsquash.
 .IP "\-ll, \-lls" 4
 list filesystem with file attributes (like ls \-l output), but don't unsquash.
+.IP "\-ln, \-lns" 4
+list filesystem with file attributes (like ls \-n output), but don't unsquash.
 .IP "\-f, \-force" 4
 if file already exists then overwrite.
 .IP "\-s, \-stat" 4
diff -Nru squashfs-tools-4.2+20130409/debian/patches/nousername squashfs-tools-4.2+20130409/debian/patches/nousername
--- squashfs-tools-4.2+20130409/debian/patches/nousername	1970-01-01 01:00:00.000000000 +0100
+++ squashfs-tools-4.2+20130409/debian/patches/nousername	2015-08-03 17:11:11.000000000 +0200
@@ -0,0 +1,51 @@
+--- a/unsquashfs.c
++++ b/unsquashfs.c
+@@ -62,7 +62,7 @@ char *file_data;
+ char *data;
+ unsigned int block_size;
+ unsigned int block_log;
+-int lsonly = FALSE, info = FALSE, force = FALSE, short_ls = TRUE;
++int lsonly = FALSE, info = FALSE, force = FALSE, short_ls = TRUE, numeric_ls = FALSE;
+ int use_regex = FALSE;
+ char **created_inode;
+ int root_process;
+@@ -492,7 +492,7 @@ int print_filename(char *pathname, struc
+ 	}
+ 
+ 	user = getpwuid(inode->uid);
+-	if(user == NULL) {
++	if(user == NULL || numeric_ls) {
+ 		int res = snprintf(dummy, 12, "%d", inode->uid);
+ 		if(res < 0)
+ 			EXIT_UNSQUASH("snprintf failed in print_filename()\n");
+@@ -506,7 +506,7 @@ int print_filename(char *pathname, struc
+ 		userstr = user->pw_name;
+ 		 
+ 	group = getgrgid(inode->gid);
+-	if(group == NULL) {
++	if(group == NULL || numeric_ls) {
+ 		int res = snprintf(dummy2, 12, "%d", inode->gid);
+ 		if(res < 0)
+ 			EXIT_UNSQUASH("snprintf failed in print_filename()\n");
+@@ -2512,6 +2512,11 @@ int main(int argc, char *argv[])
+ 				strcmp(argv[i], "-ll") == 0) {
+ 			lsonly = TRUE;
+ 			short_ls = FALSE;
++		} else if(strcmp(argv[i], "-lns") == 0 ||
++				strcmp(argv[i], "-ln") == 0) {
++			lsonly = TRUE;
++			short_ls = FALSE;
++			numeric_ls = TRUE;
+ 		} else if(strcmp(argv[i], "-linfo") == 0 ||
+ 				strcmp(argv[i], "-li") == 0) {
+ 			info = TRUE;
+@@ -2569,6 +2574,9 @@ options:
+ 			ERROR("\t-ll[s]\t\t\tlist filesystem with file "
+ 				"attributes (like\n");
+ 			ERROR("\t\t\t\tls -l output), but don't unsquash\n");
++			ERROR("\t-ln[s]\t\t\tlist filesystem with file "
++				"attributes (like\n");
++			ERROR("\t\t\t\tls -n output), but don't unsquash\n");
+ 			ERROR("\t-f[orce]\t\tif file already exists then "
+ 				"overwrite\n");
+ 			ERROR("\t-s[tat]\t\t\tdisplay filesystem superblock "
diff -Nru squashfs-tools-4.2+20130409/debian/patches/series squashfs-tools-4.2+20130409/debian/patches/series
--- squashfs-tools-4.2+20130409/debian/patches/series	2013-05-09 22:22:49.000000000 +0200
+++ squashfs-tools-4.2+20130409/debian/patches/series	2015-08-03 16:30:54.000000000 +0200
@@ -1 +1,2 @@
 0001-kfreebsd.patch
+nousername
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/filesystems-devel/attachments/20150803/05126bba/attachment.sig>


More information about the Filesystems-devel mailing list