예제 #1
0
파일: setuid.C 프로젝트: BillTheBest/k42
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;
}
예제 #2
0
파일: setuid.C 프로젝트: BillTheBest/k42
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;
}
예제 #3
0
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;
}
예제 #4
0
 static uid_t uid() { return uid_t("SeatReceiverProfile_API_UID"); }
예제 #5
0
 static  uid_t uid() { return uid_t("SeatSenderProfile_API_UID"); }
예제 #6
0
 Private(const passwd *p) : uid(uid_t(-1)), gid(gid_t(-1))
 {
     fillPasswd(p);
 }
예제 #7
0
 Private(const char *name) : uid(uid_t(-1)), gid(gid_t(-1))
 {
     fillPasswd(name ? ::getpwnam( name ) : 0);
 }
예제 #8
0
 Private() : uid(uid_t(-1)), gid(gid_t(-1)) {}
예제 #9
0
bool KUser::isValid() const {
	return uid() != uid_t(-1);
}
예제 #10
0
bool KUser::operator !=(const KUser& user) const {
	return (uid() != user.uid()) || (uid() == uid_t(-1));
}
예제 #11
0
bool KUser::isValid() const
{
    return d->uid != uid_t(-1);
}
예제 #12
0
 static uid_t uid() { return uid_t("ClimateReceiverProfile_API_UID"); }
예제 #13
0
 static  uid_t uid() { return uid_t("ClimateSenderProfile_API_UID"); }