[Was Re: sprintf security holes?] Building on OpenBSD
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