[recipes] Fix oversights in directory creation



commit 0c3473c876bf93e63a855a591d492f75d926af0b
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 30 00:41:53 2017 +0100

    Fix oversights in directory creation
    
    I didn't mean to use a literal "subdir" here, and I did not
    pass the proper arguments to mkdir.

 src/gr-utils.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/gr-utils.c b/src/gr-utils.c
index 27e40c9..3fd55cf 100644
--- a/src/gr-utils.c
+++ b/src/gr-utils.c
@@ -20,9 +20,11 @@
 
 #include "config.h"
 
-#include <glib/gi18n.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <sys/stat.h>
+
+#include <glib/gi18n.h>
 
 #include "gr-utils.h"
 #include "gr-app.h"
@@ -473,8 +475,8 @@ ensure_rotated_image (const char *path,
         basename = g_path_get_basename (path);
         subdir = g_strdup_printf ("images%d", angle);
 
-        dir = g_build_filename (g_get_user_cache_dir (), "recipes", "subdir", NULL);
-        g_mkdir_with_parents (dir, 755);
+        dir = g_build_filename (g_get_user_cache_dir (), "recipes", subdir, NULL);
+        g_mkdir_with_parents (dir, S_IRWXU | S_IRWXG | S_IRWXO);
 
         rotated = g_build_filename (dir, basename, NULL);
         if (!g_file_test (rotated, G_FILE_TEST_EXISTS)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]