summaryrefslogtreecommitdiff
path: root/pppd
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-12-31 05:33:45 +0100
committerGitHub <noreply@github.com>2020-12-31 15:33:45 +1100
commit7f7ea8967e3b02234811a4b9bb893fc21544319c (patch)
tree3ba9bfa8c2cdb57e8cfb9113bf9a5c6ec10570e1 /pppd
parent2ff8d30b889d33d3dd881257210d0ebb0806c76f (diff)
downloadppp-7f7ea8967e3b02234811a4b9bb893fc21544319c.tar.gz
pppd: Add option to strip MS domain name (#188)
Some Windows 9x/ME clients might be erroneously transmitting the MS domain along the login name. This allows to strip them on the server side. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Co-authored-by: Marco d'Itri <md@linux.it>
Diffstat (limited to 'pppd')
-rw-r--r--pppd/chap-new.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pppd/chap-new.c b/pppd/chap-new.c
index 0b1bb86..fab8280 100644
--- a/pppd/chap-new.c
+++ b/pppd/chap-new.c
@@ -59,6 +59,7 @@ int chap_server_timeout_time = 3;
int chap_max_transmits = 10;
int chap_rechallenge_time = 0;
int chap_client_timeout_time = 60;
+int chapms_strip_domain = 0;
/*
* Command-line options.
@@ -72,6 +73,8 @@ static option_t chap_option_list[] = {
"Set interval for rechallenge", OPT_PRIO },
{ "chap-timeout", o_int, &chap_client_timeout_time,
"Set timeout for CHAP (as client)", OPT_PRIO },
+ { "chapms-strip-domain", o_bool, &chapms_strip_domain,
+ "Strip the domain prefix before the Username", 1 },
{ NULL }
};
@@ -355,6 +358,14 @@ chap_handle_response(struct chap_server_state *ss, int id,
/* Null terminate and clean remote name. */
slprintf(rname, sizeof(rname), "%.*v", len, name);
name = rname;
+
+ /* strip the MS domain name */
+ if (chapms_strip_domain && strrchr(rname, '\\')) {
+ char tmp[MAXNAMELEN+1];
+
+ strcpy(tmp, strrchr(rname, '\\') + 1);
+ strcpy(rname, tmp);
+ }
}
if (chap_verify_hook)