The Samba-Bugzilla – Attachment 14156 Details for
Bug 13343
build errors with cc from developerstudio 12.5 on Solaris
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patches for v4-8-test (for bugs #13343, #13344, #13345)
tmp48.diff.txt (text/plain), 24.31 KB, created by
Stefan Metzmacher
on 2018-04-19 10:14:20 UTC
(
hide
)
Description:
Patches for v4-8-test (for bugs #13343, #13344, #13345)
Filename:
MIME Type:
Creator:
Stefan Metzmacher
Created:
2018-04-19 10:14:20 UTC
Size:
24.31 KB
patch
obsolete
>From ff029bc345b86af522e3375c047a1a1b312b4dd0 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 20 Mar 2018 21:46:12 +0100 >Subject: [PATCH 01/12] lib/replace: define __[u]intptr_t_defined if we prove > an replacement >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> >(cherry picked from commit 329a229af3c3c9475b9254ca68c413ec18fa3b71) >--- > lib/replace/replace.h | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/lib/replace/replace.h b/lib/replace/replace.h >index 128978c..3304cda 100644 >--- a/lib/replace/replace.h >+++ b/lib/replace/replace.h >@@ -691,10 +691,12 @@ typedef int bool; > > #if !defined(HAVE_INTPTR_T) > typedef long long intptr_t ; >+#define __intptr_t_defined > #endif > > #if !defined(HAVE_UINTPTR_T) > typedef unsigned long long uintptr_t ; >+#define __uintptr_t_defined > #endif > > #if !defined(HAVE_PTRDIFF_T) >-- >1.9.1 > > >From afb52d7d7d29de028d672c73fa1eb056a254ea92 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Sat, 21 Oct 2017 14:08:15 +0200 >Subject: [PATCH 02/12] nsswitch: maintain prototypes for the linux based > functions only once >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> >(cherry picked from commit b8c30abb02f461f16af4da83eecd173993974dc1) >--- > nsswitch/winbind_nss.h | 6 ++++++ > nsswitch/winbind_nss_freebsd.c | 19 ------------------- > nsswitch/winbind_nss_linux.c | 22 ---------------------- > nsswitch/winbind_nss_linux.h | 24 +++++++++++++++++++++--- > nsswitch/winbind_nss_netbsd.c | 26 -------------------------- > nsswitch/winbind_nss_solaris.h | 26 -------------------------- > 6 files changed, 27 insertions(+), 96 deletions(-) > >diff --git a/nsswitch/winbind_nss.h b/nsswitch/winbind_nss.h >index 05e07ad..e98a961 100644 >--- a/nsswitch/winbind_nss.h >+++ b/nsswitch/winbind_nss.h >@@ -30,6 +30,7 @@ > */ > > #include "nsswitch/winbind_nss_solaris.h" >+#include "nsswitch/winbind_nss_linux.h" > > #elif HAVE_NSS_H > >@@ -37,6 +38,10 @@ > * Linux (glibc) > */ > >+#include <nss.h> >+ >+typedef enum nss_status NSS_STATUS; >+ > #include "nsswitch/winbind_nss_linux.h" > > #elif HAVE_NS_API_H >@@ -60,6 +65,7 @@ > */ > > #include "nsswitch/winbind_nss_netbsd.h" >+#include "nsswitch/winbind_nss_linux.h" > > #else /* Nothing's defined. Neither gnu nor netbsd nor sun nor hp */ > >diff --git a/nsswitch/winbind_nss_freebsd.c b/nsswitch/winbind_nss_freebsd.c >index e283872..f424adb 100644 >--- a/nsswitch/winbind_nss_freebsd.c >+++ b/nsswitch/winbind_nss_freebsd.c >@@ -24,25 +24,6 @@ > #include "winbind_client.h" > > /* Make sure that the module gets registered needed by freebsd 5.1 */ >-extern enum nss_status _nss_winbind_getgrent_r(struct group *, char *, size_t, >- int *); >-extern enum nss_status _nss_winbind_getgrnam_r(const char *, struct group *, >- char *, size_t, int *); >-extern enum nss_status _nss_winbind_getgrgid_r(gid_t gid, struct group *, char *, >- size_t, int *); >-extern enum nss_status _nss_winbind_setgrent(void); >-extern enum nss_status _nss_winbind_endgrent(void); >-extern enum nss_status _nss_winbind_initgroups_dyn(char *, gid_t, long int *, >- long int *, gid_t **, long int , int *); >- >-extern enum nss_status _nss_winbind_getpwent_r(struct passwd *, char *, size_t, >- int *); >-extern enum nss_status _nss_winbind_getpwnam_r(const char *, struct passwd *, >- char *, size_t, int *); >-extern enum nss_status _nss_winbind_getpwuid_r(gid_t gid, struct passwd *, char *, >- size_t, int *); >-extern enum nss_status _nss_winbind_setpwent(void); >-extern enum nss_status _nss_winbind_endpwent(void); > ns_mtab *nss_module_register(const char *, unsigned int *, nss_module_unregister_fn *); > > NSS_METHOD_PROTOTYPE(__nss_compat_getgrnam_r); >diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c >index b5c50ef..fc165a1 100644 >--- a/nsswitch/winbind_nss_linux.c >+++ b/nsswitch/winbind_nss_linux.c >@@ -36,28 +36,6 @@ static pthread_mutex_t winbind_nss_mutex = PTHREAD_MUTEX_INITIALIZER; > #define MAX_GETPWENT_USERS 250 > #define MAX_GETGRENT_USERS 250 > >-NSS_STATUS _nss_winbind_setpwent(void); >-NSS_STATUS _nss_winbind_endpwent(void); >-NSS_STATUS _nss_winbind_getpwent_r(struct passwd *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result, >- char *buffer, size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getpwnam_r(const char *name, struct passwd *result, >- char *buffer, size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_setgrent(void); >-NSS_STATUS _nss_winbind_endgrent(void); >-NSS_STATUS _nss_winbind_getgrent_r(struct group *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getgrlst_r(struct group *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getgrnam_r(const char *name, struct group *result, >- char *buffer, size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid, struct group *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, >- long int *size, gid_t **groups, >- long int limit, int *errnop); >- > /************************************************************************* > ************************************************************************/ > >diff --git a/nsswitch/winbind_nss_linux.h b/nsswitch/winbind_nss_linux.h >index db5a378..61e5261 100644 >--- a/nsswitch/winbind_nss_linux.h >+++ b/nsswitch/winbind_nss_linux.h >@@ -22,8 +22,26 @@ > #ifndef _WINBIND_NSS_LINUX_H > #define _WINBIND_NSS_LINUX_H > >-#include <nss.h> >- >-typedef enum nss_status NSS_STATUS; >+NSS_STATUS _nss_winbind_setpwent(void); >+NSS_STATUS _nss_winbind_endpwent(void); >+NSS_STATUS _nss_winbind_getpwent_r(struct passwd *result, char *buffer, >+ size_t buflen, int *errnop); >+NSS_STATUS _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result, >+ char *buffer, size_t buflen, int *errnop); >+NSS_STATUS _nss_winbind_getpwnam_r(const char *name, struct passwd *result, >+ char *buffer, size_t buflen, int *errnop); >+NSS_STATUS _nss_winbind_setgrent(void); >+NSS_STATUS _nss_winbind_endgrent(void); >+NSS_STATUS _nss_winbind_getgrent_r(struct group *result, char *buffer, >+ size_t buflen, int *errnop); >+NSS_STATUS _nss_winbind_getgrlst_r(struct group *result, char *buffer, >+ size_t buflen, int *errnop); >+NSS_STATUS _nss_winbind_getgrnam_r(const char *name, struct group *result, >+ char *buffer, size_t buflen, int *errnop); >+NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid, struct group *result, char *buffer, >+ size_t buflen, int *errnop); >+NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, >+ long int *size, gid_t **groups, >+ long int limit, int *errnop); > > #endif /* _WINBIND_NSS_LINUX_H */ >diff --git a/nsswitch/winbind_nss_netbsd.c b/nsswitch/winbind_nss_netbsd.c >index d3a558c..4edf64c 100644 >--- a/nsswitch/winbind_nss_netbsd.c >+++ b/nsswitch/winbind_nss_netbsd.c >@@ -38,32 +38,6 @@ > static struct group _winbind_group; > static char _winbind_groupbuf[1024]; > >-/* >- * We need a proper prototype for this :-) >- */ >- >-NSS_STATUS _nss_winbind_setpwent(void); >-NSS_STATUS _nss_winbind_endpwent(void); >-NSS_STATUS _nss_winbind_getpwent_r(struct passwd *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result, >- char *buffer, size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getpwnam_r(const char *name, struct passwd *result, >- char *buffer, size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_setgrent(void); >-NSS_STATUS _nss_winbind_endgrent(void); >-NSS_STATUS _nss_winbind_getgrent_r(struct group *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getgrlst_r(struct group *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getgrnam_r(const char *name, struct group *result, >- char *buffer, size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid, struct group *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, >- long int *size, gid_t **groups, >- long int limit, int *errnop); >- > int > netbsdwinbind_endgrent(void *nsrv, void *nscb, va_list ap) > { >diff --git a/nsswitch/winbind_nss_solaris.h b/nsswitch/winbind_nss_solaris.h >index f0cc099..8e26d0d 100644 >--- a/nsswitch/winbind_nss_solaris.h >+++ b/nsswitch/winbind_nss_solaris.h >@@ -34,30 +34,4 @@ typedef nss_status_t NSS_STATUS; > #define NSS_STATUS_UNAVAIL NSS_UNAVAIL > #define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN > >-/* The solaris winbind is implemented as a wrapper around the linux >- version. */ >- >-NSS_STATUS _nss_winbind_setpwent(void); >-NSS_STATUS _nss_winbind_endpwent(void); >-NSS_STATUS _nss_winbind_getpwent_r(struct passwd* result, char* buffer, >- size_t buflen, int* errnop); >-NSS_STATUS _nss_winbind_getpwuid_r(uid_t, struct passwd*, char* buffer, >- size_t buflen, int* errnop); >-NSS_STATUS _nss_winbind_getpwnam_r(const char* name, struct passwd* result, >- char* buffer, size_t buflen, int* errnop); >- >-NSS_STATUS _nss_winbind_setgrent(void); >-NSS_STATUS _nss_winbind_endgrent(void); >-NSS_STATUS _nss_winbind_getgrent_r(struct group* result, char* buffer, >- size_t buflen, int* errnop); >-NSS_STATUS _nss_winbind_getgrnam_r(const char *name, >- struct group *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid, >- struct group *result, char *buffer, >- size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, >- long int *size, gid_t **groups, >- long int limit, int *errnop); >- > #endif /* _WINBIND_NSS_SOLARIS_H */ >-- >1.9.1 > > >From 055cd857e272ba40609db4b9d87ec6527bdcf14d Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Sat, 21 Oct 2017 14:14:34 +0200 >Subject: [PATCH 03/12] nsswitch: add some const to > _nss_winbind_initgroups_dyn() prototype >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> >(cherry picked from commit d5be3b3279162005d9ebea2eda71d455e4c48739) >--- > nsswitch/winbind_nss_linux.c | 2 +- > nsswitch/winbind_nss_linux.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c >index fc165a1..442c06e 100644 >--- a/nsswitch/winbind_nss_linux.c >+++ b/nsswitch/winbind_nss_linux.c >@@ -1024,7 +1024,7 @@ _nss_winbind_getgrgid_r(gid_t gid, > /* Initialise supplementary groups */ > > NSS_STATUS >-_nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, >+_nss_winbind_initgroups_dyn(const char *user, gid_t group, long int *start, > long int *size, gid_t **groups, long int limit, > int *errnop) > { >diff --git a/nsswitch/winbind_nss_linux.h b/nsswitch/winbind_nss_linux.h >index 61e5261..d18799e 100644 >--- a/nsswitch/winbind_nss_linux.h >+++ b/nsswitch/winbind_nss_linux.h >@@ -40,7 +40,7 @@ NSS_STATUS _nss_winbind_getgrnam_r(const char *name, struct group *result, > char *buffer, size_t buflen, int *errnop); > NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid, struct group *result, char *buffer, > size_t buflen, int *errnop); >-NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, >+NSS_STATUS _nss_winbind_initgroups_dyn(const char *user, gid_t group, long int *start, > long int *size, gid_t **groups, > long int limit, int *errnop); > >-- >1.9.1 > > >From cfdc7c4a4868985bf88db0dd2927904a86dbdcc1 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Sat, 21 Oct 2017 14:15:12 +0200 >Subject: [PATCH 04/12] nsswitch: fix the developer build of nsswitch/wins.c on > freebsd 11 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> >(cherry picked from commit dc160247d13e2c63574a7e7ec7720fc4c690483b) >--- > nsswitch/wins.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/nsswitch/wins.c b/nsswitch/wins.c >index 19d3c5b..72055f0 100644 >--- a/nsswitch/wins.c >+++ b/nsswitch/wins.c >@@ -19,7 +19,7 @@ > */ > > #include "includes.h" >-#include "nsswitch/winbind_nss.h" >+#include "nsswitch/winbind_client.h" > #include "nsswitch/libwbclient/wbclient.h" > > #ifdef HAVE_NS_API_H >-- >1.9.1 > > >From 62a1f4d8d95a2143b8ca3ec7d60105be376cea66 Mon Sep 17 00:00:00 2001 >From: Volker Lendecke <vl@samba.org> >Date: Tue, 30 Jan 2018 12:34:11 +0100 >Subject: [PATCH 05/12] vfs_virusfilter: Fix CID 1428739 Buffer not null > terminated > >Signed-off-by: Volker Lendecke <vl@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 > >(cherry picked from commit 8a4409c956bdbe5d928e685b7c219566d467a627) >--- > source3/modules/vfs_virusfilter_utils.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/source3/modules/vfs_virusfilter_utils.c b/source3/modules/vfs_virusfilter_utils.c >index 628e0ae..d2616f0 100644 >--- a/source3/modules/vfs_virusfilter_utils.c >+++ b/source3/modules/vfs_virusfilter_utils.c >@@ -148,10 +148,16 @@ bool virusfilter_io_connect_path( > struct sockaddr_un addr; > NTSTATUS status; > int socket, bes_result, flags, ret; >+ size_t len; > > ZERO_STRUCT(addr); > addr.sun_family = AF_UNIX; >- strncpy(addr.sun_path, path, sizeof(addr.sun_path)); >+ >+ len = strlcpy(addr.sun_path, path, sizeof(addr.sun_path)); >+ if (len >= sizeof(addr.sun_path)) { >+ io_h->stream = NULL; >+ return false; >+ } > > status = open_socket_out((struct sockaddr_storage *)&addr, 0, > io_h->connect_timeout, >-- >1.9.1 > > >From e979d35161163523c2b562771cb4cf6656d43fad Mon Sep 17 00:00:00 2001 >From: Volker Lendecke <vl@samba.org> >Date: Tue, 30 Jan 2018 12:36:14 +0100 >Subject: [PATCH 06/12] vfs_virusfilter: Fix CID 1428740 Macro compares > unsigned to 0 > >vsnprintf returns "int" and not "size_t" > >Signed-off-by: Volker Lendecke <vl@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 > >(cherry picked from commit 734404bbe911fd4aa6565b2a2aaecab4fbbf3c45) >--- > source3/modules/vfs_virusfilter_utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source3/modules/vfs_virusfilter_utils.c b/source3/modules/vfs_virusfilter_utils.c >index d2616f0..55d00f7 100644 >--- a/source3/modules/vfs_virusfilter_utils.c >+++ b/source3/modules/vfs_virusfilter_utils.c >@@ -417,7 +417,7 @@ bool virusfilter_io_vwritefl( > const char *data_fmt, va_list ap) > { > char data[VIRUSFILTER_IO_BUFFER_SIZE + VIRUSFILTER_IO_EOL_SIZE]; >- size_t data_size; >+ int data_size; > > data_size = vsnprintf(data, VIRUSFILTER_IO_BUFFER_SIZE, data_fmt, ap); > >-- >1.9.1 > > >From 93e8b371b4dcd6173e1eabb42850cde2bac4e641 Mon Sep 17 00:00:00 2001 >From: Volker Lendecke <vl@samba.org> >Date: Tue, 30 Jan 2018 12:37:30 +0100 >Subject: [PATCH 07/12] vfs_virusfilter: Fix CID 1428738 Macro compares > unsigned to 0 > >vsnprintf returns "int" and not "size_t" > >Signed-off-by: Volker Lendecke <vl@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Wed Jan 31 05:28:48 CET 2018 on sn-devel-144 > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 > >(cherry picked from commit 21eb5169f46b8d819a5d5d028baff581e4e63de6) >--- > source3/modules/vfs_virusfilter_utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source3/modules/vfs_virusfilter_utils.c b/source3/modules/vfs_virusfilter_utils.c >index 55d00f7..90ae427 100644 >--- a/source3/modules/vfs_virusfilter_utils.c >+++ b/source3/modules/vfs_virusfilter_utils.c >@@ -395,7 +395,7 @@ bool virusfilter_io_writefl( > { > va_list ap; > char data[VIRUSFILTER_IO_BUFFER_SIZE + VIRUSFILTER_IO_EOL_SIZE]; >- size_t data_size; >+ int data_size; > > va_start(ap, data_fmt); > data_size = vsnprintf(data, VIRUSFILTER_IO_BUFFER_SIZE, data_fmt, ap); >-- >1.9.1 > > >From 251ccd9676cc22ac401fb1215bb11b399b9ad6dc Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Tue, 20 Mar 2018 12:10:01 +0100 >Subject: [PATCH 08/12] s3:modules: fix the picky-developer build of > vfs_virusfilter.c on FreeBSD 11 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13344 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> >(cherry picked from commit fb7b67af984812784756574df4f0fb55d472181b) >--- > source3/modules/vfs_virusfilter.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/source3/modules/vfs_virusfilter.c b/source3/modules/vfs_virusfilter.c >index 571073f..7ae5a96 100644 >--- a/source3/modules/vfs_virusfilter.c >+++ b/source3/modules/vfs_virusfilter.c >@@ -275,8 +275,9 @@ static int virusfilter_vfs_connect( > temp_quarantine_dir_mode = lp_parm_const_string( > snum, "virusfilter", "quarantine directory mode", "0755"); > if (temp_quarantine_dir_mode != NULL) { >- sscanf(temp_quarantine_dir_mode, "%o", >- &config->quarantine_dir_mode); >+ unsigned int mode = 0; >+ sscanf(temp_quarantine_dir_mode, "%o", &mode); >+ config->quarantine_dir_mode = mode; > } > > config->quarantine_prefix = lp_parm_const_string( >-- >1.9.1 > > >From 2a3a2192e691f173520b7e4e765d6f9aa33b08ef Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 21 Mar 2018 07:25:11 +0100 >Subject: [PATCH 09/12] s3:modules: make virusfilter_io_connect_path() more > portable >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >We have existing utility functions to prepare a socket. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> >(cherry picked from commit 74278a70389e2479d80ec5c88b01a09c141e8d39) >--- > source3/modules/vfs_virusfilter_utils.c | 31 ++++++++++++++++--------------- > 1 file changed, 16 insertions(+), 15 deletions(-) > >diff --git a/source3/modules/vfs_virusfilter_utils.c b/source3/modules/vfs_virusfilter_utils.c >index 90ae427..f56fc6e 100644 >--- a/source3/modules/vfs_virusfilter_utils.c >+++ b/source3/modules/vfs_virusfilter_utils.c >@@ -147,8 +147,9 @@ bool virusfilter_io_connect_path( > { > struct sockaddr_un addr; > NTSTATUS status; >- int socket, bes_result, flags, ret; >+ int socket, ret; > size_t len; >+ bool ok; > > ZERO_STRUCT(addr); > addr.sun_family = AF_UNIX; >@@ -168,23 +169,23 @@ bool virusfilter_io_connect_path( > } > > /* We must not block */ >- flags = fcntl(socket, F_GETFL); >- if (flags <= 0) { >- /* Handle error by ignoring */; >- flags = 0; >- DBG_WARNING("Could not get flags on socket (%s).\n", >- strerror(errno)); >- } >- flags |= SOCK_NONBLOCK; >- ret = fcntl(socket, F_SETFL, flags); >+ ret = set_blocking(socket, false); > if (ret == -1) { >- /* Handle error by ignoring for now */ >- DBG_WARNING("Could not set flags on socket: %s.\n", >- strerror(errno)); >+ close(socket); >+ io_h->stream = NULL; >+ return false; > } > >- bes_result = tstream_bsd_existing_socket(io_h, socket, &io_h->stream); >- if (bes_result < 0) { >+ ok = smb_set_close_on_exec(socket); >+ if (!ok) { >+ close(socket); >+ io_h->stream = NULL; >+ return false; >+ } >+ >+ ret = tstream_bsd_existing_socket(io_h, socket, &io_h->stream); >+ if (ret == -1) { >+ close(socket); > DBG_ERR("Could not convert socket to tstream: %s.\n", > strerror(errno)); > io_h->stream = NULL; >-- >1.9.1 > > >From f3a6bb38414dcb3eb77d5803a931125a085cad21 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 21 Mar 2018 07:33:16 +0100 >Subject: [PATCH 10/12] lib/crypto: avoid 'return void_function();' which isn't > portable >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> >(cherry picked from commit 7ae77db3b29ef08e1f74aa413049b995a598a5dd) >--- > lib/crypto/aes.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c >index d16d715..4ff019a 100644 >--- a/lib/crypto/aes.c >+++ b/lib/crypto/aes.c >@@ -236,18 +236,20 @@ void > AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) > { > if (has_intel_aes_instructions()) { >- return AES_encrypt_aesni(in, out, key); >+ AES_encrypt_aesni(in, out, key); >+ return; > } >- return AES_encrypt_rj(in, out, key); >+ AES_encrypt_rj(in, out, key); > } > > void > AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) > { > if (has_intel_aes_instructions()) { >- return AES_decrypt_aesni(in, out, key); >+ AES_decrypt_aesni(in, out, key); >+ return; > } >- return AES_decrypt_rj(in, out, key); >+ AES_decrypt_rj(in, out, key); > } > > #endif /* SAMBA_RIJNDAEL */ >-- >1.9.1 > > >From 1c6b3ff5d2e9fc3f80823ba930cdb4b41cb2086f Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 21 Mar 2018 07:33:16 +0100 >Subject: [PATCH 11/12] ldb/tests: avoid 'return void_function();' which isn't > portable >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13343 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> >(cherry picked from commit 666dda907b7f190b2dff1f2639bd2518240b9fb2) >--- > lib/ldb/tests/ldb_mod_op_test.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/lib/ldb/tests/ldb_mod_op_test.c b/lib/ldb/tests/ldb_mod_op_test.c >index 766ca79..0f8642d 100644 >--- a/lib/ldb/tests/ldb_mod_op_test.c >+++ b/lib/ldb/tests/ldb_mod_op_test.c >@@ -1914,22 +1914,22 @@ static void test_ldb_modify_during_search(void **state, bool add_index, > > static void test_ldb_modify_during_indexed_search(void **state) > { >- return test_ldb_modify_during_search(state, true, false); >+ test_ldb_modify_during_search(state, true, false); > } > > static void test_ldb_modify_during_unindexed_search(void **state) > { >- return test_ldb_modify_during_search(state, false, false); >+ test_ldb_modify_during_search(state, false, false); > } > > static void test_ldb_rename_during_indexed_search(void **state) > { >- return test_ldb_modify_during_search(state, true, true); >+ test_ldb_modify_during_search(state, true, true); > } > > static void test_ldb_rename_during_unindexed_search(void **state) > { >- return test_ldb_modify_during_search(state, false, true); >+ test_ldb_modify_during_search(state, false, true); > } > > /* >-- >1.9.1 > > >From 47176b51a13a62ccaac32a1521e2983529c19055 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Wed, 21 Mar 2018 07:48:16 +0100 >Subject: [PATCH 12/12] s3:modules: fix the build of vfs_aixacl2.c >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13345 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Björn Jacke <bjacke@samba.org> > >Autobuild-User(master): Stefan Metzmacher <metze@samba.org> >Autobuild-Date(master): Tue Apr 3 20:18:58 CEST 2018 on sn-devel-144 > >(cherry picked from commit 702665cc52d5dc05ae636519e1ffe9c296f5ef77) >--- > source3/modules/vfs_aixacl2.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/source3/modules/vfs_aixacl2.c b/source3/modules/vfs_aixacl2.c >index d0cd2c1..e094be1 100644 >--- a/source3/modules/vfs_aixacl2.c >+++ b/source3/modules/vfs_aixacl2.c >@@ -476,7 +476,8 @@ int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle, > acl_type_t acl_type_info; > int rc; > >- DEBUG(10, ("aixjfs2_sys_acl_set_file invoked for %s", name)); >+ DEBUG(10, ("aixjfs2_sys_acl_set_file invoked for %s", >+ smb_fname->base_name)); > > rc = aixjfs2_query_acl_support((char *)smb_fname->base_name, > ACL_AIXC, &acl_type_info); >@@ -490,7 +491,7 @@ int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle, > return -1; > > rc = aclx_put( >- (char *)name, >+ (char *)smb_fname->base_name, > SET_ACL, /* set only the ACL, not mode bits */ > acl_type_info, > acl_aixc, >-- >1.9.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
bjacke
:
review+
Actions:
View
Attachments on
bug 13343
: 14156