diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -91,6 +91,35 @@ struct { int main(int argc, char *argv[]) { +// I'm assuming this is a non-working framework :) + int distrend_do_config(int argc, char *argv[], struct distrend_config *config) + { + cfg_opt_t myopts = + { + CFG_SEC("listen", /* this must be imported into struct listens (which must still be declared) */ + { + CFG_SIMPLE_STR("type", NULL), + CFG_SIMPLE_STR("path", NULL), + CFG_SIMPLE_INT("port", NULL) + }, + CFGF_MULTI), + CFG_END + }; + + config = malloc(sizeof(struct distrend_config)); + options_init(argc, argv, &config->mycfg, &myopts, "server", &config->options); + + return 0; + } + int distrend_config_free(struct distrend_config *config) + { + options_free(config->options); + free(config); + + return 0; + } + + /* !!!!!!! Important notes !!!!!!!!!!!! So, we need a common key. Maybe. Or we need to generate a key in registeruser() and get it to the client somehow. @@ -131,33 +160,6 @@ struct distrend_config } -int distrend_do_config(int argc, char *argv[], struct distrend_config *config) -{ - cfg_opt_t myopts = - { - CFG_SEC("listen", /* this must be imported into struct listens (which must still be declared) */ - { - CFG_SIMPLE_STR("type", NULL), - CFG_SIMPLE_STR("path", NULL), - CFG_SIMPLE_INT("port", NULL) - }, - CFGF_MULTI), - CFG_END - }; - - config = malloc(sizeof(struct distrend_config)); - options_init(argc, argv, &config->mycfg, &myopts, "server", &config->options); - - return 0; -} -int distrend_config_free(struct distrend_config *config) -{ - options_free(config->options); - free(config); - - return 0; -} - // Registration on server. Needs attention. (e.g., people could make tons of accounts with the key we give them... // Set up distrend -c username email@example.com @@ -210,7 +212,7 @@ void registeruser(char *username, char * void loginuser(char *username, int secret){ - // Logs into sandboxed user on zserver2 and registers a user + // Logs into sandboxed user on zserver2 as a client, but really does nothing now. char buf[10]; struct execio *testrem; char *execargv[] = @@ -221,15 +223,8 @@ void loginuser(char *username, int secre "setup.rsa", // We gotta figure out how we're going to do the whole keys thing... maybe grab this key via http? But have a secret password compiled in distren to prevent fraud? "-p", "23", - "sudo /usr/sbin/useradd", - "-M", - "-c", - email, - "-d", - "/home/distren", - "--gid", - "541", - username, + "echo", + "hello", (char *)NULL }; size_t readlen; @@ -288,7 +283,7 @@ void frame_num_struct_builder(int sframe // matches your computer up with a lovely frame to render int frame_finder(){ - int your_frame = null; // your_frame is an interger value that will be given to the client as the frame number to render + int your_frame = NULL; // your_frame is an interger value that will be given to the client as the frame number to render int finder_jobnum = 0; int frameset_count = 0; // the frameset number, because frames in an animation don't start at zero short int done = 0;