Get root before unmounting things on Linux.
authorCarl Hetherington <cth@carlh.net>
Wed, 21 Apr 2021 23:39:47 +0000 (01:39 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 22 Apr 2021 13:42:11 +0000 (15:42 +0200)
src/lib/cross_linux.cc

index 8ce72d6fce3f38798dab4f10a25bc06d458b2d68..510bce8c3df4e141ed3c0e8c113c5a8e0a4d7719 100644 (file)
@@ -356,6 +356,7 @@ bool
 Drive::unmount ()
 {
        for (auto i: _mount_points) {
 Drive::unmount ()
 {
        for (auto i: _mount_points) {
+               PrivilegeEscalator esc;
                int const r = umount(i.string().c_str());
                LOG_DISK("Tried to unmount %1 and got %2 and %3", i.string(), r, errno);
                if (r == -1) {
                int const r = umount(i.string().c_str());
                LOG_DISK("Tried to unmount %1 and got %2 and %3", i.string(), r, errno);
                if (r == -1) {