Changeset - 9b1f363559ec
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-07-26 18:14:24

Added pseudo-replacing code
1 file changed with 11 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -97,12 +97,23 @@ void loginuser(char *username){
 
    buf[readlen] = '\0'; // Null-terminating the end of it again based on how large the data is?
 
    fprintf(stderr, "read \"%s\"\n", buf);
 
    }
 
  execio_close(testrem);
 
}
 

	
 
/* Replaces username and key in the slave's conf file, currently pseudo */
 
void conf_replace(char *username, char *key){
 
	// Doesn't delete anything! :D
 
	mktemp(); // Gets a new file to put data into
 
	fopen('w'); // Open the file we created in write mode
 
	fopen('r'); // Open the conf file in read-only mode
 
	read(); // Read the created file, scanning for and replacing strings, whie
 
	writ(); // writing out to the newly created file
 
	fsync(); // fsync the file we wrote data to
 
	rename(); // rename the old file to the new file
 
}
 

	
 
/* Executors */
 

	
 
/*
 
  It seems that the client will need to know the job number. Is finish_frame going to be on the client or the server? we gotta figure that out!
 
*/
0 comments (0 inline, 0 general)