bug-hurd
[Top][All Lists]
Advanced

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

fakeroot-hurd bug or not?


From: Svante Signell
Subject: fakeroot-hurd bug or not?
Date: Wed, 23 Sep 2015 15:45:13 +0200

Hi,

The attached test program is extracted from one of p11-kit tests (the
only failing test) in trust/test_token.c:
test_not_writable (): token = p11_token_new (333, "/non-existant",
"Label");
main(): p11_test (test_not_writable, "/token/not-writable");

This test fails with fakeroot-hurd on Hurd due to that /non-existant is
writable for faked nodes according to:
error_t
netfs_report_access (struct iouser *cred, struct node *np, int *types)
{
  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;
}

which is reasonable if fakeroot is to mimic real root accesses. Return
values are *is_writable=1 and errno="No such file or directory".

However, running this program with fakeroot-tcp on Hurd or fakeroot-sysv
on Linux returns *is_writable=0 and errno="Permission denied" while
running it as real root of course returns *is_writable=1 and errno="No
such file or directory" on both Linux and Hurd. Maybe even the tests
should not be run under fakeroot at all as is done now with
fakeroot debian/rules binary?

The attached patch makes the behaviour the same as on Linux and
fakeroot-tcp. The question is which behaviour is the expected one.

Index: hurd-0.6.git20150704/trans/fakeroot.c
===================================================================
--- hurd-0.6.git20150704.orig/trans/fakeroot.c
+++ hurd-0.6.git20150704/trans/fakeroot.c
@@ -785,11 +785,7 @@ error_t
 netfs_report_access (struct iouser *cred, struct node *np, int *types)
 {
   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;
+  return = file_check_access (nn->file, types);
 }
 
 error_t

Attachment: test_access.c
Description: Text Data


reply via email to

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