summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/inetd/builtins.c10
-rw-r--r--usr.sbin/inetd/inetd.810
2 files changed, 17 insertions, 3 deletions
diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c
index 330214b..cb594a1 100644
--- a/usr.sbin/inetd/builtins.c
+++ b/usr.sbin/inetd/builtins.c
@@ -351,7 +351,7 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */
ssize_t ssize;
size_t size, bufsiz;
int c, fflag = 0, nflag = 0, rflag = 0, argc = 0, usedfallback = 0;
- int gflag = 0, getcredfail = 0, onreadlen;
+ int gflag = 0, Fflag = 0, getcredfail = 0, onreadlen;
u_short lport, fport;
inetd_setproctitle(sep->se_service, s);
@@ -373,7 +373,7 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */
size_t i;
u_int32_t random;
- while ((c = getopt(argc, sep->se_argv, "d:fgno:rt:")) != -1)
+ while ((c = getopt(argc, sep->se_argv, "d:fFgno:rt:")) != -1)
switch (c) {
case 'd':
fallback = optarg;
@@ -381,6 +381,10 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */
case 'f':
fflag = 1;
break;
+ case 'F':
+ fflag = 1;
+ Fflag=1;
+ break;
case 'g':
gflag = 1;
random = 0; /* Shush, compiler. */
@@ -627,7 +631,7 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */
* we will return their real identity instead.
*/
- if (!*cp || getpwnam(cp)) {
+ if (!*cp || (!Fflag && getpwnam(cp))) {
errno = 0;
pw = getpwuid(uc.cr_uid);
if (pw == NULL)
diff --git a/usr.sbin/inetd/inetd.8 b/usr.sbin/inetd/inetd.8
index e152a21..bbaf4f6 100644
--- a/usr.sbin/inetd/inetd.8
+++ b/usr.sbin/inetd/inetd.8
@@ -469,6 +469,16 @@ If the file
.Pa .fakeid
exists in the home directory of the identified user, report the username
found in that file instead of the real username.
+If the the username found in
+.Pa .fakeid
+is that of an existing user,
+then the real username is reported.
+.It Fl F
+same as
+.Fl f
+but without the restriction that the username in
+.Pa .fakeid
+must not match an existing user.
.It Fl g
Instead of returning the user's name to the ident requester, report a
username made up of random alphanumeric characters, e.g.
OpenPOWER on IntegriCloud