Changeset - 178f8413971b
[Not reviewed]
default
0 3 0
ethanzonca - 16 years ago 2009-07-28 00:51:10

Changed loginuser() to login_user() to mimic register_user()'s format.
3 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/slave.c
Show inline comments
 
@@ -91,25 +91,25 @@ cfg_opt_t myopts[] = {
 
		};
 
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(key == NULL || username == NULL || strcmp(key, "!key") == 0 || 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", argv[0]);
 
	}
 
	else if(key != NULL && username != NULL || key != "!key" && username != "username" ){
 
		fprintf(stderr, "Your username is %s, and your key is %s.\n",username, key);
 
		loginuser(username); // Logs in user to the server
 
		login_user(username); // Logs in user to the server
 
	}
 
	else{
 
	  fprintf(stderr,"Something is terribly wrong!!!");
 
	}
 

	
 

	
 

	
 
/* Somewhat pseudo Rendering code */
 
/*
 
	if('slave recieves "start frame#, job#"'){
 
		fprintf(stderr, "Got frame %d in job %d, preparing to render...",framenum,jobnum);
 
		get('http://distren.protofusion.org/srv/job%d.tgz', jobnum); // use curl
src/server/slavefuncs.c
Show inline comments
 
@@ -69,25 +69,25 @@ void register_user(char *username, char 
 
      buf[readlen] = '\0'; // Null-terminating the end of it again based on how large the data is?
 
      fprintf(stderr, "read \"%s\"\n", buf);
 
    }
 
  execio_close(testrem);
 

	
 
  ssh_keygen(); // Should return relative path to keyfile, or jus the keyname
 

	
 
  /* TODO: Scan distrenslave.conf for !username and !key and replace them with "keyname" and the "username" */
 

	
 
}
 

	
 

	
 
void loginuser(char *username){
 
void login_user(char *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];
src/server/slavefuncs.h
Show inline comments
 
@@ -14,18 +14,18 @@
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
#ifndef _DISTREN_SLAVEFUNCS_H
 
#define _DISTREN_SLAVEFUNCS_H
 
#include "blendjob.h"
 

	
 
void ssh_keygen();
 
void register_user(char *username, char *email);
 
void loginuser(char *username);
 
void login_user(char *username);
 
void conf_replace(char *username, char *key);
 
void exec_blender(struct blendjob* blendjob, char *input, char *output, int frame);
 

	
 

	
 
#endif
0 comments (0 inline, 0 general)