unused labels, constness, signedness.
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include <netdb.h>
#include "xmalloc.h"
#include "misc.h"
*/
#include <errno.h>
+#include <unistd.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
break;
case AUTH_UNIX: {
struct authunix_parms *unix_cred;
+ time_t time;
struct tm *tm;
unix_cred = (struct authunix_parms *) rqstp->rq_clntcred;
- tm = localtime(&unix_cred->aup_time);
+ time = unix_cred->aup_time;
+ tm = localtime(&time);
snprintf(sp, buflen, "UNIX %d/%d/%d %02d:%02d:%02d %s %d.%d",
tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec,
struct idmap_client *ic = data;
struct idmap_msg im;
u_char buf[IDMAP_MAXMSGSZ + 1];
- size_t len, bsiz;
+ size_t len;
+ ssize_t bsiz;
char *bp, typebuf[IDMAP_MAXMSGSZ],
buf1[IDMAP_MAXMSGSZ], authbuf[IDMAP_MAXMSGSZ], *p;
unsigned long tmp;
/* Get rid of newline and terminate buffer*/
buf[len - 1] = '\0';
- bp = buf;
+ bp = (char *)buf;
memset(&im, 0, sizeof(im));
imconv(ic, &im);
buf[0] = '\0';
- bp = buf;
+ bp = (char *)buf;
bsiz = sizeof(buf);
/* Authentication name */
if (failed)
return NULL;
memset(fh.fh_handle, 0, sizeof(fh.fh_handle));
- fh.fh_size = qword_get(&bp, fh.fh_handle, NFS3_FHSIZE);
+ fh.fh_size = qword_get(&bp, (char *)fh.fh_handle, NFS3_FHSIZE);
return &fh;
}
static void usage(const char *, int exitcode);
static exports get_exportlist(void);
-static struct nfs_fh_len *get_rootfh(struct svc_req *, dirpath *, int *, int v3);
+static struct nfs_fh_len *get_rootfh(struct svc_req *, dirpath *, mountstat3 *, int v3);
int new_cache = 0;
struct nfs_fh_len *fh;
xlog(D_CALL, "MNT3(%s) called", *path);
- if ((fh = get_rootfh(rqstp, path, (int *) &res->fhs_status, 1)) != NULL) {
+ if ((fh = get_rootfh(rqstp, path, &res->fhs_status, 1)) != NULL) {
struct mountres3_ok *ok = &res->mountres3_u.mountinfo;
ok->fhandle.fhandle3_len = fh->fh_size;
- ok->fhandle.fhandle3_val = fh->fh_handle;
+ ok->fhandle.fhandle3_val = (char *)fh->fh_handle;
ok->auth_flavors.auth_flavors_len
= sizeof(flavors)/sizeof(flavors[0]);
ok->auth_flavors.auth_flavors_val = flavors;
}
static struct nfs_fh_len *
-get_rootfh(struct svc_req *rqstp, dirpath *path, int *error, int v3)
+get_rootfh(struct svc_req *rqstp, dirpath *path, mountstat3 *error, int v3)
{
struct sockaddr_in *sin =
(struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
clnt = NL_NEXT(clnt);
}
+#ifdef RESTRICTED_STATD
failure:
+#endif
note(N_WARNING, "Received erroneous SM_UNMON request from %s for %s",
my_name, mon_name);
return (&result);
dprintf(N_DEBUG, "SM_UNMON_ALL request from %s with no "
"SM_MON requests from it.", my_name);
}
+#ifdef RESTRICTED_STATD
failure:
+#endif
return (&result);
}
* two copies of each - one in main(), one static in log.c...
* It also eliminates the 256-char static in log.c */
char *name_p = NULL;
-char *version_p = NULL;
+const char *version_p = NULL;
/* PRC: a high-availability callout program can be specified with -H
* When this is done, the program will receive callouts whenever clients
#endif
if (!(run_mode & MODE_NODAEMON)) {
- int filedes, fdmax, tempfd;
+ int tempfd;
if (pipe(pipefds)<0) {
perror("statd: unable to create pipe");
* as to why they're global.
*/
extern char *name_p; /* program basename */
-extern char *version_p; /* program version */
+extern const char *version_p; /* program version */
extern int re_notify; /* time to re-read notify list */
change_state (void)
{
int fd, size;
- extern short int restart;
if ((fd = open (SM_STAT_PATH, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR)) == -1)
die ("open (%s): %s", SM_STAT_PATH, strerror (errno));