- Nov 14, 2017
-
-
Sean Purcell authored
This patch adds zstd support to squashfs-tools. It works with zstd versions >= 1.0.0. It was originally written by Sean Purcell. Signed-off-by:
Sean Purcell <me@seanp.xyz> Signed-off-by:
Nick Terrell <terrelln@fb.com>
-
Nick Terrell authored
Make these functions static, since they are only exposed through the compressor struct. Signed-off-by:
Nick Terrell <terrelln@fb.com>
-
- Jul 31, 2017
-
-
Phillip Lougher authored
Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Display the format in the help text, and not only on error when the format is not recognised by the parser. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
If someone used filenames with spaces but didn't backslash the spaces (or use the new support for quoted filenames), then they'd get the less than illuminating error message "Read filename and type, but failed to read or match octal mode" Because the code would treat the filename before the first space as the filename, match the type using the first character after the space, and only then fail to parse the expected octal number. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Typically there are two methods of handling filenames with spaces. Either backslash the space, or quote the filename. Pesudo allowed backslashing but oddly didn't allow quoting. Correct that deficiency now. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
probonopd authored
-
probonopd authored
-
Sebastien Bourdelin authored
The option to display the superblock information currently give a rounded value of the bytes used by the filesystem. There are use cases in which knowing the exact value is very valuable. This commit just adds this information.
-
Martin Väth authored
It is nice if the user interface of wrapper scripts can display a progress bar to the user without having to display the detailed information about the generated file. This can be achieved easily by the new -quiet option. This is optionally already used by e.g. https://github.com/vaeth/squashmount/
-
Alexandru Ardelean authored
Signed-off-by:
Alexandru Ardelean <aa@ocedo.com>
-
Alexandru Ardelean authored
musl does not define FNM_EXTMATCH Signed-off-by:
Alexandru Ardelean <aa@ocedo.com>
-
Pranay Kr. Srivastava authored
If character device files have extended attributes then unsquashfs will incorrectly create them as block device files. This patch checks if the file is character device file in case it has extended attributes.
-
Michael S. Fischer authored
Fixes a bug in which security capabilities were not properly set on written files. chown(2) resets all capabilities so it should be run before setting xattrs instead of afterwards.
-
Mohamad Ayyash authored
Segfault happens when attempting to dump pseudo files in SQUASHFS_TRACE mode after attempting to dereference NULL pseudo pointer. Signed-off-by:
Mohamad Ayyash <mkayyash@google.com>
-
- Mar 13, 2017
-
-
Phillip Lougher authored
The pseudo format follows the standard definition, with the type "s" Name s mode uid gid symlink Will create the symlink "Name" with <gid> and <uid> and the contents <symlink>. Note <mode> is ignored, as symlinks always have "rwxrwxrwx" permissions. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Dec 07, 2015
-
-
Thomas De Schampheleire authored
Compiling mksquashfs on RHEL 5 (gcc 4.1.2, glibc 2.5) gives the following error: mksquashfs.c: In function ‘get_fragment’: mksquashfs.c:1440: error: label at end of compound statement On RHEL 6 (gcc 4.4.7, glibc 2.12), the preprocessed output shows a difference for pthread_cleanup_pop, which now has a dummy do {} while (0); statement, presumably to fix this exact error. Fix for RHEL 5 by manually inserting that dummy statement. Signed-off-by:
Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 19, 2014
-
-
Guan, Xin authored
Applies to squashfs-tools 4.3. Reported-by:
Bruno Wolff III <bruno@wolff.to> Signed-off-by:
Guan, Xin <guanx.bac@gmail.com> Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 18, 2014
-
-
Phillip Lougher authored
Fix a rare race condition in fragment waiting when finalising the filesystem. This is a race condition that was initially fixed in 2009, but inadvertantly re-introduced in the latest release when the code was rewritten. Background: When finalising the filesystem, the main control thread needs to ensure all the in-flight fragments have been queued to the writer thread before asking the writer thread to finish, and then writing the metadata. It does this by waiting on the fragments_outstanding counter. Once this counter reaches 0, it synchronises with the writer thread, waiting until the writer thread reports no outstanding data to be written. However, the main thread can race with the fragment deflator thread(s) because the fragment deflator thread(s) decrement the fragments_outstanding counter and release the mutex before queueing the compressed fragment to the writer thread, i.e. the offending code is: fragments_outstanding --; pthread_mutex_unlock(&fragment_mutex); queue_put(to_writer, write_buffer); In extremely rare circumstances, the main thread may see the fragments_outstanding counter is zero before the fragment deflator sends the fragment buffer to the writer thread, and synchronise with the writer thread, and finalise before the fragment has been written. The fix is to ensure the fragment is queued to the writer thread before releasing the mutex. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 12, 2014
-
-
Phillip Lougher authored
The progressbar was incorrectly enabled *after* writing files if sort files were used. This meant the progressbar would not be updated whilst files were being written to the filesystem. As this is the bulk of the work for Mksquashfs, this means the progressbar basically didn't appear to update whilst Mksquashfs was running, and then suddenly updated to 100% at the end of Mksquashfs. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 11, 2014
-
-
Phillip Lougher authored
This action does exactly what it says, i.e. nothing. It's designed to be used in conjunction with the verbose action options to enable debugging of the test expression. In otherwords, it allows you to check which files match on your test expression but without doing anything to the filesystem. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 10, 2014
-
-
Phillip Lougher authored
Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Previously it used atom->test->args which is the arg count in the "generic" test function. Now that test function parsing has been improved to add variable arguments, we should be using the new atom->args field which is the number of actual arguments in the particular parsed test - i.e. the instance rather than the definition. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
The set code incorrectly did (st_mode & ~S_IFMT) | mode, which is the exact inverse of what it should have been, i.e. (st_mode & S_IFMT) | mode Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 08, 2014
-
-
Phillip Lougher authored
Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 06, 2014
-
-
Phillip Lougher authored
Implement perm() test function, this is modelled directly on find -perm and implements its behaviour. Following find, three types of match are supported: perm(mode) - exact match perm(-mode) - all of the permission bits are set for the file perm(/mode) - any of the permission bits are set for the file With perm(/mode) if no permission bits are set in mode match on any file, this is to be consistent with find, which does this to be consistent with the behaviour of -perm -000 Note, only symbolic modes are currently implemented. Octal modes will be implemented next. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 05, 2014
-
-
Phillip Lougher authored
At one point in time it was anticipated that the move action might take multiple arguments. So it used the multi argument setting of "-2"... But the current implementation expects one argument only. But the -2 setting allows zero arguments which isn't expected. So enforce 1 argument. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Update the test function parser to handle variable amount of arguments, as that's now needed for the perm() test function. Up till now, though updating the test parser has been a TODO, it been a low priority because it's done what's needed. Updating the parser to speculatively read the number of arguments present (and hence handle variable number of arguments) has been a TODO even without the need to handle a variable number of arguments because experience gained updating the action parser to do this showed it generates better syntax error messages. Previously the parser just parsed the number of arguments expected, and then quit. The parser now parses all the arguments present, and then compares it against what was expected. No big deal? Well guess what gives the better syntax error if you enter too many arguments. Reading just the number of arguments expected, and then quitting, means the extra arguments cause to paraphrase a "I expected a ) here, and I got a comma or string". Now, you get an error message like "I got 5 arguments, but only expected 2". Which IMHO is a better syntax error message. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 04, 2014
-
-
Phillip Lougher authored
Allowing it to be used by the (to be added later) perm test function. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Sep 03, 2014
-
-
Phillip Lougher authored
If you specify multiple sources (directories and/or files) on the command line, Mksquashfs will merge those sources into a root directory containing all of them. This is different to the behaviour when a single directory is specified, in which case Mksquashfs creates a filesystem with the root containing the contents of the source directory. The difference manifests itself in the way the pathname of each of the directory entries is stored/obtained. Normally to reduce runtime overhead when the directory entries have all come from the same parent directory, the source pathname is not stored in each directory entry, but is computed from the source pathname of the parent directory. But in the case of the "dummy" root created to merge multiple sources specified on the command line, each directory entry does not share the same parent pathname, and so the source pathname of each directory entry is stored in the nonstandard_pathname field. This nonstandard_pathname was originally filled in using a pointer to the source pathname on the command line. Now, if you later exclude one of these source directories, Mksquashfs will free the storage, and it will try and free the nonstandard_pathname field, which leads to a crash as you cannot free a command line argument. The fix to this is to strdup the command line source and store the copy in the directory entry. This is not considered a serious bug, it has not been reported, and the scenario was discovered by chance whilst looking at the code. Additionally the trigger scenario is highly artificial and there is no use-case where this bug will be triggered. To trigger it you need to specifiy multiple source command arguments, and then you need to exclude one of them. But, if you explicitly specified it on the command line why would you later exclude it, and if you did want to exclude it the obvious way would be to remove it from the command line. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Aug 31, 2014
-
-
Phillip Lougher authored
Get rid of the redundant "Action mode: " prefix and make the error messages match others. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Get rid of the redundant "action: " prefix and make the error messages match others. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Fix display of the arguments in the action() statement. Previously it used action->action->args which is the arg count in the "generic" action statement, not the number of actual arguments in the particular parsed action - i.e. the instance rather than the definition. For actions which take a fixed number of arguments there, obviously, is no difference. But for actions which take a variable number of arguments the generic action count is "-2", and it is the responsibility of an specific action parser helper to parse the arguments. In this case the discovered number of arguments in the instance will be different to the -2 argument count in the generic statement. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
When testing the mode action, I'm always typing chmod() as that's what it's called elsewhere. So add chmod as a synonym, it should probably have been called chmod in the first place. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
When I implemented symbolic modes in the mode() action (i.e. u+r-w) I made an oversight. I didn't realise the specification allowed multiple =-+ sequences after the ownership specification. In otherwords if you wanted to add r (+r) and remove w (-w) from user, I assumed you would do u+r,u-w. After revisiting the symbolic mode specification it turns out you should be able to do u+r-w as a short cut to the previous specification. It also should be obvious I don't tend to use the symbolic mode but directly use the octal specification! So fix the parser to allow multiple =-+ sequences. So the syntax of the symbolic mode support goes from [ugoa]+[+-=]PERMS PERMS = [rwxXst]+ or [ugo] to [ugoa]*[[+-=]PERMS]+ PERMS = [rwxXst]+ or [ugo] Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
- Aug 30, 2014
-
-
Phillip Lougher authored
Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-
Phillip Lougher authored
Subpath is the path rooted at the root of the destination filesystem. It includes renames (due to name conflicts), and moves. Pathname is the original source pathname rooted at whatever pathname(s) were given on the command line. Signed-off-by:
Phillip Lougher <phillip@squashfs.org.uk>
-