8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 19:23:02 +01:00

Fixed CORE-1887: New created databases have wrong access rights

This commit is contained in:
alexpeshkoff 2008-05-07 12:22:59 +00:00
parent 1943e5ec23
commit c66d60c857
2 changed files with 14 additions and 2 deletions

View File

@ -606,6 +606,7 @@ AC_CHECK_FUNCS(pthread_keycreate pthread_key_create)
AC_CHECK_FUNCS(llrint)
AC_CHECK_FUNCS(localtime_r)
AC_CHECK_FUNCS(gmtime_r)
AC_CHECK_FUNCS(fchmod)
if test "$ac_cv_header_semaphore_h" = "yes"; then
savedFlags="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"

View File

@ -108,7 +108,7 @@ using namespace Jrd;
#ifdef SUPERSERVER
#define MASK 0600
#else
#define MASK 0666
#define MASK 0660
#endif
#define FCNTL_BROKEN
@ -219,7 +219,7 @@ jrd_file* PIO_create(Database* dbb, const Firebird::PathName& file_name,
#endif
#endif
const int desc = open(file_name.c_str(), flag, MASK);
const int desc = open(file_name.c_str(), flag, 0666);
if (desc == -1)
{
ERR_post(isc_io_error,
@ -227,6 +227,17 @@ jrd_file* PIO_create(Database* dbb, const Firebird::PathName& file_name,
isc_arg_string, ERR_string(file_name),
isc_arg_gds, isc_io_create_err, isc_arg_unix, errno, 0);
}
#ifdef HAVE_FCHMOD
if (fchmod(desc, MASK) < 0)
#else
if (chmod(file_name.c_str(), MASK) < 0)
#endif
{
ERR_post(isc_io_error,
isc_arg_string, "chmod",
isc_arg_string, ERR_string(file_name),
isc_arg_gds, isc_io_create_err, isc_arg_unix, errno, 0);
}
if (temporary
#ifdef SUPPORT_RAW_DEVICES