[haiku-bugs] Re: [Haiku] #12373: Can't "su" to non-superuser : Permission denied

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Tue, 15 Sep 2015 16:10:06 -0000

#12373: Can't "su" to non-superuser : Permission denied
-------------------------+----------------------------
Reporter: ttcoder | Owner: nobody
Type: bug | Status: new
Priority: normal | Milestone: R1/beta1
Component: - General | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
-------------------------+----------------------------

Comment (by bonefish):

Just built a hrev49645 gcc 2 hybrid (on openSUSE 13.2). Can't reproduce
the issue. packagefs's `open()` hook uses a standard VFS function to
determine whether access should be allowed. It is fed the same file mode
`*stat()` returns (i.e. what `ls -l` shows). So, if the file's permissions
allow read access, opening the file should work fine. At least as long as
its path can be traversed, i.e. the ancestor directories have executable
permission.

From just your failing syscall it is not possible to tell much. Please
enable debugging in packagefs:
{{{
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems packagefs :
1
: global ;
}}}
It will badly spam your syslog, but hopefully we'll see which packagefs
hook fails exactly (if any).

Regarding directory permissions: AFAIK ATM the build system uses the
default permissions in any case it creates a directory and the `package`
tool just stores the permissions it finds. So, indeed, if you have a
restrictive umask, the packages you build will inherit those restrictive
permissions. I guess that's something we might want to address (or at
least document).

I guess a fairly simple solution would be in `build_haiku_package` to
update all permissions [http://cgit.haiku-

os.org/haiku/tree/build/scripts/build_haiku_package?id=90ec3fc16560e46e4fcaec5af93b19570eb894d6#n114
before invoking package]. Alternatively the `package` tool could grow an
option to copy the owner permissions to group and others (or rather one
for preventing that new default).

--
Ticket URL: <https://dev.haiku-os.org/ticket/12373#comment:8>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: