diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-11-29 16:23:23 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-11-29 16:23:23 +0000 |
commit | 55df41b563d595673e105141cf8ac1ab1c382847 (patch) | |
tree | 65338a97c83cc2c47badadcdb40164542b859e09 /bin/pax/file_subs.c | |
parent | a86db4536b7a6efb18d910baba52cf31ec5e9fbd (diff) |
Build the table of created directories in-memory, instead of using
a tmp file. Makes it possible to unpack an archive without using
/tmp, while memory usage is still within every reasonable limit.
"love it" deraadt@ ok millert@ jaredy@
Diffstat (limited to 'bin/pax/file_subs.c')
-rw-r--r-- | bin/pax/file_subs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c index 2a4e063ba9f..cd05bd1c4f0 100644 --- a/bin/pax/file_subs.c +++ b/bin/pax/file_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file_subs.c,v 1.27 2004/04/16 22:50:23 deraadt Exp $ */ +/* $OpenBSD: file_subs.c,v 1.28 2004/11/29 16:23:22 otto Exp $ */ /* $NetBSD: file_subs.c,v 1.4 1995/03/21 09:07:18 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static const char sccsid[] = "@(#)file_subs.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: file_subs.c,v 1.27 2004/04/16 22:50:23 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: file_subs.c,v 1.28 2004/11/29 16:23:22 otto Exp $"; #endif #endif /* not lint */ @@ -508,9 +508,9 @@ badlink: * we have to force the mode to what was set here, * since we changed it from the default as created. */ - add_dir(nm, strlen(nm), &(arcn->sb), 1); + add_dir(nm, &(arcn->sb), 1); } else if (pmode || patime || pmtime) - add_dir(nm, strlen(nm), &(arcn->sb), 0); + add_dir(nm, &(arcn->sb), 0); } if (patime || pmtime) @@ -645,7 +645,7 @@ chk_path(char *name, uid_t st_uid, gid_t st_gid) if ((access(name, R_OK | W_OK | X_OK) < 0) && (lstat(name, &sb) == 0)) { set_pmode(name, ((sb.st_mode & FILEBITS) | S_IRWXU)); - add_dir(name, spt - name, &sb, 1); + add_dir(name, &sb, 1); } *(spt++) = '/'; continue; |