changeset 7614:48d7eea88598

[gaim-migrate @ 8238] Hopefully this will fix the permissions errors some people are getting on mkdir(). I have _no_ idea why it's happening, so I don't know if this will work ... if anyone does know, please do tell. Also fix a one-off in the pathname creation which was causing '/' to be inserted twice at the root. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Sun, 23 Nov 2003 21:03:28 +0000
parents 62d11301b8a6
children 310013ee693e
files src/util.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/util.c	Sun Nov 23 20:02:45 2003 +0000
+++ b/src/util.c	Sun Nov 23 21:03:28 2003 +0000
@@ -1197,7 +1197,7 @@
 		return -1;
 
 	dir = g_new0(char, strlen(path) + 1);
-	components = g_strsplit(path, delim, -1);
+	components = g_strsplit(path + 1, delim, -1);
 	len = 0;
 	for (cur = 0; components[cur] != NULL; cur++) {
 		dir[len++] = G_DIR_SEPARATOR;
@@ -1225,6 +1225,11 @@
 			g_free(dir);
 			return -1;
 		}
+		/* For some reason, the above mkdir doesn't properly
+		 * set permissions for some people ... and I have NO
+		 * idea why not.  In the meantime, we'll attempt to
+		 * set them explicitly. */
+		chmod(dir, mode);
 	}
 
 	g_strfreev(components);