std::string resolvedpath = "";
bool failed = true;
- if (currentpath.at(0) != '/') {
+ if ((currentpath.size() == 0) || (currentpath.at(0) != '/')) {
currentpath = this->getCwd() + std::string("/") + currentpath;
}
break;
case FILEMODE_GROUP_EXEC:
- if ((temp.st_mode & S_IWGRP) == S_IWGRP)
+ if ((temp.st_mode & S_IXGRP) == S_IXGRP)
return true;
break;
void suPHP::API_Linux::setUmask(int mode) const throw (SystemException) {
::umask(mode);
}
+
+void suPHP::API_Linux::chroot(const std::string& dir) const
+ throw (SystemException) {
+ if (::chroot(dir.c_str())) {
+ throw SystemException(std::string("chroot() failed: ")
+ + ::strerror(errno), __FILE__, __LINE__);
+ }
+}