View | Details | Raw Unified | Return to bug 64002
Collapse All | Expand All

(-)nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/monitor.c (-1 / +2 lines)
Lines 15-20 Link Here
15
#include <string.h>
15
#include <string.h>
16
#include <unistd.h>
16
#include <unistd.h>
17
#include <sys/stat.h>
17
#include <sys/stat.h>
18
#include <errno.h>
18
#include <arpa/inet.h>
19
#include <arpa/inet.h>
19
#include "misc.h"
20
#include "misc.h"
20
#include "statd.h"
21
#include "statd.h"
Lines 171-177 sm_mon_1_svc(struct mon *argp, struct sv Link Here
171
	sprintf(path, "%s/%s", SM_DIR, mon_name);
172
	sprintf(path, "%s/%s", SM_DIR, mon_name);
172
	if ((fd = open(path, O_WRONLY|O_SYNC|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
173
	if ((fd = open(path, O_WRONLY|O_SYNC|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
173
		/* Didn't fly.  We won't monitor. */
174
		/* Didn't fly.  We won't monitor. */
174
		note(N_ERROR, "creat(%s) failed: %m", path);
175
		note(N_ERROR, "creat(%s) failed: %s", path, strerror (errno));
175
		nlist_free(NULL, clnt);
176
		nlist_free(NULL, clnt);
176
		free(path);
177
		free(path);
177
		goto failure;
178
		goto failure;
(-)nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/simulate.c (-1 / +1 lines)
Lines 219-225 sim_sm_mon_1_svc (struct status *argp, s Link Here
219
{
219
{
220
  static char *result;
220
  static char *result;
221
221
222
  dprintf (N_DEBUG, "Recieved state %d for mon_name %s (opaque \"%s\")",
222
  dprintf (N_DEBUG, "Received state %d for mon_name %s (opaque \"%s\")",
223
	   argp->state, argp->mon_name, argp->priv);
223
	   argp->state, argp->mon_name, argp->priv);
224
  svc_exit ();
224
  svc_exit ();
225
  return ((void *)&result);
225
  return ((void *)&result);
(-)nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/statd.c (-1 / +8 lines)
Lines 179-186 static void drop_privs(void) Link Here
179
	struct stat st;
179
	struct stat st;
180
180
181
	if (stat(SM_DIR, &st) == -1 &&
181
	if (stat(SM_DIR, &st) == -1 &&
182
	    stat(DIR_BASE, &st) == -1)
182
	    stat(DIR_BASE, &st) == -1) {
183
		st.st_uid = 0;
183
		st.st_uid = 0;
184
		st.st_gid = 0;
185
	}
184
186
185
	if (st.st_uid == 0) {
187
	if (st.st_uid == 0) {
186
		note(N_WARNING, "statd running as root. chown %s to choose different user\n",
188
		note(N_WARNING, "statd running as root. chown %s to choose different user\n",
Lines 399-404 int main (int argc, char **argv) Link Here
399
	signal (SIGTERM, killer);
401
	signal (SIGTERM, killer);
400
	/* WARNING: the following works on Linux and SysV, but not BSD! */
402
	/* WARNING: the following works on Linux and SysV, but not BSD! */
401
	signal(SIGCHLD, SIG_IGN);
403
	signal(SIGCHLD, SIG_IGN);
404
	/*
405
	 * Ignore SIGPIPE to avoid statd dying when peers close their
406
	 * TCP connection while we're trying to reply to them. 
407
	 */
408
	signal(SIGPIPE, SIG_IGN);
402
409
403
	/* initialize out_port */
410
	/* initialize out_port */
404
	statd_get_socket(out_port);
411
	statd_get_socket(out_port);
(-)nfs-utils-sgi/nfs-utils-1.0.6/utils/statd/svc_run.c (-1 / +2 lines)
Lines 113-119 my_svc_run(void) Link Here
113
			if (errno == EINTR || errno == ECONNREFUSED
113
			if (errno == EINTR || errno == ECONNREFUSED
114
			 || errno == ENETUNREACH || errno == EHOSTUNREACH)
114
			 || errno == ENETUNREACH || errno == EHOSTUNREACH)
115
				continue;
115
				continue;
116
			note(N_ERROR, "my_svc_run() - select: %m");
116
			note(N_ERROR, "my_svc_run() - select: %s",
117
				strerror (errno));
117
			return;
118
			return;
118
119
119
		case 0:
120
		case 0:

Return to bug 64002