Hello community, here is the log from the commit of package mcstrans for openSUSE:Factory checked in at 2018-12-12 17:26:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mcstrans (Old) and /work/SRC/openSUSE:Factory/.mcstrans.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mcstrans" Wed Dec 12 17:26:42 2018 rev:20 rq:655716 version:2.8 Changes: -------- --- /work/SRC/openSUSE:Factory/mcstrans/mcstrans.changes 2017-09-05 15:19:58.333159371 +0200 +++ /work/SRC/openSUSE:Factory/.mcstrans.new.28833/mcstrans.changes 2018-12-12 17:26:47.319006018 +0100 @@ -1,0 +2,29 @@ +Tue Dec 4 11:39:52 UTC 2018 - Jan Engelhardt <jeng...@inai.de> + +- One grammar fix, and use %make_install. + +------------------------------------------------------------------- +Fri Nov 23 10:58:47 UTC 2018 - jseg...@suse.com + +- Dropped mcstransd.service, use the provided service file +- Install example configs +- Fixed source URL + +------------------------------------------------------------------- +Wed Oct 17 11:55:59 UTC 2018 - jseg...@suse.com + +- Update to version 2.8 (bsc#1111732) + For changes please see + https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180524/RELEASE-20180524.txt +- Renamed mcstrans-2.7-writepid.patch to mcstrans-writepid.patch + +------------------------------------------------------------------- +Wed May 16 07:21:45 UTC 2018 - mc...@suse.com + +- Rebase to 2.7 + For changes please see + https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/RELEASE-20170804.txt +- Renamed mcstrans-0.3.3-writepid.patch to + mcstrans-2.7-writepid.patch + +------------------------------------------------------------------- Old: ---- mcstrans-0.3.3-writepid.patch mcstrans-0.3.3.tgz mcstransd.service New: ---- mcstrans-2.8.tar.gz mcstrans-writepid.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mcstrans.spec ++++++ --- /var/tmp/diff_new_pack.kS2USv/_old 2018-12-12 17:26:47.731005494 +0100 +++ /var/tmp/diff_new_pack.kS2USv/_new 2018-12-12 17:26:47.735005489 +0100 @@ -1,7 +1,7 @@ # # spec file for package mcstrans # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,31 +12,31 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # +%define tstamp 20180524 + Name: mcstrans -Version: 0.3.3 +Version: 2.8 Release: 0 -Url: http://pkgs.fedoraproject.org/cgit/rpms/mcstrans.git Summary: SELinux Translation Daemon -License: GPL-2.0+ +License: GPL-2.0-or-later Group: System/Management -Source: %{name}-%{version}.tgz -Source1: mcstransd.service -Patch0: %{name}-%{version}-writepid.patch +URL: https://github.com/SELinuxProject/selinux/wiki +Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/%{tstamp}/%{name}-%{version}.tar.gz +Patch0: %{name}-writepid.patch Patch1: add_includes.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -Requires: aaa_base BuildRequires: aaa_base BuildRequires: libcap-devel BuildRequires: libselinux-devel >= 1.30.3 BuildRequires: libsepol-devel-static BuildRequires: pcre-devel BuildRequires: systemd -%{?systemd_requires} +Requires: aaa_base Provides: setransd +%{?systemd_requires} %description Security-enhanced Linux is a feature of the Linux® kernel and a number @@ -49,7 +49,7 @@ based on the concepts of Type Enforcement®, Role-based Access Control, and Multi-level Security. -mcstrans provides an translation daemon to translate SELinux categories +mcstrans provides a translation daemon to translate SELinux categories from internal representations to user defined representation. %prep @@ -58,41 +58,43 @@ %patch1 -p1 %build -export CFLAGS="$RPM_OPT_FLAGS" -make LIBDIR="%{_libdir}" %{?jobs:-j%jobs} +export CFLAGS="%{optflags}" +make LIBDIR="%{_libdir}" %{?_smp_mflags} %install -mkdir -p $RPM_BUILD_ROOT/%{_lib} -mkdir -p $RPM_BUILD_ROOT/%{_libdir} -mkdir -p $RPM_BUILD_ROOT/%{_unitdir} -make DESTDIR="$RPM_BUILD_ROOT" LIBDIR="$RPM_BUILD_ROOT%{_libdir}" SHLIBDIR="$RPM_BUILD_ROOT/%{_lib}" install -rm -f $RPM_BUILD_ROOT%{_sbindir}/* -rm -f $RPM_BUILD_ROOT%{_libdir}/*.a -rm $RPM_BUILD_ROOT/etc/rc.d/init.d/mcstrans -install -D -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/ -rm -rf $RPM_BUILD_ROOT/etc/rc.d -mkdir -p $RPM_BUILD_ROOT%{_sbindir} -ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcmcstransd +mkdir -p %{buildroot}/%{_lib} +mkdir -p %{buildroot}/%{_libdir} +mkdir -p %{buildroot}/%{_unitdir} +%make_install LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}/%{_lib}" +rm -f %{buildroot}%{_sbindir}/* +rm -f %{buildroot}%{_libdir}/*.a +rm %{buildroot}%{_sysconfdir}/rc.d/init.d/mcstrans* +rm -rf %{buildroot}%{_sysconfdir}/rc.d +mkdir -p %{buildroot}%{_datadir}/doc/packages/%{name} +cp -r share/examples %{buildroot}%{_datadir}/doc/packages/%{name} +mkdir -p %{buildroot}%{_sbindir} +ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} %post -%service_add_post mcstransd.service +%service_add_post mcstrans.service %preun -%service_del_preun mcstransd.service +%service_del_preun mcstrans.service %postun -%service_del_postun mcstransd.service +%service_del_postun mcstrans.service %pre -%service_add_pre mcstransd.service +%service_add_pre mcstrans.service %files -%defattr(-,root,root) -%{_unitdir}/mcstransd.service +%{_unitdir}/mcstrans*.service /sbin/mcstransd -/usr/sbin/rcmcstransd -%{_mandir}/man8/mcs.8* -%{_mandir}/man8/mcstransd.8* -%{_mandir}/man8/setrans.conf.8* +%{_sbindir}/rcmcstrans +%{_mandir}/man8/mcs.8%{?ext_man} +%{_mandir}/man8/mcstransd.8%{?ext_man} +%{_mandir}/man8/setrans.conf.8%{?ext_man} +%dir %{_datadir}/doc/packages/%{name} +%{_datadir}/doc/packages/%{name}/* %changelog ++++++ add_includes.patch ++++++ --- /var/tmp/diff_new_pack.kS2USv/_old 2018-12-12 17:26:47.755005464 +0100 +++ /var/tmp/diff_new_pack.kS2USv/_new 2018-12-12 17:26:47.755005464 +0100 @@ -1,12 +1,12 @@ -Index: mcstrans-0.3.3/src/mcstransd.c +Index: mcstrans-2.7/src/mcstransd.c =================================================================== ---- mcstrans-0.3.3.orig/src/mcstransd.c 2017-09-05 10:38:35.671557177 +0200 -+++ mcstrans-0.3.3/src/mcstransd.c 2017-09-05 10:45:49.122557656 +0200 -@@ -4,6 +4,7 @@ +--- mcstrans-2.7.orig/src/mcstransd.c ++++ mcstrans-2.7/src/mcstransd.c +@@ -14,6 +14,7 @@ #include <sys/socket.h> - #include <sys/poll.h> #include <sys/stat.h> + #include <sys/types.h> +#include <sys/uio.h> #include <fcntl.h> + #include <sys/uio.h> #include <sys/un.h> - #include <errno.h> ++++++ mcstrans-writepid.patch ++++++ Index: mcstrans-2.7/src/mcstransd.c =================================================================== --- mcstrans-2.7.orig/src/mcstransd.c +++ mcstrans-2.7/src/mcstransd.c @@ -14,6 +14,7 @@ #include <sys/socket.h> #include <sys/stat.h> #include <sys/types.h> +#include <fcntl.h> #include <sys/uio.h> #include <sys/un.h> #include "mcstrans.h" @@ -62,7 +63,7 @@ static int sockfd = -1; /* socket we are static volatile int restart_daemon = 0; static void cleanup_exit(int ret) __attribute__ ((noreturn)); static void -cleanup_exit(int ret) +cleanup_exit(int ret) { finish_context_colors(); finish_context_translations(); @@ -152,7 +153,7 @@ process_request(int fd, uint32_t functio /* TODO: Check if MLS clearance (in peercon) dominates the MLS label * (in the request input). */ - + switch (function) { case SETRANS_INIT: result = 0; @@ -231,7 +232,7 @@ service_request(int fd) data1 = malloc(data1_size); if (!data1) { log_debug("Could not allocate %d bytes\n", data1_size); - return -1; + return -1; } data2 = malloc(data2_size); if (!data2) { @@ -542,6 +543,30 @@ static void usage(char *program) printf("%s [-f] [-h] \n", program); } +static const char *pidfile = "/var/run/mcstransd.pid"; + +static int write_pid_file(void) +{ + int pidfd, len; + char val[16]; + + len = snprintf(val, sizeof(val), "%u\n", getpid()); + if (len < 0) { + syslog(LOG_ERR, "Pid error (%s)", strerror(errno)); + pidfile = 0; + return 1; + } + pidfd = open(pidfile, O_CREAT | O_TRUNC | O_NOFOLLOW | O_WRONLY, 0644); + if (pidfd < 0) { + syslog(LOG_ERR, "Unable to set pidfile (%s)", strerror(errno)); + pidfile = 0; + return 1; + } + (void)write(pidfd, val, (unsigned int)len); + close(pidfd); + return 0; +} + int main(int argc, char *argv[]) { @@ -585,6 +610,8 @@ main(int argc, char *argv[]) } #endif + write_pid_file(); + syslog(LOG_NOTICE, "%s initialized", argv[0]); process_connections();