Explorar el Código

dpkg-deb: Do not warn when parsing unknown fields with “Private-” prefix

Fields prefixed with “Private-” are intended to be used privately by
individuals, organizations or companies, and are expected to never be
standardized. This guarantees them to never collide with any official
field in the future. Because there's still the danger that different
organizations might end up using the same field name, those should
never be visible in any public repository.

Closes: #353040

Based-on-patch-by: Nils Rennebarth <nils.rennebarth@funkwerk-ec.com>
Guillem Jover hace 17 años
padre
commit
4329253347
Se han modificado 2 ficheros con 8 adiciones y 0 borrados
  1. 2 0
      debian/changelog
  2. 6 0
      dpkg-deb/build.c

+ 2 - 0
debian/changelog

@@ -132,6 +132,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
     file to match reality.
   * Warn in start-stop-daemon if the argument to --name is longer than the
     supported kernel process name size. Closes: #353015, #519128
+  * Do not warn in dpkg-deb when parsing unknown fields with the “Private-”
+    prefix. Based on a patch by Nils Rennebarth. Closes: #353040
 
   [ Frank Lichtenheld ]
   * Dpkg::Version: Remove unnecessary function next_elem which just

+ 6 - 0
dpkg-deb/build.c

@@ -70,9 +70,15 @@ static const char *arbitrary_fields[] = {
   NULL
 };
 
+static const char *private_prefix = "Private-";
+
 static int known_arbitrary_field(const struct arbitraryfield *field) {
   const char **known;
 
+  /* Always accept fields starting with a private field prefix. */
+  if (strncasecmp(field->name, private_prefix, strlen(private_prefix)) == 0)
+    return 1;
+
   for (known= arbitrary_fields; *known; known++)
     if (strcasecmp(field->name, *known) == 0)
       return 1;