X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fspool_in.c;h=cd74d1ee7cee74ba611b0cbc75cc1872a8aed84f;hb=49e56fb37f587bf0e69d2fbe76fa0793f898c26f;hp=33890c516715788cab6e074c1d84df2604dc7590;hpb=64b67b658a37dd780cc1b2fd0ef87febe461a0ba;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/spool_in.c b/src/src/spool_in.c index 33890c516..cd74d1ee7 100644 --- a/src/src/spool_in.c +++ b/src/src/spool_in.c @@ -57,9 +57,17 @@ for (i = 0; i < 2; i++) fname = spool_fname(US"input", message_subdir, id, US"-D"); DEBUG(D_deliver) debug_printf("Trying spool file %s\n", fname); + /* We protect against symlink attacks both in not propagating the + * file-descriptor to other processes as we exec, and also ensuring that we + * don't even open symlinks. + * No -D file inside the spool area should be a symlink. + */ if ((fd = Uopen(fname, #ifdef O_CLOEXEC O_CLOEXEC | +#endif +#ifdef O_NOFOLLOW + O_NOFOLLOW | #endif O_RDWR | O_APPEND, 0)) >= 0) break;