#ifndef _di_f_file_role_change_
f_status_t f_file_role_change(const f_string_static_t path, const uid_t uid, const gid_t gid, const bool dereference) {
- #ifndef _di_level_0_parameter_checking_
- if (uid == -1 && gid == -1) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
- if (!path.used) {
+ if (uid == -1 && gid == -1 || !path.used) {
return F_data_not;
}
#ifndef _di_f_file_role_change_at_
f_status_t f_file_role_change_at(const int at_id, const f_string_static_t path, const uid_t uid, const gid_t gid, const int flag) {
- #ifndef _di_level_0_parameter_checking_
- if (uid == -1 && gid == -1) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
+
+ if (uid == -1 && gid == -1) {
+ return F_data_not;
+ }
return private_f_file_role_change_at(at_id, path, uid, gid, flag);
}
/**
* Change owner and/or group of a given file at the specified path.
*
- * At least one of uid or gid must not be -1.
- *
* @param path
* The path file name.
* @param uid
*
* @return
* F_none on success.
+ * F_data_not if either both uid and gid are -1 or path.used is 0.
*
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.
/**
* Change owner and/or group of a given file at the specified path.
*
- * At least one of uid or gid must not be -1.
- *
* @param at_id
* The parent directory, as an open directory file descriptor, in which path is relative to.
* @param path
*
* @return
* F_none on success.
+ * F_data_not if either both uid and gid are -1 or path.used is 0.
*
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.