]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Merge the 0.68 release branchlet to master.
authorSimon Tatham <anakin@pobox.com>
Mon, 20 Feb 2017 20:52:41 +0000 (20:52 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 20 Feb 2017 20:52:41 +0000 (20:52 +0000)
Conflicts in the FAQ are fixed by incorporating Jacob's rewritten
post-0.68 version. (But owing to considerable git confusion I haven't
managed to get his name on to this commit anywhere.)

doc/config.but
doc/faq.but
doc/index.but
misc.c
psftp.c
windows/winnet.c

index e36f0bfc96222726bb1278c2cb352d1a4a6ec4fa..04c9cd7065d64294f8d71bed88899d75d03fc375 100644 (file)
@@ -2898,6 +2898,13 @@ the \q{User-supplied GSSAPI library path} field, and move the
 \q{User-supplied GSSAPI library} option in the preference list to
 make sure it is selected before anything else.
 
+On Windows, such libraries are files with a \I{DLL}\cw{.dll}
+extension, and must have been built in the same way as the PuTTY
+executable you're running; if you have a 32-bit DLL, you must run a
+32-bit version of PuTTY, and the same with 64-bit (see
+\k{faq-32bit-64bit}). On Unix, shared libraries generally have a
+\cw{.so} extension.
+
 \H{config-ssh-tty} The TTY panel
 
 The TTY panel lets you configure the remote pseudo-terminal.
index ba0d53213f3568011122e39cf192c8c615252800..42f965b272a0631ce3ca8e4e20a0596c4108f24b 100644 (file)
@@ -215,17 +215,12 @@ seems to be working so far.
 Currently, release versions of PuTTY tools only run on Windows
 systems and Unix.
 
-As of 0.68, the supplied PuTTY executables run on versions of
-Windows from XP onwards, up to and including Windows 10; and we
-know of no reason why PuTTY should not continue to work on
-future versions of Windows.
-
-The 32-bit Windows executables we provide for the \q{\i{x86}}
-processor architecture should also work fine on 64-bit processors
-that are backward-compatible with that architecture. The 64-bit
-executables will only work on 64-bit versions of Windows. They
-will run somewhat faster than 32-bit executables would on the
-same processor, but will consume slightly more memory.
+As of 0.68, the supplied PuTTY executables run on versions of Windows
+from XP onwards, up to and including Windows 10; and we know of no
+reason why PuTTY should not continue to work on future versions of
+Windows. We provide 32-bit and 64-bit Windows executables; see
+\k{faq-32bit-64bit} for discussion of the compatibility issues around
+that.
 
 (We used to also provide executables for Windows for the Alpha
 processor, but stopped after 0.58 due to lack of interest.)
@@ -283,13 +278,10 @@ expect our Unix port to be the right thing for everybody.
 
 \S{faq-wince}{Question} Will there be a port to Windows CE or PocketPC?
 
-We have done some work on such a port, but it only reached an early
+We once did some work on such a port, but it only reached an early
 stage, and certainly not a useful one. It's no longer being actively
 worked on.
 
-However, there's a third-party port at
-\W{http://www.pocketputty.net/}\c{http://www.pocketputty.net/}.
-
 \S{faq-win31}{Question} Is there a port to \i{Windows 3.1}?
 
 PuTTY is a 32-bit application from the ground up, so it won't run on
@@ -424,7 +416,8 @@ put your chosen pathname in the Registry, at
 
 You can ask PuTTY to delete all this data; see \k{faq-cleanup}.
 
-On Unix, PuTTY stores all of this data in a directory \cw{~/.putty}.
+On Unix, PuTTY stores all of this data in a directory \cw{~/.putty}
+by default.
 
 \H{faq-howto} HOWTO questions
 
@@ -584,6 +577,28 @@ of quotes in the obvious way:
 \c pscp "local file" user@host:
 \c pscp user@host:"remote file" .
 
+\S{faq-32bit-64bit}{Question} Should I run the 32-bit or the
+64-bit version?
+
+If you're not sure, the \I{32-bit Windows}32-bit version is generally
+the safe option. It will run perfectly well on all processors and on
+all versions of Windows that PuTTY supports. PuTTY doesn't require to
+run as a 64-bit application to work well, and having a 32-bit PuTTY on
+a 64-bit system isn't likely to cause you any trouble.
+
+The 64-bit version (first released in 0.68) will only run if you have
+a 64-bit processor \e{and} a \I{64-bit Windows}64-bit edition of
+Windows (both of these things are likely to be true of any recent
+Windows PC). It will run somewhat faster (in particular, the
+cryptography will be faster, especially during link setup), but it
+will consume slightly more memory.
+
+If you need to use an external \i{DLL} for GSSAPI authentication, that
+DLL may only be available in a 32-bit or 64-bit form, and that will
+dictate the version of PuTTY you need to use. (You will probably know
+if you're doing this; see \k{config-ssh-auth-gssapi-libraries} in the
+documentation.)
+
 \H{faq-trouble} Troubleshooting
 
 \S{faq-incorrect-mac}{Question} Why do I see \q{Incorrect MAC
index b07f77c0aa185fe59ceef680301c2de92a07a78e..1e71234f772ea1b82b0d84d6e6137d56529499d4 100644 (file)
@@ -861,6 +861,9 @@ saved sessions from
 
 \IM{SYSTEM32} \cw{SYSTEM32} directory, on Windows
 
+\IM{32-bit Windows} 32-bit Windows
+\IM{32-bit Windows} Windows, 32-bit
+\IM{32-bit Windows} x86 (32-bit processor architecture)
 \IM{64-bit Windows} 64-bit Windows
 \IM{64-bit Windows} Windows, 64-bit
 
diff --git a/misc.c b/misc.c
index 6cc817103b5a105d625bd76f6846b6a8326a47d1..9aff234b9fdde6c04527c2b79db32ef02e1122e4 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -394,15 +394,19 @@ int toint(unsigned u)
  *    directive we don't know about, we should panic and die rather
  *    than run any risk.
  */
-static char *dupvprintf_inner(char *buf, int oldlen, int oldsize,
+static char *dupvprintf_inner(char *buf, int oldlen, int *oldsize,
                               const char *fmt, va_list ap)
 {
-    int len, size;
+    int len, size, newsize;
 
-    size = oldsize - oldlen;
+    assert(*oldsize >= oldlen);
+    size = *oldsize - oldlen;
     if (size == 0) {
         size = 512;
-        buf = sresize(buf, oldlen + size, char);
+        newsize = oldlen + size;
+        buf = sresize(buf, newsize, char);
+    } else {
+        newsize = *oldsize;
     }
 
     while (1) {
@@ -430,6 +434,7 @@ static char *dupvprintf_inner(char *buf, int oldlen, int oldsize,
        if (len >= 0 && len < size) {
            /* This is the C99-specified criterion for snprintf to have
             * been completely successful. */
+            *oldsize = newsize;
            return buf;
        } else if (len > 0) {
            /* This is the C99 error condition: the returned length is
@@ -440,13 +445,15 @@ static char *dupvprintf_inner(char *buf, int oldlen, int oldsize,
             * buffer wasn't big enough, so we enlarge it a bit and hope. */
            size += 512;
        }
-       buf = sresize(buf, oldlen + size, char);
+        newsize = oldlen + size;
+        buf = sresize(buf, newsize, char);
     }
 }
 
 char *dupvprintf(const char *fmt, va_list ap)
 {
-    return dupvprintf_inner(NULL, 0, 0, fmt, ap);
+    int size = 0;
+    return dupvprintf_inner(NULL, 0, &size, fmt, ap);
 }
 char *dupprintf(const char *fmt, ...)
 {
@@ -488,7 +495,7 @@ char *strbuf_to_str(strbuf *buf)
 }
 void strbuf_catfv(strbuf *buf, const char *fmt, va_list ap)
 {
-    buf->s = dupvprintf_inner(buf->s, buf->len, buf->size, fmt, ap);
+    buf->s = dupvprintf_inner(buf->s, buf->len, &buf->size, fmt, ap);
     buf->len += strlen(buf->s + buf->len);
 }
 void strbuf_catf(strbuf *buf, const char *fmt, ...)
diff --git a/psftp.c b/psftp.c
index 4fba2d73fd184659572c67f27b56404773c7a618..5394c1fbb9150007422c8f9d0b39da66ff8aa37e 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -1050,6 +1050,7 @@ int sftp_cmd_ls(struct sftp_command *cmd)
 
     if (dirh == NULL) {
        printf("Unable to open %s: %s\n", dir, fxp_error());
+       return 0;
     } else {
        nnames = namesize = 0;
        ournames = NULL;
index fb121e3f7ea681a9cf2645a5aa063c4a91429bdb..9875323744cda7ffbdf2377061231176debc848a 100644 (file)
@@ -774,6 +774,8 @@ static int ipv4_is_local_addr(struct in_addr addr)
        SOCKET s = p_socket(AF_INET, SOCK_DGRAM, 0);
        DWORD retbytes;
 
+       SetHandleInformation((HANDLE)s, HANDLE_FLAG_INHERIT, 0);
+
        if (p_WSAIoctl &&
            p_WSAIoctl(s, SIO_GET_INTERFACE_LIST, NULL, 0,
                       local_interfaces, sizeof(local_interfaces),
@@ -1022,6 +1024,8 @@ static DWORD try_connect(Actual_Socket sock)
        goto ret;
     }
 
+       SetHandleInformation((HANDLE)s, HANDLE_FLAG_INHERIT, 0);
+
     if (sock->oobinline) {
        BOOL b = TRUE;
        p_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (void *) &b, sizeof(b));
@@ -1303,6 +1307,8 @@ Socket sk_newlistener(const char *srcaddr, int port, Plug plug,
        return (Socket) ret;
     }
 
+       SetHandleInformation((HANDLE)s, HANDLE_FLAG_INHERIT, 0);
+
     ret->oobinline = 0;
 
     p_setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *)&on, sizeof(on));