|
|
90a56e |
From 08a8b9cf677d1c21890e14fcb34f49bf0800e912 Mon Sep 17 00:00:00 2001
|
|
|
0d20ef |
From: Pino Toscano <ptoscano@redhat.com>
|
|
|
0d20ef |
Date: Fri, 24 Oct 2014 16:33:50 +0100
|
|
|
0d20ef |
Subject: [PATCH] RHEL 7: Disable alternate Augeas lenses.
|
|
|
0d20ef |
|
|
|
0d20ef |
These are included in the RHEL 7.1 augeas package, and therefore
|
|
|
0d20ef |
not required in RHEL.
|
|
|
0d20ef |
|
|
|
0d20ef |
See:
|
|
|
0d20ef |
https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html
|
|
|
0d20ef |
---
|
|
|
0d20ef |
appliance/Makefile.am | 2 --
|
|
|
0d20ef |
daemon/augeas.c | 5 ++++-
|
|
|
0d20ef |
daemon/lvm-filter.c | 4 ++--
|
|
|
0d20ef |
3 files changed, 6 insertions(+), 5 deletions(-)
|
|
|
0d20ef |
|
|
|
0d20ef |
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
|
|
|
46ce2f |
index 05b9d42e9..1e142cbd0 100644
|
|
|
0d20ef |
--- a/appliance/Makefile.am
|
|
|
0d20ef |
+++ b/appliance/Makefile.am
|
|
|
90a56e |
@@ -92,8 +92,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_lvm_conf.aug guestfs_shadow
|
|
|
e76f14 |
rm -rf tmp-d
|
|
|
0d20ef |
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs
|
|
|
0d20ef |
ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
|
|
|
0d20ef |
- ln $(srcdir)/guestfs_lvm_conf.aug tmp-d/usr/share/guestfs/guestfs_lvm_conf.aug
|
|
|
0d20ef |
- ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug
|
|
|
0d20ef |
( cd tmp-d && tar zcf - * ) > $@-t
|
|
|
0d20ef |
rm -r tmp-d
|
|
|
0d20ef |
mv $@-t $@
|
|
|
0d20ef |
diff --git a/daemon/augeas.c b/daemon/augeas.c
|
|
|
46ce2f |
index 5adc959a5..dc5266ee4 100644
|
|
|
0d20ef |
--- a/daemon/augeas.c
|
|
|
0d20ef |
+++ b/daemon/augeas.c
|
|
|
0d20ef |
@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags)
|
|
|
0d20ef |
}
|
|
|
0d20ef |
|
|
|
0d20ef |
/* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */
|
|
|
0d20ef |
- aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE);
|
|
|
0d20ef |
+ aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE);
|
|
|
0d20ef |
|
|
|
0d20ef |
if (!aug) {
|
|
|
0d20ef |
reply_with_error ("augeas initialization failed");
|
|
|
0d20ef |
@@ -148,6 +148,8 @@ do_aug_init (const char *root, int flags)
|
|
|
0d20ef |
return -1;
|
|
|
0d20ef |
}
|
|
|
0d20ef |
|
|
|
0d20ef |
+ /* We already have the needed lenses in RHEL 7 */
|
|
|
0d20ef |
+#if 0
|
|
|
0d20ef |
if (!augeas_is_version (1, 2, 1)) {
|
|
|
0d20ef |
int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow",
|
|
|
0d20ef |
0 /* = included */);
|
|
|
0d20ef |
@@ -166,6 +168,7 @@ do_aug_init (const char *root, int flags)
|
|
|
0d20ef |
}
|
|
|
0d20ef |
}
|
|
|
0d20ef |
}
|
|
|
0d20ef |
+#endif
|
|
|
0d20ef |
|
|
|
0d20ef |
return 0;
|
|
|
0d20ef |
}
|
|
|
0d20ef |
diff --git a/daemon/lvm-filter.c b/daemon/lvm-filter.c
|
|
|
46ce2f |
index 5c9ce1866..bd32626e6 100644
|
|
|
0d20ef |
--- a/daemon/lvm-filter.c
|
|
|
0d20ef |
+++ b/daemon/lvm-filter.c
|
|
|
90a56e |
@@ -140,7 +140,7 @@ set_filter (char *const *filters)
|
|
|
0d20ef |
* but do that only after having applied the transformation.
|
|
|
0d20ef |
*/
|
|
|
0d20ef |
const int flags = AUG_NO_ERR_CLOSE | AUG_NO_LOAD;
|
|
|
0d20ef |
- aug = aug_init (lvm_system_dir, "/usr/share/guestfs/", flags);
|
|
|
0d20ef |
+ aug = aug_init (lvm_system_dir, NULL, flags);
|
|
|
0d20ef |
if (!aug) {
|
|
|
0d20ef |
reply_with_error ("augeas initialization failed");
|
|
|
0d20ef |
return -1;
|
|
|
90a56e |
@@ -151,7 +151,7 @@ set_filter (char *const *filters)
|
|
|
0d20ef |
return -1;
|
|
|
0d20ef |
}
|
|
|
0d20ef |
|
|
|
0d20ef |
- r = aug_transform (aug, "guestfs_lvm_conf", "/lvm/lvm.conf",
|
|
|
0d20ef |
+ r = aug_transform (aug, "lvm", "/lvm/lvm.conf",
|
|
|
0d20ef |
0 /* = included */);
|
|
|
0d20ef |
if (r == -1) {
|
|
|
0d20ef |
AUGEAS_ERROR ("aug_transform");
|
|
|
0d20ef |
--
|
|
|
46ce2f |
2.13.4
|
|
|
0d20ef |
|