cdown / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

Blame SOURCES/0150-lsns-missing-ns-name-is-not-error.patch

05ad79
From 8694f63002c6b765e72c36fbf8ed46164d5303e5 Mon Sep 17 00:00:00 2001
05ad79
From: Karel Zak <kzak@redhat.com>
05ad79
Date: Mon, 15 Aug 2016 11:02:18 +0200
05ad79
Subject: [PATCH 150/173] lsns: missing ns/<name> is not error
05ad79
MIME-Version: 1.0
05ad79
Content-Type: text/plain; charset=UTF-8
05ad79
Content-Transfer-Encoding: 8bit
05ad79
05ad79
For example user namespace is optional it does not make sense to
05ad79
ignore process completely if the ns/user file is missing.
05ad79
05ad79
Reported-by: MichaƂ Bartoszkiewicz <mbartoszkiewicz@gmail.com>
05ad79
Upstream: http://github.com/karelzak/util-linux/commit/3082f8518f2739e9f68e660f1749acdd2b9d7a97
05ad79
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1543428
05ad79
Signed-off-by: Karel Zak <kzak@redhat.com>
05ad79
---
05ad79
 sys-utils/lsns.c | 4 ++--
05ad79
 1 file changed, 2 insertions(+), 2 deletions(-)
05ad79
05ad79
diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c
05ad79
index fb53a16a4..b8841b7a3 100644
05ad79
--- a/sys-utils/lsns.c
05ad79
+++ b/sys-utils/lsns.c
05ad79
@@ -204,7 +204,7 @@ static inline const struct colinfo *get_column_info(unsigned num)
05ad79
 	return &infos[ get_column_id(num) ];
05ad79
 }
05ad79
 
05ad79
-static ino_t get_ns_ino(int dir, const char *nsname, ino_t *ino)
05ad79
+static int get_ns_ino(int dir, const char *nsname, ino_t *ino)
05ad79
 {
05ad79
 	struct stat st;
05ad79
 	char path[16];
05ad79
@@ -269,7 +269,7 @@ static int read_process(struct lsns *ls, pid_t pid)
05ad79
 			continue;
05ad79
 
05ad79
 		rc = get_ns_ino(dirfd(dir), ns_names[i], &p->ns_ids[i]);
05ad79
-		if (rc && rc != -EACCES)
05ad79
+		if (rc && rc != -EACCES && rc != -ENOENT)
05ad79
 			goto done;
05ad79
 		rc = 0;
05ad79
 	}
05ad79
-- 
05ad79
2.14.4
05ad79