summaryrefslogtreecommitdiff
path: root/bin/pax/pat_rep.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-02-21 22:48:24 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-02-21 22:48:24 +0000
commit7eb32e92a3df5f0bcefdb58e386414c1e7d3e6da (patch)
treefae8ecb2f40763278a08a7eeaa738150b380eea5 /bin/pax/pat_rep.c
parent0d78e3742c523340ed11e8491851ca6e38258bc5 (diff)
Recent changes haven't been completely stable, so revert for the 5.7 release
requested by deraadt@
Diffstat (limited to 'bin/pax/pat_rep.c')
-rw-r--r--bin/pax/pat_rep.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index 8094ee3a3e8..55def38fa9c 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pat_rep.c,v 1.36 2015/02/12 23:44:57 guenther Exp $ */
+/* $OpenBSD: pat_rep.c,v 1.37 2015/02/21 22:48:23 guenther Exp $ */
/* $NetBSD: pat_rep.c,v 1.4 1995/03/21 09:07:33 cgd Exp $ */
/*-
@@ -583,25 +583,6 @@ range_match(char *pattern, int test)
}
/*
- * has_dotdot()
- * Returns true iff the supplied path contains a ".." component.
- */
-
-int
-has_dotdot(const char *path)
-{
- const char *p = path;
-
- while ((p = strstr(p, "..")) != NULL) {
- if ((p == path || p[-1] == '/') &&
- (p[2] == '/' || p[2] == '\0'))
- return (1);
- p += 2;
- }
- return (0);
-}
-
-/*
* mod_name()
* modify a selected file name. first attempt to apply replacement string
* expressions, then apply interactive file rename. We apply replacement
@@ -651,30 +632,6 @@ mod_name(ARCHD *arcn)
paxwarn(0, "Removing leading / from absolute path names in the archive");
}
}
- if (rmleadslash) {
- const char *last = NULL;
- const char *p = arcn->name;
-
- while ((p = strstr(p, "..")) != NULL) {
- if ((p == arcn->name || p[-1] == '/') &&
- (p[2] == '/' || p[2] == '\0'))
- last = p + 2;
- p += 2;
- }
- if (last != NULL) {
- last++;
- paxwarn(1, "Removing leading \"%.*s\"",
- (int)(last - arcn->name), arcn->name);
- arcn->nlen = strlen(last);
- if (arcn->nlen > 0)
- memmove(arcn->name, last, arcn->nlen + 1);
- else {
- arcn->name[0] = '.';
- arcn->name[1] = '\0';
- arcn->nlen = 1;
- }
- }
- }
/*
* IMPORTANT: We have a problem. what do we do with symlinks?