mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 21:23:04 +01:00
Fixed CORE-1887: New created databases have wrong access rights
This commit is contained in:
parent
1943e5ec23
commit
c66d60c857
@ -606,6 +606,7 @@ AC_CHECK_FUNCS(pthread_keycreate pthread_key_create)
|
|||||||
AC_CHECK_FUNCS(llrint)
|
AC_CHECK_FUNCS(llrint)
|
||||||
AC_CHECK_FUNCS(localtime_r)
|
AC_CHECK_FUNCS(localtime_r)
|
||||||
AC_CHECK_FUNCS(gmtime_r)
|
AC_CHECK_FUNCS(gmtime_r)
|
||||||
|
AC_CHECK_FUNCS(fchmod)
|
||||||
if test "$ac_cv_header_semaphore_h" = "yes"; then
|
if test "$ac_cv_header_semaphore_h" = "yes"; then
|
||||||
savedFlags="$CFLAGS"
|
savedFlags="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
@ -108,7 +108,7 @@ using namespace Jrd;
|
|||||||
#ifdef SUPERSERVER
|
#ifdef SUPERSERVER
|
||||||
#define MASK 0600
|
#define MASK 0600
|
||||||
#else
|
#else
|
||||||
#define MASK 0666
|
#define MASK 0660
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FCNTL_BROKEN
|
#define FCNTL_BROKEN
|
||||||
@ -219,7 +219,7 @@ jrd_file* PIO_create(Database* dbb, const Firebird::PathName& file_name,
|
|||||||
#endif
|
#endif
|
||||||
#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)
|
if (desc == -1)
|
||||||
{
|
{
|
||||||
ERR_post(isc_io_error,
|
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_string, ERR_string(file_name),
|
||||||
isc_arg_gds, isc_io_create_err, isc_arg_unix, errno, 0);
|
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
|
if (temporary
|
||||||
#ifdef SUPPORT_RAW_DEVICES
|
#ifdef SUPPORT_RAW_DEVICES
|
||||||
|
Loading…
Reference in New Issue
Block a user