summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd/builtins.c
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/builtins.c
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/builtins.c')
-rw-r--r--usr.sbin/inetd/builtins.c10
1 files changed, 7 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)
OpenPOWER on IntegriCloud