butterknife - strange directory permissions #17

Closed
opened 2026-09-15 14:39:54 +00:00 by eg2-o · 1 comment

Hi Drew,

first of all, I was extremely happy when I found Butterknife. I’ve wanted a Debian installer like this for a long time. I really like Debian, but getting a proper BTRFS setup with subvolumes, Timeshift and GRUB rollback working nicely has always involved a lot of manual work. Having an installer that takes care of all of this is exactly what I was looking for.

I’ve been testing Butterknife in a VM and noticed something with the directory permissions that I wanted to report.

GUFW gave me a warning about /lib being writable. I checked a few directories afterwards and found that several system directories are 775 instead of the 755 I normally see on Debian.

For example, directly after a fresh install:

775 root:root /usr/bin
755 root:root /usr/sbin
775 root:root /usr/lib
775 root:root /usr/share
775 root:root /usr/local
775 root:root /usr/local/sbin

755 root:root /etc
755 root:root /etc/apt
775 root:root /etc/systemd
775 root:root /etc/systemd/system
775 root:root /etc/grub.d
775 root:root /etc/default

755 root:root /var
755 root:root /var/lib
755 root:root /var/log

At first I thought this might have happened because I had upgraded the system or changed something myself.

So I made another fresh installation and checked the permissions before doing any updates. They were already like this.

I then tried again with the newer Butterknife 0.3.2 ISO on a fresh virtual disk and got the same result immediately after installation.

I compared the same directories with a normal Debian installation and they are 755 there.

Maybe there is a reason for the 775 permissions that I’m not aware of, but since GUFW complained about /lib it seemed worth mentioning.

No hurry at all. I just wanted to let you know because I really like the idea behind Butterknife and hope to use it for my Debian systems.

Thanks for your work on it!
And I hope I haven't reported something as a bug here that is actually intentional. :-)

Best regards
Oliver

Hi Drew, first of all, I was extremely happy when I found Butterknife. I’ve wanted a Debian installer like this for a long time. I really like Debian, but getting a proper BTRFS setup with subvolumes, Timeshift and GRUB rollback working nicely has always involved a lot of manual work. Having an installer that takes care of all of this is exactly what I was looking for. I’ve been testing Butterknife in a VM and noticed something with the directory permissions that I wanted to report. GUFW gave me a warning about `/lib` being writable. I checked a few directories afterwards and found that several system directories are 775 instead of the 755 I normally see on Debian. For example, directly after a fresh install: ```text id="9k2wvt" 775 root:root /usr/bin 755 root:root /usr/sbin 775 root:root /usr/lib 775 root:root /usr/share 775 root:root /usr/local 775 root:root /usr/local/sbin 755 root:root /etc 755 root:root /etc/apt 775 root:root /etc/systemd 775 root:root /etc/systemd/system 775 root:root /etc/grub.d 775 root:root /etc/default 755 root:root /var 755 root:root /var/lib 755 root:root /var/log ``` At first I thought this might have happened because I had upgraded the system or changed something myself. So I made another fresh installation and checked the permissions before doing any updates. They were already like this. I then tried again with the newer Butterknife 0.3.2 ISO on a fresh virtual disk and got the same result immediately after installation. I compared the same directories with a normal Debian installation and they are 755 there. Maybe there is a reason for the 775 permissions that I’m not aware of, but since GUFW complained about `/lib` it seemed worth mentioning. No hurry at all. I just wanted to let you know because I really like the idea behind Butterknife and hope to use it for my Debian systems. Thanks for your work on it! And I hope I haven't reported something as a bug here that is actually intentional. :-) Best regards Oliver
Owner

Thanks Oliver, this is a real bug and not intentional. Good catch, and thanks for doing the second clean install to rule yourself out.

Cause: the installer copies its overlay files onto the new system with cp -a, and cp -a stamps the source directory modes onto directories that already exist on the target. The checkout the ISO is built from has group-writable directories, so /usr/lib, /etc/systemd and the rest of the list you posted came out 775. Only /, /etc and /usr were being reset afterwards, which is why those three looked right.

It is 775 root:root, so on a stock install nobody but root can write there. Still wrong, and it should not be shipping. Fixed on dev; the overlay now goes through tar with modes normalised and existing directories left alone. It will be in 0.3.3, which I am building now.
For your existing install, this puts the affected directories back to stock. Package upgrades will not do it for you, since dpkg does not change the mode of a directory that already exists:

sudo chmod 755 /usr/bin /usr/lib /usr/share /usr/local \ 
/usr/local/sbin /etc/systemd /etc/systemd/system \
/etc/grub.d /etc/default
sudo chmod 644 /usr/lib/os-release /etc/default/grub-btrfs/config \
/usr/lib/systemd/system/grub-btrfsd.service \
 /etc/systemd/system/grub-btrfsd.service.d/timeshift.conf \
 /etc/NetworkManager/conf.d/20-connectivity.conf

Thanks Oliver, this is a real bug and not intentional. Good catch, and thanks for doing the second clean install to rule yourself out. Cause: the installer copies its overlay files onto the new system with cp -a, and cp -a stamps the source directory modes onto directories that already exist on the target. The checkout the ISO is built from has group-writable directories, so /usr/lib, /etc/systemd and the rest of the list you posted came out 775. Only /, /etc and /usr were being reset afterwards, which is why those three looked right. It is 775 root:root, so on a stock install nobody but root can write there. Still wrong, and it should not be shipping. Fixed on dev; the overlay now goes through tar with modes normalised and existing directories left alone. It will be in 0.3.3, which I am building now. For your existing install, this puts the affected directories back to stock. Package upgrades will not do it for you, since dpkg does not change the mode of a directory that already exists: ``` sudo chmod 755 /usr/bin /usr/lib /usr/share /usr/local \ /usr/local/sbin /etc/systemd /etc/systemd/system \ /etc/grub.d /etc/default ``` ``` sudo chmod 644 /usr/lib/os-release /etc/default/grub-btrfs/config \ /usr/lib/systemd/system/grub-btrfsd.service \ /etc/systemd/system/grub-btrfsd.service.d/timeshift.conf \ /etc/NetworkManager/conf.d/20-connectivity.conf ```
drew closed this issue 2026-09-15 17:25:38 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
drew/butterknife#17
No description provided.