Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gzip: Use fts_path instead of fts_name to get full path on messages #25

Closed
wants to merge 1 commit into from

Conversation

ricardobranco777
Copy link

The handle_dir() function should pass fts_path and not fts_name because the latter is the basename(3). Because of this, not just verbose output but error messages as well are ambiguous when files with the same name exist.

To reproduce:

$ mkdir /tmp/x /tmp/y
$ cp /etc/services /tmp/x
$ cp /etc/services /tmp/y
$ chmod 000 /tmp/x/services
$ gzip -vr /tmp/x /tmp/y
gzip: can't open services: Permission denied
services:          86.1% -- replaced with services.gz

With patch:

gzip: can't open /tmp/x/services: Permission denied
/tmp/y/services:	   86.1% -- replaced with /tmp/y/services.gz

Fixed in FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=114470

rokuyama pushed a commit to IIJ-NetBSD/netbsd-src that referenced this pull request Jan 15, 2024
netbsd-srcmastr pushed a commit that referenced this pull request Jan 15, 2024
@ricardobranco777 ricardobranco777 deleted the gzip_path branch February 4, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant