[vlc-devel] [PATCH] win32: filesystem: transform UNIX permissions into Windows flags for _wopen()

Rémi Denis-Courmont remi at remlab.net
Tue Sep 26 15:43:44 CEST 2017


Le 26 septembre 2017 13:39:49 GMT+03:00, Steve Lhomme <robux4 at videolabs.io> a écrit :
>---
> src/win32/filesystem.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
>diff --git a/src/win32/filesystem.c b/src/win32/filesystem.c
>index 29a7a3fc4d..b3a5b6b6ea 100644
>--- a/src/win32/filesystem.c
>+++ b/src/win32/filesystem.c
>@@ -81,7 +81,15 @@ int vlc_open (const char *filename, int flags, ...)
> 
>     va_start (ap, flags);
>     if (flags & O_CREAT)
>-        mode = va_arg (ap, int);
>+    {
>+        int unixmode = va_arg(ap, int);
>+        if (unixmode & 0444)
>+            mode |= _S_IREAD;
>+        if (unixmode & 0222)
>+            mode |= _S_IWRITE;
>+        if (unixmode & 0111)
>+            mode |= _S_IEXEC;
>+    }
>     va_end (ap);
> 
>     /*
>-- 
>2.12.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

Aren't read and exec permissions no-ops on Windows? This looks overkill.

And I'd only check S_IWUSR, not all three write bits...

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


More information about the vlc-devel mailing list