common BUGFIX perm value -1 means keep current values
@@ -1371,6 +1371,7 @@ sr_chmodown(const char *path, const char *owner, const char *group, mode_t perm)
assert(path);
+ if ((int)perm != -1) {
if (perm > 00666) {
sr_errinfo_new(&err_info, SR_ERR_INVAL_ARG, NULL, "Only read and write permissions can be set.");
return err_info;
@@ -1378,6 +1379,7 @@ sr_chmodown(const char *path, const char *owner, const char *group, mode_t perm)
sr_errinfo_new(&err_info, SR_ERR_INVAL_ARG, NULL, "Setting execute permissions has no effect.");
return err_info;
}
+ }
/* we are going to change the owner */
if (owner && (err_info = sr_get_pwd(&uid, (char **)&owner))) {
