diff options
author | green <green@FreeBSD.org> | 2000-03-28 01:10:35 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2000-03-28 01:10:35 +0000 |
commit | 5a96429bd9b5a44415f952c5f06ee1e632916e0c (patch) | |
tree | d290e3a0e844afc85c15506190c7a255ce650bee /usr.sbin/inetd/builtins.c | |
parent | d7295a1a39d1518cf454629be7cb8e3e0623831d (diff) | |
download | FreeBSD-src-5a96429bd9b5a44415f952c5f06ee1e632916e0c.zip FreeBSD-src-5a96429bd9b5a44415f952c5f06ee1e632916e0c.tar.gz |
Allow using "-d username" without "-r". Example:
auth stream tcp nowait root internal auth -d "Only fools trust ident"
Diffstat (limited to 'usr.sbin/inetd/builtins.c')
-rw-r--r-- | usr.sbin/inetd/builtins.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c index b49ecba..fae9d17 100644 --- a/usr.sbin/inetd/builtins.c +++ b/usr.sbin/inetd/builtins.c @@ -469,8 +469,20 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */ goto printit; } - if (!rflag) /* Send HIDDEN-USER immediately if not "real" */ - iderror(lport, fport, s, -1); + /* + * If not "real" (-r), send a HIDDEN-USER error for everything. + * If -d is used to set a fallback username, this is used to + * override it, and the fallback is returned instead. + */ + if (!rflag) { + if (fallback == NULL) + iderror(lport, fport, s, -1); + else { + cp = fallback; + goto printit; + } + } + /* * We take the input and construct an array of two sockaddr_ins * which contain the local address information and foreign |