summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/include/clitar.h41
-rw-r--r--source4/include/includes.h10
-rw-r--r--source4/include/interfaces.h0
-rw-r--r--source4/include/module.h30
-rw-r--r--source4/include/mutex.h2
-rw-r--r--source4/include/smb_macros.h4
-rw-r--r--source4/lib/registry/tools/regpatch.c17
-rw-r--r--source4/param/loadparm.c8
-rw-r--r--source4/smb_server/trans2.c2
9 files changed, 24 insertions, 90 deletions
diff --git a/source4/include/clitar.h b/source4/include/clitar.h
deleted file mode 100644
index b7731172d6..0000000000
--- a/source4/include/clitar.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Unix SMB/CIFS implementation.
- * clitar file format
- * Copyright (C) Andrew Tridgell 2000
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 675
- * Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef _CLITAR_H
-#define _CLITAR_H
-
-#define TBLOCK 512
-#define NAMSIZ 100
-union hblock {
- char dummy[TBLOCK];
- struct header {
- char name[NAMSIZ];
- char mode[8];
- char uid[8];
- char gid[8];
- char size[12];
- char mtime[12];
- char chksum[8];
- char linkflag;
- char linkname[NAMSIZ];
- } dbuf;
-};
-
-#endif /* _CLITAR_H */
diff --git a/source4/include/includes.h b/source4/include/includes.h
index ee1ac6d96e..b7acae9019 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -102,7 +102,6 @@ struct ipv4_addr {
#include "smb_macros.h"
#include "smb.h"
#include "byteorder.h"
-#include "module.h"
#include "lib/tdr/tdr.h"
#include "librpc/ndr/libndr.h"
#include "librpc/gen_ndr/misc.h"
@@ -116,10 +115,6 @@ struct ipv4_addr {
#include "lib/com/com.h"
#include "credentials.h"
-#define malloc_p(type) (type *)malloc(sizeof(type))
-#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
-#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
-
/***** automatically generated prototypes *****/
#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
#include "include/proto.h"
@@ -170,9 +165,4 @@ extern int DEBUGLEVEL;
#define UINT16_MAX 65535
#endif
-/*
- type safe varient of smb_xmalloc()
-*/
-#define smb_xmalloc_p(type) (type *)smb_xmalloc(sizeof(type))
-
#endif /* _INCLUDES_H */
diff --git a/source4/include/interfaces.h b/source4/include/interfaces.h
deleted file mode 100644
index e69de29bb2..0000000000
--- a/source4/include/interfaces.h
+++ /dev/null
diff --git a/source4/include/module.h b/source4/include/module.h
deleted file mode 100644
index 5994b85f8e..0000000000
--- a/source4/include/module.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- Handling of idle/exit events
- Copyright (C) Jelmer Vernooij 2003
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef _MODULE_H
-#define _MODULE_H
-
-/* Module support */
-typedef NTSTATUS (*init_module_function) (void);
-
-/* Module that registers a backend for a certain subsystem */
-typedef NTSTATUS (*register_backend_function) (const void *data);
-
-#endif /* _MODULE_H */
diff --git a/source4/include/mutex.h b/source4/include/mutex.h
index c0b7d26744..bb26c84f5d 100644
--- a/source4/include/mutex.h
+++ b/source4/include/mutex.h
@@ -66,4 +66,4 @@ struct mutex_ops {
int (*rwlock_destroy)(smb_rwlock_t *rwlock, const char *name);
};
-#endif /* ndef _MUTEX_H_ */
+#endif /* endif _MUTEX_H_ */
diff --git a/source4/include/smb_macros.h b/source4/include/smb_macros.h
index f5ac3ac96d..f1c62ab024 100644
--- a/source4/include/smb_macros.h
+++ b/source4/include/smb_macros.h
@@ -70,4 +70,8 @@
#define SAFE_FREE(x) do { if ((x) != NULL) {free(discard_const_p(void *, (x))); (x)=NULL;} } while(0)
#endif
+#define malloc_p(type) (type *)malloc(sizeof(type))
+#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
+#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count)
+
#endif /* _SMB_MACROS_H */
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index 887f53df37..98e6c0ff5d 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -156,10 +156,13 @@ static void print_line(struct cmd_line *cl)
*/
static struct cmd_line *get_cmd_line(int fd)
{
- CMD_LINE *cl = smb_xmalloc_p(CMD_LINE);
+ CMD_LINE *cl = malloc_p(CMD_LINE);
int i = 0, rc;
uint8_t ch;
+ if (!cl)
+ return NULL;
+
cl->len = INIT_ALLOC;
/*
@@ -447,7 +450,9 @@ static CMD *regedit4_get_cmd(int fd)
struct cmd_line *cl = NULL;
struct val_spec_list *vl = NULL;
- cmd = smb_xmalloc_p(struct command_s);
+ cmd = malloc_p(struct command_s);
+ if (!cmd)
+ return NULL;
cmd->cmd = CMD_NONE;
cmd->key = NULL;
@@ -490,7 +495,9 @@ static CMD *regedit4_get_cmd(int fd)
* There could be a \ on the end which we need to
* handle at some time
*/
- vl = smb_xmalloc_p(struct val_spec_list);
+ vl = malloc_p(struct val_spec_list);
+ if (!vl)
+ return NULL;
vl->next = NULL;
vl->val = NULL;
vl->name = parse_value(cl, &vl->type, &vl->val);
@@ -609,7 +616,9 @@ static CMD_FILE *cmd_file_create(const char *file)
return NULL;
}
- tmp = smb_xmalloc_p(CMD_FILE);
+ tmp = malloc_p(CMD_FILE);
+ if (!tmp)
+ return NULL;
/*
* Let's fill in some of the fields;
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 7576b05d83..18c8d47746 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -1485,7 +1485,9 @@ static void copy_service(service * pserviceDest, service * pserviceSource, BOOL
pdata = pdata->next;
}
if (not_added) {
- paramo = smb_xmalloc_p(struct param_opt);
+ paramo = malloc_p(struct param_opt);
+ if (!paramo)
+ smb_panic("OOM");
paramo->key = strdup(data->key);
paramo->value = strdup(data->value);
DLIST_ADD(pserviceDest->param_opt, paramo);
@@ -1742,7 +1744,9 @@ static BOOL lp_do_parameter_parametric(int snum, const char *pszParmName, const
}
}
- paramo = smb_xmalloc_p(struct param_opt);
+ paramo = malloc_p(struct param_opt);
+ if (!paramo)
+ smb_panic("OOM");
paramo->key = strdup(name);
paramo->value = strdup(pszParmValue);
paramo->flags = flags;
diff --git a/source4/smb_server/trans2.c b/source4/smb_server/trans2.c
index 694cd969ec..c9a357523b 100644
--- a/source4/smb_server/trans2.c
+++ b/source4/smb_server/trans2.c
@@ -26,8 +26,6 @@
#include "smb_server/smb_server.h"
#include "librpc/gen_ndr/ndr_misc.h"
-
-
#define CHECK_MIN_BLOB_SIZE(blob, size) do { \
if ((blob)->length < (size)) { \
return NT_STATUS_INFO_LENGTH_MISMATCH; \