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

Airdrop status outputs an error first use #163

Open
bensleveritt opened this issue May 6, 2021 · 1 comment
Open

Airdrop status outputs an error first use #163

bensleveritt opened this issue May 6, 2021 · 1 comment
Labels

Comments

@bensleveritt
Copy link
Collaborator

When getting Airdrop status for the first time:

./m airdrop status
2021-05-06 16:19:04.741 defaults[85572:47467663] 
The domain/default pair of (com.apple.NetworkBrowser, DisableAirDrop) does not exist

Based on SummitRoute/osxlockdown#50 this is expected, but it'd be nice to deal with.

@paxperscientiam
Copy link
Contributor

paxperscientiam commented Jun 25, 2021

One way to approach this would be to first check that the domain in question actually exists.

For example:

defaults read com.apple.NetworkBrowser
# yields the full configuration object
# exit value is 0

So, if that exits with 0 and defaults read com.apple.NetworkBrowser DisableAirDrop exits with 1, perhaps we should assume that the property DisableAirDrop just hasn't been set yet (which is the case in your example).

ie:

m airdrop status
# outputs "not previously set"

How to go about it really depends on how robust m-cli should be. The above is a basic heuristic. Another reason for failure might be that it is both true that the property is not set in the plist AND it's an unreferenced property (IE, it's a property that isn't used by any program, which would be the case for misspelled properties).

Personally, I would go with the simple solution for now

EDIT: grammar

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

No branches or pull requests

2 participants