git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Was Re: sprintf security holes?] Building on OpenBSD

From
PEPeter Eriksen <s022018@student.dtu.dk>
Date
Sep 16, 2005, 21:36 UTC
Message-ID
<20050916213627.GA19867@ebar091.ebar.dtu.dk>
In-Reply-To
<86zmqd5aey.fsf@blue.stonehenge.com>
On Fri, Sep 16, 2005 at 07:56:05AM -0700, Randal L. Schwartz wrote:
> 
> As I was trying to (unsuccessfully) compile git for OpenBSD, I noticed
> a number of occurances of sprintf(), because OpenBSD thoughtfully
> yells at programmers for using that.
I've got git mostly working on OpenBSD.  Here is what I changed:
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -87,7 +87,7 @@ SCRIPT_PYTHON = \

 # The ones that do not have to link with lcrypto nor lz.
 SIMPLE_PROGRAMS = \
-       git-get-tar-commit-id git-mailinfo git-mailsplit git-stripspace
        \
+       git-get-tar-commit-id git-mailsplit git-stripspace \
        git-daemon git-var

 # ... and all the rest
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -50,7 +50,7 @@ test_expect_success \

 test_expect_success \
     'validate file modification time' \
-    'TZ=GMT tar tvf b.tar a/a |
+    'TZ=GMT gtar tvf b.tar a/a |
      awk \{print\ \$4,\ \(length\(\$5\)\<7\)\ ?\ \$5\":00\"\ :\ \$5\} \
      >b.mtime &&
      echo "2005-05-27 22:00:00" >expected.mtime &&
 

The two issues showing up are
1) missing strcasestr() which is used in mailinfo.c
2) OpenBSD tar tvf doesn't format the date as we expect.

There were talks about making a directory compat/ with system 
specific code, where an implementation of strcasestr.c could go?

With those changes all I did to compile was: 

gmake CFLAGS+='-I/usr/local/include/ -L/usr/local/lib'
gmake test
gmake install


Regards,

Peter
Previous: Morten WelinderNext: Junio C Hamano
Message 3 of 5 in “sprintf security holes?”
  1. Randal L. SchwartzSep 16, 2005
  2. Morten WelinderSep 16, 2005
  3. [Was Re: sprintf security holes?] Building on OpenBSDPeter Eriksen, Sep 16, 2005
  4. Junio C HamanoSep 19, 2005
  5. Sven VerdoolaegeSep 19, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.