osquery: fix build

We use `dpkg` 1.19.2 since 23661254e4.
This version dropped pkg_db_reset` in  `<dpkg/dpkg_db.h>` which broke compilation with the
following errors:

```
/build/source/osquery/tables/system/linux/deb_packages.cpp: In function 'void osquery::tables::dpkg_setup(pkg_array*)':
/build/source/osquery/tables/system/linux/deb_packages.cpp:83:3: error: 'pkg_array_init_from_db' was not declared in this scope
   pkg_array_init_from_db(packages);
   ^~~~~~~~~~~~~~~~~~~~~~
/build/source/osquery/tables/system/linux/deb_packages.cpp:83:3: note: suggested alternative: 'pkg_array_init_from_hash'
   pkg_array_init_from_db(packages);
   ^~~~~~~~~~~~~~~~~~~~~~
   pkg_array_init_from_hash
/build/source/osquery/tables/system/linux/deb_packages.cpp: In function 'void osquery::tables::dpkg_teardown(pkg_array*)':
/build/source/osquery/tables/system/linux/deb_packages.cpp:93:3: error: 'pkg_db_reset' was not declared in this scope
   pkg_db_reset();
   ^~~~~~~~~~~~
/build/source/osquery/tables/system/linux/deb_packages.cpp:93:3: note: suggested alternative: 'pkg_hash_reset'
   pkg_db_reset();
   ^~~~~~~~~~~~
   pkg_hash_reset
make[2]: *** [osquery/tables/CMakeFiles/osquery_system_tables.dir/build.make:115: osquery/tables/CMakeFiles/osquery_system_tables.dir/system/linux/deb_packages.cpp.o] Error 1
```

As there's currently no upstream fix, it's better to use an older
version of `dpkg` for now.
This commit is contained in:
Maximilian Bosch 2019-02-13 10:50:28 +01:00
parent aa21b4b3d3
commit 7a961cf06f
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

View file

@ -4,7 +4,7 @@
, beecrypt, augeas, libxml2, sleuthkit, yara, lldpd, google-gflags
, thrift, boost, rocksdb_lite, glog, gbenchmark, snappy
, openssl, file, doxygen
, gtest, sqlite, fpm, zstd, rdkafka, rapidjson, fetchgit
, gtest, sqlite, fpm, zstd, rdkafka, rapidjson, fetchgit, fetchurl
}:
let
@ -61,6 +61,16 @@ stdenv.mkDerivation rec {
sha256 = "1ny3srcsxd6kj59zq1cman5myj8kzw010wbyc6mrpk4kp823r5nx";
};
});
# dpkg 1.19.2 dropped api in `<dpkg/dpkg-db.h>` which breaks compilation.
dpkg' = dpkg.overrideAttrs (old: rec {
name = "dpkg-${version}";
version = "1.19.0.5";
src = fetchurl {
url = "mirror://debian/pool/main/d/dpkg/dpkg_${version}.tar.xz";
sha256 = "1dc5kp3fqy1k66fly6jfxkkg7w6d0jy8szddpfyc2xvzga94d041";
};
});
in [
udev audit
@ -69,7 +79,7 @@ stdenv.mkDerivation rec {
customMemoryManagement = false;
})
lvm2' libgcrypt libarchive libgpgerror libuuid iptables dpkg
lvm2' libgcrypt libarchive libgpgerror libuuid iptables dpkg'
lzma bzip2 rpm beecrypt augeas libxml2 sleuthkit
yara lldpd gflags' thrift boost
glog gbenchmark snappy openssl