diff options
| author | default <nobody@localhost> | 2025-01-05 13:17:03 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2025-01-05 13:17:03 +0100 |
| commit | 4985b3e17e1dc7574f8e28c758645a019ba65e7a (patch) | |
| tree | f516a12c630507b9e9e479a0b987cdf550bcd3e9 /data.c | |
| parent | a69968f83d6e2f24ecb2651c66894a9667a0c2e3 (diff) | |
| parent | fced3aa3abae94c97d71ed60bd617c3de47a835d (diff) | |
Merge branch 'master' of grunfink-codeberg:grunfink/snac2
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 39 |
1 files changed, 1 insertions, 38 deletions
@@ -115,44 +115,7 @@ int srv_open(const char *basedir, int auto_upgrade) #define st_mtim st_mtimespec #endif -#ifdef __OpenBSD__ - if (xs_is_true(xs_dict_get(srv_config, "disable_openbsd_security"))) { - srv_debug(1, xs_dup("OpenBSD security disabled by admin")); - } - else { - int smail = !xs_is_true(xs_dict_get(srv_config, "disable_email_notifications")); - const char *address = xs_dict_get(srv_config, "address"); - - srv_debug(1, xs_fmt("Calling unveil()")); - unveil(basedir, "rwc"); - unveil("/tmp", "rwc"); - unveil("/etc/resolv.conf", "r"); - unveil("/etc/hosts", "r"); - unveil("/etc/ssl/openssl.cnf", "r"); - unveil("/etc/ssl/cert.pem", "r"); - unveil("/usr/share/zoneinfo", "r"); - - if (smail) - unveil("/usr/sbin/sendmail", "x"); - - if (*address == '/') - unveil(address, "rwc"); - - unveil(NULL, NULL); - - srv_debug(1, xs_fmt("Calling pledge()")); - - xs *p = xs_str_new("stdio rpath wpath cpath flock inet proc dns fattr"); - - if (smail) - p = xs_str_cat(p, " exec"); - - if (*address == '/') - p = xs_str_cat(p, " unix"); - - pledge(p, NULL); - } -#endif /* __OpenBSD__ */ + sbox_enter(srv_basedir); /* read (and drop) emojis.json, possibly creating it */ xs_free(emojis()); |