Changeset - 73902eddcef8
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-06 17:27:04

Commenting, minor framework changes.
1 file changed with 17 insertions and 26 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -51,7 +51,6 @@ struct {
 
  char *submitter;
 
  char *email;
 
  int priority;  // 1 is lowest, 10 is highest, 0 is done
 

	
 
  int percent_done;
 
  int completed_frames; // number of completed frames
 
  int assigned_frames; // number of assigned frames (that are not yet completed)
 
@@ -62,8 +61,6 @@ struct {
 
  int frame_num[];
 
  char slave_name[][];
 
  short int frame_status[];
 

	
 

	
 
  // For secondary upload location...
 
  char url;
 
  char login_name;
 
@@ -72,7 +69,7 @@ struct {
 

	
 
/*
 
// -- Matthew's handywork --
 
// struct for storing informaiton on each frame for a particular blender job
 
// struct for storing information on each frame for a particular blender job
 
struct {
 
	int frame_num; // frame number to render
 
	char slave_name; // user that frame is assigned to
 
@@ -93,8 +90,6 @@ struct {
 
} luxjob[max];
 

	
 

	
 

	
 

	
 
int main(int argc, char *argv[])
 
{
 

	
 
@@ -127,13 +122,7 @@ int main(int argc, char *argv[])
 
	}
 

	
 

	
 
/* !!!!!!! 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.
 
If we use a common key, then we'll need different passphrases for each user, which would be kinda crazy. How can
 
we get a key generated on the server, and transferred to the client's distrend?
 

	
 
*/
 

	
 
  int cont = 1;
 
  struct distrend_listenset *listenset;
 
@@ -167,15 +156,17 @@ struct distrend_config
 
}
 

	
 

	
 
/* Notes on Registration:
 
We need to generate a key in registeruser() that is returned to the client.
 
How will we transfer the key?
 
*/
 

	
 
// 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
 
// We must prevent multi-user-creation abuse, too.
 
// Registration on server. Needs attention. Prevent account spamming.
 
// Set up something like: distrend -c username email@example.com
 
void registeruser(char *username, char *email){
 
  // Logs into sandboxed user on zserver2 and registers a user. Should eventually generate a key on the server and return it to the user.
 
  // All created user accounts should be sandboxed accordingly, requiring a different skel, and the default shell to be rbash. They also
 
  // need a custom path, which can be defined in the .bash_profile of the skel. All activity of server-side configuration should be documented
 
  // to ease the creation of new distren servers, or it should be automated and made much more all-inclusive, not requiring much config.
 
  // 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 buf[10];
 
  struct execio *testrem;
 
  char *execargv[] =
 
@@ -183,7 +174,7 @@ void registeruser(char *username, char *
 
  "ssh",
 
  "distren_setup@protofusion.org",
 
  "-i",
 
  "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?
 
  "setup.rsa", // default distributed key, account can only create users.
 
  "-p",
 
  "23",
 
  "sudo /usr/sbin/useradd",
 
@@ -193,7 +184,7 @@ void registeruser(char *username, char *
 
  "-d",
 
  "/home/distren",
 
  "--gid",
 
  "541",
 
  "541", // Add in shellscript to generate ssh key and return it to the user somehow
 
  username,
 
  (char *)NULL
 
  };
 
@@ -206,7 +197,7 @@ void registeruser(char *username, char *
 
	fprintf(stderr, "!!!! Something is terribly wrong!\n");
 
      }
 
      if(buf == 0) {
 
	fprintf(stderr, "**** Operation successful, or so we hope. We got no output. Just kidding. You will never see this. Something else should catch this though! And registration should really have some sort of password.");
 
	fprintf(stderr, "Make this throw a successfull message if no output is returned... maybe");
 
      }
 
    buf[readlen] = '\0'; // Null-terminating the end of it again based on how large the data is?
 
    fprintf(stderr, "read \"%s\"\n", buf);
 
@@ -219,19 +210,19 @@ void registeruser(char *username, char *
 

	
 

	
 
void loginuser(char *username, int secret){
 
  // Logs into sandboxed user on zserver2 as a client, but really does nothing now.
 
  // Logs into sandboxed user on zserver2 as a client, currently does nothing
 
  char buf[10];
 
  struct execio *testrem;
 
  char *execargv[] =
 
    {
 
  "ssh",
 
  "distren_setup@protofusion.org",
 
  "username@protofusion.org", // username must be read from the conf
 
  "-i",
 
  "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?
 
  "username.rsa", // Key created from registeruser()
 
  "-p",
 
  "23",
 
  "echo",
 
  "hello",
 
  "hello", // This should eventually open a non-terminating connection to the server for communication
 
  (char *)NULL
 
  };
 
  size_t readlen;
 
@@ -243,7 +234,7 @@ void loginuser(char *username, int secre
 
	fprintf(stderr, "!!!! Something is terribly wrong!\n");
 
      }
 
      if(buf == 0) {
 
	fprintf(stderr, "**** Operation successful, or so we hope. We got no output. Just kidding. You will never see this. Something else should catch this though!");
 
	fprintf(stderr, "Put stuff here-ish to check whether the operation(s) were successful.");
 
      }
 
    buf[readlen] = '\0'; // Null-terminating the end of it again based on how large the data is?
 
    fprintf(stderr, "read \"%s\"\n", buf);
0 comments (0 inline, 0 general)