Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177549543
D59565.1794688736.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D59565.1794688736.diff
View Options
diff --git a/contrib/openbsm/bin/auditdistd/proto.c b/contrib/openbsm/bin/auditdistd/proto.c
--- a/contrib/openbsm/bin/auditdistd/proto.c
+++ b/contrib/openbsm/bin/auditdistd/proto.c
@@ -269,7 +269,6 @@
int
proto_connection_send(const struct proto_conn *conn, struct proto_conn *mconn)
{
- const char *protoname;
int error, fd;
PJDLOG_ASSERT(conn != NULL);
@@ -281,11 +280,9 @@
PJDLOG_ASSERT(mconn->pc_proto != NULL);
fd = proto_descriptor(mconn);
PJDLOG_ASSERT(fd >= 0);
- protoname = mconn->pc_proto->prt_name;
- PJDLOG_ASSERT(protoname != NULL);
error = conn->pc_proto->prt_send(conn->pc_ctx,
- (const unsigned char *)protoname, strlen(protoname) + 1, fd);
+ mconn->pc_proto->prt_name, sizeof(mconn->pc_proto->prt_name), fd);
proto_close(mconn);
if (error != 0) {
errno = error;
@@ -303,7 +300,7 @@
int error;
TAILQ_FOREACH(proto, &protos, prt_next) {
- if (strcmp(proto->prt_name, protoname) == 0)
+ if (memcmp(proto->prt_name, protoname, sizeof(proto->prt_name)) == 0)
break;
}
if (proto == NULL) {
@@ -332,7 +329,7 @@
proto_connection_recv(const struct proto_conn *conn, bool client,
struct proto_conn **newconnp)
{
- char protoname[128];
+ char protoname[sizeof(conn->pc_proto->prt_name)];
int error, fd;
PJDLOG_ASSERT(conn != NULL);
@@ -341,10 +338,8 @@
PJDLOG_ASSERT(conn->pc_proto->prt_recv != NULL);
PJDLOG_ASSERT(newconnp != NULL);
- bzero(protoname, sizeof(protoname));
-
error = conn->pc_proto->prt_recv(conn->pc_ctx,
- (unsigned char *)protoname, sizeof(protoname) - 1, &fd);
+ protoname, sizeof(protoname), &fd);
if (error != 0) {
errno = error;
return (-1);
diff --git a/contrib/openbsm/bin/auditdistd/proto_impl.h b/contrib/openbsm/bin/auditdistd/proto_impl.h
--- a/contrib/openbsm/bin/auditdistd/proto_impl.h
+++ b/contrib/openbsm/bin/auditdistd/proto_impl.h
@@ -54,7 +54,7 @@
typedef int prt_exec_t(int, char *[]);
struct proto {
- const char *prt_name;
+ char prt_name[4];
prt_connect_t *prt_connect;
prt_connect_wait_t *prt_connect_wait;
prt_server_t *prt_server;
diff --git a/contrib/openbsm/bin/auditdistd/proto_socketpair.c b/contrib/openbsm/bin/auditdistd/proto_socketpair.c
--- a/contrib/openbsm/bin/auditdistd/proto_socketpair.c
+++ b/contrib/openbsm/bin/auditdistd/proto_socketpair.c
@@ -247,7 +247,7 @@
}
static struct proto sp_proto = {
- .prt_name = "socketpair",
+ .prt_name = "skp",
.prt_connect = sp_connect,
.prt_wrap = sp_wrap,
.prt_send = sp_send,
diff --git a/contrib/openbsm/bin/auditdistd/proto_tls.c b/contrib/openbsm/bin/auditdistd/proto_tls.c
--- a/contrib/openbsm/bin/auditdistd/proto_tls.c
+++ b/contrib/openbsm/bin/auditdistd/proto_tls.c
@@ -854,7 +854,7 @@
if (tlsctx == NULL)
return (errno);
- if (proto_wrap("socketpair", client, fd, &sock) == -1) {
+ if (proto_wrap("skp", client, fd, &sock) == -1) {
error = errno;
free(tlsctx);
return (error);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 14, 8:38 PM (10 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41731919
Default Alt Text
D59565.1794688736.diff (2 KB)
Attached To
Mode
D59565: auditdistd: Use fixed-length protocol names
Attached
Detach File
Event Timeline