1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## ubuntu_toolchain_FTBFS.dpatch by Devid Filoni <d.filoni@techemail.com>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: fix FTBFS caused by -Wformat -Wformat-security and -D_FORTIFY_SOURCE=2.
8
diff -urNad open-vm-tools-2008.08.08-109361~/guestd/foundryToolsDaemon.c open-vm-tools-2008.08.08-109361/guestd/foundryToolsDaemon.c
9
--- open-vm-tools-2008.08.08-109361~/guestd/foundryToolsDaemon.c 2008-08-08 07:01:56.000000000 +0000
10
+++ open-vm-tools-2008.08.08-109361/guestd/foundryToolsDaemon.c 2008-08-15 20:17:39.000000000 +0000
12
* from the contents of /etc/fstab, and invoke custom mount programs like the
13
* one needed for HGFS.
15
- system("mount -a -t vmhgfs");
16
+ if (system("mount -a -t vmhgfs")) { }
20
diff -urNad open-vm-tools-2008.08.08-109361~/guestd/main.c open-vm-tools-2008.08.08-109361/guestd/main.c
21
--- open-vm-tools-2008.08.08-109361~/guestd/main.c 2008-08-08 07:01:56.000000000 +0000
22
+++ open-vm-tools-2008.08.08-109361/guestd/main.c 2008-08-15 20:17:39.000000000 +0000
25
pidFile = fopen(pidFileName, "r");
27
- fscanf(pidFile, "%"FMTPID"\n", &pid);
28
+ if (fscanf(pidFile, "%"FMTPID"\n", &pid)) { }
32
diff -urNad open-vm-tools-2008.08.08-109361~/lib/guestInfo/guestInfoPerfMonLinux.c open-vm-tools-2008.08.08-109361/lib/guestInfo/guestInfoPerfMonLinux.c
33
--- open-vm-tools-2008.08.08-109361~/lib/guestInfo/guestInfoPerfMonLinux.c 2008-08-08 07:01:52.000000000 +0000
34
+++ open-vm-tools-2008.08.08-109361/lib/guestInfo/guestInfoPerfMonLinux.c 2008-08-15 20:17:39.000000000 +0000
39
- fscanf(fp, "%s %"FMT64"u", buf, &value);
40
+ if (fscanf(fp, "%s %"FMT64"u", buf, &value)) { }
41
if (StrUtil_StartsWith(buf, "MemTotal")) {
42
vmStats->memTotal = value;
44
diff -urNad open-vm-tools-2008.08.08-109361~/lib/guestInfo/guestInfoPosix.c open-vm-tools-2008.08.08-109361/lib/guestInfo/guestInfoPosix.c
45
--- open-vm-tools-2008.08.08-109361~/lib/guestInfo/guestInfoPosix.c 2008-08-08 07:01:52.000000000 +0000
46
+++ open-vm-tools-2008.08.08-109361/lib/guestInfo/guestInfoPosix.c 2008-08-15 20:17:39.000000000 +0000
48
char macAddress[NICINFO_MAC_LEN];
49
char ipAddress[NICINFO_MAX_IP_LEN];
51
- Str_Sprintf(macAddress, sizeof macAddress,
52
+ Str_Sprintf(macAddress, sizeof macAddress, "%s\n",
53
addr_ntoa(&entry->intf_link_addr));
54
nic = GuestInfoAddNicEntry(nicInfo, macAddress);
56
diff -urNad open-vm-tools-2008.08.08-109361~/lib/misc/posixPosix.c open-vm-tools-2008.08.08-109361/lib/misc/posixPosix.c
57
--- open-vm-tools-2008.08.08-109361~/lib/misc/posixPosix.c 2008-08-08 07:01:54.000000000 +0000
58
+++ open-vm-tools-2008.08.08-109361/lib/misc/posixPosix.c 2008-08-15 20:17:39.000000000 +0000
60
if (!PosixConvertToCurrent(output, &outCurr)) {
63
- numChars = printf(outCurr);
64
+ numChars = printf(outCurr,"%s\n");
68
diff -urNad open-vm-tools-2008.08.08-109361~/lib/panic/panic.c open-vm-tools-2008.08.08-109361/lib/panic/panic.c
69
--- open-vm-tools-2008.08.08-109361~/lib/panic/panic.c 2008-08-08 07:01:54.000000000 +0000
70
+++ open-vm-tools-2008.08.08-109361/lib/panic/panic.c 2008-08-15 20:17:39.000000000 +0000
79
fprintf(stderr, "Panic loop\n");
81
* the log file on exit.
87
Log_SetAlwaysKeep(TRUE);
89
diff -urNad open-vm-tools-2008.08.08-109361~/lib/system/systemLinux.c open-vm-tools-2008.08.08-109361/lib/system/systemLinux.c
90
--- open-vm-tools-2008.08.08-109361~/lib/system/systemLinux.c 2008-08-08 07:01:53.000000000 +0000
91
+++ open-vm-tools-2008.08.08-109361/lib/system/systemLinux.c 2008-08-15 20:18:00.000000000 +0000
93
cmd = "shutdown -h now";
97
+ if (system(cmd)) { }
102
* won't treat EPIPE as an error, because we'd like to carry on with
103
* our own life, even if our parent -did- abandon us. ;_;
105
- write(fds[1], &buf, sizeof buf);
106
+ if (write(fds[1], &buf, sizeof buf)) { }
109
if (!nochdir && (chdir("/") == -1)) {
110
diff -urNad open-vm-tools-2008.08.08-109361~/vmware-user/foundryToolsDaemon.c open-vm-tools-2008.08.08-109361/vmware-user/foundryToolsDaemon.c
111
--- open-vm-tools-2008.08.08-109361~/vmware-user/foundryToolsDaemon.c 2008-08-08 07:01:56.000000000 +0000
112
+++ open-vm-tools-2008.08.08-109361/vmware-user/foundryToolsDaemon.c 2008-08-15 20:17:39.000000000 +0000
113
@@ -1381,7 +1381,7 @@
114
* from the contents of /etc/fstab, and invoke custom mount programs like the
115
* one needed for HGFS.
117
- system("mount -a -t vmhgfs");
118
+ if (system("mount -a -t vmhgfs")) { }
122
diff -urNad open-vm-tools-2008.08.08-109361~/xferlogs/xferlogs.c open-vm-tools-2008.08.08-109361/xferlogs/xferlogs.c
123
--- open-vm-tools-2008.08.08-109361~/xferlogs/xferlogs.c 2008-08-08 07:01:57.000000000 +0000
124
+++ open-vm-tools-2008.08.08-109361/xferlogs/xferlogs.c 2008-08-15 20:17:39.000000000 +0000
126
RpcVMX_Log("%s: %s: ver - %d", LOG_START_MARK, filename, LOG_VERSION);
127
while ((readLen = fread(buf, 1, sizeof buf, fp)) > 0 ) {
128
if (Base64_Encode(buf, readLen, base64Buf, sizeof base64B - 1, NULL)) {
129
- RpcVMX_Log(base64B);
130
+ RpcVMX_Log(base64B,"%s\n");
132
Warning("Error in Base64_Encode\n");
138
- RpcVMX_Log(argv[1]);
139
+ RpcVMX_Log(argv[1],"%s\n");