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

munki-notifier does not respect UseNotificationCenterDays if set in /var/root or managed preference. #819

Closed
weswhet opened this issue Nov 17, 2017 · 9 comments

Comments

@weswhet
Copy link
Contributor

weswhet commented Nov 17, 2017

plistRef = CFPreferencesCopyValue(
CFSTR("UseNotificationCenterDays"), CFSTR("ManagedInstalls"), kCFPreferencesAnyUser, kCFPreferencesCurrentHost);

should be CFPreferencesCopyAppValue

@weswhet weswhet changed the title muni-notifier does not respect UseNotificationCenterDays if set in /var/root or managed preference. munki-notifier does not respect UseNotificationCenterDays if set in /var/root or managed preference. Nov 17, 2017
@gregneagle
Copy link
Contributor

Please see if this commit 42152f3 addresses your issue.

@weswhet
Copy link
Contributor Author

weswhet commented Nov 17, 2017

Does not appear to resolve the issue.

@gregneagle
Copy link
Contributor

Are you up to adding some debug logging, building and testing to figure out why?

@weswhet
Copy link
Contributor Author

weswhet commented Nov 17, 2017

yeah, It doesn't look like there are any logs for munki-notifier otherwise I would have posted them already. Unless i'm missing them somewhere. Happy to test/build.

@gregneagle
Copy link
Contributor

gregneagle commented Nov 17, 2017

There aren't. You'd need to add NSLog() calls.

@gregneagle
Copy link
Contributor

Oh, duh.
munki-notifier runs as the current GUI user. It can't read root preferences. The fix is still needed for managed preferences, though.

@gregneagle
Copy link
Contributor

Nasty side-effect: a user could do defaults write ManagedInstalls UseNotificationCenterDays -int 10000, writing the pref to their own home dir, and now MSC will essentially never launch. Then they could also disable Notification Center notifications for MSC and then never ever be notified again.
So what's really needed is to use CFPreferencesAppValueIsForced -- if so, use the forced value returned by CFPreferencesCopyAppValue, otherwise use CFPreferencesCopyValue and target /Library/Preferences.

@gregneagle
Copy link
Contributor

b59eeff implements this strategy.

@gregneagle
Copy link
Contributor

I'm closing this issue as fixed for Managed Preferences and can't fix/works as designed as far as root preferences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants