security/linux-pam/musl.patch

Fri, 15 Nov 2019 20:05:00 +0100

author
David Demelier <markand@malikania.fr>
date
Fri, 15 Nov 2019 20:05:00 +0100
changeset 1207
c9592a9a949b
parent 385
3b0114bc7438
permissions
-rw-r--r--

python/python2: add DEPRECATED tag

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

mercurial