newrule->uid = uid;
newrule->gid = gid;
- strncpy(newrule->name, user, sizeof(newrule->name) - 1);
+ strncpy(newrule->username, user, sizeof(newrule->username) - 1);
strncpy(newrule->destination, destination,
sizeof(newrule->destination) - 1);
newrule->next = NULL;
}
cgroup_dbg("Added rule %s (UID: %d, GID: %d) -> %s for"
- " controllers:", lst->tail->name, lst->tail->uid,
+ " controllers:", lst->tail->username, lst->tail->uid,
lst->tail->gid, lst->tail->destination);
for (i = 0; lst->tail->controllers[i]; i++) {
cgroup_dbg(" %s", lst->tail->controllers[i]);
}
/* If this is a group rule, the UID might be a member. */
- if (ret->name[0] == '@') {
+ if (ret->username[0] == '@') {
/* Get the group data. */
- sp = &(ret->name[1]);
+ sp = &(ret->username[1]);
grp = getgrnam(sp);
if (!grp) {
continue;
}
}
cgroup_dbg("Found matching rule %s for PID: %d, UID: %d, GID: %d\n",
- tmp->name, pid, uid, gid);
+ tmp->username, pid, uid, gid);
/* If we are here, then we found a matching rule, so execute it. */
do {
- cgroup_dbg("Executing rule %s for PID %d... ", tmp->name, pid);
+ cgroup_dbg("Executing rule %s for PID %d... ", tmp->username,
+ pid);
ret = cgroup_change_cgroup_path(tmp->destination,
pid, tmp->controllers);
if (ret) {
* we just executed.
*/
tmp = tmp->next;
- } while (tmp && (tmp->name[0] == '%'));
+ } while (tmp && (tmp->username[0] == '%'));
finished:
return ret;
itr = rl.head;
while (itr) {
- fprintf(fp, "Rule: %s\n", itr->name);
+ fprintf(fp, "Rule: %s\n", itr->username);
if (itr->uid == CGRULE_WILD)
fprintf(fp, " UID: any\n");