OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 14-Apr-2008 14:38:46
Branch: HEAD Handle: 2008041413384600
Modified files:
openpkg-src/dcron dcron.patch dcron.spec
Log:
fix segfault by making a copy of the argument list in the asprintf()
fallback function
Summary:
Revision Changes Path
1.7 +18 -12 openpkg-src/dcron/dcron.patch
1.58 +1 -1 openpkg-src/dcron/dcron.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/dcron/dcron.patch
============================================================================
$ cvs diff -u -r1.6 -r1.7 dcron.patch
--- openpkg-src/dcron/dcron.patch 14 Apr 2008 12:00:21 -0000 1.6
+++ openpkg-src/dcron/dcron.patch 14 Apr 2008 12:38:46 -0000 1.7
@@ -1,6 +1,6 @@
Index: crontab.1
--- crontab.1.orig 1999-02-10 07:22:37 +0100
-+++ crontab.1 2008-04-14 13:57:33 +0200
++++ crontab.1 2008-04-14 14:33:15 +0200
@@ -26,7 +26,7 @@
manipulates the crontab for a particular user. Only the superuser may
specify a different user and/or crontab directory. Generally the -e
@@ -12,7 +12,7 @@
Unlike other crond/crontabs, this crontab does not try to do everything
Index: crontab.c
--- crontab.c.orig 2006-04-27 19:29:56 +0200
-+++ crontab.c 2008-04-14 13:57:23 +0200
++++ crontab.c 2008-04-14 14:33:15 +0200
@@ -302,7 +302,7 @@
if (ChangeUser(user, 1) < 0)
@@ -23,8 +23,8 @@
snprintf(visual, sizeof(visual), "%s %s", ptr, file);
Index: database.c
---- database.c.orig 2006-05-16 18:20:01.000000000 +0200
-+++ database.c 2006-10-24 09:04:26.497144006 +0200
+--- database.c.orig 2006-05-16 18:20:01 +0200
++++ database.c 2008-04-14 14:33:15 +0200
@@ -225,7 +225,7 @@
if (--maxEntries == 0)
break;
@@ -35,8 +35,8 @@
if (DebugOpt)
log9("User %s Entry %s\n", userName, buf);
Index: defs.h
---- defs.h.orig 2006-05-16 18:24:45.000000000 +0200
-+++ defs.h 2006-10-24 09:05:15.063043609 +0200
+--- defs.h.orig 2006-05-16 18:24:45 +0200
++++ defs.h 2008-04-14 14:33:15 +0200
@@ -22,7 +22,7 @@
#include <pwd.h>
#include <unistd.h>
@@ -64,8 +64,8 @@
+#define asprintf my_asprintf
+
Index: main.c
---- main.c.orig 2006-04-29 18:47:26.000000000 +0200
-+++ main.c 2006-10-24 09:00:36.395498701 +0200
+--- main.c.orig 2006-04-29 18:47:26 +0200
++++ main.c 2008-04-14 14:33:15 +0200
@@ -120,8 +120,14 @@
perror("fork");
exit(1);
@@ -83,8 +83,8 @@
/*
Index: subs.c
---- subs.c.orig 2006-04-27 19:29:56.000000000 +0200
-+++ subs.c 2006-10-24 09:13:53.222197790 +0200
+--- subs.c.orig 2006-04-27 19:29:56 +0200
++++ subs.c 2008-04-14 14:35:49 +0200
@@ -15,6 +15,8 @@
Prototype int ChangeUser(const char *user, short dochdir);
Prototype void vlog(int level, int fd, const char *ctl, va_list va);
@@ -122,7 +122,7 @@
/*
* Change running state to the user in question
-@@ -143,3 +151,31 @@
+@@ -143,3 +151,37 @@
}
#endif
@@ -140,10 +140,16 @@
+int my_asprintf(char **ret, const char *fmt, ...)
+{
+ va_list ap;
++ va_list ap2;
+ int l;
+
+ va_start(ap, fmt);
-+ l = vsnprintf(NULL, 0, fmt, ap);
++#if defined(__STDC__) && defined(__STDC__VERSION__) && (__STDC_VERSION__ >=
199901L)
++ va_copy(ap2, ap);
++#else
++ __builtin_va_copy(ap2, ap);
++#endif
++ l = vsnprintf(NULL, 0, fmt, ap2);
+ if (((*ret) = (char *)malloc(l+1)) == NULL) {
+ va_end(ap);
+ *ret = NULL;
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/dcron/dcron.spec
============================================================================
$ cvs diff -u -r1.57 -r1.58 dcron.spec
--- openpkg-src/dcron/dcron.spec 14 Apr 2008 12:00:22 -0000 1.57
+++ openpkg-src/dcron/dcron.spec 14 Apr 2008 12:38:46 -0000 1.58
@@ -46,7 +46,7 @@
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
-BuildPreReq: OpenPKG, openpkg >= 20060823, make
+BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc
PreReq: OpenPKG, openpkg >= 20060823, MTA, vim
AutoReq: no
AutoReqProv: no
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List [email protected]