/* A tar (tape archiver) program.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000,
- 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2001, 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
Written by John Gilmore, starting 1985-08-25.
#include <version-etc.h>
#include <xstrtol.h>
#include <stdopen.h>
+#include <priv-set.h>
/* Local declarations. */
IGNORE_FAILED_READ_OPTION,
INDEX_FILE_OPTION,
KEEP_NEWER_FILES_OPTION,
+ LZMA_OPTION,
LZOP_OPTION,
MODE_OPTION,
MTIME_OPTION,
{"auto-compress", 'a', 0, 0,
N_("use archive suffix to determine the compression program"), GRID+1 },
{"no-auto-compress", NO_AUTO_COMPRESS_OPTION, 0, 0,
- N_("do not use use archive suffix to determine the compression program"),
+ N_("do not use archive suffix to determine the compression program"),
GRID+1 },
{"bzip2", 'j', 0, 0,
N_("filter the archive through bzip2"), GRID+1 },
{"compress", 'Z', 0, 0,
N_("filter the archive through compress"), GRID+1 },
{"uncompress", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
- {"lzma", 'J', 0, 0,
+ {"lzma", LZMA_OPTION, 0, 0,
N_("filter the archive through lzma"), GRID+1 },
{"lzop", LZOP_OPTION, 0, 0,
N_("filter the archive through lzop"), GRID+8 },
+ {"xz", 'J', 0, 0,
+ N_("filter the archive through xz"), GRID+8 },
{"use-compress-program", 'I', N_("PROG"), 0,
N_("filter through PROG (must accept -d)"), GRID+1 },
#undef GRID
break;
case 'J':
- set_use_compress_program_option ("lzma");
+ set_use_compress_program_option ("xz");
break;
case 'k':
}
break;
+ case LZMA_OPTION:
+ set_use_compress_program_option ("lzma");
+ break;
+
case LZOP_OPTION:
set_use_compress_program_option ("lzop");
break;
obstack_init (&argv_stk);
-#ifdef SIGCHLD
+ /* Ensure default behavior for some signals */
+ signal (SIGPIPE, SIG_DFL);
/* System V fork+wait does not work if SIGCHLD is ignored. */
signal (SIGCHLD, SIG_DFL);
-#endif
+ /* Try to disable the ability to unlink a directory. */
+ priv_set_remove_linkdir ();
+
/* Decode options. */
decode_options (argc, argv);