[pacman-dev] [PATCH] Use "mode" in _alpm_makepath_mode

Allan McRae allan at archlinux.org
Mon Feb 20 19:01:44 EST 2012


It seems that if we pass the permissions that we want the created
directory to have, then we should probably use it...

Signed-off-by: Allan McRae <allan at archlinux.org>
---

<falconindy> NOW I LOOK LIKE THE ASS WHO DIDNT FIX IT

 lib/libalpm/util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index ba079f4..22e9e35 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -118,7 +118,7 @@ int _alpm_makepath_mode(const char *path, mode_t mode)
 		/* temporarily mask the end of the path */
 		*ptr = '\0';
 
-		if(mkdir(str, 0755) < 0 && errno != EEXIST) {
+		if(mkdir(str, mode) < 0 && errno != EEXIST) {
 			ret = 1;
 			goto done;
 		}
@@ -129,7 +129,7 @@ int _alpm_makepath_mode(const char *path, mode_t mode)
 
 	/* end of the string. add the full path. It will already exist when the path
 	 * passed in has a trailing slash. */
-	if(mkdir(str, 0755) < 0 && errno != EEXIST) {
+	if(mkdir(str, mode) < 0 && errno != EEXIST) {
 		ret = 1;
 	}
 
-- 
1.7.9.1



More information about the pacman-dev mailing list