diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-01-02 23:00:27 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-01-02 23:00:27 +0000 |
commit | 9a781a8c6de9513ba5f4cafef41379fae96807c1 (patch) | |
tree | d9bd28fba6ccdaabe43d2183200310cb6bc4d283 /source3/nmbd | |
parent | 321983bb6b68b5fe18f1021dc5851ce3bb0de625 (diff) | |
download | samba-9a781a8c6de9513ba5f4cafef41379fae96807c1.tar.gz samba-9a781a8c6de9513ba5f4cafef41379fae96807c1.tar.bz2 samba-9a781a8c6de9513ba5f4cafef41379fae96807c1.zip |
- added tdb_flags option to tdb_open()
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the
first attached process. Useful for non-persistent databases like our
locking area (this will also make upgrades to new database layouts easier)
- use lock_path() in a couple of places
- leave connections database open while smbd running
- cleaned up some tdb code a little, using macros for constants
(This used to be commit 00e9da3ca577527db392aced62f02c69cfee8f4f)
Diffstat (limited to 'source3/nmbd')
-rw-r--r-- | source3/nmbd/nmbd_namelistdb.c | 10 | ||||
-rw-r--r-- | source3/nmbd/nmbd_winsserver.c | 10 |
2 files changed, 4 insertions, 16 deletions
diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c index dbb8be1f2d..e2433f42d3 100644 --- a/source3/nmbd/nmbd_namelistdb.c +++ b/source3/nmbd/nmbd_namelistdb.c @@ -602,21 +602,15 @@ static void dump_subnet_namelist( struct subnet_record *subrec, FILE *fp) void dump_all_namelists(void) { - pstring fname; FILE *fp; struct subnet_record *subrec; - pstrcpy(fname,lp_lockdir()); - trim_string(fname,NULL,"/"); - pstrcat(fname,"/"); - pstrcat(fname,"namelist.debug"); - - fp = sys_fopen(fname,"w"); + fp = sys_fopen(lock_path("namelist.debug"),"w"); if (!fp) { DEBUG(0,("dump_all_namelists: Can't open file %s. Error was %s\n", - fname,strerror(errno))); + "namelist.debug",strerror(errno))); return; } diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index 45e9335167..d1a100aaea 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -172,7 +172,6 @@ Load or create the WINS database. BOOL initialise_wins(void) { - pstring fname; time_t time_now = time(NULL); FILE *fp; pstring line; @@ -182,15 +181,10 @@ BOOL initialise_wins(void) add_samba_names_to_subnet(wins_server_subnet); - pstrcpy(fname,lp_lockdir()); - trim_string(fname,NULL,"/"); - pstrcat(fname,"/"); - pstrcat(fname,WINS_LIST); - - if((fp = sys_fopen(fname,"r")) == NULL) + if((fp = sys_fopen(lock_path(WINS_LIST),"r")) == NULL) { DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n", - fname, strerror(errno) )); + WINS_LIST, strerror(errno) )); return True; } |