]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsns: missing ns/<name> is not error
authorKarel Zak <kzak@redhat.com>
Mon, 15 Aug 2016 09:02:18 +0000 (11:02 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Aug 2016 09:02:18 +0000 (11:02 +0200)
For example user namespace is optional it does not make sense to
ignore process completely if the ns/user file is missing.

Reported-by: MichaƂ Bartoszkiewicz <mbartoszkiewicz@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lsns.c

index c79bde3838d5ab6173756a5b29e94902bbd47798..75c04f8f8e110d794a1315d1236f381312c9c076 100644 (file)
@@ -202,7 +202,7 @@ static inline const struct colinfo *get_column_info(unsigned num)
        return &infos[ get_column_id(num) ];
 }
 
-static ino_t get_ns_ino(int dir, const char *nsname, ino_t *ino)
+static int get_ns_ino(int dir, const char *nsname, ino_t *ino)
 {
        struct stat st;
        char path[16];
@@ -267,7 +267,7 @@ static int read_process(struct lsns *ls, pid_t pid)
                        continue;
 
                rc = get_ns_ino(dirfd(dir), ns_names[i], &p->ns_ids[i]);
-               if (rc && rc != -EACCES)
+               if (rc && rc != -EACCES && rc != -ENOENT)
                        goto done;
                rc = 0;
        }