From owner-freebsd-questions@freebsd.org Sun Jan 21 04:14:33 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03AA6EB6754 for ; Sun, 21 Jan 2018 04:14:33 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) Received: from sonic303-19.consmr.mail.ir2.yahoo.com (sonic303-19.consmr.mail.ir2.yahoo.com [77.238.178.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94D507A07A for ; Sun, 21 Jan 2018 04:14:31 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) X-YMail-OSG: PjHtHRgVM1nG1akYug5BaEpGLVXiOaCtlYE088fcAvHXux4KS4tol2ToLPEWlkR EU.MSSP9MGMLJILimT9T0P65t9hikihxIaTfjiPARzXpa9kM8W0XkGjLD2.x1hay4cLRoEjc63RP nuJgKP_IJR_mywIxWIRmjtZxaT6uBELMbCb3oJjHLgubFcJbV5nfLAyIgAnZfT.ocLSaCXpKSbxa xMmjrwTIIZJTV.mzmSJItNfv.UY7ro7_HuyYndob3Ww2PV75XeFNT4QJCPJKAxAmVQuTIaW5QgbW R_pBZZqLFt6njuImsZ4abdfac7DQi_5YeRLJIJZh0pIyGpGadEFyaXUshHPn3H0FoiqdhfCKEN3F pc1zrTfxwT45UmfW.SO1qUrac63hAJnH7yg9S2ieC2vlpadUiB6oaEfUVlfQxCfZJOufIaHGxfsS rQQ01Z8IAUZEBeMhDpS2P4H_unCDwub.uUMoESHnJ2s.qyXUtMt1SjdYfo4V_KF6UAyjEZ_AFWBo 0NTmdYz_lin0Se7RXVYG4tCu7QXlfhgS08EjGJM.iAQ3UIGq8vA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Sun, 21 Jan 2018 04:14:24 +0000 Received: from smtpgate101.mail.ir2.yahoo.com (EHLO archlinux.localdomain) ([217.146.189.7]) by smtp411.mail.ir2.yahoo.com (JAMES SMTP Server ) with ESMTPA ID dd32dccd3fc288f98a32e435628c1f3c for ; Sun, 21 Jan 2018 04:14:23 +0000 (UTC) Date: Sun, 21 Jan 2018 05:14:26 +0100 From: Ralf Mardorf To: freebsd-questions@freebsd.org Subject: Re: xfce4 reverts to mirrored dislays Message-ID: <20180121051426.4879cab4@archlinux.localdomain> In-Reply-To: <20180121013136.3bf3440a.freebsd@edvax.de> References: <20180120125636.6ad88128.freebsd@edvax.de> <20180120134001.65ddb697@archlinux.localdomain> <20180120141518.7a85ed99@planb.netng.org> <2c24a50e-c7d1-0841-bee6-9f015d48a927@nethead.se> <20180120170942.532834dd.freebsd@edvax.de> <20180120190647.01b163d0@archlinux.localdomain> <20180120200846.e0925689.freebsd@edvax.de> <20180120202134.7e20734b@archlinux.localdomain> <20180121013136.3bf3440a.freebsd@edvax.de> X-Mailer: Claws Mail 3.16.0git3 (GTK+ 2.24.32; x86_64-arch-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jan 2018 04:14:33 -0000 On Sun, 21 Jan 2018 01:31:36 +0100, Polytropon wrote: >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. As already pointed out, my second guess is idiotic. ># 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). A little bit off-topic, but not completely unimportant. FreeBSD tar and cp seem to be more or less equal to Linux tar and cp, IOW tar seems to require --xattr and cp seems to require -a to preserve the immutable flag. https://www.freebsd.org/cgi/man.cgi?tar(1) https://www.freebsd.org/cgi/man.cgi?cp So if the workaround should work, it requires to care about it, if e.g. a backup strategy should be based upon tar or cp. -- https://www.schneier.com/blog/archives/2018/01/spectre_and_mel_1.html