Skip to content

Commit

Permalink
Do the right chmod
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Aug 29, 2014
1 parent 7617159 commit 78b91b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/util.c
Expand Up @@ -209,7 +209,7 @@ int rad_mkdir(char *directory, mode_t mode)
rcode = mkdir(directory, mode & 0777);
if (rcode < 0) {
if (errno == EEXIST) {
return chmod(directory, mode);
return 0; /* don't change permissions */
}

if (errno != ENOENT) {
Expand Down Expand Up @@ -240,9 +240,9 @@ int rad_mkdir(char *directory, mode_t mode)
} /* else we successfully created the directory */

/*
* Assume that the permissions are correct.
* Set the permissions on the created directory.
*/
return 0;
return chmod(directory, mode);
}


Expand Down

0 comments on commit 78b91b5

Please sign in to comment.