Lines Matching defs:uid
114 if (vm_register(ps, &vmc, &vm, 0, vmc.vmc_owner.uid)) {
143 vm->vm_params.vmc_owner.uid);
313 ret = vm_register(ps, &vmc, &vm, 0, vmc.vmc_owner.uid);
321 vmc.vmc_owner.uid);
550 vir.vir_uid = vm->vm_params.vmc_owner.uid;
883 config_setvm(&env->vmd_ps, vm, -1, vm->vm_params.vmc_owner.uid);
1213 vm_claimid(const char *name, int uid, uint32_t *id)
1218 if (strcmp(n2i->name, name) == 0 && n2i->uid == uid)
1230 n2i->uid = uid;
1245 struct vmd_vm **ret_vm, uint32_t id, uid_t uid)
1257 if ((ret = vm_instance(ps, &vm_parent, vmc, uid)) != 0) {
1268 uid) != 0) {
1282 if (vm_checkperm(NULL, vmo, uid) != 0) {
1378 else if (vm_claimid(vcp->vcp_name, uid, &nid) == -1)
1396 struct vmop_create_params *vmc, uid_t uid)
1417 if (vm_checkperm(NULL, &vmcp->vmc_insowner, uid) != 0) {
1433 if (vm_checkinsflag(vmcp, VMOP_CREATE_CPU, uid) != 0 &&
1443 if (vm_checkinsflag(vmcp, VMOP_CREATE_MEMORY, uid) != 0 &&
1451 if (vm_checkinsflag(vmcp, VMOP_CREATE_DISK, uid) != 0 &&
1471 vm_checkinsflag(vmcp, VMOP_CREATE_NETWORK, uid) != 0 &&
1517 if (vm_checkinsflag(vmcp, VMOP_CREATE_KERNEL, uid) != 0) {
1527 if (vm_checkinsflag(vmcp, VMOP_CREATE_CDROM, uid) != 0) {
1539 if (vmc->vmc_owner.uid == 0)
1540 vmc->vmc_owner.uid = vmcp->vmc_owner.uid;
1541 else if (vmc->vmc_owner.uid != uid &&
1542 vmc->vmc_owner.uid != vmcp->vmc_owner.uid) {
1562 vmc->vmc_insowner.uid = vmcp->vmc_insowner.gid;
1566 vmc->vmc_insowner.uid = 0;
1579 * Checks if the user represented by the 'uid' parameter is allowed to
1585 * vmo: the required uid/gid to be checked
1586 * uid: the user ID of the user making the request
1593 vm_checkperm(struct vmd_vm *vm, struct vmop_owner *vmo, uid_t uid)
1600 if (uid == 0)
1608 if (vmo->uid == uid)
1615 if (((vm->vm_state & VM_STATE_RUNNING) && vm->vm_uid == uid) ||
1616 (!(vm->vm_state & VM_STATE_RUNNING) && vmo->uid == uid))
1622 if ((pw = getpwuid(uid)) == NULL)
1644 * uid: the user ID of the user making the request
1651 vm_checkinsflag(struct vmop_create_params *vmc, unsigned int flag, uid_t uid)
1654 if (uid == 0)
1666 * Checks if the user represented by the 'uid' parameter is allowed to
1672 * uid: the user ID of the user making the request
1680 vm_checkaccess(int fd, unsigned int uflag, uid_t uid, int amode)
1698 if (uid == 0 || uflag == 0)
1710 if (uid == st.st_uid && (st.st_mode & mode) == mode)
1718 if ((pw = getpwuid(uid)) == NULL)
1736 uid_t uid;
1760 uid = vm->vm_uid;
1773 log_debug("%s: vm %s tty %s uid %d gid %d mode %o",
1775 vm->vm_ttyname, uid, gid, mode);
1786 if (st.st_uid != uid || st.st_gid != gid) {
1787 if (chown(vm->vm_ttyname, uid, gid) == -1) {
1788 log_warn("chown %s %d %d failed, uid %d",
1789 vm->vm_ttyname, uid, gid, getuid());
1793 (st.st_uid == uid || st.st_uid == 0)))
1800 log_warn("chmod %s %o failed, uid %d",
1805 (st.st_uid == uid || st.st_uid == 0)))