NetBSD Problem Report #33160
From www@netbsd.org Tue Mar 28 13:55:35 2006
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
id 3927E63B90D; Tue, 28 Mar 2006 13:55:35 +0000 (UTC)
Message-Id: <20060328135535.3927E63B90D@narn.netbsd.org>
Date: Tue, 28 Mar 2006 13:55:35 +0000 (UTC)
From: oshima-ya@yagoto-urayama.jp
Reply-To: oshima-ya@yagoto-urayama.jp
To: gnats-bugs@netbsd.org
Subject: databases/myodbc's library cannot resolv strndup on BSD system
X-Send-Pr-Version: www-1.0
>Number: 33160
>Category: pkg
>Synopsis: databases/myodbc's library cannot resolv strndup on BSD system
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Mar 28 14:00:00 +0000 2006
>Closed-Date: Sun Jan 14 14:39:44 +0000 2007
>Last-Modified: Sun Jan 14 17:00:02 +0000 2007
>Originator: Yasushi Oshima
>Release: NetBSD 3.99.17
>Organization:
>Environment:
NetBSD 3.99.17 amd64
>Description:
Myodbc's library uses strndup function.
However, there is only in GNU libc. BSD's libc does not have it.
So, that symbol is not resolved when linking client program that uses libmyodbc.
% nm libmyodbc3-3.51.12.so | grep strndup
U strndup
>How-To-Repeat:
make install in databases/myodbc.
>Fix:
Myodbc has strndup() in its own source for some platforms.
Apply patch as follows:
--- util/MYODBCUtil.h.orig 2005-10-10 04:33:40.000000000 +0900
+++ util/MYODBCUtil.h
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/param.h>
#ifdef WIN32
#include <windows.h>
--- util/MYODBCUtilReadDataSourceStr.c.orig 2005-10-10 04:33:40.000000000 +0900
+++ util/MYODBCUtilReadDataSourceStr.c
@@ -20,7 +20,7 @@
#include "MYODBCUtil.h"
-#if defined(__APPLE__) || defined(WIN32) || defined(__sparc)
+#if defined(__APPLE__) || defined(WIN32) || defined(__sparc) || defined(BSD)
char *strndup( const char *s, size_t n )
{
size_t nAvail;
then,
% nm libmyodbc3-3.51.12.so | grep strndup
000000000001a480 T strndup
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: obache@netbsd.org
State-Changed-When: Sun, 14 Jan 2007 14:39:44 +0000
State-Changed-Why:
Fixed. Thanks for your PR!
From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/33160 CVS commit: pkgsrc/databases/myodbc
Date: Sun, 14 Jan 2007 14:37:44 +0000 (UTC)
Module Name: pkgsrc
Committed By: obache
Date: Sun Jan 14 14:37:44 UTC 2007
Modified Files:
pkgsrc/databases/myodbc: Makefile distinfo
Added Files:
pkgsrc/databases/myodbc/patches: patch-ab
Log Message:
*BSD dosen't have strndup.
Pointed out by Yasushi Oshima in PR 33160.
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -r1.16 -r1.17 pkgsrc/databases/myodbc/Makefile
cvs rdiff -r1.4 -r1.5 pkgsrc/databases/myodbc/distinfo
cvs rdiff -r0 -r1.1 pkgsrc/databases/myodbc/patches/patch-ab
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Christian Biere <christianbiere@gmx.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/33160
Date: Sun, 14 Jan 2007 18:06:16 +0100
OBATA Akio wrote:
> Modified Files:
> pkgsrc/databases/myodbc: Makefile distinfo
> Added Files:
> pkgsrc/databases/myodbc/patches: patch-ab
>
> Log Message:
> *BSD dosen't have strndup.
For the record, this is not true. NetBSD does have strndup(). These kind of
checks are broken by design (TM). There are already bug reports filed against
MySQL regarding this issue:
http://bugs.mysql.com/bug.php?id=7974
http://bugs.mysql.com/bug.php?id=19549
--
Christian
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.