Changeset - 17ef3ec18076
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-08-01 13:00:17

Removed old key stuff from login function
1 file changed with 3 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -172,21 +172,20 @@ int register_user(char *username, char *
 
}
 

	
 
/** Logs the user into the server with a nice ssh session */
 
int login_user(char *username)
 
{
 
  char *userhost;
 
  char *userkey;
 
  char buf[10];
 
  struct execio *testrem;
 
  char *execargv[] =
 
    {
 
      "ssh",
 

	
 
      "-i",
 
      (char *)NULL, // Key created from registeruser()
 
      SYSCONF "distren.id_rsa"
 
      "-p",
 
      "23",
 
      (char *)NULL,// username and hostname
 
      "echo",
 
      "hello", // This should eventually open a non-terminating connection to the server for communication,
 

	
 
@@ -199,25 +198,15 @@ int login_user(char *username)
 
  if(!userhost)
 
    return 43;
 

	
 
  strcpy(userhost, username);
 
  strcat(userhost, "@protofusion.org"); // Throws @protofusion.org after the username
 

	
 
  userkey = malloc(strlen(username) + strlen(".rsa") + 1);
 
  if(!userkey)
 
    {
 
      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, "Logging you in to %s", userhost);
 
  if(fopen(SYSCONF "distren.id_rsa", "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);
 
	  return 0;
 
  }
 
  execio_open(&testrem, "ssh", execargv); // TODO: Grab returns from this someday
 
  buf[9] = '\0'; // null-terminating the array...
 
  while(!execio_read(testrem, buf, 9, &readlen))
0 comments (0 inline, 0 general)