Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146429
b: refs/heads/master
c: f850a7c
h: refs/heads/master
i:
  146427: a81e8d2
v: v3
  • Loading branch information
Eric Paris authored and James Morris committed May 14, 2009
1 parent f4a9462 commit 07bcb5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 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: b103387037cea2ba0f04b44d408d54c53f678061
refs/heads/master: f850a7c040d9faafb41bceb0a05d6bb7432c8c7a
6 changes: 5 additions & 1 deletion trunk/security/integrity/ima/ima_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* implemenents security file system for reporting
* current measurement list and IMA statistics
*/
#include <linux/fcntl.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/rculist.h>
Expand Down Expand Up @@ -283,6 +284,9 @@ static atomic_t policy_opencount = ATOMIC_INIT(1);
*/
int ima_open_policy(struct inode * inode, struct file * filp)
{
/* No point in being allowed to open it if you aren't going to write */
if (!(filp->f_flags & O_WRONLY))
return -EACCES;
if (atomic_dec_and_test(&policy_opencount))
return 0;
return -EBUSY;
Expand Down Expand Up @@ -349,7 +353,7 @@ int ima_fs_init(void)
goto out;

ima_policy = securityfs_create_file("policy",
S_IRUSR | S_IRGRP | S_IWUSR,
S_IWUSR,
ima_dir, NULL,
&ima_measure_policy_ops);
if (IS_ERR(ima_policy))
Expand Down

0 comments on commit 07bcb5b

Please sign in to comment.