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

Jérémy Bobbio lunar at debian.org
Mon Aug 3 15:30:49 UTC 2015


Hi!

Maria Valentina Marin:
> 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'.

Cool!

Tiny nitpick: the option might now have the best name. `unsquashfs`
currently supports `-l` = `-ls` and `-ll` = `-lls`. I guess the latter
is far 'long ls'. Puting the 'n' in the middle of 'ls' seems a bit
confusing.

> +@@ -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");

Maybe the call to getpwuid() could be avoided entirely if numeric_ls is
set? With the above this will look up the NSS database, and then ditch
the result. This makes unecessary computations.

-- 
Lunar                                .''`. 
lunar at debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/filesystems-devel/attachments/20150803/7a6243b1/attachment.sig>


More information about the Filesystems-devel mailing list