-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix crypt_r detection under BSD system. #5971
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
Conversation
build/php.m4
Outdated
]],[[ | ||
struct crypt_data buffer; | ||
crypt_r("passwd", "hash", &buffer); | ||
]])],[php_cv_crypt_r_style=struct_crypt_data_bsd],[]) |
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.
]])],[php_cv_crypt_r_style=struct_crypt_data_bsd],[]) | |
]])],[php_cv_crypt_r_style=struct_crypt_data],[]) |
I think. Though I think it would be better to just add an #if HAVE_UNISTD_H #include <unistd.> #endif
to the main check above, instead of doing a separate one. It's not like including an extra header should hurt :)
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.
there is no crypt.h header on FreeBSD
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.
I see, in that case I'd still suggest to merge the checks and put the crypt.h include behind #if HAVE_CRYPT_H
as well.
As implemented now, I would expect actual usage to fail because neither CRYPT_R_STRUCT_CRYPT_DATA nor CRYPT_R_CRYPTD gets set. It doesn't matter right now because we never actually end up using system crypt_r right now, but would be a problem if we did.
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.
Yes right I knew for crypt_r not used it was just to pass config step :-) fiar point I ll take your suggestion
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.
Your current variant also works though, maybe it's cleaner this way :)
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.
The current version works better maybe in the longer run. What do you prefer ?
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.
Yeah, let's stick with your current version.
9bcbb18
to
1d98699
Compare
OpenBSD needs additional header too.
Do you know if there is any good way we can test FreeBSD in CI? |
well there is this possibility : https://builds.sr.ht/ as we do for radare2 project here https://github.com/radareorg/radare2/blob/master/.builds/freebsd.yml |
OpenBSD needs additional header too.