You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
crypt.h should be in _cryptmodule.c, not in public header #88914
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-07-27.22:58:40.724>created_at=<Date2021-07-27.21:23:37.808>labels= ['3.8', '3.9', '3.10', '3.11', 'expert-C-API', '3.7']
title='crypt.h should be in _cryptmodule.c, not in public header'updated_at=<Date2021-09-30.21:54:16.845>user='https://github.com/geofft'
In bpo-32635, it was discovered that _cryptmodule.c was missing a dependency on crypt.h, which caused it to segfault when it was missing the proper prototype for crypt. This was fixed by adding an #include <crypt.h> to Python.h.
This include doesn't need to be in the public header; it only needs to be in _cryptmodule.c. Removing it from the public header is helpful for packagers, because it means that the libpython-dev (or whatever) package doesn't need a dependency on libcrypt-dev, only on the libcrypt runtime library.
New changeset 196998e by Geoffrey Thomas in branch 'main':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) 196998e
New changeset 9626ac8 by Miss Islington (bot) in branch '3.9':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) 9626ac8
New changeset 80285ec by Miss Islington (bot) in branch '3.10':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) (GH-28636) 80285ec
Could you backport this fix to at least 3.9 and 3.10 branches?
Done.
This is fix for regression which was previously backported to 2.7 and 3.6 branches.
I'm not sure what you mean.
In Python 2.7 and Python 3.6, <crypt.h> was already included by Include/Python.h:
#ifdefHAVE_CRYPT_H#include<crypt.h>#endif
Arfrever commented on Sep 30, 2021
Arfrevermannequin
Mannequin
More actions
> This is fix for regression which was previously backported to 2.7 and 3.6 branches.
I'm not sure what you mean.
In Python 2.7 and Python 3.6, <crypt.h> was already included by Include/Python.h:
See issue bpo-32635, where Victor Stinner backported some commit (with problematic location of '#include <crypt.h>') to 2.7 and 3.6 branches (which was released in >=2.7.15 and >=3.6).
See issue bpo-32635, where Victor Stinner backported some commit (with problematic location of '#include <crypt.h>') to 2.7 and 3.6 branches (which was released in >=2.7.15 and >=3.6).
Activity
geofft commentedon Jul 27, 2021
In bpo-32635, it was discovered that _cryptmodule.c was missing a dependency on crypt.h, which caused it to segfault when it was missing the proper prototype for crypt. This was fixed by adding an #include <crypt.h> to Python.h.
This include doesn't need to be in the public header; it only needs to be in _cryptmodule.c. Removing it from the public header is helpful for packagers, because it means that the libpython-dev (or whatever) package doesn't need a dependency on libcrypt-dev, only on the libcrypt runtime library.
miss-islington commentedon Jul 27, 2021
New changeset 196998e by Geoffrey Thomas in branch 'main':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394)
196998e
Arfrever commentedon Sep 29, 2021
Could you backport this fix to at least 3.9 and 3.10 branches?
This is fix for regression which was previously backported to 2.7 and 3.6 branches.
miss-islington commentedon Sep 29, 2021
New changeset 9626ac8 by Miss Islington (bot) in branch '3.9':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394)
9626ac8
vstinner commentedon Sep 29, 2021
New changeset 80285ec by Miss Islington (bot) in branch '3.10':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) (GH-28636)
80285ec
vstinner commentedon Sep 29, 2021
Done.
I'm not sure what you mean.
In Python 2.7 and Python 3.6, <crypt.h> was already included by Include/Python.h:
Arfrever commentedon Sep 30, 2021
See issue bpo-32635, where Victor Stinner backported some commit (with problematic location of '#include <crypt.h>') to 2.7 and 3.6 branches (which was released in >=2.7.15 and >=3.6).
vstinner commentedon Sep 30, 2021
crypt.h was added to Python.h by: https://github.com/python/cpython/pull/5284/files
And this change was then backported to 2.7 and 3.6. Ok, now I understand.
Well, it's now fixed in all branches accepting bugfixes.