Changeset - 4c61e238ef92
[Not reviewed]
default
0 2 0
ethanzonca - 16 years ago 2009-08-01 13:15:31

Minor fixes
2 files changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -93,25 +93,24 @@ cfg_opt_t myopts[] = {
 
		CFG_END()
 
		};
 
struct options_common *commonopts;
 
options_init(argc,argv,&my_cfg, myopts, "slave", &commonopts);
 
/* End option getter */
 

	
 

	
 
/* If there's no key or username in the conf, or if they're at the default (!key/!username) let the user know! */
 
	if(username == NULL || strcmp(username, "!username") == 0 ){
 
	  fprintf(stderr, "\nYou didn't register!\nPlease register or edit your config. (see -h)\nIf this error persists, check distrenslave.conf to ensure all items are filled.\n");
 
	}
 
	else if( username != NULL || strcmp(username,"!username") != 0 ){
 
		fprintf(stderr, "Your username is %s\n",username);
 
		// Logs ya in:
 
		if(login_user(username) == 1){
 
			fprintf(stderr,"You should now be logged into distren.\n");
 
		}
 
		else{
 
			fprintf(stderr,"Login failed. I have no clue why. Goodbye.\n");
 
			return 0;
 
		}
 
	}
 
	else{
 
	  fprintf(stderr,"Something is terribly wrong!!!");
 
	}
src/server/slavefuncs.c
Show inline comments
 
@@ -193,27 +193,27 @@ 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", userhost);
 
  fprintf(stderr, "Logging you in to %s\n", userhost);
 
  if(fopen(SYSCONFDIR "distren.id_rsa", "r") == NULL){
 
	  fprintf(stderr,"Your key 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!");
 
	  fprintf(stderr,"Your key has not been found! Re-register or somehow regenerate your key!\nWe need a way to regenerate keys coded in, but we don't have the facilities yet!");
 
	  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))
 
    {
 
      if(readlen > 9) {
 
	fprintf(stderr, "!!!! Something is terribly wrong!\n");
 
      }
 
    buf[readlen] = '\0';
 
    fprintf(stderr, "read \"%s\"\n", buf);
 
    }
0 comments (0 inline, 0 general)