Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions smbclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,9 @@ PHP_FUNCTION(smbclient_utimes)
hide_password(file, file_len);
switch (state->err = errno) {
case EINVAL: php_error(E_WARNING, "Couldn't set times on %s: the client library is not properly initialized", file); break;
case EPERM: php_error(E_WARNING, "Couldn't set times on %s: permission was denied", file); break;
case EPERM:
case EACCES:
php_error(E_WARNING, "Couldn't set times on %s: permission was denied", file); break;
default: php_error(E_WARNING, "Couldn't set times on %s: unknown error (%d)", file, errno); break;
}
RETURN_FALSE;
Expand Down Expand Up @@ -1486,7 +1488,9 @@ PHP_FUNCTION(smbclient_listxattr)
switch (state->err = errno) {
case EINVAL: php_error(E_WARNING, "Couldn't get xattrs: library not initialized"); break;
case ENOMEM: php_error(E_WARNING, "Couldn't get xattrs: out of memory"); break;
case EPERM: php_error(E_WARNING, "Couldn't get xattrs: permission denied"); break;
case EPERM:
case EACCES:
php_error(E_WARNING, "Couldn't get xattrs: permission denied"); break;
case ENOTSUP: php_error(E_WARNING, "Couldn't get xattrs: file system does not support extended attributes"); break;
default: php_error(E_WARNING, "Couldn't get xattrs: unknown error (%d)", errno); break;
}
Expand Down Expand Up @@ -1566,7 +1570,9 @@ PHP_FUNCTION(smbclient_getxattr)
switch (state->err = errno) {
case EINVAL: php_error(E_WARNING, "Couldn't get xattr for %s: library not initialized or incorrect parameter", url); break;
case ENOMEM: php_error(E_WARNING, "Couldn't get xattr for %s: out of memory", url); break;
case EPERM: php_error(E_WARNING, "Couldn't get xattr for %s: permission denied", url); break;
case EPERM:
case EACCES:
php_error(E_WARNING, "Couldn't get xattr for %s: permission denied", url); break;
case ENOTSUP: php_error(E_WARNING, "Couldn't get xattr for %s: file system does not support extended attributes", url); break;
default:
if (xattr_size == MAXIMUM_BUFFER_SIZE) {
Expand Down Expand Up @@ -1605,7 +1611,9 @@ PHP_FUNCTION(smbclient_setxattr)
case EEXIST: php_error(E_WARNING, "Couldn't set attribute on %s: attribute already exists", url); break;
case ENOATTR: php_error(E_WARNING, "Couldn't set attribute on %s: attribute does not exist", url); break;
case ENOTSUP: php_error(E_WARNING, "Couldn't set attribute on %s: not supported by filesystem", url); break;
case EPERM: php_error(E_WARNING, "Couldn't set attribute on %s: permission denied", url); break;
case EPERM:
case EACCES:
php_error(E_WARNING, "Couldn't set attribute on %s: permission denied", url); break;
default: php_error(E_WARNING, "Couldn't set attribute on %s: unknown error (%d)", url, errno); break;
}
RETURN_FALSE;
Expand Down Expand Up @@ -1635,7 +1643,9 @@ PHP_FUNCTION(smbclient_removexattr)
case EINVAL: php_error(E_WARNING, "Couldn't remove attribute on %s: client library not properly initialized", url); break;
case ENOMEM: php_error(E_WARNING, "Couldn't remove attribute on %s: out of memory", url); break;
case ENOTSUP: php_error(E_WARNING, "Couldn't remove attribute on %s: not supported by filesystem", url); break;
case EPERM: php_error(E_WARNING, "Couldn't remove attribute on %s: permission denied", url); break;
case EPERM:
case EACCES:
php_error(E_WARNING, "Couldn't remove attribute on %s: permission denied", url); break;
default: php_error(E_WARNING, "Couldn't remove attribute on %s: unknown error (%d)", url, errno); break;
}
RETURN_FALSE;
Expand Down