You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nbackup is unable to open a FDB file when the file is not owner by the current user although the current user has read permission. This happens because O_NOATIME is only allowed if the current user either owns the file or is root.
open(".../database.fdb", O_RDONLY|O_DIRECT|O_NOATIME) = -1 EPERM (Operation not permitted)
Proposed fix:
--- src/utilities/nbackup.cpp.orig 2010-10-27 03:00:32.068887122 +0200
+++ src/utilities/nbackup.cpp 2010-10-27 03:03:36.801352983 +0200
@@ -336,6 +336,10 @@
#define O_DIRECT 0
#endif // O_DIRECT
dbase = open(dbname.c_str(), O_RDONLY | O_LARGEFILE | O_NOATIME | O_DIRECT);
+ if (dbase < 0 && O_NOATIME)
+ // O_NOATIME fails unless we are either root or the owner of the file
+ // try again without O_NOATIME
+ dbase = open(dbname.c_str(), O_RDONLY | O_LARGEFILE | O_DIRECT);
if (dbase < 0)
b_error::raise("Error (%d) opening database file: %s", errno, dbname.c_str());
#ifdef HAVE_POSIX_FADVISE
Submitted by: Christian Heimes (tiran)
Is duplicated by CORE3540
Votes: 1
nbackup is unable to open a FDB file when the file is not owner by the current user although the current user has read permission. This happens because O_NOATIME is only allowed if the current user either owns the file or is root.
open(".../database.fdb", O_RDONLY|O_DIRECT|O_NOATIME) = -1 EPERM (Operation not permitted)
Proposed fix:
--- src/utilities/nbackup.cpp.orig 2010-10-27 03:00:32.068887122 +0200
+++ src/utilities/nbackup.cpp 2010-10-27 03:03:36.801352983 +0200
@@ -336,6 +336,10 @@
#define O_DIRECT 0
#endif // O_DIRECT
dbase = open(dbname.c_str(), O_RDONLY | O_LARGEFILE | O_NOATIME | O_DIRECT);
+ if (dbase < 0 && O_NOATIME)
+ // O_NOATIME fails unless we are either root or the owner of the file
+ // try again without O_NOATIME
+ dbase = open(dbname.c_str(), O_RDONLY | O_LARGEFILE | O_DIRECT);
if (dbase < 0)
b_error::raise("Error (%d) opening database file: %s", errno, dbname.c_str());
#ifdef HAVE_POSIX_FADVISE
Commits: 016fd3b c4c34a7
The text was updated successfully, but these errors were encountered: