pam_tacplus
pam_tacplus copied to clipboard
Use __thread (thread-local storage) keyword for pthread-safe
C99 supports Thread-Local Storage: https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Thread_002dLocal.html
This patch makes use of "__thread" storage class keyword to make the code pthread-safe without changing the code much:
- Changed all global variables which can be modified by multiple threads
- Changed static varible in tac_ntop()
- Removed unnecessary "static" from local variable in _pam_account()
Hi @kyeongy did you test if it works on older compilers as well?