/[packages]/cauldron/pam/current/SOURCES/pam-1.1.0-console-fixes.patch
ViewVC logotype

Contents of /cauldron/pam/current/SOURCES/pam-1.1.0-console-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 389214 - (show annotations) (download)
Thu Jan 17 21:30:27 2013 UTC (10 years, 8 months ago) by pterjan
File size: 2151 byte(s)
oops
1 diff -up Linux-PAM-1.1.0/modules/pam_console/handlers.c.consolefix Linux-PAM-1.1.0/modules/pam_console/handlers.c
2 --- Linux-PAM-1.1.0/modules/pam_console/handlers.c.consolefix 2009-11-02 08:45:24.000000000 +0100
3 +++ Linux-PAM-1.1.0/modules/pam_console/handlers.c 2009-11-02 08:50:19.000000000 +0100
4 @@ -172,13 +172,13 @@ call_exec(struct console_handler *handle
5 const char *flagptr;
6 const char **argv;
7 int i = 0;
8 - argv = malloc(sizeof(*argv)*nparams+2);
9 -
10 + argv = malloc(sizeof(*argv)*(nparams+2));
11 +
12 if (argv == NULL)
13 return;
14 -
15 +
16 argv[i++] = handler->executable;
17 -
18 +
19 for (flagptr = handler->flags; *flagptr != '\0'; flagptr += strlen(flagptr)+1) {
20 switch (testflag(flagptr)) {
21 case HF_LOGFAIL:
22 @@ -231,7 +231,7 @@ execute_handler(pam_handle_t *pamh, stru
23 }
24
25 sighandler = signal(SIGCHLD, SIG_DFL);
26 -
27 +
28 child = fork();
29 switch (child) {
30 case -1:
31 @@ -246,30 +246,31 @@ execute_handler(pam_handle_t *pamh, stru
32 if (!wait_exit) {
33 switch(fork()) {
34 case 0:
35 - exit(0);
36 + if(setsid() == -1) {
37 + _exit(255);
38 + }
39 + break;
40 case -1:
41 - exit(255);
42 + _exit(255);
43 default:
44 - if(setsid() == -1) {
45 - exit(255);
46 - }
47 + _exit(0);
48 }
49 }
50 if (set_uid) {
51 struct passwd *pw;
52 pw = getpwnam(user);
53 if (pw == NULL)
54 - exit(255);
55 + _exit(255);
56 if (setgid(pw->pw_gid) == -1 ||
57 setuid(pw->pw_uid) == -1)
58 - exit(255);
59 + _exit(255);
60 }
61 call_exec(handler, nparams, user, tty);
62 - exit(255);
63 + _exit(255);
64 default:
65 break;
66 }
67 -
68 +
69 waitpid(child, &rv, 0);
70
71 if (sighandler != SIG_ERR)

  ViewVC Help
Powered by ViewVC 1.1.28