summaryrefslogtreecommitdiff
path: root/snac.h
diff options
context:
space:
mode:
authorGravatar Alvar Penning2026-02-05 20:58:25 +0100
committerGravatar Alvar Penning2026-02-05 21:17:44 +0100
commitea81780895702b08b0b93ff48bd1876330632b89 (patch)
tree007d4ef16eb1c2d4c20410491754beb07319f610 /snac.h
parentUpdated TODO. (diff)
downloadsnac2-ea81780895702b08b0b93ff48bd1876330632b89.tar.gz
snac2-ea81780895702b08b0b93ff48bd1876330632b89.tar.xz
snac2-ea81780895702b08b0b93ff48bd1876330632b89.zip
strip_exif support for the OpenBSD sandbox
Change the strip_exif logic to work with the already existing OpenBSD sandbox and allow ffmpeg and mogrify to be executed. The previous strip_exif implementation relied on system(3), effectively starting "/bin/sh" and executing the required tool within a shell session. Making this work in the sandbox would require to allow executing "/bin/sh", rendering the sandbox useless. Thus, the code now starts determining the absolute path of the tools - unless they are given as ffmpeg_path or mogrify_path - and allowing them to be executed via unveil(2). Then, instead of the system(3) call, the good old fork(2) and execve(2) dance is performed. The sbox_enter code was made aware of strip_exif, which resulted in a pledge(2) violation before when disable_email_notifications was set to false. Furthermore, the detected paths of the tools are now allowed.
Diffstat (limited to 'snac.h')
-rw-r--r--snac.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/snac.h b/snac.h
index dfc12cb..dfed18a 100644
--- a/snac.h
+++ b/snac.h
@@ -107,6 +107,7 @@ int validate_uid(const char *uid);
107xs_str *hash_password(const char *uid, const char *passwd, const char *nonce); 107xs_str *hash_password(const char *uid, const char *passwd, const char *nonce);
108int check_password(const char *uid, const char *passwd, const char *hash); 108int check_password(const char *uid, const char *passwd, const char *hash);
109 109
110char* findprog(const char *prog);
110int strip_media(const char *fn); 111int strip_media(const char *fn);
111int check_strip_tool(void); 112int check_strip_tool(void);
112 113