Files
@ 9a5d54f30d40
Branch filter:
Location: DistRen/src/client/distren.c - annotation
9a5d54f30d40
2.0 KiB
text/plain
Added system log
7f09dcee58f4 7fcbed937039 7f09dcee58f4 aaedffb71a83 aaedffb71a83 aaedffb71a83 7f09dcee58f4 7f09dcee58f4 7f09dcee58f4 aaedffb71a83 aaedffb71a83 7f09dcee58f4 7f09dcee58f4 7f09dcee58f4 aaedffb71a83 7f09dcee58f4 aaedffb71a83 7f09dcee58f4 7f09dcee58f4 d643c8d1d8a8 d643c8d1d8a8 627c64f1fd14 510b082d50ae 32011f71cbbb 32011f71cbbb 32011f71cbbb 32011f71cbbb 627c64f1fd14 627c64f1fd14 627c64f1fd14 32011f71cbbb 32011f71cbbb 94aafba083ee 94aafba083ee 94aafba083ee 94aafba083ee 94aafba083ee 94aafba083ee 32011f71cbbb 32011f71cbbb 55ea8f754512 32011f71cbbb 94aafba083ee 32011f71cbbb 94aafba083ee 943db19cf524 49749aac184e 943db19cf524 943db19cf524 94aafba083ee 510b082d50ae 510b082d50ae 94aafba083ee 94aafba083ee 94aafba083ee 94aafba083ee 94aafba083ee 510b082d50ae 943db19cf524 32011f71cbbb 49749aac184e 94aafba083ee 49749aac184e 49749aac184e 49749aac184e 49749aac184e 49749aac184e 49749aac184e 49749aac184e 49749aac184e 49749aac184e 49749aac184e 49749aac184e 49749aac184e 94aafba083ee 94aafba083ee 627c64f1fd14 94aafba083ee d643c8d1d8a8 94aafba083ee d643c8d1d8a8 d643c8d1d8a8 7df3f36d8160 94aafba083ee 94aafba083ee 94aafba083ee 94aafba083ee 94aafba083ee 94aafba083ee | /*
Copyright 2008 Nathan Phillip Brink, Ethan Zonca, Matt Orlando
This file is a part of DistRen.
DistRen is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DistRen is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with DistRen. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h> /* sprintf, printf */
#include <stdlib.h> /* malloc, free */
#include "options.h"
#include "execio.h"
#include <libxml/tree.h> /* Happy fun XML time */
#include <libxml/xmlwriter.h>
int main(int argc, char *argv[])
{
/* Mneh variable goodness */
int isusername;
char *host = "protofusion.org";
char *username = "guest";
char *nameemail;
/* */
/* put some code here to parse for a username, set isusername=0 if no username in the xml file or if no xml file exists. if no file, drop a warning */
if(isusername = 0){
char buf[10];
struct execio *testrem;
char *execargv[] =
{
"ssh",
host,
"sh",
"-c",
"\"useradd -M -c",
nameemail,
"-d /home/distren --gid 537",
username,
"\"",
(char *)NULL
};
size_t readlen;
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))
{
if(readlen > 9)
{
fprintf(stderr, "execio_read doesn't set readlen correctly or read() is messed up\n");
return 1;
}
buf[readlen] = '\0';
fprintf(stderr, "read \"%s\"\n", buf);
}
return 0;
}
else
{
/* put code here to ssh to zserver2 w/ execio as the user from the xml file */
}
};
|