1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
8 #cgo LDFLAGS: -lpam -fPIC
9 #include <security/pam_ext.h>
10 char *stringindex(char** a, int i) { return a[i]; }
11 const char *get_user(pam_handle_t *pamh) {
13 if (pam_get_item(pamh, PAM_USER, (const void**)&user) != PAM_SUCCESS)
17 const char *get_authtoken(pam_handle_t *pamh) {
19 if (pam_get_authtok(pamh, PAM_AUTHTOK, &token, NULL) != PAM_SUCCESS)