mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone
Blob Blame History Raw
From 2d9866c3d979a54da7a1abd0e8d611890a41212c Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Fri, 24 Oct 2014 16:33:50 +0100
Subject: [PATCH] RHEL 8: Disable alternate Augeas lenses.

These are included in the RHEL augeas package, and therefore not
required.

See:
https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html
---
 appliance/Makefile.am | 1 -
 daemon/augeas.c       | 5 ++++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/appliance/Makefile.am b/appliance/Makefile.am
index 6cba8d158..16714b197 100644
--- a/appliance/Makefile.am
+++ b/appliance/Makefile.am
@@ -91,7 +91,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_shadow.aug
 	rm -rf tmp-d
 	mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs
 	ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
-	ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug
 	( cd tmp-d && tar zcf - * ) > $@-t
 	rm -r tmp-d
 	mv $@-t $@
diff --git a/daemon/augeas.c b/daemon/augeas.c
index 453251337..5bbfffa2d 100644
--- a/daemon/augeas.c
+++ b/daemon/augeas.c
@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags)
   }
 
   /* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */
-  aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE);
+  aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE);
 
   if (!aug) {
     reply_with_error ("augeas initialization failed");
@@ -148,6 +148,8 @@ do_aug_init (const char *root, int flags)
     return -1;
   }
 
+  /* We already have the needed lenses in RHEL 8 */
+#if 0
   if (!augeas_is_version (1, 2, 1)) {
     int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow",
                            0 /* = included */);
@@ -166,6 +168,7 @@ do_aug_init (const char *root, int flags)
       }
     }
   }
+#endif
 
   return 0;
 }
-- 
2.20.1