commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 06/30: Fake full file access only for faked nodes


From: Samuel Thibault
Subject: [hurd] 06/30: Fake full file access only for faked nodes
Date: Tue, 22 Sep 2015 21:51:57 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 68af46b57f817f84cf12bdacc32a1878e1c0fafa
Author: Samuel Thibault <address@hidden>
Date:   Fri Aug 14 15:19:53 2015 +0200

    Fake full file access only for faked nodes
    
    Otherwise some scripts may try to modify system files just because they find
    they seem to be able to.
    
    * trans/fakeroot.c (netfs_report_access): When FAKE_MODE is not set on
    `np', call file_check_access on the underlying node instead of returning
    O_RDWR|O_EXEC.
---
 trans/fakeroot.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 3c84ce7..76fc901 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -780,7 +780,11 @@ netfs_attempt_write (struct iouser *cred, struct node *np,
 error_t
 netfs_report_access (struct iouser *cred, struct node *np, int *types)
 {
-  *types = O_RDWR|O_EXEC;
+  struct netnode *nn = netfs_node_netnode (np);
+  if (!(nn->faked & FAKE_MODE))
+    return file_check_access (nn->file, types);
+  else
+    *types = O_RDWR|O_EXEC;
   return 0;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]