xfce4 reverts to mirrored dislays

Polytropon freebsd at edvax.de
Sun Jan 21 00:31:44 UTC 2018


On Sat, 20 Jan 2018 20:21:34 +0100, Ralf Mardorf via freebsd-questions wrote:
> On Sat, 20 Jan 2018 20:08:46 +0100, Polytropon wrote:
> >As it seems, the immutable flag is not set.
> 
> Indeed, this makes sense, while my second guess is idiotic, see on Sat,
> 
> 20 Jan 2018 19:23:02 +0100, Ralf Mardorf wrote:
> >On Sat, 20 Jan 2018 19:06:47 +0100, Ralf Mardorf wrote:
> >>actually it's impossible to change permissions of an immutable file.  
> >
> >Perhaps I'm mistaken regarding "permissions",however, what ever the
> >permissions should be, the file remains immutable,
> >un-over{ride,write}able ;).
> 
> Somebody needs to have permission to set or clear the immutable flag ;).

Being able to change the permissions or ownership would first
require "chflags noschg", which usually only root can perform.
So even though my suggestion doesn't deserve the name "solution",
it _should_ actually prevent any file changes, even if the
process which changes the file is UID 0.

# touch /tmp/testfile
# ll -o /tmp/testfile
-rw-r--r--  1 root  wheel     - 0 2018-01-21 01:27:49 /tmp/testfile

# chmod -w /tmp/testfile 
# ll -o /tmp/testfile
-r--r--r--  1 root  wheel     - 0 2018-01-21 01:27:49 /tmp/testfile
  ^
Writing flag is gone.

# chflags schg /tmp/testfile 
# ll -o /tmp/testfile
-r--r--r--  1 root  wheel  schg 0 2018-01-21 01:27:49 /tmp/testfile

The file is now locked / immutable.

# chown ftp:ftp /tmp/testfile
chown: /tmp/testfile: Operation not permitted
# chmod +w /tmp/testfile 
chmod: /tmp/testfile: Operation not permitted
# rm /tmp/testfile 
override r--r--r--  root/wheel schg for /tmp/testfile? y
rm: /tmp/testfile: Operation not permitted

Without a "chflags noschg" issued by root, the file will stay
as it is (content, ownership, permissions).



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list