pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/49764: net/wget won't build on Solaris



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 20/03/15 08:20, bnjf+netbsd%bnjf.id.au@localhost a écrit :
>> Number:         49764
>> Category:       pkg
>> Synopsis:       net/wget won't build on Solaris
>> Confidential:   no
>> Severity:       non-critical
>> Priority:       low
>> Responsible:    pkg-manager
>> State:          open
>> Class:          sw-bug
>> Submitter-Id:   net
>> Arrival-Date:   Fri Mar 20 07:20:00 +0000 2015
>> Originator:     Brad Forschinger
>> Release:        2014Q4
>> Organization:
>> Environment:
>> Description:
> uses strcasestr(), which doesn't exist in Solaris
>> How-To-Repeat:
> 
>> Fix:
> 
> (lifted from http://notmuchmail.org/pipermail/notmuch/2010/002232.html)
> 
> --- iri.c.orig  Fri Mar 20 18:11:43 2015
> +++ iri.c       Fri Mar 20 18:14:17 2015
> @@ -46,6 +46,21 @@
>  
>  /* Note: locale encoding is kept in options struct (opt.locale) */
>  
> +#ifdef __sun
> +static char *
> +strcasestr(char *a, char *b)
> +{
> +  size_t l;
> +  char f[3];
> +  
> +  snprintf(f, sizeof(f), "%c%c", tolower(*b), toupper(*b));
> +  for (l = strcspn(a, f); l != strlen(a); l += strcspn(a + l + 1, f) + 1)
> +    if (strncasecmp(a + l, b, strlen(b)) == 0)
> +      return a + l;
> +  return NULL;
> +}
> +#endif
> +
>  /* Given a string containing "charset=XXX", return the encoding if found,
>     or NULL otherwise */
>  char *
> 
> 

This seems dangerous as strcasestr is in Solaris since:
> commit 23a1ccea6aac035f084a7a4cdc968687d1b02daf
> Author: Roger A. Faulkner <Roger.Faulkner%Oracle.COM@localhost>
> Date:   Thu Aug 12 14:55:22 2010 -0700
> 
>     PSARC 2010/299 GNU/Linux/BSD compatibility functions
>     6960818 add get_nprocs(), getline(), strdupa(), strndup() to libc
>     6901783 strndup would be nice
>     6824404 libc should provide ffsl() & ffsll()
>     6793969 RFE: Add|stpcpy|to libc
>     6735446 Want a __progname symbol for BSD-style source compatibility
>     6421095 Solaris should provide strcasestr
>     6275498 Provide string compare functions wcscasecmp,wcsncasecmp in solaris like linux


Perhaps the following sort of guard is safer:
>#if defined(__sun) && !defined(HAVE_RAW_DECL_STRCASESTR)
> ...
>#endif


- -- 
Richard PALO

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJVC9a8AAoJECAB22fHtp27qvsIALiHbCcl9o94fMz17psmFAOA
jmHJyQ8MTRsnyQdrUjbEu0693+zVGSS+mfEnMr+NRvz3J7gGCCKoiJI7isZTe8xV
f84pYqLpFexCCwPwHDKW8ZdU6kI1od7qHLuIFL393hgiMbEmGWTWgAJzT3Jq4qhD
/nf53Mu5Kjdt2UoSIF/KroMjaGCrRXrQ5MnrfhTXvqm8q9kEqvBy1zDpHdWIL92j
Oj6GlFqMupD5MOQp4E5E0bvzJvzwOrL+5M8XYbUwit6JX0u6yL2QD+0gpnmPk/qj
laILR/HD1QA87OzVKfk+wLOZqgwZtsCN+DctUBhrSebXp135BwGKpdHTelMf+d8=
=9sNs
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index