summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-12-10 07:27:20 +0000
committerMartin Pool <mbp@samba.org>2001-12-10 07:27:20 +0000
commitcaa08bb56e2dc533c3754f90f6139fe04a317545 (patch)
tree1a0081e100cf4e6c58e1407a25da93386dba8693
parentc5e45a4bc8362cfbac1d3204f8aa69b2ac78ddba (diff)
downloadsamba-caa08bb56e2dc533c3754f90f6139fe04a317545.tar.gz
samba-caa08bb56e2dc533c3754f90f6139fe04a317545.tar.xz
samba-caa08bb56e2dc533c3754f90f6139fe04a317545.zip
Allow for internal databases which may have no name.
-rw-r--r--source/tdb/tdb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index 881d9b6ee5d..b4ff0e1b012 100644
--- a/source/tdb/tdb.c
+++ b/source/tdb/tdb.c
@@ -1423,11 +1423,6 @@ TDB_CONTEXT *tdb_open_ex(char *name, int hash_size, int tdb_flags,
tdb->open_flags = open_flags;
tdb->log_fn = log_fn;
- if (!(tdb->name = (char *)strdup(name))) {
- errno = ENOMEM;
- goto fail;
- }
-
if ((open_flags & O_ACCMODE) == O_WRONLY) {
TDB_LOG((tdb, 0, "tdb_open_ex: can't open tdb %s write-only\n",
name));
@@ -1506,6 +1501,11 @@ TDB_CONTEXT *tdb_open_ex(char *name, int hash_size, int tdb_flags,
goto fail;
}
+ if (!(tdb->name = (char *)strdup(name))) {
+ errno = ENOMEM;
+ goto fail;
+ }
+
tdb->map_size = st.st_size;
tdb->device = st.st_dev;
tdb->inode = st.st_ino;