mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0071-RHEL-8-Disable-alternate-Augeas-lenses.patch

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