$(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \
$(SECRETS_OBJ) $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ)
-LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o tdb/tdb.o
+LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o tdb/tdb.o tdb/spinlock.o
CAC_OBJ = $(LIBSMBCLIENT_OBJ) \
libmsrpc/libmsrpc.o libmsrpc/libmsrpc_internal.o \
#include "includes.h"
#include "smb_share_modes.h"
+/* Remove the paranoid malloc checker. */
+#ifdef malloc
+#undef malloc
+#endif
+
/*
* open/close sharemode database.
*/
struct smbdb_ctx *smb_share_mode_db_open(const char *db_path)
{
- struct smbdb_ctx *smb_db = SMB_MALLOC_P(struct smbdb_ctx);
+ struct smbdb_ctx *smb_db = (struct smbdb_ctx *)malloc(sizeof(struct smbdb_ctx));
if (!smb_db) {
return NULL;
memset(smb_db, '\0', sizeof(struct smbdb_ctx));
- if (!db_path) {
- db_path = lock_path("locking.tdb");
- }
-
- smb_db->smb_tdb = tdb_open_log(db_path,
+ smb_db->smb_tdb = tdb_open(db_path,
0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST,
O_RDWR|O_CREAT,
0644);
return 0;
}
- list = SMB_MALLOC_ARRAY(struct smb_share_mode_entry, num_share_modes);
+ list = (struct smb_share_mode_entry *)malloc(sizeof(struct smb_share_mode_entry)*num_share_modes);
if (!list) {
free(db_data.dptr);
return -1;
db_data = tdb_fetch(db_ctx->smb_tdb, locking_key);
if (!db_data.dptr) {
/* We must create the entry. */
- db_data.dptr = SMB_MALLOC(sizeof(struct locking_data) + sizeof(share_mode_entry) + strlen(filename) + 1);
+ db_data.dptr = malloc(sizeof(struct locking_data) + sizeof(share_mode_entry) + strlen(filename) + 1);
if (!db_data.dptr) {
return -1;
}
}
/* Entry exists, we must add a new entry. */
- new_data_p = SMB_MALLOC(db_data.dsize + sizeof(share_mode_entry));
+ new_data_p = malloc(db_data.dsize + sizeof(share_mode_entry));
if (!new_data_p) {
free(db_data.dptr);
return -1;
}
/* More than one - allocate a new record minus the one we'll delete. */
- new_data_p = SMB_MALLOC(db_data.dsize - sizeof(share_mode_entry));
+ new_data_p = malloc(db_data.dsize - sizeof(share_mode_entry));
if (!new_data_p) {
free(db_data.dptr);
return -1;