summaryrefslogtreecommitdiffstats
path: root/libexec/rexecd/rexecd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/rexecd/rexecd.c')
-rw-r--r--libexec/rexecd/rexecd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c
index 10c2f2b..bd8876c 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");
OpenPOWER on IntegriCloud