static void fill_ipc_desc(int id, IpcDescEntry *desc, const struct ipc_perm *ipcp) { desc->id = id; desc->key = ipcp->KEY; desc->uid = userns_uid(ipcp->uid); desc->gid = userns_gid(ipcp->gid); desc->cuid = userns_uid(ipcp->cuid); desc->cgid = userns_gid(ipcp->cgid); desc->mode = ipcp->mode; }
static bool sb_opt_cb(char *opt, char *unknown, size_t *uoff) { unsigned int id; if (sscanf(opt, "gid=%d", &id) == 1) { *uoff += sprintf(unknown + *uoff, "gid=%d", userns_gid(id)); unknown[*uoff] = ','; (*uoff)++; return true; } else if (sscanf(opt, "uid=%d", &id) == 1) { *uoff += sprintf(unknown + *uoff, "uid=%d", userns_uid(id)); unknown[*uoff] = ','; (*uoff)++; return true; } return false; }