diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -29,7 +29,7 @@ void ssh_keygen(){ // Give me some args! } -void register_user(char *username, char *email) +int register_user(char *username, char *email) { /* * Logs into sandboxed user on zserver2 and registers a user. Should eventually generate a key on the server and return it to the user. @@ -74,11 +74,11 @@ void register_user(char *username, char 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" */ - + return 1; } -void login_user(char *username){ +int login_user(char *username){ // TODO: Why does this segfault??? fprintf(stderr, "Logging you in..."); char *userhost = strcpy(userhost, username); @@ -88,7 +88,7 @@ void login_user(char *username){ 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? + return 0; } char buf[10]; struct execio *testrem; @@ -116,6 +116,7 @@ void login_user(char *username){ fprintf(stderr, "read \"%s\"\n", buf); } execio_close(testrem); + return 1; // 1 can be like... error-free login... } /* Replaces username and key in the slave's conf file, currently pseudo */