pbzip2 turns read-only empty file to rewritable one
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pbzip2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
How to reproduce the bug:
1.) Create an empty file and make it read-only. E.g.
-r-------- 1 konopka konopka 0 apr 24 18:18 empty_file
2.) Apply pbzip2 on it:
pbzip2 empty_file
3.) List its name:
ls -l empty_file.bz2
The ls command shows
-rw------- 1 konopka konopka 14 apr 24 18:24 empty_file.bz2
I.e. the file has been turned into rewritable.
It may look ridiculous to care about empty files but __there are__ situations when user wants to keep them. Such file can for example serve as an indicator at which time some event occured; there is an information coded in the file name and in the time of the last access to the file. If some program (which can be a simulation running for several days) produces such an empty file, user know at which time the file was produced.
The standard (but slower) bzip2 program does not modify permissions.
pbzip2 modifies the permision also when processing several file in single command:
pbzip *.dat
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: pbzip2 1.1.6-1
ProcVersionSign
Uname: Linux 3.2.0-23-generic i686
ApportVersion: 2.0.1-0ubuntu5
Architecture: i386
Date: Tue Apr 24 18:20:01 2012
InstallationMedia: Xubuntu 12.04 LTS "Precise Pangolin" - Beta i386 (20120328)
ProcEnviron:
LANGUAGE=sk:en
TERM=xterm
PATH=(custom, user)
LANG=sk_SK.UTF-8
SHELL=/bin/bash
SourcePackage: pbzip2
UpgradeStatus: No upgrade log present (probably fresh install)
This is effectively the same as bug #1011021 which was fixed in version 1.1.8 (available since quantal). I've tested the scenario in this bug and it works fine now.