Add upstream patch to fix test error:
nbd_connect_unix: getlogin: No such device or address
This commit is contained in:
parent
f0a39ef385
commit
d14f6f788e
50
0001-lib-Try-LOGNAME-before-using-getlogin_r.patch
Normal file
50
0001-lib-Try-LOGNAME-before-using-getlogin_r.patch
Normal file
@ -0,0 +1,50 @@
|
||||
From e0b30bceab1cf61d8129b874d0122bc2cccec0e9 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 21 Aug 2019 09:57:54 +0100
|
||||
Subject: [PATCH] lib: Try $LOGNAME before using getlogin_r.
|
||||
|
||||
Fixes tests in Koji which failed with
|
||||
nbd_connect_unix: getlogin: No such device or address
|
||||
---
|
||||
lib/crypto.c | 18 ++++++++++++++++--
|
||||
1 file changed, 16 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/crypto.c b/lib/crypto.c
|
||||
index 703bc84..2a59943 100644
|
||||
--- a/lib/crypto.c
|
||||
+++ b/lib/crypto.c
|
||||
@@ -102,7 +102,7 @@ nbd_unlocked_set_tls_username (struct nbd_handle *h, const char *username)
|
||||
char *
|
||||
nbd_unlocked_get_tls_username (struct nbd_handle *h)
|
||||
{
|
||||
- char *ret;
|
||||
+ char *s, *ret;
|
||||
|
||||
if (h->tls_username) {
|
||||
ret = strdup (h->tls_username);
|
||||
@@ -113,7 +113,21 @@ nbd_unlocked_get_tls_username (struct nbd_handle *h)
|
||||
return ret;
|
||||
}
|
||||
|
||||
- /* Otherwise we return the local login name. */
|
||||
+ /* Otherwise we return the local login name. Try $LOGNAME first for
|
||||
+ * two reasons: (1) So the user can override it. (2) Because
|
||||
+ * getlogin fails with ENXIO if there is no controlling terminal
|
||||
+ * (which is often the case in test and embedded environments).
|
||||
+ */
|
||||
+ s = getenv ("LOGNAME");
|
||||
+ if (s) {
|
||||
+ ret = strdup (s);
|
||||
+ if (ret == NULL) {
|
||||
+ set_error (errno, "strdup");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
ret = malloc (L_cuserid);
|
||||
if (ret == NULL) {
|
||||
set_error (errno, "malloc");
|
||||
--
|
||||
2.22.0
|
||||
|
@ -22,6 +22,8 @@ Source1: http://libguestfs.org/download/libnbd/%{source_directory}/%{name
|
||||
# https://pgp.key-server.io/pks/lookup?search=rjones%40redhat.com&fingerprint=on&op=vindex
|
||||
Source2: libguestfs.keyring
|
||||
|
||||
Patch1: 0001-lib-Try-LOGNAME-before-using-getlogin_r.patch
|
||||
|
||||
%if 0%{patches_touch_autotools}
|
||||
BuildRequires: autoconf, automake, libtool
|
||||
%endif
|
||||
@ -218,6 +220,8 @@ make %{?_smp_mflags} check || {
|
||||
* Wed Aug 21 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.8-4
|
||||
- Fix nbdkit dependencies so we're actually running the tests.
|
||||
- Add glib2-devel BR so we build the glib main loop example.
|
||||
- Add upstream patch to fix test error:
|
||||
nbd_connect_unix: getlogin: No such device or address
|
||||
|
||||
* Tue Aug 20 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.8-3
|
||||
- Bump and rebuild to fix releng brokenness.
|
||||
|
Loading…
Reference in New Issue
Block a user