Changeset - f46ff0f1ba9f
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-08-01 13:57:48

Made the userhost concatenator do something
1 file changed with 8 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -174,18 +174,24 @@ int register_user(char *username, char *
 
/** Logs the user into the server with a nice ssh session */
 
int login_user(char *username)
 
{
 

	
 
  char *userhost;
 
  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
 

	
 
  char buf[10];
 
  struct execio *testrem;
 
  char *execargv[] =
 
    {
 
      "ssh",
 

	
 
      userhost,// username and hostname
 
      "-i",
 
      SYSCONFDIR "/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,
 

	
 
@@ -193,15 +199,6 @@ int login_user(char *username)
 
    };
 
  size_t readlen;
 

	
 
  /*< @TODO remove being tied to protofusion.org for no reason  */
 
  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
 

	
 

	
 
  fprintf(stderr, "Logging you in to %s\n", userhost);
 

	
 
  int status;
0 comments (0 inline, 0 general)