Browse code

core: set the global sock_uid/gid based on the user/group values

- they were left with initial value, more or less being unused

Daniel-Constantin Mierla authored on 11/03/2015 08:40:52
Showing 1 changed files
... ...
@@ -2301,12 +2301,15 @@ try_again:
2301 2301
 			fprintf(stderr, "bad user name/uid number: -u %s\n", user);
2302 2302
 			goto error;
2303 2303
 		}
2304
+		sock_uid = uid;
2305
+		sock_gid = gid;
2304 2306
 	}
2305 2307
 	if (group){
2306 2308
 		if (group2gid(&gid, group)<0){
2307 2309
 				fprintf(stderr, "bad group name/gid number: -u %s\n", group);
2308 2310
 			goto error;
2309 2311
 		}
2312
+		sock_gid = gid;
2310 2313
 	}
2311 2314
 	if (fix_all_socket_lists()!=0){
2312 2315
 		fprintf(stderr,  "failed to initialize list addresses\n");