@@ -289,19 +289,23 @@ void FileImpl::setExecutableImpl(bool flag)
poco_assert (!_path.empty());
struct stat st;
if (stat(_path.c_str(), &st) != 0)
handleLastErrorImpl(_path);
mode_t mode;
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
{
mode_t wmask = S_IXUSR | S_IXGRP | S_IXOTH;
mode = st.st_mode & ~wmask;
}
- if (chmod(_path.c_str(), mode) != 0)
+ if (chmod(_path.c_str(), mode) != 0)
handleLastErrorImpl(_path);
}