FS#7525 - Permissions of .pacnew files
Attached to Project:
Pacman
Opened by Maciej Sitarz (macieks2) - Thursday, 28 June 2007, 01:35 GMT
Last edited by Dan McGee (toofishes) - Monday, 09 July 2007, 04:32 GMT
Opened by Maciej Sitarz (macieks2) - Thursday, 28 June 2007, 01:35 GMT
Last edited by Dan McGee (toofishes) - Monday, 09 July 2007, 04:32 GMT
|
Details
Summary and Info:
After updating packages, the .pacnew files have wrong permissions set: $ LANG="" ls -l /etc/sudoers* -r--r----- 1 root root 723 Jun 20 02:11 /etc/sudoers -rw-r--r-- 1 root root 608 Jun 27 00:26 /etc/sudoers.pacnew ("storylike" description here: http://bbs.archlinux.org/viewtopic.php?id=34606) Steps to Reproduce: 1. Be sure that /etc/sudoers file is modified (not default after install) 2. Update sudo package 3. Check file permissions of sudoers.pacnew file created |
This task depends upon
Closed by Dan McGee (toofishes)
Monday, 09 July 2007, 04:32 GMT
Reason for closing: Fixed
Additional comments about closing: fixed in git
Monday, 09 July 2007, 04:32 GMT
Reason for closing: Fixed
Additional comments about closing: fixed in git
fixed here : http://chantry.homelinux.org/~xav/git/gitweb.cgi?p=pacman.git;a=commitdiff;h=1a3b3bc1300b42dc2f554a6faa09b5ece2d3321c
seems to work fine after that change.
it determines if it should install it or not (with .pacnew suffix or not),
and then copies it from /tmp/ to final destination.
Now an additional chmod was added after the copying, to preserve the permission, and fixing the reported bug.
But I was thinking about another way of fixing this :
first compute md5 / sha1 by reading the file directly from the archive (without extracting it on disk),
then based on that, determine if the file should be extracted or not, with or without the .pacnew extension ,
and finally, extracting the file from the archive directly to the final filename.
So instead of three steps :
1) extracting to /tmp
2) copying if needed
3) chmod
we could have instead :
1) read from archive a first time, and compute md5 on the fly
2) extracts if needed on disk (a second read from the archive, so less efficient :( )
It would have avoided the current bug, and also the following bug with libarchive 1.3.1 :
http://bugs.archlinux.org/task/7323
Dan's patch has fixed the problem. For now there doesn't seem to be a better solution.
and we record this information somehow.
And then a second time, where we actually extract the files.
Otherwise, the files in backup array are always small config files afaik, but well, it could be indeed be safer
to avoid putting the whole file in memory.
Oh well, finally, the current behavior is alright I guess, and this is probably not the correct place for discussing about things anyway (silly me).
So I think this bug could be closed now :)