projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
purge socketaddr call in favor of getsockname
[unix-history]
/
usr
/
src
/
lib
/
libc
/
net
/
rcmd.c
diff --git
a/usr/src/lib/libc/net/rcmd.c
b/usr/src/lib/libc/net/rcmd.c
index
47bc868
..
2af7c47
100644
(file)
--- a/
usr/src/lib/libc/net/rcmd.c
+++ b/
usr/src/lib/libc/net/rcmd.c
@@
-1,5
+1,5
@@
#ifndef lint
#ifndef lint
-static char sccsid[] = "@(#)rcmd.c 4.
6
%G%";
+static char sccsid[] = "@(#)rcmd.c 4.
8
%G%";
#endif
#include <stdio.h>
#endif
#include <stdio.h>
@@
-142,14
+142,16
@@
rresvport(alport)
}
}
}
}
-ruserok(rhost, ruser, luser)
- char *rhost, *ruser, *luser;
+ruserok(rhost, superuser, ruser, luser)
+ char *rhost;
+ int superuser;
+ char *ruser, *luser;
{
FILE *hostf;
char ahost[32];
int first = 1;
{
FILE *hostf;
char ahost[32];
int first = 1;
- hostf = fopen("/etc/hosts.equiv", "r");
+ hostf =
superuser ? (FILE *)0 :
fopen("/etc/hosts.equiv", "r");
again:
if (hostf) {
while (fgets(ahost, sizeof (ahost), hostf)) {
again:
if (hostf) {
while (fgets(ahost, sizeof (ahost), hostf)) {
@@
-160,8
+162,10
@@
again:
if (user)
*user++ = 0;
if (!strcmp(rhost, ahost) &&
if (user)
*user++ = 0;
if (!strcmp(rhost, ahost) &&
- !strcmp(ruser, user ? user : luser))
- goto ok;
+ !strcmp(ruser, user ? user : luser)) {
+ (void) fclose(hostf);
+ return (0);
+ }
}
(void) fclose(hostf);
}
}
(void) fclose(hostf);
}
@@
-171,13
+175,4
@@
again:
goto again;
}
return (-1);
goto again;
}
return (-1);
-ok:
- (void) fclose(hostf);
- return (0);
-}
-
-socketaddr(x, y)
-{
-
- syscall(103,x,y);
}
}