On Tue, Jan 19, 2016 at 09:09:49AM +0100, Matthias Kilian wrote:
> Add a binding to pledge(2) to package 'unix'.

Just a question, as I am unsure by just reading the code.

> Index: files/Process.hsc
> ===================================================================
> RCS file: files/Process.hsc
> diff -N files/Process.hsc
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ files/Process.hsc 19 Jan 2016 07:58:19 -0000
> @@ -0,0 +1,29 @@
> +{-# LANGUAGE Safe #-}
> +
> +module System.OpenBSD.Process ( pledge ) where
> +
> +import Foreign
> +import Foreign.C
> +import System.Posix.Internals ( withFilePath )
> +
> +pledge :: String -> [FilePath] -> IO ()

Shouldn't be:

pledge :: String -> Maybe [FilePath] -> IO ()

in order to differenciate passing not second argument, and an empty
array ?


Because these C codes have differents meaning:

pledge("stdio rpath", NULL)

and

char *empty = {NULL};
pledge("stdio rpath", empty);

The first is to not specify `paths' argument (so no particular addition
restriction), and the second is to add the restriction to no accessible
paths (but well, it is EINVAL currently).

Thanks.
-- 
Sebastien Marie

Reply via email to