summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2000-12-05 13:56:01 +0000
committerdwmalone <dwmalone@FreeBSD.org>2000-12-05 13:56:01 +0000
commit1144f3ac9a6d3b1e4007c2f8252d4f7ac126a3c4 (patch)
treeb828bde7bfc24a00e67edfadeb25c0f2946acf2f /usr.sbin/inetd
parent3339f5cc674f817f03ffd011de01dcc07c557402 (diff)
downloadFreeBSD-src-1144f3ac9a6d3b1e4007c2f8252d4f7ac126a3c4.zip
FreeBSD-src-1144f3ac9a6d3b1e4007c2f8252d4f7ac126a3c4.tar.gz
Add a -F option to the builtin ident service, which allows .fakeid files
to contain the name of other valid users. PR: 22837 Submitted by: Andreas Gerstenberg <andy@andy.de> Reviewed by: green Reviewed by: sheldonh
Diffstat (limited to 'usr.sbin/inetd')
-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