# HG changeset patch # User ethanzonca # Date 2009-07-25 01:31:12 # Node ID e1fa88daaa575dc2e4a5a9d961cb3b7b4f4c80a3 # Parent 71b7b74b07a98153e5b6a6195b8c1d6e0f8b888f Added key-stuff to the register function, needs attention. diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -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" */ + }