dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

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

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