patch-lib_clib_soup.c - pkgsrc-localpatches - leot's pkgsrc LOCALPATCHES
 (HTM) hg clone https://bitbucket.org/iamleot/pkgsrc-localpatches
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
       patch-lib_clib_soup.c
       ---
            1 $NetBSD$
            2 
            3 Adjust permissions for cookies.db.
            4 
            5 --- clib/soup.c.orig    2018-09-22 23:42:41.000000000 +0000
            6 +++ clib/soup.c
            7 @@ -24,6 +24,7 @@
            8  #include "common/signal.h"
            9  #include "web_context.h"
           10  
           11 +#include <glib/gstdio.h>
           12  #include <libsoup/soup.h>
           13  #include <webkit2/webkit2.h>
           14  
           15 @@ -100,10 +101,16 @@ static void
           16  luaH_soup_set_cookies_storage(lua_State *L)
           17  {
           18      const gchar *new_path = luaL_checkstring(L, 3);
           19 +    FILE *f;
           20      if (g_str_equal(new_path, ""))
           21          luaL_error(L, "cookies_storage cannot be empty");
           22      g_free(cookies_storage);
           23      cookies_storage = g_strdup(new_path);
           24 +    
           25 +    if ((f = g_fopen(cookies_storage, "a")) == NULL)
           26 +        luaL_error(L, "Could not open cookies_storage");
           27 +    g_chmod(cookies_storage, 0600);
           28 +    fclose(f);
           29  
           30      WebKitWebContext * web_context = web_context_get();
           31      WebKitCookieManager *cookie_mgr = webkit_web_context_get_cookie_manager(web_context);