You are not logged in.

#1 2021-03-13 00:07:35

ethin
Member
Registered: 2021-03-12
Posts: 13

Strange permission errors in user accounts

So, I recently installed Arch on a Xen server with /home being on a separate partition. Ever since I created my user account (and added it to the wheel, power, storage, and users groups), then installed yay for AUR packages, I've suffered very strange permission errors where files will have all their permissions stripped away except for read by owner. Therefore I have to use sudo rm all over the place and I've no idea why. I'm using BTRFS as my file system for both partitions (both root and /home) but I don't think that would affect things all that much. I've tried using setfacl to alter the permissions; this is what all of it looks like at the moment:

# file: home/ethin
# owner: ethin
# group: users
# flags: -s-
user::rwx
group::---
other::---
default:user::rwx
default:group::---
default:other::---

(I've just altered my fstab to mount /home with NODEV and NOSUID mount options.... I'm not sure what else to try or what's going wrong. This is a base install of arch with no major modifications to anything.)

Offline

#2 2021-03-13 00:12:33

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Strange permission errors in user accounts

Probably irrelevant but why did you add your user to power and storage?
https://wiki.archlinux.org/index.php/Us … emd_groups


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2021-03-13 00:31:51

ethin
Member
Registered: 2021-03-12
Posts: 13

Re: Strange permission errors in user accounts

Its just something I picked up when I first learned to install arch... I just never really stopped doing it since.

Offline

#4 2021-03-13 05:48:13

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: Strange permission errors in user accounts

ethin wrote:

files will have all their permissions stripped away except for read by owner

When? On creation, later, after specific events?
Some or all files, specific directories or mount points?
Umask?

Offline

#5 2021-03-13 17:24:03

ethin
Member
Registered: 2021-03-12
Posts: 13

Re: Strange permission errors in user accounts

tucuxi wrote:

When? On creation, later, after specific events?

I honestly don't know. It only seems to happen when I install the xe-guest-utilities-git/xenstore-git packages (the build fails but still). The problem is that the PKGBUILD isn't broken from what I can tell.

tucuxi wrote:

Some or all files, specific directories or mount points?

It only seems to happen on ~ ($HOME) from what I can tell, so only under the /home mount point. It doesn't seem to happen anywhere else.

tucuxi wrote:

Umask

077

Offline

#6 2021-03-13 17:30:54

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: Strange permission errors in user accounts

What is the output of the following,  when logged in as your user:

touch ~/atestfile
stat ~/atestfile
rm ~/atestfile

Offline

#7 2021-03-13 17:51:20

ethin
Member
Registered: 2021-03-12
Posts: 13

Re: Strange permission errors in user accounts

touch ~/atestfile

: No output

stat ~/atestfile

:

  File: /home/ethin/atestfile
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 35h/53d Inode: 214919      Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/   ethin)   Gid: (  985/   users)
Access: 2021-03-13 11:49:40.309991305 -0600
Modify: 2021-03-13 11:49:40.309991305 -0600
Change: 2021-03-13 11:49:40.309991305 -0600
 Birth: 2021-03-13 11:49:40.309991305 -0600
rm ~/atestfile

: No output

Offline

#8 2021-03-13 18:39:34

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: Strange permission errors in user accounts

See if it is the same for /home and / .

stat /home
stat /

Offline

#9 2021-03-13 18:44:34

ethin
Member
Registered: 2021-03-12
Posts: 13

Re: Strange permission errors in user accounts

For /home, I get:

  File: /home
  Size: 10              Blocks: 32         IO Block: 4096   directory
Device: 35h/53d Inode: 256         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-03-11 22:15:11.633327688 -0600
Modify: 2021-03-11 22:13:44.716661045 -0600
Change: 2021-03-11 22:13:44.716661045 -0600
 Birth: 2021-03-11 11:06:57.000000000 -0600

And for / I get:

  File: /
  Size: 122             Blocks: 32         IO Block: 4096   directory
Device: 19h/25d Inode: 256         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-03-12 15:02:34.323324875 -0600
Modify: 2021-03-11 11:27:07.429995510 -0600
Change: 2021-03-11 11:27:07.429995510 -0600
 Birth: 2021-03-11 11:06:54.000000000 -0600

Offline

#10 2021-03-13 18:54:31

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: Strange permission errors in user accounts

/home and / look fine,  so what if you create a new user:

# useradd -m testuser
# password testuser

Logout as your user login as the new user and rerun the commands from post #6.

Offline

#11 2021-03-13 19:22:46

ethin
Member
Registered: 2021-03-12
Posts: 13

Re: Strange permission errors in user accounts

The output is similar to that of the original output:

File: /home/testuser/atestfile
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 35h/53d Inode: 214924      Links: 1
Access: (0600/-rw-------)  Uid: ( 1001/testuser)   Gid: ( 1001/testuser)
Access: 2021-03-13 13:21:55.996657470 -0600
Modify: 2021-03-13 13:21:55.996657470 -0600
Change: 2021-03-13 13:21:55.996657470 -0600
 Birth: 2021-03-13 13:21:55.996657470 -0600

Offline

#12 2021-03-13 21:34:27

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: Strange permission errors in user accounts

His umask is 077 (very bottom of post #5), the behavior is expectable.
https://wiki.archlinux.org/index.php/Umask

Sorry, missed that

stripped away except for read by owner. Therefore I have to use sudo rm all over the place

We've not seen that, but the inability to delete files does not so much depend on their permissions as on the permissionto write the directory they're in.
So please post those stats.

Edit: "states" …

Essentially

mkdir foo
stat test
touch foo/bar
stat foo/bar

and stat foo and foo/bar again when you lose the ability to delete bar.

Last edited by seth (2021-03-13 21:45:17)

Offline

#13 2021-03-13 21:58:35

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: Strange permission errors in user accounts

Given the newly created user also has the same umask something in /etc/profile or another global config file is setting it to 077?

Offline

#14 2021-03-13 22:08:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: Strange permission errors in user accounts

See my edit, the umask explains the outputs of #7 ff. but not the problem described in the OP sad

Offline

#15 2021-03-14 10:02:13

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: Strange permission errors in user accounts

If umask were 377, it would be an explanation., but as it as 077 we can eliminate that idea.

Please post the stats of the parent directory next time you see the effect.

Offline

#16 2021-03-14 14:49:51

ethin
Member
Registered: 2021-03-12
Posts: 13

Re: Strange permission errors in user accounts

I'll do that if it happens again.

Offline

#17 2021-03-14 14:53:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: Strange permission errors in user accounts

Ideally create a baseline first (see post #12) and also look out for a pattern (resp. try to trigger it as you suggested in #5)

Offline

#18 2021-03-14 17:17:59

ethin
Member
Registered: 2021-03-12
Posts: 13

Re: Strange permission errors in user accounts

Okay, I've managed to trigger it again:

:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:2]  xe-guest-utilities-git-20190927.2f5d2e4-1 (xe-guest-utilities-git xenstore-git)

  1 xe-guest-utilities-git (xe-guest-utilities-git xenstore-git) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> a
:: Deleting (1/1): /home/ethin/.cache/yay/xe-guest-utilities-git
unlinkat /home/ethin/.cache/yay/xe-guest-utilities-git/src/xe-guest-utilities/pkg/mod/golang.org/x/sys@v0.0.0-20210313202042-bd2e13477e9c/.gitattributes: permission denied
error cloning xe-guest-utilities-git: fatal: destination path 'xe-guest-utilities-git' already exists and is not an empty directory.

Output of

getfacl

on the file:

# file: home/ethin/.cache/yay/xe-guest-utilities-git/src/xe-guest-utilities/pkg/mod/golang.org/x/sys@v0.0.0-20210313202042-bd2e13477e9c/.gitattributes
# owner: ethin
# group: users
user::r--
group::---
other::---

Output of stat on the parent directory of ~:

  File: /home
  Size: 26              Blocks: 32         IO Block: 4096   directory
Device: 32h/50d Inode: 256         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-03-14 12:01:28.326666665 -0500
Modify: 2021-03-13 13:20:18.129990836 -0600
Change: 2021-03-13 13:20:18.129990836 -0600
 Birth: 2021-03-11 11:06:57.000000000 -0600

Stat of a test file:

  File: test
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 32h/50d Inode: 216078      Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/   ethin)   Gid: (  985/   users)
Access: 2021-03-14 12:15:05.149999983 -0500
Modify: 2021-03-14 12:15:05.149999983 -0500
Change: 2021-03-14 12:15:05.149999983 -0500
 Birth: 2021-03-14 12:15:05.149999983 -0500

Stat of ~/.cache/yay:

  File: .cache/yay
  Size: 76              Blocks: 0          IO Block: 4096   directory
Device: 32h/50d Inode: 214914      Links: 1
Access: (2700/drwx--S---)  Uid: ( 1000/   ethin)   Gid: (  985/   users)
Access: 2021-03-12 18:29:02.423333210 -0600
Modify: 2021-03-14 12:10:41.153333320 -0500
Change: 2021-03-14 12:10:41.153333320 -0500
 Birth: 2021-03-12 18:29:02.423333210 -0600

The odd thing is the S bit (is that SUID or Sticky?). I'm mounting /home with NODEV and NOSUID.
Edit: I can successfully reproduce this issue by creating a separate user account and attempting the same command (

yay -S xe-guest-utilities-git xenstore-git

) from there.

Last edited by ethin (2021-03-14 17:22:10)

Offline

#19 2021-03-14 17:38:45

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: Strange permission errors in user accounts

What are the stats along the path from /home/ethin/.cache/yay down to /home/ethin/.cache/yay/xe-guest-utilities-git/src/xe-guest-utilities/pkg/mod/golang.org/x/sys@v0.0.0-20210313202042-bd2e13477e9c?

Offline

Board footer

Powered by FluxBB