107-debian_stripMSdomain.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. Index: ppp-2.4.3/pppd/chap-new.c
  2. ===================================================================
  3. --- ppp-2.4.3.orig/pppd/chap-new.c 2007-06-04 13:22:08.298593704 +0200
  4. +++ ppp-2.4.3/pppd/chap-new.c 2007-06-04 13:22:11.199152752 +0200
  5. @@ -57,6 +57,7 @@
  6. int chap_timeout_time = 3;
  7. int chap_max_transmits = 10;
  8. int chap_rechallenge_time = 0;
  9. +int chapms_strip_domain = 0;
  10. /*
  11. * Command-line options.
  12. @@ -68,6 +69,8 @@
  13. "Set max #xmits for challenge", OPT_PRIO },
  14. { "chap-interval", o_int, &chap_rechallenge_time,
  15. "Set interval for rechallenge", OPT_PRIO },
  16. + { "chapms-strip-domain", o_bool, &chapms_strip_domain,
  17. + "Strip the domain prefix before the Username", 1 },
  18. { NULL }
  19. };
  20. @@ -338,6 +341,14 @@
  21. /* Null terminate and clean remote name. */
  22. slprintf(rname, sizeof(rname), "%.*v", len, name);
  23. name = rname;
  24. +
  25. + /* strip the MS domain name */
  26. + if (chapms_strip_domain && strrchr(rname, '\\')) {
  27. + char tmp[MAXNAMELEN+1];
  28. +
  29. + strcpy(tmp, strrchr(rname, '\\') + 1);
  30. + strcpy(rname, tmp);
  31. + }
  32. }
  33. if (chap_verify_hook)