-
Notifications
You must be signed in to change notification settings - Fork 0
/
pam_sqlite3.c
792 lines (678 loc) · 20.9 KB
/
pam_sqlite3.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
/*
* * PAM authentication module for SQLite
* *
* * pam_sqlite3: zhangjun <18238896@qq.com>
* *
* * This work is a dirivative of pam_sqlite3
* * (https://github.com/HormyAJP/pam_sqlite3).
* *
* pam_sqlite3
*
* This work is Copyright (C) zhangjun
* GNU GPL v3
* This work is a dirivative of pam_sqlite3, Copyright (C) HormyAJP
* pam_sqlite3 is a dirivative of pam_sqlite3.
*
* Different portions of this program are Copyright to the respective
* authors of those peices of code; but are all under the terms
* of of the GNU General Pulblic License.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
*
* */
/* $Id: pam_sqlite.c, 2019/04/28 22:30:07 $ */
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <syslog.h>
#include <ctype.h>
#include <unistd.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <time.h>
#include <sqlite3.h>
#ifdef HAVE_OPENSSL_MD5_H
#include <openssl/md5.h>
#endif
#ifdef HAVE_OPENSSL_SHA_H
#include <openssl/sha.h>
#endif
#include <sys/cdefs.h>
#define PAM_OPT_USE_FIRST_PASS 0x04
#define PAM_OPT_TRY_FIRST_PASS 0x08
#define PAM_OPT_ECHO_PASS 0x20
#include <security/pam_modules.h>
#include <security/pam_appl.h>
#define PAM_MODULE_NAME "pam_sqlite3"
#define SYSLOG(x...) do { \
openlog("pam_sqlite3", LOG_PID, LOG_AUTH); \
syslog(LOG_INFO, ##x); \
closelog(); \
} while(0)
#define SYSLOGERR(x...) SYSLOG("Error: " x)
#define FAIL(MSG) \
{ \
SYSLOGERR(MSG); \
free(buf); \
return NULL; \
}
#define GROW(x) if (x > buflen - dest - 1) { \
char *grow; \
buflen += 256 + x; \
grow = realloc(buf, buflen + 256 + x); \
if (grow == NULL) FAIL("Out of memory building query"); \
buf = grow; \
}
#define APPEND(str, len) GROW(len); memcpy(buf + dest, str, len); dest += len
#define APPENDS(str) len = strlen(str); APPEND(str, len)
#define MAX_ZSQL -1
/*
* * Being very defensive here. The current logic in the rest of the code should prevent this from
* * happening. But lets protect against future code changes which could cause a NULL ptr to creep
* * in.
* */
#define CHECK_STRING(str) \
if (!str) \
FAIL("Internal error in format_query: string ptr " #str " was NULL");
static const char* UNKNOWN_SERVICE = "<Unknown Service>";
typedef enum {
PW_CLEAR = 0,
PW_MD5 = 1,
PW_SHA = 2
} pw_scheme;
/* Options */
struct module_options {
char *db;
char *table;
char *user;
char *passwd;
char *expire;
pw_scheme pw_type;
};
static void *
xcalloc(size_t nmemb, size_t size)
{
void *retval;
double v = ((double)size) * (int)(nmemb & (((size_t)-1) >> 1));
if (v != nmemb * size) {
return NULL;
}
retval = calloc(nmemb, size);
return retval;
}
#ifdef HAVE_OPENSSL_MD5_H
#define HAVE_PAM_MD5_DATA
/* pam_md5_data */
static char *
pam_md5_data(const char *d, unsigned int sz, char *md)
{
size_t i, j;
unsigned char buf[16];
if (md == NULL) {
if ((md = xcalloc(32 + 1, sizeof(char))) == NULL) {
return NULL;
}
}
MD5((unsigned char*)d, (unsigned long)sz, buf);
for (i = 0, j = 0; i < 16; i++, j += 2) {
md[j + 0] = "0123456789abcdef"[(int)(buf[i] >> 4)];
md[j + 1] = "0123456789abcdef"[(int)(buf[i] & 0x0f)];
}
md[j] = '\0';
return md;
}
#endif
#ifdef HAVE_OPENSSL_SHA_H
#define HAVE_PAM_SHA_DATA
/* pam_sha_data */
static char *
pam_sha_data(const char *d, unsigned int sz, char *md)
{
size_t i, j;
unsigned char buf[SHA_DIGEST_LENGTH];
if (md == NULL) {
if ((md = xcalloc(SHA_DIGEST_LENGTH*2 + 1, sizeof(char))) == NULL) {
return NULL;
}
}
SHA1((unsigned char*)d, (unsigned long)sz, buf);
for (i = 0, j = 0; i < SHA_DIGEST_LENGTH; i++, j += 2) {
md[j + 0] = "0123456789abcdef"[(int)(buf[i] >> 4)];
md[j + 1] = "0123456789abcdef"[(int)(buf[i] & 0x0f)];
}
md[j] = '\0';
return md;
}
#endif
static char *
format_query(const char *template, struct module_options *options,
const char *user, const char *passwd)
{
char *buf = malloc(256);
if (!buf)
return NULL;
int buflen = 256;
int dest = 0, len;
const char *src = template;
char *pct;
char *tmp;
while (*src) {
pct = strchr(src, '%');
if (pct) {
/* copy from current position to % char into buffer */
if (pct != src) {
len = pct - src;
APPEND(src, len);
}
/* decode the escape */
switch(pct[1]) {
case 'U': /* username */
if (user) {
tmp = sqlite3_mprintf("%q", user);
if (!tmp)
FAIL("sqlite3_mprintf out of memory");
len = strlen(tmp);
APPEND(tmp, len);
sqlite3_free(tmp);
}
break;
case 'P': /* password */
if (passwd) {
tmp = sqlite3_mprintf("%q", passwd);
if (!tmp)
FAIL("sqlite3_mprintf out of memory");
len = strlen(tmp);
APPEND(tmp, len);
sqlite3_free(tmp);
}
break;
case 'O': /* option value */
pct++;
switch (pct[1]) {
case 'p': /* passwd */
CHECK_STRING(options->passwd);
APPENDS(options->passwd);
break;
case 'u': /* username */
CHECK_STRING(options->user);
APPENDS(options->user);
break;
case 't': /* table */
CHECK_STRING(options->table);
APPENDS(options->table);
break;
case 'e': /* expire */
CHECK_STRING(options->expire);
APPENDS(options->expire);
break;
}
break;
case '%': /* quoted % sign */
APPEND(pct, 1);
break;
default: /* unknown */
APPEND(pct, 2);
break;
}
src = pct + 2;
} else {
/* copy rest of string into buffer and we're done */
len = strlen(src);
APPEND(src, len);
break;
}
}
buf[dest] = '\0';
return buf;
}
/*
* * safe_assign protects against duplicate config options causing a memory leak.
* */
static void inline
safe_assign(char **asignee, const char *val)
{
if(*asignee)
free(*asignee);
*asignee = strdup(val);
}
static int
pam_conv_pass(pam_handle_t *pamh, int options)
{
int retval;
const void *item;
const struct pam_conv *conv;
struct pam_message msg;
const struct pam_message *msgs[1];
struct pam_response *resp;
if ((retval = pam_get_item(pamh, PAM_CONV, &item)) != PAM_SUCCESS)
return retval;
conv = (const struct pam_conv *)item;
msg.msg_style = options & PAM_OPT_ECHO_PASS ? PAM_PROMPT_ECHO_ON : PAM_PROMPT_ECHO_OFF;
msg.msg = "";
msgs[0] = &msg;
if ((retval = conv->conv(1, msgs, &resp, conv->appdata_ptr)) != PAM_SUCCESS)
return retval;
if ((retval = pam_set_item(pamh, PAM_AUTHTOK, resp[0].resp)) != PAM_SUCCESS)
return retval;
memset(resp[0].resp, 0, strlen(resp[0].resp));
free(resp[0].resp);
free(resp);
return PAM_SUCCESS;
}
int
pam_get_pass(pam_handle_t *pamh, const char **passp, int options)
{
int retval;
const void *item = NULL;
/*
* Grab the already-entered password if we might want to use it.
*/
if (options & (PAM_OPT_TRY_FIRST_PASS | PAM_OPT_USE_FIRST_PASS)) {
if ((retval = pam_get_item(pamh, PAM_AUTHTOK, &item)) != PAM_SUCCESS)
return retval;
}
if (item == NULL) {
/* The user hasn't entered a password yet. */
if (options & PAM_OPT_USE_FIRST_PASS)
return PAM_AUTH_ERR;
/* Use the conversation function to get a password. */
if ((retval = pam_conv_pass(pamh, options)) != PAM_SUCCESS ||
(retval = pam_get_item(pamh, PAM_AUTHTOK, &item)) != PAM_SUCCESS)
return retval;
}
*passp = (const char *)item;
return PAM_SUCCESS;
}
const char*
pam_get_service(pam_handle_t *pamh, const char **service)
{
if (pam_get_item(pamh, PAM_SERVICE, (const void**)service) != PAM_SUCCESS)
*service = UNKNOWN_SERVICE;
return *service;
}
/* private: parse and set the specified string option */
static void
set_module_option(const char *option, struct module_options *options)
{
char *buf, *eq;
char *val, *end;
if(!option || !*option)
return;
buf = strdup(option);
if(!buf)
return;
if((eq = strchr(buf, '='))) {
end = eq - 1;
val = eq + 1;
if(end <= buf || !*val)
{
free(buf);
return;
}
while(end > buf && isspace(*end))
end--;
end++;
*end = '\0';
while(*val && isspace(*val))
val++;
} else {
val = NULL;
}
// SYSLOG("setting option: %s=>%s\n", buf, val);
if(!strcmp(buf, "db")) {
safe_assign(&options->db, val);
} else if(!strcmp(buf, "table")) {
safe_assign(&options->table, val);
} else if(!strcmp(buf, "user")) {
safe_assign(&options->user, val);
} else if(!strcmp(buf, "passwd")) {
safe_assign(&options->passwd, val);
} else if(!strcmp(buf, "expire")) {
safe_assign(&options->expire, val);
} else if(!strcmp(buf, "crypt")) {
if(!strcmp(val, "1")) {
options->pw_type = PW_MD5;
} else if(!strcmp(val, "2")) {
options->pw_type = PW_SHA;
} else {
options->pw_type = PW_CLEAR;
}
} else {
SYSLOG("ignored option: %s\n", buf);
}
free(buf);
}
/* private: read module options from file or commandline */
static int
get_module_options(int argc, const char **argv, struct module_options **options)
{
int i, rc;
struct module_options *opts;
rc = 0;
if (!(opts = (struct module_options *)malloc(sizeof *opts))){
*options = NULL;
return rc;
}
bzero(opts, sizeof(*opts));
opts->pw_type = PW_CLEAR;
for(i = 0; i < argc; i++) {
set_module_option(argv[i], opts);
}
*options = opts;
return rc;
}
/* private: free module options returned by get_module_options() */
static void
free_module_options(struct module_options *options)
{
if (!options)
return;
if(options->db)
free(options->db);
if(options->table)
free(options->table);
if(options->user)
free(options->user);
if(options->passwd)
free(options->passwd);
if(options->expire)
free(options->expire);
bzero(options, sizeof(*options));
free(options);
}
/* private: make sure required options are present (in cmdline or conf file) */
static int
options_valid(struct module_options *options)
{
if(!options)
{
SYSLOGERR("failed to read options.");
return -1;
}
if(options->db == 0 || options->table == 0 || options->user == 0)
{
SYSLOGERR("the database, table and user options are required.");
return -1;
}
return 0;
}
/* private: open SQLite database */
static sqlite3 *
pam_sqlite3_connect(struct module_options *options)
{
const char *errtext = NULL;
sqlite3 *sdb = NULL;
if (sqlite3_open(options->db, &sdb) != SQLITE_OK) {
errtext = sqlite3_errmsg(sdb);
SYSLOG("Error opening SQLite database (%s)", errtext);
/*
* * N.B. sdb is usually non-NULL when errors occur, so we explicitly
* * release the resource and return NULL to indicate failure to the caller.
* */
sqlite3_close(sdb);
return NULL;
}
return sdb;
}
/* private: authenticate expire for acount */
static int
auth_verify_expire(const char *user, struct module_options *options)
{
int res;
int rc = PAM_CRED_EXPIRED;
sqlite3 *conn = NULL;
sqlite3_stmt *vm = NULL;
const char *tail = NULL;
const char *errtext = NULL;
char *query = NULL;
time_t timenow = {0}, endtime = {0};
struct tm *timeinfo;
if(!(conn = pam_sqlite3_connect(options))) {
rc = PAM_AUTH_ERR;
goto done;
}
if(!(query = format_query("SELECT %Oe FROM %Ot WHERE %Ou='%U'", options, user, NULL))) {
SYSLOGERR("failed to construct sql query");
rc = PAM_AUTH_ERR;
goto done;
}
res = sqlite3_prepare(conn, query, MAX_ZSQL, &vm, &tail);
free(query);
if (res != SQLITE_OK) {
errtext = sqlite3_errmsg(conn);
SYSLOG("Error executing SQLite query (%s)", errtext);
rc = PAM_AUTH_ERR;
goto done;
}
if (SQLITE_ROW != sqlite3_step(vm)) {
SYSLOG("no rows to retrieve");
rc = PAM_AUTH_ERR;
goto done;
}
const char *expire = (const char *) sqlite3_column_text(vm, 0);
if (!expire) {
SYSLOG("sqlite3 failed to return row data");
rc = PAM_AUTH_ERR;
goto done;
}
char year[5], mon[3], day[3], ym[8];
char *dtmp = strrchr(expire, '-');
strncpy(ym, expire, strlen(expire) - strlen(dtmp));
char *mtmp = strrchr(ym, '-');
strncpy(year, ym, strlen(ym) - strlen(mtmp));
strcpy(day, ++dtmp);
strcpy(mon, ++mtmp);
timenow = time(NULL);
timeinfo = localtime(&timenow);
timeinfo->tm_year = atoi(year) - 1900;
timeinfo->tm_mon = atoi(mon) - 1;
timeinfo->tm_mday = atoi(day);
endtime = mktime(timeinfo);
if (difftime(endtime, timenow) > 0 ) {
rc = PAM_SUCCESS;
}
done:
sqlite3_finalize(vm);
sqlite3_close(conn);
return rc;
}
/* private: authenticate user and passwd against database */
static int
auth_verify_password(const char *user, const char *passwd,
struct module_options *options)
{
int res;
sqlite3 *conn = NULL;
sqlite3_stmt *vm = NULL;
int rc = PAM_AUTH_ERR;
const char *tail = NULL;
const char *errtext = NULL;
char *encrypted_pw = NULL;
char *query = NULL;
if(!(conn = pam_sqlite3_connect(options))) {
rc = PAM_AUTH_ERR;
goto done;
}
if(!(query = format_query("SELECT %Op FROM %Ot WHERE %Ou='%U'", options, user, NULL) )) {
SYSLOGERR("failed to construct sql query");
rc = PAM_AUTH_ERR;
goto done;
}
// SYSLOG("query: %s", query);
res = sqlite3_prepare(conn, query, MAX_ZSQL, &vm, &tail);
free(query);
if (res != SQLITE_OK) {
errtext = sqlite3_errmsg(conn);
SYSLOG("Error executing SQLite query (%s)", errtext);
rc = PAM_AUTH_ERR;
goto done;
}
if (SQLITE_ROW != sqlite3_step(vm)) {
SYSLOG("no rows to retrieve");
rc = PAM_USER_UNKNOWN;
goto done;
}
const char *stored_pw = (const char *) sqlite3_column_text(vm, 0);
if (!stored_pw) {
SYSLOG("sqlite3 failed to return row data");
rc = PAM_AUTH_ERR;
goto done;
}
switch(options->pw_type) {
case PW_CLEAR:
if(strcmp(passwd, stored_pw) == 0)
rc = PAM_SUCCESS;
break;
#ifdef HAVE_PAM_MD5_DATA
case PW_MD5:
encrypted_pw = pam_md5_data(passwd, strlen(passwd), encrypted_pw);
if (!encrypted_pw) {
SYSLOG("crypt failed when encrypting password");
rc = PAM_AUTH_ERR;
goto done;
}
if(strcmp(encrypted_pw, stored_pw) == 0)
rc = PAM_SUCCESS;
break;
#endif
#ifdef HAVE_PAM_SHA_DATA
case PW_SHA:
encrypted_pw = pam_sha_data(passwd, strlen(passwd), encrypted_pw);
if (!encrypted_pw) {
SYSLOG("crypt failed when encrypting password");
rc = PAM_AUTH_ERR;
goto done;
}
if(strcmp(encrypted_pw, stored_pw) == 0)
rc = PAM_SUCCESS;
break;
}
#endif
done:
sqlite3_finalize(vm);
sqlite3_close(conn);
return rc;
}
/* public: authenticate user */
PAM_EXTERN int
pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
struct module_options *options = NULL;
const char *user = NULL, *password = NULL, *service = NULL;
int rc, std_flags;
std_flags = get_module_options(argc, argv, &options);
if(options_valid(options) != 0) {
rc = PAM_AUTH_ERR;
goto done;
}
if((rc = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS) {
SYSLOG("failed to get username from pam");
goto done;
}
SYSLOG("attempting to authenticate: '%s'", user);
if((rc = pam_get_pass(pamh, &password, std_flags) != PAM_SUCCESS)) {
goto done;
}
if((rc = auth_verify_password(user, password, options)) != PAM_SUCCESS)
SYSLOG("(%s) user '%s' is not authenticated.", pam_get_service(pamh, &service), user);
else
SYSLOG("(%s) user '%s' is authenticated.", pam_get_service(pamh, &service), user);
done:
free_module_options(options);
return rc;
}
/* public: check if account has active */
PAM_EXTERN int
pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
struct module_options *options = NULL;
const char *user = NULL, *service = NULL;
int rc = PAM_AUTH_ERR;
sqlite3 *conn = NULL;
sqlite3_stmt *vm = NULL;
char *query = NULL;
const char *tail = NULL;
const char *errtext = NULL;
int res;
get_module_options(argc, argv, &options);
if(options_valid(options) != 0) {
rc = PAM_AUTH_ERR;
goto done;
}
if((rc = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS) {
SYSLOGERR("could not retrieve user");
rc = PAM_AUTH_ERR;
goto done;
}
if(!(conn = pam_sqlite3_connect(options))) {
SYSLOGERR("could not connect to database");
rc = PAM_AUTH_ERR;
goto done;
}
/* if account has activated then active = '1' */
if(!(query = format_query("SELECT active from %Ot WHERE %Ou='%U'", options, user, NULL))) {
SYSLOGERR("failed to construct sql query");
rc = PAM_AUTH_ERR;
goto done;
}
res = sqlite3_prepare(conn, query, MAX_ZSQL, &vm, &tail);
free(query);
if (res != SQLITE_OK) {
errtext = sqlite3_errmsg(conn);
SYSLOGERR("Error executing SQLite query (%s)", errtext);
rc = PAM_AUTH_ERR;
goto done;
}
res = sqlite3_step(vm);
if(SQLITE_ROW != res) {
SYSLOG("no rows to retrieve");
rc = PAM_AUTH_ERR;
goto done;
}
const char *active = (const char *) sqlite3_column_text(vm, 0);
if (atoi(active) == 1) {
if((rc = auth_verify_expire(user, options)) != PAM_SUCCESS) {
SYSLOG("(%s) user '%s' has expire.", pam_get_service(pamh, &service), user);
rc = PAM_ACCT_EXPIRED;
goto done;
}
} else {
SYSLOG("(%s) user '%s' is not activated.", pam_get_service(pamh, &service), user);
rc = PAM_ACCT_EXPIRED;
goto done;
}
SYSLOG("(%s) user '%s' is activated.", pam_get_service(pamh, &service), user);
rc = PAM_SUCCESS;
done:
/* Do all cleanup in one place. */
sqlite3_finalize(vm);
sqlite3_close(conn);
free_module_options(options);
return rc;
}
/* public: change password */
PAM_EXTERN int
pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
return PAM_SUCCESS;
}
/* public: just succeed. */
PAM_EXTERN int
pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
{
return PAM_SUCCESS;
}