Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripting additions do not get installed correctly under a restrictive umask #400

Closed
kqr opened this issue Feb 4, 2020 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@kqr
Copy link

kqr commented Feb 4, 2020

I don't know what information I can provide to assist in diagnosing this issue. What I'm seeing is this:

I can send a window to a different space with yabai -m window --space 3, but then if I try to focus this space with yabai -m space --focus 3, nothing appears to happen. In fact, I haven't gotten any space command to have any effect: I've tried creating, destroying, focusing, and moving to other displays.

(Consequently, I'm currently using the regular Mission Control hotkeys for switching between spaces, but they are animated and therefore sloooow.)

I have tried running yabai in verbose mode, but nothing in particular shows up in the logs other than that it receives the message.

Please help me help you!

@kqr kqr changed the title Not all space commands working -m space commands not working Feb 4, 2020
@dominiklohmann
Copy link
Collaborator

Moving spaces requires the scripting addition to be enabled.

@kqr
Copy link
Author

kqr commented Feb 4, 2020

Sorry, this issue was woefully underspecified. I have enabled the scripting addition (as far as I can tell – sudo yabai --install-sa was successful, and sudo yabai --check-sa returns 0. I have restarted Dock afterwards, as well.)

I'm running OS X 10.14.6, and yabai-v2.2.2.

@dominiklohmann
Copy link
Collaborator

When you start yabai, do you get a notification saying that the scripting addition was loaded?

image

@kqr
Copy link
Author

kqr commented Feb 4, 2020

No, that I don't! Furthermore, if I try to manually sudo yabai --load-sa, it tells me that

yabai: scripting-addition could not load, make sure SIP is disabled!

However, csrutil status tells me that

System Integrity Protection status: disabled.

I didn't specifically disable SIP for yabai – I did it at some point before in order to be able to use dtrace. I was fairly certain I disabled it entirely, but maybe I only disabled the parts of it that block dtrace?

@dominiklohmann
Copy link
Collaborator

Note that sudo is only required for --install-sa and --uninstall-sa.

yabai needs SIP for fs (filesystem) and debug to be disabled.

# from a recovery partition
csrutil enable --without debug --without fs

@kqr
Copy link
Author

kqr commented Feb 4, 2020

The problem persists even though I just now rebooted into recovery mode and disabled SIP entirely. I get this notification when starting yabai:

image

@kqr
Copy link
Author

kqr commented Feb 4, 2020

Don't know if this is of any help:

$ sudo yabai --uninstall-sa; echo "Status: $?"
Status: 0

$ sudo yabai --install-sa; echo "Status: $?"
Status: 0

$ yabai --check-sa; echo "Status: $?"
Status: 1

$ sudo yabai --check-sa; echo "Status: $?"
Status: 0

$ yabai --load-sa; echo "Status: $?"
Status: 1

$ sudo yabai --load-sa; echo "Status: $?"
yabai: scripting-addition could not load, make sure SIP is disabled!
Status: 1

@dominiklohmann
Copy link
Collaborator

Try killing Dock after installing. sudo yabai --install-sa; pkill -x Dock

@kqr
Copy link
Author

kqr commented Feb 4, 2020

That did not help. However, I looked into what yabai/src/osax/sa.m is doing, to see if I can figure out where something is going wrong. I noticed it attempts to create directories with permissions 0755. On my end, however, they seem to have been created with 750:

$ sudo stat /Library/ScriptingAdditions/yabai.osax
16777220 34182272 drwxr-x--- 3 root wheel 0 96 "Feb  4 12:23:02 2020" "Feb  4 12:19:25 2020" "Feb  4 12:19:25 2020" "Feb  4 12:19:25 2020" 4096 0 0 /Library/ScriptingAdditions/yabai.osax

which is probably because

$ umask
0007

Indeed, if I set umask 0000 and then try running sudo yabai --install-sa, I am presented with the following notification:

image

And! Best of all: things now work.

@kqr
Copy link
Author

kqr commented Feb 4, 2020

Thank you for your patient assistance. Before closing this issue, I think something should be done about the very non-obvious failure when running on a restrictive umask. Would you prefer it if this was documented in in the installation instructions, or that the --install-sa command itself fixed the umask before running? (Or at least gave a sensible error when it is incorrectly set?)

@kqr kqr changed the title -m space commands not working Scripting additions do not get installed correctly under a restrictive umask Feb 4, 2020
@dominiklohmann
Copy link
Collaborator

I think @koekeishiya can fix this quite simply by explicitly setting the umask for the scripting addition when installing it.

@dominiklohmann dominiklohmann added the bug Something isn't working label Feb 4, 2020
@koekeishiya koekeishiya added the addressed on master; not released Fixed upstream, but not yet released label Feb 4, 2020
@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants