[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#819145: freebsd-buildutils: prototype setmode to fix implicit pointer conversion



Package: freebsd-buildutils
Version: 10.0-8
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu xenial ubuntu-patch

Dear Maintainer,

As is evident from the build logs [1], there is an implicit declaration and pointer conversion of the
setmode function in freebsd-utils. This can lead to unintended consequences, especially on 64-bit
architectures.

In Ubuntu, the attached patch was applied to achieve the following:

  * Merge from Debian unstable. Remaining changes:
    - Prototype setmode since freebsd-glue and libbsd don't do the right thing.

Thanks for considering the patch.

Logan Rosen

[1] https://qa.debian.org/bls/packages/f/freebsd-buildutils.html

-- System Information:
Debian Release: stretch/sid
  APT prefers xenial-updates
  APT policy: (500, 'xenial-updates'), (500, 'xenial-security'), (500, 'xenial'), (100, 'xenial-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.4.0-7-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru freebsd-buildutils-10.0/debian/patches/prototype-setmode.diff freebsd-buildutils-10.0/debian/patches/prototype-setmode.diff
--- freebsd-buildutils-10.0/debian/patches/prototype-setmode.diff	1969-12-31 18:00:00.000000000 -0600
+++ freebsd-buildutils-10.0/debian/patches/prototype-setmode.diff	2015-07-11 02:19:06.000000000 -0500
@@ -0,0 +1,15 @@
+Description: Prototype setmode
+
+Index: b/src/usr.sbin/mtree/spec.c
+===================================================================
+--- a/src/usr.sbin/mtree/spec.c
++++ b/src/usr.sbin/mtree/spec.c
+@@ -49,6 +49,8 @@
+ #include "mtree.h"
+ #include "extern.h"
+ 
++extern void *setmode(const char *mode_str);
++
+ int lineno;				/* Current spec line number. */
+ 
+ static void	 set(char *, NODE *);
diff -Nru freebsd-buildutils-10.0/debian/patches/series freebsd-buildutils-10.0/debian/patches/series
--- freebsd-buildutils-10.0/debian/patches/series	2015-07-09 06:37:17.000000000 -0500
+++ freebsd-buildutils-10.0/debian/patches/series	2016-03-23 01:17:38.000000000 -0500
@@ -25,6 +25,7 @@
 disable_wsystem_headers.diff
 nostrip.diff
 config_ldflags.diff
+prototype-setmode.diff
 
 # Patches that are likely to be Debian-specific
 avoid_defsyspath_collision.diff

Reply to: