Module Name:src
Committed By: snj
Date: Mon Apr 13 20:42:59 UTC 2009
Modified Files:
src/bin/pax [netbsd-5]: extern.h file_subs.c options.c pat_rep.c pax.h
Log Message:
Pull up following revision(s) (requested by christo in ticket #678):
bin/pax/extern.h: revision 1.56
bin/pax/file_subs.c: revision 1.62
bin/pax/options.c: revision 1.104
bin/pax/pat_rep.c: revision 1.29
bin/pax/pax.h: revision 1.30
Fixes from christos for pr-41167
XXX -X is still broken, but that wasn't part of this PR.
To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.8.1 src/bin/pax/extern.h
cvs rdiff -u -r1.61 -r1.61.10.1 src/bin/pax/file_subs.c
cvs rdiff -u -r1.101.12.1 -r1.101.12.2 src/bin/pax/options.c
cvs rdiff -u -r1.28 -r1.28.8.1 src/bin/pax/pat_rep.c src/bin/pax/pax.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/pax/extern.h
diff -u src/bin/pax/extern.h:1.55 src/bin/pax/extern.h:1.55.8.1
--- src/bin/pax/extern.h:1.55 Sun Feb 24 20:42:46 2008
+++ src/bin/pax/extern.h Mon Apr 13 20:42:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.55 2008/02/24 20:42:46 joerg Exp $ */
+/* $NetBSD: extern.h,v 1.55.8.1 2009/04/13 20:42:59 snj Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -216,7 +216,7 @@
* pat_rep.c
*/
int rep_add(char *);
-int pat_add(char *, char *);
+int pat_add(char *, char *, int);
void pat_chk(void);
int pat_sel(ARCHD *);
int pat_match(ARCHD *);
Index: src/bin/pax/file_subs.c
diff -u src/bin/pax/file_subs.c:1.61 src/bin/pax/file_subs.c:1.61.10.1
--- src/bin/pax/file_subs.c:1.61 Thu Jan 10 04:24:51 2008
+++ src/bin/pax/file_subs.c Mon Apr 13 20:42:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: file_subs.c,v 1.61 2008/01/10 04:24:51 tls Exp $ */
+/* $NetBSD: file_subs.c,v 1.61.10.1 2009/04/13 20:42:59 snj Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = @(#)file_subs.c 8.1 (Berkeley) 5/31/93;
#else
-__RCSID($NetBSD: file_subs.c,v 1.61 2008/01/10 04:24:51 tls Exp $);
+__RCSID($NetBSD: file_subs.c,v 1.61.10.1 2009/04/13 20:42:59 snj Exp $);
#endif
#endif /* not lint */
@@ -275,15 +275,9 @@
/*
* We may be running as root, so we have to be sure that link target
- * is not a directory, so we lstat and check
+ * is not a directory, so we lstat and check. XXX: This is still racy.
*/
- if (lstat(arcn-ln_name, sb) 0) {
- syswarn(1, errno, Cannot link to %s from %s, arcn-ln_name,
- arcn-name);
- return -1;
- }
-
- if (S_ISDIR(sb.st_mode)) {
+ if (lstat(arcn-ln_name, sb) != -1 S_ISDIR(sb.st_mode)) {
tty_warn(1, A hard link to the directory %s is not allowed,
arcn-ln_name);
return -1;
Index: src/bin/pax/options.c
diff -u src/bin/pax/options.c:1.101.12.1 src/bin/pax/options.c:1.101.12.2
--- src/bin/pax/options.c:1.101.12.1 Sun Nov 23 21:26:50 2008
+++ src/bin/pax/options.c Mon Apr 13 20:42:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: options.c,v 1.101.12.1 2008/11/23 21:26:50 riz Exp $ */
+/* $NetBSD: options.c,v 1.101.12.2 2009/04/13 20:42:59 snj Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = @(#)options.c 8.2 (Berkeley) 4/18/94;
#else
-__RCSID($NetBSD: options.c,v 1.101.12.1 2008/11/23 21:26:50 riz Exp $);
+__RCSID($NetBSD: options.c,v 1.101.12.2 2009/04/13 20:42:59 snj Exp $);
#endif
#endif /* not lint */
@@ -692,7 +692,7 @@
case LIST:
case EXTRACT:
for (; optind argc; optind++)
- if (pat_add(argv[optind], NULL) 0)
+ if (pat_add(argv[optind], NULL, NOGLOB_MTCH) 0)
pax_usage();
break;
case COPY:
@@ -1234,7 +1234,7 @@
free(str);
continue;
}
- if (pat_add(str, dir) 0)
+ if (pat_add(str, dir, NOGLOB_MTCH) 0)
tar_usage();
sawpat = 1;
}
@@ -1254,7 +1254,7 @@
break;
chdname = *argv++;
havechd++;
-} else if (pat_add(*argv++, chdname) 0)
+} else if (pat_add(*argv++, chdname, 0) 0)
tar_usage();
else
sawpat = 1;
@@ -1641,7 +1641,7 @@
cpio_usage();
}
while ((str = getline(fp)) != NULL) {
-pat_add(str, NULL);
+pat_add(str, NULL, 0);
}
fclose(fp);
if (getline_error) {
@@ -1780,7 +1780,7 @@
case LIST:
case EXTRACT:
for (; optind argc; optind++)
- if (pat_add(argv[optind], 0) 0)
+ if (pat_add(argv[optind], NULL, 0) 0)
cpio_usage();
break;
case COPY:
Index: src/bin/pax/pat_rep.c
diff -u src/bin/pax/pat_rep.c:1.28 src/bin/pax/pat_rep.c:1.28.8.1
--- src/bin/pax/pat_rep.c:1.28 Sun Feb 24 20:42:46 2008
+++ src/bin/pax/pat_rep.c Mon Apr 13 20:42:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pat_rep.c,v 1.28 2008/02/24 20:42:46 joerg Exp $ */
+/* $NetBSD: pat_rep.c,v 1.28.8.1 2009/04/13 20:42:59 snj Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = @(#)pat_rep.c 8.2 (Berkeley) 4/18/94;
#else