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

  • From: "ttcoder" <trac@xxxxxxxxxxxx>
  • Date: Wed, 16 Sep 2015 09:23:14 -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 ttcoder):

Looks like I need help with tracing:

After adding SetConfigVar DEBUG ... in UserBuildConfig, building packagefs
from scratch, installing and confirming the install I did not get extra
output to syslog nor the /var/log/packagefs.log file mentionned in the
header; by hacking around I realized the debug macros were not activated
at all, so I edited the DebugSupport.h header and added `#define
DEBUG_PRINT 1` and there the macros are compiled in, but there's still no
output.

***

Anyway I've been digging in the jamfiles and found something interesting:

The Application, Preference ..etc rules all end up invoking the Link rule,
which does have a "MODE on..." variable and invokes ChMod with 755 (rwxr-
xr-x) , as seen here:

http://cgit.haiku-os.org/haiku/tree/build/jam/OverriddenJamRules#n35

So the Application > Main > MainFromObjects > Link rule chain works in
that respect.

[http://cgit.haiku-os.org/haiku/tree/build/jam/MainBuildRules#n444 Shared
libraries] (.so) end up calling Link too:

SharedLibrary > SharedLibraryFromObjects > MainFromObjects > Link

One that does NOT is runtime_loader, because its [http://cgit.haiku-
os.org/haiku/tree/src/system/runtime_loader/Jamfile jamfile] is special:
it makes "raw" calls to..
- Objects
- Ld
and that's it, so it never gets a chance to call ChMod and set a MODE
value for it. Seeing as it is special case linking-wise, maybe the ChMod +
MODE should be special-cased and added "raw" to its Jamfile as well ?

Finally, and I don't know how I missed that before, the reason the
libraries are not accessible is.. The lib/ directory itself is 700 !

{{{
~/> ll /system/
...
dr-x------ 1 user root 0 Sep 5 22:03 lib
}}}

Are "generated" folders made with the MkDir jam rule ?

I'd test my theory, but I don't know if I can override a directory "as-is"
rather than files inside.. So can't test my theory by crafting a custom
package, but that looks very much like the culprit here.

Anyway, is that the right diagnosis ?

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

Other related posts: