]> andersk Git - gssapi-openssh.git/blobdiff - openssh/gss-serv-gsi.c
add GssapiCredentialsPath option for sshd_config as requested in
[gssapi-openssh.git] / openssh / gss-serv-gsi.c
index 9fdd9254df10cb21cd08599a146ce0803ef03cfa..7eec0548548760c727a97736f49f878ef63a32f6 100644 (file)
@@ -199,17 +199,25 @@ ssh_gssapi_gsi_storecreds(ssh_gssapi_client *client)
        } else {
            client->store.envvar = strdup((char *)export_cred.value);
        }
+       if (access(p, R_OK) == 0) {
+        if (client->store.filename) {
+            if (rename(p, client->store.filename) < 0) {
+                logit("Failed to rename %s to %s: %s", p,
+                      client->store.filename, strerror(errno));
+                xfree(client->store.filename);
+                client->store.filename = strdup(p);
+            } else {
+                p = client->store.filename;
+            }
+        } else {
+            client->store.filename = strdup(p);
+        }
+       }
        client->store.envval = strdup(p);
 #ifdef USE_PAM
        if (options.use_pam)
            do_pam_putenv(client->store.envvar, client->store.envval);
 #endif
-       if (strncmp(p, "FILE:", 5) == 0) {
-           p += 5;
-       }
-       if (access(p, R_OK) == 0) {
-           client->store.filename = strdup(p);
-       }
        gss_release_buffer(&minor_status, &export_cred);
 }
 
This page took 0.443148 seconds and 4 git commands to generate.