-
Notifications
You must be signed in to change notification settings - Fork 983
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
fixes #9551 - checking the encryption format so osx doesn't fail #2206
Conversation
Before I even start digging - I don't like this at all :-) Can you paste the actual error you encounter and some description what the problem is? I believe MacOS engineers created "better" crypt function which has different behavior. |
@lzap - this is actually the second time we encounter this. see http://apidock.com/ruby/String/crypt we can either check the output or stop relying on the output, we can't ignore the fact that #crypt will work different on different machines. |
Can't we simply change the regexp to One could possibly have a password starting with Alternatively let's detect OS properly and in case of MacOS change the regexp. Not following introduction of |
actually, the variable is the right thing to do here anyway, as it prevents code duplication :) |
[test] |
Ok, can we get rid of
and do this test during application load (class variable or constant in the utility lib/ module). Platforms do not change during runtime :-) |
@lzap - done |
@@ -9,4 +9,8 @@ def self.passw_crypt(passwd, hash_alg = 'MD5') | |||
def self.grub2_passw_crypt(passw) | |||
self.passw_crypt(passw, 'MD5') | |||
end | |||
|
|||
def self.nix? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do more transparent method name? I would suggest crypt_unix_compatible
or if we want to be precise then crypt_mcf_compatible
(Modular Crypt Format defacto-standard: http://pythonhosted.org/passlib/modular_crypt_format.html). Definitely not "*nix" because MacOS is also unix-like OS.
Looks fine! Thanks. |
Merged as 526e02f thanks! |
No description provided.