You are not logged in.

#1 2015-02-22 20:48:14

ssri
Member
Registered: 2010-02-16
Posts: 216

p7zip: warning: directory permissions differ

During the update of p7zip (9.38-2 > 9.38-3), I get the following warnings:

(5/8) upgrading p7zip       [--------------------------------------------------] 100%
warning: directory permissions differ on /usr/share/doc/p7zip/MANUAL/
filesystem: 704  package: 755
warning: directory permissions differ on /usr/share/doc/p7zip/MANUAL/switches/
filesystem: 704  package: 755
warning: directory permissions differ on /usr/share/doc/p7zip/MANUAL/commands/
filesystem: 704  package: 755

Last edited by ssri (2015-02-22 20:48:31)

Offline

#2 2015-02-22 21:15:04

utopyand
Member
Registered: 2012-09-05
Posts: 33

Re: p7zip: warning: directory permissions differ

There's a bug opened: https://bugs.archlinux.org/task/43914

Last edited by utopyand (2015-02-22 21:15:37)

Offline

#3 2015-02-22 21:19:45

mkoskar
Member
Registered: 2014-07-16
Posts: 64
Website

Re: p7zip: warning: directory permissions differ

Also see https://bbs.archlinux.org/viewtopic.php?id=193892.

Most notably:

anatolik wrote:

I believe upcoming pacman release 4.2.1 is going to disable these warnings https://projects.archlinux.org/pacman.g … a036e749c8

Offline

#4 2015-02-22 23:51:32

Salkay
Member
Registered: 2014-05-22
Posts: 682

Re: p7zip: warning: directory permissions differ

So I guess these warnings arise from changes in packages? i.e. the previous version installed those files with permissions as 704, and the current version changed them to 755? Presumably pacman doesn't want to modify those directories itself. That seems odd though, as I would have thought pacman could read the old packages permission, and realise that there was a deliberate change in the current version.

In any case, almost all of /usr/share/doc has 755 permissions, so I presume that's how /usr/share/doc/p7zip/MANUAL/ should be.

$ sudo find /usr/share/doc -type d ! -perm 755
/usr/share/doc/wcslib-4.25.1
/usr/share/doc/wcslib-4.25.1/html
/usr/share/doc/p7zip/MANUAL
/usr/share/doc/p7zip/MANUAL/switches
/usr/share/doc/p7zip/MANUAL/commands

(The exception, /usr/share/doc/wcslib-4.25.1, has 775 permissions.)

utopyand wrote:

FWIW the closing comment of the bug has a typo; I guess they meant chmod to 755, not 775.

Offline

#5 2015-02-23 01:05:13

mkoskar
Member
Registered: 2014-07-16
Posts: 64
Website

Re: p7zip: warning: directory permissions differ

Salkay wrote:

So I guess these warnings arise from changes in packages? i.e. the previous version installed those files with permissions as 704, and the current version changed them to 755?

Not really. These warnings generally are a good thing and should warn you about deviation between expected state and current state as found on filesystem. That may be symptomatic to manipulation, which could be intended e.g., by changing configuration file (it will be reported with changed timestamp and size) or unintended, or even malicious. All these warnings are reported with "pacman -Qkk". I've setup cron job which runs every day and makes a diff essentially of what has changed regarding all tracked files on filesystem. It helps me verify state of my custom configurations / changes with a per-day history.

Problem is that some packages are doing manipulation of filesystem (e.g., changing of permissions) in install script, so then metadata which are recorded for package during build time (mtree file) goes out of sync with the state on filesystem after package installation. That in effect makes interpretation of "pacman -Qkk" harder. Ideally if nothing has been changed by user, its output would be empty. That's not the case now. I had this on my TODO list to report these packages I've found problematic (or rather discuss if this is considered a bug). Then reading the thread mentioned above with upcoming "workaround" in pacman it seems that this is a known issue and will be handled in future.

Offline

#6 2015-02-23 01:18:17

Salkay
Member
Registered: 2014-05-22
Posts: 682

Re: p7zip: warning: directory permissions differ

Interesting! Thanks for sharing the `pacman -Qkk` hint. That sounds like a great idea in theory, but as you suggest, there are so many false positives when I ran it.

Also, in the case of p7zip specifically, I've never modified /usr/share/doc/p7zip/MANUAL/, so surely the previous version of p7zip was responsible for the 704 permissions? And hence the never package must have changed it to 755?

Offline

#7 2015-02-23 02:16:04

mkoskar
Member
Registered: 2014-07-16
Posts: 64
Website

Re: p7zip: warning: directory permissions differ

Ok, regarding p7zip my theory is not correct. Probably what happened is what you've described but then you get warning only during install. Upon installation all permissions should got fixed. I was talking more about the case when even after installation `pacman -Qkk` still reports warnings. Does it report warnings for your p7zip package now (pacman -Qkk p7zip)? Regarding those false positive, yes ... those make it less readable, but e.g. for me since I do diff between two subsequent days, changeset is usually very small easy to go through.

Edit: typos

Last edited by mkoskar (2015-02-23 02:17:01)

Offline

#8 2015-02-23 02:43:50

Salkay
Member
Registered: 2014-05-22
Posts: 682

Re: p7zip: warning: directory permissions differ

Ah, diffing between days is a very clever idea.

After installation, they were not fixed, and I had to manually change the permissions. Is that not expected behaviour though? Pacman hasn't changed it on two previous warnings for me.

Since I've already manually fixed them, `pacman -Qkk p7zip` doesn't report problems, but I reverted my changes just to check, and can confirm that it complains correctly then.

Offline

#9 2015-02-23 02:49:13

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: p7zip: warning: directory permissions differ

If pacman does it right, then the permissions should be handled in a three-way diff (file system, new file, old mtree entry) just like configuration files. I'm not sure if pacman does that or if it only compares the file system with the new permissions with a warning.
Edit: Sorry, this only applies to directories, and there is little pacman can do. A directory can be part of multiple packages and each package can provide different permissions. pacman can only warn about problems, otherwise it has to do an expensive search and compare the permissions in all packages. You might provide such funcitonality in a separate tool just like pacdiff is not part of pacman.

Last edited by progandy (2015-02-23 02:53:48)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#10 2015-02-23 09:23:45

mkoskar
Member
Registered: 2014-07-16
Posts: 64
Website

Re: p7zip: warning: directory permissions differ

progandy wrote:

Edit: Sorry, this only applies to directories, and there is little pacman can do. A directory can be part of multiple packages and each package can provide different permissions. pacman can only warn about problems, otherwise it has to do an expensive search and compare the permissions in all packages. You might provide such funcitonality in a separate tool just like pacdiff is not part of pacman.

I see, you are right. Regarding directories provided by multiple packages, I don't think that would be major problem, because all that well-known directories will have permission "standardized" over time.
I went and checked my actual `pacman -Qkk` and in fact there are not a whole lot of false positives, and the reasons for them are different obviously. For myself I don't mind fixing p7zip manually.

For sake of completes bellow are my "false positives", apart from p7zip other cases are what I was describing above (and wrongly extended to apply to p7zip), they do "chown" and "chmod" in install script. I've noticed this some time ago but didn't have time to follow-up on it.

mongodb: /var/lib/mongodb (GID mismatch)
mongodb: /var/lib/mongodb (UID mismatch)
mongodb: /var/log/mongodb (GID mismatch)
mongodb: /var/log/mongodb (UID mismatch)
p7zip: /usr/share/doc/p7zip/MANUAL (Permissions mismatch)
p7zip: /usr/share/doc/p7zip/MANUAL/commands (Permissions mismatch)
p7zip: /usr/share/doc/p7zip/MANUAL/switches (Permissions mismatch)
postfix: /usr/bin/postdrop (GID mismatch)
postfix: /usr/bin/postdrop (Permissions mismatch)
postfix: /usr/bin/postqueue (GID mismatch)
postfix: /usr/bin/postqueue (Permissions mismatch)
postfix: /var/lib/postfix (UID mismatch)
postfix: /var/spool/postfix/active (UID mismatch)
postfix: /var/spool/postfix/bounce (UID mismatch)
postfix: /var/spool/postfix/corrupt (UID mismatch)
postfix: /var/spool/postfix/defer (UID mismatch)
postfix: /var/spool/postfix/deferred (UID mismatch)
postfix: /var/spool/postfix/flush (UID mismatch)
postfix: /var/spool/postfix/hold (UID mismatch)
postfix: /var/spool/postfix/incoming (UID mismatch)
postfix: /var/spool/postfix/maildrop (GID mismatch)
postfix: /var/spool/postfix/maildrop (UID mismatch)
postfix: /var/spool/postfix/private (UID mismatch)
postfix: /var/spool/postfix/public (GID mismatch)
postfix: /var/spool/postfix/public (UID mismatch)
postfix: /var/spool/postfix/saved (UID mismatch)
postfix: /var/spool/postfix/trace (UID mismatch)
privoxy: /etc/privoxy (GID mismatch)
privoxy: /etc/privoxy (UID mismatch)
privoxy: /etc/privoxy/config (UID mismatch)
privoxy: /etc/privoxy/default.action (UID mismatch)
privoxy: /etc/privoxy/default.filter (UID mismatch)
privoxy: /etc/privoxy/match-all.action (UID mismatch)
privoxy: /etc/privoxy/templates (GID mismatch)
privoxy: /etc/privoxy/templates (UID mismatch)
privoxy: /etc/privoxy/templates/blocked (GID mismatch)
privoxy: /etc/privoxy/templates/blocked (UID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-404 (GID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-404 (UID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-bad-param (GID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-bad-param (UID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-disabled (GID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-disabled (UID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-file (GID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-file (UID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-file-read-only (GID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-file-read-only (UID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-modified (GID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-modified (UID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-parse (GID mismatch)
privoxy: /etc/privoxy/templates/cgi-error-parse (UID mismatch)
privoxy: /etc/privoxy/templates/cgi-style.css (GID mismatch)
privoxy: /etc/privoxy/templates/cgi-style.css (UID mismatch)
privoxy: /etc/privoxy/templates/connect-failed (GID mismatch)
privoxy: /etc/privoxy/templates/connect-failed (UID mismatch)
privoxy: /etc/privoxy/templates/connection-timeout (GID mismatch)
privoxy: /etc/privoxy/templates/connection-timeout (UID mismatch)
privoxy: /etc/privoxy/templates/default (GID mismatch)
privoxy: /etc/privoxy/templates/default (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-add-url-form (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-add-url-form (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-for-url (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-for-url (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-for-url-filter (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-for-url-filter (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-list (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-list (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-list-button (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-list-button (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-list-section (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-list-section (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-list-url (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-list-url (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-remove-url-form (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-remove-url-form (UID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-url-form (GID mismatch)
privoxy: /etc/privoxy/templates/edit-actions-url-form (UID mismatch)
privoxy: /etc/privoxy/templates/forwarding-failed (GID mismatch)
privoxy: /etc/privoxy/templates/forwarding-failed (UID mismatch)
privoxy: /etc/privoxy/templates/mod-local-help (GID mismatch)
privoxy: /etc/privoxy/templates/mod-local-help (UID mismatch)
privoxy: /etc/privoxy/templates/mod-support-and-service (GID mismatch)
privoxy: /etc/privoxy/templates/mod-support-and-service (UID mismatch)
privoxy: /etc/privoxy/templates/mod-title (GID mismatch)
privoxy: /etc/privoxy/templates/mod-title (UID mismatch)
privoxy: /etc/privoxy/templates/mod-unstable-warning (GID mismatch)
privoxy: /etc/privoxy/templates/mod-unstable-warning (UID mismatch)
privoxy: /etc/privoxy/templates/no-server-data (GID mismatch)
privoxy: /etc/privoxy/templates/no-server-data (UID mismatch)
privoxy: /etc/privoxy/templates/no-such-domain (GID mismatch)
privoxy: /etc/privoxy/templates/no-such-domain (UID mismatch)
privoxy: /etc/privoxy/templates/show-request (GID mismatch)
privoxy: /etc/privoxy/templates/show-request (UID mismatch)
privoxy: /etc/privoxy/templates/show-status (GID mismatch)
privoxy: /etc/privoxy/templates/show-status (UID mismatch)
privoxy: /etc/privoxy/templates/show-status-file (GID mismatch)
privoxy: /etc/privoxy/templates/show-status-file (UID mismatch)
privoxy: /etc/privoxy/templates/show-url-info (GID mismatch)
privoxy: /etc/privoxy/templates/show-url-info (UID mismatch)
privoxy: /etc/privoxy/templates/show-version (GID mismatch)
privoxy: /etc/privoxy/templates/show-version (UID mismatch)
privoxy: /etc/privoxy/templates/toggle (GID mismatch)
privoxy: /etc/privoxy/templates/toggle (UID mismatch)
privoxy: /etc/privoxy/templates/toggle-mini (GID mismatch)
privoxy: /etc/privoxy/templates/toggle-mini (UID mismatch)
privoxy: /etc/privoxy/templates/untrusted (GID mismatch)
privoxy: /etc/privoxy/templates/untrusted (UID mismatch)
privoxy: /etc/privoxy/templates/url-info-osd.xml (GID mismatch)
privoxy: /etc/privoxy/templates/url-info-osd.xml (UID mismatch)
privoxy: /etc/privoxy/trust (UID mismatch)
privoxy: /etc/privoxy/user.action (UID mismatch)
privoxy: /etc/privoxy/user.filter (UID mismatch)
privoxy: /var/log/privoxy (UID mismatch)
tor: /var/lib/tor (GID mismatch)
tor: /var/lib/tor (UID mismatch)

Offline

#11 2015-02-23 13:14:34

utopyand
Member
Registered: 2012-09-05
Posts: 33

Re: p7zip: warning: directory permissions differ

So, after all, these warnings were a feature of older pacman (<4.2.1, btw just updated) when a package couldn't update permissions? I don't think they were all false positives, i found some dirs with the older permissions instead of the ones in the warning.

In future versions pacman should correct these warnings automatically? Or with something similar to pacnew files?
A good way cold be the one used by 'yaourt -C', a list of problems and a choice to how correct them (permission mismatch, current: 700 package: 755, options: choose current, choose new, ignore)

Offline

Board footer

Powered by FluxBB