Perform cleanups to rpc.rusersd:
- Perform whitespace fixes. Use tabs instead of 8 spaces. - Make it build at WARNS=6.
This commit is contained in:
parent
13e403fdea
commit
2de7889ec8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201146
@ -4,6 +4,8 @@ PROG = rpc.rusersd
|
|||||||
SRCS = rusersd.c rusers_proc.c
|
SRCS = rusersd.c rusers_proc.c
|
||||||
MAN = rpc.rusersd.8
|
MAN = rpc.rusersd.8
|
||||||
|
|
||||||
|
WARNS?= 6
|
||||||
|
|
||||||
DPADD= ${LIBRPCSVC} ${LIBUTIL}
|
DPADD= ${LIBRPCSVC} ${LIBUTIL}
|
||||||
LDADD= -lrpcsvc -lutil
|
LDADD= -lrpcsvc -lutil
|
||||||
|
|
||||||
|
@ -83,18 +83,20 @@ typedef char ut_line_t[UT_LINESIZE+1];
|
|||||||
typedef char ut_name_t[UT_NAMESIZE+1];
|
typedef char ut_name_t[UT_NAMESIZE+1];
|
||||||
typedef char ut_host_t[UT_HOSTSIZE+1];
|
typedef char ut_host_t[UT_HOSTSIZE+1];
|
||||||
|
|
||||||
utmpidle utmp_idle[MAXUSERS];
|
static utmpidle utmp_idle[MAXUSERS];
|
||||||
rutmp old_utmp[MAXUSERS];
|
static rutmp old_utmp[MAXUSERS];
|
||||||
ut_line_t line[MAXUSERS];
|
static ut_line_t line[MAXUSERS];
|
||||||
ut_name_t name[MAXUSERS];
|
static ut_name_t name[MAXUSERS];
|
||||||
ut_host_t host[MAXUSERS];
|
static ut_host_t host[MAXUSERS];
|
||||||
|
|
||||||
extern int from_inetd;
|
extern int from_inetd;
|
||||||
|
|
||||||
FILE *ufp;
|
void rusers_service(struct svc_req *, SVCXPRT *);
|
||||||
|
|
||||||
|
static FILE *ufp;
|
||||||
|
|
||||||
#ifdef XIDLE
|
#ifdef XIDLE
|
||||||
Display *dpy;
|
static Display *dpy;
|
||||||
|
|
||||||
static jmp_buf openAbort;
|
static jmp_buf openAbort;
|
||||||
|
|
||||||
@ -106,211 +108,213 @@ abortOpen(void)
|
|||||||
|
|
||||||
XqueryIdle(char *display)
|
XqueryIdle(char *display)
|
||||||
{
|
{
|
||||||
int first_event, first_error;
|
int first_event, first_error;
|
||||||
Time IdleTime;
|
Time IdleTime;
|
||||||
|
|
||||||
(void) signal (SIGALRM, abortOpen);
|
(void) signal (SIGALRM, abortOpen);
|
||||||
(void) alarm ((unsigned) 10);
|
(void) alarm ((unsigned) 10);
|
||||||
if (!setjmp (openAbort)) {
|
if (!setjmp (openAbort)) {
|
||||||
if (!(dpy= XOpenDisplay(display))) {
|
if (!(dpy= XOpenDisplay(display))) {
|
||||||
syslog(LOG_ERR, "Cannot open display %s", display);
|
syslog(LOG_ERR, "Cannot open display %s", display);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
if (XidleQueryExtension(dpy, &first_event, &first_error)) {
|
if (XidleQueryExtension(dpy, &first_event, &first_error)) {
|
||||||
if (!XGetIdleTime(dpy, &IdleTime)) {
|
if (!XGetIdleTime(dpy, &IdleTime)) {
|
||||||
syslog(LOG_ERR, "%s: unable to get idle time", display);
|
syslog(LOG_ERR, "%s: unable to get idle time", display);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
syslog(LOG_ERR, "%s: Xidle extension not loaded", display);
|
||||||
syslog(LOG_ERR, "%s: Xidle extension not loaded", display);
|
return(-1);
|
||||||
return(-1);
|
}
|
||||||
}
|
XCloseDisplay(dpy);
|
||||||
XCloseDisplay(dpy);
|
} else {
|
||||||
}
|
syslog(LOG_ERR, "%s: server grabbed for over 10 seconds", display);
|
||||||
else {
|
return(-1);
|
||||||
syslog(LOG_ERR, "%s: server grabbed for over 10 seconds", display);
|
}
|
||||||
return(-1);
|
(void) signal (SIGALRM, SIG_DFL);
|
||||||
}
|
(void) alarm ((unsigned) 0);
|
||||||
(void) signal (SIGALRM, SIG_DFL);
|
|
||||||
(void) alarm ((unsigned) 0);
|
|
||||||
|
|
||||||
IdleTime /= 1000;
|
IdleTime /= 1000;
|
||||||
return((IdleTime + 30) / 60);
|
return((IdleTime + 30) / 60);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static u_int
|
static u_int
|
||||||
getidle(char *tty, char *display)
|
getidle(const char *tty, const char *display __unused)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char devname[PATH_MAX];
|
char ttyname[PATH_MAX];
|
||||||
time_t now;
|
time_t now;
|
||||||
u_long idle;
|
u_long idle;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this is an X terminal or console, then try the
|
* If this is an X terminal or console, then try the
|
||||||
* XIdle extension
|
* XIdle extension
|
||||||
*/
|
*/
|
||||||
#ifdef XIDLE
|
#ifdef XIDLE
|
||||||
if (display && *display && (idle = XqueryIdle(display)) >= 0)
|
if (display && *display && (idle = XqueryIdle(display)) >= 0)
|
||||||
return(idle);
|
return(idle);
|
||||||
#endif
|
#endif
|
||||||
idle = 0;
|
idle = 0;
|
||||||
if (*tty == 'X') {
|
if (*tty == 'X') {
|
||||||
u_long kbd_idle, mouse_idle;
|
u_long kbd_idle, mouse_idle;
|
||||||
#if !defined(__FreeBSD__)
|
#if !defined(__FreeBSD__)
|
||||||
kbd_idle = getidle("kbd", NULL);
|
kbd_idle = getidle("kbd", NULL);
|
||||||
#else
|
#else
|
||||||
kbd_idle = getidle("vga", NULL);
|
kbd_idle = getidle("vga", NULL);
|
||||||
#endif
|
#endif
|
||||||
mouse_idle = getidle("mouse", NULL);
|
mouse_idle = getidle("mouse", NULL);
|
||||||
idle = (kbd_idle < mouse_idle)?kbd_idle:mouse_idle;
|
idle = (kbd_idle < mouse_idle)?kbd_idle:mouse_idle;
|
||||||
}
|
} else {
|
||||||
else {
|
sprintf(ttyname, "%s/%s", _PATH_DEV, tty);
|
||||||
sprintf(devname, "%s/%s", _PATH_DEV, tty);
|
if (stat(ttyname, &st) < 0) {
|
||||||
if (stat(devname, &st) < 0) {
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("%s: %s\n", devname, strerror(errno));
|
printf("%s: %s\n", ttyname, strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
time(&now);
|
time(&now);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("%s: now=%d atime=%d\n", devname, now,
|
printf("%s: now=%d atime=%d\n", ttyname, now,
|
||||||
st.st_atime);
|
st.st_atime);
|
||||||
#endif
|
#endif
|
||||||
idle = now - st.st_atime;
|
idle = now - st.st_atime;
|
||||||
idle = (idle + 30) / 60; /* secs->mins */
|
idle = (idle + 30) / 60; /* secs->mins */
|
||||||
}
|
}
|
||||||
if (idle < 0) idle = 0;
|
|
||||||
|
|
||||||
return(idle);
|
return(idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static utmpidlearr *
|
static utmpidlearr *
|
||||||
do_names_2(int all)
|
do_names_2(void)
|
||||||
{
|
{
|
||||||
static utmpidlearr ut;
|
static utmpidlearr ut;
|
||||||
struct utmp usr;
|
struct utmp usr;
|
||||||
int nusers = 0;
|
int nusers = 0;
|
||||||
|
|
||||||
bzero((char *)&ut, sizeof(ut));
|
bzero((char *)&ut, sizeof(ut));
|
||||||
ut.utmpidlearr_val = &utmp_idle[0];
|
ut.utmpidlearr_val = &utmp_idle[0];
|
||||||
|
|
||||||
ufp = fopen(_PATH_UTMP, "r");
|
ufp = fopen(_PATH_UTMP, "r");
|
||||||
if (!ufp) {
|
if (!ufp) {
|
||||||
syslog(LOG_ERR, "%m");
|
syslog(LOG_ERR, "%m");
|
||||||
return(&ut);
|
return(&ut);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* only entries with both name and line fields */
|
/* only entries with both name and line fields */
|
||||||
while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1 &&
|
while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1 &&
|
||||||
nusers < MAXUSERS)
|
nusers < MAXUSERS)
|
||||||
if (*usr.ut_name && *usr.ut_line &&
|
if (*usr.ut_name && *usr.ut_line &&
|
||||||
strncmp(usr.ut_name, IGNOREUSER,
|
strncmp(usr.ut_name, IGNOREUSER,
|
||||||
sizeof(usr.ut_name))
|
sizeof(usr.ut_name))
|
||||||
#ifdef OSF
|
#ifdef OSF
|
||||||
&& usr.ut_type == USER_PROCESS
|
&& usr.ut_type == USER_PROCESS
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
utmp_idle[nusers].ui_utmp.ut_time =
|
utmp_idle[nusers].ui_utmp.ut_time =
|
||||||
usr.ut_time;
|
usr.ut_time;
|
||||||
utmp_idle[nusers].ui_idle =
|
utmp_idle[nusers].ui_idle =
|
||||||
getidle(usr.ut_line, usr.ut_host);
|
getidle(usr.ut_line, usr.ut_host);
|
||||||
utmp_idle[nusers].ui_utmp.ut_line = line[nusers];
|
utmp_idle[nusers].ui_utmp.ut_line = line[nusers];
|
||||||
strncpy(line[nusers], usr.ut_line, UT_LINESIZE);
|
strncpy(line[nusers], usr.ut_line, UT_LINESIZE);
|
||||||
utmp_idle[nusers].ui_utmp.ut_name = name[nusers];
|
utmp_idle[nusers].ui_utmp.ut_name = name[nusers];
|
||||||
strncpy(name[nusers], usr.ut_name, UT_NAMESIZE);
|
strncpy(name[nusers], usr.ut_name, UT_NAMESIZE);
|
||||||
utmp_idle[nusers].ui_utmp.ut_host = host[nusers];
|
utmp_idle[nusers].ui_utmp.ut_host = host[nusers];
|
||||||
strncpy(host[nusers], usr.ut_host, UT_HOSTSIZE);
|
strncpy(host[nusers], usr.ut_host, UT_HOSTSIZE);
|
||||||
|
|
||||||
/* Make sure entries are NUL terminated */
|
/* Make sure entries are NUL terminated */
|
||||||
line[nusers][UT_LINESIZE] =
|
line[nusers][UT_LINESIZE] =
|
||||||
name[nusers][UT_NAMESIZE] =
|
name[nusers][UT_NAMESIZE] =
|
||||||
host[nusers][UT_HOSTSIZE] = '\0';
|
host[nusers][UT_HOSTSIZE] = '\0';
|
||||||
nusers++;
|
nusers++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ut.utmpidlearr_len = nusers;
|
ut.utmpidlearr_len = nusers;
|
||||||
fclose(ufp);
|
fclose(ufp);
|
||||||
return(&ut);
|
return(&ut);
|
||||||
}
|
}
|
||||||
|
|
||||||
int *
|
static int *
|
||||||
rusers_num(void)
|
rusers_num(void *argp __unused, struct svc_req *rqstp __unused)
|
||||||
{
|
{
|
||||||
static int num_users = 0;
|
static int num_users = 0;
|
||||||
struct utmp usr;
|
struct utmp usr;
|
||||||
|
|
||||||
ufp = fopen(_PATH_UTMP, "r");
|
ufp = fopen(_PATH_UTMP, "r");
|
||||||
if (!ufp) {
|
if (!ufp) {
|
||||||
syslog(LOG_ERR, "%m");
|
syslog(LOG_ERR, "%m");
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* only entries with both name and line fields */
|
/* only entries with both name and line fields */
|
||||||
while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1)
|
while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1)
|
||||||
if (*usr.ut_name && *usr.ut_line &&
|
if (*usr.ut_name && *usr.ut_line &&
|
||||||
strncmp(usr.ut_name, IGNOREUSER,
|
strncmp(usr.ut_name, IGNOREUSER,
|
||||||
sizeof(usr.ut_name))
|
sizeof(usr.ut_name))
|
||||||
#ifdef OSF
|
#ifdef OSF
|
||||||
&& usr.ut_type == USER_PROCESS
|
&& usr.ut_type == USER_PROCESS
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
num_users++;
|
num_users++;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(ufp);
|
fclose(ufp);
|
||||||
return(&num_users);
|
return(&num_users);
|
||||||
}
|
}
|
||||||
|
|
||||||
static utmparr *
|
static utmparr *
|
||||||
do_names_1(int all)
|
do_names_1(void)
|
||||||
{
|
{
|
||||||
utmpidlearr *utidle;
|
utmpidlearr *utidle;
|
||||||
static utmparr ut;
|
static utmparr ut;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
bzero((char *)&ut, sizeof(ut));
|
bzero((char *)&ut, sizeof(ut));
|
||||||
|
|
||||||
utidle = do_names_2(all);
|
utidle = do_names_2();
|
||||||
if (utidle) {
|
if (utidle) {
|
||||||
ut.utmparr_len = utidle->utmpidlearr_len;
|
ut.utmparr_len = utidle->utmpidlearr_len;
|
||||||
ut.utmparr_val = &old_utmp[0];
|
ut.utmparr_val = &old_utmp[0];
|
||||||
for (i = 0; i < ut.utmparr_len; i++)
|
for (i = 0; i < ut.utmparr_len; i++)
|
||||||
bcopy(&utmp_idle[i].ui_utmp, &old_utmp[i],
|
bcopy(&utmp_idle[i].ui_utmp, &old_utmp[i],
|
||||||
sizeof(old_utmp[0]));
|
sizeof(old_utmp[0]));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(&ut);
|
return(&ut);
|
||||||
}
|
}
|
||||||
|
|
||||||
utmpidlearr *
|
utmpidlearr *
|
||||||
rusersproc_names_2_svc(void *argp, struct svc_req *rqstp)
|
rusersproc_names_2_svc(void *argp __unused, struct svc_req *rqstp __unused)
|
||||||
{
|
{
|
||||||
return(do_names_2(0));
|
|
||||||
|
return (do_names_2());
|
||||||
}
|
}
|
||||||
|
|
||||||
utmpidlearr *
|
utmpidlearr *
|
||||||
rusersproc_allnames_2_svc(void *argp, struct svc_req *rqstp)
|
rusersproc_allnames_2_svc(void *argp __unused, struct svc_req *rqstp __unused)
|
||||||
{
|
{
|
||||||
return(do_names_2(1));
|
|
||||||
|
return (do_names_2());
|
||||||
}
|
}
|
||||||
|
|
||||||
utmparr *
|
utmparr *
|
||||||
rusersproc_names_1_svc(void *argp, struct svc_req *rqstp)
|
rusersproc_names_1_svc(void *argp __unused, struct svc_req *rqstp __unused)
|
||||||
{
|
{
|
||||||
return(do_names_1(0));
|
|
||||||
|
return (do_names_1());
|
||||||
}
|
}
|
||||||
|
|
||||||
utmparr *
|
utmparr *
|
||||||
rusersproc_allnames_1_svc(void *argp, struct svc_req *rqstp)
|
rusersproc_allnames_1_svc(void *argp __unused, struct svc_req *rqstp __unused)
|
||||||
{
|
{
|
||||||
return(do_names_1(1));
|
|
||||||
|
return (do_names_1());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef void *(*rusersproc_t)(void *, struct svc_req *);
|
||||||
|
|
||||||
void
|
void
|
||||||
rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
|
rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
|
||||||
{
|
{
|
||||||
@ -318,8 +322,8 @@ rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
int fill;
|
int fill;
|
||||||
} argument;
|
} argument;
|
||||||
char *result;
|
char *result;
|
||||||
bool_t (*xdr_argument)(), (*xdr_result)();
|
xdrproc_t xdr_argument, xdr_result;
|
||||||
char *(*local)();
|
rusersproc_t local;
|
||||||
|
|
||||||
switch (rqstp->rq_proc) {
|
switch (rqstp->rq_proc) {
|
||||||
case NULLPROC:
|
case NULLPROC:
|
||||||
@ -327,43 +331,43 @@ rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
case RUSERSPROC_NUM:
|
case RUSERSPROC_NUM:
|
||||||
xdr_argument = xdr_void;
|
xdr_argument = (xdrproc_t)xdr_void;
|
||||||
xdr_result = xdr_int;
|
xdr_result = (xdrproc_t)xdr_int;
|
||||||
local = (char *(*)()) rusers_num;
|
local = (rusersproc_t)rusers_num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RUSERSPROC_NAMES:
|
case RUSERSPROC_NAMES:
|
||||||
xdr_argument = xdr_void;
|
xdr_argument = (xdrproc_t)xdr_void;
|
||||||
xdr_result = xdr_utmpidlearr;
|
xdr_result = (xdrproc_t)xdr_utmpidlearr;
|
||||||
switch (rqstp->rq_vers) {
|
switch (rqstp->rq_vers) {
|
||||||
case RUSERSVERS_ORIG:
|
case RUSERSVERS_ORIG:
|
||||||
local = (char *(*)()) rusersproc_names_1_svc;
|
local = (rusersproc_t)rusersproc_names_1_svc;
|
||||||
break;
|
break;
|
||||||
case RUSERSVERS_IDLE:
|
case RUSERSVERS_IDLE:
|
||||||
local = (char *(*)()) rusersproc_names_2_svc;
|
local = (rusersproc_t)rusersproc_names_2_svc;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
svcerr_progvers(transp, RUSERSVERS_ORIG, RUSERSVERS_IDLE);
|
svcerr_progvers(transp, RUSERSVERS_ORIG, RUSERSVERS_IDLE);
|
||||||
goto leave;
|
goto leave;
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RUSERSPROC_ALLNAMES:
|
case RUSERSPROC_ALLNAMES:
|
||||||
xdr_argument = xdr_void;
|
xdr_argument = (xdrproc_t)xdr_void;
|
||||||
xdr_result = xdr_utmpidlearr;
|
xdr_result = (xdrproc_t)xdr_utmpidlearr;
|
||||||
switch (rqstp->rq_vers) {
|
switch (rqstp->rq_vers) {
|
||||||
case RUSERSVERS_ORIG:
|
case RUSERSVERS_ORIG:
|
||||||
local = (char *(*)()) rusersproc_allnames_1_svc;
|
local = (rusersproc_t)rusersproc_allnames_1_svc;
|
||||||
break;
|
break;
|
||||||
case RUSERSVERS_IDLE:
|
case RUSERSVERS_IDLE:
|
||||||
local = (char *(*)()) rusersproc_allnames_2_svc;
|
local = (rusersproc_t)rusersproc_allnames_2_svc;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
svcerr_progvers(transp, RUSERSVERS_ORIG, RUSERSVERS_IDLE);
|
svcerr_progvers(transp, RUSERSVERS_ORIG, RUSERSVERS_IDLE);
|
||||||
goto leave;
|
goto leave;
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -385,6 +389,6 @@ rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
leave:
|
leave:
|
||||||
if (from_inetd)
|
if (from_inetd)
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
@ -49,42 +49,42 @@ extern void rusers_service(struct svc_req *, SVCXPRT *);
|
|||||||
|
|
||||||
int from_inetd = 1;
|
int from_inetd = 1;
|
||||||
|
|
||||||
void
|
static void
|
||||||
cleanup(int sig __unused)
|
cleanup(int sig __unused)
|
||||||
{
|
{
|
||||||
(void) rpcb_unset(RUSERSPROG, RUSERSVERS_IDLE, NULL);
|
(void) rpcb_unset(RUSERSPROG, RUSERSVERS_IDLE, NULL);
|
||||||
(void) rpcb_unset(RUSERSPROG, RUSERSVERS_ORIG, NULL);
|
(void) rpcb_unset(RUSERSPROG, RUSERSVERS_ORIG, NULL);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc __unused, char *argv[] __unused)
|
||||||
{
|
{
|
||||||
SVCXPRT *transp;
|
SVCXPRT *transp = NULL; /* Keep compiler happy. */
|
||||||
int ok;
|
int ok;
|
||||||
struct sockaddr_storage from;
|
struct sockaddr_storage from;
|
||||||
socklen_t fromlen;
|
socklen_t fromlen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See if inetd started us
|
* See if inetd started us
|
||||||
*/
|
*/
|
||||||
fromlen = sizeof(from);
|
fromlen = sizeof(from);
|
||||||
if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) {
|
if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) {
|
||||||
from_inetd = 0;
|
from_inetd = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!from_inetd) {
|
if (!from_inetd) {
|
||||||
daemon(0, 0);
|
daemon(0, 0);
|
||||||
|
|
||||||
(void) rpcb_unset(RUSERSPROG, RUSERSVERS_IDLE, NULL);
|
(void) rpcb_unset(RUSERSPROG, RUSERSVERS_IDLE, NULL);
|
||||||
(void) rpcb_unset(RUSERSPROG, RUSERSVERS_ORIG, NULL);
|
(void) rpcb_unset(RUSERSPROG, RUSERSVERS_ORIG, NULL);
|
||||||
|
|
||||||
(void) signal(SIGINT, cleanup);
|
(void) signal(SIGINT, cleanup);
|
||||||
(void) signal(SIGTERM, cleanup);
|
(void) signal(SIGTERM, cleanup);
|
||||||
(void) signal(SIGHUP, cleanup);
|
(void) signal(SIGHUP, cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
openlog("rpc.rusersd", LOG_CONS|LOG_PID, LOG_DAEMON);
|
openlog("rpc.rusersd", LOG_CONS|LOG_PID, LOG_DAEMON);
|
||||||
|
|
||||||
if (from_inetd) {
|
if (from_inetd) {
|
||||||
transp = svc_tli_create(0, NULL, NULL, 0, 0);
|
transp = svc_tli_create(0, NULL, NULL, 0, 0);
|
||||||
@ -112,7 +112,7 @@ main(int argc, char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
svc_run();
|
svc_run();
|
||||||
syslog(LOG_ERR, "svc_run returned");
|
syslog(LOG_ERR, "svc_run returned");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user