comparison security/linux-pam/musl.patch @ 385:3b0114bc7438

security/linux-pam: initial import, closes #1483
author David Demelier <markand@malikania.fr>
date Mon, 01 Apr 2019 20:10:00 +0200
parents
children
comparison
equal deleted inserted replaced
384:df76922c2bf0 385:3b0114bc7438
1 --- modules/pam_exec/pam_exec.c.orig
2 +++ modules/pam_exec/pam_exec.c
3 @@ -103,11 +103,14 @@
4 int optargc;
5 const char *logfile = NULL;
6 const char *authtok = NULL;
7 + char authtok_buf[PAM_MAX_RESP_SIZE+1];
8 +
9 pid_t pid;
10 int fds[2];
11 int stdout_fds[2];
12 FILE *stdout_file = NULL;
13
14 + memset(authtok_buf, 0, sizeof(authtok_buf));
15 if (argc < 1) {
16 pam_syslog (pamh, LOG_ERR,
17 "This module needs at least one argument");
18 @@ -180,12 +183,12 @@
19 if (resp)
20 {
21 pam_set_item (pamh, PAM_AUTHTOK, resp);
22 - authtok = strndupa (resp, PAM_MAX_RESP_SIZE);
23 + authtok = strncpy (authtok_buf, resp, sizeof (authtok_buf));
24 _pam_drop (resp);
25 }
26 }
27 else
28 - authtok = strndupa (void_pass, PAM_MAX_RESP_SIZE);
29 + authtok = strncpy (authtok_buf, void_pass, sizeof (authtok_buf));
30
31 if (pipe(fds) != 0)
32 {
33 --- modules/pam_lastlog/pam_lastlog.c.orig
34 +++ modules/pam_lastlog/pam_lastlog.c
35 @@ -10,6 +10,7 @@
36
37 #include "config.h"
38
39 +#include <paths.h>
40 #include <fcntl.h>
41 #include <time.h>
42 #include <errno.h>
43 @@ -48,6 +49,10 @@
44
45 #ifndef _PATH_BTMP
46 # define _PATH_BTMP "/var/log/btmp"
47 +#endif
48 +
49 +#ifndef __GLIBC__
50 +#define logwtmp(args...)
51 #endif
52
53 /* XXX - time before ignoring lock. Is 1 sec enough? */