-
Notifications
You must be signed in to change notification settings - Fork 727
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Seems like the compiler got a whole lot stricter with this release. The biggest fix was changing the thread ID from unsigned long to pthread_t, which will probably break compilation on Win32. While we are at it, replace static uses of REINPLACE_CMD with patch files as per policy. This change is responsible for most of the newly added patches. The wzdftpd build scripts want to install plugins into ${PREFIX}/share when they belong into ${PREFIX}/lib. Instead of patching this in each Makefile.am, set --datadir=${PREFIX}/lib and work around the one file for which this is wrong. Approved by: eduardo (mentor) Differential Revision: https://reviews.freebsd.org/D38523
- Loading branch information
1 parent
81ce1e4
commit 2f04ed7
Showing
19 changed files
with
244 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- Makefile.am.orig 2023-02-11 10:33:06 UTC | ||
+++ Makefile.am | ||
@@ -20,3 +20,4 @@ doxy: | ||
doxygen doxygen.cfg | ||
|
||
|
||
+ACLOCAL_AMFLAGS= -I ac-helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- libwzd-auth/wzd_md5.c.orig 2023-02-11 10:36:30 UTC | ||
+++ libwzd-auth/wzd_md5.c | ||
@@ -158,7 +158,7 @@ void MD5Name(MD5Final)(unsigned char digest[16], struc | ||
MD5Name(MD5Transform)(ctx->buf, (uint32 *) ctx->in); | ||
byteReverse((unsigned char *) ctx->buf, 4); | ||
memcpy(digest, ctx->buf, 16); | ||
- memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ | ||
+ explicit_bzero(ctx, sizeof *ctx); /* In case it's sensitive */ | ||
} | ||
|
||
#ifndef ASM_MD5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- libwzd-core/Makefile.am.orig 2007-04-14 10:02:19 UTC | ||
+++ libwzd-core/Makefile.am | ||
@@ -101,7 +101,7 @@ libwzd_core_la_SOURCES = \ | ||
|
||
|
||
libwzd_core_la_LIBADD = ../libwzd-base/libwzd_base.la ../libwzd-auth/libwzd_auth.la | ||
-libwzd_core_la_LDFLAGS = @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ -version-info $(LT_VERSION_INFO) -export-dynamic -no-undefined | ||
+libwzd_core_la_LDFLAGS = @LTLIBICONV@ @PTHREAD_LIBS@ -version-info $(LT_VERSION_INFO) -export-dynamic -no-undefined | ||
|
||
AM_CPPFLAGS = -I$(top_srcdir) $(WZD_SSL_INCLUDES) -DWZD_MULTITHREAD -D_REENTRANT @PTHREAD_CFLAGS@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- libwzd-core/wzd_cookie_lex.l.orig 2023-02-11 11:26:34 UTC | ||
+++ libwzd-core/wzd_cookie_lex.l | ||
@@ -1731,7 +1731,7 @@ out_err(LEVEL_HIGH,"char: %d [%c]\n", c, c); | ||
{ | ||
/* check FLAG_SITEOP for self */ | ||
if (me && me->flags && strchr(me->flags,FLAG_SITEOP)) | ||
- snprintf(internalbuffer,IBUFSIZE,"%lu",current_context->pid_child); | ||
+ snprintf(internalbuffer,IBUFSIZE,"%lu",(unsigned long)current_context->pid_child); | ||
else | ||
snprintf(internalbuffer,IBUFSIZE,"some id"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- libwzd-core/wzd_debug.c.orig 2023-02-11 11:21:12 UTC | ||
+++ libwzd-core/wzd_debug.c | ||
@@ -318,7 +318,7 @@ int check_context(wzd_context_t * context) | ||
out_err(LEVEL_CRITICAL,"CRITICAL context %p\n",context); | ||
return 1; | ||
} | ||
- if (!context->magic == CONTEXT_MAGIC) | ||
+ if (context->magic != CONTEXT_MAGIC) | ||
{ | ||
out_err(LEVEL_CRITICAL,"CRITICAL context->magic is invalid, context may be corrupted\n"); | ||
return 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- libwzd-core/wzd_libmain.c.orig 2023-02-11 10:43:55 UTC | ||
+++ libwzd-core/wzd_libmain.c | ||
@@ -285,7 +285,6 @@ void context_init(wzd_context_t * context) | ||
context->datafd = -1; | ||
context->pasvsock = -1; | ||
context->userid = (unsigned int)-1; | ||
- context->thread_id = (unsigned long)-1; | ||
context->state = STATE_UNKNOWN; | ||
context->datamode = DATA_PORT; | ||
context->current_action.current_file = -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- libwzd-core/wzd_list.c.orig 2023-02-11 11:22:20 UTC | ||
+++ libwzd-core/wzd_list.c | ||
@@ -277,7 +277,7 @@ char * mlst_single_file(const char *filename, wzd_cont | ||
|
||
ptr = strrchr(filename,'/'); | ||
if (!ptr) return NULL; | ||
- if (ptr+1 != '\0') ptr++; | ||
+ if (ptr[1] != '\0') ptr++; | ||
|
||
/** \bug this kills VFS */ | ||
/* if (fs_file_lstat(filename,&s)) return -1;*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- libwzd-core/wzd_misc.c.orig 2023-02-11 11:23:37 UTC | ||
+++ libwzd-core/wzd_misc.c | ||
@@ -990,7 +990,7 @@ void win_normalize(char * s, unsigned int length, unsi | ||
|
||
|
||
/* \return 0 if ok, -1 if error, 1 if trying to kill myself */ | ||
-int kill_child_signal(unsigned long pid, wzd_context_t * context) | ||
+int kill_child_signal(pthread_t pid, wzd_context_t * context) | ||
{ | ||
ListElmt * elmnt; | ||
wzd_context_t * loop_context; | ||
@@ -1022,7 +1022,7 @@ int kill_child_signal(unsigned long pid, wzd_context_t | ||
} | ||
|
||
/* \return 0 if ok, -1 if error, 1 if trying to kill myself */ | ||
-int kill_child_new(unsigned long pid, wzd_context_t * context) | ||
+int kill_child_new(pthread_t pid, wzd_context_t * context) | ||
{ | ||
ListElmt * elmnt; | ||
int found=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- libwzd-core/wzd_misc.h.orig 2023-02-11 11:24:33 UTC | ||
+++ libwzd-core/wzd_misc.h | ||
@@ -52,7 +52,7 @@ int split_filename(const char *filename, char *path, c | ||
* If the client is inside a function, it is stopped immediatly, | ||
* maybe creating some problems. | ||
*/ | ||
-int kill_child_signal(unsigned long pid, wzd_context_t * context); | ||
+int kill_child_signal(pthread_t pid, wzd_context_t * context); | ||
|
||
/** \brief Kill child | ||
* | ||
@@ -61,7 +61,7 @@ int kill_child_signal(unsigned long pid, wzd_context_t | ||
* If the client is inside a function, it will exit after the function | ||
* is finished. | ||
*/ | ||
-int kill_child_new(unsigned long pid, wzd_context_t * context); | ||
+int kill_child_new(pthread_t pid, wzd_context_t * context); | ||
|
||
/* returns system ip on specifed interface (e.g eth0) */ | ||
int get_system_ip(const char * itface, struct in_addr * ina); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- libwzd-core/wzd_site_user.c.orig 2023-02-11 11:29:18 UTC | ||
+++ libwzd-core/wzd_site_user.c | ||
@@ -1224,9 +1224,9 @@ int do_site_kill(UNUSED wzd_string_t *ignored, wzd_str | ||
{ | ||
char *ptr; | ||
int ret; | ||
- unsigned long pid; | ||
+ pthread_t pid; | ||
|
||
- pid = strtoul(str_tochar(param),&ptr,0); | ||
+ pid = (pthread_t)strtoul(str_tochar(param),&ptr,0); | ||
if (*ptr!='\0') { | ||
ret = send_message_with_args(501,context,"Usage: site kill <pid>"); | ||
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- libwzd-core/wzd_structs.h.orig 2007-05-17 09:54:38 UTC | ||
+++ libwzd-core/wzd_structs.h | ||
@@ -366,8 +366,8 @@ struct wzd_context_t { | ||
data_mode_t datamode; | ||
tls_data_mode_t tls_data_mode; | ||
net_family_t datafamily; /**< \brief IPv4 or IPv6 */ | ||
- unsigned long pid_child; | ||
- unsigned long thread_id; | ||
+ pthread_t pid_child; | ||
+ pthread_t thread_id; | ||
|
||
union wzd_thread_t * transfer_thread; | ||
u8_t is_transferring; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- libwzd-perl/Makefile.am.orig 2006-06-13 07:34:54 UTC | ||
+++ libwzd-perl/Makefile.am | ||
@@ -7,14 +7,14 @@ ext: ext/Makefile ext/wzdftpd.pm ../libwzd/libwzd.la | ||
cd ext && $(MAKE) LD_RUN_PATH="" | ||
|
||
ext/Makefile: ext/Makefile.PL ext/wzdftpd.pm ext/wzdftpd.xs | ||
- cd ext && $(PERL) Makefile.PL $(PERLFLAGS) $(PERL_MAKE_OPTIONS) INSTALLDIRS=vendor | ||
+ cd ext && $(PERL) Makefile.PL $(PERLFLAGS) $(PERL_MAKE_OPTIONS) INSTALLPRIVLIB=${prefix}/lib | ||
|
||
|
||
all-local: ext | ||
|
||
install-data-local: all-local | ||
echo "Installing wzdftpd.pm"; \ | ||
- cd ext && $(MAKE) install | ||
+ cd ext && $(MAKE) pure_install | ||
|
||
clean-local: | ||
cd ext && test -f Makefile && $(MAKE) clean || true \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- libwzd/libwzd_tls.c.orig 2006-09-19 13:28:28 UTC | ||
+++ libwzd/libwzd_tls.c | ||
@@ -153,7 +153,6 @@ int tls_write(const char *buffer, int length) | ||
#elif HAVE_GNUTLS | ||
|
||
#include <gnutls/gnutls.h> | ||
-#include <gcrypt.h> | ||
|
||
#define DH_BITS 1024 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- modules/sfv/libwzd_sfv_main.h.orig 2006-05-29 16:45:55 UTC | ||
+++ modules/sfv/libwzd_sfv_main.h | ||
@@ -15,7 +15,7 @@ typedef struct { | ||
double size_total; | ||
} wzd_release_stats; | ||
|
||
-wzd_sfv_config SfvConfig; /*Our main SFV config */ | ||
+extern wzd_sfv_config SfvConfig; /*Our main SFV config */ | ||
char * create_filepath(const char *dir, const char * file); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- wzdftpd/wzd_ServerThread.c.orig 2023-02-11 11:33:03 UTC | ||
+++ wzdftpd/wzd_ServerThread.c | ||
@@ -934,7 +934,7 @@ static void server_login_accept(wzd_context_t * contex | ||
out_err(LEVEL_CRITICAL,"Unable to create thread\n"); | ||
return; | ||
} | ||
- context->pid_child = (unsigned long)WZD_THREAD_VOID(&thread); | ||
+ context->pid_child = (pthread_t)WZD_THREAD_VOID(&thread); | ||
wzd_thread_attr_destroy(&thread_attr); /* not needed anymore */ | ||
} | ||
|
||
@@ -1624,10 +1624,12 @@ void serverMainThreadCleanup(int retcode) | ||
{ | ||
ListElmt * elmnt; | ||
wzd_context_t * loop_context; | ||
+ wzd_thread_t child; | ||
for (elmnt=list_head(context_list); elmnt!=NULL; elmnt=list_next(elmnt)) | ||
{ | ||
if ((loop_context = list_data(elmnt))) { | ||
- wzd_thread_cancel(loop_context->pid_child); | ||
+ child._t = loop_context->pid_child; | ||
+ wzd_thread_cancel(&child); | ||
#ifdef WIN32 | ||
/** \todo remove this when wzd_thread_cancel is implemented on windows */ | ||
loop_context->exitclient = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- wzdftpd/wzd_opts.h.orig 2023-02-11 11:32:00 UTC | ||
+++ wzdftpd/wzd_opts.h | ||
@@ -24,11 +24,7 @@ struct option | ||
#define optional_argument 2 | ||
|
||
#if __STDC__ | ||
-#if defined(__GNU_LIBRARY__) | ||
extern int getopt (int argc, char *const *argv, const char *shortopts); | ||
-#else /* not __GNU_LIBRARY__ */ | ||
-extern int getopt (); | ||
-#endif /* not __GNU_LIBRARY__ */ | ||
extern int getopt_long (int argc, char *const *argv, const char | ||
*shortopts, const struct option *longopts, int | ||
*longind); extern int getopt_long_only (int argc, char *const *argv, |