Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package snapper for openSUSE:Factory checked 
in at 2023-03-29 23:25:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/snapper (Old)
 and      /work/SRC/openSUSE:Factory/.snapper.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "snapper"

Wed Mar 29 23:25:53 2023 rev:152 rq:1074617 version:0.10.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/snapper/snapper.changes  2023-02-25 
19:54:49.123158246 +0100
+++ /work/SRC/openSUSE:Factory/.snapper.new.31432/snapper.changes       
2023-03-29 23:25:55.211095565 +0200
@@ -1,0 +2,7 @@
+Tue Mar 21 08:51:05 CET 2023 - aschn...@suse.com
+
+- enable SELinux (and allow to disable via conditional build)
+  (bsc#1209515)
+- avoid some extra checks if SELinux is compile-time disabled
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ snapper.spec ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.151099981 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.155099999 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package snapper
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -28,6 +28,9 @@
 %define pam_security_dir /%{_lib}/security
 %endif
 
+# Optionally build without SELinux support
+%bcond_without selinux
+
 # Optionally build with test coverage reporting
 %bcond_with coverage
 
@@ -41,16 +44,16 @@
 Source:         snapper-%{version}.tar.bz2
 %if 0%{?suse_version}
 BuildRequires:  libboost_system-devel
-BuildRequires:  libboost_thread-devel
 BuildRequires:  libboost_test-devel
+BuildRequires:  libboost_thread-devel
 %else
 BuildRequires:  boost-devel
 %endif
+BuildRequires:  e2fsprogs-devel
 BuildRequires:  gcc-c++
 BuildRequires:  libacl-devel
 BuildRequires:  libtool
 BuildRequires:  libxml2-devel
-BuildRequires:  e2fsprogs-devel
 BuildRequires:  ncurses-devel
 %if 0%{?suse_version}
 BuildRequires:  libbtrfs-devel
@@ -69,8 +72,8 @@
 %endif
 %if 0%{?fedora_version} || 0%{?centos_version}
 BuildRequires: glibc-langpack-de
-BuildRequires: glibc-langpack-fr
 BuildRequires: glibc-langpack-en
+BuildRequires:  glibc-langpack-fr
 %else
 BuildRequires:  glibc-locale
 %endif
@@ -95,10 +98,12 @@
 BuildRequires:  pam-devel
 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} || 
0%{?scientificlinux_version}
 BuildRequires:  json-c-devel
-BuildRequires:  libselinux-devel
 %else
 BuildRequires:  libjson-c-devel
 %endif
+%if %{with selinux}
+BuildRequires:  libselinux-devel
+%endif
 BuildRequires:  zlib-devel
 %if %{with coverage}
 BuildRequires:  lcov
@@ -107,7 +112,8 @@
 Requires:       libsnapper6 = %version
 Requires:       systemd
 %if 0%{?suse_version}
-Recommends:     logrotate snapper-zypp-plugin
+Recommends:     logrotate
+Recommends:     snapper-zypp-plugin
 Supplements:    btrfsprogs
 %endif
 
@@ -131,17 +137,13 @@
 autoreconf -fvi
 %configure \
        --docdir="%{_defaultdocdir}/snapper"                                    
\
-%if %{with coverage}
-       --enable-coverage \
-%endif
+       %{?with_coverage:--enable-coverage}                                     
\
        --with-pam-security="%{pam_security_dir}"                               
\
 %if ! 0%{?suse_version}
        --disable-rollback                                                      
\
        --disable-btrfs-quota                                                   
\
 %endif
-%if 0%{?fedora_version} || 0%{?rhel_version}
-       --enable-selinux                                                        
\
-%endif
+       %{?with_selinux:--enable-selinux}                                       
\
        --disable-silent-rules --disable-ext4
 make %{?_smp_mflags}
 
@@ -317,8 +319,8 @@
 %{_includedir}/snapper
 
 %package -n snapper-zypp-plugin
-Requires:       libzypp(plugin:commit) = 1
 Requires:       snapper = %version
+Requires:       libzypp(plugin:commit) = 1
 Summary:        A zypp commit plugin for calling snapper
 Group:          System/Packages
 

++++++ debian.tar.gz ++++++

++++++ snapper-0.10.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/LIBVERSION 
new/snapper-0.10.4/LIBVERSION
--- old/snapper-0.10.4/LIBVERSION       2023-02-23 11:40:43.000000000 +0100
+++ new/snapper-0.10.4/LIBVERSION       2023-03-27 02:00:00.000000000 +0200
@@ -1 +1 @@
-6.2.1
+6.2.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/FileUtils.cc 
new/snapper-0.10.4/snapper/FileUtils.cc
--- old/snapper-0.10.4/snapper/FileUtils.cc     2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/FileUtils.cc     2023-03-27 02:00:00.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2011-2014] Novell, Inc.
- * Copyright (c) [2018-2020] SUSE LLC
+ * Copyright (c) [2018-2023] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -23,7 +23,7 @@
 
 #include "config.h"
 
-#include <string.h>
+#include <cstring>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/mount.h>
@@ -33,12 +33,9 @@
 #include <stddef.h>
 #include <dirent.h>
 #include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <assert.h>
-#ifdef ENABLE_SELINUX
-#include <selinux/selinux.h>
-#endif
+#include <cerrno>
+#include <cstdlib>
+#include <cassert>
 #include <algorithm>
 
 #include "snapper/FileUtils.h"
@@ -633,8 +630,7 @@
        {
            char *src_con = NULL;
 
-           int fd = ::openat(dirfd, name.c_str(), O_RDONLY | O_NOFOLLOW | 
O_NOATIME
-                             | O_NONBLOCK | O_CLOEXEC);
+           int fd = ::openat(dirfd, name.c_str(), O_RDONLY | O_NOFOLLOW | 
O_NOATIME | O_NONBLOCK | O_CLOEXEC);
            if (fd < 0)
            {
                // symlink, detached dev node?
@@ -657,7 +653,8 @@
                    y2deb("setting new SELinux context on " << fullname() << 
"/" << name);
                    if (lsetfilecon(name.c_str(), con))
                    {
-                       y2err("lsetfilecon on " << fullname() << "/" << name << 
" failed errno: " << errno << " (" << stringerror(errno) << ")");
+                       y2err("lsetfilecon on " << fullname() << "/" << name << 
" failed errno: " << errno <<
+                             " (" << stringerror(errno) << ")");
                        retval = false;
                    }
                }
@@ -672,7 +669,8 @@
                    y2deb("setting new SELinux context on " << fullname() << 
"/" << name);
                    if (::fsetfilecon(fd, con))
                    {
-                       y2err("fsetfilecon on " << fullname() << "/" << name << 
" failed errno: " << errno << " (" << stringerror(errno) << ")");
+                       y2err("fsetfilecon on " << fullname() << "/" << name << 
" failed errno: " << errno <<
+                             " (" << stringerror(errno) << ")");
                        retval = false;
                    }
                }
@@ -683,42 +681,42 @@
            freecon(src_con);
        }
 #endif
+
        return retval;
     }
 
 
     bool
-    SDir::restorecon(const string& name, SelinuxLabelHandle* sh) const
+    SDir::restorecon(const string& name, SelinuxLabelHandle* selabel_handle) 
const
     {
        assert(name.find('/') == string::npos);
        assert(name != "..");
 
        bool retval = true;
-#ifdef ENABLE_SELINUX
-       if (_is_selinux_enabled())
-       {
-           assert(sh);
 
-           struct stat buf;
-           if (stat(name, &buf, AT_SYMLINK_NOFOLLOW))
-           {
-               y2err("Failed to stat " << fullname() << "/" << name);
-               return false;
-           }
+#ifdef ENABLE_SELINUX
+       assert(selabel_handle);
 
-           char* con = sh->selabel_lookup(fullname() + "/" + name, 
buf.st_mode);
-           if (con)
-           {
-               retval = fsetfilecon(name, con);
-           }
-           else
-           {
-               retval = false;
-           }
+       struct stat buf;
+       if (stat(name, &buf, AT_SYMLINK_NOFOLLOW))
+       {
+           y2err("Failed to stat " << fullname() << "/" << name);
+           return false;
+       }
 
-           freecon(con);
+       char* con = selabel_handle->selabel_lookup(fullname() + "/" + name, 
buf.st_mode);
+       if (con)
+       {
+           retval = fsetfilecon(name, con);
+       }
+       else
+       {
+           retval = false;
        }
+
+       freecon(con);
 #endif
+
        return retval;
     }
 
@@ -746,41 +744,41 @@
            freecon(src_con);
        }
 #endif
+
        return retval;
     }
 
 
     bool
-    SDir::restorecon(SelinuxLabelHandle* sh) const
+    SDir::restorecon(SelinuxLabelHandle* selabel_handle) const
     {
        bool retval = true;
-#ifdef ENABLE_SELINUX
-       if (_is_selinux_enabled())
-       {
-           assert(sh);
 
-           struct stat buf;
+#ifdef ENABLE_SELINUX
+       assert(selabel_handle);
 
-           if (stat(&buf))
-           {
-               y2err("Failed to stat " << fullname());
-               return false;
-           }
+       struct stat buf;
 
-           char* con = sh->selabel_lookup(fullname(), buf.st_mode);
-           if (con)
-           {
-               retval = fsetfilecon(con);
-           }
-           else
-           {
-               y2war("can't get proper label for path:" << fullname());
-               retval = false;
-           }
+       if (stat(&buf))
+       {
+           y2err("Failed to stat " << fullname());
+           return false;
+       }
 
-           freecon(con);
+       char* con = selabel_handle->selabel_lookup(fullname(), buf.st_mode);
+       if (con)
+       {
+           retval = fsetfilecon(con);
        }
+       else
+       {
+           y2war("can't get proper label for path:" << fullname());
+           retval = false;
+       }
+
+       freecon(con);
 #endif
+
        return retval;
     }
 
@@ -855,10 +853,11 @@
        dir.fsetfilecon(name, con);
     }
 
+
     void
-    SFile::restorecon(SelinuxLabelHandle* sh) const
+    SFile::restorecon(SelinuxLabelHandle* selabel_handle) const
     {
-       dir.restorecon(name, sh);
+       dir.restorecon(name, selabel_handle);
     }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/FileUtils.h 
new/snapper-0.10.4/snapper/FileUtils.h
--- old/snapper-0.10.4/snapper/FileUtils.h      2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/FileUtils.h      2023-03-27 02:00:00.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2011-2014] Novell, Inc.
- * Copyright (c) 2020 SUSE LLC
+ * Copyright (c) [2020-2023] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -110,8 +110,8 @@
 
        bool fsetfilecon(const string& name, const char* con) const;
        bool fsetfilecon(const char* con) const;
-       bool restorecon(SelinuxLabelHandle* sh) const;
-       bool restorecon(const string& name, SelinuxLabelHandle* sh) const;
+       bool restorecon(SelinuxLabelHandle* selabel_handle) const;
+       bool restorecon(const string& name, SelinuxLabelHandle* selabel_handle) 
const;
 
     private:
 
@@ -147,7 +147,7 @@
        ssize_t getxattr(const char* name, void* value, size_t size) const;
 
        void fsetfilecon(const char* con) const;
-       void restorecon(SelinuxLabelHandle* sh) const;
+       void restorecon(SelinuxLabelHandle* selabel_handle) const;
 
     private:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Lvm.cc 
new/snapper-0.10.4/snapper/Lvm.cc
--- old/snapper-0.10.4/snapper/Lvm.cc   2023-02-23 11:40:43.000000000 +0100
+++ new/snapper-0.10.4/snapper/Lvm.cc   2023-03-27 02:00:00.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2011-2014] Novell, Inc.
- * Copyright (c) [2020-2022] SUSE LLC
+ * Copyright (c) [2020-2023] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -23,10 +23,10 @@
 
 #include "config.h"
 
-#include <string.h>
+#include <cstring>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <errno.h>
+#include <cerrno>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
@@ -69,7 +69,7 @@
     Lvm::Lvm(const string& subvolume, const string& root_prefix, const string& 
mount_type)
        : Filesystem(subvolume, root_prefix), mount_type(mount_type),
          caps(LvmCapabilities::get_lvm_capabilities()),
-         cache(LvmCache::get_lvm_cache()), sh(NULL)
+         cache(LvmCache::get_lvm_cache())
     {
        if (access(LVCREATEBIN, X_OK) != 0)
        {
@@ -104,18 +104,6 @@
            mount_options.push_back("nouuid");
            mount_options.push_back("norecovery");
        }
-
-#ifdef ENABLE_SELINUX
-       try
-       {
-           sh = SelinuxLabelHandle::get_selinux_handle();
-       }
-       catch (const SelinuxException& e)
-       {
-           SN_RETHROW(e);
-       }
-#endif
-
     }
 
 
@@ -140,7 +128,7 @@
 #ifdef ENABLE_SELINUX
        if (_is_selinux_enabled())
        {
-           assert(sh);
+           SelinuxLabelHandle* selabel_handle = 
SelinuxLabelHandle::get_selinux_handle();
 
            char* con = NULL;
 
@@ -148,7 +136,7 @@
            {
                string path(subvolume_dir.fullname() + "/.snapshots");
 
-               con = sh->selabel_lookup(path, mode);
+               con = selabel_handle->selabel_lookup(path, mode);
                if (con)
                {
                    // race free mkdir with correct Selinux context preset
@@ -184,6 +172,7 @@
            }
        }
 #endif
+
        createLvmConfig(subvolume_dir, mode);
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Lvm.h 
new/snapper-0.10.4/snapper/Lvm.h
--- old/snapper-0.10.4/snapper/Lvm.h    2023-02-23 11:40:43.000000000 +0100
+++ new/snapper-0.10.4/snapper/Lvm.h    2023-03-27 02:00:00.000000000 +0200
@@ -74,7 +74,6 @@
        bool time_support = false;
     };
 
-    class SelinuxLabelHandle;
 
     class Lvm : public Filesystem
     {
@@ -115,7 +114,6 @@
        const string mount_type;
        const LvmCapabilities* caps;
        LvmCache* cache;
-       SelinuxLabelHandle* sh;
 
        bool detectThinVolumeNames(const MtabData& mtab_data);
        void activateSnapshot(const string& vg_name, const string& lv_name) 
const;
@@ -134,5 +132,4 @@
 
 }
 
-
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Makefile.am 
new/snapper-0.10.4/snapper/Makefile.am
--- old/snapper-0.10.4/snapper/Makefile.am      2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/Makefile.am      2023-03-27 02:00:00.000000000 
+0200
@@ -32,7 +32,6 @@
        SnapperDefines.h                                \
        Version.h
 
-
 if ENABLE_BTRFS
 libsnapper_la_SOURCES +=                               \
        Btrfs.cc                Btrfs.h                 \
@@ -71,6 +70,9 @@
 libsnapper_la_CPPFLAGS += $(LIBBTRFSUTIL_CFLAGS)
 libsnapper_la_LIBADD += $(LIBBTRFSUTIL_LIBS)
 endif
+if ENABLE_SELINUX
+libsnapper_la_LIBADD += -lselinux
+endif
 
 pkgincludedir = $(includedir)/snapper
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Makefile.in 
new/snapper-0.10.4/snapper/Makefile.in
--- old/snapper-0.10.4/snapper/Makefile.in      2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/Makefile.in      2023-03-27 02:00:00.000000000 
+0200
@@ -113,6 +113,7 @@
 @ENABLE_ROLLBACK_TRUE@am__append_6 = -lmount
 @ENABLE_BTRFS_TRUE@am__append_7 = $(LIBBTRFSUTIL_CFLAGS)
 @ENABLE_BTRFS_TRUE@am__append_8 = $(LIBBTRFSUTIL_LIBS)
+@ENABLE_SELINUX_TRUE@am__append_9 = -lselinux
 subdir = snapper
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -157,7 +158,7 @@
 @ENABLE_BTRFS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
 libsnapper_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
        $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-       $(am__DEPENDENCIES_2)
+       $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
 am__libsnapper_la_SOURCES_DIST = Snapper.cc Snapper.h Snapshot.cc \
        Snapshot.h Comparison.cc Comparison.h ComparisonImpl.cc \
        ComparisonImpl.h Filesystem.cc Filesystem.h File.cc File.h \
@@ -479,7 +480,8 @@
 libsnapper_la_CPPFLAGS = $(XML2_CFLAGS) $(ZLIB_CFLAGS) $(am__append_7)
 libsnapper_la_LDFLAGS = -version-info @LIBVERSION_INFO@
 libsnapper_la_LIBADD = -lboost_thread -lboost_system $(XML2_LIBS) \
-       -lacl $(ZLIB_LIBS) $(am__append_6) $(am__append_8)
+       -lacl $(ZLIB_LIBS) $(am__append_6) $(am__append_8) \
+       $(am__append_9)
 pkginclude_HEADERS = \
        Version.h                                       \
        Snapper.h                                       \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Selinux.cc 
new/snapper-0.10.4/snapper/Selinux.cc
--- old/snapper-0.10.4/snapper/Selinux.cc       2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/Selinux.cc       2023-03-27 02:00:00.000000000 
+0200
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) [2016] Red Hat, Inc.
+ * Copyright (c) 2023 SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -21,7 +22,6 @@
 
 #include <cerrno>
 #include <map>
-
 #include <boost/algorithm/string.hpp>
 
 #include "snapper/AppUtil.h"
@@ -121,7 +121,7 @@
        else
        {
            if (errno == ENOENT)
-               y2deb("Selinux context not defined for path " << path);
+               y2deb("SELinux context not defined for path " << path);
 
            return NULL;
        }
@@ -131,13 +131,14 @@
     bool
     _is_selinux_enabled()
     {
-       static bool selinux_enabled, selinux_checked = false;
+       static bool selinux_enabled = false;
+       static bool selinux_checked = false;
 
        if (!selinux_checked)
        {
            selinux_enabled = (is_selinux_enabled() == 1); // may return -1 on 
error
            selinux_checked = true;
-           y2mil("Selinux support " << (selinux_enabled ? "en" : "dis") << 
"abled");
+           y2mil("SELinux support " << (selinux_enabled ? "enabled" : 
"disabled"));
        }
 
        return selinux_enabled;
@@ -147,13 +148,9 @@
     SelinuxLabelHandle*
     SelinuxLabelHandle::get_selinux_handle()
     {
-       if (_is_selinux_enabled())
-       {
-           static SelinuxLabelHandle handle;
-           return &handle;
-       }
+       static SelinuxLabelHandle handle;
 
-       return NULL;
+       return &handle;
     }
 
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Selinux.h 
new/snapper-0.10.4/snapper/Selinux.h
--- old/snapper-0.10.4/snapper/Selinux.h        2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/Selinux.h        2023-03-27 02:00:00.000000000 
+0200
@@ -69,14 +69,18 @@
     class SelinuxLabelHandle : public boost::noncopyable
     {
     public:
+
+       /**
+        * Will most likely throw if SELinux is not enabled.
+        */
        static SelinuxLabelHandle* get_selinux_handle();
 
        char* selabel_lookup(const string& path, int mode);
 
-       ~SelinuxLabelHandle() { selabel_close(handle); }
-
     private:
+
        SelinuxLabelHandle();
+       ~SelinuxLabelHandle() { selabel_close(handle); }
 
        struct selabel_handle* handle;
     };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Snapper.cc 
new/snapper-0.10.4/snapper/Snapper.cc
--- old/snapper-0.10.4/snapper/Snapper.cc       2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/Snapper.cc       2023-03-27 02:00:00.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) [2016-2022] SUSE LLC
+ * Copyright (c) [2016-2023] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -26,7 +26,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <glob.h>
-#include <string.h>
+#include <cstring>
 #include <mntent.h>
 #include <sys/acl.h>
 #include <acl/libacl.h>
@@ -96,17 +96,6 @@
        y2mil("libsnapper version " VERSION);
        y2mil("config_name:" << config_name << " disable_filters:" << 
disable_filters);
 
-#ifdef ENABLE_SELINUX
-       try
-       {
-           selabel_handle = SelinuxLabelHandle::get_selinux_handle();
-       }
-       catch (const SelinuxException& e)
-       {
-           SN_RETHROW(e);
-       }
-#endif
-
        try
        {
            config_info = new ConfigInfo(config_name, root_prefix);
@@ -120,8 +109,15 @@
 
        filesystem = Filesystem::create(*config_info, root_prefix);
 
-       // With btrfs backend, it's useless try syncing snapshot RO subvolumes
-       syncSelinuxContexts(filesystem->fstype() == "btrfs");
+#ifdef ENABLE_SELINUX
+       if (_is_selinux_enabled())
+       {
+           SelinuxLabelHandle* selabel_handle = 
SelinuxLabelHandle::get_selinux_handle();
+
+           // With btrfs backend, it's useless try syncing snapshot RO 
subvolumes
+           syncSelinuxContexts(selabel_handle, filesystem->fstype() == 
"btrfs");
+       }
+#endif
 
        bool sync_acl;
        if (config_info->get_value(KEY_SYNC_ACL, sync_acl) && sync_acl == true)
@@ -924,7 +920,7 @@
 
 
     void
-    Snapper::syncSelinuxContexts(bool skip_snapshot_dir) const
+    Snapper::syncSelinuxContexts(SelinuxLabelHandle* selabel_handle, bool 
skip_snapshot_dir) const
     {
 #ifdef ENABLE_SELINUX
        try
@@ -934,14 +930,14 @@
 
            if (infos_dir.restorecon(selabel_handle))
            {
-               syncSelinuxContextsInInfosDir(skip_snapshot_dir);
+               syncSelinuxContextsInInfosDir(selabel_handle, 
skip_snapshot_dir);
            }
            else
            {
                SnapperContexts scons;
 
                if (infos_dir.fsetfilecon(scons.subvolume_context()))
-                   syncSelinuxContextsInInfosDir(skip_snapshot_dir);
+                   syncSelinuxContextsInInfosDir(selabel_handle, 
skip_snapshot_dir);
            }
        }
        catch (const SelinuxException& e)
@@ -954,7 +950,7 @@
 
 
     void
-    Snapper::syncSelinuxContextsInInfosDir(bool skip_snapshot_dir) const
+    Snapper::syncSelinuxContextsInInfosDir(SelinuxLabelHandle* selabel_handle, 
bool skip_snapshot_dir) const
     {
 #ifdef ENABLE_SELINUX
        static const regex rx("[0-9]+", regex::extended);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Snapper.h 
new/snapper-0.10.4/snapper/Snapper.h
--- old/snapper-0.10.4/snapper/Snapper.h        2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/Snapper.h        2023-03-27 02:00:00.000000000 
+0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) [2016-2022] SUSE LLC
+ * Copyright (c) [2016-2023] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -206,8 +206,9 @@
 
        void syncAcl(const vector<uid_t>& uids, const vector<gid_t>& gids) 
const;
 
-       void syncSelinuxContexts(bool skip_snapshot_dir) const;
-       void syncSelinuxContextsInInfosDir(bool skip_snapshot_dir) const;
+       void syncSelinuxContexts(SelinuxLabelHandle* selabel_handle, bool 
skip_snapshot_dir) const;
+       void syncSelinuxContextsInInfosDir(SelinuxLabelHandle* selabel_handle, 
bool skip_snapshot_dir) const;
+
        void syncInfoDir(SDir& dir) const;
 
        ConfigInfo* config_info = nullptr;
@@ -218,7 +219,7 @@
 
        Snapshots snapshots;
 
-       SelinuxLabelHandle* selabel_handle = nullptr;
+       SelinuxLabelHandle* selabel_handle_unused = nullptr; // TODO remove
 
     };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper/Version.h 
new/snapper-0.10.4/snapper/Version.h
--- old/snapper-0.10.4/snapper/Version.h        2023-02-23 11:40:43.000000000 
+0100
+++ new/snapper-0.10.4/snapper/Version.h        2023-03-27 02:00:00.000000000 
+0200
@@ -26,7 +26,7 @@
 
 #define LIBSNAPPER_MAJOR="6"
 #define LIBSNAPPER_MINOR="2"
-#define LIBSNAPPER_PATCHLEVEL="1"
+#define LIBSNAPPER_PATCHLEVEL="2"
 
 #define LIBSNAPPER_VERSION ( LIBSNAPPER_MAJOR * 10000 + \\
                             LIBSNAPPER_MINOR * 100 + \\
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/snapper-0.10.4/snapper.spec.in 
new/snapper-0.10.4/snapper.spec.in
--- old/snapper-0.10.4/snapper.spec.in  2023-02-23 11:40:43.000000000 +0100
+++ new/snapper-0.10.4/snapper.spec.in  2023-03-27 02:00:00.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package snapper
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -28,6 +28,9 @@
 %define pam_security_dir /%{_lib}/security
 %endif
 
+# Optionally build without SELinux support
+%bcond_without selinux
+
 # Optionally build with test coverage reporting
 %bcond_with coverage
 
@@ -95,10 +98,12 @@
 BuildRequires:  pam-devel
 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} || 
0%{?scientificlinux_version}
 BuildRequires:  json-c-devel
-BuildRequires:  libselinux-devel
 %else
 BuildRequires:  libjson-c-devel
 %endif
+%if %{with selinux}
+BuildRequires:  libselinux-devel
+%endif
 BuildRequires:  zlib-devel
 %if %{with coverage}
 BuildRequires:  lcov
@@ -131,17 +136,13 @@
 autoreconf -fvi
 %configure \
        --docdir="%{_defaultdocdir}/snapper"                                    
\
-%if %{with coverage}
-       --enable-coverage \
-%endif
+       %{?with_coverage:--enable-coverage}                                     
\
        --with-pam-security="%{pam_security_dir}"                               
\
 %if ! 0%{?suse_version}
        --disable-rollback                                                      
\
        --disable-btrfs-quota                                                   
\
 %endif
-%if 0%{?fedora_version} || 0%{?rhel_version}
-       --enable-selinux                                                        
\
-%endif
+       %{?with_selinux:--enable-selinux}                                       
\
        --disable-silent-rules --disable-ext4
 make %{?_smp_mflags}
 

++++++ snapper-Debian_10.0.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.799103026 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.799103026 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-Debian_11.0.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.819103120 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.819103120 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-Debian_Unstable.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.835103194 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.839103214 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_18.04.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.875103382 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.879103401 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_18.10.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.895103476 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.899103495 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_19.04.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.915103570 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.919103589 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_19.10.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.935103665 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.939103683 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_20.04.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.955103759 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.959103777 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_20.10.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.975103853 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.979103871 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_21.04.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:56.995103946 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:56.999103965 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_21.10.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:57.015104040 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:57.019104059 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_22.04.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:57.035104134 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:57.039104153 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

++++++ snapper-xUbuntu_22.10.dsc ++++++
--- /var/tmp/diff_new_pack.VBOCrB/_old  2023-03-29 23:25:57.055104228 +0200
+++ /var/tmp/diff_new_pack.VBOCrB/_new  2023-03-29 23:25:57.059104246 +0200
@@ -11,5 +11,5 @@
 #  423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz
 #
 Files:
-dfdaf63f4d8ec6f1dc25aaac99cbf667 672300 snapper-0.10.4.tar.bz2
+f240ccd20f60cc7c90c5c00507e80235 671913 snapper-0.10.4.tar.bz2
 

Reply via email to