2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 09:57:41 +00:00

Update to protobuf-c 1.5.2

This commit is contained in:
Todd C. Miller 2025-08-14 14:08:53 -06:00
parent aa2498e46f
commit 839be2a417
9 changed files with 28 additions and 53 deletions

View File

@ -323,7 +323,7 @@ The embedded copy of zlib bears the following license:
The embedded copy of protobuf-c bears the following license: The embedded copy of protobuf-c bears the following license:
Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors. Copyright (c) 2008-2025, Dave Benson and the protobuf-c authors.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors. * Copyright (c) 2008-2025, Dave Benson and the protobuf-c authors.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -34,16 +34,17 @@
* *
* This file defines the public API for the `libprotobuf-c` support library. * This file defines the public API for the `libprotobuf-c` support library.
* This API includes interfaces that can be used directly by client code as well * This API includes interfaces that can be used directly by client code as well
* as the interfaces used by the code generated by the `protoc-c` compiler. * as the interfaces used by the code generated by the `protoc-gen-c` compiler
* plugin.
* *
* The `libprotobuf-c` support library performs the actual serialization and * The `libprotobuf-c` support library performs the actual serialization and
* deserialization of Protocol Buffers messages. It interacts with structures, * deserialization of Protocol Buffers messages. It interacts with structures,
* definitions, and metadata generated by the `protoc-c` compiler from .proto * definitions, and metadata generated by the `protoc-gen-c` compiler plugin
* files. * from .proto files.
* *
* \authors Dave Benson and the `protobuf-c` authors. * \authors Dave Benson and the `protobuf-c` authors.
* *
* \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license. * \copyright 2008-2025. Licensed under the terms of the [BSD-2-Clause] license.
* *
* [protobuf-c]: https://github.com/protobuf-c/protobuf-c * [protobuf-c]: https://github.com/protobuf-c/protobuf-c
* [Protocol Buffers]: https://developers.google.com/protocol-buffers/ * [Protocol Buffers]: https://developers.google.com/protocol-buffers/
@ -74,7 +75,7 @@
* *
* - Identifiers for functions and globals are all lowercase, with camel case * - Identifiers for functions and globals are all lowercase, with camel case
* words separated by single underscores. For example, one of the function * words separated by single underscores. For example, one of the function
* prototypes generated by `protoc-c` for the above example: * prototypes generated by `protoc-gen-c` for the above example:
* *
~~~{.c} ~~~{.c}
Foo__Bar__BazBah * Foo__Bar__BazBah *
@ -794,16 +795,16 @@ protobuf_c_version_number(void);
* The version of the protobuf-c headers, represented as a string using the same * The version of the protobuf-c headers, represented as a string using the same
* format as protobuf_c_version(). * format as protobuf_c_version().
*/ */
#define PROTOBUF_C_VERSION "1.4.1" #define PROTOBUF_C_VERSION "1.5.2"
/** /**
* The version of the protobuf-c headers, represented as an integer using the * The version of the protobuf-c headers, represented as an integer using the
* same format as protobuf_c_version_number(). * same format as protobuf_c_version_number().
*/ */
#define PROTOBUF_C_VERSION_NUMBER 1004001 #define PROTOBUF_C_VERSION_NUMBER 1005002
/** /**
* The minimum protoc-c version which works with the current version of the * The minimum protoc-gen-c version which works with the current version of the
* protobuf-c headers. * protobuf-c headers.
*/ */
#define PROTOBUF_C_MIN_COMPILER_VERSION 1000000 #define PROTOBUF_C_MIN_COMPILER_VERSION 1000000

View File

@ -108,7 +108,7 @@ Makefile: $(srcdir)/Makefile.in
$(devdir)/log_server.pb-c.c: $(srcdir)/log_server.proto $(devdir)/log_server.pb-c.c: $(srcdir)/log_server.proto
@if [ -n "$(DEVEL)" ]; then \ @if [ -n "$(DEVEL)" ]; then \
cmd='protoc-c --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/log_server.proto'; \ cmd='protoc --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/log_server.proto'; \
echo "$$cmd"; eval $$cmd; \ echo "$$cmd"; eval $$cmd; \
cmd='$(scriptdir)/unanon $(devdir)/log_server.pb-c.h $(devdir)/log_server.pb-c.c'; \ cmd='$(scriptdir)/unanon $(devdir)/log_server.pb-c.h $(devdir)/log_server.pb-c.c'; \
echo "$$cmd"; eval $$cmd; \ echo "$$cmd"; eval $$cmd; \

View File

@ -101,20 +101,6 @@ Makefile: $(srcdir)/Makefile.in
.i.plog: .i.plog:
ifile=$<; rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $${ifile%i}c --i-file $< --output-file $@ ifile=$<; rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $${ifile%i}c --i-file $< --output-file $@
$(devdir)/log_server.pb-c.c: $(srcdir)/log_server.proto
@if [ -n "$(DEVEL)" ]; then \
cmd='protoc-c --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/log_server.proto'; \
echo "$$cmd"; eval $$cmd; \
cmd='$(scriptdir)/unanon $(devdir)/log_server.pb-c.h $(devdir)/log_server.pb-c.c'; \
echo "$$cmd"; eval $$cmd; \
if [ "$(devdir)" == "$(srcdir)" ]; then \
cmd='mv -f $(devdir)/log_server.pb-c.h $(incdir)/log_server.pb-c.h'; \
else \
cmd='mv -f $(devdir)/log_server.pb-c.h $(top_builddir)/log_server.pb-c.h'; \
fi; \
echo "$$cmd"; eval $$cmd; \
fi
libprotobuf-c.la: $(LIBPROTOBUF_C_OBJS) libprotobuf-c.la: $(LIBPROTOBUF_C_OBJS)
$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(LIBPROTOBUF_C_OBJS) $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(LIBPROTOBUF_C_OBJS)

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors. * Copyright (c) 2008-2025, Dave Benson and the protobuf-c authors.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -28,14 +28,14 @@
*/ */
/*! \file /*! \file
* Support library for `protoc-c` generated code. * Support library for `protoc-gen-c` generated code.
* *
* This file implements the public API used by the code generated * This file implements the public API used by the code generated
* by `protoc-c`. * by `protoc-gen-c`.
* *
* \authors Dave Benson and the protobuf-c authors * \authors Dave Benson and the protobuf-c authors
* *
* \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license. * \copyright 2008-2025. Licensed under the terms of the [BSD-2-Clause] license.
*/ */
/** /**
@ -1903,7 +1903,6 @@ pack_buffer_packed_payload(const ProtobufCFieldDescriptor *field,
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
unsigned len = boolean_pack(((protobuf_c_boolean *) array)[i], scratch); unsigned len = boolean_pack(((protobuf_c_boolean *) array)[i], scratch);
buffer->append(buffer, len, scratch); buffer->append(buffer, len, scratch);
rv += len;
} }
return count; return count;
default: default:
@ -1938,6 +1937,7 @@ repeated_field_pack_to_buffer(const ProtobufCFieldDescriptor *field,
buffer->append(buffer, rv, scratch); buffer->append(buffer, rv, scratch);
tmp = pack_buffer_packed_payload(field, count, array, buffer); tmp = pack_buffer_packed_payload(field, count, array, buffer);
assert(tmp == payload_len); assert(tmp == payload_len);
(void)tmp;
return rv + payload_len; return rv + payload_len;
} else { } else {
size_t siz; size_t siz;
@ -2571,7 +2571,7 @@ parse_required_member(ScannedMember *scanned_member,
if (maybe_clear && *pstr != NULL) { if (maybe_clear && *pstr != NULL) {
const char *def = scanned_member->field->default_value; const char *def = scanned_member->field->default_value;
if (*pstr != NULL && *pstr != def) if (*pstr != def)
do_free(allocator, *pstr); do_free(allocator, *pstr);
} }
*pstr = do_alloc(allocator, len - pref_len + 1); *pstr = do_alloc(allocator, len - pref_len + 1);
@ -3293,6 +3293,8 @@ protobuf_c_message_unpack(const ProtobufCMessageDescriptor *desc,
n_unknown * sizeof(ProtobufCMessageUnknownField)); n_unknown * sizeof(ProtobufCMessageUnknownField));
if (rv->unknown_fields == NULL) if (rv->unknown_fields == NULL)
goto error_cleanup; goto error_cleanup;
} else {
rv->unknown_fields = NULL;
} }
/* do real parsing */ /* do real parsing */

View File

@ -106,20 +106,6 @@ Makefile: $(srcdir)/Makefile.in
.i.plog: .i.plog:
ifile=$<; rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $${ifile%i}c --i-file $< --output-file $@ ifile=$<; rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $${ifile%i}c --i-file $< --output-file $@
$(devdir)/log_server.pb-c.c: $(srcdir)/log_server.proto
@if [ -n "$(DEVEL)" ]; then \
cmd='protoc-c --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/log_server.proto'; \
echo "$$cmd"; eval $$cmd; \
cmd='$(scriptdir)/unanon $(devdir)/log_server.pb-c.h $(devdir)/log_server.pb-c.c'; \
echo "$$cmd"; eval $$cmd; \
if [ "$(devdir)" == "$(srcdir)" ]; then \
cmd='mv -f $(devdir)/log_server.pb-c.h $(incdir)/log_server.pb-c.h'; \
else \
cmd='mv -f $(devdir)/log_server.pb-c.h $(top_builddir)/log_server.pb-c.h'; \
fi; \
echo "$$cmd"; eval $$cmd; \
fi
libssl_compat.la: $(LIBSSL_COMPAT_OBJS) $(LT_LIBS) libssl_compat.la: $(LIBSSL_COMPAT_OBJS) $(LT_LIBS)
$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(LIBSSL_COMPAT_OBJS) $(LT_LIBS) $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(LIBSSL_COMPAT_OBJS) $(LT_LIBS)

View File

@ -1,6 +1,6 @@
#!/usr/bin/env perl #!/usr/bin/env perl
# #
# Post-process files generated by protoc-c to remove anonymous unions. # Post-process files generated by protoc to remove anonymous unions.
# Works on the generated files but probably little else. # Works on the generated files but probably little else.
use warnings; use warnings;

View File

@ -203,7 +203,7 @@ Makefile: $(srcdir)/Makefile.in
$(devdir)/intercept.pb-c.c: $(srcdir)/intercept.proto $(devdir)/intercept.pb-c.c: $(srcdir)/intercept.proto
@if [ -n "$(DEVEL)" ]; then \ @if [ -n "$(DEVEL)" ]; then \
cmd='protoc-c --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/intercept.proto'; \ cmd='protoc --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/intercept.proto'; \
echo "$$cmd"; eval $$cmd; \ echo "$$cmd"; eval $$cmd; \
cmd='$(scriptdir)/unanon $(devdir)/intercept.pb-c.h $(devdir)/intercept.pb-c.c'; \ cmd='$(scriptdir)/unanon $(devdir)/intercept.pb-c.h $(devdir)/intercept.pb-c.c'; \
echo "$$cmd"; eval $$cmd; \ echo "$$cmd"; eval $$cmd; \

View File

@ -378,7 +378,7 @@ static const ProtobufCFieldDescriptor intercept_request__field_descriptors[2] =
offsetof(InterceptRequest, u.policy_check_req), offsetof(InterceptRequest, u.policy_check_req),
&policy_check_request__descriptor, &policy_check_request__descriptor,
NULL, NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -390,7 +390,7 @@ static const ProtobufCFieldDescriptor intercept_request__field_descriptors[2] =
offsetof(InterceptRequest, u.hello), offsetof(InterceptRequest, u.hello),
&intercept_hello__descriptor, &intercept_hello__descriptor,
NULL, NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
}; };
@ -774,7 +774,7 @@ static const ProtobufCFieldDescriptor intercept_response__field_descriptors[4] =
offsetof(InterceptResponse, u.hello_resp), offsetof(InterceptResponse, u.hello_resp),
&hello_response__descriptor, &hello_response__descriptor,
NULL, NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -786,7 +786,7 @@ static const ProtobufCFieldDescriptor intercept_response__field_descriptors[4] =
offsetof(InterceptResponse, u.accept_msg), offsetof(InterceptResponse, u.accept_msg),
&policy_accept_message__descriptor, &policy_accept_message__descriptor,
NULL, NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -798,7 +798,7 @@ static const ProtobufCFieldDescriptor intercept_response__field_descriptors[4] =
offsetof(InterceptResponse, u.reject_msg), offsetof(InterceptResponse, u.reject_msg),
&policy_reject_message__descriptor, &policy_reject_message__descriptor,
NULL, NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -810,7 +810,7 @@ static const ProtobufCFieldDescriptor intercept_response__field_descriptors[4] =
offsetof(InterceptResponse, u.error_msg), offsetof(InterceptResponse, u.error_msg),
&policy_error_message__descriptor, &policy_error_message__descriptor,
NULL, NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
}; };