Age | Commit message (Collapse) | Author | Files | Lines |
|
Warned-by: coverity
|
|
This function and macros are unused, now that all commands have been
reimplemented fully as built-ins.
|
|
Do not execute itself with --set or --auto for each alternative to
set a selection for, just handle them in-process.
|
|
Do not execute itself with --config for each alternative to configure,
just handle them all in-process.
|
|
We will need to use functions defined further down the file, so let's
move these ones after alternative_update().
|
|
This simplifies the main() function, and will allow reusing some of
these new functions to avoid having to call itself.
|
|
We will use this name for the actual alternative remove action.
|
|
No callers have been found in Debian parsing the best version of an
alternative.
|
|
|
|
As a side effect now a missing group after ‘:’ on --chuid is a fatal
error.
Warned-by: coverity
|
|
|
|
Use clock_gettime(CLOCK_MONOTONIC) if available instead of
gettimeofday() which gets affected by abrupt system clock changes, and
might mess with the timeout calculations.
Closes: #783014
Suggested-by: Jose M Calhariz <jose.calhariz@hds.com>
|
|
Switch to use pselect() instead of select().
|
|
Cherry picked from commit eaa073bc37901a6d8c46abc9fa5e7ec5551df04b.
We should close the kvm instances after every operation, so not to leak
them, as they might exhaust the file descriptor pool, or leak into the
started process.
Closes: #779467
Based-on-patch-by: Jeff Epler <jepler@unpythonic.net>
|
|
|
|
That is "" or '', and not the unbalanced `' pair.
|
|
This should make it more clear we are talking about the key and not
something else.
|
|
|
|
This makes it possible to correctly translate the string.
Required-by: #766311
|
|
This is the counter-option to --make-pidfile, so that programs that need
their pidfile created can use an option to remove them without needing
to do that manually.
|
|
Regression introduced in commit 29778da537e2ff1a0f032db33dde43413b7345ef.
When the user asked us to create the pidfile, but _not_ to background
ourselves, we should still create the pidfile.
This usage is somewhat dubious, as s-s-d has an option to background,
which is better in any way, as it will make sure to return error codes
in case the program cannot be started for whatever reason. But it's
still a regression.
Closes: #765110
|
|
Return NULL, and let the call sites return false themselves. This fixes
the code failing on retries when the process has disappeared.
|
|
We do not need that file, as we are not using any kvm_read(3) call,
either explicitly or implicitly. Everything is retrieved through
sysctl(2).
libkvm from FreeBSD allows to pass /dev/null as the memory file to
denote that we do not need it.
This will make s-s-d work again on jails which do not usually have
/dev/mem available.
Reported-by: Steven Chamberlain <steven@pyro.eu.org>
|
|
Create two new functions, ssd_kvm_open() and ssd_kvm_get_procs().
|
|
When running with «--stop» and only pid or ppid as matching options,
start-stop-daemon aborts with a "no match option" error.
«pid» and «ppid» are proper matching options, so they should be enough
to proceed.
Missed in commits 80de58344cb38ab085ca2c7808f4f7b3be1d2422 and
3fabf94e0b5fe1bcdea26fecee1c87e74fab98b2.
Closes: #763767
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Although this got partially corrected with the fix for the background
and pidfile creation bug, it still migth happen that the parent had a
too restrictive umask.
Closes: #760222
Reported-by: Will Conley <willconley3@gmail.com>
|
|
When using the --background option combined with --make-pidfile, the
parent process might end up exiting before the child's pidfile has been
created, which might confuse service supervising programs.
Fix the race condition by making the first parent wait for the second
one, so that it can safely create the pidfile if required.
Closes: #686420
Based-on-patch-by: Nir Soffer <nirs@hyperms.com>
|
|
We'll be needing to call the former in the latter.
|
|
This requires to check the setpgid() return value in the setsid()
compatibility function.
|
|
We do not need TEST_PREFIX anymore, as the prefixes are implicit for
each typo of test case. Use the build directory for compiled programs
and the source directory for scripts.
|
|
Use libkvm instead of relying on linprocfs, which is not the native
procfs on kFreeBSD, and it is usually not mounted as FreeBSD programs
do not expect it to be present.
This stops making the code handle GNU/kFreeBSD as if it was a
Linux-based system.
|
|
|
|
Closes: #734452
Based-on-patch-by: Hleb Valoshka <375gnu@gmail.com>
|
|
|
|
|
|
|
|
|
|
There are OpenVZ Linux kernels that instead of appending, prepend the
deleted marker, making the exec check fail to match. Add a workaround
so that those systems do not get affected.
This will still be affecting any other userland tool that checks the
/proc/PID/exe symlink, and might end up helping this behaviour to get
entrenched, but better this than the getting strange system failures.
Closes: #731530
|
|
We are performing the same search twice, let's just reuse the fs pointer
to decide if we have found the choice.
This was confusing coverity, and making it think that
alternative_has_broken_slave() could get fs with a NULL value.
Warned-by: coverity
|
|
This does not have any security implications, but it makes the code
more robust.
Warned-by: coverity
|
|
This does not have any security implications, but it makes the code
more robust.
Warned-by: coverity
|
|
This makes it possible to embed libcompat inside libdpkg, so that the
static library that we ship is self contained with the required
compatibility code, specifically the MD5 functions.
This also prepares the build system for when we start building a
shared library, although it disables it by default.
Closes: #746122
|
|
This might happen if the executable pathname is longer than
_POSIX_PATH_MAX. Although this should not have security implications
as the buffer is surrounded by two arrays (so those catch accesses
even if the stack grows up or down), and we are compiling with
-fstack-protector anyway.
We just need to always leave room for the final NUL character.
Warned-by: coverity
|
|
Free prio_str and master_file.
Warned-by: coverity
|
|
This allows to check for processes with a specific parent PID.
Suggested-by: Alex Mestiashvili <mailatgoogl@gmail.com>
|
|
Instead of hardcoding their usage depending on system macros.
|
|
|
|
|
|
Use the KERN_PROC_PATHNAME sysctl interface to retrieve the process
pathname. This will allow to stop requiring the linprocfs fileystem
which is not the native procfs and is not usually mounted by default
anyway.
This still has the problem that the pathname cannot be retrieved when
the inode has been unlinked, in the same way as when accessing the
/proc/<PID>/exe symlink from linprocfs.
|
|
|