]> 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>
Wed, 31 Aug 2016 09:05:10 +0000 (11:05 +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 9621425271166b6c839fc97e208770d3f1b1c57f..443efde5073518dc8b738efe29cde47043170815 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;
        }