Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls_parser parses data incorrectly in case of broken symlinks #3454

Open
jobselko opened this issue Jun 29, 2022 · 0 comments
Open

ls_parser parses data incorrectly in case of broken symlinks #3454

jobselko opened this issue Jun 29, 2022 · 0 comments

Comments

@jobselko
Copy link
Contributor

The _load(self) method of the Directory(dict) class in the insights-core/insights/core/ls_parser.py is unable to parse the broken symlinks correctly when using the ls -lanRL command.

Example:

[root@jobselko /]# ls -lan /run/systemd/units
total 0
drwxr-xr-x.  2 0 0  60 Jun 29 06:53 .
drwxr-xr-x. 16 0 0 400 Jun 28 06:40 ..
lrwxrwxrwx.  1 0 0  32 Jun 28 06:40 invocation:auditd.service -> ad92564f4a9e4fd8a7a77bb00dbd2ab9
[root@jobselko /]# ls -lanL /run/systemd/units
ls: cannot access '/run/systemd/units/invocation:auditd.service': No such file or directory
total 0
drwxr-xr-x.  2 0 0  60 Jun 29 06:53 .
drwxr-xr-x. 16 0 0 400 Jun 28 06:40 ..
l??????????  ? ? ?   ?            ? invocation:auditd.service

Parsed result:
'? ? invocation:auditd.service': {'type': 'l', 'perms': '??????????', 'owner': '?', 'group': '?', 'se_user': '?', 'se_role': None, 'se_type': None, 'se_mls': None, 'name': '? ? invocation:auditd.service', 'raw_entry': 'l?????????? ? ? ? ? ? invocation:auditd.service', 'dir': '/etc/systemd/system'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant