summaryrefslogtreecommitdiff
path: root/source3
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
commitebc1f6fda3dc015fbd1172dabc2804291cce5003 (patch)
treeea84f60d5088ce2ede5eabc94e97c9f102c581cf /source3
parentfa8cb083499114d631b97790bda3a7ae22fe946a (diff)
downloadsamba-ebc1f6fda3dc015fbd1172dabc2804291cce5003.tar.gz
samba-ebc1f6fda3dc015fbd1172dabc2804291cce5003.tar.bz2
samba-ebc1f6fda3dc015fbd1172dabc2804291cce5003.zip
Allow for internal databases which may have no name.
(This used to be commit caa08bb56e2dc533c3754f90f6139fe04a317545)
Diffstat (limited to 'source3')
-rw-r--r--source3/tdb/tdb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 881d9b6ee5..b4ff0e1b01 100644
--- a/source3/tdb/tdb.c
+++ b/source3/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;