freebsd-ports/security/stunnel/files/patch-src::client.c
Peter Pentchev f06998a46e Update to 4.10, fixing the execvp() and pid file issues while I'm here.
PR:		79114, 79120, 80143, 80405
Submitted by:	Florian Hars <hars@bik-gmbh.de>,
		Jim Hatfield <jim.hatfield@insignia.com>,
		Vasil Dimov <vd@datamax.bg>,
		Vsevolod Stakhov <vsevolod@highsecure.ru>
2005-05-12 11:36:41 +00:00

17 lines
595 B
C

--- src/client.c.orig Thu May 12 14:01:28 2005
+++ src/client.c Thu May 12 14:04:19 2005
@@ -841,6 +841,14 @@
sigemptyset(&newmask);
sigprocmask(SIG_SETMASK, &newmask, NULL);
#endif
+ if (c->opt->execargs != NULL && c->opt->execargs[0] == NULL) {
+ free(c->opt->execargs);
+ c->opt->execargs = NULL;
+ }
+ if (c->opt->execargs == NULL) {
+ c->opt->execargs = calloc(2, sizeof(c->opt->execargs[0]));
+ c->opt->execargs[0] = c->opt->execname;
+ }
execvp(c->opt->execname, c->opt->execargs);
ioerror(c->opt->execname); /* execv failed */
_exit(1);