# HG changeset patch # User ethanzonca # Date 2009-07-30 16:09:56 # Node ID 2c7d4da48d01fd456367ec352dd9def6f26ca536 # Parent 557353de66e57964464c2c0bbd574fba3beaacc1 Un-impaired ssh-keygen, added correct arguments. diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -30,10 +30,10 @@ int ssh_keygen(){ fprintf(stderr, "We're generating your SSH key. Please be patient.\n"); - char *command = "ssh-keygenn"; // append .exe if win32? - char *path_to_command = "/usr/bin/ssh-keygenn"; + char *command = "ssh-keygen"; // append .exe if win32? + char *path_to_command = "/usr/bin/ssh-keygen"; int ret; - char *cmd[] = { command, "-b", "-o", (char *)0 }; // TODO: Give me the correct args! + char *cmd[] = { command, "-f", "username.rsa", "-N", "", (char *)0 }; // TODO: Give me the correct args! ret = execv(path_to_command, cmd); // This path will be absolute for testing, should be relative to install on production if(ret == -1){ fprintf(stderr, "Generating your key failed. Ensure that ssh-keygen is present!\n"); // Use different executor that searches the path? there is one... @@ -103,7 +103,7 @@ int login_user(char *username) char *execargv[] = { "ssh", - + "-i", (char *)NULL, // Key created from registeruser() "-p", @@ -111,7 +111,7 @@ int login_user(char *username) (char *)NULL,// username and hostname "echo", "hello", // This should eventually open a non-terminating connection to the server for communication, - + (char *)NULL }; size_t readlen; @@ -120,7 +120,7 @@ int login_user(char *username) userhost = malloc(strlen(username) + strlen("@protofusion.org") + 1); if(!userhost) return 43; - + strcpy(userhost, username); strcat(userhost, "@protofusion.org"); // Throws @protofusion.org after the username @@ -130,11 +130,11 @@ int login_user(char *username) free(userhost); return 44; } - + strcpy(userkey, username); strcat(userkey,".rsa"); - - + + fprintf(stderr, "Logging you in to %s using key %s\n", userhost, userkey); if(fopen(userkey, "r") == NULL){ fprintf(stderr,"Your key, %s, has not been found! Re-register or somehow regenerate your key! We need a way to regenerate keys coded in, but we don't have the facilities yet!",userkey);