From 35c176ff831a34328b50d418b0af3ba0a918b1e2 Mon Sep 17 00:00:00 2001 From: Nick Sayer Date: Fri, 30 Jun 2000 16:46:58 +0000 Subject: MFC: 1.19 --- libexec/rexecd/rexecd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libexec') diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index 10c2f2be98c6..bd8876cbaadd 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -82,6 +82,8 @@ void getstr __P((char *, int, char *)); /*VARARGS1*/ void error __P(()); +int no_uid_0 = 1; + /* * remote execute server: * username\0 @@ -99,6 +101,9 @@ main(argc, argv) int fromlen; struct hostent *hp; + if (argc == 2 && !strcmp(argv[1], "-i")) + no_uid_0 = 0; + openlog(argv[0], LOG_PID, LOG_AUTH); fromlen = sizeof (from); if (getpeername(0, (struct sockaddr *)&from, &fromlen) < 0) @@ -191,7 +196,7 @@ doit(f, fromp) } } - if (pwd->pw_uid == 0 || *pwd->pw_passwd == '\0' || + if ((pwd->pw_uid == 0 && no_uid_0) || *pwd->pw_passwd == '\0' || (pwd->pw_expire && time(NULL) >= pwd->pw_expire)) { syslog(LOG_ERR, "%s LOGIN REFUSED from %s", user, remote); error("Login incorrect.\n"); -- cgit v1.3