diff --git a/src/client/distren.c b/src/client/distren.c --- a/src/client/distren.c +++ b/src/client/distren.c @@ -30,56 +30,37 @@ int main(int argc, char *argv[]) { +/* Mneh variable goodness */ +int isusername; +char *host = "protofusion.org"; +char *username = "guest"; +char *nameemail; +/* */ - /* XML Testing, segfaults, so reverted to default. */ - /* - xmlDocPtr doc; - xmlNodePtr cur; - - doc = xmlParseFile(docname); - - if (doc == NULL ) { - fprintf(stderr,"The document was not parsed correctly \n"); - return; - } - - cur = xmlDocGetRootElement(doc); +/* put some code here to parse for a username, set username=0 if no username in the xml file or if no xml file exists. if no file, drop a warning */ - if (cur == NULL) { - fprintf(stderr,"I cannot parse an empty document \n"); - xmlFreeDoc(doc); - return; - } +if(isusername = 0){ - if (xmlStrcmp(cur->name, (const xmlChar *) "story")) { - fprintf(stderr,"The document you want me to parse is of the wrong type"); - xmlFreeDoc(doc); - return; - } - - */ - - - - char buf[10]; +char buf[10]; struct execio *testrem; char *execargv[] = { "ssh", - "protofusion.org", + host, "sh", "-c", - "\"echo hello from ${HOSTNAME}\"", + "\"useradd -M -c", + nameemail, + "-d /home/distren --gid 537", + username, + "\"", (char *)NULL }; size_t readlen; - - - fprintf(stderr, "testing execio (It shouldn't work) :-)\n"); + fprintf(stderr, "execio madness is occuring!"); fprintf(stderr, "execio_open returns %d\n", execio_open(&testrem, "ssh", execargv)); - buf[9] = '\0'; while(!execio_read(testrem, buf, 9, &readlen)) { @@ -91,23 +72,18 @@ int main(int argc, char *argv[]) buf[readlen] = '\0'; fprintf(stderr, "read \"%s\"\n", buf); } - + return 0; +} - return 0; -}; - -/* this function should probably not exist. asprintf should be used instead of sprintf */ -size_t intstrlen(size_t theint) +else { - size_t len = 0; /* if the number is single digit, this will be incremented */ - do - { - theint /= 10; - len ++; - } - while(theint > 0); - - return len; +/* put code here to ssh to zserver2 w/ execio as the user from the xml file */ } +}; + + + + +