threads / patch / 21340

patchRe: [PATCH] tar: on extract, -o is --no-same-owner

Subject: Re: [PATCH] tar: on extract, -o is --no-same-owner

## tl;dr

13 messages between Oct 23, 2009 and Oct 24, 2009. Diffs are folded; open one to read it.

replies: 12people: 5as markdown or json

Bernhard Reutner-Fischer· Oct 23, 2009, 20:25 UTC · lore
On Fri, Oct 23, 2009 at 10:15:43PM +0200, Bernhard Reutner-Fischer wrote:
>GNU tar-1.22 handles 'o' as no-same-owner only on extract,
>on create, 'o' would be --old-archive.
FYI this was prompted by:
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>

diff -rdup git-1.6.5.oorig/templates/Makefile git-1.6.5/templates/Makefile --- git-1.6.5.oorig/templates/Makefile 2009-10-11 03:42:04.000000000 +0200 +++ git-1.6.5/templates/Makefile 2009-10-23 21:43:06.000000000 +0200

Show changes to diff +1 −1
@@ -50,4 +50,4 @@ clean:
 install: all
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
 	(cd blt && $(TAR) cf - .) | \
-	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
+	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) x --no-numeric-owner -f -)

Someone should try to ask the git people not to rely on getopt
permuting options.. xof would be gentle to folks who don't want
to turn on getopt_long though.

cheers,
Bernhard Reutner-Fischer· Oct 23, 2009, 21:06 UTC · re: Bernhard Reutner-Fischer · lore
On Fri, Oct 23, 2009 at 10:25:24PM +0200, Bernhard Reutner-Fischer wrote:
Show 17 quoted lines
>On Fri, Oct 23, 2009 at 10:15:43PM +0200, Bernhard Reutner-Fischer wrote:
>>GNU tar-1.22 handles 'o' as no-same-owner only on extract,
>>on create, 'o' would be --old-archive.
>
>FYI this was prompted by:
>
>Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
>
>diff -rdup git-1.6.5.oorig/templates/Makefile git-1.6.5/templates/Makefile
>--- git-1.6.5.oorig/templates/Makefile	2009-10-11 03:42:04.000000000 +0200
>+++ git-1.6.5/templates/Makefile	2009-10-23 21:43:06.000000000 +0200
>@@ -50,4 +50,4 @@ clean:
> install: all
> 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
> 	(cd blt && $(TAR) cf - .) | \
>-	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
>+	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) x --no-numeric-owner -f -)
argh, sorry! --no-same-owner of course.
>Someone should try to ask the git people not to rely on getopt
>permuting options.. xof would be gentle to folks who don't want
>to turn on getopt_long though.
Junio C Hamano· Oct 23, 2009, 21:26 UTC · re: Bernhard Reutner-Fischer · lore
Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
Show 20 quoted lines
> On Fri, Oct 23, 2009 at 10:25:24PM +0200, Bernhard Reutner-Fischer wrote:
>>On Fri, Oct 23, 2009 at 10:15:43PM +0200, Bernhard Reutner-Fischer wrote:
>>>GNU tar-1.22 handles 'o' as no-same-owner only on extract,
>>>on create, 'o' would be --old-archive.
>>
>>FYI this was prompted by:
>>
>>Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
>>
>>diff -rdup git-1.6.5.oorig/templates/Makefile git-1.6.5/templates/Makefile
>>--- git-1.6.5.oorig/templates/Makefile	2009-10-11 03:42:04.000000000 +0200
>>+++ git-1.6.5/templates/Makefile	2009-10-23 21:43:06.000000000 +0200
>>@@ -50,4 +50,4 @@ clean:
>> install: all
>> 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
>> 	(cd blt && $(TAR) cf - .) | \
>>-	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
>>+	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) x --no-numeric-owner -f -)
>
> argh, sorry! --no-same-owner of course.

Either way, your change would break non-GNU tar implementations that are properly POSIX.1, isn't it?

Bernhard Reutner-Fischer· Oct 24, 2009, 09:17 UTC · re: Junio C Hamano · lore
On Fri, Oct 23, 2009 at 02:26:53PM -0700, Junio C Hamano wrote:
Show 25 quoted lines
>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>
>> On Fri, Oct 23, 2009 at 10:25:24PM +0200, Bernhard Reutner-Fischer wrote:
>>>On Fri, Oct 23, 2009 at 10:15:43PM +0200, Bernhard Reutner-Fischer wrote:
>>>>GNU tar-1.22 handles 'o' as no-same-owner only on extract,
>>>>on create, 'o' would be --old-archive.
>>>
>>>FYI this was prompted by:
>>>
>>>Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
>>>
>>>diff -rdup git-1.6.5.oorig/templates/Makefile git-1.6.5/templates/Makefile
>>>--- git-1.6.5.oorig/templates/Makefile	2009-10-11 03:42:04.000000000 +0200
>>>+++ git-1.6.5/templates/Makefile	2009-10-23 21:43:06.000000000 +0200
>>>@@ -50,4 +50,4 @@ clean:
>>> install: all
>>> 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
>>> 	(cd blt && $(TAR) cf - .) | \
>>>-	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
>>>+	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) x --no-numeric-owner -f -)
>>
>> argh, sorry! --no-same-owner of course.
>
>Either way, your change would break non-GNU tar implementations that are
>properly POSIX.1, isn't it?
I suppose xf - -o would work?
Andreas Schwab· Oct 24, 2009, 09:49 UTC · re: Bernhard Reutner-Fischer · lore
Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
Show 28 quoted lines
> On Fri, Oct 23, 2009 at 02:26:53PM -0700, Junio C Hamano wrote:
>>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>>
>>> On Fri, Oct 23, 2009 at 10:25:24PM +0200, Bernhard Reutner-Fischer wrote:
>>>>On Fri, Oct 23, 2009 at 10:15:43PM +0200, Bernhard Reutner-Fischer wrote:
>>>>>GNU tar-1.22 handles 'o' as no-same-owner only on extract,
>>>>>on create, 'o' would be --old-archive.
>>>>
>>>>FYI this was prompted by:
>>>>
>>>>Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
>>>>
>>>>diff -rdup git-1.6.5.oorig/templates/Makefile git-1.6.5/templates/Makefile
>>>>--- git-1.6.5.oorig/templates/Makefile	2009-10-11 03:42:04.000000000 +0200
>>>>+++ git-1.6.5/templates/Makefile	2009-10-23 21:43:06.000000000 +0200
>>>>@@ -50,4 +50,4 @@ clean:
>>>> install: all
>>>> 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
>>>> 	(cd blt && $(TAR) cf - .) | \
>>>>-	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
>>>>+	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) x --no-numeric-owner -f -)
>>>
>>> argh, sorry! --no-same-owner of course.
>>
>>Either way, your change would break non-GNU tar implementations that are
>>properly POSIX.1, isn't it?
>
> I suppose xf - -o would work?
Isn't that the same as 'xfo -'?
(tar isn't specified by POSIX, btw.)
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Jakub Narebski· Oct 24, 2009, 09:56 UTC · re: Andreas Schwab · lore
Andreas Schwab <schwab@linux-m68k.org> writes:
Show 8 quoted lines
> Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>> On Fri, Oct 23, 2009 at 02:26:53PM -0700, Junio C Hamano wrote:
>>>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>>>> On Fri, Oct 23, 2009 at 10:25:24PM +0200, Bernhard Reutner-Fischer wrote:
>>>>> On Fri, Oct 23, 2009 at 10:15:43PM +0200, Bernhard Reutner-Fischer wrote:
>>>>>>
>>>>>> GNU tar-1.22 handles 'o' as no-same-owner only on extract,
>>>>>> on create, 'o' would be --old-archive.
Show 15 quoted lines
>>>>>  	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
>>>>>  	(cd blt && $(TAR) cf - .) | \
>>>>> -	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
>>>>> +	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) x --no-numeric-owner -f -)
>>>>
>>>> argh, sorry! --no-same-owner of course.
>>>
>>> Either way, your change would break non-GNU tar implementations that are
>>> properly POSIX.1, isn't it?
>>
>> I suppose xf - -o would work?
> 
> Isn't that the same as 'xfo -'?
> 
> (tar isn't specified by POSIX, btw.)

I don't quite understand why 'o' has to be spelled using long name --no-same-owner, instead of just correcting the ordering of "old style" short options to have 'f' last, i.e.

  $(TAR) xof -
and not (current)
  $(TAR) xfo -
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Bernhard Reutner-Fischer· Oct 24, 2009, 10:06 UTC · re: Jakub Narebski · lore
On Sat, Oct 24, 2009 at 02:56:33AM -0700, Jakub Narebski wrote:
Show 28 quoted lines
>Andreas Schwab <schwab@linux-m68k.org> writes:
>> Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>>> On Fri, Oct 23, 2009 at 02:26:53PM -0700, Junio C Hamano wrote:
>>>>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>>>>> On Fri, Oct 23, 2009 at 10:25:24PM +0200, Bernhard Reutner-Fischer wrote:
>>>>>> On Fri, Oct 23, 2009 at 10:15:43PM +0200, Bernhard Reutner-Fischer wrote:
>>>>>>>
>>>>>>> GNU tar-1.22 handles 'o' as no-same-owner only on extract,
>>>>>>> on create, 'o' would be --old-archive.
>
>>>>>>  	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
>>>>>>  	(cd blt && $(TAR) cf - .) | \
>>>>>> -	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
>>>>>> +	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) x --no-numeric-owner -f -)
>>>>>
>>>>> argh, sorry! --no-same-owner of course.
>>>>
>>>> Either way, your change would break non-GNU tar implementations that are
>>>> properly POSIX.1, isn't it?
>>>
>>> I suppose xf - -o would work?
>> 
>> Isn't that the same as 'xfo -'?
>> 
>> (tar isn't specified by POSIX, btw.)
>
>I don't quite understand why 'o' has to be spelled using long name
>--no-same-owner, instead of just correcting the ordering of "old style"
It doesn't have to be, right.
Show 7 quoted lines
>short options to have 'f' last, i.e.
>
>  $(TAR) xof -
>
>and not (current)
>
>  $(TAR) xfo -
any of "xf - -o" or "xof -" would work for me.
Andreas Schwab· Oct 24, 2009, 10:06 UTC · re: Jakub Narebski · lore
Jakub Narebski <jnareb@gmail.com> writes:
Show 9 quoted lines
> I don't quite understand why 'o' has to be spelled using long name
> --no-same-owner, instead of just correcting the ordering of "old style"
> short options to have 'f' last, i.e.
>
>   $(TAR) xof -
>
> and not (current)
>
>   $(TAR) xfo -

Both do exactly the same, traditionally. Note the lack of '-' preceding 'xfo', which does not use getopt-style option parsing.

Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Bernhard Reutner-Fischer· Oct 24, 2009, 10:05 UTC · re: Andreas Schwab · lore
On Sat, Oct 24, 2009 at 11:49:10AM +0200, Andreas Schwab wrote:
Show 32 quoted lines
>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>
>> On Fri, Oct 23, 2009 at 02:26:53PM -0700, Junio C Hamano wrote:
>>>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>>>
>>>> On Fri, Oct 23, 2009 at 10:25:24PM +0200, Bernhard Reutner-Fischer wrote:
>>>>>On Fri, Oct 23, 2009 at 10:15:43PM +0200, Bernhard Reutner-Fischer wrote:
>>>>>>GNU tar-1.22 handles 'o' as no-same-owner only on extract,
>>>>>>on create, 'o' would be --old-archive.
>>>>>
>>>>>FYI this was prompted by:
>>>>>
>>>>>Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
>>>>>
>>>>>diff -rdup git-1.6.5.oorig/templates/Makefile git-1.6.5/templates/Makefile
>>>>>--- git-1.6.5.oorig/templates/Makefile	2009-10-11 03:42:04.000000000 +0200
>>>>>+++ git-1.6.5/templates/Makefile	2009-10-23 21:43:06.000000000 +0200
>>>>>@@ -50,4 +50,4 @@ clean:
>>>>> install: all
>>>>> 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
>>>>> 	(cd blt && $(TAR) cf - .) | \
>>>>>-	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
>>>>>+	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) x --no-numeric-owner -f -)
>>>>
>>>> argh, sorry! --no-same-owner of course.
>>>
>>>Either way, your change would break non-GNU tar implementations that are
>>>properly POSIX.1, isn't it?
>>
>> I suppose xf - -o would work?
>
>Isn't that the same as 'xfo -'?

Not really (if you do not permute the arguments which we don't in busybox, for size reasons). f specifies the file so "fo" acts on file "o". "xof -" would work for me as well as "xf - -o", it's just that "xfo -" does not work.

Andreas Schwab· Oct 24, 2009, 10:44 UTC · re: Bernhard Reutner-Fischer · lore
Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
Show 9 quoted lines
> On Sat, Oct 24, 2009 at 11:49:10AM +0200, Andreas Schwab wrote:
>>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>>
>>> I suppose xf - -o would work?
>>
>>Isn't that the same as 'xfo -'?
>
> Not really (if you do not permute the arguments which we don't in
> busybox, for size reasons).

There is no argument permutation. The traditional argument parsing of tar does not cluster option letters with option arguments.

Of course, just using 'xof -' will work around this busybox bug.
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Andreas Schwab· Oct 24, 2009, 13:06 UTC · re: Andreas Schwab · lore
Andreas Schwab <schwab@linux-m68k.org> writes:
Show 16 quoted lines
> Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>
>> On Sat, Oct 24, 2009 at 11:49:10AM +0200, Andreas Schwab wrote:
>>>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
>>>
>>>> I suppose xf - -o would work?
>>>
>>>Isn't that the same as 'xfo -'?
>>
>> Not really (if you do not permute the arguments which we don't in
>> busybox, for size reasons).
>
> There is no argument permutation.  The traditional argument parsing of
> tar does not cluster option letters with option arguments.
>
> Of course, just using 'xof -' will work around this busybox bug.
Like this.
Andreas.
>From ebadb41b346c305b94f27e3bb787bf0ba6bb8a5b Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@linux-m68k.org>
Date: Sat, 24 Oct 2009 15:01:03 +0200
Subject: [PATCH] Work around option parsing bug in the busybox tar implementation

Traditionally the first argument of the tar command was interpreted a bundle of letters specifying the mode of operation and additional options, with any option arguments taken from subsequent words on the command line as needed. The implementation of tar in busybox apparently treats this bundle as if preceded by a dash and then parses it by getopt rules, which mishandles 'tar xfo -'. Use 'tar xof -' instead which is parsed the same way by both traditional tar implementations and busybox.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 templates/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to templates/Makefile +1 −1
diff --git a/templates/Makefile b/templates/Makefile
index a12c6e2..408f013 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -50,4 +50,4 @@ clean:
 install: all
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
 	(cd blt && $(TAR) cf - .) | \
-	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
+	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xof -)
-- 
1.6.5.1


-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Junio C Hamano· Oct 24, 2009, 19:25 UTC · re: Andreas Schwab · lore
Andreas Schwab <schwab@linux-m68k.org> writes:
> Like this.
Yeah, correct and it beautifly explains the issue.  Thanks.
Show 36 quoted lines
>>From ebadb41b346c305b94f27e3bb787bf0ba6bb8a5b Mon Sep 17 00:00:00 2001
> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Sat, 24 Oct 2009 15:01:03 +0200
> Subject: [PATCH] Work around option parsing bug in the busybox tar implementation
>
> Traditionally the first argument of the tar command was interpreted a
> bundle of letters specifying the mode of operation and additional options,
> with any option arguments taken from subsequent words on the command line
> as needed.  The implementation of tar in busybox apparently treats this
> bundle as if preceded by a dash and then parses it by getopt rules, which
> mishandles 'tar xfo -'.  Use 'tar xof -' instead which is parsed the same
> way by both traditional tar implementations and busybox.
>
> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
> ---
>  templates/Makefile |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/templates/Makefile b/templates/Makefile
> index a12c6e2..408f013 100644
> --- a/templates/Makefile
> +++ b/templates/Makefile
> @@ -50,4 +50,4 @@ clean:
>  install: all
>  	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
>  	(cd blt && $(TAR) cf - .) | \
> -	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
> +	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xof -)
> -- 
> 1.6.5.1
>
>
> -- 
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
Denys Vlasenko· Oct 24, 2009, 23:32 UTC · re: Andreas Schwab · lore
On Saturday 24 October 2009 12:44, Andreas Schwab wrote:
Show 16 quoted lines
> Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
> 
> > On Sat, Oct 24, 2009 at 11:49:10AM +0200, Andreas Schwab wrote:
> >>Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:
> >>
> >>> I suppose xf - -o would work?
> >>
> >>Isn't that the same as 'xfo -'?
> >
> > Not really (if you do not permute the arguments which we don't in
> > busybox, for size reasons).
> 
> There is no argument permutation.  The traditional argument parsing of
> tar does not cluster option letters with option arguments.
> 
> Of course, just using 'xof -' will work around this busybox bug.

From my side, I prefer to squash that busybox bug. This is the second time people complain about it, so it is a reoccurring problem.

The attached patch has been pushed to busybox git.

function old new delta tar_main 702 751 +49

-- vda

diff -d -urpN busybox.0/archival/tar.c busybox.1/archival/tar.c --- busybox.0/archival/tar.c 2009-10-20 22:11:09.000000000 +0200 +++ busybox.1/archival/tar.c 2009-10-25 01:27:38.000000000 +0200

Show changes to diff +27 −0
@@ -841,6 +841,33 @@ int tar_main(int argc UNUSED_PARAM, char
 #if ENABLE_FEATURE_TAR_LONG_OPTIONS
 	applet_long_options = tar_longopts;
 #endif
+#if ENABLE_DESKTOP
+	if (argv[1][0] != '-') {
+		/* Compat:
+		 * 1st argument without dash handles options with parameters
+		 * differently from dashed one: it takes *next argv[i]*
+		 * as paramenter even if there are more chars in 1st argument:
+		 *  "tar fx TARFILE" - "x" is not taken as f's param
+		 *  but is interpreted as -x option
+		 *  "tar -xf TARFILE" - dashed equivalent of the above
+		 *  "tar -fx ..." - "x" is taken as f's param
+		 * getopt32 wouldn't handle 1st command correctly.
+		 * Unfortunately, people do use such commands.
+		 * We massage argv[1] to work around it by moving 'f'
+		 * to the end of the string.
+		 * More contrived "tar fCx TARFILE DIR" still fails,
+		 * but such commands are much less likely to be used.
+		 */
+		char *f = strchr(argv[1], 'f');
+		if (f) {
+			while (f[1] != '\0') {
+				*f = f[1];
+				f++;
+			}
+			*f = 'f';
+		}
+	}
+#endif
 	opt = getopt32(argv,
 		"txC:f:Opvk"
 		IF_FEATURE_TAR_CREATE(   "ch"  )

← back to recent threads