You are not logged in.

#1 2025-07-20 10:06:57

corearch
Member
Registered: 2025-07-20
Posts: 3

tar: SELinux support is not available

hello! I'm asking for help. I needed tar to work with files where I need to save the selinux context. Using the tar command with the --selinux option, I get the following error:
tar: SELinux support is not available

I thought I could solve the problem if I install SELinux support. Using the step-by-step guide on the Wiki, I installed it using github, added lsm=...selinux to the kernel parameters...
but after restarting ArchLinux tar it still gives this error despite the fact that sestatus shows that SELinux = enabled. Please help me, what needs to be done so that tar can work with the selinux context?

Offline

#2 2025-07-20 10:36:24

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,186
Website

Re: tar: SELinux support is not available

Mod note: moving to AUR Issues


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2025-07-20 10:36:52

frostschutz
Member
Registered: 2013-11-15
Posts: 1,588

Re: tar: SELinux support is not available

This is not kernel or configuration related. ArchLinux tar is built without selinux support (HAVE_SELINUX_SELINUX_H = 0).

If it were supported, the string "SELinux support is not available" would not appear in the binary at all (filtered by preprocessor in src/xattrs.c) and instead the error message "Cannot set SELinux context for file" would appear.

If you `strings /bin/tar | grep -i selinux` and compare ArchLinux vs. Debian (for example), Debian tar has the selinux support while Arch does not.

Offline

#4 2025-07-20 10:58:02

corearch
Member
Registered: 2025-07-20
Posts: 3

Re: tar: SELinux support is not available

I understand you, thank you very much for the clarification. In that case, can you tell me how to build tar with Selinux support? or is it impossible on Arch at all?

Offline

#5 2025-07-20 12:03:18

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,584

Offline

#6 2025-07-21 13:50:41

corearch
Member
Registered: 2025-07-20
Posts: 3

Re: tar: SELinux support is not available

thank you! but the fact is that this link describes a technique for compiling a package yourself. And I need more than just that, I need to know how to compile so that SELinux is supported.

Offline

#7 2025-07-21 14:18:03

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,584

Re: tar: SELinux support is not available

By compiling the package yourself while having the selinux header (selinux userspace stuff) installed - there seems no special config flag and the definition very much sounds like that's what's tested to enable the feature.

Offline

Board footer

Powered by FluxBB