Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309987
b: refs/heads/master
c: cc1dad7
h: refs/heads/master
i:
  309985: ab884dd
  309983: 8ec673a
v: v3
  • Loading branch information
Al Viro committed May 30, 2012
1 parent 3b2963d commit b91abff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 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: c862868bb455694704c255481369c40d7185eb25
refs/heads/master: cc1dad7183e4cb7f5d313b6942f2059fc0eabab6
36 changes: 7 additions & 29 deletions trunk/security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,12 +1259,8 @@ static int sel_make_bools(void)
if (!inode)
goto out;

ret = -EINVAL;
len = snprintf(page, PAGE_SIZE, "/%s/%s", BOOL_DIR_NAME, names[i]);
if (len < 0)
goto out;

ret = -ENAMETOOLONG;
len = snprintf(page, PAGE_SIZE, "/%s/%s", BOOL_DIR_NAME, names[i]);
if (len >= PAGE_SIZE)
goto out;

Expand Down Expand Up @@ -1557,19 +1553,10 @@ static inline u32 sel_ino_to_perm(unsigned long ino)
static ssize_t sel_read_class(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
ssize_t rc, len;
char *page;
unsigned long ino = file->f_path.dentry->d_inode->i_ino;

page = (char *)__get_free_page(GFP_KERNEL);
if (!page)
return -ENOMEM;

len = snprintf(page, PAGE_SIZE, "%d", sel_ino_to_class(ino));
rc = simple_read_from_buffer(buf, count, ppos, page, len);
free_page((unsigned long)page);

return rc;
char res[TMPBUFLEN];
ssize_t len = snprintf(res, sizeof(res), "%d", sel_ino_to_class(ino));
return simple_read_from_buffer(buf, count, ppos, res, len);
}

static const struct file_operations sel_class_ops = {
Expand All @@ -1580,19 +1567,10 @@ static const struct file_operations sel_class_ops = {
static ssize_t sel_read_perm(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
ssize_t rc, len;
char *page;
unsigned long ino = file->f_path.dentry->d_inode->i_ino;

page = (char *)__get_free_page(GFP_KERNEL);
if (!page)
return -ENOMEM;

len = snprintf(page, PAGE_SIZE, "%d", sel_ino_to_perm(ino));
rc = simple_read_from_buffer(buf, count, ppos, page, len);
free_page((unsigned long)page);

return rc;
char res[TMPBUFLEN];
ssize_t len = snprintf(res, sizeof(res), "%d", sel_ino_to_perm(ino));
return simple_read_from_buffer(buf, count, ppos, res, len);
}

static const struct file_operations sel_perm_ops = {
Expand Down

0 comments on commit b91abff

Please sign in to comment.