Age | Commit message (Collapse) | Author | Files | Lines |
|
We should not consider a username or groupname that starts with digits
as a valid uid or gid. When parsing integers we should parse the strings
fully and not consider any partial parsing to be correct.
Reported-by: Bodo Eggert <7eggert@online.de>
|
|
We need to define this macro to be able to get the declarations for the
struct proc and other struct kproc_info members.
|
|
|
|
|
|
Do not shadow the global err() with a local variable.
|
|
This gives the actual executable name instead of having to look into
argv[0], which is not really correct, as the program doing execve()
can set that to anything it likes.
We have to check for the name being NULL or empty due to an initial
implementation bug.
|
|
|
|
|
|
When setting them sort them on by relative importance/relevance/freeness.
Separate the name with an underscore and use proper case for the kernel
names. Update the name of several OSes/kernels.
|
|
Based-on-a-patch-by: Mo McRoberts <mo@nevali.net>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The function returns an enum status_code, not a bool.
|
|
POSIX states that these can be defined as -1 (unavailable), or 0
(available at build-time, but might or might not be available at
run-time). Handles these, which happens to be the case in Mac OS X.
|
|
Use underscore-prefixed symbols to distinguish the system we are
building for.
|
|
Avoid useless intermediate variables, and use if else to select the
actions.
|
|
|
|
|
|
|
|
|
|
|
|
This is the common name used for the first argument, and avoids the
variable name clash with the function argument with the same name.
This fixes a build failure on */kFreeBSD systems.
|
|
Avoid libkvm-dev to make sure we always use the low-level sysctl(3)
interface.
|
|
|
|
Commit 3db7a6eb4fd16b4cea475009bd80be3a41ada014 would always set
changegroup in the --chuid option, even if no colon is given on the
commandline.
[guillem@debian.org:
- Avoid an else from a fatal if. ]
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Warned-by: gcc
|
|
Introduced in commit 3db7a6eb4fd16b4cea475009bd80be3a41ada014.
Warned-by: coverity
|
|
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>
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
|