Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyukaidesu committed Aug 20, 2014
1 parent 9b7f64a commit 006d26d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Platform_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ bool gt::Platform::checkDirExist(std::string dir)
gt::Log::Debug(std::string(dir + " exists,").c_str());
else
gt::Log::Debug(std::string(dir + " doesn't exists,").c_str());
int permissions =
(st.st_mode & S_IRUSR) |
(st.st_mode & S_IWUSR) |
(st.st_mode & S_IXUSR) |
(st.st_mode & S_IRGRP) |
(st.st_mode & S_IWGRP) |
(st.st_mode & S_IXGRP) |
(st.st_mode & S_IROTH) |
(st.st_mode & S_IWOTH) |
(st.st_mode & S_IXOTH);
if(permissions != 0755) chmod(dir.c_str(), 0755); //fix permissions if they are not good
return state == 0; //stat() returns 0 if the dir exist
}

Expand Down

3 comments on commit 006d26d

@benwaffle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't fix gtorrent#109

@benwaffle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and you may not have permission to fix permissions :P

@fuyukaidesu
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it wrong to assume the user owns his home dir ?

Please sign in to comment.