Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
1 answers
88 views
xattr -c not removing com.apple.FinderInfo attribute
I was trying to solve the problem in [this post](https://stackoverflow.com/questions/39652867/code-sign-error-in-macos-monterey-xcode-resource-fork-finder-information-or), and it seems like `xattr -cr .` is not actually removing the com.apple.FinderInfo attribute, nor is `xattr -c ` or `xattr -d com...
I was trying to solve the problem in [this post](https://stackoverflow.com/questions/39652867/code-sign-error-in-macos-monterey-xcode-resource-fork-finder-information-or) , and it seems like xattr -cr . is not actually removing the com.apple.FinderInfo attribute, nor is xattr -c or xattr -d com.apple.FinderInfo . Here's what I tried, and how the shell responded: * listed all files with extended attributes, showed 15 files
FlackBook-Pro:BasicEQ julianflack$ xattr -lr .
./Source/PluginProcessor.h: com.apple.lastuseddate#PS: +N?g
./Source/PluginProcessor.h: com.apple.metadata:kMDLabel_mgte763loh3jfiptugpk6t3rl4: ????? ?Sv?pӰ=y??X?1
?7d?LHNd;?Ӊ?????, confirmed zero exit code, ran xattr -lr .`
* the specified file was still there with the same attribute
FlackBook-Pro:BasicEQ julianflack$ xattr -c ./Builds/MacOSX/BasicEQ.xcodeproj FlackBook-Pro:BasicEQ julianflack$ echo "$?" 0 FlackBook-Pro:BasicEQ julianflack$ xattr -lr .
* ran xattr -d com.apple.FinderInfo , confirmed zero exit code, ran xattr -lr .
* same problem
FlackBook-Pro:BasicEQ julianflack$ xattr -d com.apple.FinderInfo ./Builds/MacOSX/BasicEQ.xcodeproj FlackBook-Pro:BasicEQ julianflack$ echo "$?" 0 FlackBook-Pro:BasicEQ julianflack$ xattr -lr . ``` Other things I've tried: * confirmed I am running bash and not zsh * type xattr returns xattr is hashed (/usr/bin/xattr) I'm at a bit of a loss here, I posted the [same question](https://stackoverflow.com/questions/79355771/xattr-c-not-actually-removing-attributes) in stack overflow and, after going back and forth with some answerers in the comments, they closed my question for some reason. I figured I could try here as well, any ideas?
Julian Flack (11 rep)
Jan 19, 2025, 07:58 PM • Last activity: Feb 20, 2025, 04:56 PM
2 votes
1 answers
63 views
Something on Ubuntu is changing File Attributes to immutable
So the issue is curious. Something or some service is changing the entire domain directory of a website (yes, only one of hundreds) to immutable attribute. Manually one would use `chattr` to do this, but it happens almost every second day, whereas no other human has access to this system. The server...
So the issue is curious. Something or some service is changing the entire domain directory of a website (yes, only one of hundreds) to immutable attribute. Manually one would use chattr to do this, but it happens almost every second day, whereas no other human has access to this system. The server runs ubuntu 22.04, Lightspeed webserver LSWS and Cyberpanel. Has anyone experienced something similar? Is it me going crackers? Is it a ghost? Thanks guys for @potential@ answers / ideas / suggestions....
pcdoc (21 rep)
Jan 24, 2025, 04:16 PM • Last activity: Jan 26, 2025, 04:58 PM
0 votes
1 answers
43 views
Solaris 10: extended attributes, how to create it?
Some Solaris 10 commands (ls, find..) support extended attributes. With runat is possible to copy and list extended attributes. But how to create/insert an extended attribute in a file? On Linux we have chattr (chattr +i...chattr +m¹). On Solaris 10? Thanks 1 DON'T TEST IF YOU DON'T KNOW WHAT T...
Some Solaris 10 commands (ls, find..) support extended attributes. With runat is possible to copy and list extended attributes. But how to create/insert an extended attribute in a file? On Linux we have chattr (chattr +i...chattr +m¹). On Solaris 10? Thanks 1 DON'T TEST IF YOU DON'T KNOW WHAT THEY DID!
elbarna (13690 rep)
Dec 20, 2024, 12:18 AM • Last activity: Dec 20, 2024, 03:31 PM
0 votes
0 answers
378 views
Chattr failing with Inappropriate ioctl for device on BTRFS
trying to delete a directory that my user is the owner off and I keep failing with Permission denied errors. Even if I `sudo rm -rf ./dir` I tried looking if the `immutable` flag is set but `chattr` fails with `chattr: read flags of '.dir': Inappropriate ioctl for device` here is how my directory is...
trying to delete a directory that my user is the owner off and I keep failing with Permission denied errors. Even if I sudo rm -rf ./dir I tried looking if the immutable flag is set but chattr fails with chattr: read flags of '.dir': Inappropriate ioctl for device here is how my directory is mounted, it is on a btrfs filesystem and the mount is because I use impermanence on my system
/persist/home/nikola/files on /home/nikola/files type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100,default_permissions,allow_other)
Not sure how to approach debugging this, tried exporting GPG_TTY=$(tty) but that didn't help EDIT: File is located under ~/files/project/dir, the ~/files is mounted on /persist since / is deleted on every boot. /persist is BTRFS subvolume. Files are owned by my user, both when viewed on the /persist and inside ~/files/project I used the commands as such chattr -i ./dir and lsattr ./dir, I tried adding other flags and had the same error pop up. Persist is a subvolume, the files/project is not, just a regular directory
Nikola-Milovic (111 rep)
Nov 25, 2024, 12:18 PM • Last activity: Nov 25, 2024, 01:52 PM
0 votes
1 answers
147 views
ext4 and chattr ( change attributes ) 's - undo ( u ) option
This is an `microsd ext4 card on a rooted Android`, where I want to use busybox chattr -R +u /mypath I know what +u means but does anyone have an idea about how the undo option is implemented for ext4 and specifically in case my hardware to what extent undo will let me in datarecovery. If I use `ext...
This is an microsd ext4 card on a rooted Android, where I want to use busybox chattr -R +u /mypath I know what +u means but does anyone have an idea about how the undo option is implemented for ext4 and specifically in case my hardware to what extent undo will let me in datarecovery. If I use extundelete & ext4magic would these get back my data in case it's deleted by the app ? corollary to that if : -- ext4 does honor +u and other extended attributes any mount level option that will gimme a good chance of recovery in case of deletion ? -- what file system then does +u work with after all chattr is a linux / unix command there is a mention > ext_attr This feature enables the use of extended attributes. This feature is supported by ext2, ext3, and ext4. here I wondered if that op mount activate the +u attribute
user1874594 (133 rep)
Aug 30, 2024, 06:38 AM • Last activity: Aug 30, 2024, 11:12 AM
0 votes
2 answers
195 views
Cannot change file permission of "/usr/bin/nvidia-smi" via "chattr"
**Problem background**: I was reinstalling the nvidia driver. After purging the original driver, I ran `sudo apt install nvidia-driver-515` and got an error with the package `nvidia-utils-515`. The error message asked me to try `sudo apt --fix-broken install`. I did so, but got another error shown b...
**Problem background**: I was reinstalling the nvidia driver. After purging the original driver, I ran sudo apt install nvidia-driver-515 and got an error with the package nvidia-utils-515. The error message asked me to try sudo apt --fix-broken install. I did so, but got another error shown below.
Unpacking nvidia-utils-515 (515.43.04-0ubuntu1) ...
dpkg: error processing archive /var/cuda-repo-ubuntu2004-11-7-local/./nvidia-utils-515_515.43.04-0ubuntu1_amd64.deb (--unpack):
 unable to make backup link of './usr/bin/nvidia-smi' before installing new version: Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cuda-repo-ubuntu2004-11-7-local/./nvidia-utils-515_515.43.04-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I searched this problem online, and it seemed that something was wrong with the permission of the file /usr/bin/nvidia-smi. Therefore, I tried to use chattr to change the attributes of this file. **Problem:** The original attributes of this file are shown as follows, using lsattr
$ sudo lsattr /usr/bin/nvidia-smi
----ia--------e----- /usr/bin/nvidia-smi
Then I tried to remove the i attribute by sudo chattr -i /usr/bin/nvidia-smi. However, when using lsattr to examine the attributes again, it shows the same result. That is, the i attribute is not successfully removed.
----ia--------e----- /usr/bin/nvidia-smi
**What I've tried**: I have tried entering the root user by sudo su. But it still cannot change the attribute successfully. **Other information**: My system is Ubuntu 20.04 LTS. **Please let me know if you need any additional information!** By the way, I'm actually not sure if changing the attributes of the file /usr/bin/nvidia-smi is the right way to solve the error in driver installation. If you have any idea of what happened to my nvidia driver, please also let me know. Thank you.
jsonr (1 rep)
Jul 23, 2024, 01:58 PM • Last activity: Jul 23, 2024, 08:38 PM
0 votes
1 answers
245 views
Delete multiple extended attributes (but not all of them) in one step
For example, I have a file with three extended attributes: ``` com.apple.FinderInfo com.apple.metadata:_kMDItemUserTags com.apple.metadata:kMDItemFinderComment ``` I can delete the first two using ``` xattr -d com.apple.FinderInfo file.txt xattr -d com.apple.metadata:_kMDItemUserTags file.txt ``` Bu...
For example, I have a file with three extended attributes:
com.apple.FinderInfo
com.apple.metadata:_kMDItemUserTags
com.apple.metadata:kMDItemFinderComment
I can delete the first two using
xattr -d com.apple.FinderInfo file.txt
xattr -d com.apple.metadata:_kMDItemUserTags file.txt
But I would prefer to not invoke xattr multiple times, and to use something like this instead:
xattr -d \( com.apple.FinderInfo, com.apple.metadata:_kMDItemUserTags \) file.txt
xattr -d com.apple.FinderInfo -d com.apple.metadata:_kMDItemUserTags file.txt
Is it possible somehow?
jsx97 (1347 rep)
Mar 14, 2024, 12:28 PM • Last activity: Mar 14, 2024, 12:55 PM
2 votes
2 answers
798 views
why there is no output of lsattr and how to resolve it
The normal output of `lsattr` is below ``` # lsattr /etc/fstab ---------------- /etc/fstab ``` but I have a host ,when I run `lsattr`, there is no output display to me, just like below. [![enter image description here][1]][1] my os version is `centos 7.9.2009`. I reinstalled e2fsprogs-1.42.9-19.el7....
The normal output of lsattr is below
# lsattr /etc/fstab 
---------------- /etc/fstab
but I have a host ,when I run lsattr, there is no output display to me, just like below. enter image description here my os version is centos 7.9.2009. I reinstalled e2fsprogs-1.42.9-19.el7.x86_64 but it seams helpless. Why I noticed this is because I could not operator /usr/sbin/sshd neither delete or copy etc. It caused me unable to reinstall the sshd service enter image description here Below is the error of installing openssh-server enter image description here I run strace /usr/sbin/sshd on the ob01 which is a bad system,the output is below
[root@ob01 ~]# strace lsattr /usr/sbin/sshd
execve("/bin/lsattr", ["lsattr", "/usr/sbin/sshd"], 0x7ffd56518b68 /* 17 vars */) = 0
brk(NULL)                               = 0x945000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb10a84a000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=34304, ...}) = 0
mmap(NULL, 34304, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb10a841000
close(3)                                = 0
open("/lib64/libtinfo.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\316\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=174576, ...}) = 0
mmap(NULL, 2268928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb10a400000
mprotect(0x7fb10a425000, 2097152, PROT_NONE) = 0
mmap(0x7fb10a625000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7fb10a625000
close(3)                                = 0
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=19248, ...}) = 0
mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb10a1fc000
mprotect(0x7fb10a1fe000, 2097152, PROT_NONE) = 0
mmap(0x7fb10a3fe000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fb10a3fe000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`&\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2156592, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb10a840000
mmap(NULL, 3985920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb109e2e000
mprotect(0x7fb109ff2000, 2093056, PROT_NONE) = 0
mmap(0x7fb10a1f1000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7fb10a1f1000
mmap(0x7fb10a1f7000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb10a1f7000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb10a83e000
arch_prctl(ARCH_SET_FS, 0x7fb10a83e740) = 0
access("/etc/sysconfig/strcasecmp-nonascii", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/sysconfig/strcasecmp-nonascii", F_OK) = -1 ENOENT (No such file or directory)
mprotect(0x7fb10a1f1000, 16384, PROT_READ) = 0
mprotect(0x7fb10a3fe000, 4096, PROT_READ) = 0
mprotect(0x7fb10a625000, 16384, PROT_READ) = 0
mprotect(0x6dd000, 4096, PROT_READ)     = 0
mprotect(0x7fb10a84b000, 4096, PROT_READ) = 0
munmap(0x7fb10a841000, 34304)           = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/dev/tty", O_RDWR|O_NONBLOCK)     = 3
close(3)                                = 0
brk(NULL)                               = 0x945000
brk(0x966000)                           = 0x966000
brk(NULL)                               = 0x966000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=106176928, ...}) = 0
mmap(NULL, 106176928, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb1038eb000
close(3)                                = 0
brk(NULL)                               = 0x966000
getuid()                                = 0
getgid()                                = 0
geteuid()                               = 0
getegid()                               = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb10a849000
read(3, "MemTotal:       263972636 kB\nMem"..., 1024) = 1024
close(3)                                = 0
munmap(0x7fb10a849000, 4096)            = 0
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, 8) = 0
uname({sysname="Linux", nodename="ob01", ...}) = 0
stat("/root", {st_mode=S_IFDIR|0550, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0550, st_size=4096, ...}) = 0
getpid()                                = 28390
open("/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=26970, ...}) = 0
mmap(NULL, 26970, PROT_READ, MAP_SHARED, 3, 0) = 0x7fb10a843000
close(3)                                = 0
getppid()                               = 28383
getpgrp()                               = 28383
rt_sigaction(SIGCHLD, {sa_handler=0x4414a0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, 8) = 0
getrlimit(RLIMIT_NPROC, {rlim_cur=640*1024, rlim_max=640*1024}) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/bin/lsattr", O_RDONLY)           = 3
ioctl(3, TCGETS, 0x7fff7292e310)        = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "#!/bin/sh\n", 80)              = 10
lseek(3, 0, SEEK_SET)                   = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=640*1024, rlim_max=640*1024}) = 0
fcntl(255, F_GETFD)                     = -1 EBADF (Bad file descriptor)
dup2(3, 255)                            = 255
close(3)                                = 0
fcntl(255, F_SETFD, FD_CLOEXEC)         = 0
fcntl(255, F_GETFL)                     = 0x8000 (flags O_RDONLY|O_LARGEFILE)
fstat(255, {st_mode=S_IFREG|0755, st_size=10, ...}) = 0
lseek(255, 0, SEEK_CUR)                 = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(255, "#!/bin/sh\n", 10)            = 10
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(255, "", 10)                       = 0
exit_group(0)                           = ?
+++ exited with 0 +++
And the good system output is below
[root@ob03 ~]#  strace lsattr /usr/sbin/sshd 
execve("/usr/bin/lsattr", ["lsattr", "/usr/sbin/sshd"], 0x7ffcd663f778 /* 21 vars */) = 0
brk(NULL)                               = 0x246d000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d042000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=26333, ...}) = 0
mmap(NULL, 26333, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f742d03b000
close(3)                                = 0
open("/lib64/libe2p.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\37\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=33704, ...}) = 0
mmap(NULL, 2128240, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f742cc1a000
mprotect(0x7f742cc21000, 2093056, PROT_NONE) = 0
mmap(0x7f742ce20000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f742ce20000
close(3)                                = 0
open("/lib64/libcom_err.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\25\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=15856, ...}) = 0
mmap(NULL, 2109928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f742ca16000
mprotect(0x7f742ca19000, 2093056, PROT_NONE) = 0
mmap(0x7f742cc18000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f742cc18000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`&\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2156592, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d03a000
mmap(NULL, 3985920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f742c648000
mprotect(0x7f742c80c000, 2093056, PROT_NONE) = 0
mmap(0x7f742ca0b000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7f742ca0b000
mmap(0x7f742ca11000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f742ca11000
close(3)                                = 0
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200m\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=142144, ...}) = 0
mmap(NULL, 2208904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f742c42c000
mprotect(0x7f742c443000, 2093056, PROT_NONE) = 0
mmap(0x7f742c642000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f742c642000
mmap(0x7f742c644000, 13448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f742c644000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d039000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d037000
arch_prctl(ARCH_SET_FS, 0x7f742d037740) = 0
access("/etc/sysconfig/strcasecmp-nonascii", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/sysconfig/strcasecmp-nonascii", F_OK) = -1 ENOENT (No such file or directory)
mprotect(0x7f742ca0b000, 16384, PROT_READ) = 0
mprotect(0x7f742c642000, 4096, PROT_READ) = 0
mprotect(0x7f742cc18000, 4096, PROT_READ) = 0
mprotect(0x7f742ce20000, 4096, PROT_READ) = 0
mprotect(0x601000, 4096, PROT_READ)     = 0
mprotect(0x7f742d043000, 4096, PROT_READ) = 0
munmap(0x7f742d03b000, 26333)           = 0
set_tid_address(0x7f742d037a10)         = 6671
set_robust_list(0x7f742d037a20, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f742c432860, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f742c43b630}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f742c4328f0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f742c43b630}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=10240*1024}) = 0
brk(NULL)                               = 0x246d000
brk(0x248e000)                          = 0x248e000
brk(NULL)                               = 0x248e000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=106176928, ...}) = 0
mmap(NULL, 106176928, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7425ee9000
close(3)                                = 0
lstat("/usr/sbin/sshd", {st_mode=S_IFREG|0755, st_size=852856, ...}) = 0
lstat("/usr/sbin/sshd", {st_mode=S_IFREG|0755, st_size=852856, ...}) = 0
open("/usr/sbin/sshd", O_RDONLY|O_NONBLOCK) = 3
ioctl(3, FS_IOC_GETFLAGS, 0x7ffdd67d6c3c) = 0
close(3)                                = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d041000
write(1, "---------------- /usr/sbin/sshd\n", 32---------------- /usr/sbin/sshd
) = 32
exit_group(0)                           = ?
+++ exited with 0 +++
Is there anyone who has any ideas about the situation and how to resovle it? Best wishes.
Hongwei Lu (49 rep)
Sep 21, 2022, 09:58 AM • Last activity: Mar 13, 2024, 04:10 AM
4 votes
1 answers
639 views
Are the attributes set by the "chattr" command implemented as extended attributes?
The `chattr` command is used to set some attributes for a file (for example: *append only (a)*, *immutable (i)*, etc.). Are these attributes implemented as extended attributes, or are they their own category of attributes?
The chattr command is used to set some attributes for a file (for example: *append only (a)*, *immutable (i)*, etc.). Are these attributes implemented as extended attributes, or are they their own category of attributes?
John (563 rep)
Feb 20, 2019, 08:26 AM • Last activity: Mar 6, 2024, 08:51 AM
0 votes
1 answers
198 views
Find all the folders that are concealed using 'chflags'
I have concealed some folders on my laptop using `chflags`: ``` chflags hidden hide-me ``` And I don't remember where exaclty these folders are located. How is it possible to find all of them? (Probably by using `find` and/or `grep`.)
I have concealed some folders on my laptop using chflags:
chflags hidden hide-me
And I don't remember where exaclty these folders are located. How is it possible to find all of them? (Probably by using find and/or grep.)
jsx97 (1347 rep)
Feb 26, 2024, 09:58 AM • Last activity: Feb 26, 2024, 10:30 AM
17 votes
2 answers
2613 views
State of ZFS xattr support in FreeBSD
I'm trying to work out whether or not, or rather to what extend, xattrs are supported in FreeBSD using ZFS. I've read some conflicting information. 1. `zfs get xattr` lists it as `on (default)` for `/`, `/usr` and `/var`, but as `off (temporary)` for all other datasets, including children of those m...
I'm trying to work out whether or not, or rather to what extend, xattrs are supported in FreeBSD using ZFS. I've read some conflicting information. 1. zfs get xattr lists it as on (default) for /, /usr and /var, but as off (temporary) for all other datasets, including children of those mentioned above. 2. Running zfs set xattr=on zroot/usr/home I get the message > property 'xattr' not supported on FreeBSD: permission denied. 3. This agrees with [the zfs man page](https://www.freebsd.org/cgi/man.cgi?query=zfs&apropos=0&sektion=0&manpath=FreeBSD+10.2-RELEASE&arch=default&format=html) : > The xattr property is currently not supported on FreeBSD. 4. setextattr, getextattr and lsextattr seem to work well enough. 5. I also managed to save and restore a device file node using rsync --fake-super, and could see its data using lsextattr and getextattr. 6. Wikipedia has some discussion in the [xattr talk page](https://en.wikipedia.org/wiki/Talk:Extended_file_attributes#FreeBSD) . Apparently there once was a claim that ZFS supports xattr since FreeBSD 8, but that was removed later on, with reference to the manpage (see 3.). Currently I get the impression that extended attributes on zfs work in practice, but that the xattr property which would control their use does not work as it would in other zfs distributions. But I'd like to hear that confirmed (or corrected) before I trust large amounts of backup data to an rsync --fake-super running on such a machine. I'd rather not lose all my metadata due to known xattr problems. If it matters, this is a *very* fresh FreeBSD 10.2 install I just set up, with ZFS set up by the installer.
MvG (4551 rep)
Mar 1, 2016, 11:08 PM • Last activity: Dec 23, 2023, 01:00 AM
6 votes
1 answers
23281 views
Setfattr always returns operation not supported
I'm trying to get a script working however I'm having issues with a particular line trying to set file attributes with setfattr. The line in question is ret=os.system('setfattr -n "user.dummy" -v "dummy" /apachelogs/data/file') The fstab output of this location is as follows. /dev/sdb1 /apachelogs r...
I'm trying to get a script working however I'm having issues with a particular line trying to set file attributes with setfattr. The line in question is ret=os.system('setfattr -n "user.dummy" -v "dummy" /apachelogs/data/file') The fstab output of this location is as follows. /dev/sdb1 /apachelogs reiserfs user,noauto,rw,exec,suid,user_xattr 0 2 Returns the error message: setfattr: /apachelogs/data/file: Operation not supported Can anyone give me any advice on what I might be doing wrong? My google-fu is only telling me that the problem usually occurs when someone doesn't prefix user on the first variable. Cheers.
Peleus (179 rep)
Jan 22, 2014, 05:12 PM • Last activity: Nov 24, 2023, 06:18 AM
1 votes
1 answers
53 views
dir permissions: delete enclosed files but not create or write to files
I want the following situation for a user's directory: - user can list files - user can read files - user can delete files - user cannot add files - (ideally, also) user cannot modify files I haven't been able to think of a way to do this with permissions and xattrs. Any thoughts? The file system ty...
I want the following situation for a user's directory: - user can list files - user can read files - user can delete files - user cannot add files - (ideally, also) user cannot modify files I haven't been able to think of a way to do this with permissions and xattrs. Any thoughts? The file system types in use are NFS v3 and GPFS. The OS is RHEL 7 Linux.
Cavalcade of Cats (227 rep)
Nov 7, 2022, 04:53 PM • Last activity: Jul 7, 2023, 12:18 PM
0 votes
1 answers
284 views
How can I use the Trusted xattr namespace on FreeBSD 11.2?
I'm trying to translate whiteout files from the AUFS format to the kernel-overlay FS format. This [entails][1] marking certain directories with the extended attribute trusted.overlay.opaque = y. Unfortunately, it seems that at least by default, FreeBSD only supports the user and system namespaces fo...
I'm trying to translate whiteout files from the AUFS format to the kernel-overlay FS format. This entails marking certain directories with the extended attribute trusted.overlay.opaque = y. Unfortunately, it seems that at least by default, FreeBSD only supports the user and system namespaces for extended attributes. Is there any way around this restriction? The manual for extattr implies that some file system I could mount might support other namespaces, perhaps including the trusted namespace, but I haven't been able to find a namespace that I can mount and that does indeed allow for use of the trusted namespace. Unfortunately, I'm unable to upgrade to a supported FreeBSD version. Additionally, while KOFS has a flag to read its opaque whiteout files from the user namespace instead of the trusted one, we're stuck building our KOFS on top of tempfs, which does not support user namespace extended attributes. Any thoughts?
Anaxagoras (1 rep)
Sep 16, 2022, 03:49 PM • Last activity: Jul 1, 2023, 01:54 PM
1 votes
1 answers
129 views
Can't remove ceph xattrs on linux
I had set xattrs for quota limits on CephFS $ setfattr -n ceph.quota.max_bytes -v 1100000000 /mnt/cephfs/data/ I can get value of this attribute $ getfattr -n ceph.quota.max_bytes /mnt/cephfs/data/ getfattr: Removing leading '/' from absolute path names # file: mnt/cephfs/data/ ceph.quota.max_bytes=...
I had set xattrs for quota limits on CephFS $ setfattr -n ceph.quota.max_bytes -v 1100000000 /mnt/cephfs/data/ I can get value of this attribute $ getfattr -n ceph.quota.max_bytes /mnt/cephfs/data/ getfattr: Removing leading '/' from absolute path names # file: mnt/cephfs/data/ ceph.quota.max_bytes="1100000000" But then I try to remove quota, I had $ setfattr -x ceph.quota.max_bytes /mnt/cephfs/data/ setfattr: /mnt/cephfs/data/: No such attribute How can I remove this xattr?
Dan B (11 rep)
Jun 4, 2023, 09:29 AM • Last activity: Jun 21, 2023, 08:07 AM
26 votes
2 answers
64795 views
What's the meaning of output of lsattr
I'm wondering what the output of `lsattr` means.It prints so oddly as follows,when I have tried: `lsattr /usr`. $ lsattr /usr -----------------e- /usr/local -----------------e- /usr/src -----------------e- /usr/games --------------I--e- /usr/include --------------I--e- /usr/share --------------I--e-...
I'm wondering what the output of lsattr means.It prints so oddly as follows,when I have tried: lsattr /usr. $ lsattr /usr -----------------e- /usr/local -----------------e- /usr/src -----------------e- /usr/games --------------I--e- /usr/include --------------I--e- /usr/share --------------I--e- /usr/lib -----------------e- /usr/lib32 --------------I--e- /usr/bin --------------I--e- /usr/sbin I've read the man page of chattr and lsattr but still have no idea.
Hongxu Chen (5888 rep)
Feb 21, 2012, 11:00 AM • Last activity: Mar 26, 2023, 09:54 PM
0 votes
1 answers
308 views
What is `chattr +x` used for?
The `chattr(1)` manpage describes the `x` attribute as: ``` x The 'x' attribute can be set on a directory or file. If the attri‐ bute is set on an existing directory, it will be inherited by all files and subdirectories that are subsequently created in the direc‐ tory. If an existing directory has c...
The chattr(1) manpage describes the x attribute as:
x      The  'x' attribute can be set on a directory or file.  If the attri‐
       bute is set on an existing directory, it will be  inherited  by  all
       files and subdirectories that are subsequently created in the direc‐
       tory.  If an existing directory has contained some files and  subdi‐
       rectories,  modifying  the attribute on the parent directory doesn't
       change the attributes on these files and subdirectories.
So this attribute is inherited by newly created files/subdirectories, but other than that, the manpage doesn't specify any effect. What is this attribute used for?
Evan Krall (211 rep)
Mar 23, 2023, 12:29 AM • Last activity: Mar 23, 2023, 12:39 AM
2 votes
1 answers
988 views
Append only attribute for directories
I want to create a directory which is `undeletable`, and that you can only add files, not delete any file therein. I was reading the `man chattr` page and I came across attribute `a` >A file with the 'a' attribute set can only be opened in append mode for writing. Only the superuser or a process pos...
I want to create a directory which is undeletable, and that you can only add files, not delete any file therein. I was reading the man chattr page and I came across attribute a >A file with the 'a' attribute set can only be opened in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute. But it just mentions files. Can I apply it to a directory? Something like sudo chattr +a +u /path/to/dir
João Pimentel Ferreira (870 rep)
Mar 31, 2022, 07:45 PM • Last activity: Feb 19, 2023, 06:02 PM
0 votes
0 answers
136 views
macOS ACL settings - unable to delete Time Machine backup left-over files
(macOS Ventura - MacBook Pro M1) I have deleted Time Machine backup file manually!! (my bad). Now I am left with files in my `.Trashes` folder that I cannot delete, no matter what I try. I have enabled root user; I have disabled SIP; I have tried `chmod -N`, `chmod -/+a`, `chmod 777` etc. to no avai...
(macOS Ventura - MacBook Pro M1) I have deleted Time Machine backup file manually!! (my bad). Now I am left with files in my .Trashes folder that I cannot delete, no matter what I try. I have enabled root user; I have disabled SIP; I have tried chmod -N, chmod -/+a, chmod 777 etc. to no avail... I have read a lot about ACL, extended attributes etc. but I couldn't find a solution. All of the files that I am not able to delete have the following ACL: For ex:
ls -le@ah WebSecurity
-rwxr-xr-x@ 1 root wheel 222K Aug 15 2019 WebSecurity
   com.apple.finder.copy.source.checksum#N 4B
0: group:everyone deny write,delete,append,writeattr,writeextattr,chown
Any help will be appreciated a lot :) I have tried the following on this file:
sh-3.2# chmod -a "group:everyone deny chown" WebSecurity
chmod: Failed to set ACL on file 'WebSecurity': Operation not permitted

sh-3.2# chmod -a "group:everyone deny writeattr" WebSecurity
chmod: Failed to set ACL on file 'WebSecurity': Operation not permitted

sh-3.2# chmod -N WebSecurity
chmod: Failed to clear ACL on file WebSecurity: Operation not permitted

sh-3.2# sudo chmod 777 WebSecurity
chmod: Unable to change file mode on WebSecurity: Operation not permitted
cem ozel (1 rep)
Feb 13, 2023, 04:24 PM • Last activity: Feb 13, 2023, 04:25 PM
3 votes
1 answers
731 views
What is the difference between the chattr and setfattr command
At the Veeam Documentation, I read that the chattr and setfattr commands need to be supported: - https://helpcenter.veeam.com/docs/backup/vsphere/hardened_repository_limitations.html?ver=110 I have read the following man pages: - https://man7.org/linux/man-pages/man1/chattr.1.html - https://man7.org...
At the Veeam Documentation, I read that the chattr and setfattr commands need to be supported: - https://helpcenter.veeam.com/docs/backup/vsphere/hardened_repository_limitations.html?ver=110 I have read the following man pages: - https://man7.org/linux/man-pages/man1/chattr.1.html - https://man7.org/linux/man-pages/man1/setfattr.1.html I figured out that chattr is used to set attributes, e.g. cattr +i makes a file immutable. But for what is the setfattr comand in context with Veeam used for? I searched for hours but did not figure it out.
Nightscape (31 rep)
Feb 4, 2023, 08:21 PM • Last activity: Feb 5, 2023, 01:54 AM
Showing page 1 of 20 total questions