1
1
mirror of http://git.sesse.net/plocate synced 2025-10-06 00:13:40 +02:00

344 Commits

Author SHA1 Message Date
Manfred Schwarb
a3644e43d9 Remove ConditionACPower=true.
A lot of people use laptops like mobile phones, they use it mostly being on
battery and plug it over night, when the device is turned off, or when battery
level is really down. Then most likely the laptop is on battery when the
plocate update job is due. If you are on battery, systemd services with
ConditionACPower=true do silently nothing, the job is not started and there is
only a minor log notice about it which will go unnoticed most likely. As
plocate is really fast, remove ConditionACPower=true from
plocate-updatedb.service.in.
2024-12-09 07:08:28 +01:00
Steinar H. Gunderson
9b705aac46 Bump version number. 2024-12-09 07:07:01 +01:00
Steinar H. Gunderson
fd7e1f0a1a Release plocate 1.1.23. 1.1.23 2024-11-24 23:14:30 +01:00
Lucas Werkmeister
d7a9d84a65 Sandbox plocate-update.service some more
A variety of sandboxing options, as long as they do not introduce bind
mounts. (Bind mounts cause problems, as noted in commit 1acc100b09, so
leave out ProtectSystem= and a few other options.) The system call
filter is relatively broad, so it will hopefully not break things.
(@chown and CAP_CHOWN are needed because the updater fchown’s the
database file.)

CAP_DAC_READ_SEARCH and CAP_CHOWN together are unfortunately mostly
equivalent to CAP_DAC_OVERRIDE, in that the updater can access any file,
chown it to itself, and then write to it. Users who do not need
--prune-bind-mounts support may wish to enable ProtectSystem=strict
(together with ReadWritePaths= or an equivalent option to make the
database file writable again). But at least this still filters out a lot
of other capabilities.
2024-11-13 20:41:28 +01:00
Petasus Ruber
333235850b Start timer immediately instead of on reboot 2024-11-12 09:28:46 +01:00
Michal Sekletar
889638fcea Reset string explicitely to prevent undefined behavior 2024-08-28 18:24:49 +02:00
Michal Sekletar
80d6f4a60c Don't leak file descriptor 2024-08-28 18:24:49 +02:00
Michal Sekletar
de286d0903 Avoid writing uninitialized header data 2024-08-28 18:24:49 +02:00
Steinar H. Gunderson
5cf809c353 Bump version number. 2024-07-28 09:39:46 +02:00
Ondrej Mosnáček
8d102a55cc Run updatedb with low scheduling priority
On my workstation, plocate-updatedb often starts right after waking up
from suspend in the morning, consuming a lot of CPU time and slowing
down other running processes. Mitigate this by specifying a low
scheduling priority in the unit file.

For reference, man-db's unit file does the same:
0df248b30b/init/systemd/man-db.service.in (L13)

Signed-off-by: Ondrej Mosnáček <omosnacek@gmail.com>
2024-07-27 09:15:41 +02:00
Steinar H. Gunderson
cc95fed7a2 Release plocate 1.1.22. 1.1.22 2024-01-12 16:18:01 +01:00
Steinar H. Gunderson
a03412e91a Revert "In updatedb, check prunepaths _before_ opening the directory."
This reverts commit 6e7991e5e0.

David Caldwell pointed out that this breaks prunepaths that are not
directly on the root, since we now get /b before /a/a and this breaks
the expectation that the prunepaths list is iterated through in order.
2024-01-12 16:15:22 +01:00
Steinar H. Gunderson
4696bbc488 Clean up some legacy logic in filesystem_is_excluded(). 2024-01-06 17:43:29 +01:00
Steinar H. Gunderson
f0941b2f09 Bump version number. 2024-01-06 17:36:10 +01:00
Steinar H. Gunderson
59e63cbf6b Release plocate 1.1.21. 1.1.21 2024-01-06 17:03:10 +01:00
Steinar H. Gunderson
1ef357761c tmpwatch is not kept in sync with plocate. 2024-01-06 16:11:44 +01:00
Steinar H. Gunderson
519b3bc11a Include prunepaths in bind mount pruning logic. 2024-01-06 15:59:05 +01:00
Steinar H. Gunderson
046336f640 Remove mount entries that will be pruned away due to prunefs.
This should fix https://bugs.debian.org/1055450, where /home and
/run/schroot/mount/<something>/home were found to be duplicates
and the latter had the lower ID, but then /run was pruned out
and there was no indexing of the directory at all.

We can still see things like this in the form of prunepaths,
I believe.
2024-01-06 15:52:04 +01:00
Steinar H. Gunderson
eeacf2ed3c Remove the last remnants of translation support. 2024-01-06 14:44:59 +01:00
Steinar H. Gunderson
ca5b4e7df2 Remove an unneeded #include. 2024-01-06 14:44:42 +01:00
Steinar H. Gunderson
3a6c45e193 Remove some globals from the bind mount code. 2024-01-05 08:49:04 +01:00
Steinar H. Gunderson
3c65bf907c Remove obsolete comment about obstacks. 2024-01-04 23:19:21 +01:00
Steinar H. Gunderson
c13691f954 Remove some comments left over from mlocate.
We don't support gettext (although perhaps we should), so remove
some comments saying that we don't translate debug output.
2024-01-04 23:18:38 +01:00
Steinar H. Gunderson
6e7991e5e0 In updatedb, check prunepaths _before_ opening the directory.
This makes sure we never even try to enter a directory if it is
in prunepaths (much like we already do with prunenames).

Inspired by https://bugs.debian.org/1025099, although it doesn't
fix that issue (we still open it before checking prunefs).
2024-01-04 23:10:15 +01:00
Steinar H. Gunderson
07e5cc4d0b Bump version number. 2024-01-04 23:09:27 +01:00
Steinar H. Gunderson
64d41711c1 Release plocate 1.1.20. 1.1.20 2023-12-31 14:26:05 +01:00
Steinar H. Gunderson
5ec2c63511 Add an undocumented flag --ignore-visibility.
This is mostly useful in the case where you are root, but the directories
in question no longer exist (or were never there to begin with) and you
still want to search in the database, or dump all of it using plocate ''.
Obviously, this needs to drop the sgid flag like --debug already does,
so we do that.

Using this together with -e/--existing doesn't make any sense,
but we don't have any explicit checks for it.
2023-12-31 11:29:43 +01:00
Florian Schmaus
05665a91e7 timer: set AccuracySec to 6h and RandomizedDelaySec to 1h
The previous configuration caused the updatedb timer to run
potentially in the late morning. However this should be avoided to not
affect normal users. Furthermore, the low setting of AccuracySet to
20m caused a low chance of systemd to coalesce the updatedb timer with
other timers.

Increase the AccuracySec to 6h so that systemd is more likely to be
able to coalesce the timer with others in an effort to optimize power
consumption.

Furthermore, lower RandomizedDelaySec to 1h, to ensure that the
plocate updatedb job runs before 07:00 in the morning (and after
midnight).
2023-11-16 00:18:06 +01:00
Steinar H. Gunderson
994819bafa Fix updatedb writing incomplete .db files under Termux.
Report and patch by Grisha Levit; see

  https://unix.stackexchange.com/questions/739150/var-lib-plocate-plocate-db-has-version-4294967295-expected-0-or-1-please-reb/761248#761248

for the entire story.
2023-11-12 00:18:58 +01:00
Steinar H. Gunderson
e4e68f1123 Fix all relevant instances of wrong hyphens in man pages.
Cf. https://lwn.net/Articles/947941/, not escaping - will change
e.g. “plocate-build” to “plocate(Unicode dash)build”, which breaks
cut-and-paste. We had this right most places, but not all.
2023-10-24 00:46:44 +02:00
Steinar H. Gunderson
1789fba4eb Bump version number. 2023-10-24 00:46:40 +02:00
Steinar H. Gunderson
cbc153c598 Release plocate 1.1.19. 1.1.19 2023-06-09 09:24:29 +02:00
Steinar H. Gunderson
bbaf87d17e Revert stray patch that inadvertently became part of 1.1.18. 2023-06-09 09:24:02 +02:00
Tim Landscheidt
ca28328e10 Fix man page for "--add-single-prunepath"
The option "--add-single-prunepath" has no short version.
2023-05-08 16:17:06 +02:00
Nick Alcock
7f39444852 uring: always pair io_uring_get_probe_ring and io_uring_free_probe
As of liburing 2.4-to-be, liburing has ceased using malloc for its
probe allocations: it's concealed behind layers of confusing macros,
but io_uring_get_probe_ring() doesn't actually use libc's malloc
but ratehr its own __uring_alloc/__uring_free functions.  So it no
longer works to free() the return value of io_uring_get_probe_ring():
you have to use io_uring_free_probe() instead.

I am going to report this to liburing upstream as a possible bug,
but it is easy to work around in plocate in any case.
2023-03-20 13:09:02 +01:00
Steinar H. Gunderson
a81eb2f236 Add missing <inttypes.h> #include.
Reported by sudhanshu goswami.
2023-02-08 22:47:05 +01:00
Steinar H. Gunderson
72a0c25dc9 Fix missing newline in error message. 2023-01-28 22:06:40 +01:00
Steinar H. Gunderson
bb7206e3ba Bump version number. 2023-01-28 22:06:14 +01:00
Steinar H. Gunderson
068e02eec2 Release plocate 1.1.18. 1.1.18 2023-01-28 21:45:19 +01:00
Steinar H. Gunderson
9e431e8c15 Correct the plocate-build man page around --require-visibility. 2023-01-05 18:25:08 +01:00
Steinar H. Gunderson
63815d4402 Support the --require-visibility flag in plocate-build. 2023-01-04 23:46:01 +01:00
Steinar H. Gunderson
bbece6e378 Fix a deprecation warning when running meson. 2023-01-04 00:00:11 +01:00
Steinar H. Gunderson
59e91ecf33 Fix display of rlim_t in ulimit error message on 32-bit platforms.
Reported by Jakub Wilk (Debian bug #1027702).
2023-01-03 23:58:13 +01:00
Steinar H. Gunderson
6ae351ed1b Bump version number. 2023-01-03 23:51:29 +01:00
Steinar H. Gunderson
7e5defd4e7 Release plocate 1.1.17. 1.1.17 2022-11-21 18:26:34 +01:00
Clément Pit-Claudel
31641da575 Return 1 if no matches were found
* plocate.1: Document this new behavior.
* plocate.cpp (do_search_file, main): Exit with code 1 if no matches were found.

This behavior is consistent with that of mlocate except with --limit=0, which
plocate rejects.
2022-11-07 11:30:36 +01:00
Steinar H. Gunderson
6c2976c34e Add missing <locale.h>.
Reported by Maciej Adamczyk.
2022-10-27 00:38:57 +02:00
Steinar H. Gunderson
5219c70754 Fix a Meson warning. 2022-10-15 15:46:03 +02:00
Steinar H. Gunderson
19e638d54b Use unique_lock CTAD.
It's not useful to write unique_lock<mutex> in C++17;
unique_lock will do.
2022-10-15 15:44:47 +02:00
Steinar H. Gunderson
fd6198891d Remove dependency on non-POSIX header error.h.
This helps compatibility with certain configurations of musl libc.
Note that the output format on updatedb.conf errors will change somewhat,
and only the first one will be reported followed by immediate exit
(unlike earlier, where all updatedb.conf errors would be output before exit).

Based on a patch by Alfred Persson Forsberg.
2022-07-13 22:31:54 +02:00