google / google/google-authenticator-libpam
Building google-authenticator on illumos/Solaris fails
- Dominant language
- C
- Stars
- 2k
- Forks
- 305
- PR merge metrics
- No merged PRs in 30d
Description
_From @ThomasHabets on October 10, 2014 8:7_
Original [issue 317](https://code.google.com/p/google-authenticator/issues/detail?id=317) created by alasdairrr on 2013-09-18T10:16:38.000Z:
What steps will reproduce the problem?
1. Download google-authenticator/libpam
2. Type gmake
3. Watch failure
What is the expected output? What do you see instead?
Expected output is a completed build. What I see instead is:
gcc --std=gnu99 -Wall -O2 -g -fPIC -c -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -fvisibility=hidden -o demo.o demo.c
demo.c: In function 'pam_get_item':
demo.c:97: warning: initialization from incompatible pointer type
demo.c: At top level:
demo.c:106: error: conflicting types for 'pam_set_item'
/usr/include/security/pam_appl.h:175: note: previous declaration of 'pam_set_item' was here
What version of the product are you using? On what operating system?
Applies to 1.0, and the latest git version at the date of filing the bug (a096a628455a05c5ff3b651e6aeb1dad9a646742).
Operating system is SmartOS (everycity_20130902T111649Z) but this applies to all illumos based distributions, as well as OpenSolaris, Solaris 10 and Solaris 11.
Please provide any additional information below.
The problem here is that on Linux, pam_get_item and pam_set_item both have const values on the last argument:
pam_get_item(const pam_handle_t _pamh, int item_type, const void *_item);
pam_set_item(pam_handle_t *pamh, int item_type, const void *item);
On illumos/Solaris, only pam_set_item has a const, the pam_get_item does not:
pam_get_item(const pam_handle_t _pamh, int item_type, void *_item);
pam_set_item(pam_handle_t *pamh, int item_type, const void *item)
I have filed a bug against illumos for this as it seems a little inconsistent, but unfortunately the pam_get_item/pam_set_item are stable committed interfaces, so I doubt this can be changed. The bug FYI is here: https://www.illumos.org/issues/4144
Some attempts have been made to fix building google-authenticator libpam on Solaris already, and the fix is "almost" correct. But the author of the patch has assumed that on Solaris both pam_get_item and pam_set_item don't have const present, which isn't true. To rectify this, please see the attached patch.
This patch should work on all illumos/Solaris variants.
_Copied from original issue: google/google-authenticator#316_
Contributor guide
Assessment
This issue has not been assessed yet.