PERFORCE change 166610 for review

Jonathan Anderson jona at FreeBSD.org
Mon Jul 27 11:31:15 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166610

Change 166610 by jona at jona-trustedbsd-belle-vmware on 2009/07/27 11:30:52

	Removed some commented-out lines, changed some printf()s

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/tools/cap/user_angel/server.c#17 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/src/tools/cap/user_angel/server.c#17 (text+ko) ====

@@ -401,7 +401,7 @@
 	int sock = client->socket;
 
 	if(ua_unmarshall_string(d, path, &pathlen) < 0) return -1;
-	printf(": %s\n", path);
+	printf(": '%s'\n", path);
 
 	struct stat s;
 	if(stat(path, &s)) return 1;
@@ -421,18 +421,14 @@
 
 int handle_path_request(struct client *client, struct ua_datum *d)
 {
-//	unsigned int fdlen = 0;
 	char path[256] = "";
 	unsigned int pathlen = 256;
 
 	int sock = client->socket;
 
-//	struct ua_datum *d = ua_recv(sock, NULL, &fdlen);
 	if(ua_unmarshall_string(d, path, &pathlen) < 0) return -1;
-//	free(d);
+	printf(": '%s'\n", path);
 
-	printf(": %s\n", path);
-
 	int32_t flags, rights;
 	if(ua_unmarshall_int(ua_recv(sock, NULL, NULL), &flags) < 0) return -1;
 	if(ua_unmarshall_int(ua_recv(sock, NULL, NULL), &rights) < 0) return -1;
@@ -485,18 +481,21 @@
 		return -1;
 	}
 
+	printf(": ");
 	for(int i = 0; i < len; i++)
 	{
 		const char *name = names[i];
 		struct ua_datum *d
 			= ua_marshall_string(name, strlen(name));
 
+		printf("'%s' ", name);
 		if(ua_send(client->socket, d, fds + i, 1) < 0)
 		{
 			printf("Error sending file descriptor");
 			return -1;
 		}
 	}
+	printf("\n");
 
 	return 0;
 }


More information about the p4-projects mailing list