int (*chown)( resmgr_context_t *ctp, io_chown_t *msg, RESMGR_OCB_T *ocb )
struct _io_chown { uint16_t type; uint16_t combine_len; int32_t gid; int32_t uid; }; typedef union { struct _io_chown i; } io_chown_t;
The default implementation iofunc_chown_default() calls the helper function iofunc_chown() to check the IOFUNC_PC_CHOWN_RESTRICTED flag to determine whether the user is allowed to change the user ID on the entry. The helper function also checks whether the client has the iofunc/chown (IOFUNC_ABILITY_CHOWN) dynamic ability (using iofunc_ability_check(), which allows it to set the user ID as if it were root. Finally, the helper checks to make sure it's not a read-only filesystem.
When iofunc_chown() sets the new user ID or group ID, it removes the set user ID and set group ID bits if they were set on the file. A value of -1 for the user or group ID means that the caller does not want to change that ID.