FS#43272 - updpkgsums changes permissions to 600

Attached to Project: Pacman
Opened by Joakim Hernberg (jhernberg) - Tuesday, 30 December 2014, 12:39 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 04 January 2015, 17:23 GMT
Task Type Bug Report
Category Scripts & Tools
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version 4.2.0
Due in Version 4.2.1
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
updpkgsums changes the permissions of PKGBUILD to 600

Additional info:
pacman 4.2.0-5

Steps to reproduce:
Just run updpkgsums in a dir with a PKGBUILD.
This task depends upon

Closed by  Dave Reisner (falconindy)
Sunday, 04 January 2015, 17:23 GMT
Reason for closing:  Fixed
Additional comments about closing:  https://projects.archlinux.org/pacman.gi t/commit/?id=ca5a2771aeb0
Comment by Allan McRae (Allan) - Tuesday, 30 December 2014, 12:58 GMT
  • Field changed: Category (Packages: Core → Scripts & Tools)
  • Field changed: Reported Version ( → 4.2.0)
  • Field changed: Due in Version (Undecided → 4.2.1)
  • Field changed: Architecture (All → All)
  • Task assigned to Dave Reisner (falconindy)
I guess this is due to the change to tempfile usage.
Comment by Johannes Löthberg (demize) - Tuesday, 30 December 2014, 13:07 GMT
`mktemp` creates temp files with 0600. I wonder if we could use `chmod`’s `--reference` flag an point it at the PKGBUILD to get the same permissions.
Comment by Dave Reisner (falconindy) - Tuesday, 30 December 2014, 13:14 GMT
> I wonder if we could use `chmod`’s `--reference` flag an point it at the PKGBUILD to get the same permissions.
That was my first thought as well, but the flag is GNU specific and doesn't exist anywhere else. Scraping the permissions off of the file also gets painful because stat(1) isn't portable. The simplest solution I can come up with is using cat to "copy" the file. This retains permissions, and there's already an exit trap to clean up afterwards.
Comment by Johannes Löthberg (demize) - Tuesday, 30 December 2014, 13:28 GMT
Ah, not optimal but that sounds okay, yeah.

Loading...