summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8f124d0)
s/#endif lint/#endif/ for irix cc
#include <crypt.h> in idno.c for OSes that don't have crypt in stdlib
64-bit OS fixes in mr_param.c
fill in missing return values in sq.c
19 files changed:
depend:: ${CODE}
library_obj_rule()
depend:: ${CODE}
library_obj_rule()
-install_library_target(moira,$(OBJECTS),$(SRCS),${MR_LINTLIB})
+install_library_target(moira,$(OBJECTS),$(SRCS))
install::
-mkdir ${DESTDIR}${INCLDIR}
install::
-mkdir ${DESTDIR}${INCLDIR}
#include <syslog.h>
#endif
#include <string.h>
#include <syslog.h>
#endif
#include <string.h>
+#include <time.h>
+#include <com_err.h>
/* mode to create the file with */
#define LOGFILEMODE 0644
/* mode to create the file with */
#define LOGFILEMODE 0644
* whoami to be defined and contain the name of the calling program.
* It's a kludge that it takes a max of 8 arguments in a way that
* isn't necessarily portable, but varargs doesn't work here and we
* whoami to be defined and contain the name of the calling program.
* It's a kludge that it takes a max of 8 arguments in a way that
* isn't necessarily portable, but varargs doesn't work here and we
- * don't have vsprintf().
+ * don't necessarily have vsprintf().
*/
void critical_alert(instance, msg, arg1, arg2, arg3, arg4,
*/
void critical_alert(instance, msg, arg1, arg2, arg3, arg4,
/* Log message to critical file */
if ((crit = fopen(CRITERRLOG, "a")) != (FILE *)NULL)
{
/* Log message to critical file */
if ((crit = fopen(CRITERRLOG, "a")) != (FILE *)NULL)
{
#ifndef lint
static char *rcsid_fixhost_c = "$Header$";
#ifndef lint
static char *rcsid_fixhost_c = "$Header$";
#include <mit-copyright.h>
#include <sys/types.h>
#include <mit-copyright.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#ifdef POSIX
#include <sys/utsname.h>
#endif
#ifdef POSIX
#include <sys/utsname.h>
#endif
#include <ctype.h>
#include <moira.h>
#include <ctype.h>
#include <moira.h>
-extern char *malloc();
-extern char *realloc();
-
/*
* Canonicalize hostname:
* if it is in double-quotes, then strip the quotes and return the name.
/*
* Canonicalize hostname:
* if it is in double-quotes, then strip the quotes and return the name.
#ifndef lint
static char *rcsid_fixname_c = "$Header$";
#ifndef lint
static char *rcsid_fixname_c = "$Header$";
#include <mit-copyright.h>
#include <string.h>
#include <mit-copyright.h>
#include <string.h>
#ifdef notdef
/* okay, finish up first name */
AppendJrOrIII(ifnm, &ends_jr, &ends_ii, &ends_iii, &ends_iv, &ends_v);
#ifdef notdef
/* okay, finish up first name */
AppendJrOrIII(ifnm, &ends_jr, &ends_ii, &ends_iii, &ends_iv, &ends_v);
strncpy(first, ifnm, FIRST_LEN);
}
strncpy(first, ifnm, FIRST_LEN);
}
#include <ctype.h>
#include <moira.h>
#include <string.h>
#include <ctype.h>
#include <moira.h>
#include <string.h>
-extern char *malloc();
-
#define hash_func(h, key) (key >= 0 ? (key % h->size) : (-key % h->size))
/* Create a hash table. The size is just a hint, not a maximum. */
#define hash_func(h, key) (key >= 0 ? (key % h->size) : (-key % h->size))
/* Create a hash table. The size is just a hint, not a maximum. */
#include <mit-copyright.h>
#include <string.h>
#include <ctype.h>
#include <mit-copyright.h>
#include <string.h>
#include <ctype.h>
+#ifdef POSIX
+#include <unistd.h>
+#endif
+#ifdef USE_CRYPT_H
+#include <crypt.h>
+#endif
/* Function Name: RemoveHyphens
* Description: Removes all hyphens from the string passed to it.
/* Function Name: RemoveHyphens
* Description: Removes all hyphens from the string passed to it.
char *sbuf, *idnumber, *first, *last;
{
char salt[3];
char *sbuf, *idnumber, *first, *last;
{
char salt[3];
RemoveHyphens(idnumber);
salt[0] = tolower(last[0]);
RemoveHyphens(idnumber);
salt[0] = tolower(last[0]);
#ifndef lint
static char *rcsid_sms_access_c = "$Header$";
#ifndef lint
static char *rcsid_sms_access_c = "$Header$";
#include <mit-copyright.h>
#include "mr_private.h"
#include <string.h>
#include <mit-copyright.h>
#include "mr_private.h"
#include <string.h>
/*
* Check access to a named query.
/*
* Check access to a named query.
#ifndef lint
static char *rcsid_sms_auth_c = "$Header$";
#ifndef lint
static char *rcsid_sms_auth_c = "$Header$";
#include <mit-copyright.h>
#include "mr_private.h"
#include <mit-copyright.h>
#include "mr_private.h"
#ifndef lint
static char *rcsid_sms_call_c = "$Header$";
#ifndef lint
static char *rcsid_sms_call_c = "$Header$";
#include <mit-copyright.h>
#include "mr_private.h"
#include <mit-copyright.h>
#include "mr_private.h"
#ifndef lint
static char *rcsid_sms_connect_c = "$Header$";
#ifndef lint
static char *rcsid_sms_connect_c = "$Header$";
#include <mit-copyright.h>
#include "mr_private.h"
#include <moira_site.h>
#include <string.h>
#include <mit-copyright.h>
#include "mr_private.h"
#include <moira_site.h>
#include <string.h>
+#include <stdlib.h>
+#include <hesiod.h>
static char *mr_server_host = 0;
static char *mr_server_host = 0;
{
extern int errno;
char *p, **pp, sbuf[256];
{
extern int errno;
char *p, **pp, sbuf[256];
- extern char *getenv(), **hes_resolve();
if (!mr_inited) mr_init();
if (_mr_conn) return MR_ALREADY_CONNECTED;
if (!mr_inited) mr_init();
if (_mr_conn) return MR_ALREADY_CONNECTED;
pp = hes_resolve("moira", "sloc");
if (pp) server = *pp;
}
pp = hes_resolve("moira", "sloc");
if (pp) server = *pp;
}
if (!server || (strlen(server) == 0)) {
server = MOIRA_SERVER;
if (!server || (strlen(server) == 0)) {
server = MOIRA_SERVER;
#ifndef lint
static char *rcsid_sms_data_c = "$Header$";
#ifndef lint
static char *rcsid_sms_data_c = "$Header$";
#include <mit-copyright.h>
#include "mr_private.h"
#include <mit-copyright.h>
#include "mr_private.h"
#ifndef lint
static char *rcsid_sms_init_c = "$Header$";
#ifndef lint
static char *rcsid_sms_init_c = "$Header$";
#include <mit-copyright.h>
#include "mr_private.h"
#include <mit-copyright.h>
#include "mr_private.h"
#ifndef lint
static char *rcsid_sms_do_update_c = "$Header$";
#ifndef lint
static char *rcsid_sms_do_update_c = "$Header$";
#include <mit-copyright.h>
#include <string.h>
#include <mit-copyright.h>
#include <string.h>
#ifndef lint
static char *rcsid_sms_param_c = "$Header$";
#ifndef lint
static char *rcsid_sms_param_c = "$Header$";
#include <mit-copyright.h>
#include <sys/types.h>
#include <netinet/in.h>
#include "mr_private.h"
#include <string.h>
#include <mit-copyright.h>
#include <sys/types.h>
#include <netinet/in.h>
#include "mr_private.h"
#include <string.h>
/*
* GDB operations to send and recieve RPC requests and replies.
/*
* GDB operations to send and recieve RPC requests and replies.
* At least for now, each argument is a string, which is
* sent as a count of bytes followed by the bytes
* (including the trailing '\0'), padded
* At least for now, each argument is a string, which is
* sent as a count of bytes followed by the bytes
* (including the trailing '\0'), padded
- * to a longword boundary.
+ * to a 32-bit boundary.
- mr_size = 4 * sizeof(long);
+ mr_size = 4 * sizeof(int32);
argl = (int *)malloc((unsigned)(sizeof(int) * arg->mr_argc));
argl = (int *)malloc((unsigned)(sizeof(int) * arg->mr_argc));
argl[i] = len = arg->mr_argl[i];
else
argl[i] = len = strlen(arg->mr_argv[i]) + 1;
argl[i] = len = arg->mr_argl[i];
else
argl[i] = len = strlen(arg->mr_argv[i]) + 1;
- mr_size += sizeof(long) + len;
- /* Round up to next longword boundary.. */
- mr_size = sizeof(long) * howmany(mr_size, sizeof(long));
+ mr_size += sizeof(int32) + len;
+ /* Round up to next 32-bit boundary.. */
+ mr_size = sizeof(int32) * howmany(mr_size, sizeof(int32));
}
arg->mr_flattened = buf = malloc(mr_size);
}
arg->mr_flattened = buf = malloc(mr_size);
- /*
- * This is gross. Any better suggestions, anyone?
- * It should work on the RT's, since malloc is guaranteed to
- * return a pointer which is aligned correctly for any data.
- */
-
- ((long *)buf)[0] = htonl(mr_size);
- ((long *)buf)[1] = htonl(arg->mr_version_no);
- ((long *)buf)[2] = htonl(arg->mr_procno);
- ((long *)buf)[3] = htonl(arg->mr_argc);
+ ((int32 *)buf)[0] = htonl(mr_size);
+ ((int32 *)buf)[1] = htonl(arg->mr_version_no);
+ ((int32 *)buf)[2] = htonl(arg->mr_procno);
+ ((int32 *)buf)[3] = htonl(arg->mr_argc);
/*
* bp is a pointer into the point in the buffer to put
* the next argument.
*/
/*
* bp is a pointer into the point in the buffer to put
* the next argument.
*/
- bp = (char *)(((long *)buf) + 4);
+ bp = (char *)(((int32 *)buf) + 4);
for (i = 0; i<arg->mr_argc; ++i) {
len = argl[i];
for (i = 0; i<arg->mr_argc; ++i) {
len = argl[i];
- *((long *)bp) = htonl(len);
- bp += sizeof(long);
+ *((int32 *)bp) = htonl(len);
+ bp += sizeof(int32);
memcpy(bp, arg->mr_argv[i], len);
memcpy(bp, arg->mr_argv[i], len);
- bp += sizeof(long) * howmany(len, sizeof(long));
+ bp += sizeof(int32) * howmany(len, sizeof(int32));
}
op->fcn.cont = mr_cont_send;
arg->mr_size = mr_size;
}
op->fcn.cont = mr_cont_send;
arg->mr_size = mr_size;
case S_RECV_START:
arg->mr_state = S_RECV_DATA;
if (gdb_receive_data(hcon, (caddr_t)&arg->mr_size,
case S_RECV_START:
arg->mr_state = S_RECV_DATA;
if (gdb_receive_data(hcon, (caddr_t)&arg->mr_size,
- sizeof(long)) == OP_COMPLETE)
+ sizeof(int32)) == OP_COMPLETE)
continue;
done = TRUE;
break;
continue;
done = TRUE;
break;
}
arg->mr_flattened = malloc(arg->mr_size);
arg->mr_state = S_DECODE_DATA;
}
arg->mr_flattened = malloc(arg->mr_size);
arg->mr_state = S_DECODE_DATA;
- memcpy(arg->mr_flattened, (caddr_t)&arg->mr_size, sizeof(long));
+ memcpy(arg->mr_flattened, (caddr_t)&arg->mr_size, sizeof(int32));
if (gdb_receive_data(hcon,
if (gdb_receive_data(hcon,
- arg->mr_flattened + sizeof(long),
- arg->mr_size - sizeof(long))
+ arg->mr_flattened + sizeof(int32),
+ arg->mr_size - sizeof(int32))
== OP_COMPLETE)
continue;
done = TRUE;
== OP_COMPLETE)
continue;
done = TRUE;
for (i = 0; i<arg->mr_argc; ++i) {
u_short nlen = ntohl(* (int *) cp);
for (i = 0; i<arg->mr_argc; ++i) {
u_short nlen = ntohl(* (int *) cp);
if (cp + nlen > arg->mr_flattened + arg->mr_size) {
free(arg->mr_flattened);
arg->mr_flattened = NULL;
if (cp + nlen > arg->mr_flattened + arg->mr_size) {
free(arg->mr_flattened);
arg->mr_flattened = NULL;
arg->mr_argv[i] = (char *)malloc(nlen);
memcpy(arg->mr_argv[i], cp, nlen);
arg->mr_argl[i]=nlen;
arg->mr_argv[i] = (char *)malloc(nlen);
memcpy(arg->mr_argv[i], cp, nlen);
arg->mr_argl[i]=nlen;
- cp += sizeof(long) * howmany(nlen, sizeof(long));
+ cp += sizeof(int32) * howmany(nlen, sizeof(int32));
}
free(arg->mr_flattened);
arg->mr_flattened = NULL;
}
free(arg->mr_flattened);
arg->mr_flattened = NULL;
#define EVER (;;)
#define CHECK_CONNECTED {if (!_mr_conn) return MR_NOT_CONNECTED;}
#define EVER (;;)
#define CHECK_CONNECTED {if (!_mr_conn) return MR_NOT_CONNECTED;}
-
-/*
- * There should be an include file for these..
- */
-
-extern char *malloc();
-#ifndef htonl
-extern u_long htonl(), ntohl();
-extern u_short htons(), ntohs();
-#endif /* htonl */
-
-
-
#ifndef lint
static char *rcsid_sms_query_c = "$Header$";
#ifndef lint
static char *rcsid_sms_query_c = "$Header$";
#include <mit-copyright.h>
#include "mr_private.h"
#include <string.h>
#include <mit-copyright.h>
#include "mr_private.h"
#include <string.h>
/*
* This routine is the primary external interface to the mr library.
/*
* This routine is the primary external interface to the mr library.
* It builds a new argument vector with the query handle prepended,
* and calls mr_query_internal.
*/
* It builds a new argument vector with the query handle prepended,
* and calls mr_query_internal.
*/
int mr_query(name, argc, argv, callproc, callarg)
char *name; /* Query name */
int mr_query(name, argc, argv, callproc, callarg)
char *name; /* Query name */
#ifndef lint
static char *rcsid_nfsparttype_c = "$Header$";
#ifndef lint
static char *rcsid_nfsparttype_c = "$Header$";
#include <mit-copyright.h>
#include <moira.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <mit-copyright.h>
#include <moira.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
extern char *strsave();
extern char *strtrim();
extern char *strsave();
extern char *strtrim();
#include <mit-copyright.h>
#include <moira.h>
#include <string.h>
#include <mit-copyright.h>
#include <moira.h>
#include <string.h>
-
-extern char *malloc();
struct save_queue *
sq_create()
struct save_queue *
sq_create()
register struct save_queue *q;
for (q = sq->q_next; q != sq; q = q->q_next)
register struct save_queue *q;
for (q = sq->q_next; q != sq; q = q->q_next)
- if (q->q_data == data) return;
+ if (q->q_data == data) return 1;
return sq_save_data(sq, data);
}
return sq_save_data(sq, data);
}
register struct save_queue *q;
for (q = sq->q_next; q != sq; q = q->q_next)
register struct save_queue *q;
for (q = sq->q_next; q != sq; q = q->q_next)
- if (!strcmp(q->q_data, data)) return;
+ if (!strcmp(q->q_data, data)) return 1;
return sq_save_data(sq, data);
}
return sq_save_data(sq, data);
}
#ifndef lint
static char *rcsid_strs_c = "$Header$";
#ifndef lint
static char *rcsid_strs_c = "$Header$";
#include <mit-copyright.h>
#include <sys/types.h>
#include <mit-copyright.h>
#include <sys/types.h>
#include <string.h>
#include <ctype.h>
#include <string.h>
#include <ctype.h>
-extern char *malloc(), *realloc();
-
/*
* Random string functions which should be in the C library..
*/
/*
* Random string functions which should be in the C library..
*/
register char *p;
/* Kludge for sloppy string semantics */
if (!s) {
register char *p;
/* Kludge for sloppy string semantics */
if (!s) {
- printf("NULL != \"\" !!!!\r\n");
p = malloc(1);
*p = '\0';
return p;
p = malloc(1);
*p = '\0';
return p;