merged the overlapping strcpy fix from head
authorAndrew Tridgell <tridge@samba.org>
Tue, 25 Apr 2000 03:01:50 +0000 (03:01 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 25 Apr 2000 03:01:50 +0000 (03:01 +0000)
source/smbd/reply.c

index eb1cd694ba7633f33ad7c469bc0f1ea796a24b50..3dc92fc582ed0398fec66acc52b16526dfed7592 100644 (file)
@@ -264,7 +264,7 @@ int reply_tcon(connection_struct *conn,
 
 int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize)
 {
-       pstring service;
+       fstring service;
        pstring user;
        pstring password;
        pstring devicename;
@@ -296,11 +296,9 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
                passlen = strlen(password);
        }
        
-       fstrcpy(service,path+2);
-       p = strchr(service,'\\');
+       p = strchr(path+2,'\\');
        if (!p)
                return(ERROR(ERRSRV,ERRinvnetname));
-       *p = 0;
        fstrcpy(service,p+1);
        p = strchr(service,'%');
        if (p) {
@@ -310,11 +308,11 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
        StrnCpy(devicename,path + strlen(path) + 1,6);
        DEBUG(4,("Got device type %s\n",devicename));
 
-    /*
-     * Ensure the user and password names are in UNIX codepage format.
-     */
+       /*
+        * Ensure the user and password names are in UNIX codepage format.
+        */
 
-    dos_to_unix(user,True);
+       dos_to_unix(user,True);
        if (!doencrypt)
                dos_to_unix(password,True);