vm/file-editor: load session environment (#620)
Especially set DBUS socket to allow interprocess communication instead of spawning new instances or timeouts.
This commit is contained in:
		
							parent
							
								
									342a190302
								
							
						
					
					
						commit
						e81fb612ce
					
				| @ -58,6 +58,8 @@ main() | |||||||
| 	struct stat stat_pre, stat_post, session_stat; | 	struct stat stat_pre, stat_post, session_stat; | ||||||
| 	char *filename = get_filename(); | 	char *filename = get_filename(); | ||||||
| 	int child, status, log_fd; | 	int child, status, log_fd; | ||||||
|  | 	char var[1024], val[4096]; | ||||||
|  | 	FILE *env_file; | ||||||
| 	FILE *waiter_pidfile; | 	FILE *waiter_pidfile; | ||||||
| 
 | 
 | ||||||
| 	copy_file(filename); | 	copy_file(filename); | ||||||
| @ -99,6 +101,13 @@ main() | |||||||
| 			exit(1); | 			exit(1); | ||||||
| 		case 0: | 		case 0: | ||||||
| 			close(0); | 			close(0); | ||||||
|  | 
 | ||||||
|  | 			env_file = fopen("/tmp/qubes-session-env", "r"); | ||||||
|  | 			while(fscanf(env_file, "%1024[^=]=%4096[^\n]\n", var, val) == 2) { | ||||||
|  | 				setenv(var, val, 1); | ||||||
|  | 			} | ||||||
|  | 			fclose(env_file); | ||||||
|  | 
 | ||||||
| 			log_fd = open("/tmp/mimeopen.log", O_CREAT | O_APPEND, 0666); | 			log_fd = open("/tmp/mimeopen.log", O_CREAT | O_APPEND, 0666); | ||||||
| 			if (log_fd == -1) { | 			if (log_fd == -1) { | ||||||
| 				perror("open /tmp/mimeopen.log"); | 				perror("open /tmp/mimeopen.log"); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Marek Marczykowski
						Marek Marczykowski