Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package transactional-update for 
openSUSE:Factory checked in at 2021-11-22 23:03:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/transactional-update (Old)
 and      /work/SRC/openSUSE:Factory/.transactional-update.new.1895 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "transactional-update"

Mon Nov 22 23:03:53 2021 rev:84 rq:932569 version:3.6.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/transactional-update/transactional-update.changes    
    2021-11-12 15:59:48.210579889 +0100
+++ 
/work/SRC/openSUSE:Factory/.transactional-update.new.1895/transactional-update.changes
      2021-11-22 23:04:14.597920107 +0100
@@ -1,0 +2,11 @@
+Fri Nov 19 16:58:21 UTC 2021 - Ignaz Forster <ifors...@suse.com>
+
+- Version 3.6.2
+  - Bind mount root file system snapshot on itself, this makes the
+    temporary directory in /tmp unnecessary; also fixes [boo#1188110]
+    to return the correct snapshot's working directory via API call.
+  - Use separate mount namespace for transactional-update; this should
+    fix several applications that fail to run if a mount point has the
+    'unbindable' mount flag set
+
+-------------------------------------------------------------------
@@ -116 +127 @@
-  - Don't discard manual changes in fstab [boo#1183856]
+  - Don't discard manual changes in fstab [boo#1183856], [bsc#1192302]
@@ -344 +355 @@
-    [boo#1149131] & [boo#1133891]
+    [boo#1149131] & [boo#1133891] & [boo#1192078]

Old:
----
  transactional-update-3.6.1.tar.gz

New:
----
  transactional-update-3.6.2.tar.gz

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

Other differences:
------------------
++++++ transactional-update.spec ++++++
--- /var/tmp/diff_new_pack.xJ5Ikb/_old  2021-11-22 23:04:15.121918349 +0100
+++ /var/tmp/diff_new_pack.xJ5Ikb/_new  2021-11-22 23:04:15.121918349 +0100
@@ -26,7 +26,7 @@
 %{!?_distconfdir: %global _distconfdir %{_prefix}%{_sysconfdir}}
 
 Name:           transactional-update
-Version:        3.6.1
+Version:        3.6.2
 Release:        0
 Summary:        Transactional Updates with btrfs and snapshots
 License:        GPL-2.0-or-later AND LGPL-2.1-or-later

++++++ transactional-update-3.6.1.tar.gz -> transactional-update-3.6.2.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/transactional-update-3.6.1/NEWS 
new/transactional-update-3.6.2/NEWS
--- old/transactional-update-3.6.1/NEWS 2021-11-10 15:50:57.000000000 +0100
+++ new/transactional-update-3.6.2/NEWS 2021-11-19 17:55:13.000000000 +0100
@@ -2,6 +2,14 @@
 
 Copyright (C) 2016-2021 Thorsten Kukuk, Ignaz Forster et al.
 
+Version 3.6.2
+* Bind mount root file system snapshot on itself, this makes the
+  temporary directory in /tmp unnecessary; also fixes [boo#1188110]
+  to return the correct snapshot's working directory via API call.
+* Use separate mount namespace for transactional-update; this should
+  fix several applications that fail to run if a mount point has the
+  'unbindable' mount flag set
+
 Version 3.6.1
 * Fix rsyncing /etc into the running system with --drop-if-no-change
   [bsc#1192242]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/transactional-update-3.6.1/configure.ac 
new/transactional-update-3.6.2/configure.ac
--- old/transactional-update-3.6.1/configure.ac 2021-11-10 15:50:57.000000000 
+0100
+++ new/transactional-update-3.6.2/configure.ac 2021-11-19 17:55:13.000000000 
+0100
@@ -1,9 +1,9 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(transactional-update, 3.6.1)
+AC_INIT(transactional-update, 3.6.2)
 # Increase on any interface change and reset revision
 LIBTOOL_CURRENT=3
 # Increase or reset on any VERSION update
-LIBTOOL_REVISION=6
+LIBTOOL_REVISION=7
 # Increase if interface change is backwards compatible, reset otherwise
 LIBTOOL_AGE=3
 AC_CANONICAL_SYSTEM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/transactional-update-3.6.1/lib/Transaction.cpp 
new/transactional-update-3.6.2/lib/Transaction.cpp
--- old/transactional-update-3.6.1/lib/Transaction.cpp  2021-11-10 
15:50:57.000000000 +0100
+++ new/transactional-update-3.6.2/lib/Transaction.cpp  2021-11-19 
17:55:13.000000000 +0100
@@ -23,6 +23,7 @@
 #include <ftw.h>
 #include <limits.h>
 #include <poll.h>
+#include <sched.h>
 #include <signal.h>
 #include <sys/inotify.h>
 #include <sys/wait.h>
@@ -42,7 +43,6 @@
     static int inotifyAdd(const char *pathname, const struct stat *sbuf, int 
type, struct FTW *ftwb);
     int inotifyRead();
     std::unique_ptr<Snapshot> snapshot;
-    std::string bindDir;
     std::vector<std::unique_ptr<Mount>> dirsToMount;
     Supplements supplements;
     pid_t pidCmd;
@@ -64,13 +64,6 @@
         close(inotifyFd);
 
     pImpl->dirsToMount.clear();
-    if (!pImpl->bindDir.empty()) {
-        try {
-            fs::remove(fs::path{pImpl->bindDir});
-        }  catch (const std::exception &e) {
-            tulog.error("ERROR: ", e.what());
-        }
-    }
     try {
         if (isInitialized() && !getSnapshot().empty() && 
fs::exists(getRoot())) {
             tulog.info("Discarding snapshot ", pImpl->snapshot->getUid(), ".");
@@ -94,11 +87,13 @@
 }
 
 void Transaction::impl::mount() {
+    if (unshare(CLONE_NEWNS) < 0) {
+        throw std::runtime_error{"Creating new mount namespace failed: " + 
std::string(strerror(errno))};
+    }
+
     // GRUB needs to have an actual mount point for the root partition, so
     // mount the snapshot directory on a temporary mount point
-    char bindTemplate[] = "/tmp/transactional-update-XXXXXX";
-    bindDir = mkdtemp(bindTemplate);
-    std::unique_ptr<BindMount> mntBind{new BindMount{bindDir, MS_UNBINDABLE}};
+    std::unique_ptr<BindMount> mntBind{new BindMount{snapshot->getRoot(), 
MS_UNBINDABLE}};
     mntBind->setSource(snapshot->getRoot());
     mntBind->mount();
 
@@ -166,14 +161,14 @@
     dirsToMount.push_back(std::make_unique<BindMount>("/.snapshots"));
 
     for (auto it = dirsToMount.begin(); it != dirsToMount.end(); ++it) {
-        it->get()->mount(bindDir);
+        it->get()->mount(snapshot->getRoot());
     }
 
     dirsToMount.push_back(std::move(mntBind));
 }
 
 void Transaction::impl::addSupplements() {
-    supplements = Supplements(bindDir);
+    supplements = Supplements(snapshot->getRoot());
 
     Mount mntVar{"/var"};
     if (mntVar.isMount()) {
@@ -217,26 +212,26 @@
     std::unique_ptr<Mount> mntEtc{new Mount{"/etc"}};
     if (mntEtc->isMount() && mntEtc->getFilesystem() == "overlay") {
         Overlay overlay = Overlay{pImpl->snapshot->getUid()};
-        overlay.create(base, pImpl->snapshot->getUid(), 
pImpl->snapshot->getRoot());
+        overlay.create(base, pImpl->snapshot->getUid(), getRoot());
         overlay.setMountOptions(mntEtc);
         // Copy current fstab into root in case the user modified it
         if (fs::exists(fs::path{overlay.lowerdirs[0] / "fstab"})) {
-            fs::copy(fs::path{overlay.lowerdirs[0] / "fstab"}, 
fs::path{pImpl->snapshot->getRoot() / "etc"}, 
fs::copy_options::overwrite_existing);
+            fs::copy(fs::path{overlay.lowerdirs[0] / "fstab"}, 
fs::path{getRoot() / "etc"}, fs::copy_options::overwrite_existing);
         }
 
-        mntEtc->persist(pImpl->snapshot->getRoot() / "etc" / "fstab");
+        mntEtc->persist(getRoot() / "etc" / "fstab");
 
         // Make sure both the snapshot and the overlay contain all relevant 
fstab data, i.e.
         // user modifications from the overlay are present in the root fs and 
the /etc
         // overlay is visible in the overlay
-        fs::copy(fs::path{pImpl->snapshot->getRoot() / "etc" / "fstab"}, 
overlay.upperdir, fs::copy_options::overwrite_existing);
+        fs::copy(fs::path{getRoot() / "etc" / "fstab"}, overlay.upperdir, 
fs::copy_options::overwrite_existing);
     }
 
     pImpl->mount();
     pImpl->addSupplements();
     if (pImpl->discardIfNoChange) {
         // Flag file to indicate this snapshot was initialized with discard 
flag
-        std::ofstream output(pImpl->snapshot->getRoot() / "discardIfNoChange");
+        std::ofstream output(getRoot() / "discardIfNoChange");
     }
 }
 
@@ -248,7 +243,7 @@
     }
     pImpl->mount();
     pImpl->addSupplements();
-    if (fs::exists(pImpl->snapshot->getRoot() / "discardIfNoChange")) {
+    if (fs::exists(getRoot() / "discardIfNoChange")) {
         pImpl->discardIfNoChange = true;
     }
 }
@@ -310,11 +305,11 @@
         throw std::runtime_error{"fork() failed: " + 
std::string(strerror(errno))};
     } else if (pid == 0) {
         if (inChroot) {
-            if (chdir(bindDir.c_str()) < 0) {
+            if (chdir(snapshot->getRoot().c_str()) < 0) {
                 tulog.info("Warning: Couldn't set working directory: ", 
std::string(strerror(errno)));
             }
-            if (chroot(bindDir.c_str()) < 0) {
-                throw std::runtime_error{"Chrooting to " + bindDir + " failed: 
" + std::string(strerror(errno))};
+            if (chroot(snapshot->getRoot().c_str()) < 0) {
+                throw std::runtime_error{"Chrooting to " + 
std::string(snapshot->getRoot()) + " failed: " + std::string(strerror(errno))};
             }
         }
         // Set indicator for RPM pre/post sections to detect whether we run in 
a
@@ -351,7 +346,7 @@
 int Transaction::callExt(char* argv[]) {
     for (int i=0; argv[i] != nullptr; i++) {
         if (strcmp(argv[i], "{}") == 0) {
-            char* bindDir = strdup(pImpl->bindDir.c_str());
+            char* bindDir = strdup(getRoot().c_str());
             argv[i] = bindDir;
         }
     }
@@ -370,19 +365,19 @@
     sync();
     if (pImpl->discardIfNoChange &&
             ((inotifyFd != 0 && pImpl->inotifyRead() == 0) ||
-            (inotifyFd == 0 && fs::exists(pImpl->snapshot->getRoot() / 
"discardIfNoChange")))) {
+            (inotifyFd == 0 && fs::exists(getRoot() / "discardIfNoChange")))) {
         tulog.info("No changes to the root file system - discarding 
snapshot.");
 
         // Even if the snapshot itself did not contain any changes, /etc may 
do so. Changes
         // in /etc may be applied immediately, so merge them back into the 
running system.
         std::unique_ptr<Mount> mntEtc{new Mount{"/etc"}};
         if (mntEtc->isMount() && mntEtc->getFilesystem() == "overlay") {
-            Util::exec("rsync --archive --inplace --xattrs --acls --exclude 
'fstab' --delete --quiet '" + pImpl->bindDir + "/etc/' /etc");
+            Util::exec("rsync --archive --inplace --xattrs --acls --exclude 
'fstab' --delete --quiet '" + std::string(getRoot()) + "/etc/' /etc");
         }
         return;
     }
-    if (fs::exists(pImpl->snapshot->getRoot() / "discardIfNoChange")) {
-        fs::remove(pImpl->snapshot->getRoot() / "discardIfNoChange");
+    if (fs::exists(getRoot() / "discardIfNoChange")) {
+        fs::remove(getRoot() / "discardIfNoChange");
     }
 
     // Update /usr timestamp to support system offline update mechanism

Reply via email to