[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] Fix procfs_node_chmod
From: |
Justus Winter |
Subject: |
[PATCH 1/4] Fix procfs_node_chmod |
Date: |
Tue, 16 Jul 2013 10:51:20 +0200 |
Formerly only the mode_t bits cut out by S_IFMT were preserved, but
this does not include S_IPTRANS. Fix this by preserving everything but
the permission bits.
* procfs.c (procfs_node_chmod): Fix bitmask.
---
procfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/procfs.c b/procfs.c
index ae5a676..b52553b 100644
--- a/procfs.c
+++ b/procfs.c
@@ -93,7 +93,7 @@ void procfs_node_chown (struct node *np, uid_t owner)
void procfs_node_chmod (struct node *np, mode_t mode)
{
- np->nn_stat.st_mode = (np->nn_stat.st_mode & S_IFMT) | mode;
+ np->nn_stat.st_mode = (np->nn_stat.st_mode & ~07777) | mode;
np->nn_translated = np->nn_stat.st_mode;
}
--
1.7.10.4