Changeset - 11f92cc7df63
[Not reviewed]
default
0 2 0
ethanzonca - 16 years ago 2009-08-01 13:09:24

Fixes to remove key from slave
2 files changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -70,27 +70,26 @@ for(counter=0; counter<argc; counter++){
 
			fprintf(stderr, "I want to see an '@' in your email address!\n%s may be good enough for you, but I need more!\n", email);
 
			return 235;
 
		}
 
		if( register_user(username, email) == 1){
 
			// register_user generates a key, too */
 
			fprintf(stderr,"Registration successfull. You may now invoke distrenslave with no arguments.\n");
 
			return 0;
 
		}
 
		else{
 
			fprintf(stderr,"Please try again! :D\n");
 
			return 0;
 
		}
 
	}
 
/* End arg parser */
 

	
 

	
 

	
 
/* Option getter: Creates vars to grab stuff from conf, uses the options include to grab this data */
 
char *username;
 
char *key;
 
username = NULL;
 
key = NULL;
 
cfg_t * my_cfg;
 
cfg_opt_t myopts[] = {
 
		CFG_SIMPLE_STR("username", &username),
 
		CFG_END()
 
		};
 
struct options_common *commonopts;
 
@@ -100,13 +99,13 @@ options_init(argc,argv,&my_cfg, myopts, 
 

	
 
/* 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, and your key is %s.\n",username, key);
 
		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");
src/server/slavefuncs.c
Show inline comments
 
@@ -100,13 +100,13 @@ int ssh_keygen(){
 
	// Supposedly execio returns 1 if it has bad args.
 
	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...
 
		return 0;
 
	}
 
	else{
 
		fprintf(stderr,"We successfully generated your key! Yay!");
 
		fprintf(stderr,"We successfully generated your key! Yay!\n");
 
		return 1;
 
	}
 
return 0;
 
}
 

	
 
/** Registers the user on the DistRen server */
0 comments (0 inline, 0 general)