Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105901
b: refs/heads/master
c: 7759fc9
h: refs/heads/master
i:
  105899: ed387ac
v: v3
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Jul 25, 2008
1 parent ed55c8f commit 20c70a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4efd1a1b2f09a4b746dd9dc057986c6dadcb1317
refs/heads/master: 7759fc9d10d3559f365cb122d81e0c0a185fe0fe
22 changes: 8 additions & 14 deletions trunk/security/device_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static struct cgroup_subsys_state *devcgroup_create(struct cgroup_subsys *ss,
}
wh->minor = wh->major = ~0;
wh->type = DEV_ALL;
wh->access = ACC_MKNOD | ACC_READ | ACC_WRITE;
wh->access = ACC_MASK;
list_add(&wh->list, &dev_cgroup->whitelist);
} else {
parent_dev_cgroup = cgroup_to_devcgroup(parent_cgroup);
Expand Down Expand Up @@ -264,11 +264,10 @@ static char type_to_char(short type)

static void set_majmin(char *str, unsigned m)
{
memset(str, 0, MAJMINLEN);
if (m == ~0)
sprintf(str, "*");
strcpy(str, "*");
else
snprintf(str, MAJMINLEN, "%u", m);
sprintf(str, "%u", m);
}

static int devcgroup_seq_read(struct cgroup *cgroup, struct cftype *cft,
Expand Down Expand Up @@ -360,6 +359,7 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
{
struct dev_cgroup *cur_devcgroup;
const char *b;
char *endp;
int retval = 0, count;
struct dev_whitelist_item wh;

Expand Down Expand Up @@ -395,11 +395,8 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
wh.major = ~0;
b++;
} else if (isdigit(*b)) {
wh.major = 0;
while (isdigit(*b)) {
wh.major = wh.major*10+(*b-'0');
b++;
}
wh.major = simple_strtoul(b, &endp, 10);
b = endp;
} else {
return -EINVAL;
}
Expand All @@ -412,11 +409,8 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup,
wh.minor = ~0;
b++;
} else if (isdigit(*b)) {
wh.minor = 0;
while (isdigit(*b)) {
wh.minor = wh.minor*10+(*b-'0');
b++;
}
wh.minor = simple_strtoul(b, &endp, 10);
b = endp;
} else {
return -EINVAL;
}
Expand Down

0 comments on commit 20c70a7

Please sign in to comment.