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>
int chap_max_transmits = 10;
int chap_rechallenge_time = 0;
int chap_client_timeout_time = 60;
int chap_max_transmits = 10;
int chap_rechallenge_time = 0;
int chap_client_timeout_time = 60;
+int chapms_strip_domain = 0;
/*
* Command-line options.
/*
* Command-line options.
"Set interval for rechallenge", OPT_PRIO },
{ "chap-timeout", o_int, &chap_client_timeout_time,
"Set timeout for CHAP (as client)", OPT_PRIO },
"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 terminate and clean remote name. */
slprintf(rname, sizeof(rname), "%.*v", len, name);
name = rname;
/* 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);
+ }