1 diff -up openssh-5.8p1/auth-krb5.c.kuserok openssh-5.8p1/auth-krb5.c
2 --- openssh-5.8p1/auth-krb5.c.kuserok 2009-12-21 00:49:22.000000000 +0100
3 +++ openssh-5.8p1/auth-krb5.c 2011-02-14 09:15:12.000000000 +0100
6 extern ServerOptions options;
9 +ssh_krb5_kuserok(krb5_context krb5_ctx, krb5_principal krb5_user, const char *client)
11 + if (options.use_kuserok)
12 + return krb5_kuserok(krb5_ctx, krb5_user, client);
16 + if (krb5_aname_to_localname(krb5_ctx, krb5_user, sizeof(kuser), kuser))
18 + return strcmp(kuser, client) == 0;
23 krb5_init(void *context)
25 @@ -146,7 +160,7 @@ auth_krb5_password(Authctxt *authctxt, c
29 - if (!krb5_kuserok(authctxt->krb5_ctx, authctxt->krb5_user, client)) {
30 + if (!ssh_krb5_kuserok(authctxt->krb5_ctx, authctxt->krb5_user, client)) {
34 diff -up openssh-5.8p1/gss-serv-krb5.c.kuserok openssh-5.8p1/gss-serv-krb5.c
35 --- openssh-5.8p1/gss-serv-krb5.c.kuserok 2006-09-01 07:38:36.000000000 +0200
36 +++ openssh-5.8p1/gss-serv-krb5.c 2011-02-14 09:15:12.000000000 +0100
37 @@ -57,6 +57,7 @@ extern ServerOptions options;
40 static krb5_context krb_context = NULL;
41 +extern int ssh_krb5_kuserok(krb5_context, krb5_principal, const char *);
43 /* Initialise the krb5 library, for the stuff that GSSAPI won't do */
45 @@ -97,7 +98,7 @@ ssh_gssapi_krb5_userok(ssh_gssapi_client
46 krb5_get_err_text(krb_context, retval));
49 - if (krb5_kuserok(krb_context, princ, name)) {
50 + if (ssh_krb5_kuserok(krb_context, princ, name)) {
52 logit("Authorized to %s, krb5 principal %s (krb5_kuserok)",
53 name, (char *)client->displayname.value);
54 diff -up openssh-5.8p1/servconf.c.kuserok openssh-5.8p1/servconf.c
55 --- openssh-5.8p1/servconf.c.kuserok 2011-02-14 09:15:12.000000000 +0100
56 +++ openssh-5.8p1/servconf.c 2011-02-14 09:20:22.000000000 +0100
57 @@ -142,6 +142,7 @@ initialize_server_options(ServerOptions
58 options->authorized_principals_file = NULL;
59 options->ip_qos_interactive = -1;
60 options->ip_qos_bulk = -1;
61 + options->use_kuserok = -1;
65 @@ -291,6 +292,8 @@ fill_default_server_options(ServerOption
66 if (use_privsep == -1)
69 + if (options->use_kuserok == -1)
70 + options->use_kuserok = 1;
72 if (use_privsep && options->compression == 1) {
73 error("This platform does not support both privilege "
74 @@ -312,7 +315,7 @@ typedef enum {
75 sPermitRootLogin, sLogFacility, sLogLevel,
76 sRhostsRSAAuthentication, sRSAAuthentication,
77 sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup,
78 - sKerberosGetAFSToken,
79 + sKerberosGetAFSToken, sKerberosUseKuserok,
80 sKerberosTgtPassing, sChallengeResponseAuthentication,
81 sPasswordAuthentication, sKbdInteractiveAuthentication,
82 sListenAddress, sAddressFamily,
83 @@ -381,11 +384,13 @@ static struct {
85 { "kerberosgetafstoken", sUnsupported, SSHCFG_GLOBAL },
87 + { "kerberosusekuserok", sKerberosUseKuserok, SSHCFG_ALL },
89 { "kerberosauthentication", sUnsupported, SSHCFG_ALL },
90 { "kerberosorlocalpasswd", sUnsupported, SSHCFG_GLOBAL },
91 { "kerberosticketcleanup", sUnsupported, SSHCFG_GLOBAL },
92 { "kerberosgetafstoken", sUnsupported, SSHCFG_GLOBAL },
93 + { "kerberosusekuserok", sUnsupported, SSHCFG_ALL },
95 { "kerberostgtpassing", sUnsupported, SSHCFG_GLOBAL },
96 { "afstokenpassing", sUnsupported, SSHCFG_GLOBAL },
97 @@ -1341,6 +1346,10 @@ process_server_config_line(ServerOptions
101 + case sKerberosUseKuserok:
102 + intptr = &options->use_kuserok;
107 if (!arg || *arg == '\0')
108 @@ -1544,6 +1553,7 @@ copy_set_server_options(ServerOptions *d
109 M_CP_INTOPT(max_authtries);
110 M_CP_INTOPT(ip_qos_interactive);
111 M_CP_INTOPT(ip_qos_bulk);
112 + M_CP_INTOPT(use_kuserok);
116 @@ -1764,6 +1774,7 @@ dump_config(ServerOptions *o)
117 dump_cfg_fmtint(sUseDNS, o->use_dns);
118 dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding);
119 dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
120 + dump_cfg_fmtint(sKerberosUseKuserok, o->use_kuserok);
122 /* string arguments */
123 dump_cfg_string(sPidFile, o->pid_file);
124 diff -up openssh-5.8p1/servconf.h.kuserok openssh-5.8p1/servconf.h
125 --- openssh-5.8p1/servconf.h.kuserok 2011-02-14 09:15:12.000000000 +0100
126 +++ openssh-5.8p1/servconf.h 2011-02-14 09:15:12.000000000 +0100
127 @@ -157,6 +157,7 @@ typedef struct {
129 int num_permitted_opens;
132 char *chroot_directory;
133 char *revoked_keys_file;
134 char *trusted_user_ca_keys;
135 diff -up openssh-5.8p1/sshd_config.5.kuserok openssh-5.8p1/sshd_config.5
136 --- openssh-5.8p1/sshd_config.5.kuserok 2011-02-14 09:15:12.000000000 +0100
137 +++ openssh-5.8p1/sshd_config.5 2011-02-14 09:17:11.000000000 +0100
138 @@ -574,6 +574,10 @@ Specifies whether to automatically destr
142 +.It Cm KerberosUseKuserok
143 +Specifies whether to look at .k5login file for user's aliases.
147 Specifies the available KEX (Key Exchange) algorithms.
148 Multiple algorithms must be comma-separated.
149 @@ -715,6 +719,7 @@ Available keywords are
150 .Cm HostbasedUsesNameFromPacketOnly ,
151 .Cm KbdInteractiveAuthentication ,
152 .Cm KerberosAuthentication ,
153 +.Cm KerberosUseKuserok ,
156 .Cm PubkeyAuthentication ,
157 diff -up openssh-5.8p1/sshd_config.kuserok openssh-5.8p1/sshd_config
158 --- openssh-5.8p1/sshd_config.kuserok 2011-02-14 09:15:12.000000000 +0100
159 +++ openssh-5.8p1/sshd_config 2011-02-14 09:15:12.000000000 +0100
160 @@ -73,6 +73,7 @@ ChallengeResponseAuthentication no
161 #KerberosOrLocalPasswd yes
162 #KerberosTicketCleanup yes
163 #KerberosGetAFSToken no
164 +#KerberosUseKuserok yes
167 #GSSAPIAuthentication no