You are not logged in.

#1 2011-09-01 17:00:55

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Preventing root from overwriting a file

Is there any way to keep pacman (or other package managers that run as root) from overwriting a file in a directory where it would normally be overwritten? Without using the immutable flag (which only works on ext* filesystems)? I know this should strictly never be necessary, but if there is any way to render things read-only for root, I think it would be useful to know.

Offline

#2 2011-09-01 17:18:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Preventing root from overwriting a file

Pacman creates .pacnew files for the files in backup array:

[karol@black ~]$ sp -Qii initscripts
Name           : initscripts
Version        : 2011.07.3-1
URL            : http://www.archlinux.org
Licenses       : GPL2
Groups         : base
Provides       : None
Depends On     : glibc  bash  grep  coreutils  udev>=171  iproute2  ncurses  kbd  findutils
                 sysvinit
Optional Deps  : bridge-utils: Network bridging support
                 dhcpcd: DHCP network configuration
                 net-tools: legacy network support
                 wireless_tools: Wireless networking
Required By    : None
Conflicts With : None
Replaces       : None
Installed Size : 112,00 K
Packager       : Tom Gundersen <teg@jklm.no>
Architecture   : i686
Build Date     : czw, 28 lip 2011, 14:42:30
Install Date   : nie, 31 lip 2011, 09:14:39
Install Reason : Explicitly installed
Install Script : Yes
Description    : System initialization/bootup scripts
Backup Files:
MODIFIED	/etc/inittab
MODIFIED	/etc/rc.conf
MODIFIED	/etc/rc.local
UNMODIFIED	/etc/rc.local.shutdown
UNMODIFIED	/etc/conf.d/wireless

Offline

#3 2011-09-01 17:45:36

thestinger
Package Maintainer (PM)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: Preventing root from overwriting a file

You can add files to NoUpgrade in pacman.conf and upgrades will be installed as .pacnew

Offline

#4 2011-09-01 19:52:19

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Preventing root from overwriting a file

Ah, thank you very much! Now I feel pretty stupid.

Offline

Board footer

Powered by FluxBB