static sval set_helper( ProcessLinux::set_uids_gids_type type, uid_t uid, uid_t euid, uid_t suid, uid_t fsuid, gid_t gid, gid_t egid, gid_t sgid, gid_t fsgid) { SysStatus rc, resMgrRC; SYSCALL_ENTER(); rc = DREFGOBJ(TheProcessLinuxRef)->set_uids_gids( type, uid, euid, suid, fsuid, gid, egid, sgid, fsgid); if (((type == ProcessLinux::SETREUID) || (type == ProcessLinux::SETRESUID)) && (uid != uid_t(-1)) && _SUCCESS(rc)) { /* * FIXME: ProcessLinuxServer should contact the resource manager, * or vice versa. We shouldn't rely on the user to contact * the resource manager. */ resMgrRC = DREFGOBJ(TheResourceManagerRef)->assignDomain(uid); passertWrn(_SUCCESS(resMgrRC), "ResMgr assignDomain failed.\n"); } SYSCALL_EXIT(); if (_FAILURE(rc)) { return -_SGENCD(rc); } return rc; }
gid_t __k42_linux_getegid (void) { SysStatus rc; ProcessLinux::LinuxInfo linuxInfo; SYSCALL_ENTER(); rc = DREFGOBJ(TheProcessLinuxRef)->getInfoLinuxPid(0, linuxInfo); SYSCALL_EXIT(); if (_FAILURE(rc)) { return uid_t(-_SGENCD(rc)); } return linuxInfo.creds.egid; }
uid_t uidFromName(QString name) { uid_t ret; if(name.isEmpty()) return -1; if(name.at(0).digitValue() != -1) { ret = uid_t(name.toUInt()); } else { struct passwd* pw = getpwnam(name.toLatin1()); // FIXME: use getpwnam_r instead later to make it reentrant ret = pw ? pw->pw_uid : -1; } return ret; }
static uid_t uid() { return uid_t("SeatReceiverProfile_API_UID"); }
static uid_t uid() { return uid_t("SeatSenderProfile_API_UID"); }
Private(const passwd *p) : uid(uid_t(-1)), gid(gid_t(-1)) { fillPasswd(p); }
Private(const char *name) : uid(uid_t(-1)), gid(gid_t(-1)) { fillPasswd(name ? ::getpwnam( name ) : 0); }
Private() : uid(uid_t(-1)), gid(gid_t(-1)) {}
bool KUser::isValid() const { return uid() != uid_t(-1); }
bool KUser::operator !=(const KUser& user) const { return (uid() != user.uid()) || (uid() == uid_t(-1)); }
bool KUser::isValid() const { return d->uid != uid_t(-1); }
static uid_t uid() { return uid_t("ClimateReceiverProfile_API_UID"); }
static uid_t uid() { return uid_t("ClimateSenderProfile_API_UID"); }