santa
santa copied to clipboard
Fix USB config sync
- get
BlockUSBMountandRemountUSBModefrom theconfigStateand from thesyncState. - disable
BlockUSBMountif set tofalsein the preflight response. - only set
BlockUSBMountinsyncStateif present in the preflight response. - Fix
keyPathsForValuesAffecting*forRemountUSBMode,RemountUSBBlockMessageandUSBBlockMessage. - Add
BlockUSBMountandRemountUSBModeto the docs. - Fix
block_usb_mountdocs.
I think this change is necessary if we want to be able to unblock the USB device mounts and if we want to not update the SNTConfigurator syncState if the server is not sending the key.
Hey folks 👋
We're looking at rolling this out internally and appear to have hit the same issue - is there an update on this, or a workaround? The Santa documentation seems to suggest that it'll work with a sync server. Happy to help get this over the line if you need!
@liamn the main issue with this PR is that the settings are being changed in the Preflight stage rather than at the end in the Postflight stage. This breaks how the sync protocol is supposed to work.
As @russellhancox calls out reverting the changes in the syncservice should enough to fix this. If the PR can be changed to do that I think it'll good to merge.
If @np5 doesn't chime in soon I'll remind him that this is pending his response.
Sorry for the delay. I made the change in the preflight because it was easier for me to manage the true/false/missing values in the server response. I think that "missing" or "absent" is important, because if a sync server is not yet implementing this, you do not want to overwrite the value set in the config profile. I am not really proficient with objective C, but maybe by setting the value as a pointer to a ~~boolean~~ NSNumber in the preflight, it would be possible to maintain the "absent" state separate from "false" and only apply the change in the postflight if the value was sent by the server?
I am not really proficient with objective C, but maybe by setting the value as a pointer to a boolean NSNumber in the preflight, it would be possible to maintain the "absent" state separate from "false" and only apply the change in the postflight if the value was sent by the server?
Yes, this will work and what you have now meets our general constraint of receiving new configuration during preflight but applying it during postflight so that syncing acts like a kind of transaction.
Thanks!