From ba209da3eef1ddb2969c2b24e002549a7a223a9fcf8d32ea506df9500b7b6d1f Mon Sep 17 00:00:00 2001 From: Martin Hauke Date: Wed, 15 Jan 2020 14:54:06 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/security:OpenVAS:STABLE/openvas-smb?expand=0&rev=1 --- .gitattributes | 23 ++++ .gitignore | 1 + 0001-Fix-heimdal-gssapi-dependencies.patch | 94 +++++++++++++++ openvas-smb-1.0.5.tar.gz | 3 + openvas-smb-1.0.5.tar.gz.sig | 17 +++ openvas-smb.changes | 10 ++ openvas-smb.keyring | 29 +++++ openvas-smb.spec | 131 +++++++++++++++++++++ 8 files changed, 308 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-Fix-heimdal-gssapi-dependencies.patch create mode 100644 openvas-smb-1.0.5.tar.gz create mode 100644 openvas-smb-1.0.5.tar.gz.sig create mode 100644 openvas-smb.changes create mode 100644 openvas-smb.keyring create mode 100644 openvas-smb.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Fix-heimdal-gssapi-dependencies.patch b/0001-Fix-heimdal-gssapi-dependencies.patch new file mode 100644 index 0000000..126562f --- /dev/null +++ b/0001-Fix-heimdal-gssapi-dependencies.patch @@ -0,0 +1,94 @@ +From 2dec4204de81f79922c8b77f54404983172360a8 Mon Sep 17 00:00:00 2001 +From: Martin Hauke +Date: Sun, 14 Apr 2019 20:40:10 +0200 +Subject: [PATCH] Fix heimdal gssapi dependencies + +libheimdal on openSUSE does not provide a pkg-config file for gssapi. +--- + CMakeLists.txt | 7 +++---- + cmake/Modules/FindGSSAPI.cmake | 34 ++++++++++++++++++++++++++++++++++ + samba/CMakeLists.txt | 2 +- + 3 files changed, 38 insertions(+), 5 deletions(-) + create mode 100644 cmake/Modules/FindGSSAPI.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 021b08f..e9515c5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -30,6 +30,8 @@ project(openvas-smb + + set(CMAKE_INCLUDE_CURRENT_DIR ON) + ++list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) ++ + find_package(Perl REQUIRED) + + include (FindPkgConfig) +@@ -144,12 +146,9 @@ endif (NOT INCLUDEDIR) + message ("-- Install prefix: ${CMAKE_INSTALL_PREFIX}") + + pkg_check_modules (GNUTLS REQUIRED gnutls>=3.2.15) +-pkg_check_modules (GSSAPI REQUIRED heimdal-gssapi>=1.6.0) ++find_package(GSSAPI REQUIRED heimdal-gssapi>=1.6.0) + pkg_check_modules (POPT REQUIRED popt) + +-if(${GSSAPI_VERSION} VERSION_LESS "7.5.0") +- add_definitions(-DOLD_HEIMDAL) +-endif() + set (CMAKE_C_FLAGS "-fPIC -O2 -D_FORTIFY_SOURCE=2 -fstack-protector ${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "-Wno-unused-result -fno-strict-aliasing ${CMAKE_C_FLAGS}") + set (LINKER_HARDENING_FLAGS "-Wl,-z,relro -Wl,-z,now") +diff --git a/cmake/Modules/FindGSSAPI.cmake b/cmake/Modules/FindGSSAPI.cmake +new file mode 100644 +index 0000000..6dcf570 +--- /dev/null ++++ b/cmake/Modules/FindGSSAPI.cmake +@@ -0,0 +1,34 @@ ++INCLUDE(FindPkgConfig) ++PKG_CHECK_MODULES(PC_GSSAPI "gssapi") ++ ++FIND_PATH(GSSAPI_INCLUDE_DIRS ++ NAMES gssapi/gssapi.h ++ HINTS ${PC_GSSAPI_INCLUDE_DIR} ++ ${CMAKE_INSTALL_PREFIX}/include ++ ${LIBGSSAPI_INSTALL_PREFIX}/include ++ PATHS ++ /usr/local/include ++ /usr/include ++) ++ ++FIND_LIBRARY(GSSAPI_LIBRARIES ++ NAMES gssapi libgssapi ++ HINTS ${PC_GSSAPI_LIBDIR} ++ ${CMAKE_INSTALL_PREFIX}/lib ++ ${CMAKE_INSTALL_PREFIX}/lib64 ++ PATHS ++ /usr/local/lib ++ /usr/lib ++) ++ ++if (GSSAPI_LIBRARIES AND GSSAPI_INCLUDE_DIRS) ++ set(LIBGSSAPI_FOUND TRUE CACHE INTERNAL "gssapi") ++ message(STATUS "Found gssapi: ${GSSAPI_INCLUDE_DIRS}, ${GSSAPI_LIBRARIES}") ++else (GSSAPI_LIBRARIES AND GSSAPI_INCLUDE_DIRS) ++ set(LIBGSSAPI_FOUND FALSE CACHE INTERNAL "gssapi found") ++ message(STATUS "gssapi not found") ++endif (GSSAPI_LIBRARIES AND GSSAPI_INCLUDE_DIRS) ++ ++INCLUDE(FindPackageHandleStandardArgs) ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSSAPI DEFAULT_MSG GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIRS) ++MARK_AS_ADVANCED(GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIRS) +diff --git a/samba/CMakeLists.txt b/samba/CMakeLists.txt +index 82f55e6..b8eef7f 100644 +--- a/samba/CMakeLists.txt ++++ b/samba/CMakeLists.txt +@@ -450,5 +450,5 @@ add_custom_command( + add_library(samba-static STATIC ${RPC_GEN_SRC} ${SAMBA_SRC} ${RPC_GEN_HEADERS}) + # Link against static heimdal-gssapi ldflags returned by pkg-config + # Link against libhdb as well since it is missing from the list +-target_link_libraries (samba-static ${GSSAPI_STATIC_LDFLAGS} hdb) ++target_link_libraries (samba-static com_err asn1 krb5 gssapi hdb) + set_target_properties (samba-static PROPERTIES CMAKE_POSITION_INDEPENDENT_CODE TRUE) +-- +2.16.4 + diff --git a/openvas-smb-1.0.5.tar.gz b/openvas-smb-1.0.5.tar.gz new file mode 100644 index 0000000..bd81878 --- /dev/null +++ b/openvas-smb-1.0.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9308df2a7fca84ecc71a8c5679a0e59d8dccc3c24de38fd089ae18f00d6283ce +size 1081679 diff --git a/openvas-smb-1.0.5.tar.gz.sig b/openvas-smb-1.0.5.tar.gz.sig new file mode 100644 index 0000000..11fc57f --- /dev/null +++ b/openvas-smb-1.0.5.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQIcBAABAgAGBQJcp2mEAAoJEJgj+qYO0eWAp3cP/2MBs5dhm0PMjtyet8whUdWk +gIKPb2oW0bww7jyU2H2DPwXwEZL91+AjdY+zvEFrwe0l1Y6sZMl2x/Dn2fA26Qwt +4VUSbWM2Nvf2MUQ2tTTFUvS4Y5iAyTU3D0M+3R1T+1L1BXaEs3WuqKCs+Y5nzgmV +MvOUdf0SO2q7+d3uCMbo6jk3/OdxhsU9cVLFNWm7tUSBo4+Re8gKsRs6uBey+y8p ++irvnObRqLWnQcm5xSVX3KaDB5ji4go8g/KLOBJLwlpq5HgK07NEazx+AI/hAoM3 +az14LsY0uCD5qFvS/X9DZeO53f8lTwI1O08iYLv8KvBU+v6F0f8mGSUTK77Bj04r +pxrRSl1F/inbvqmLAugHYfYpcXxo8mop9vaEqannCpCxy/DzBJNiE3/SP8d/tHae +YSnsadlnjDi8d4pY7naujB+Gou9kuO3uxB0Gb+uAGFlOj+pkcNSjMyicQp+pfoui +QIMaW6OVEJQukz1ltxgHde6PD2swTUaBCmfBEb2m0FQqnTpIOjgz8H3Fe0yIl1Dv +UkO7aEfH4lck7mkGgyJhOJHKnHBMv3fZqi2+G6IAte4BMdQqwxiwXQOPWiKr32vO +De7aix/8b+NLqlEf04aRx3QWqYg+wEhbZb28czHBbyAC1/FilB2ch59KkT3f+IyE +ZhoyCKbPaZj0DytJ1bXo +=8MqO +-----END PGP SIGNATURE----- diff --git a/openvas-smb.changes b/openvas-smb.changes new file mode 100644 index 0000000..d152c53 --- /dev/null +++ b/openvas-smb.changes @@ -0,0 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 9 23:23:19 UTC 2020 - Martin Hauke + +- Add "-std=c11" to CFLAGS to workaround compiler warnings that + turned into errors with "-Wall" on Factory with gcc9 + +------------------------------------------------------------------- +Mon Apr 15 19:23:38 UTC 2019 - Martin Hauke + +- Initial package, version 1.0.5 diff --git a/openvas-smb.keyring b/openvas-smb.keyring new file mode 100644 index 0000000..84ada16 --- /dev/null +++ b/openvas-smb.keyring @@ -0,0 +1,29 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFmwBV8BEAC12vjOMsOZnK3zaBI+7hImmpkmiuwQ33ys/1Yhk99wcZw3Lxap +uesRgdZTFr93E0oiN7PzKgPJcFT9Wz7O2h1OpgPWJnL6vp3usMxGLS0gSUj/pgUI +qvlKtnaV1+2qMtsunnEW3QGN/m1HmQtaPBFWBAJIP7NNqBmrQNuRyLslV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qHEkaPOZ2OK9SjXjd8RPARazHk4hYveSzxCM+OCQBQNvlyVr +JLGOtYCVah4rDsiCiDp/mrNwT5NqVaK8yABk/QlE2EakssXxfliAkse6/up1ymLm +nuG0KyrrSztoS5YGzyn+ZX9tCZ2L8QDFhjpmkb+1JfDBdAlwdXyBNl0XqKfEp6IU +2T+z+0nas6NTqwLJ/QVH5Hn9nKTmfjaFQSsPhvUeN2jatNmgle8UFihBUrw7f0DX +xMbJc0howgAT0zg+T3FHINZfmjChlAHbd3B/1crJAeIHnEyVtrcV/dNrc4qXEKNs +hrwIQ1cRTJcY +=+bJs +-----END PGP PUBLIC KEY BLOCK----- diff --git a/openvas-smb.spec b/openvas-smb.spec new file mode 100644 index 0000000..318403a --- /dev/null +++ b/openvas-smb.spec @@ -0,0 +1,131 @@ +# +# spec file for package openvas-smb +# +# +# Copyright (c) 2019, Martin Hauke +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +%define sover 1 +Name: openvas-smb +Version: 1.0.5 +Release: 0 +Summary: SMB module for OpenVAS Scanner +License: GPL-2.0-or-later +Group: Productivity/Networking/Security +URL: https://github.com/greenbone/openvas-smb +#Git-Clone: https://github.com/greenbone/gvm-libs.git +Source: https://github.com/greenbone/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source98: https://github.com/greenbone/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz.sig +Source99: https://www.greenbone.net/GBCommunitySigningKey.asc#/%{name}.keyring +Patch0: 0001-Fix-heimdal-gssapi-dependencies.patch +BuildRequires: cmake +BuildRequires: doxygen +BuildRequires: graphviz +BuildRequires: libheimdal-devel >= 7.5.0 +BuildRequires: mingw32-cross-gcc +BuildRequires: perl +BuildRequires: pkgconfig +BuildRequires: xmltoman +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gnutls) >= 3.2.15 +BuildRequires: pkgconfig(popt) +Provides: wmic +Provides: winexe + +%description +This is the smb module for the OpenVAS Scanner. It includes libraries +(openvas-wmiclient/openvas-wincmd) to interface with Microsoft Windows +Systems through the Windows Management Instrumentation API and a +winexe binary to execute processes remotely on that system. + +%package -n libopenvas_wincmd%{sover} +Summary: Support libraries for GVM +Group: System/Libraries + +%description -n libopenvas_wincmd%{sover} +The support libraries for the Greenbone Vulnerability Management framework. + +%package -n libopenvas_wincmd-devel +Summary: Development files for the OpenVAS wincmd library +Group: Development/Libraries/C and C++ +Requires: libopenvas_wincmd%{sover} = %{version} + +%description -n libopenvas_wincmd-devel +The support libraries for the Greenbone Vulnerability Management framework. + +This subpackage contains libraries and header files for developing +applications that want to make use of libopenvas_wincmd. + +%package -n libopenvas_wmiclient%{sover} +Summary: Support libraries for GVM +Group: System/Libraries + +%description -n libopenvas_wmiclient%{sover} +The support libraries for the Greenbone Vulnerability Management framework. + +%package -n libopenvas_wmiclient-devel +Summary: Development files for the OpenVAS wmiclient library +Group: Development/Libraries/C and C++ +Requires: libopenvas_wmiclient%{sover} = %{version} + +%description -n libopenvas_wmiclient-devel +The support libraries for the Greenbone Vulnerability Management framework. + +This subpackage contains libraries and header files for developing +applications that want to make use of libopenvas_wmiclient. + +%prep +%setup -q +%patch0 -p1 +# Fix libheimdal include path +find . -name '*.[c\|h]' -print0 | xargs -0 sed -i 's|heimdal\/||g' + +%build +%cmake -DCMAKE_C_FLAGS="-Wno-address -std=c11" +%make_jobs + +%install +%cmake_install + +%post -n libopenvas_wincmd%{sover} -p /sbin/ldconfig +%post -n libopenvas_wmiclient%{sover} -p /sbin/ldconfig +%postun -n libopenvas_wincmd%{sover} -p /sbin/ldconfig +%postun -n libopenvas_wmiclient%{sover} -p /sbin/ldconfig + +%files +%license COPYING +%doc CHANGES README.md +%{_bindir}/winexe +%{_bindir}/wmic +%{_mandir}/man1/winexe.1%{?ext_man} +%{_mandir}/man1/wmic.1%{?ext_man} + +%files -n libopenvas_wmiclient%{sover} +%{_libdir}/libopenvas_wmiclient.so.%{sover}* + +%files -n libopenvas_wmiclient-devel +%dir %{_includedir}/openvas +%dir %{_includedir}/openvas/smb +%{_includedir}/openvas/smb/*.h +%{_libdir}/libopenvas_wmiclient.so +%{_libdir}/pkgconfig/libopenvas_wmiclient.pc + +%files -n libopenvas_wincmd%{sover} +%{_libdir}/libopenvas_wincmd.so.%{sover}* + +%files -n libopenvas_wincmd-devel +%{_libdir}/libopenvas_wincmd.so +%{_libdir}/pkgconfig/libopenvas_wincmd.pc + +%changelog