public inbox for [email protected]help / color / mirror / Atom feed
[PATCH 02/20] Fix broken error message on unseekable input.. 22+ messages / 1 participants [nested] [flat]
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH 02/20] Fix broken error message on unseekable input.. @ 2020-12-22 21:40 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Justin Pryzby @ 2020-12-22 21:40 UTC (permalink / raw) pg_dump -Fd -f dir.dir cat dir.dir/toc.dat | pg_restore -l # I realize this isn't how it's intended to be used pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 18577) file position 18446744073709551615 See also 929c69aa19 --- src/bin/pg_dump/pg_backup_tar.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 54e708875c..61c9c87a9f 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1280,12 +1280,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th) if (chk != sum) { - char posbuf[32]; + off_t off = ftello(ctx->tarFH); - snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, - (uint64) ftello(ctx->tarFH)); - fatal("corrupt tar header found in %s (expected %d, computed %d) file position %s", - tag, sum, chk, posbuf); + if (off == -1) + fatal("corrupt tar header found in %s (expected %d, computed %d)", + tag, sum, chk); + else + fatal("corrupt tar header found in %s (expected %d, computed %d) file position " UINT64_FORMAT, + tag, sum, chk, off); } th->targetFile = pg_strdup(tag); -- 2.17.0 --GRPZ8SYKNexpdSJ7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Support-multiple-compression-algs-levels-opts.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
end of thread, other threads:[~2020-12-22 21:40 UTC | newest] Thread overview: 22+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]> 2020-12-22 21:40 [PATCH 02/20] Fix broken error message on unseekable input.. Justin Pryzby <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox