void test_bind(const char *path)
{
	int sfd;
	struct sockaddr_un my_addr, peer_addr;

	sfd = socket(AF_UNIX, SOCK_STREAM, 0);

	if (sfd < 0) {
		fprintf(stderr, "Failed to open a socket for bind test\n");
		exit(1);
	}
	memset(&my_addr, 0, sizeof(struct sockaddr_un));
	my_addr.sun_family = AF_UNIX;
	strncpy(my_addr.sun_path, path,
			sizeof(my_addr.sun_path) - 1);
	if (bind(sfd, (struct sockaddr *) &my_addr,
				sizeof(struct sockaddr_un)) != -1) {
		fprintf(stderr, "leak at bind of %s\n", path);
		exit(1);
	}
	if (errno != ENOENT && errno != ENOSYS) {
		fprintf(stderr, "leak at bind of %s: errno was %s\n", path, strerror(errno));
		exit(1);
	}
	close(sfd);
}
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.