~ubuntu-branches/ubuntu/vivid/lshw/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/09-lshw-privacy.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2008-03-28 12:12:46 UTC
  • Revision ID: james.westby@ubuntu.com-20080328121246-9xq6ocanv3ywa6j9
Tags: 02.12.01-2ubuntu1
Add 09-lshw-privacy.dpatch: disable lshw's check for updated versions
via network lookup, thanks to Darik Horn (LP: #208399).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 09-lshw-privacy.dpatch by Darik Horn <dajhorn@vanadac.com>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Prevents lshw from phoning home.
 
6
 
 
7
@DPATCH@
 
8
diff -dru lshw-02.12.01/src/core/version.cc lshw-02.12.01-privacy/src/core/version.cc
 
9
--- lshw-02.12.01/src/core/version.cc   2007-10-13 17:23:16.000000000 -0500
 
10
+++ lshw-02.12.01-privacy/src/core/version.cc   2008-02-19 11:57:29.000000000 -0600
 
11
@@ -13,9 +13,6 @@
 
12
 #include <stdlib.h>
 
13
 #include <string.h>
 
14
 #include <ctype.h>
 
15
-#include <netinet/in.h>
 
16
-#include <arpa/nameser.h>
 
17
-#include <resolv.h>
 
18
 #include <sys/types.h>
 
19
 
 
20
 #ifndef PACKETSZ
 
21
@@ -54,66 +51,8 @@
 
22
   return result;
 
23
 }
 
24
 
 
25
-static char *txtquery(const char *name, const char *domain, unsigned int *ttl)
 
26
-{
 
27
-  unsigned char answer[PACKETSZ], *pt;
 
28
-  char host[128], *txt;
 
29
-  int len, exp, cttl, size, txtlen, type;
 
30
-
 
31
-  if(res_init() < 0)
 
32
-    return NULL;
 
33
-
 
34
-  memset(answer, 0, PACKETSZ);
 
35
-  if((len = res_querydomain(name, domain, C_IN, T_TXT, answer, PACKETSZ)) < 0)
 
36
-    return NULL;
 
37
-
 
38
-  pt = answer + sizeof(HEADER);
 
39
-
 
40
-  if((exp = dn_expand(answer, answer + len, pt, host, sizeof(host))) < 0)
 
41
-    return NULL;
 
42
-
 
43
-  pt += exp;
 
44
-
 
45
-  GETSHORT(type, pt);
 
46
-  if(type != T_TXT)
 
47
-    return NULL;
 
48
-
 
49
-  pt += INT16SZ; /* class */
 
50
-
 
51
-  if((exp = dn_expand(answer, answer + len, pt, host, sizeof(host))) < 0)
 
52
-    return NULL;
 
53
-
 
54
-  pt += exp;
 
55
-  GETSHORT(type, pt);
 
56
-  if(type != T_TXT)
 
57
-    return NULL;
 
58
-
 
59
-  pt += INT16SZ; /* class */
 
60
-  GETLONG(cttl, pt);
 
61
-  if(ttl)
 
62
-    *ttl = cttl;
 
63
-  GETSHORT(size, pt);
 
64
-  txtlen = *pt;
 
65
-
 
66
-  if(txtlen >= size || !txtlen)
 
67
-    return NULL;
 
68
-
 
69
-  if(!(txt = (char*)malloc(txtlen + 1)))
 
70
-    return NULL;
 
71
-
 
72
-  pt++;
 
73
-  strncpy(txt, (char*)pt, txtlen);
 
74
-  txt[txtlen] = 0;
 
75
-
 
76
-  return txt;
 
77
-}
 
78
-
 
79
 const char * checkupdates()
 
80
 {
 
81
-  static char *latest = NULL;
 
82
-
 
83
-  if(!latest)
 
84
-    latest = txtquery(PACKAGE, "ezix.org", NULL);
 
85
-
 
86
-  return latest;
 
87
+  // This disables the home phone function for user privacy.
 
88
+  return NULL;
 
89
 }
 
90
diff -dru lshw-02.12.01/src/Makefile lshw-02.12.01-privacy/src/Makefile
 
91
--- lshw-02.12.01/src/Makefile  2007-10-13 17:23:16.000000000 -0500
 
92
+++ lshw-02.12.01-privacy/src/Makefile  2008-02-19 11:55:30.000000000 -0600
 
93
@@ -24,7 +24,7 @@
 
94
        LDFLAGS+= -Wl,--as-needed
 
95
 endif
 
96
 LDSTATIC=-static
 
97
-LIBS=-llshw -lresolv
 
98
+LIBS=-llshw
 
99
 
 
100
 DATAFILES = pci.ids usb.ids oui.txt manuf.txt
 
101