Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc69e7d5

Browse files
committed
Skip recently-added umask() call on Windows.
Symbols S_IRWXG and S_IRWXO became available to Windows builds in commit1319002, so PostgreSQL 9.0 cannot usethem in platform-independent code. Rewrite commit24aed21 to not change Windows builds.The new umask() call had no effect on Windows, anyway. Per buildfarm.
1 parent68e83c1 commitc69e7d5

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

‎src/bin/pg_dump/pg_backup_tar.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -375,20 +375,23 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
375375
}
376376
else
377377
{
378-
intold_umask;
379-
380378
tm=calloc(1,sizeof(TAR_MEMBER));
381379

382-
/*
383-
* POSIX does not require, but permits, tmpfile() to restrict file
384-
* permissions. Given an OS crash after we write data, the filesystem
385-
* might retain the data but forget tmpfile()'s unlink(). If so, the
386-
* file mode protects confidentiality of the data written.
387-
*/
388-
old_umask=umask(S_IRWXG |S_IRWXO);
389-
390380
#ifndefWIN32
391-
tm->tmpFH=tmpfile();
381+
{
382+
intold_umask;
383+
384+
/*
385+
* POSIX does not require, but permits, tmpfile() to restrict file
386+
* permissions. Given an OS crash after we write data, the
387+
* filesystem might retain the data but forget tmpfile()'s
388+
* unlink(). If so, the file mode protects confidentiality of the
389+
* data written.
390+
*/
391+
old_umask=umask(S_IRWXG |S_IRWXO);
392+
tm->tmpFH=tmpfile();
393+
umask(old_umask);
394+
}
392395
#else
393396

394397
/*
@@ -421,8 +424,6 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
421424
if (tm->tmpFH==NULL)
422425
die_horribly(AH,modulename,"could not generate temporary file name: %s\n",strerror(errno));
423426

424-
umask(old_umask);
425-
426427
#ifdefHAVE_LIBZ
427428

428429
if (AH->compression!=0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp