diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-04-15 00:35:38 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-04-15 00:35:38 +0000 |
commit | 8e71af4aa590f1cdeeb93d13e09efcc8076be1c4 (patch) | |
tree | 2ae6d91a9b9e20f36d8ea3011f8560442e7d38e5 /modules/pam_access | |
parent | 190d45d02d4af57f1f5688eb323bd4ccd5f42604 (diff) | |
download | pam-8e71af4aa590f1cdeeb93d13e09efcc8076be1c4.tar.gz pam-8e71af4aa590f1cdeeb93d13e09efcc8076be1c4.tar.bz2 pam-8e71af4aa590f1cdeeb93d13e09efcc8076be1c4.zip |
pam_access, pam_issue: do not assume that getdomainname always exists
* modules/pam_access/pam_access.c (netgroup_match): Place the code
that calls getdomainname under HAVE_GETDOMAINNAME guard.
* modules/pam_issue/pam_issue.c (read_issue_quoted): Likewise.
Resolves: https://github.com/linux-pam/linux-pam/issues/43
Diffstat (limited to 'modules/pam_access')
-rw-r--r-- | modules/pam_access/pam_access.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 4d4339a4..4c11418d 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -481,6 +481,8 @@ netgroup_match (pam_handle_t *pamh, const char *netgroup, { int retval; char *mydomain = NULL; + +#ifdef HAVE_GETDOMAINNAME char domainname_res[256]; if (getdomainname (domainname_res, sizeof (domainname_res)) == 0) @@ -490,6 +492,7 @@ netgroup_match (pam_handle_t *pamh, const char *netgroup, mydomain = domainname_res; } } +#endif #ifdef HAVE_INNETGR retval = innetgr (netgroup, machine, user, mydomain); |