SAP / macOS-enterprise-privileges

For Mac users in enterprise environments, this application gives users control over the administration of their machine by elevating their level of access to administrator privileges on macOS. Users can set a timeframe in the application's settings to perform specific tasks, such as installing or removing an application.
Apache License 2.0
1.4k stars 149 forks source link

[Privileges 2] Able to meet character requirement with spaces #118

Closed aduffner closed 1 month ago

aduffner commented 1 month ago

Tested on:

Same config applied as provided here:

114

mthielemann commented 1 month ago

@aduffner Technically a space is a character. I could add a check to make sure that subsequent spaces are counted as only one character. Would this help?

aduffner commented 1 month ago

@mthielemann Yes, or perhaps any character that exceeds a sequence of three? I’m not entirely sure, but if I need to enforce the user to deliver a reason, I want it to be valid. As you correctly identified, this would just be an enhancement, but we should also assume the user isn’t deliberately trying to exploit the app ...

mthielemann commented 1 month ago

@aduffner I think it would be a better approach to utilize NSSpellChecker and try if we can determine the text's language. If I would enter something like fsdfavjolsrksafv it would return undefined. Otherwise it would return the language code. But this would still not be perfect because something like das ist fsdfavjolsrksafv would also return de even if it makes no sense.

mthielemann commented 1 month ago

@aduffner Added this to build 1803. The feature is disabled by default and has to be enabled using a configuration profile by setting the key ReasonCheckingEnabled to true.

mthielemann commented 1 month ago

@aduffner Build 1805 has just been posted. Please check if it works for you. Thanks.

aduffner commented 1 month ago

@mthielemann Works as designed and described. Thank you! 🥇

aduffner commented 1 month ago

@mthielemann Ah wait, possibly it's active without defining the key - in german language. Or did you seperately checked just for spaces?

mthielemann commented 1 month ago

@aduffner The removal of subsequent whitespace characters is always active. Only the "content checking" must be enabled separately.

aduffner commented 1 month ago

@mthielemann Thanks for making it clear, helps a lot for later documentation. 😊