1 --- Linux-PAM-0.99.6.2/modules/pam_selinux/pam_selinux.8.xml.drop-multiple 2006-06-18 10:26:59.000000000 +0200
2 +++ Linux-PAM-0.99.6.2/modules/pam_selinux/pam_selinux.8.xml 2006-11-10 17:47:16.000000000 +0100
17 - <option>multiple</option>
21 - Tells pam_selinux.so to allow the user to select the
22 - security context they will login with, if the user has
32 --- Linux-PAM-0.99.6.2/modules/pam_selinux/pam_selinux.c.drop-multiple 2006-11-10 17:44:33.000000000 +0100
33 +++ Linux-PAM-0.99.6.2/modules/pam_selinux/pam_selinux.c 2006-11-10 17:44:33.000000000 +0100
37 static security_context_t
38 -select_context (pam_handle_t *pamh, security_context_t* contextlist,
42 - char *text=calloc(PATH_MAX,1);
45 - return (security_context_t) strdup(contextlist[0]);
47 - snprintf(text, PATH_MAX,
48 - _("Your default context is %s. \n"), contextlist[0]);
49 - send_text(pamh,text,debug);
51 - query_response(pamh,_("Do you want to choose a different one? [n]"),
53 - if (responses && ((responses[0] == 'y') ||
54 - (responses[0] == 'Y')))
58 - const char *prompt=_("Enter number of choice: ");
59 - int len=strlen(prompt);
62 - _pam_drop(responses);
63 - for (i = 0; contextlist[i]; i++) {
64 - len+=strlen(contextlist[i]) + 10;
67 - for (i = 0; contextlist[i]; i++) {
68 - snprintf(buf, PATH_MAX,
69 - "[%d] %s\n", i+1, contextlist[i]);
70 - strncat(text,buf,len);
72 - strcat(text,prompt);
73 - while ((choice < 1) || (choice > i)) {
74 - query_response(pamh,text,&responses,debug);
75 - choice = strtol (responses, NULL, 10);
76 - _pam_drop(responses);
79 - return (security_context_t) strdup(contextlist[choice-1]);
82 - _pam_drop(responses);
84 - return (security_context_t) strdup(contextlist[0]);
87 -static security_context_t
88 manual_context (pam_handle_t *pamh, const char *user, int debug)
90 security_context_t newcon;
92 int argc, const char **argv)
94 int i, debug = 0, ttys=1, has_tty=isatty(0);
95 - int verbose=0, multiple=0, close_session=0;
96 + int verbose=0, close_session=0;
98 security_context_t* contextlist = NULL;
101 if (strcmp(argv[i], "verbose") == 0) {
104 - if (strcmp(argv[i], "multiple") == 0) {
107 if (strcmp(argv[i], "close") == 0) {
113 if (num_contexts > 0) {
114 - if (multiple && (num_contexts > 1) && has_tty) {
115 - user_context = select_context(pamh,contextlist, debug);
116 - freeconary(contextlist);
118 - user_context = (security_context_t) strdup(contextlist[0]);
119 - freeconary(contextlist);
121 + user_context = (security_context_t) strdup(contextlist[0]);
122 + freeconary(contextlist);
125 user_context = manual_context(pamh,username,debug);