kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

New hook behavior has a permissions problem #233

Closed dilyn-corner closed 3 years ago

dilyn-corner commented 3 years ago

Hooks were recently d765dbd043d5a69a15875f2cd0ff81cdaaa2d97f changed to be execced not sourced. So now if a hook lives in a directory a user doesn't have permissions to exec from, you get a lovely error: /usr/bin/kiss: 125: /var/db/kiss/KISS-me/hooks: Permission denied

Repo in question is in /var/db/kiss, I like to keep my hook in my repo :)

dylanaraps commented 3 years ago

I don't think this should be considered a bug. The new behavior just has different requirements. This is a breaking change for hooks regardless as anything reliant on package manager internals (or long living variables (between hook types)) is now broken. This will improve over time as more information is exposed to hooks in an explicit, supported and documented way.

The only way to solve this (in the package manager) is to copy the hook somewhere else and then execute it. Why should the package manager do this though? It's not making sense to me. Also, we can't do sh /path/to/script as the file is now language agnostic (see build files, etc).