5c13d3
From 67a5b36a48067002c5f4a101612b717dab010909 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
---
a30de4
 appliance/Makefile.am | 1 -
0d20ef
 daemon/augeas.c       | 5 ++++-
a30de4
 2 files changed, 4 insertions(+), 2 deletions(-)
0d20ef
0d20ef
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
a034fe
index fc424b1d0..5efc5c036 100644
0d20ef
--- a/appliance/Makefile.am
0d20ef
+++ b/appliance/Makefile.am
a30de4
@@ -91,7 +91,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_shadow.aug
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_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
97ae69
index 453251337..003fcd313 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
-- 
a034fe
2.21.0
0d20ef