]> git.pld-linux.org Git - packages/pam.git/blob - pam-selinux-drop-multiple.patch
- don't call pam_env twice (auth is enough)
[packages/pam.git] / pam-selinux-drop-multiple.patch
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
3 @@ -25,9 +25,6 @@
4         debug
5        </arg>
6        <arg choice="opt">
7 -       multiple
8 -      </arg>
9 -      <arg choice="opt">
10         open
11        </arg>
12        <arg choice="opt">
13 @@ -93,18 +90,6 @@
14        </varlistentry>
15        <varlistentry>
16          <term>
17 -          <option>multiple</option>
18 -        </term>
19 -        <listitem>
20 -          <para>
21 -            Tells pam_selinux.so to allow the user to  select  the
22 -            security context  they  will  login  with, if the user has
23 -            more than one role.
24 -          </para>
25 -        </listitem>
26 -      </varlistentry>
27 -      <varlistentry>
28 -        <term>
29            <option>open</option>
30          </term>
31          <listitem>
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
34 @@ -89,56 +89,6 @@
35  }
36  
37  static security_context_t
38 -select_context (pam_handle_t *pamh, security_context_t* contextlist,
39 -               int debug)
40 -{
41 -  char *responses;
42 -  char *text=calloc(PATH_MAX,1);
43 -
44 -  if (text == NULL)
45 -    return (security_context_t) strdup(contextlist[0]);
46 -
47 -  snprintf(text, PATH_MAX,
48 -          _("Your default context is %s. \n"), contextlist[0]);
49 -  send_text(pamh,text,debug);
50 -  free(text);
51 -  query_response(pamh,_("Do you want to choose a different one? [n]"),
52 -                &responses,debug);
53 -  if (responses && ((responses[0] == 'y') ||
54 -                   (responses[0] == 'Y')))
55 -    {
56 -      int choice=0;
57 -      int i;
58 -      const char *prompt=_("Enter number of choice: ");
59 -      int len=strlen(prompt);
60 -      char buf[PATH_MAX];
61 -
62 -      _pam_drop(responses);
63 -      for (i = 0; contextlist[i]; i++) {
64 -       len+=strlen(contextlist[i]) + 10;
65 -      }
66 -      text=calloc(len,1);
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);
71 -      }
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);
77 -      }
78 -      free(text);
79 -      return (security_context_t) strdup(contextlist[choice-1]);
80 -    }
81 -  else if (responses)
82 -    _pam_drop(responses);
83 -
84 -  return (security_context_t) strdup(contextlist[0]);
85 -}
86 -
87 -static security_context_t
88  manual_context (pam_handle_t *pamh, const char *user, int debug)
89  {
90    security_context_t newcon;
91 @@ -322,7 +272,7 @@
92                     int argc, const char **argv)
93  {
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;
97    int ret = 0;
98    security_context_t* contextlist = NULL;
99    int num_contexts = 0;
100 @@ -342,9 +292,6 @@
101      if (strcmp(argv[i], "verbose") == 0) {
102        verbose = 1;
103      }
104 -    if (strcmp(argv[i], "multiple") == 0) {
105 -      multiple = 1;
106 -    }
107      if (strcmp(argv[i], "close") == 0) {
108        close_session = 1;
109      }
110 @@ -377,13 +324,8 @@
111           free(level);
112    }
113    if (num_contexts > 0) {
114 -    if (multiple && (num_contexts > 1) && has_tty) {
115 -      user_context = select_context(pamh,contextlist, debug);
116 -      freeconary(contextlist);
117 -    } else {
118 -      user_context = (security_context_t) strdup(contextlist[0]);
119 -      freeconary(contextlist);
120 -    }
121 +    user_context = (security_context_t) strdup(contextlist[0]);
122 +    freeconary(contextlist);
123    } else {
124      if (has_tty) {
125        user_context = manual_context(pamh,username,debug);
This page took 0.036659 seconds and 3 git commands to generate.