aboutsummaryrefslogtreecommitdiffstats
path: root/src/exec.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-18Move src/*.{c,h} to src/core/Pau Espin Pedrol1-290/+0
This way we have all libosmocore.so in an own subdir instead of having lots of files in the parent dir, which also contains subdirs to other libraries. This also matches the schema under include/osmocom/. Change-Id: I6c76fafebdd5e961aed88bbecd2c16bc69d580e2
2021-12-14treewide: remove FSF addressOliver Smith1-4/+0
Remove the paragraph about writing to the Free Software Foundation's mailing address. The FSF has changed addresses in the past, and may do so again. In 2021 this is not useful, let's rather have a bit less boilerplate at the start of source files. Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2020-05-12exec: osmo_system_nowait2: initalize *pw pointer with NULLPhilipp Maier1-1/+2
The pointer *pw is only populated when the the parameter *user is given, otherwise it remains uninitalized while it is used later when the previleges are being dropped. Change-Id: Idec7041e9ea17a252aefbf6fa90091ae17fd4fcd Fixes: CID#209895
2020-04-18exec: Introduce osmo_system_nowait2() to allow specify a userHarald Welte1-2/+48
For a process running as root, it may be desirable to drop privileges down to a normal user before executing an external command. Let's add a new API function for that. Change-Id: If1431f930f72a8d6c1d102426874a11b7a2debd9
2020-02-09exec: propogate errors from osmo_environment_[filter|append]Vadim Yanitskiy1-4/+10
Change-Id: If7d6e0441f73092a4fb455340c076ba4dc60af3f
2020-02-09exec: prevent uninitialized memory access in osmo_system_nowait()Vadim Yanitskiy1-0/+3
If (!env_whitelist && addl_env), osmo_environment_append() would access uninitialized memory. If both are false, execle() would also deal with garbage values. Let's ensure that at least the first element of new_env[] is initialized. Change-Id: Id3901de4692ef44e9e9c67b1804e027fc4ce7c18 Fixes: CID#206571
2019-12-17Introduce helper functions for safe fork+exec of processesHarald Welte1-0/+238
In some situations, we want to execute an external shell command in a non-blocking way. Similar to 'system', but without waiting for the child to complete. We also want to close all file descriptors ahead of the exec() and filter + modify the environment. Change-Id: Ib24ac8a083db32e55402ce496a5eabd8749cc888 Related: OS#4332