[pptp-server] Req: pppd patch to strip MS <DOMAIN>\\

Robert Lankshear rlankshear at comset.co.uk
Tue Sep 7 07:52:04 CDT 1999


Hi there,

I modified the chap.c component of the PPTP daemon to do the MS Domain
Strip when it became clear that Chap-Secrets were case-sensitive and my
users liked to fiddle about with their Domain name case.

patch -p0 < chap.patch

To be run from the same directory as the file to be patched.

It's nice and simple and relies on the fact that MS hosts do not return a
Remote Host name so that all that needs to be manipulated is the rhostname
variable. A trivial piece of C String manipulation and voila - a
domain-less username is produced.

Enjoy it :)

Robert.

--- chap.c.orig     Wed Sep  1 09:42:52 1999
+++ chap.c     Tue Sep  7 12:55:06 1999
@@ -366,7 +366,7 @@
     return;
     }
     len -= CHAP_HEADERLEN;
-
+
     /*
      * Action depends on code (as in fact it usually does :-).
      */
@@ -522,6 +522,10 @@
     char secret[MAXSECRETLEN];
     u_char hash[MD5_SIGNATURE_SIZE];

+#ifdef CHAPMS
+    char *msstring;
+#endif
+
     if (cstate->serverstate == CHAPSS_CLOSED ||
     cstate->serverstate == CHAPSS_PENDING) {
     CHAPDEBUG(("ChapReceiveResponse: in state %d", cstate->serverstate));
@@ -565,6 +569,14 @@
     len = sizeof(rhostname) - 1;
     BCOPY(inp, rhostname, len);
     rhostname[len] = '\000';
+
+#ifdef CHAPMS
+    /* Patch to strip DOMAIN from a Windows Logon */
+    if ((msstring = strrchr(rhostname, '\\')) != (char *)NULL) {
+    ++msstring;
+    strncpy(rhostname, msstring, sizeof(rhostname));
+    }
+#endif

     /*
      * Get secret for authenticating them with us,






More information about the pptp-server mailing list