NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/37944: [patch]: gzip cannot preserve utimes() because it first sets chflags()



>Number:         37944
>Category:       bin
>Synopsis:       [patch]: gzip cannot preserve utimes() because it first sets 
>chflags()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 03 10:35:00 +0000 2008
>Originator:     Ighighi
>Release:        
>Organization:
>Environment:
>Description:
Both gzip & gunzip fail to preserve the input file's times on files with
the immutable and/or append flags because chflags() is called before utimes().
 
>How-To-Repeat:
$ /usr/bin/touch /tmp/foo
$ /bin/chflags uchg /tmp/foo
$ /usr/bin/gzip -v /tmp/foo
gzip: couldn't utimes: /tmp/foo.gz: Operation not permitted
/tmp/foo: -99.9% -- replaced with /tmp/foo.gz
>Fix:
I sent a simple patch to FreeBSD, making it run utimes() / chflags()
http://www.freebsd.org/cgi/query-pr.cgi?pr=120208

Note that src/usr.bin/compress/compress.c does the right thing...




Home | Main Index | Thread Index | Old Index