
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Linux
|
|
Issue Links:
|
Duplicate
|
|
|
|
This issue is duplicated by:
|
|
CORE-3540
NBackup only runs with root priviledges
|
|
|
|
|
|
|
| Planning Status: |
Unspecified
|
|
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
|
|
Description
|
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
|
Show » |
|