Update to 2.6, which brings I18N support.
Also include Debian/Ubuntu patches for CAN-2005-1111 (chmod races) and CAN-2005-1229 (path traversal).
This commit is contained in:
parent
7bbe8eec32
commit
8c06325d1f
@ -1,21 +1,24 @@
|
||||
# $OpenBSD: Makefile,v 1.9 2005/02/11 23:28:34 naddy Exp $
|
||||
# $OpenBSD: Makefile,v 1.10 2005/10/20 21:45:18 naddy Exp $
|
||||
|
||||
COMMENT= "GNU copy-in/out (cpio)"
|
||||
COMMENT= "GNU copy-in/out (cpio)"
|
||||
|
||||
DISTNAME= cpio-2.5
|
||||
PKGNAME= g${DISTNAME}p0
|
||||
CATEGORIES= archivers
|
||||
DISTNAME= cpio-2.6
|
||||
PKGNAME= g${DISTNAME}
|
||||
CATEGORIES= archivers
|
||||
|
||||
# GPL/LGPL
|
||||
# GPL
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
WANTLIB= c
|
||||
|
||||
MASTER_SITES= ${MASTER_SITE_GNU:=cpio/}
|
||||
MASTER_SITES= ${MASTER_SITE_GNU:=cpio/}
|
||||
|
||||
CONFIGURE_STYLE= gnu dest
|
||||
CONFIGURE_ARGS= --program-prefix="g"
|
||||
MODULES= gettext
|
||||
WANTLIB= c
|
||||
|
||||
CONFIGURE_STYLE=gnu
|
||||
CONFIGURE_ARGS= --program-prefix="g" \
|
||||
--with-rmt=/etc/rmt
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,4 +1,4 @@
|
||||
MD5 (cpio-2.5.tar.gz) = e02859af1bbbbd73fcbf757acb57e0a4
|
||||
RMD160 (cpio-2.5.tar.gz) = 92ab8152b03eae064f24909d76bad31a331d283d
|
||||
SHA1 (cpio-2.5.tar.gz) = d5908ee20484f092e591a430620feec33060528c
|
||||
SIZE (cpio-2.5.tar.gz) = 185480
|
||||
MD5 (cpio-2.6.tar.gz) = 76b4145f33df088a5bade3bf4373d17d
|
||||
RMD160 (cpio-2.6.tar.gz) = 8246bdd08ab8727f9a8042d33ddfe3a6332476b8
|
||||
SHA1 (cpio-2.6.tar.gz) = 5a4ea156519909994fe05933dc823abcf07e3e21
|
||||
SIZE (cpio-2.6.tar.gz) = 556018
|
||||
|
@ -1,34 +0,0 @@
|
||||
$OpenBSD: patch-Makefile_in,v 1.1.1.1 2001/04/10 00:41:32 lebel Exp $
|
||||
--- Makefile.in.orig Wed Dec 20 11:28:30 1995
|
||||
+++ Makefile.in Fri Apr 6 10:10:35 2001
|
||||
@@ -66,9 +66,9 @@ prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
# Prefix for each installed program, normally empty or `g'.
|
||||
-binprefix =
|
||||
+binprefix = g
|
||||
# Prefix for each installed man page, normally empty or `g'.
|
||||
-manprefix =
|
||||
+manprefix = g
|
||||
|
||||
|
||||
# Where to install the cpio and mt executables.
|
||||
@@ -117,17 +117,14 @@ README NEWS INSTALL cpio.1 mt.1 makefile
|
||||
configure configure.in mkinstalldirs install-sh $(MT_SRCS) rmt.c tcexparg.c \
|
||||
alloca.c cpio.texi cpio.info texinfo.tex
|
||||
|
||||
-all: @PROGS@
|
||||
+all: cpio
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $<
|
||||
|
||||
install:: installdirs all $(srcdir)/cpio.1 $(srcdir)/mt.1
|
||||
$(INSTALL_PROGRAM) cpio $(bindir)/$(binprefix)cpio
|
||||
- test ! -f mt || $(INSTALL_PROGRAM) mt $(bindir)/$(binprefix)mt
|
||||
- -test ! -f rmt || $(INSTALL_PROGRAM) rmt $(libexecdir)/rmt
|
||||
-$(INSTALL_DATA) $(srcdir)/cpio.1 $(mandir)/$(manprefix)cpio.$(manext)
|
||||
- -test ! -f mt || $(INSTALL_DATA) $(srcdir)/mt.1 $(mandir)/$(manprefix)mt.$(manext)
|
||||
|
||||
installdirs:
|
||||
$(srcdir)/mkinstalldirs $(bindir) $(libexecdir) $(mandir) $(infodir)
|
12
archivers/gcpio/patches/patch-configure
Normal file
12
archivers/gcpio/patches/patch-configure
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-configure,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- configure.orig Thu Oct 20 23:11:17 2005
|
||||
+++ configure Thu Oct 20 23:11:43 2005
|
||||
@@ -16167,7 +16167,7 @@ s,@host_vendor@,$host_vendor,;t t
|
||||
s,@host_os@,$host_os,;t t
|
||||
s,@LIBICONV@,$LIBICONV,;t t
|
||||
s,@LTLIBICONV@,$LTLIBICONV,;t t
|
||||
-s,@INTLLIBS@,$INTLLIBS,;t t
|
||||
+s,@INTLLIBS@,$LTLIBINTL,;t t
|
||||
s,@LIBINTL@,$LIBINTL,;t t
|
||||
s,@LTLIBINTL@,$LTLIBINTL,;t t
|
||||
s,@POSUB@,$POSUB,;t t
|
@ -1,125 +0,0 @@
|
||||
$OpenBSD: patch-cpio_1,v 1.2 2005/02/11 23:28:34 naddy Exp $
|
||||
--- cpio.1.orig Thu Aug 30 05:37:00 2001
|
||||
+++ cpio.1 Sat Feb 12 00:02:39 2005
|
||||
@@ -1,8 +1,8 @@
|
||||
.TH CPIO 1L \" -*- nroff -*-
|
||||
.SH NAME
|
||||
-cpio \- copy files to and from archives
|
||||
+gcpio \- GNU cpio, copy files to and from archives
|
||||
.SH SYNOPSIS
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
{\-o|\-\-create} [\-0acvABLV] [\-C bytes] [\-H format] [\-M message]
|
||||
[\-O [[user@]host:]archive] [\-F [[user@]host:]archive]
|
||||
[\-\-file=[[user@]host:]archive] [\-\-format=format] [\-\-message=message]
|
||||
@@ -11,7 +11,7 @@ cpio \- copy files to and from archives
|
||||
[\-\-force\-local] [\-\-rsh-command=command] [\-\-help] [\-\-version]
|
||||
< name-list [> archive]
|
||||
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
{\-i|\-\-extract} [\-bcdfmnrtsuvBSV] [\-C bytes] [\-E file] [\-H format]
|
||||
[\-M message] [\-R [user][:.][group]] [\-I [[user@]host:]archive]
|
||||
[\-F [[user@]host:]archive] [\-\-file=[[user@]host:]archive]
|
||||
@@ -24,7 +24,7 @@ cpio \- copy files to and from archives
|
||||
[\-\-only\-verify\-crc] [\-\-quiet] [\-\-rsh-command=command] [\-\-help]
|
||||
[\-\-version] [pattern...] [< archive]
|
||||
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
{\-p|\-\-pass-through} [\-0adlmuvLV] [\-R [user][:.][group]]
|
||||
[\-\-null] [\-\-reset-access-time] [\-\-make-directories] [\-\-link] [\-\-quiet]
|
||||
[\-\-preserve-modification-time] [\-\-unconditional] [\-\-verbose] [\-\-dot]
|
||||
@@ -34,16 +34,16 @@ cpio \- copy files to and from archives
|
||||
This manual page
|
||||
documents the GNU version of
|
||||
.BR cpio .
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
copies files into or out of a cpio or tar archive, which is a file that
|
||||
contains other files plus information about them, such as their
|
||||
file name, owner, timestamps, and access permissions. The archive can
|
||||
be another file on the disk, a magnetic tape, or a pipe.
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
has three operating modes.
|
||||
.PP
|
||||
In copy-out mode,
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
copies files into an archive. It reads a list of filenames, one per
|
||||
line, on the standard input, and writes the archive onto the standard
|
||||
output. A typical way to generate the list of filenames is with the
|
||||
@@ -54,7 +54,7 @@ the \-depth option to minimize problems
|
||||
directories that are unwritable or not searchable.
|
||||
.PP
|
||||
In copy-in mode,
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
copies files out of an archive or lists the archive contents. It
|
||||
reads the archive from the standard input. Any non-option command
|
||||
line arguments are shell globbing patterns; only files in the archive
|
||||
@@ -65,14 +65,14 @@ can match wildcards. If no patterns are
|
||||
extracted.
|
||||
.PP
|
||||
In copy-pass mode,
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
copies files from one directory tree to another, combining the
|
||||
copy-out and copy-in steps without actually using an archive.
|
||||
It reads the list of files to copy from the standard input; the
|
||||
directory into which it will copy them is given as a non-option
|
||||
argument.
|
||||
.PP
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
supports the following archive formats: binary, old ASCII, new
|
||||
ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar.
|
||||
The binary format
|
||||
@@ -88,7 +88,7 @@ currently, it is only supported by GNU a
|
||||
The crc format is
|
||||
like the new ASCII format, but also contains a checksum for each file
|
||||
which
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
calculates when creating an archive
|
||||
and verifies when the file is extracted from the archive.
|
||||
The HPUX formats are provided for compatibility with HPUX's cpio which
|
||||
@@ -104,18 +104,18 @@ The POSIX.1 tar format can not be used t
|
||||
than 255 characters (less unless they have a "/" in just the right place).
|
||||
.PP
|
||||
By default,
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
creates binary format archives, for compatibility with
|
||||
older
|
||||
.B cpio
|
||||
programs.
|
||||
When extracting from archives,
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
automatically recognizes which kind of archive it is reading and can
|
||||
read archives created on machines with a different byte-order.
|
||||
.PP
|
||||
Some of the options to
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
apply only to certain operating modes; see the SYNOPSIS section for a
|
||||
list of which options are allowed in which modes.
|
||||
.SS OPTIONS
|
||||
@@ -166,7 +166,7 @@ Create leading directories where needed.
|
||||
In copy-in mode, read additional patterns specifying filenames to
|
||||
extract or list from FILE. The lines of FILE are treated as if they
|
||||
had been non-option arguments to
|
||||
-.BR cpio .
|
||||
+.BR gcpio .
|
||||
.TP
|
||||
.I "\-f, \-\-nonmatching"
|
||||
Only copy files that do not match any of the given patterns.
|
||||
@@ -336,5 +336,5 @@ Print a "." for each file processed.
|
||||
.TP
|
||||
.I "\-\-version"
|
||||
Print the
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
program version number and exit.
|
12
archivers/gcpio/patches/patch-doc_Makefile_in
Normal file
12
archivers/gcpio/patches/patch-doc_Makefile_in
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-doc_Makefile_in,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- doc/Makefile.in.orig Thu Oct 20 21:47:43 2005
|
||||
+++ doc/Makefile.in Thu Oct 20 21:47:57 2005
|
||||
@@ -206,7 +206,7 @@ sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
info_TEXINFOS = cpio.texi
|
||||
-man_MANS = cpio.1 mt.1
|
||||
+man_MANS = cpio.1
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
all: all-am
|
||||
|
32
archivers/gcpio/patches/patch-doc_cpio_1
Normal file
32
archivers/gcpio/patches/patch-doc_cpio_1
Normal file
@ -0,0 +1,32 @@
|
||||
$OpenBSD: patch-doc_cpio_1,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- doc/cpio.1.orig Thu Oct 20 22:08:15 2005
|
||||
+++ doc/cpio.1 Thu Oct 20 22:08:49 2005
|
||||
@@ -1,8 +1,8 @@
|
||||
.TH CPIO 1L \" -*- nroff -*-
|
||||
.SH NAME
|
||||
-cpio \- copy files to and from archives
|
||||
+gcpio \- copy files to and from archives
|
||||
.SH SYNOPSIS
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
{\-o|\-\-create} [\-0acvABLV] [\-C bytes] [\-H format] [\-M message]
|
||||
[\-O [[user@]host:]archive] [\-F [[user@]host:]archive]
|
||||
[\-\-file=[[user@]host:]archive] [\-\-format=format] [\-\-message=message]
|
||||
@@ -11,7 +11,7 @@ cpio \- copy files to and from archives
|
||||
[\-\-force\-local] [\-\-rsh-command=command] [\-\-help] [\-\-version]
|
||||
< name-list [> archive]
|
||||
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
{\-i|\-\-extract} [\-bcdfmnrtsuvBSV] [\-C bytes] [\-E file] [\-H format]
|
||||
[\-M message] [\-R [user][:.][group]] [\-I [[user@]host:]archive]
|
||||
[\-F [[user@]host:]archive] [\-\-file=[[user@]host:]archive]
|
||||
@@ -24,7 +24,7 @@ cpio \- copy files to and from archives
|
||||
[\-\-only\-verify\-crc] [\-\-quiet] [\-\-rsh-command=command] [\-\-help]
|
||||
[\-\-version] [pattern...] [< archive]
|
||||
|
||||
-.B cpio
|
||||
+.B gcpio
|
||||
{\-p|\-\-pass-through} [\-0adlmuvLV] [\-R [user][:.][group]]
|
||||
[\-\-null] [\-\-reset-access-time] [\-\-make-directories] [\-\-link] [\-\-quiet]
|
||||
[\-\-preserve-modification-time] [\-\-unconditional] [\-\-verbose] [\-\-dot]
|
@ -1,9 +0,0 @@
|
||||
$OpenBSD: patch-filetypes_h,v 1.1.1.1 2001/04/10 00:41:32 lebel Exp $
|
||||
--- filetypes.h.orig Sun Jul 19 01:53:46 1992
|
||||
+++ filetypes.h Fri Apr 6 10:10:36 2001
|
||||
@@ -80,5 +80,3 @@
|
||||
#ifndef S_ISLNK
|
||||
#define lstat stat
|
||||
#endif
|
||||
-int lstat ();
|
||||
-int stat ();
|
25
archivers/gcpio/patches/patch-lib_rtapelib_c
Normal file
25
archivers/gcpio/patches/patch-lib_rtapelib_c
Normal file
@ -0,0 +1,25 @@
|
||||
$OpenBSD: patch-lib_rtapelib_c,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- lib/rtapelib.c.orig Thu Oct 20 21:27:56 2005
|
||||
+++ lib/rtapelib.c Thu Oct 20 21:28:26 2005
|
||||
@@ -625,7 +625,7 @@ rmt_lseek__ (int handle, off_t offset, i
|
||||
{
|
||||
char command_buffer[COMMAND_BUFFER_SIZE];
|
||||
char operand_buffer[UINTMAX_STRSIZE_BOUND];
|
||||
- uintmax_t u = offset < 0 ? - (uintmax_t) offset : (uintmax_t) offset;
|
||||
+ uint64_t u = offset < 0 ? - (uint64_t) offset : (uint64_t) offset;
|
||||
char *p = operand_buffer + sizeof operand_buffer;
|
||||
|
||||
*--p = 0;
|
||||
@@ -667,9 +667,9 @@ rmt_ioctl__ (int handle, int operation,
|
||||
{
|
||||
char command_buffer[COMMAND_BUFFER_SIZE];
|
||||
char operand_buffer[UINTMAX_STRSIZE_BOUND];
|
||||
- uintmax_t u = (((struct mtop *) argument)->mt_count < 0
|
||||
- ? - (uintmax_t) ((struct mtop *) argument)->mt_count
|
||||
- : (uintmax_t) ((struct mtop *) argument)->mt_count);
|
||||
+ uint64_t u = (((struct mtop *) argument)->mt_count < 0
|
||||
+ ? - (uint64_t) ((struct mtop *) argument)->mt_count
|
||||
+ : (uint64_t) ((struct mtop *) argument)->mt_count);
|
||||
char *p = operand_buffer + sizeof operand_buffer;
|
||||
|
||||
*--p = 0;
|
12
archivers/gcpio/patches/patch-lib_system_h
Normal file
12
archivers/gcpio/patches/patch-lib_system_h
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-lib_system_h,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- lib/system.h.orig Thu Oct 20 21:27:34 2005
|
||||
+++ lib/system.h Thu Oct 20 21:27:49 2005
|
||||
@@ -467,7 +467,7 @@ char *getenv ();
|
||||
((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 \
|
||||
+ 1 + TYPE_SIGNED (t))
|
||||
|
||||
-#define UINTMAX_STRSIZE_BOUND (INT_STRLEN_BOUND (uintmax_t) + 1)
|
||||
+#define UINTMAX_STRSIZE_BOUND (INT_STRLEN_BOUND (uint64_t) + 1)
|
||||
|
||||
/* Prototypes for external functions. */
|
||||
|
@ -1,19 +0,0 @@
|
||||
$OpenBSD: patch-main_c,v 1.3 2005/02/11 23:28:34 naddy Exp $
|
||||
--- main.c.orig Sat Feb 12 00:13:59 2005
|
||||
+++ main.c Sat Feb 12 00:15:20 2005
|
||||
@@ -512,7 +512,6 @@ main (argc, argv)
|
||||
char *argv[];
|
||||
{
|
||||
program_name = argv[0];
|
||||
- umask (0);
|
||||
|
||||
#ifdef __TURBOC__
|
||||
_fmode = O_BINARY; /* Put stdin and stdout in binary mode. */
|
||||
@@ -523,6 +522,7 @@ main (argc, argv)
|
||||
#endif
|
||||
|
||||
process_args (argc, argv);
|
||||
+ umask (0);
|
||||
|
||||
initialize_buffers ();
|
||||
|
100
archivers/gcpio/patches/patch-src_copyin_c
Normal file
100
archivers/gcpio/patches/patch-src_copyin_c
Normal file
@ -0,0 +1,100 @@
|
||||
$OpenBSD: patch-src_copyin_c,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- src/copyin.c.orig Wed Sep 8 13:10:02 2004
|
||||
+++ src/copyin.c Thu Oct 20 23:33:40 2005
|
||||
@@ -389,19 +389,20 @@ create_final_defers ()
|
||||
continue;
|
||||
}
|
||||
|
||||
- if (close (out_file_des) < 0)
|
||||
- error (0, errno, "%s", d->header.c_name);
|
||||
-
|
||||
/* File is now copied; set attributes. */
|
||||
if (!no_chown_flag)
|
||||
- if ((chown (d->header.c_name,
|
||||
+ if ((fchown (out_file_des,
|
||||
set_owner_flag ? set_owner : d->header.c_uid,
|
||||
set_group_flag ? set_group : d->header.c_gid) < 0)
|
||||
&& errno != EPERM)
|
||||
error (0, errno, "%s", d->header.c_name);
|
||||
/* chown may have turned off some permissions we wanted. */
|
||||
- if (chmod (d->header.c_name, (int) d->header.c_mode) < 0)
|
||||
+ if (fchmod (out_file_des, (int) d->header.c_mode) < 0)
|
||||
error (0, errno, "%s", d->header.c_name);
|
||||
+
|
||||
+ if (close (out_file_des) < 0)
|
||||
+ error (0, errno, "%s", d->header.c_name);
|
||||
+
|
||||
if (retain_time_flag)
|
||||
{
|
||||
times.actime = times.modtime = d->header.c_mtime;
|
||||
@@ -1335,6 +1336,48 @@ swab_array (char *ptr, int count)
|
||||
}
|
||||
}
|
||||
|
||||
+/* Return a safer suffix of FILE_NAME, or "." if it has no safer
|
||||
+ suffix. Check for fully specified file names and other atrocities. */
|
||||
+static const char *
|
||||
+safer_name_suffix (char const *file_name)
|
||||
+{
|
||||
+ char const *p;
|
||||
+
|
||||
+ /* Skip leading file name components that contain "..", and leading slashes. */
|
||||
+ size_t prefix_len = 0;
|
||||
+
|
||||
+ for (p = file_name; *p;)
|
||||
+ {
|
||||
+ if (p[0] == '.' && p[1] == '.' && ((p[2] == '/') || !p[2]))
|
||||
+ prefix_len = p + 2 - file_name;
|
||||
+
|
||||
+ do
|
||||
+ {
|
||||
+ if (*p++ == '/')
|
||||
+ break;
|
||||
+ }
|
||||
+ while (*p);
|
||||
+ }
|
||||
+
|
||||
+ for (p = file_name + prefix_len; *p == '/'; p++)
|
||||
+ continue;
|
||||
+ prefix_len = p - file_name;
|
||||
+
|
||||
+ if (prefix_len)
|
||||
+ {
|
||||
+ char *prefix = alloca (prefix_len + 1);
|
||||
+ memcpy (prefix, file_name, prefix_len);
|
||||
+ prefix[prefix_len] = '\0';
|
||||
+
|
||||
+ error (0, 0, ("Removing leading `%s' from member names"), prefix);
|
||||
+ }
|
||||
+
|
||||
+ if (!*p)
|
||||
+ p = ".";
|
||||
+
|
||||
+ return p;
|
||||
+}
|
||||
+
|
||||
/* Read the collection from standard input and create files
|
||||
in the file system. */
|
||||
|
||||
@@ -1445,18 +1488,11 @@ process_copy_in ()
|
||||
|
||||
/* Do we have to ignore absolute paths, and if so, does the filename
|
||||
have an absolute path? */
|
||||
- if (no_abs_paths_flag && file_hdr.c_name && file_hdr.c_name [0] == '/')
|
||||
+ if (no_abs_paths_flag && file_hdr.c_name && file_hdr.c_name [0])
|
||||
{
|
||||
- char *p;
|
||||
+ const char *p = safer_name_suffix (file_hdr.c_name);
|
||||
|
||||
- p = file_hdr.c_name;
|
||||
- while (*p == '/')
|
||||
- ++p;
|
||||
- if (*p == '\0')
|
||||
- {
|
||||
- strcpy (file_hdr.c_name, ".");
|
||||
- }
|
||||
- else
|
||||
+ if (p != file_hdr.c_name)
|
||||
{
|
||||
/* Debian hack: file_hrd.c_name is sometimes set to
|
||||
point to static memory by code in tar.c. This
|
29
archivers/gcpio/patches/patch-src_copypass_c
Normal file
29
archivers/gcpio/patches/patch-src_copypass_c
Normal file
@ -0,0 +1,29 @@
|
||||
$OpenBSD: patch-src_copypass_c,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- src/copypass.c.orig Mon Sep 6 14:09:04 2004
|
||||
+++ src/copypass.c Thu Oct 20 23:33:41 2005
|
||||
@@ -181,19 +181,20 @@ process_copy_pass ()
|
||||
}
|
||||
if (close (in_file_des) < 0)
|
||||
error (0, errno, "%s", input_name.ds_string);
|
||||
- if (close (out_file_des) < 0)
|
||||
- error (0, errno, "%s", output_name.ds_string);
|
||||
-
|
||||
/* Set the attributes of the new file. */
|
||||
if (!no_chown_flag)
|
||||
- if ((chown (output_name.ds_string,
|
||||
+ if ((fchown (out_file_des,
|
||||
set_owner_flag ? set_owner : in_file_stat.st_uid,
|
||||
set_group_flag ? set_group : in_file_stat.st_gid) < 0)
|
||||
&& errno != EPERM)
|
||||
error (0, errno, "%s", output_name.ds_string);
|
||||
/* chown may have turned off some permissions we wanted. */
|
||||
- if (chmod (output_name.ds_string, in_file_stat.st_mode) < 0)
|
||||
+ if (fchmod (out_file_des, in_file_stat.st_mode) < 0)
|
||||
error (0, errno, "%s", output_name.ds_string);
|
||||
+
|
||||
+ if (close (out_file_des) < 0)
|
||||
+ error (0, errno, "%s", output_name.ds_string);
|
||||
+
|
||||
if (reset_time_flag)
|
||||
{
|
||||
times.actime = in_file_stat.st_atime;
|
9
archivers/gcpio/patches/patch-src_filetypes_h
Normal file
9
archivers/gcpio/patches/patch-src_filetypes_h
Normal file
@ -0,0 +1,9 @@
|
||||
$OpenBSD: patch-src_filetypes_h,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- src/filetypes.h.orig Fri Nov 21 15:48:13 2003
|
||||
+++ src/filetypes.h Thu Oct 20 21:57:55 2005
|
||||
@@ -80,5 +80,3 @@
|
||||
#ifndef S_ISLNK
|
||||
#define lstat stat
|
||||
#endif
|
||||
-int lstat ();
|
||||
-int stat ();
|
19
archivers/gcpio/patches/patch-src_main_c
Normal file
19
archivers/gcpio/patches/patch-src_main_c
Normal file
@ -0,0 +1,19 @@
|
||||
$OpenBSD: patch-src_main_c,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- src/main.c.orig Tue Nov 23 01:42:18 2004
|
||||
+++ src/main.c Thu Oct 20 21:57:59 2005
|
||||
@@ -740,7 +740,6 @@ main (int argc, char *argv[])
|
||||
textdomain (PACKAGE);
|
||||
|
||||
program_name = argv[0];
|
||||
- umask (0);
|
||||
|
||||
#ifdef __TURBOC__
|
||||
_fmode = O_BINARY; /* Put stdin and stdout in binary mode. */
|
||||
@@ -751,6 +750,7 @@ main (int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
process_args (argc, argv);
|
||||
+ umask (0);
|
||||
|
||||
initialize_buffers ();
|
||||
|
33
archivers/gcpio/patches/patch-src_tar_c
Normal file
33
archivers/gcpio/patches/patch-src_tar_c
Normal file
@ -0,0 +1,33 @@
|
||||
$OpenBSD: patch-src_tar_c,v 1.1 2005/10/20 21:45:18 naddy Exp $
|
||||
--- src/tar.c.orig Thu Oct 20 21:59:27 2005
|
||||
+++ src/tar.c Thu Oct 20 22:06:49 2005
|
||||
@@ -107,6 +107,18 @@ to_oct (register long value, register in
|
||||
where[--digits] = '0';
|
||||
}
|
||||
|
||||
+/* Convert a number into a string of octal digits.
|
||||
+ Convert long VALUE into a DIGITS-digit field at WHERE,
|
||||
+ including a trailing space. DIGITS==2 means
|
||||
+ 1 digit, and a space.
|
||||
+*/
|
||||
+
|
||||
+static void
|
||||
+to_oct_no_nul (register long value, register int digits, register char *where)
|
||||
+{
|
||||
+ to_oct (value, digits + 1, where);
|
||||
+}
|
||||
+
|
||||
|
||||
|
||||
/* Compute and return a checksum for TAR_HDR,
|
||||
@@ -167,8 +179,8 @@ write_out_tar_header (struct new_cpio_he
|
||||
to_oct (file_hdr->c_mode & MODE_ALL, 8, tar_hdr->mode);
|
||||
to_oct (file_hdr->c_uid, 8, tar_hdr->uid);
|
||||
to_oct (file_hdr->c_gid, 8, tar_hdr->gid);
|
||||
- to_oct (file_hdr->c_filesize, 12, tar_hdr->size);
|
||||
- to_oct (file_hdr->c_mtime, 12, tar_hdr->mtime);
|
||||
+ to_oct_no_nul (file_hdr->c_filesize, 12, tar_hdr->size);
|
||||
+ to_oct_no_nul (file_hdr->c_mtime, 12, tar_hdr->mtime);
|
||||
|
||||
switch (file_hdr->c_mode & CP_IFMT)
|
||||
{
|
@ -1,44 +0,0 @@
|
||||
$OpenBSD: patch-tar_c,v 1.2 2005/02/11 23:28:34 naddy Exp $
|
||||
--- tar.c.orig Thu Dec 6 05:55:34 2001
|
||||
+++ tar.c Sat Feb 12 00:02:39 2005
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "tarhdr.h"
|
||||
|
||||
static void to_oct ();
|
||||
+static void to_oct_no_nul ();
|
||||
static char *stash_tar_linkname ();
|
||||
static char *stash_tar_filename ();
|
||||
|
||||
@@ -97,8 +98,8 @@ write_out_tar_header (file_hdr, out_des)
|
||||
to_oct (file_hdr->c_mode, 8, tar_hdr->mode);
|
||||
to_oct (file_hdr->c_uid, 8, tar_hdr->uid);
|
||||
to_oct (file_hdr->c_gid, 8, tar_hdr->gid);
|
||||
- to_oct (file_hdr->c_filesize, 12, tar_hdr->size);
|
||||
- to_oct (file_hdr->c_mtime, 12, tar_hdr->mtime);
|
||||
+ to_oct_no_nul (file_hdr->c_filesize, 12, tar_hdr->size);
|
||||
+ to_oct_no_nul (file_hdr->c_mtime, 12, tar_hdr->mtime);
|
||||
|
||||
switch (file_hdr->c_mode & CP_IFMT)
|
||||
{
|
||||
@@ -444,6 +445,21 @@ to_oct (value, digits, where)
|
||||
/* Add leading spaces, if necessary. */
|
||||
while (digits > 0)
|
||||
where[--digits] = ' ';
|
||||
+}
|
||||
+
|
||||
+/* Convert a number into a string of octal digits.
|
||||
+ Convert long VALUE into a DIGITS-digit field at WHERE,
|
||||
+ including a trailing space. DIGITS==2 means
|
||||
+ 1 digit, and a space.
|
||||
+*/
|
||||
+
|
||||
+static void
|
||||
+to_oct_no_nul (value, digits, where)
|
||||
+ register long value;
|
||||
+ register int digits;
|
||||
+ register char *where;
|
||||
+{
|
||||
+ to_oct (value, digits + 1, where);
|
||||
}
|
||||
|
||||
/* Return
|
@ -1,4 +1,19 @@
|
||||
@comment $OpenBSD: PLIST,v 1.3 2004/08/03 11:30:01 espie Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.4 2005/10/20 21:45:18 naddy Exp $
|
||||
bin/gcpio
|
||||
@info info/cpio.info
|
||||
@man man/man1/gcpio.1
|
||||
share/locale/da/LC_MESSAGES/cpio.mo
|
||||
share/locale/de/LC_MESSAGES/cpio.mo
|
||||
share/locale/es/LC_MESSAGES/cpio.mo
|
||||
share/locale/fr/LC_MESSAGES/cpio.mo
|
||||
share/locale/gl/LC_MESSAGES/cpio.mo
|
||||
share/locale/hu/LC_MESSAGES/cpio.mo
|
||||
share/locale/ko/LC_MESSAGES/cpio.mo
|
||||
share/locale/nl/LC_MESSAGES/cpio.mo
|
||||
share/locale/pl/LC_MESSAGES/cpio.mo
|
||||
share/locale/pt_BR/LC_MESSAGES/cpio.mo
|
||||
share/locale/ro/LC_MESSAGES/cpio.mo
|
||||
share/locale/ru/LC_MESSAGES/cpio.mo
|
||||
share/locale/sv/LC_MESSAGES/cpio.mo
|
||||
share/locale/tr/LC_MESSAGES/cpio.mo
|
||||
share/locale/zh_CN/LC_MESSAGES/cpio.mo
|
||||
|
Loading…
x
Reference in New Issue
Block a user