Changeset - 4e24c5b3210e
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-28 00:50:20

Loginuser issues... meh
1 file changed with 12 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -79,8 +79,17 @@ void register_user(char *username, char 
 

	
 

	
 
void loginuser(char *username){
 
  // Logs into sandboxed user on zserver2 as a client, currently does nothing
 
  char *userhost = strcat(username, "@protofusion.org"); // Throws @protofusion.org after the username
 
	// TODO: Why does this segfault???
 
  fprintf(stderr, "Logging you in...");
 
  char *userhost = strcpy(userhost, username);
 
  char *userkey = strcpy(userkey, username);
 
  strcat(userhost, "@protofusion.org"); // Throws @protofusion.org after the username
 
  strcat(userkey,".rsa");
 
  fprintf(stderr, "i'm here");
 
  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);
 
	  return; // Maybe return something?
 
  }
 
  char buf[10];
 
  struct execio *testrem;
 
  char *execargv[] =
 
@@ -88,7 +97,7 @@ void loginuser(char *username){
 
  "ssh",
 
  userhost, // username and hostname
 
  "-i",
 
  "username.rsa", // Key created from registeruser()
 
  userkey, // Key created from registeruser()
 
  "-p",
 
  "23",
 
  "echo",
0 comments (0 inline, 0 general)