eza-community / eza

A modern, maintained replacement for ls
https://eza.rocks
MIT License
8.79k stars 170 forks source link

feat: SELinux support #952

Closed dylanmtaylor closed 1 week ago

dylanmtaylor commented 2 months ago

ls -Z and eza -Z have very different results produced

cafkafk commented 2 months ago

could you describe in more detail what the differences are and how this affects your usage?

dylanmtaylor commented 2 months ago

ls -Z: image

eza -Z: image

cafkafk commented 2 months ago

what does this look like with the -l flag? (I don't have a SELinux box to test on)

dylanmtaylor commented 2 months ago

ls -l image

eza -l image

You can test on a Fedora Live ISO which has SELinux by default.

MartinFillon commented 2 months ago

Hey, as per right now, -Z or security contextm is keeped behind two things, first the -l flag, and secondly xattr, they need to be enabled, they are currenty only supported on target oses:

if SELinux is a different os than those then this can be the reason why its not working. As I dont have the ability to run a SELinux os . Feel free to test and maybe debug the variable to see if its enabled in a rust basic project. code the ENABLED const is here the reason.

dylanmtaylor commented 2 months ago

Hey, as per right now, -Z or security contextm is keeped behind two things, first the -l flag, and secondly xattr, they need to be enabled, they are currenty only supported on target oses:

* `linux`

* `netbsd`

* `macos`

* `freebsd`

if SELinux is a different os than those then this can be the reason why its not working. As I dont have the ability to run a SELinux os . Feel free to test and maybe debug the variable to see if its enabled in a rust basic project. code the ENABLED const is here the reason.

SELinux is not a different OS than Linux.

MartinFillon commented 2 months ago

SELinux is not a different OS than Linux.

Ok then i think you not having the same output is due to us gatekeeping it behind -l

shdwchn10 commented 2 weeks ago

I use SELinux-enabled Linux system (Fedora Silverblue) and can't see SELinux labels in eza -l output.

UPD: eza -lZ works, so issue can be closed:

❯ eza -lZ            
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023 11 Jun 12:03 chezmoi
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023  8 Jun 12:33 eza
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023 17 Jun 23:24 fzf
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023  8 Jun 14:14 gum
.rw-r--r--  11k shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023  8 Jun 15:39 LICENSE
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023 11 Jun 11:39 nu
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023 18 Jun 07:38 pueue
.rw-r--r-- 1.8k shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023 18 Jun 09:40 README.md
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023 18 Jun 09:17 solo2
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023  8 Jun 14:28 starship
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023 18 Jun 07:16 topgrade
drwxr-xr-x    - shdwchn10 unconfined_u:object_r:container_file_t:s0:c1022,c1023 17 Jun 23:24 zoxide
cafkafk commented 1 week ago

Okay, closing as solved :3