diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2015-06-15 09:07:44 +0000 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2015-06-15 09:07:44 +0000 |
commit | 8b61a947bd7797102a14dc37573f10629db65fb7 (patch) | |
tree | 9995391fba27c8795a8037429ac2929bfdb45d45 | |
parent | 2c51e416cb8a5469719a3ba72b1cc2ad1b63e1f6 (diff) | |
download | ppp-8b61a947bd7797102a14dc37573f10629db65fb7.tar.gz |
debian stripMSdomain
-rw-r--r-- | pppd/chap-new.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pppd/chap-new.c b/pppd/chap-new.c index 2714bff..7fd7087 100644 --- a/pppd/chap-new.c +++ b/pppd/chap-new.c @@ -58,6 +58,7 @@ int (*chap_verify_hook)(char *name, char *ourname, int id, int chap_timeout_time = 3; int chap_max_transmits = 10; int chap_rechallenge_time = 0; +int chapms_strip_domain = 0; /* * Command-line options. @@ -69,6 +70,8 @@ static option_t chap_option_list[] = { "Set max #xmits for challenge", OPT_PRIO }, { "chap-interval", o_int, &chap_rechallenge_time, "Set interval for rechallenge", OPT_PRIO }, + { "chapms-strip-domain", o_bool, &chapms_strip_domain, + "Strip the domain prefix before the Username", 1 }, { NULL } }; @@ -336,6 +339,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) |