yum-plugin-fs-snapshot broken for me

Maxim Burgerhout <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
Hi list,

After I installed a fresh F13 on my laptop, I toyed a bit with the new
yum-plugin-fs-snapshot. Which is pretty cool, let's say that first.

It had a slight problem with my setup though. I use sudo for most
administrative tasks, so I recycled my old sudoers file from F12 (it's
probably older :-). This broke the plugin. Apparently, the new sudoers
file from F13 sets secure_path, which my sudoers do not. This is also
the default setting, according to the manpage. The result was the
plugin throwing an exception about not being able to find btrfsctl.

If the path to btrfsctl would be hard-coded in fs-snapshot.py, the
plugin would not be dependant on a correctly set $PATH or a correct
(i.e. expected) sudoers configuration. I discussed this in #yum with
geppetto and neither of us saw problems with hardcoding the path to
btrfsctl in fs-snapshot.py. The chances of it moving out of /sbin are
extremely small.

So, attached patch: hard-code the path to btrfsctl in fs-snapshot.py.

Regards,

Maxim Burgerhout
[email protected]
----------------
GPG Fingerprint
EB11 5E56 E648 9D99 E8EF 05FB C513 6FD4 1302 B48A

_______________________________________________
Yum mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum
fs-snapshot.patch (application/octet-stream, 834 B)
diff -up /usr/lib/yum-plugins/fs-snapshot.py.orig /usr/lib/yum-plugins/fs-snapshot.py
--- /usr/lib/yum-plugins/fs-snapshot.py.orig	2010-04-20 20:52:22.028254935 +0200
+++ /usr/lib/yum-plugins/fs-snapshot.py	2010-04-20 20:52:05.940254588 +0200
@@ -201,11 +201,11 @@ def _create_btrfs_snapshot(conduit, snap
 
     snapname = mntpnt + snapshot_tag
     conduit.info(1, "fs-snapshot: snapshotting " + mntpnt + ": " + snapname)
-    p = Popen(["btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE)
+    p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE)
     err = p.wait()
     if err:
         return 1
-    p = Popen(["btrfsctl", "-s", snapname, mntpnt], stdout=PIPE, stderr=PIPE)
+    p = Popen(["/sbin/btrfsctl", "-s", snapname, mntpnt], stdout=PIPE, stderr=PIPE)
     err = p.wait()
     if err:
         return 1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.