[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 17/20: Make sure to record only RWX open modes
From: |
Samuel Thibault |
Subject: |
[hurd] 17/20: Make sure to record only RWX open modes |
Date: |
Sat, 23 May 2015 05:09:42 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit bc0163aaa19ba102da3f73f30ca3f4cc11ba7a9d
Author: Samuel Thibault <address@hidden>
Date: Sat May 23 00:33:04 2015 +0530
Make sure to record only RWX open modes
Thanks Svante Signell for the investigation and proposed patch.
* trans/fakeroot.c (new_node): Assert that `openmodes' includes only
O_RDWR|O_EXEC
(check_openmodes): Likewise with `newmodes'.
(netfs_S_dir_lookup): Keep only O_RDWR|O_EXEC from `flags' when calling
new_node.
---
trans/fakeroot.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 671314f..99b6723 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -75,6 +75,9 @@ new_node (file_t file, mach_port_t idport, int locked, int
openmodes,
{
error_t err;
struct netnode *nn;
+
+ assert ((openmodes & ~(O_RDWR|O_EXEC)) == 0);
+
*np = netfs_make_node_alloc (sizeof *nn);
if (*np == 0)
{
@@ -203,6 +206,8 @@ check_openmodes (struct netnode *nn, int newmodes, file_t
file)
{
error_t err = 0;
+ assert ((newmodes & ~(O_RDWR|O_EXEC)) == 0);
+
if (newmodes &~ nn->openmodes)
{
/* The user wants openmodes we haven't tried before. */
@@ -390,7 +395,7 @@ netfs_S_dir_lookup (struct protid *diruser,
else
{
pthread_spin_unlock (&netfs_node_refcnt_lock);
- err = new_node (file, idport, 1, flags, &np);
+ err = new_node (file, idport, 1, flags & (O_RDWR|O_EXEC), &np);
pthread_mutex_unlock (&dnp->lock);
if (!err)
{
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 06/20: libdiskfs: make struct node more compact, (continued)
- [hurd] 06/20: libdiskfs: make struct node more compact, Samuel Thibault, 2015/05/23
- [hurd] 07/20: libdiskfs: drop unused fields from struct node, Samuel Thibault, 2015/05/23
- [hurd] 08/20: libdiskfs: fix node initialization, Samuel Thibault, 2015/05/23
- [hurd] 14/20: Fix creating named sockets inside fakeroot-hurd, Samuel Thibault, 2015/05/23
- [hurd] 09/20: libdiskfs: declare all inline functions as `extern inline', Samuel Thibault, 2015/05/23
- [hurd] 20/20: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2015/05/23
- [hurd] 18/20: Make comment clearer, Samuel Thibault, 2015/05/23
- [hurd] 19/20: fakeroot: Fix reopening files after a chmod, Samuel Thibault, 2015/05/23
- [hurd] 16/20: fatfs: fix error handling, Samuel Thibault, 2015/05/23
- [hurd] 15/20: libdiskfs: fix renaming of directories, Samuel Thibault, 2015/05/23
- [hurd] 17/20: Make sure to record only RWX open modes,
Samuel Thibault <=
- [hurd] 01/20: ext2fs: use a seperate lock to protect nodehash, Samuel Thibault, 2015/05/23
- [hurd] 04/20: tmpfs: use a seperate lock to protect all_nodes, Samuel Thibault, 2015/05/23
- [hurd] 03/20: isofs: use a seperate lock to protect node_cache, Samuel Thibault, 2015/05/23
- [hurd] 13/20: fatfs: port to libdiskfs' node cache, Samuel Thibault, 2015/05/23
- [hurd] 12/20: isofs: port to libdiskfs' node cache, Samuel Thibault, 2015/05/23
- [hurd] 05/20: libdiskfs: lock-less reference counting of nodes, Samuel Thibault, 2015/05/23
- [hurd] 02/20: fatfs: use a seperate lock to protect nodehash, Samuel Thibault, 2015/05/23
- [hurd] 10/20: ext2fs: use fat nodes, Samuel Thibault, 2015/05/23
- [hurd] 11/20: libdiskfs: implement a node cache, Samuel Thibault, 2015/05/23