git: gzip(1): Set file flags after setting file times

Aaron LI aly at crater.dragonflybsd.org
Tue Mar 5 17:26:42 PST 2024


commit 9f7ef25b7e62c035382d6e91586bece801b8bd50
Author: Ricardo Branco <rbranco at suse.de>
Date:   Mon Mar 4 17:41:56 2024 +0100

    gzip(1): Set file flags after setting file times
    
    Only set the source file flags on the target file after the timestamp
    has been set; otherwise setting the timestamp will fail if the flags
    don't permit it (i.e., uchg).
    
    To reproduce the issue:
    $ /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
    
    GitHub PR: https://github.com/DragonFlyBSD/DragonFlyBSD/pull/21
    See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=120208

Summary of changes:
 usr.bin/gzip/gzip.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9f7ef25b7e62c035382d6e91586bece801b8bd50


-- 
DragonFly BSD source repository


More information about the Commits mailing list