You are not logged in.

#1 2024-07-01 17:28:13

BiffenB
Member
Registered: 2024-07-01
Posts: 15

[SOLVED] Unsafe path transition - symbolic link - installing Snap

Hello! I've been reading online about the "Detected unsafe path transition" error, but can't find anyone who has a similar issue, so here goes:

When trying to install Snap (I have the .zst ready and am installing it via pacman -U) I get the following errors:

Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric.
Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric/logs.

For reference, the fabric symbolic link actually points to /home/fabric_server_actual/fabric/ and is used for a minecraft server (so it should be unrelated to Snap if I understand correctly).

I am following the installation instructions on the wiki.
The Snap installation is for installing Certbot.

The following is output when I run "stat /":

  File: /
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 259,3   Inode: 2           Links: 20
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-07-01 18:16:38.969997211 +0200
Modify: 2024-07-01 17:16:40.150578635 +0200
Change: 2024-07-01 18:16:36.893330575 +0200
Birth: 2023-06-08 23:00:52.000000000 +0200

I don't know how to check who actually owns the root folder, but I have also done "chown root:root /" just in case. The symbolic link /srv/fabric is owned by fabric:fabric, and the entire /home/fabric_server_actual folder is recursively owned by fabric:fabric.

I haven't found any posts about unsafe path transitions over symbolic links which have the unsafe path transitions go to a parent directory, only child/sibling directories. Thank you for taking the time to read this, and if you have any idea, please reach out! Thanks!

Last edited by BiffenB (2024-07-05 19:26:24)

Offline

#2 2024-07-02 06:23:45

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

ls -lR /srv/fabric

Do you bind-mount or symlink the root path into that tree?

Offline

#3 2024-07-02 16:05:06

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Not sure I understand fully what you mean. /srv/fabric is a symlink (I tried removing the old symlink and putting a new one with ln -s /home/fabric_server_actual/fabric/ /srv/fabric, but it predictably didn't change anything).

# ls -lR /srv/fabric
lrwxrwxrwx 1 fabric fabric 34 Jul  1 18:54 /srv/fabric -> /home/fabric_server_actual/fabric/
# findmnt
TARGET                                SOURCE FSTYPE     OPTIONS
/                                     /dev/nvme0n1p3
│                                            ext4       rw,relatime
├─/proc                               proc   proc       rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc          systemd-1
│                                            autofs     rw,relatime,fd=39,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,
├─/sys                                sys    sysfs      rw,nosuid,nodev,noexec,relatime
│ ├─/sys/firmware/efi/efivars         efivarfs
│ │                                          efivarfs   rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security              securityfs
│ │                                          securityfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup                    cgroup2
│ │                                          cgroup2    rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot
│ ├─/sys/fs/pstore                    pstore pstore     rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/bpf                       bpf    bpf        rw,nosuid,nodev,noexec,relatime,mode=700
│ ├─/sys/kernel/debug                 debugfs
│ │                                          debugfs    rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/tracing               tracefs
│ │                                          tracefs    rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/fuse/connections          fusectl
│ │                                          fusectl    rw,nosuid,nodev,noexec,relatime
│ └─/sys/kernel/config                configfs
│                                            configfs   rw,nosuid,nodev,noexec,relatime
├─/dev                                dev    devtmpfs   rw,nosuid,relatime,size=16250324k,nr_inodes=4062581,mode=755,ino
│ ├─/dev/shm                          tmpfs  tmpfs      rw,nosuid,nodev,inode64
│ ├─/dev/pts                          devpts devpts     rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/mqueue                       mqueue mqueue     rw,nosuid,nodev,noexec,relatime
│ └─/dev/hugepages                    hugetlbfs
│                                            hugetlbfs  rw,nosuid,nodev,relatime,pagesize=2M
├─/run                                run    tmpfs      rw,nosuid,nodev,relatime,mode=755,inode64
│ ├─/run/user/0                       tmpfs  tmpfs      rw,nosuid,nodev,relatime,size=3252108k,nr_inodes=813027,mode=700
│ ├─/run/credentials/systemd-journald.service
│ │                                   tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
│ ├─/run/credentials/systemd-udev-load-credentials.service
│ │                                   tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
│ ├─/run/credentials/systemd-sysctl.service
│ │                                   tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
│ ├─/run/credentials/systemd-tmpfiles-setup-dev-early.service
│ │                                   tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
│ ├─/run/credentials/systemd-sysusers.service
│ │                                   tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
│ ├─/run/credentials/systemd-tmpfiles-setup-dev.service
│ │                                   tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
│ ├─/run/credentials/systemd-tmpfiles-setup.service
│ │                                   tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
│ ├─/run/credentials/systemd-vconsole-setup.service
│ │                                   tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
│ └─/run/credentials/getty@tty1.service
│                                     tmpfs  tmpfs      ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes
├─/tmp                                tmpfs  tmpfs      rw,nosuid,nodev,size=16260560k,nr_inodes=1048576,inode64
├─/boot                               /dev/nvme0n1p1
│                                            vfat       rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,s
├─/home                               /dev/nvme0n1p4
│                                            ext4       rw,relatime
└─/ssd                                /dev/sda1
                                             ext4       rw,relatime

Note that the root and /home are mounted on different partitions of the same drive.

Offline

#4 2024-07-02 16:17:11

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

I mean there's perhaps a symlink in /srv/fabric (ie. /home/fabric_server_actual/fabric) that points at "/"

Offline

#5 2024-07-02 16:36:53

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

# ls -l /srv
total 12
lrwxrwxrwx 1 fabric  fabric    34 Jul  1 18:54 fabric -> /home/fabric_server_actual/fabric/
dr-xr-xr-x 2 root    root    4096 Jan 31  2023 ftp
drwxr-xr-x 2 root    root    4096 Jan 31  2023 http
drwxrwsr-x 3 papermc papermc 4096 Feb 24 23:07 papermc

# ls -l /home/fabric_server_actual/
total 4
drwxrwsr-x 12 fabric fabric 4096 Jul  1 18:15 fabric

# ls -l /home/fabric_server_actual/fabric/
total 47236
drwxr-sr-x  2 fabric fabric     4096 Jul  2 17:36 backup
-rw-r--r--  1 fabric fabric        2 Jul  2 17:37 banned-ips.json
-rw-r--r--  1 fabric fabric        2 Jul  2 17:37 banned-players.json
drwxr-xr-x  7 fabric fabric     4096 Jan 13 15:45 config
drwxr-sr-x  2 fabric fabric     4096 Feb  6 21:39 crash-reports
-rw-r--r--  1 fabric fabric      157 Jan 13 15:46 eula.txt
-rw-r--r--  1 fabric fabric      633 Jan 14 13:41 fabric-server-launch.jar
-rw-r--r--  1 fabric fabric       51 Jan 14 13:44 fabric-server-launcher.properties
drwxr-xr-x  8 fabric fabric     4096 Jan 14 13:44 libraries
drwxr-sr-x  2 fabric fabric    12288 Jul  2 17:36 logs
drwxr-xr-x  2 fabric fabric     4096 Feb 13 15:30 mods
-rw-r--r--  1 fabric fabric      535 Jul  2 17:37 ops.json
-rw-r--r--  1 fabric fabric 48285806 Jan 14 13:41 server.jar
-rw-r--r--  1 fabric fabric     1307 Jul  2 17:37 server.properties
-rw-r--r--  1 fabric fabric     1066 Jul  2 17:37 usercache.json
drwxr-sr-x  3 fabric fabric     4096 Jan 14 13:44 versions
-rw-r--r--  1 fabric fabric      847 Feb 18 21:49 whitelist.json
drwxr-sr-x 15 fabric fabric     4096 Jul  2 17:42 world
-rw-r--r--  1 fabric fabric       87 Jul  2 17:37 xaeroworldmap-common.txt

Looks to me like the only symlink is the fabric -> /home/fabric_server_actual/fabric/ link. /home/fabric_server_actual/fabric/logs/ is similarly empty of symlinks (but I omitted it due to its number of files). Thanks for the quick reply!

Offline

#6 2024-07-02 20:08:20

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

And what's i the directories?

find /home/fabric_server_actual/fabric/ -lname /

Offline

#7 2024-07-02 23:28:34

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Running find on the symlink doesn't return anything.

# find /srv/fabric/ -lname /

Running

 # find -L /srv/fabric/ 

works just fine (the contents of /home/fabric_server_actual/fabric/ are printed); the symlink doesn't appear broken.

Last edited by BiffenB (2024-07-02 23:29:38)

Offline

#8 2024-07-03 06:13:44

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

What snap package exactly are you trying to install? The error only appears in that context?
Please post the complete IO of the process.

Offline

#9 2024-07-03 11:41:09

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Haven't gotten to installing any snap packages yet, I am installing snap itself.

# pacman -U /home/[USER]/temp/snapd/snapd-2.63-1-x86_64.pkg.tar.zst
loading packages...
warning: snapd-2.63-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) snapd-2.63-1

Total Installed Size:  64.40 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                           [########################################] 100%
(1/1) checking package integrity                                         [########################################] 100%
(1/1) loading package files                                              [########################################] 100%
(1/1) checking for file conflicts                                        [########################################] 100%
(1/1) checking available disk space                                      [########################################] 100%
:: Processing package changes...
(1/1) reinstalling snapd                                                 [########################################] 100%
:: Running post-transaction hooks...
(1/5) Reloading system manager configuration...
(2/5) Reloading user manager configuration...
(3/5) Creating temporary files...
Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric.
Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric/logs.
error: command failed to execute correctly
(4/5) Arming ConditionNeedsUpdate...
(5/5) Reloading system bus configuration...

The .zst was prepared via the instructions on the wiki (cloning the repository and then makepkg(ing) it), except for the makepkg command, which I used the flags -si on, as follows:

makepkg -si

I tried installing python2 from the AUR using the exact same method, and it worked just fine:

# pacman -U /home/[USER]/temp3/python2/python2-2.7.18-11-x86_64.pkg.tar.zst
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) python2-2.7.18-11

Total Installed Size:  76.30 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                           [########################################] 100%
(1/1) checking package integrity                                         [########################################] 100%
(1/1) loading package files                                              [########################################] 100%
(1/1) checking for file conflicts                                        [########################################] 100%
(1/1) checking available disk space                                      [########################################] 100%
:: Processing package changes...
(1/1) installing python2                                                 [########################################] 100%
Optional dependencies for python2
    tk: for IDLE [installed]
    python2-setuptools
    python2-pip
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Offline

#10 2024-07-03 12:59:30

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Offline

#11 2024-07-03 15:30:20

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Yes, that's the correct AUR package.

I assume the relevant files from systemd-tmpfiles --tldr are both the snapd and fabricd ones? The fabric installation is from https://aur.archlinux.org/packages/fabric-server, but I can't imagine that's relevant since packages other than snap install just fine.

# /usr/lib/tmpfiles.d/snapd.conf
D! /tmp/snap-private-tmp 0700 root root -
# /usr/lib/tmpfiles.d/fabricd.conf
z /srv/fabric 2775 fabric fabric - -
d /srv/fabric/logs 2755 fabric fabric -
z /srv/fabric/logs - fabric fabric - -

Offline

#12 2024-07-03 22:02:37

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Does either of

sudo /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/snapd.conf
sudo /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/fabricd.conf

cause the warning?

Offline

#13 2024-07-03 22:43:16

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

The second one causes the warning! (The first one returns nothing.) What do I do now? I see that systemd-tmpfiles contains a bunch of options, but seeing as I've messed something up I'm refraining from trying anything myself.

# sudo /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/fabricd.conf
Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric.
Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric/logs.

Offline

#14 2024-07-03 23:03:08

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

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

#15 2024-07-04 06:44:42

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

If

sudo SYSTEMD_LOG_LEVEL=console:debug  /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/fabricd.conf

doesn't expose the problem, you'll have to strace it
(You can also try whether "/usr/bin/systemd-tmpfiles --dry-run --create /usr/lib/tmpfiles.d/fabricd.conf" still causes it)

Offline

#16 2024-07-04 12:22:42

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

I tried both commands you suggested, and also tried stack tracing them (following https://wiki.archlinux.org/title/Debugg … _a_program).

# sudo SYSTEMD_LOG_LEVEL=console:debug  /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/fabricd.conf
Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric.
Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric/logs.
# sudo SYSTEMD_LOG_LEVEL=console:debug /usr/bin/systemd-tmpfiles --dry-run --create /usr/lib/tmpfiles.d/fabricd.conf
Would create directory /srv/fabric/logs
Detected unsafe path transition /srv/fabric (owned by fabric) → / (owned by root) during canonicalization of srv/fabric/logs.

As you can see, the second one didn't generate the warning for srv/fabric, only srv/fabric/logs. Neither generated anything of interest in the stack trace (only newlines have been omitted):

Starting program: /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/fabricd.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Inferior 1 (process 82208) exited with code 0111]
Starting program: /usr/bin/systemd-tmpfiles --dry-run --create /usr/lib/tmpfiles.d/fabricd.conf
Downloading separate debug info for system-supplied DSO at 0x7ffff7fc7000
[###                                                                                                                 ]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Inferior 1 (process 82480) exited with code 0111]

Running gdb generated the same warnings in the console, but they weren't logged to the file.

Changing the ownership of the symlink doesn't do anything, because as soon as I run sudo SYSTEMD_LOG_LEVEL=console:debug  /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/fabricd.conf, the ownership changes back to fabric:fabric. Is there some other logging method I can use to gather more information on the warnings (since I can't stack trace them since the program exits normally)?

Offline

#17 2024-07-04 14:57:32

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

/usr/lib/tmpfiles.d/fabricd.conf - edit that file and see which line causes what error.
The last one looks pointless?

However, the error highly suggests that "/" is a child node of "/srv/fabric" which is rather weird and I can only imagine a symlink or a bind-mount inside that path.

As for the strace

strace -f -tt -o /tmp/tmpfiles.strace /usr/bin/systemd-tmpfiles --dry-run --create /usr/lib/tmpfiles.d/fabricd.conf
cat /tmp/tmpfiles.strace | curl -F 'file=@-' 0x0.st

Offline

#18 2024-07-04 18:48:49

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Sorry, didn't realise strace was a package - thought it referred to a gdb stack trace. Here is an excerpt of the output (the full output can be found here, once the pastebin post gets approved):

88867 19:30:47.587058 openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
88867 19:30:47.587073 openat(AT_FDCWD, "/usr/lib/locale/C.utf8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = 7
88867 19:30:47.587087 fstat(7, {st_mode=S_IFREG|0644, st_size=270, ...}) = 0
88867 19:30:47.587099 mmap(NULL, 270, PROT_READ, MAP_PRIVATE, 7, 0) = 0x7d706a0ff000
88867 19:30:47.587113 close(7)          = 0
88867 19:30:47.587127 openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
88867 19:30:47.587141 openat(AT_FDCWD, "/usr/lib/locale/C.utf8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = 7
88867 19:30:47.587155 fstat(7, {st_mode=S_IFREG|0644, st_size=1406, ...}) = 0
88867 19:30:47.587167 mmap(NULL, 1406, PROT_READ, MAP_PRIVATE, 7, 0) = 0x7d70698f7000
88867 19:30:47.587181 close(7)          = 0
88867 19:30:47.587195 openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_TIME", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
88867 19:30:47.587209 openat(AT_FDCWD, "/usr/lib/locale/C.utf8/LC_TIME", O_RDONLY|O_CLOEXEC) = 7
88867 19:30:47.587223 fstat(7, {st_mode=S_IFREG|0644, st_size=3360, ...}) = 0
88867 19:30:47.587236 mmap(NULL, 3360, PROT_READ, MAP_PRIVATE, 7, 0) = 0x7d70698f6000
88867 19:30:47.587252 close(7)          = 0
88867 19:30:47.587266 openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
88867 19:30:47.587280 openat(AT_FDCWD, "/usr/lib/locale/C.utf8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = 7
88867 19:30:47.587295 fstat(7, {st_mode=S_IFREG|0644, st_size=50, ...}) = 0
88867 19:30:47.587308 mmap(NULL, 50, PROT_READ, MAP_PRIVATE, 7, 0) = 0x7d70698f5000
88867 19:30:47.587321 close(7)          = 0
88867 19:30:47.587334 openat(AT_FDCWD, "/usr/lib/locale/C.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
88867 19:30:47.587348 openat(AT_FDCWD, "/usr/lib/locale/C.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = 7
88867 19:30:47.587363 fstat(7, {st_mode=S_IFREG|0644, st_size=360460, ...}) = 0
88867 19:30:47.587376 mmap(NULL, 360460, PROT_READ, MAP_PRIVATE, 7, 0) = 0x7d7068fa7000
88867 19:30:47.587390 close(7)          = 0
88867 19:30:47.587411 ioctl(1, TCGETS, {c_iflag=ICRNL|IXON, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B9600|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
88867 19:30:47.587432 ioctl(2, TCGETS, {c_iflag=ICRNL|IXON, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B9600|CS8|CREAD, c_lflag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
88867 19:30:47.587449 writev(2, [{iov_base="\33[0;1;38;5;185m", iov_len=15}, {iov_base="Detected unsafe path transition "..., iov_len=127}, {iov_base="\33[0m", iov_len=4}, {iov_base="\r\n", iov_len=2}], 4) = 148
88867 19:30:47.587471 close(4)          = 0
88867 19:30:47.587483 close(5)          = 0
88867 19:30:47.587495 close(6)          = 0
88867 19:30:47.587506 close(3)          = 0
88867 19:30:47.587542 exit_group(73)    = ?
88867 19:30:47.587704 +++ exited with 73 +++

The /usr/lib/tmpfiles.d/fabricd.conf file looks reasonable to me, but I could have missed something:

z /srv/fabric 2775 fabric fabric - -
d /srv/fabric/logs 2755 fabric fabric -
z /srv/fabric/logs - fabric fabric - -

Because even if the first line were to fail because it's a symbolic link, it shouldn't have a problem with the /logs folder, should it? I've also double-checked the permissions of the folders; /home/fabric_server_actual/fabric is set to 2775 (and the symbolic link defaults to 0777).

And, for completeness, here is my root:

# ls -la
total 60
drwxr-xr-x  20 root   root 4096 Jul  1 17:16 .
drwxr-xr-x  20 root   root 4096 Jul  1 17:16 ..
drwxr-xr-x   2 [USER] root 4096 Jan 14 13:00 .ssh
lrwxrwxrwx   1 root   root    7 Apr  7 20:02 bin -> usr/bin
drwxr-xr-x   4 root   root 4096 Jan  1  1970 boot
drwxr-xr-x  20 root   root 4100 Jul  2 17:45 dev
drwxr-xr-x  58 root   root 4096 Jul  4 19:43 etc
drwxr-xr-x   5 root   root 4096 Jul  1 17:12 home
lrwxrwxrwx   1 root   root    7 Apr  7 20:02 lib -> usr/lib
lrwxrwxrwx   1 root   root    7 Apr  7 20:02 lib64 -> usr/lib
drwxr-xr-x   3 root   root 4096 Jun  9  2023 media
drwxr-xr-x   2 root   root 4096 Jan 31  2023 mnt
drwxr-xr-x   2 root   root 4096 Jun  9  2023 nvme
drwxr-xr-x   2 root   root 4096 Jan 31  2023 opt
dr-xr-xr-x 214 root   root    0 Jul  2 17:35 proc
drwxr-x---   6 root   root 4096 Jul  4 14:15 root
drwxr-xr-x  23 root   root  580 Jul  2 17:35 run
lrwxrwxrwx   1 root   root    7 Apr  7 20:02 sbin -> usr/bin
drwxr-xr-x   5 root   root 4096 Jul  1 18:54 srv
drwxr-xr-x   7 root   root 4096 Jul  1 17:15 ssd
dr-xr-xr-x  13 root   root    0 Jul  2 17:39 sys
drwxrwxrwt  15 root   root  320 Jul  4 19:43 tmp
drwxr-xr-x   9 root   root 4096 Jul  4 19:44 usr
drwxr-xr-x  13 root   root 4096 Jul  2 17:35 var

Offline

#19 2024-07-04 19:48:56

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Just

cat /tmp/tmpfiles.strace | curl -F 'file=@-' 0x0.st

wasn't an option?
The contents of / are less relevant than the contents of  /srv/fabric - the error complains that "/" is found somehere below /srv/fabric

Offline

#20 2024-07-04 19:58:58

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Sorry - didn't realize it was uploading to a website, thought this was hosted locally somehow. Obvious in hindsight that it's hosted online...

http://0x0.st/Xadk.txt contains the results.

Offline

#21 2024-07-04 20:01:17

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

The contents of /srv/fabric are the same as my earlier post (quoted below)

# ls -la /srv/fabric/
total 47300
drwxrwsr-x 12 fabric fabric     4096 Jul  4 14:15 .
drwxr-xr-x  3 fabric fabric     4096 Jan 31 16:41 ..
-rw-------  1 fabric fabric    48000 Jul  4 14:15 .bash_history
drwxr-sr-x  3 fabric fabric     4096 Jan 14 13:44 .cache
drwxr-xr-x  5 fabric fabric     4096 Jan 13 15:45 .fabric
drwxr-sr-x  2 fabric fabric     4096 Jul  4 17:38 backup
-rw-r--r--  1 fabric fabric        2 Jul  4 14:15 banned-ips.json
-rw-r--r--  1 fabric fabric        2 Jul  4 14:15 banned-players.json
drwxr-xr-x  7 fabric fabric     4096 Jan 13 15:45 config
drwxr-sr-x  2 fabric fabric     4096 Feb  6 21:39 crash-reports
-rw-r--r--  1 fabric fabric      157 Jan 13 15:46 eula.txt
-rw-r--r--  1 fabric fabric      633 Jan 14 13:41 fabric-server-launch.jar
-rw-r--r--  1 fabric fabric       51 Jan 14 13:44 fabric-server-launcher.properties
drwxr-xr-x  8 fabric fabric     4096 Jan 14 13:44 libraries
drwxr-sr-x  2 fabric fabric    12288 Jul  4 14:15 logs
drwxr-xr-x  2 fabric fabric     4096 Feb 13 15:30 mods
-rw-r--r--  1 fabric fabric      535 Jul  4 14:15 ops.json
-rw-r--r--  1 fabric fabric 48285806 Jan 14 13:41 server.jar
-rw-r--r--  1 fabric fabric     1307 Jul  4 14:15 server.properties
-rw-r--r--  1 fabric fabric     1066 Jul  4 14:15 usercache.json
drwxr-sr-x  3 fabric fabric     4096 Jan 14 13:44 versions
-rw-r--r--  1 fabric fabric      847 Feb 18 21:49 whitelist.json
drwxr-sr-x 15 fabric fabric     4096 Jul  4 14:20 world
-rw-r--r--  1 fabric fabric       87 Jul  4 14:15 xaeroworldmap-common.txt
BiffenB wrote:
# ls -l /srv
total 12
lrwxrwxrwx 1 fabric  fabric    34 Jul  1 18:54 fabric -> /home/fabric_server_actual/fabric/
dr-xr-xr-x 2 root    root    4096 Jan 31  2023 ftp
drwxr-xr-x 2 root    root    4096 Jan 31  2023 http
drwxrwsr-x 3 papermc papermc 4096 Feb 24 23:07 papermc

# ls -l /home/fabric_server_actual/
total 4
drwxrwsr-x 12 fabric fabric 4096 Jul  1 18:15 fabric

# ls -l /home/fabric_server_actual/fabric/
total 47236
drwxr-sr-x  2 fabric fabric     4096 Jul  2 17:36 backup
-rw-r--r--  1 fabric fabric        2 Jul  2 17:37 banned-ips.json
-rw-r--r--  1 fabric fabric        2 Jul  2 17:37 banned-players.json
drwxr-xr-x  7 fabric fabric     4096 Jan 13 15:45 config
drwxr-sr-x  2 fabric fabric     4096 Feb  6 21:39 crash-reports
-rw-r--r--  1 fabric fabric      157 Jan 13 15:46 eula.txt
-rw-r--r--  1 fabric fabric      633 Jan 14 13:41 fabric-server-launch.jar
-rw-r--r--  1 fabric fabric       51 Jan 14 13:44 fabric-server-launcher.properties
drwxr-xr-x  8 fabric fabric     4096 Jan 14 13:44 libraries
drwxr-sr-x  2 fabric fabric    12288 Jul  2 17:36 logs
drwxr-xr-x  2 fabric fabric     4096 Feb 13 15:30 mods
-rw-r--r--  1 fabric fabric      535 Jul  2 17:37 ops.json
-rw-r--r--  1 fabric fabric 48285806 Jan 14 13:41 server.jar
-rw-r--r--  1 fabric fabric     1307 Jul  2 17:37 server.properties
-rw-r--r--  1 fabric fabric     1066 Jul  2 17:37 usercache.json
drwxr-sr-x  3 fabric fabric     4096 Jan 14 13:44 versions
-rw-r--r--  1 fabric fabric      847 Feb 18 21:49 whitelist.json
drwxr-sr-x 15 fabric fabric     4096 Jul  2 17:42 world
-rw-r--r--  1 fabric fabric       87 Jul  2 17:37 xaeroworldmap-common.txt

Looks to me like the only symlink is the fabric -> /home/fabric_server_actual/fabric/ link. /home/fabric_server_actual/fabric/logs/ is similarly empty of symlinks (but I omitted it due to its number of files). Thanks for the quick reply!

Offline

#22 2024-07-04 22:03:07

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

This doesn't list subdirectories…

ls -laR /srv/fabric/

Offline

#23 2024-07-04 23:35:25

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

All the subdirectories and respective files can be found here: http://0x0.st/Xa78.txt
There are no symbolic links in the subdirectories, least of all in the logs folder.

Offline

#24 2024-07-05 06:45:36

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

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

https://github.com/FabricMC/fabric/issues - but the error message is probably just nonsense, there's nothing resembling the root inside that path
Let's see who onws the link target path

stat / /home /home/fabric_server_actual

Offline

#25 2024-07-05 13:29:36

BiffenB
Member
Registered: 2024-07-01
Posts: 15

Re: [SOLVED] Unsafe path transition - symbolic link - installing Snap

Is it even a Fabric issue though, considering that Python2 installed without issue? Maybe I should create an issue in the Snap repo instead?

# stat / /home /home/fabric_server_actual
  File: /
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 259,3   Inode: 2           Links: 20
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-07-04 19:47:16.060647262 +0200
Modify: 2024-07-01 17:16:40.150578635 +0200
Change: 2024-07-01 18:16:36.893330575 +0200
 Birth: 2023-06-08 23:00:52.000000000 +0200
  File: /home
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 259,4   Inode: 2           Links: 5
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-07-04 14:08:42.854281922 +0200
Modify: 2024-07-01 17:12:28.130582356 +0200
Change: 2024-07-01 17:12:28.130582356 +0200
 Birth: 2023-06-08 23:02:56.000000000 +0200
  File: /home/fabric_server_actual
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 259,4   Inode: 66060289    Links: 3
Access: (0755/drwxr-xr-x)  Uid: (  970/  fabric)   Gid: (  970/  fabric)
Access: 2024-07-04 14:13:15.340944521 +0200
Modify: 2024-01-31 16:41:28.333311053 +0100
Change: 2024-07-04 14:13:12.067611233 +0200
 Birth: 2024-01-31 16:40:16.013312131 +0100

Offline

Board footer

Powered by FluxBB