Changeset - e1fa88daaa57
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-25 01:31:12

Added key-stuff to the register function, needs attention.
1 file changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -19,8 +19,7 @@
 

	
 
 /*
 
  * Registration on server. Needs attention. Prevent account spamming.
 
  * TODO: MAKE THIS FUNCTION RETURN THE UNIQUE URL TO THE USER'S KEY!!!
 
  * Set up something like: distrend -c username email@example.com
 
  * distrenslave -c username email@example.com
 
 */
 
void registeruser(char *username, char *email){
 
  /*
 
@@ -28,6 +27,7 @@ void registeruser(char *username, char *
 
   * All created user accounts should be sandboxed accordingly, requiring a different skel, and the default shell to be rbash. Also,
 
   * a custom path defined in the .bash_profile of the skel is needed.
 
  */
 
  char *keyurl; // Url to the key
 
  char buf[10];
 
  struct execio *testrem;
 
  char *execargv[] =
 
@@ -45,7 +45,7 @@ void registeruser(char *username, char *
 
  "-d",
 
  "/home/distren",
 
  "--gid",
 
  "541", // Add in shellscript to generate ssh key and return it to the user somehow, probably post to http
 
  "541", // Add in shellscript to generate ssh key and set keyname
 
  username,
 
  (char *)NULL
 
  };
 
@@ -61,6 +61,10 @@ void registeruser(char *username, char *
 
    fprintf(stderr, "read \"%s\"\n", buf);
 
    }
 
  execio_close(testrem);
 

	
 
 exec('exec wget http://protofusion.org/distren/keys/%s',keyname); // Download the key
 
 /* Scan distrenslave.conf for !username and !key and replace them with "keyname" and the "username" */
 

	
 
}
 

	
 

	
0 comments (0 inline, 0 general)