491457
From 67a5b36a48067002c5f4a101612b717dab010909 Mon Sep 17 00:00:00 2001
4ebc84
From: Pino Toscano <ptoscano@redhat.com>
4ebc84
Date: Fri, 24 Oct 2014 16:33:50 +0100
4ebc84
Subject: [PATCH] RHEL 7: Disable alternate Augeas lenses.
4ebc84
4ebc84
These are included in the RHEL 7.1 augeas package, and therefore
4ebc84
not required in RHEL.
4ebc84
4ebc84
See:
4ebc84
https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html
4ebc84
---
4ebc84
 appliance/Makefile.am | 1 -
4ebc84
 daemon/augeas.c       | 5 ++++-
4ebc84
 2 files changed, 4 insertions(+), 2 deletions(-)
4ebc84
4ebc84
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
4ebc84
index fc424b1d0..5efc5c036 100644
4ebc84
--- a/appliance/Makefile.am
4ebc84
+++ b/appliance/Makefile.am
4ebc84
@@ -91,7 +91,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_shadow.aug
4ebc84
 	rm -rf tmp-d
4ebc84
 	mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs
4ebc84
 	ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
4ebc84
-	ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug
4ebc84
 	( cd tmp-d && tar zcf - * ) > $@-t
4ebc84
 	rm -r tmp-d
4ebc84
 	mv $@-t $@
4ebc84
diff --git a/daemon/augeas.c b/daemon/augeas.c
4ebc84
index 453251337..003fcd313 100644
4ebc84
--- a/daemon/augeas.c
4ebc84
+++ b/daemon/augeas.c
4ebc84
@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags)
4ebc84
   }
4ebc84
 
4ebc84
   /* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */
4ebc84
-  aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE);
4ebc84
+  aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE);
4ebc84
 
4ebc84
   if (!aug) {
4ebc84
     reply_with_error ("augeas initialization failed");
4ebc84
@@ -148,6 +148,8 @@ do_aug_init (const char *root, int flags)
4ebc84
     return -1;
4ebc84
   }
4ebc84
 
4ebc84
+  /* We already have the needed lenses in RHEL 7 */
4ebc84
+#if 0
4ebc84
   if (!augeas_is_version (1, 2, 1)) {
4ebc84
     int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow",
4ebc84
                            0 /* = included */);
4ebc84
@@ -166,6 +168,7 @@ do_aug_init (const char *root, int flags)
4ebc84
       }
4ebc84
     }
4ebc84
   }
4ebc84
+#endif
4ebc84
 
4ebc84
   return 0;
4ebc84
 }
4ebc84
-- 
4ebc84
2.21.0
4ebc84