qsupport.c qsubs.c queries2.c mr_smalloc.c \
increment.c cache.c mr_glue.c qvalidate.c \
mr_server.h query.h qrtn.h qaccess.c qsetup.c \
- qfollow.c $(XSRC)
+ qfollow.c malloc.h $(XSRC)
CODE= startmoira.c mr_main.c mr_sauth.c mr_scall.c \
mr_srvdata.c mr_shutdown.c mr_util.c qrtn.dc \
qsupport.dc qsubs.c queries2.c mr_smalloc.c \
increment.dc cache.dc mr_glue.c qvalidate.dc \
Imakefile mr_server.h query.h qrtn.h qaccess.dc \
- qsetup.dc qfollow.dc $(XSRC)
+ qsetup.dc qfollow.dc malloc.h $(XSRC)
SRVOBJ=mr_main.o mr_sauth.o mr_scall.o mr_srvdata.o mr_shutdown.o \
mr_util.o qrtn.o queries2.o qsupport.o qsubs.o \
mr_smalloc.o increment.o cache.o qvalidate.o \
#endif lint
#include <mit-copyright.h>
-#include "mr_server.h"
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/wait.h>
#include <krb_et.h>
#include <pwd.h>
#include "query.h"
+#include "mr_server.h"
static int already_connected = 0;
static client pseudo_client;
extern int errno;
-extern char *malloc(), *whoami;
+extern char *whoami;
extern time_t now;
void reapchild();
extern int errno;
extern FILE *journal;
-extern char *malloc();
-extern int free();
extern char *inet_ntoa();
extern void mr_com_err();
extern void do_client();
extern time_t now;
+#ifdef _DEBUG_MALLOC_INC
+static char *dbg_malloc();
+static int dbg_free();
+#endif
+
/*
* Main MOIRA server loop.
*
/* Profiling implies that getting rid of one level of call
* indirection here wins us maybe 1% on the VAX.
*/
+#ifdef _DEBUG_MALLOC_INC
+ gdb_amv = dbg_malloc;
+ gdb_fmv = dbg_free;
+#else
gdb_amv = malloc;
- gdb_fmv = free;
+ gdb_fmv = (int (*)()) free;
+#endif
/*
* GDB initialization.
exit(1);
}
}
+
+#ifdef _DEBUG_MALLOC_INC
+static char *dbg_malloc(size)
+ SIZETYPE size;
+{
+ return( debug_malloc("somewhere in the gdb code",1,size) );
+}
+
+static int dbg_free(cptr)
+ DATATYPE *cptr;
+{
+ debug_free((char *)NULL, 0, cptr);
+ return 0; /* GDB is being stupid */
+}
+#endif
+
extern char buf1[];
extern int nclients;
extern char *whoami;
-extern char *malloc();
extern int errno;
extern void clist_delete(), do_auth(), do_shutdown();
extern client **clients;
extern char *inet_ntoa();
char *cp;
- char *index();
char *ctime();
for (i = 0; i < nclients; i++) {
#include "mr_proto.h"
#include <moira_site.h>
#include <krb.h>
+#include "malloc.h"
typedef struct returned_tuples {
struct returned_tuples *next;
#include "mr_server.h"
#include <ctype.h>
-#include <strings.h>
#include <sys/types.h>
extern char *whoami;
client *cl;
{
register int i, j;
- char **argv, *malloc();
+ char **argv;
int id, status;
i = q->vcnt - 2;
client *cl;
{
register int i, j;
- char **argv, *malloc();
+ char **argv;
#ifdef GDSS
unsigned char sigbuf[256];
char *kname;
int actarg;
client *cl;
{
- char **argv, *index();
+ char **argv;
char *ptype, *p;
int mid, sid, status, i;
int actarg;
client *cl;
{
- char **argv, *malloc(), *realloc(), *type;
+ char **argv, *type;
int id, i, idx, status;
idx = 8;
int actarg;
client *cl;
{
- char **argv, *malloc(), *realloc(), *type;
+ char **argv, *type;
int id, i, idx, status;
while (sq_get_data(sq, &argv)) {
int actarg;
client *cl;
{
- char **argv, *malloc(), *realloc(), *type;
+ char **argv, *type;
int id, i, idx, status;
idx = 8;
client *cl;
{
register int j;
- char **argv, *malloc();
+ char **argv;
EXEC SQL BEGIN DECLARE SECTION;
int id;
char *name, *label;
client *cl;
{
register int i, j;
- char **argv, *malloc();
+ char **argv;
int id, status;
i = q->vcnt - 2;
int mr_open_database()
{
register int i;
- char *malloc();
MR_SQLDA_T *mr_alloc_SQLDA();
static first_open = 1;
register char *c;
register int i;
char *args[4];
- char *index();
c = fmt;
for (i = 0; i < argc; i++) {
register struct valobj *vo;
register int n;
char elem[16];
+#ifdef _DEBUG_MALLOC_INC
+#undef index
+#endif
n = v->objcnt;
vo = v->valobj;
register int (*action)();
int actarg;
{
- char *argv[13], *malloc(), *realloc();
+ char *argv[13];
EXEC SQL BEGIN DECLARE SECTION;
char *name, acl_type[9], listname[33], active[5], public[5], hidden[5];
char maillist[5], grouplist[5], gid_str[6], acl_name[256], desc[256];
EXEC SQL WHENEVER SQLERROR CALL ingerr;
+#ifdef _DEBUG_MALLOC_INC
+#undef index
+#define dbg_index(str1,c) DBindex(__FILE__, __LINE__, str1, c)
+#else
+#define dbg_index index
+#endif
/* Validation Routines */
int id;
EXEC SQL END DECLARE SECTION;
int status;
- char *index();
register char *c;
/* get named object */
if (sqlca.sqlerrd[2] != 1) return(MR_TYPE);
/* now retrieve the record id corresponding to the named object */
- if (index(data_type, ' '))
- *index(data_type, ' ') = 0;
+ if (dbg_index(data_type, ' '))
+ *dbg_index(data_type, ' ') = 0;
if (!strcmp(data_type, "user")) {
/* USER */
- if (index(name, '@'))
+ if (dbg_index(name, '@'))
return(MR_USER);
status = name_to_id(name, data_type, &id);
if (status && (status == MR_NO_MATCH || status == MR_NOT_UNIQUE))