SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,27 @@
Re-instate the chroot by default code.
Index: conv.c
--- conv.c.orig
+++ conv.c
@@ -289,7 +289,9 @@ daemonize_finish(void)
* For security, chroot (optionally) and drop privileges.
* Pass a NULL chroot_dir to disable chroot() behaviour.
*/
-void privdrop(const char *chroot_dir, const char *privdrop_user) {
+void
+privdrop(const char *chroot_dir, const char *privdrop_user)
+{
struct passwd *pw;
errno = 0;
@@ -301,9 +303,7 @@ void privdrop(const char *chroot_dir, const char *priv
else
err(1, "getpwnam(\"%s\") failed", privdrop_user);
}
- if (chroot_dir == NULL) {
- verbosef("no --chroot dir specified, darkstat will not chroot()");
- } else {
+ if (chroot_dir != NULL) {
tzset(); /* read /etc/localtime before we chroot */
if (chdir(chroot_dir) == -1)
err(1, "chdir(\"%s\") failed", chroot_dir);