mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-17 19:30:00 +08:00
Skip recently-added umask() call on Windows.
Symbols S_IRWXG and S_IRWXO became available to Windows builds in commit1319002e2e
, so PostgreSQL 9.0 cannot use them in platform-independent code. Rewrite commit24aed2124a
to not change Windows builds. The new umask() call had no effect on Windows, anyway. Per buildfarm.
This commit is contained in:
parent
68e83c1208
commit
c69e7d5c78
@ -375,20 +375,23 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
|
||||
}
|
||||
else
|
||||
{
|
||||
int old_umask;
|
||||
|
||||
tm = calloc(1, sizeof(TAR_MEMBER));
|
||||
|
||||
/*
|
||||
* POSIX does not require, but permits, tmpfile() to restrict file
|
||||
* permissions. Given an OS crash after we write data, the filesystem
|
||||
* might retain the data but forget tmpfile()'s unlink(). If so, the
|
||||
* file mode protects confidentiality of the data written.
|
||||
*/
|
||||
old_umask = umask(S_IRWXG | S_IRWXO);
|
||||
|
||||
#ifndef WIN32
|
||||
tm->tmpFH = tmpfile();
|
||||
{
|
||||
int old_umask;
|
||||
|
||||
/*
|
||||
* POSIX does not require, but permits, tmpfile() to restrict file
|
||||
* permissions. Given an OS crash after we write data, the
|
||||
* filesystem might retain the data but forget tmpfile()'s
|
||||
* unlink(). If so, the file mode protects confidentiality of the
|
||||
* data written.
|
||||
*/
|
||||
old_umask = umask(S_IRWXG | S_IRWXO);
|
||||
tm->tmpFH = tmpfile();
|
||||
umask(old_umask);
|
||||
}
|
||||
#else
|
||||
|
||||
/*
|
||||
@ -421,8 +424,6 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
|
||||
if (tm->tmpFH == NULL)
|
||||
die_horribly(AH, modulename, "could not generate temporary file name: %s\n", strerror(errno));
|
||||
|
||||
umask(old_umask);
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
|
||||
if (AH->compression != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user