#
370004 |
|
16-Jun-2021 |
git2svn |
libcasper: fix descriptors numbers
Casper services expect that the first 3 descriptors (stdin/stdout/stderr) will point to /dev/null. Which Casper will ensure later. The Casper services are forked from the original process. If the initial process closes one of those descriptors, Casper may reuse one of them for it on purpose. If this is the case, then renumarate the descriptors used by Casper to higher numbers. This is done already after the fork, so it doesn't break the parent process.
PR: 255339 Reported by: Borja Marcos <borjam (at) sarenet.es> Tested by: jkim@
(cherry picked from commit aa310ebfba3d49a0b6b03a103b969731a8136a73)
Git Hash: 6c0a51837f4ba242ea723a887c3b6120d9335c8f Git Author: oshogbo@FreeBSD.org
|
#
296047 |
|
25-Feb-2016 |
oshogbo |
Convert casperd(8) daemon to the libcasper. After calling the cap_init(3) function Casper will fork from it's original process, using pdfork(2). Forking from a process has a lot of advantages: 1. We have the same cwd as the original process. 2. The same uid, gid and groups. 3. The same MAC labels. 4. The same descriptor table. 5. The same routing table. 6. The same umask. 7. The same cpuset(1). From now services are also in form of libraries. We also removed libcapsicum at all and converts existing program using Casper to new architecture.
Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste Partially reviewed by: drysdale@google.com, bdrewery Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D4277
|