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" */ + }