]> andersk Git - gssapi-openssh.git/commitdiff
auth2.c sshconnec2.c ssh.c readconf.h are modified
authorbhe <bhe>
Sun, 21 Apr 2002 20:56:56 +0000 (20:56 +0000)
committerbhe <bhe>
Sun, 21 Apr 2002 20:56:56 +0000 (20:56 +0000)
openssh/auth2.c
openssh/readconf.h
openssh/ssh.c
openssh/sshconnect2.c

index 890c6d0c591026f4a61aa8661d511f5b6de419f1..81005f94fd66a3695840ffce64ca0add9de2eb17 100644 (file)
@@ -193,6 +193,28 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt)
        user = packet_get_string(NULL);
        service = packet_get_string(NULL);
        method = packet_get_string(NULL);
+
+        if(strcmp(method,"external-keyx") == 0 && strcmp(user,"") == 0) {
+                char *gridmapped_name = NULL;
+                struct passwd *pw = NULL;
+
+                gssapi_setup_env();
+                if(globus_gss_assist_gridmap(gssapi_client_name.value,
+                                     &gridmapped_name) == 0) {
+                        user = gridmapped_name;
+                        debug("I gridmapped and got %s", user);
+                        pw = getpwnam(user);
+                        if (pw && allowed_user(pw)) {
+                                authctxt->user = user;
+                                authctxt->pw = pwcopy(pw);
+                                authctxt->valid = 1;
+                        }
+                } else {
+                debug("I gridmapped and got null, reverting to %s", authctxt->user);
+                user = authctxt->user;
+                }
+        }
+
        debug("userauth-request for user %s service %s method %s", user, service, method);
        debug("attempt %d failures %d", authctxt->attempt, authctxt->failures);
 
index 78eb92a0fde983b45422c43b69deed12aa85b5f6..a26e20ae520ccd9cffaddba1b136d5133cd55cb1 100644 (file)
@@ -88,6 +88,7 @@ typedef struct {
        char   *host_key_alias; /* hostname alias for .ssh/known_hosts */
        char   *proxy_command;  /* Proxy command for connecting the host. */
        char   *user;           /* User to log in as. */
+        int    implicit;
        int     escape_char;    /* Escape character; -2 = none */
 
        char   *system_hostfile;/* Path for /etc/ssh/ssh_known_hosts. */
index 117a0930b0b4ef4529cd9e24e87e1340f24fb8de..d288d788885a46fb7a25d6cc5a0bf1ed1d9c542a 100644 (file)
@@ -633,8 +633,11 @@ again:
 
        seed_rng();
 
-       if (options.user == NULL)
-               options.user = xstrdup(pw->pw_name);
+        if (options.user == NULL) {
+                options.user = xstrdup(pw->pw_name);
+                options.implicit = 1;
+        }
+        else options.implicit = 0;
 
        if (options.hostname != NULL)
                host = options.hostname;
index d98ec2e00e57ba79c9ebb2919ee957ef9ca1ac75..e5b6fda994e739c10cfa2ea26f54d96f4785c82a 100644 (file)
@@ -514,7 +514,8 @@ userauth_gssapi(Authctxt *authctxt)
        authctxt->methoddata=(void *)gssctxt;
                
        packet_start(SSH2_MSG_USERAUTH_REQUEST);
-       packet_put_cstring(authctxt->server_user);
+        if(options.implicit) packet_put_cstring("");
+        else packet_put_cstring(authctxt->server_user);
        packet_put_cstring(authctxt->service);
         packet_put_cstring(authctxt->method->name);
 
This page took 0.04127 seconds and 5 git commands to generate.