fixed GH #1934: File::setExecutable() on POSIX should set executable bit for group and other if corresponding readable bit is set

This commit is contained in:
Guenter Obiltschnig 2017-10-31 22:17:33 +01:00
parent 1f546c4502
commit 0c4cbb55ff

View File

@ -339,6 +339,10 @@ void FileImpl::setExecutableImpl(bool flag)
if (flag)
{
mode = st.st_mode | S_IXUSR;
if (st.st_mode & S_IRGRP)
mode |= S_IXGRP;
if (st.st_mode & S_IROTH)
mode |= S_IXOTH;
}
else
{
@ -425,7 +429,7 @@ void FileImpl::removeImpl()
bool FileImpl::createFileImpl()
{
poco_assert (!_path.empty());
int n = open(_path.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (n != -1)
{