Hello community, here is the log from the commit of package snapper for openSUSE:Factory checked in at 2016-08-18 10:18:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/snapper (Old) and /work/SRC/openSUSE:Factory/.snapper.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "snapper" Changes: -------- --- /work/SRC/openSUSE:Factory/snapper/snapper.changes 2016-08-10 19:54:08.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.snapper.new/snapper.changes 2016-08-18 10:18:59.000000000 +0200 @@ -1,0 +2,12 @@ +Tue Aug 09 21:53:02 CEST 2016 - aschn...@suse.com + +- merged patch to fix order of object destruction on shutdown + (gh#openSUSE/snapper#258) + +------------------------------------------------------------------- +Mon Aug 08 14:40:32 CEST 2016 - aschn...@suse.com + +- better messages for some btrfs quota errors + (gh#openSUSE/snapper#257) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ snapper-0.3.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/client/cleanup.cc new/snapper-0.3.3/client/cleanup.cc --- old/snapper-0.3.3/client/cleanup.cc 2016-04-06 17:03:34.000000000 +0200 +++ new/snapper-0.3.3/client/cleanup.cc 2016-08-08 14:58:00.000000000 +0200 @@ -189,7 +189,7 @@ if (strcmp(e.name(), "error.quota") == 0) { - cerr << "quota not working" << endl; + cerr << "quota not working (" << e.message() << ")" << endl; return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/client/installation-helper.cc new/snapper-0.3.3/client/installation-helper.cc --- old/snapper-0.3.3/client/installation-helper.cc 2015-06-29 14:59:43.000000000 +0200 +++ new/snapper-0.3.3/client/installation-helper.cc 2016-08-08 14:58:00.000000000 +0200 @@ -197,6 +197,7 @@ cout << "done" << endl; } + bool step5(const string& root_prefix, const string& snapshot_type, unsigned int pre_num, const string& description, const string& cleanup, const map<string, string>& userdata) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/doc/Makefile.am new/snapper-0.3.3/doc/Makefile.am --- old/snapper-0.3.3/doc/Makefile.am 2015-09-22 16:35:12.000000000 +0200 +++ new/snapper-0.3.3/doc/Makefile.am 2016-08-02 17:31:43.000000000 +0200 @@ -27,7 +27,8 @@ .xml.html: .xml $(XSLTPROC) --nonet html.xsl $< > $@ -EXTRA_DIST = dbus-protocol.txt manpages.xsl html.xsl +EXTRA_DIST = dbus-protocol.txt manpages.xsl html.xsl selinux-readme.txt + clean-local: rm -f *.{5,8} *.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/doc/Makefile.in new/snapper-0.3.3/doc/Makefile.in --- old/snapper-0.3.3/doc/Makefile.in 2016-08-02 13:35:20.000000000 +0200 +++ new/snapper-0.3.3/doc/Makefile.in 2016-08-10 20:12:59.000000000 +0200 @@ -309,7 +309,7 @@ top_srcdir = @top_srcdir@ man_MANS = snapper.8 snapperd.8 snapper-configs.5 $(am__append_1) \ $(am__append_2) $(am__append_3) -EXTRA_DIST = dbus-protocol.txt manpages.xsl html.xsl +EXTRA_DIST = dbus-protocol.txt manpages.xsl html.xsl selinux-readme.txt all: all-am .SUFFIXES: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/doc/selinux-readme.txt new/snapper-0.3.3/doc/selinux-readme.txt --- old/snapper-0.3.3/doc/selinux-readme.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/snapper-0.3.3/doc/selinux-readme.txt 2016-08-02 17:04:58.000000000 +0200 @@ -0,0 +1,24 @@ +Any distribution interested in enabling selinux support in snapper should be aware +of following requirements to be able to run snapper in confined environment +properly. + +The snapper with enabled selinux support requires following symbol provided by +distributed libselinux package: selinux_snapperd_contexts_path. The symbol is +available in libselinux upstream [1] since commit "b2c1b0baaf52" which should +land in libselinux version 2.6 and higher. + +Also distribution is expected to install a file located on a path acquired via the +call above. Usually the file is packaged together with selinux-policy. Currently +the minimal required file content is as follows: + +snapperd_data = system_u:object_r:snapperd_data_t:s0 + +Content description: + +a) the selinux context referenced by key 'snapperd_data' is used to label all +snapper metadata stored in (including) /mnt/dir/.snapshots subvolume or directory. + +Keep this file up to date whenever requirements on a selinux enabled snapper gets +changed! + +[1] https://github.com/SELinuxProject/selinux diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/server/Background.cc new/snapper-0.3.3/server/Background.cc --- old/snapper-0.3.3/server/Background.cc 2014-01-29 16:48:30.000000000 +0100 +++ new/snapper-0.3.3/server/Background.cc 2016-08-09 21:50:44.000000000 +0200 @@ -31,9 +31,6 @@ #include "Background.h" -Backgrounds backgrounds; - - Backgrounds::Backgrounds() { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/server/Background.h new/snapper-0.3.3/server/Background.h --- old/snapper-0.3.3/server/Background.h 2014-01-29 16:48:30.000000000 +0100 +++ new/snapper-0.3.3/server/Background.h 2016-08-09 21:50:44.000000000 +0200 @@ -75,7 +75,4 @@ }; -extern Backgrounds backgrounds; - - #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/server/Client.cc new/snapper-0.3.3/server/Client.cc --- old/snapper-0.3.3/server/Client.cc 2016-03-31 17:52:56.000000000 +0200 +++ new/snapper-0.3.3/server/Client.cc 2016-08-09 21:50:44.000000000 +0200 @@ -37,11 +37,9 @@ boost::shared_mutex big_mutex; -Clients clients; - -Client::Client(const string& name) - : name(name), zombie(false) +Client::Client(const string& name, const Clients& clients) + : name(name), zombie(false), clients(clients) { } @@ -1027,7 +1025,7 @@ bool background_comparison = true; it->getConfigInfo().getValue("BACKGROUND_COMPARISON", background_comparison); if (background_comparison) - backgrounds.add_task(it, snap1, snap2); + clients.backgrounds().add_task(it, snap1, snap2); DBus::MessageMethodReturn reply(msg); @@ -1431,7 +1429,7 @@ } hoho << "backgrounds:"; - for (Backgrounds::const_iterator it = backgrounds.begin(); it != backgrounds.end(); ++it) + for (Backgrounds::const_iterator it = clients.backgrounds().begin(); it != clients.backgrounds().end(); ++it) { std::ostringstream s; s << " name:'" << it->meta_snapper->configName() << "'"; @@ -1726,6 +1724,19 @@ } +Clients::Clients(Backgrounds& backgrounds) + : bgs(backgrounds) +{ +} + + +Backgrounds& +Clients::backgrounds() const +{ + return bgs; +} + + Clients::iterator Clients::find(const string& name) { @@ -1742,7 +1753,7 @@ { assert(find(name) == entries.end()); - entries.emplace_back(name); + entries.emplace_back(name, *this); return --entries.end(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/server/Client.h new/snapper-0.3.3/server/Client.h --- old/snapper-0.3.3/server/Client.h 2016-03-31 17:52:56.000000000 +0200 +++ new/snapper-0.3.3/server/Client.h 2016-08-09 21:50:44.000000000 +0200 @@ -51,6 +51,9 @@ extern boost::shared_mutex big_mutex; +class Backgrounds; +class Clients; + struct NoComparison : Exception { @@ -112,7 +115,7 @@ void dispatch(DBus::Connection& conn, DBus::Message& msg); - Client(const string& name); + Client(const string& name, const Clients& clients); ~Client(); list<Comparison*>::iterator find_comparison(Snapper* snapper, unsigned int number1, @@ -160,12 +163,15 @@ void worker(); + const Clients& clients; + }; class Clients { public: + Clients(Backgrounds& backgrounds); typedef list<Client>::iterator iterator; typedef list<Client>::const_iterator const_iterator; @@ -185,14 +191,15 @@ bool has_zombies() const; + Backgrounds& backgrounds() const; + private: list<Client> entries; -}; - + Backgrounds& bgs; -extern Clients clients; +}; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/server/snapperd.cc new/snapper-0.3.3/server/snapperd.cc --- old/snapper-0.3.3/server/snapperd.cc 2015-01-27 14:25:38.000000000 +0100 +++ new/snapper-0.3.3/server/snapperd.cc 2016-08-09 21:50:44.000000000 +0200 @@ -57,11 +57,16 @@ void periodic(); milliseconds periodic_timeout(); +private: + + Backgrounds backgrounds; + Clients clients; + }; MyMainLoop::MyMainLoop(DBusBusType type) - : MainLoop(type) + : MainLoop(type), backgrounds(), clients(backgrounds) { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/snapper-0.3.3/snapper/Snapper.cc new/snapper-0.3.3/snapper/Snapper.cc --- old/snapper-0.3.3/snapper/Snapper.cc 2016-08-02 13:30:41.000000000 +0200 +++ new/snapper-0.3.3/snapper/Snapper.cc 2016-08-08 14:58:00.000000000 +0200 @@ -696,33 +696,38 @@ SDir subvolume_dir = openSubvolumeDir(); - vector<qgroup_t> children = qgroup_query_children(subvolume_dir.fd(), btrfs->getQGroup()); - sort(children.begin(), children.end()); + try + { + vector<qgroup_t> children = qgroup_query_children(subvolume_dir.fd(), btrfs->getQGroup()); + sort(children.begin(), children.end()); - // Iterate all snapshot and ensure that those and only those with a - // cleanup algorithm are included in the high level qgroup. + // Iterate all snapshot and ensure that those and only those with a + // cleanup algorithm are included in the high level qgroup. - for (const Snapshot& snapshot : snapshots) - { - if (snapshot.isCurrent()) - continue; + for (const Snapshot& snapshot : snapshots) + { + if (snapshot.isCurrent()) + continue; - subvolid_t subvolid = get_id(snapshot.openSnapshotDir().fd()); - qgroup_t qgroup = calc_qgroup(0, subvolid); + subvolid_t subvolid = get_id(snapshot.openSnapshotDir().fd()); + qgroup_t qgroup = calc_qgroup(0, subvolid); - bool included = binary_search(children.begin(), children.end(), qgroup); + bool included = binary_search(children.begin(), children.end(), qgroup); - if (!snapshot.getCleanup().empty() && !included) - { - qgroup_assign(subvolume_dir.fd(), qgroup, btrfs->getQGroup()); - } - else if (snapshot.getCleanup().empty() && included) - { - qgroup_remove(subvolume_dir.fd(), qgroup, btrfs->getQGroup()); + if (!snapshot.getCleanup().empty() && !included) + { + qgroup_assign(subvolume_dir.fd(), qgroup, btrfs->getQGroup()); + } + else if (snapshot.getCleanup().empty() && included) + { + qgroup_remove(subvolume_dir.fd(), qgroup, btrfs->getQGroup()); + } } } - - quota_rescan(subvolume_dir.fd()); + catch (const runtime_error& e) + { + SN_THROW(QuotaException("preparing quota failed")); + } #else