Giter Club home page Giter Club logo

Comments (5)

rkervella avatar rkervella commented on July 19, 2024

I must be missing something obvious, but your listing of / (last snippet) shows the permissions and last modified time of the directories in the / directory. What do you think is missing exactly?

from sliver.

spenceradolph avatar spenceradolph commented on July 19, 2024

What is missing is the permissions and modified time of the ‘/‘ directory itself. Not the things inside it.

For example, it’s not currently known if ‘/‘ is world writable.

from sliver.

rkervella avatar rkervella commented on July 19, 2024

Ok I get it now, I was confused by the additional info not showing any difference between the two examples (/ vs /etc/rsyslog.d). Right now we're calling os.ReadDir() on the provided path (well, when it's a directory), which doesn't return anything for the root element of the path itself.
For a quick sanity check, I just tested with /bin/ls on MacOS and /usr/bin/ls on an Ubuntu 22.04 box and I'm not getting any details about the root element either when doing /bin/ls /. So at least we seem to be consistent with the system's ls binary, unless once again I'm missing some context here.

When you say:

It should be possible to see modified time of '/' directory using ls and not relying on something like execute.

Do you have an example of the command you're using with execute to get a different result than what the built-in ls command does?

EDIT: nevermind I'm not fully awake yet, ls -la will not ignore . and this is the way to get the info with the system's ls binary.

from sliver.

rkervella avatar rkervella commented on July 19, 2024

A potential solution could be to add a . entry on Unix/Linux systems that fetches the info of the inode matching the requested directory entry (top/root level).

from sliver.

spenceradolph avatar spenceradolph commented on July 19, 2024

Adding the '.' entry would be awesome! It would prevent needing additional runs of 'ls' and should be easy to parse.

from sliver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.