bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #59766] printf %i doesn't show same result in all situations


From: anonymous
Subject: [bug #59766] printf %i doesn't show same result in all situations
Date: Sat, 26 Dec 2020 11:19:44 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

URL:
  <https://savannah.gnu.org/bugs/?59766>

                 Summary: printf %i doesn't show same result in all situations
                 Project: findutils
            Submitted by: None
            Submitted on: Sat 26 Dec 2020 04:19:42 PM UTC
                Category: find
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 4.7.0
         Discussion Lock: Any
           Fixed Release: None

    _______________________________________________________

Details:

in linux the ip-tool for example mounts pseudo-files from /proc over normal
files in /run/netns/... for giving a net-namespace a name.

you can achieve similar by doing following:
touch /tmp/foo
mount --bind /proc/1/ns/net /tmp/foo

(there are further relevant use-cases for such mounts)

using `find /run/netns/ "%f %i\n"` prints the inodes of the underlaying normal
files instead of those of the pseudo-files, because it uses the inode-numbers
from the getdent()-call.

using "-ls" as find-option or any other additional property, which need a
stat()-call leads to the expected inode of the pseudo-files...

at least the output should be the same with any combination of options.

if you decide to prefer the normal inodes should alaways be shown, you should
add an option to get the inodes from possibly mounted files without the need
to know a property in advance (those /proc-files always have size 0, so a
"-size 0" helps me at the moment)





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59766>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]