Age | Commit message (Collapse) | Author |
|
Saves one malloc(3) and one listxattr(2) per file that has no xattrs.
On my system, this improves `time metastore -d /usr >/dev/null` from:
real 0m2.347s
user 0m0.732s
sys 0m1.603s
to:
real 0m2.183s
user 0m0.733s
sys 0m1.435s
Average of 5 runs, on a warm cache, reducing runtime by roughly 7%.
|
|
|
|
Apply mtime using utimensat() instead of utime(), which not only
supports setting nanoseconds, but also omitting atime change (last
access time), and working on symlinks - we use all of that.
Reported-by: Björn Haßler <bjohas@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
Previously metastore would fail if running from / and paths were given:
$ pwd
/
$ metastore -d bin
lstat failed for .bin: No such file or directory
Now it works properly:
$ metastore -d bin | head -1
lrwxrwxrwx root root 2018-08-17 16:31:23.120322532 +0200 ./bin/hostname
Signed-off-by: Przemyslaw Pawelczyk <przemoc@gmail.com>
|
|
|
|
|
|
|
|
|
|
Support building with no extended attributes support when NO_XATTR
macro is predefined to non-0 value (e.g. put -DNO_XATTR in CFLAGS).
|
|
|
|
|
|
Also change level of usage message shown after critical one to error,
so it can be suppressed without hiding critical one if desired (-qqq).
|
|
README is actually written in markdown, but I don't like .md extension.
README.md is here only for better experience of web viewers of the repo,
it's set to be not exported by git archive and won't be present in
released tarballs.
BTW if GitHub is offline, you can use following unofficial mirror:
http://repo.or.cz/metastore.git
(It also renders README.md file, that's why I mentioned it here.)
|
|
|
|
The Software Package Data Exchange (SPDX) is a good initiative, it has
matured over time and deserves accelerated adoption in open-source.
https://spdx.org/learn
https://spdx.org/using-spdx
https://spdx.org/license-list
|
|
Reformat second paragraph for better look. It had awkward line wrap.
Modernize third paragraph. No need to send letters to FSF in Boston.
|
|
David misdocumented read/write int functions back in commit
5fed2f9169fdd0585cc83ff0fa8210d97da77cb2 (2007-05-19) and later it
probably got copy-pasted to the documentation of file format.
|
|
Avoid using VLAs when it is not really needed, especially in cases like
this one here, when possible array size is very limited (1-8 bytes).
|
|
Declare file-scope objects or functions that do not need external
linkage as static.
|
|
Explicitly specify void when a function accepts no arguments.
|
|
|
|
|
|
See commit 16cde6c32fb3e0640ac01ca5d8ddea127f59106c for details.
|
|
|
|
PATH_MAX is not guaranteed by POSIX to be present and some systems, like
GNU Hurd, indeed does not define it.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
https://www.gnu.org/software/hurd/hurd/porting/guidelines.html
For now let's define PATH_MAX as 4096 (if it is not already defined),
because that's how Linux defines it and it seems quite reasonable.
In future dependence on PATH_MAX can be removed.
|
|
|
|
https://bugs.debian.org/883539
Requested-by: Romain Francoise <rfrancoise@debian.org>
|
|
|
|
|
|
Signed-off-by: Przemyslaw Pawelczyk <przemoc@gmail.com>
|
|
Wrong type has been used for calculating size of requested memory.
Underallocation happened in mentries_fromfile() code path if
sizeof(ssize_t) > sizeof(int), which is true on 64-bit platforms.
Reading metadata file with extended attributes entries led to corruption
of metadata represented in memory on such platforms, so applying could
led to corruption of metadata on disk too.
Reported-by: Uros Juvan <asmpro@gmail.com>
|
|
That way we can avoid possible (yet not feasible in current code)
NULL pointer dereference.
|
|
|
|
It's required to avoid getting warnings w/ glibc >= 2.20.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Starting from upcoming version 1.1.0 I won't ever put planned release
date of the next version in NEWS file.
|
|
Zak most likely mistakenly committed original patch (*) with email used
for his Anki-Plugins git repository.
(*) Mind that I amended the one present in this repository
[f75ca58c96bb] and rewrote its commit message.
|
|
|
|
|