Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Core: fix build without libcrypt #514

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

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Core: fix build without libcrypt #514

merged 1 commit into from
Feb 18, 2025

Conversation

orgads
Copy link
Contributor

@orgads orgads commented Feb 12, 2025

libcrypt is no longer part of glibc, so it might not be available.

Source: https://mailman.nginx.org/pipermail/nginx-devel/2024-February/U6NVHU7OSALXTJ65MTY2M5GNNWD7UA7U.html

@arut
Copy link
Contributor

arut commented Feb 13, 2025

First, a better solution would probably be this (see src/os/unix/ngx_posix_config.h):

#if (NGX_HAVE_CRYPT_H)                                                           
#include <crypt.h>                                                               
#endif

Further, are you having this issue on your system? If yes, could you please elaborate what kind of system that is. Unlike in the general POSIX case, this header is typically available in Linux distributions.

@pluknet
Copy link
Contributor

pluknet commented Feb 13, 2025

@orgads
Copy link
Contributor Author

orgads commented Feb 13, 2025

Nice, I wasn't aware of it. Cherry-picked it now to replace my change.

Our use-case was FIPS compliance. We had to disable the use of crypt.h.

@orgads orgads changed the title Fix compilation without crypt.h Core: fix build without libcrypt Feb 13, 2025
@arut
Copy link
Contributor

arut commented Feb 18, 2025

@orgads could you please revert completely to the original Piotr's patch?
I mean:

  • the dot at the end of commit log subject line
  • remove link to the email
  • add empty lines above and beyond the include
  • fix the email ("at" -> @)

I could do it myself and push the new (old) version to the branch, but it looks like you disabled this.

@arut
Copy link
Contributor

arut commented Feb 18, 2025

BTW, I tried this with musl (as mentioted by @PiotrSikora in the email thread) and indeed compilation breaks without the patch and works fine with it.

libcrypt is no longer part of glibc, so it might not be available.

Signed-off-by: Piotr Sikora <[email protected]>
@orgads
Copy link
Contributor Author

orgads commented Feb 18, 2025

@orgads could you please revert completely to the original Piotr's patch? I mean:

  • the dot at the end of commit log subject line
  • remove link to the email
  • add empty lines above and beyond the include
  • fix the email ("at" -> @)

I could do it myself and push the new (old) version to the branch, but it looks like you disabled this.

Sure, done.

I didn't disable anything intentionally, maybe it's something in the repo settings or somewhere else.

@arut arut merged commit 9a4090f into nginx:master Feb 18, 2025
@orgads orgads deleted the no-crypt branch February 18, 2025 15:07
@Maryna-f5 Maryna-f5 added this to the nginx-1.27.5 milestone Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants