Пример #1
0
Файл: ipc_ns.c Проект: 8472/criu
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;
}
Пример #2
0
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;
}