override the user's group prior to opening the group configuration file

That prevented opening group configuration for users that had their
group in a certificate. Reported by Norbert Paschedag.
This commit is contained in:
Nikos Mavrogiannopoulos
2014-09-25 12:16:23 +02:00
parent bdcd27d13e
commit 4674508188

View File

@@ -197,6 +197,11 @@ struct cookie_entry_st *old;
memcpy(proc->sid, cmsg->sid.data, cmsg->sid.len);
proc->active_sid = 1;
/* override the group name in order to load the correct configuration in
* case his group is specified in the certificate */
if (cmsg->groupname)
snprintf(proc->groupname, sizeof(proc->groupname), "%s", cmsg->groupname);
/* cookie is good so far, now read config (in order to know
* whether roaming is allowed or not */
memset(&proc->config, 0, sizeof(proc->config));
@@ -271,9 +276,6 @@ struct cookie_entry_st *old;
return -1;
}
if (cmsg->groupname)
snprintf(proc->groupname, sizeof(proc->groupname), "%s", cmsg->groupname);
if (cmsg->hostname)
snprintf(proc->hostname, sizeof(proc->hostname), "%s", cmsg->hostname);