Skip to content

Commit

Permalink
selinux: change sel_make_dir() to specify inode counter.
Browse files Browse the repository at this point in the history
Specify the inode counter explicitly in sel_make_dir(), rather than always
using sel_last_ino.

Signed-off-by: Christopher J. PeBenito <cpebenito@tresys.com>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
pebenito authored and James Morris committed Jul 12, 2007
1 parent 0c92d7c commit 0dd4ae5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,8 @@ static int sel_make_initcon_files(struct dentry *dir)
return ret;
}

static int sel_make_dir(struct inode *dir, struct dentry *dentry)
static int sel_make_dir(struct inode *dir, struct dentry *dentry,
unsigned long *ino)
{
int ret = 0;
struct inode *inode;
Expand All @@ -1305,7 +1306,7 @@ static int sel_make_dir(struct inode *dir, struct dentry *dentry)
}
inode->i_op = &simple_dir_inode_operations;
inode->i_fop = &simple_dir_operations;
inode->i_ino = ++sel_last_ino;
inode->i_ino = ++(*ino);
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inc_nlink(inode);
d_add(dentry, inode);
Expand Down Expand Up @@ -1351,7 +1352,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
goto err;
}

ret = sel_make_dir(root_inode, dentry);
ret = sel_make_dir(root_inode, dentry, &sel_last_ino);
if (ret)
goto err;

Expand Down Expand Up @@ -1384,7 +1385,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
goto err;
}

ret = sel_make_dir(root_inode, dentry);
ret = sel_make_dir(root_inode, dentry, &sel_last_ino);
if (ret)
goto err;

Expand All @@ -1398,7 +1399,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
goto err;
}

ret = sel_make_dir(root_inode, dentry);
ret = sel_make_dir(root_inode, dentry, &sel_last_ino);
if (ret)
goto err;

Expand Down

0 comments on commit 0dd4ae5

Please sign in to comment.