Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-1.9.git;a=commitdiff;h=4266d9ba9d6db89d3397690f7d70e33b11b8f0f3

commit 4266d9ba9d6db89d3397690f7d70e33b11b8f0f3
Author: kikadf <[email protected]>
Date:   Sat Oct 4 21:06:06 2014 +0200

putty-0.62-2arcturus1-x86_64

* Fix CVE-2013-4206, CVE-2013-4207, CVE-2013-4208, CVE-2013-4852
* Fix build

diff --git a/source/xapps-extra/putty/CVE-2013-4206.patch 
b/source/xapps-extra/putty/CVE-2013-4206.patch
new file mode 100644
index 0000000..fc9b590
--- /dev/null
+++ b/source/xapps-extra/putty/CVE-2013-4206.patch
@@ -0,0 +1,95 @@
+Description: CVE-2013-4206
+ Buffer underrun in modmul could corrupt the heap.
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9977
+Bug: 
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/vuln-modmul.html
+Forwarded: not-needed
+Last-Update: 2013-08-07
+
+Index: b/sshbn.c
+===================================================================
+--- a/sshbn.c
++++ b/sshbn.c
+@@ -1018,6 +1018,13 @@
+
+     pqlen = (p[0] > q[0] ? p[0] : q[0]);
+
++    /*
++     * Make sure that we're allowing enough space. The shifting below
++     * will underflow the vectors we allocate if pqlen is too small.
++     */
++    if (2*pqlen <= mlen)
++        pqlen = mlen/2 + 1;
++
+     /* Allocate n of size pqlen, copy p to n */
+     n = snewn(pqlen, BignumInt);
+     i = pqlen - p[0];
+@@ -1864,6 +1871,44 @@
+             freebn(b);
+             freebn(c);
+             freebn(p);
++        } else if (!strcmp(buf, "modmul")) {
++            Bignum a, b, m, c, p;
++
++            if (ptrnum != 4) {
++                printf("%d: modmul with %d parameters, expected 4\n",
++                       line, ptrnum);
++                exit(1);
++            }
++            a = bignum_from_bytes(ptrs[0], ptrs[1]-ptrs[0]);
++            b = bignum_from_bytes(ptrs[1], ptrs[2]-ptrs[1]);
++            m = bignum_from_bytes(ptrs[2], ptrs[3]-ptrs[2]);
++            c = bignum_from_bytes(ptrs[3], ptrs[4]-ptrs[3]);
++            p = modmul(a, b, m);
++
++            if (bignum_cmp(c, p) == 0) {
++                passes++;
++            } else {
++                char *as = bignum_decimal(a);
++                char *bs = bignum_decimal(b);
++                char *ms = bignum_decimal(m);
++                char *cs = bignum_decimal(c);
++                char *ps = bignum_decimal(p);
++
++                printf("%d: fail: %s * %s mod %s gave %s expected %s\n",
++                       line, as, bs, ms, ps, cs);
++                fails++;
++
++                sfree(as);
++                sfree(bs);
++                sfree(ms);
++                sfree(cs);
++                sfree(ps);
++            }
++            freebn(a);
++            freebn(b);
++            freebn(m);
++            freebn(c);
++            freebn(p);
+         } else if (!strcmp(buf, "pow")) {
+             Bignum base, expt, modulus, expected, answer;
+
+Index: b/testdata/bignum.py
+===================================================================
+--- a/testdata/bignum.py
++++ b/testdata/bignum.py
+@@ -103,6 +103,15 @@
+     a, b, p = findprod((1<<i)+1, +1, (i, i+1))
+     print "mul", hexstr(a), hexstr(b), hexstr(p)
+
++# Simple tests of modmul.
++for ai in range(20, 200, 60):
++    a = sqrt(3<<(2*ai-1))
++    for bi in range(20, 200, 60):
++        b = sqrt(5<<(2*bi-1))
++        for m in range(20, 600, 32):
++            m = sqrt(2**(m+1))
++            print "modmul", hexstr(a), hexstr(b), hexstr(m), hexstr((a*b) % m)
++
+ # Simple tests of modpow.
+ for i in range(64, 4097, 63):
+     modulus = sqrt(1<<(2*i-1)) | 1
+@@ -113,3 +122,4 @@
+         # Test even moduli, which can't be done by Montgomery.
+         modulus = modulus - 1
+         print "pow", hexstr(base), hexstr(expt), hexstr(modulus), 
hexstr(pow(base, expt, modulus))
++        print "pow", hexstr(i), hexstr(expt), hexstr(modulus), hexstr(pow(i, 
expt, modulus))
diff --git a/source/xapps-extra/putty/CVE-2013-4207.patch 
b/source/xapps-extra/putty/CVE-2013-4207.patch
new file mode 100644
index 0000000..31aa30a
--- /dev/null
+++ b/source/xapps-extra/putty/CVE-2013-4207.patch
@@ -0,0 +1,337 @@
+Description: CVE-2013-4207
+ Non-coprime values in DSA signatures can cause buffer overflow in modular
+ inverse.
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9987
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9989
+Origin: backport, http://svn.tartarus.org/sgt?view=rev&revision=9990
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9992
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9995
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9996
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9997
+Bug: 
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/vuln-bignum-division-by-zero.html
+Forwarded: not-needed
+Last-Update: 2013-08-07
+
+Index: b/sshbn.c
+===================================================================
+--- a/sshbn.c
++++ b/sshbn.c
+@@ -6,6 +6,7 @@
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <limits.h>
+
+ #include "misc.h"
+
+@@ -120,7 +121,11 @@
+
+ static Bignum newbn(int length)
+ {
+-    Bignum b = snewn(length + 1, BignumInt);
++    Bignum b;
++
++    assert(length >= 0 && length < INT_MAX / BIGNUM_INT_BITS);
++
++    b = snewn(length + 1, BignumInt);
+     if (!b)
+       abort();                       /* FIXME */
+     memset(b, 0, (length + 1) * sizeof(*b));
+@@ -154,7 +159,11 @@
+
+ Bignum bn_power_2(int n)
+ {
+-    Bignum ret = newbn(n / BIGNUM_INT_BITS + 1);
++    Bignum ret;
++
++    assert(n >= 0);
++
++    ret = newbn(n / BIGNUM_INT_BITS + 1);
+     bignum_set_bit(ret, n, 1);
+     return ret;
+ }
+@@ -598,6 +607,7 @@
+     addend = (BignumDblInt)n << bshift;
+
+     while (addend) {
++        assert(word <= number[0]);
+       addend += number[word];
+       number[word] = (BignumInt) addend & BIGNUM_INT_MASK;
+       addend >>= BIGNUM_INT_BITS;
+@@ -624,6 +634,7 @@
+     int i, k;
+
+     m0 = m[0];
++    assert(m0 >> (BIGNUM_INT_BITS-1) == 1);
+     if (mlen > 1)
+       m1 = m[1];
+     else
+@@ -873,6 +884,7 @@
+     len = mod[0];
+     r = bn_power_2(BIGNUM_INT_BITS * len);
+     inv = modinv(mod, r);
++    assert(inv); /* cannot fail, since mod is odd and r is a power of 2 */
+
+     /*
+      * Multiply the base by r mod n, to get it into Montgomery
+@@ -999,6 +1011,12 @@
+     int pqlen, mlen, rlen, i, j;
+     Bignum result;
+
++    /*
++     * The most significant word of mod needs to be non-zero. It
++     * should already be, but let's make sure.
++     */
++    assert(mod[mod[0]] != 0);
++
+     /* Allocate m of size mlen, copy mod to m */
+     /* We use big endian internally */
+     mlen = mod[0];
+@@ -1103,6 +1121,12 @@
+     int mshift;
+     int plen, mlen, i, j;
+
++    /*
++     * The most significant word of mod needs to be non-zero. It
++     * should already be, but let's make sure.
++     */
++    assert(mod[mod[0]] != 0);
++
+     /* Allocate m of size mlen, copy mod to m */
+     /* We use big endian internally */
+     mlen = mod[0];
+@@ -1178,6 +1202,8 @@
+     Bignum result;
+     int w, i;
+
++    assert(nbytes >= 0 && nbytes < INT_MAX/8);
++
+     w = (nbytes + BIGNUM_INT_BYTES - 1) / BIGNUM_INT_BYTES; /* bytes->words */
+
+     result = newbn(w);
+@@ -1254,7 +1280,7 @@
+  */
+ int bignum_byte(Bignum bn, int i)
+ {
+-    if (i >= (int)(BIGNUM_INT_BYTES * bn[0]))
++    if (i < 0 || i >= (int)(BIGNUM_INT_BYTES * bn[0]))
+       return 0;                      /* beyond the end */
+     else
+       return (bn[i / BIGNUM_INT_BYTES + 1] >>
+@@ -1266,7 +1292,7 @@
+  */
+ int bignum_bit(Bignum bn, int i)
+ {
+-    if (i >= (int)(BIGNUM_INT_BITS * bn[0]))
++    if (i < 0 || i >= (int)(BIGNUM_INT_BITS * bn[0]))
+       return 0;                      /* beyond the end */
+     else
+       return (bn[i / BIGNUM_INT_BITS + 1] >> (i % BIGNUM_INT_BITS)) & 1;
+@@ -1277,7 +1303,7 @@
+  */
+ void bignum_set_bit(Bignum bn, int bitnum, int value)
+ {
+-    if (bitnum >= (int)(BIGNUM_INT_BITS * bn[0]))
++    if (bitnum < 0 || bitnum >= (int)(BIGNUM_INT_BITS * bn[0]))
+       abort();                       /* beyond the end */
+     else {
+       int v = bitnum / BIGNUM_INT_BITS + 1;
+@@ -1313,7 +1339,18 @@
+ int bignum_cmp(Bignum a, Bignum b)
+ {
+     int amax = a[0], bmax = b[0];
+-    int i = (amax > bmax ? amax : bmax);
++    int i;
++
++    /* Annoyingly we have two representations of zero */
++    if (amax == 1 && a[amax] == 0)
++        amax = 0;
++    if (bmax == 1 && b[bmax] == 0)
++        bmax = 0;
++
++    assert(amax == 0 || a[amax] != 0);
++    assert(bmax == 0 || b[bmax] != 0);
++
++    i = (amax > bmax ? amax : bmax);
+     while (i) {
+       BignumInt aval = (i > amax ? 0 : a[i]);
+       BignumInt bval = (i > bmax ? 0 : b[i]);
+@@ -1335,6 +1372,8 @@
+     int i, shiftw, shiftb, shiftbb, bits;
+     BignumInt ai, ai1;
+
++    assert(shift >= 0);
++
+     bits = bignum_bitcount(a) - shift;
+     ret = newbn((bits + BIGNUM_INT_BITS - 1) / BIGNUM_INT_BITS);
+
+@@ -1636,9 +1675,26 @@
+     Bignum x = copybn(One);
+     int sign = +1;
+
++    assert(number[number[0]] != 0);
++    assert(modulus[modulus[0]] != 0);
++
+     while (bignum_cmp(b, One) != 0) {
+-      Bignum t = newbn(b[0]);
+-      Bignum q = newbn(a[0]);
++      Bignum t, q;
++
++        if (bignum_cmp(b, Zero) == 0) {
++            /*
++             * Found a common factor between the inputs, so we cannot
++             * return a modular inverse at all.
++             */
++            freebn(b);
++            freebn(a);
++            freebn(xp);
++            freebn(x);
++            return NULL;
++        }
++
++        t = newbn(b[0]);
++      q = newbn(a[0]);
+       bigdivmod(a, b, t, q);
+       while (t[0] > 1 && t[t[0]] == 0)
+           t[0]--;
+Index: b/sshdss.c
+===================================================================
+--- a/sshdss.c
++++ b/sshdss.c
+@@ -257,10 +257,21 @@
+     if (!r || !s)
+       return 0;
+
++    if (!bignum_cmp(s, Zero)) {
++        freebn(r);
++        freebn(s);
++        return 0;
++    }
++
+     /*
+      * Step 1. w <- s^-1 mod q.
+      */
+     w = modinv(s, dss->q);
++    if (!w) {
++        freebn(r);
++        freebn(s);
++        return 0;
++    }
+
+     /*
+      * Step 2. u1 <- SHA(message) * w mod q.
+@@ -578,16 +589,32 @@
+     SHA512_Init(&ss);
+     SHA512_Bytes(&ss, digest512, sizeof(digest512));
+     SHA512_Bytes(&ss, digest, sizeof(digest));
+-    SHA512_Final(&ss, digest512);
+
+-    memset(&ss, 0, sizeof(ss));
++    while (1) {
++        SHA512_State ss2 = ss;         /* structure copy */
++        SHA512_Final(&ss2, digest512);
++
++        memset(&ss2, 0, sizeof(ss2));
++
++        /*
++         * Now convert the result into a bignum, and reduce it mod q.
++         */
++        proto_k = bignum_from_bytes(digest512, 64);
++        k = bigmod(proto_k, dss->q);
++        freebn(proto_k);
++        kinv = modinv(k, dss->q);            /* k^-1 mod q */
++        if (!kinv) {                           /* very unlikely */
++            freebn(k);
++            /* Perturb the hash to think of a different k. */
++            SHA512_Bytes(&ss, "x", 1);
++            /* Go round and try again. */
++            continue;
++        }
+
+-    /*
+-     * Now convert the result into a bignum, and reduce it mod q.
+-     */
+-    proto_k = bignum_from_bytes(digest512, 64);
+-    k = bigmod(proto_k, dss->q);
+-    freebn(proto_k);
++        break;
++    }
++
++    memset(&ss, 0, sizeof(ss));
+
+     memset(digest512, 0, sizeof(digest512));
+
+@@ -599,7 +626,6 @@
+     freebn(gkp);
+
+     hash = bignum_from_bytes(digest, 20);
+-    kinv = modinv(k, dss->q);        /* k^-1 mod q */
+     hxr = bigmuladd(dss->x, r, hash);  /* hash + x*r */
+     s = modmul(kinv, hxr, dss->q);     /* s = k^-1 * (hash + x*r) mod q */
+     freebn(hxr);
+Index: b/sshrsa.c
+===================================================================
+--- a/sshrsa.c
++++ b/sshrsa.c
+@@ -273,9 +273,18 @@
+           bignum_cmp(random, key->modulus) >= 0) {
+           freebn(random);
+           continue;
+-      } else {
+-          break;
+       }
++
++        /*
++         * Also, make sure it has an inverse mod modulus.
++         */
++        random_inverse = modinv(random, key->modulus);
++        if (!random_inverse) {
++          freebn(random);
++          continue;
++        }
++
++        break;
+     }
+
+     /*
+@@ -294,7 +303,6 @@
+      */
+     random_encrypted = crt_modpow(random, key->exponent,
+                                   key->modulus, key->p, key->q, key->iqmp);
+-    random_inverse = modinv(random, key->modulus);
+     input_blinded = modmul(input, random_encrypted, key->modulus);
+     ret_blinded = crt_modpow(input_blinded, key->private_exponent,
+                              key->modulus, key->p, key->q, key->iqmp);
+@@ -441,6 +449,8 @@
+
+       freebn(key->iqmp);
+       key->iqmp = modinv(key->q, key->p);
++        if (!key->iqmp)
++            return 0;
+     }
+
+     /*
+Index: b/sshrsag.c
+===================================================================
+--- a/sshrsag.c
++++ b/sshrsag.c
+@@ -2,6 +2,8 @@
+  * RSA key generation.
+  */
+
++#include <assert.h>
++
+ #include "ssh.h"
+
+ #define RSA_EXPONENT 37                      /* we like this prime */
+@@ -92,8 +94,10 @@
+     freebn(pm1);
+     freebn(qm1);
+     key->private_exponent = modinv(key->exponent, phi_n);
++    assert(key->private_exponent);
+     pfn(pfnparam, PROGFN_PROGRESS, 3, 4);
+     key->iqmp = modinv(key->q, key->p);
++    assert(key->iqmp);
+     pfn(pfnparam, PROGFN_PROGRESS, 3, 5);
+
+     /*
diff --git a/source/xapps-extra/putty/CVE-2013-4208.patch 
b/source/xapps-extra/putty/CVE-2013-4208.patch
new file mode 100644
index 0000000..1231d71
--- /dev/null
+++ b/source/xapps-extra/putty/CVE-2013-4208.patch
@@ -0,0 +1,70 @@
+Description: CVE-2013-4208
+ Private keys were left in memory after being used by PuTTY tools.
+Origin: backport, http://svn.tartarus.org/sgt?view=rev&revision=9919
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9984
+Origin: backport, http://svn.tartarus.org/sgt?view=rev&revision=9988
+Bug: 
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/private-key-not-wiped.html
+Forwarded: not-needed
+Last-Update: 2013-08-07
+
+Index: b/sshdss.c
+===================================================================
+--- a/sshdss.c
++++ b/sshdss.c
+@@ -111,6 +111,7 @@
+     dss->q = getmp(&data, &len);
+     dss->g = getmp(&data, &len);
+     dss->y = getmp(&data, &len);
++    dss->x = NULL;
+
+     return dss;
+ }
+@@ -118,10 +119,16 @@
+ static void dss_freekey(void *key)
+ {
+     struct dss_key *dss = (struct dss_key *) key;
+-    freebn(dss->p);
+-    freebn(dss->q);
+-    freebn(dss->g);
+-    freebn(dss->y);
++    if (dss->p)
++        freebn(dss->p);
++    if (dss->q)
++        freebn(dss->q);
++    if (dss->g)
++        freebn(dss->g);
++    if (dss->y)
++        freebn(dss->y);
++    if (dss->x)
++        freebn(dss->x);
+     sfree(dss);
+ }
+
+@@ -630,6 +637,7 @@
+     s = modmul(kinv, hxr, dss->q);     /* s = k^-1 * (hash + x*r) mod q */
+     freebn(hxr);
+     freebn(kinv);
++    freebn(k);
+     freebn(hash);
+
+     /*
+Index: b/sshrsa.c
+===================================================================
+--- a/sshrsa.c
++++ b/sshrsa.c
+@@ -421,6 +421,7 @@
+     pm1 = copybn(key->p);
+     decbn(pm1);
+     ed = modmul(key->exponent, key->private_exponent, pm1);
++    freebn(pm1);
+     cmp = bignum_cmp(ed, One);
+     sfree(ed);
+     if (cmp != 0)
+@@ -429,6 +430,7 @@
+     qm1 = copybn(key->q);
+     decbn(qm1);
+     ed = modmul(key->exponent, key->private_exponent, qm1);
++    freebn(qm1);
+     cmp = bignum_cmp(ed, One);
+     sfree(ed);
+     if (cmp != 0)
diff --git a/source/xapps-extra/putty/CVE-2013-4852.patch 
b/source/xapps-extra/putty/CVE-2013-4852.patch
new file mode 100644
index 0000000..5acada0
--- /dev/null
+++ b/source/xapps-extra/putty/CVE-2013-4852.patch
@@ -0,0 +1,77 @@
+Description: CVE-2013-4852
+ Negative string length in public-key signatures could cause integer
+ overflow and overwrite all of memory.
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9896
+Origin: upstream, http://svn.tartarus.org/sgt?view=rev&revision=9978
+Bug: 
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/vuln-signature-stringlen.html
+Bug-Debian: http://bugs.debian.org/718779
+Forwarded: not-needed
+Last-Update: 2013-08-07
+
+Index: b/import.c
+===================================================================
+--- a/import.c
++++ b/import.c
+@@ -290,7 +290,7 @@
+     if (len < 4)
+         goto error;
+     bytes = GET_32BIT(d);
+-    if (len < 4+bytes)
++    if (bytes < 0 || len-4 < bytes)
+         goto error;
+
+     ret->start = d + 4;
+Index: b/sshdss.c
+===================================================================
+--- a/sshdss.c
++++ b/sshdss.c
+@@ -43,6 +43,8 @@
+     if (*datalen < 4)
+       return;
+     *length = GET_32BIT(*data);
++    if (*length < 0)
++        return;
+     *datalen -= 4;
+     *data += 4;
+     if (*datalen < *length)
+@@ -70,6 +72,9 @@
+ {
+     Bignum b;
+
++    if (*datalen < 20)
++        return NULL;
++
+     b = bignum_from_bytes((unsigned char *)*data, 20);
+     *data += 20;
+     *datalen -= 20;
+@@ -98,7 +103,7 @@
+     }
+ #endif
+
+-    if (!p || memcmp(p, "ssh-dss", 7)) {
++    if (!p || slen != 7 || memcmp(p, "ssh-dss", 7)) {
+       sfree(dss);
+       return NULL;
+     }
+Index: b/sshrsa.c
+===================================================================
+--- a/sshrsa.c
++++ b/sshrsa.c
+@@ -526,6 +526,8 @@
+     if (*datalen < 4)
+       return;
+     *length = GET_32BIT(*data);
++    if (*length < 0)
++        return;
+     *datalen -= 4;
+     *data += 4;
+     if (*datalen < *length)
+@@ -838,6 +840,8 @@
+       return 0;
+     }
+     in = getmp(&sig, &siglen);
++    if (!in)
++        return 0;
+     out = modpow(in, rsa->exponent, rsa->modulus);
+     freebn(in);
+
diff --git a/source/xapps-extra/putty/FrugalBuild 
b/source/xapps-extra/putty/FrugalBuild
index 3bfe39b..27c6e88 100644
--- a/source/xapps-extra/putty/FrugalBuild
+++ b/source/xapps-extra/putty/FrugalBuild
@@ -3,25 +3,38 @@

pkgname=putty
pkgver=0.62
-pkgrel=1
+pkgrel=2arcturus1
pkgdesc="A terminal integrated SSH/Telnet client known from Windows."
url="http://www.chiark.greenend.org.uk/~sgtatham/putty/";
depends=('gtk+2')
groups=('xapps-extra')
archs=('i686' 'x86_64')
up2date="lynx -dump $url|grep -m 1 latest|sed 's/.* \(.*\)\.$/\1/'"
-source=(http://the.earth.li/~sgtatham/putty/latest/putty-$pkgver.tar.gz)
-sha1sums=('5898438614117ee7e3704fc3f30a3c4bf2041380')
+source=(http://the.earth.li/~sgtatham/putty/latest/putty-$pkgver.tar.gz
+        glib-deprecated-functions.patch)
+sha1sums=('5898438614117ee7e3704fc3f30a3c4bf2041380' \
+          '6debf39e38e4822f6688ad3c1b6a030a19cef2ff')
+
+# FSA fix ***
+source=(${source[@]} CVE-2013-4206.patch CVE-2013-4207.patch 
CVE-2013-4208.patch
+                     CVE-2013-4852.patch)
+sha1sums=(${sha1sums[@]} '29ba7f5ed90e377a18144423bf1b6e3507519d04' \
+                         'f58a5637804d4e88b51c67d4dfadb8d74a3608cf' \
+                         'a78da7812ca9ef307681a4a0d3c8082e01965710' \
+                         'eb904c3be64e8591490921b271469f7fc5fdceb4')
+# ***********

build()
{
-       Fcd $pkgname-$pkgver/unix
+       Fpatchall
+       cd unix || Fdie
ln -s Makefile.gtk Makefile
Fsed "usr/local" "usr"  Makefile
Fsed "INSTALL=install" "INSTALL=install -D" Makefile
Fsed "CFLAGS =" "CFLAGS = $CFLAGS" Makefile
Fmkdir /usr/{bin,share/man/man1}
-       Fbuild
+       Fmake
+       Fmakeinstall
}

# optimization OK
diff --git a/source/xapps-extra/putty/glib-deprecated-functions.patch 
b/source/xapps-extra/putty/glib-deprecated-functions.patch
new file mode 100644
index 0000000..5c7336b
--- /dev/null
+++ b/source/xapps-extra/putty/glib-deprecated-functions.patch
@@ -0,0 +1,105 @@
+Description: Avoid deprecated GLib functions
+Author: Colin Watson <[email protected]>
+Forwarded: yes
+Applied-Upstream: http://bazaar.launchpad.net/+branch/putty/revision/3403
+Last-Update: 2012-01-03
+
+Index: b/unix/gtkfont.c
+===================================================================
+--- a/unix/gtkfont.c
++++ b/unix/gtkfont.c
+@@ -47,6 +47,11 @@
+  *    I haven't the energy.
+  */
+
++#if !GLIB_CHECK_VERSION(1,3,7)
++#define g_ascii_strcasecmp g_strcasecmp
++#define g_ascii_strncasecmp g_strncasecmp
++#endif
++
+ /*
+  * Ad-hoc vtable mechanism to allow font structures to be
+  * polymorphic.
+@@ -524,21 +529,21 @@
+           style = p;
+           p += sprintf(p, "%s", components[2][0] ? components[2] :
+                        "regular");
+-          if (!g_strcasecmp(components[3], "i"))
++          if (!g_ascii_strcasecmp(components[3], "i"))
+               p += sprintf(p, " italic");
+-          else if (!g_strcasecmp(components[3], "o"))
++          else if (!g_ascii_strcasecmp(components[3], "o"))
+               p += sprintf(p, " oblique");
+-          else if (!g_strcasecmp(components[3], "ri"))
++          else if (!g_ascii_strcasecmp(components[3], "ri"))
+               p += sprintf(p, " reverse italic");
+-          else if (!g_strcasecmp(components[3], "ro"))
++          else if (!g_ascii_strcasecmp(components[3], "ro"))
+               p += sprintf(p, " reverse oblique");
+-          else if (!g_strcasecmp(components[3], "ot"))
++          else if (!g_ascii_strcasecmp(components[3], "ot"))
+               p += sprintf(p, " other-slant");
+-          if (components[4][0] && g_strcasecmp(components[4], "normal"))
++          if (components[4][0] && g_ascii_strcasecmp(components[4], "normal"))
+               p += sprintf(p, " %s", components[4]);
+-          if (!g_strcasecmp(components[10], "m"))
++          if (!g_ascii_strcasecmp(components[10], "m"))
+               p += sprintf(p, " [M]");
+-          if (!g_strcasecmp(components[10], "c"))
++          if (!g_ascii_strcasecmp(components[10], "c"))
+               p += sprintf(p, " [C]");
+           if (components[5][0])
+               p += sprintf(p, " %s", components[5]);
+@@ -550,23 +555,23 @@
+            */
+           p++;
+           stylekey = p;
+-          if (!g_strcasecmp(components[2], "medium") ||
+-              !g_strcasecmp(components[2], "regular") ||
+-              !g_strcasecmp(components[2], "normal") ||
+-              !g_strcasecmp(components[2], "book"))
++          if (!g_ascii_strcasecmp(components[2], "medium") ||
++              !g_ascii_strcasecmp(components[2], "regular") ||
++              !g_ascii_strcasecmp(components[2], "normal") ||
++              !g_ascii_strcasecmp(components[2], "book"))
+               weightkey = 0;
+-          else if (!g_strncasecmp(components[2], "demi", 4) ||
+-                   !g_strncasecmp(components[2], "semi", 4))
++          else if (!g_ascii_strncasecmp(components[2], "demi", 4) ||
++                   !g_ascii_strncasecmp(components[2], "semi", 4))
+               weightkey = 1;
+           else
+               weightkey = 2;
+-          if (!g_strcasecmp(components[3], "r"))
++          if (!g_ascii_strcasecmp(components[3], "r"))
+               slantkey = 0;
+-          else if (!g_strncasecmp(components[3], "r", 1))
++          else if (!g_ascii_strncasecmp(components[3], "r", 1))
+               slantkey = 2;
+           else
+               slantkey = 1;
+-          if (!g_strcasecmp(components[4], "normal"))
++          if (!g_ascii_strcasecmp(components[4], "normal"))
+               setwidthkey = 0;
+           else
+               setwidthkey = 1;
+@@ -774,8 +779,8 @@
+
+     matched = FALSE;
+     for (i = 0; i < nfamilies; i++) {
+-      if (!g_strcasecmp(pango_font_family_get_name(families[i]),
+-                        pango_font_description_get_family(desc))) {
++      if (!g_ascii_strcasecmp(pango_font_family_get_name(families[i]),
++                              pango_font_description_get_family(desc))) {
+           matched = TRUE;
+           break;
+       }
+@@ -1393,7 +1398,7 @@
+     /*
+      * Otherwise, ordinary strcasecmp.
+      */
+-    return g_strcasecmp(a, b);
++    return g_ascii_strcasecmp(a, b);
+ }
+
+ static int fontinfo_realname_compare(void *av, void *bv)
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to