On Tue, 2015-06-09 at 11:11 +0200, Samuel Thibault wrote:

> So the package is actually doing something stupid (yes, that's what you
> should have written in your mail to explain what is happening, actually
> :) ). But it does work as root as specified by POSIX, so we have to
> support it.

Yes I think there is a package bug (it's up to the package maintainer to
write good code, not me pointing fingers):
The command should have read
chmod -R 644
debian/pycorrfit/usr/share/doc/pycorrfit/examples/external_model_functions/*
since there are no directories below.

Nevertheless, as you write, it has to be fixed.

> I'd say in netfs_attempt_chmod just do
> 
>   real_mode |= S_IRUSR;
>   real_mode |= S_IWUSR;
>   if (nn is a directory)
>     real_mode |= S_IXUSR;
> 
> so we're sure of having all rights that root would have on the
> underlying file.

New patch attached. Maybe you want to remove the second condition to add
S_IXUSR unconditionally for directories.


Index: hurd-0.6.git20150523/trans/fakeroot.c
===================================================================
--- hurd-0.6.git20150523.orig/trans/fakeroot.c
+++ hurd-0.6.git20150523/trans/fakeroot.c
@@ -560,12 +560,10 @@ netfs_attempt_chmod (struct iouser *cred
      it.  */
   real_mode = mode;
   nn = netfs_node_netnode (np);
-  if (nn->openmodes & O_READ)
     real_mode |= S_IRUSR;
-  if (nn->openmodes & O_WRITE)
     real_mode |= S_IWUSR;
-  if (nn->openmodes & O_EXEC)
-    real_mode |= S_IXUSR;
+    if ((real_mode & S_IFDIR) && ((real_mode & S_IXUSR) == 0))
+      real_mode |= S_IXUSR;
 
   /* We don't bother with error checking since the fake mode change should
      always succeed--worst case a later open will get EACCES.  */

Reply via email to