summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <chalserogers@gmail.com>2007-09-23 18:51:38 +1000
committerChristopher James Halse Rogers <chalserogers@gmail.com>2007-09-23 18:51:38 +1000
commit785fc4dc1167ad7e845133fa8e082a01d45c5773 (patch)
treebc39ccce98f41b70965af404835ed902ff34503a
parenta29deb7d1483bdab8f6839be3408ff3ac5ac08a5 (diff)
downloadsession-xdg-785fc4dc1167ad7e845133fa8e082a01d45c5773.tar.gz
session-xdg-785fc4dc1167ad7e845133fa8e082a01d45c5773.tar.bz2
Fix permission setting & path creation in mkdirp
-rw-r--r--session.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/session.c b/session.c
index 5488bdd..0762743 100644
--- a/session.c
+++ b/session.c
@@ -314,7 +314,7 @@ sessionWriteWindow (CompWindow *w, char *clientId, char *name, void *user_data)
* file. It should return FALSE if a file exists with the name we want.
**/
-static Bool mkdirp(const char *path, int mode)
+static Bool mkdirp(const char *path, mode_t mode)
{
char *partialPath;
char *delim;
@@ -337,7 +337,7 @@ static Bool mkdirp(const char *path, int mode)
partialPath[delim - path] = '\0';
if (mkdirp (partialPath, mode));
- success = !mkdir (partialPath, mode);
+ success = !mkdir (path, mode);
free (partialPath);
}
@@ -379,7 +379,7 @@ saveState (CompDisplay *d)
FILE *outfile;
getSessionFilePath(filename, 1024);
- if (mkdirp (filename, 700))
+ if (mkdirp (filename, 0700))
{
strncat (filename, "/", 1024);
strncat (filename, smClientId, 1024);