diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/Makefile.am | 16 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-algorithm.c | 14 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/Makefile.am | 24 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 26 | ||||
-rw-r--r-- | xlators/nfs/server/src/Makefile.am | 10 | ||||
-rw-r--r-- | xlators/protocol/legacy/server/src/Makefile.am | 1 | ||||
-rw-r--r-- | xlators/protocol/server/src/Makefile.am | 3 | ||||
-rw-r--r-- | xlators/protocol/server/src/server3_1-fops.c | 5 | ||||
-rw-r--r-- | xlators/storage/posix/src/Makefile.am | 2 | ||||
-rw-r--r-- | xlators/storage/posix/src/posix-helpers.c | 1 | ||||
-rw-r--r-- | xlators/storage/posix/src/posix.c | 10 |
11 files changed, 66 insertions, 46 deletions
diff --git a/xlators/cluster/afr/src/Makefile.am b/xlators/cluster/afr/src/Makefile.am index ed0901813..95db5dd96 100644 --- a/xlators/cluster/afr/src/Makefile.am +++ b/xlators/cluster/afr/src/Makefile.am @@ -1,7 +1,11 @@ xlator_LTLIBRARIES = afr.la pump.la xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/cluster -afr_common_source = afr-dir-read.c afr-dir-write.c afr-inode-read.c afr-inode-write.c afr-open.c afr-transaction.c afr-self-heal-data.c afr-self-heal-common.c afr-self-heal-metadata.c afr-self-heal-entry.c afr-self-heal-algorithm.c afr-lk-common.c afr-self-heald.c $(top_builddir)/xlators/lib/src/libxlator.c +afr_common_source = afr-dir-read.c afr-dir-write.c afr-inode-read.c \ + afr-inode-write.c afr-open.c afr-transaction.c afr-self-heal-data.c \ + afr-self-heal-common.c afr-self-heal-metadata.c afr-self-heal-entry.c \ + afr-self-heal-algorithm.c afr-lk-common.c afr-self-heald.c \ + $(top_builddir)/xlators/lib/src/libxlator.c afr_la_LDFLAGS = -module -avoidversion afr_la_SOURCES = $(afr_common_source) afr.c @@ -11,11 +15,15 @@ pump_la_LDFLAGS = -module -avoidversion pump_la_SOURCES = $(afr_common_source) pump.c pump_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la -noinst_HEADERS = afr.h afr-transaction.h afr-inode-write.h afr-inode-read.h afr-dir-read.h afr-dir-write.h afr-self-heal.h afr-self-heal-common.h afr-self-heal-algorithm.h pump.h afr-mem-types.h afr-common.c afr-self-heald.h $(top_builddir)/xlators/lib/src/libxlator.h $(top_builddir)/glusterfsd/src/glusterfsd.h +noinst_HEADERS = afr.h afr-transaction.h afr-inode-write.h afr-inode-read.h \ + afr-dir-read.h afr-dir-write.h afr-self-heal.h afr-self-heal-common.h \ + afr-self-heal-algorithm.h pump.h afr-mem-types.h afr-common.c \ + afr-self-heald.h $(top_builddir)/xlators/lib/src/libxlator.h \ + $(top_builddir)/glusterfsd/src/glusterfsd.h AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -D$(GF_HOST_OS) \ - -I$(top_srcdir)/libglusterfs/src -I$(top_srcdir)/contrib/md5 -shared -nostartfiles $(GF_CFLAGS) \ - -I$(top_srcdir)/xlators/lib/src -I$(top_srcdir)/rpc/rpc-lib/src + -I$(top_srcdir)/libglusterfs/src -I$(top_srcdir)/xlators/lib/src \ + -I$(top_srcdir)/rpc/rpc-lib/src -shared -nostartfiles $(GF_CFLAGS) CLEANFILES = diff --git a/xlators/cluster/afr/src/afr-self-heal-algorithm.c b/xlators/cluster/afr/src/afr-self-heal-algorithm.c index bf787339b..6bd0adcd8 100644 --- a/xlators/cluster/afr/src/afr-self-heal-algorithm.c +++ b/xlators/cluster/afr/src/afr-self-heal-algorithm.c @@ -18,6 +18,7 @@ */ +#include <openssl/md5.h> #include "glusterfs.h" #include "afr.h" #include "xlator.h" @@ -33,7 +34,6 @@ #include "compat-errno.h" #include "compat.h" #include "byte-order.h" -#include "md5.h" #include "afr-transaction.h" #include "afr-self-heal.h" @@ -239,7 +239,7 @@ sh_loop_frame_create (call_frame_t *sh_frame, xlator_t *this, gf_afr_mt_char); if (!new_loop_sh->write_needed) goto out; - new_loop_sh->checksum = GF_CALLOC (priv->child_count, MD5_DIGEST_LEN, + new_loop_sh->checksum = GF_CALLOC (priv->child_count, MD5_DIGEST_LENGTH, gf_afr_mt_uint8_t); if (!new_loop_sh->checksum) goto out; @@ -590,8 +590,8 @@ sh_diff_checksum_cbk (call_frame_t *loop_frame, void *cookie, xlator_t *this, strerror (op_errno)); sh->op_failed = 1; } else { - memcpy (loop_sh->checksum + child_index * MD5_DIGEST_LEN, - strong_checksum, MD5_DIGEST_LEN); + memcpy (loop_sh->checksum + child_index * MD5_DIGEST_LENGTH, + strong_checksum, MD5_DIGEST_LENGTH); } call_count = afr_frame_return (loop_frame); @@ -601,9 +601,9 @@ sh_diff_checksum_cbk (call_frame_t *loop_frame, void *cookie, xlator_t *this, if (sh->sources[i] || !sh_local->child_up[i]) continue; - if (memcmp (loop_sh->checksum + (i * MD5_DIGEST_LEN), - loop_sh->checksum + (sh->source * MD5_DIGEST_LEN), - MD5_DIGEST_LEN)) { + if (memcmp (loop_sh->checksum + (i * MD5_DIGEST_LENGTH), + loop_sh->checksum + (sh->source * MD5_DIGEST_LENGTH), + MD5_DIGEST_LENGTH)) { /* Checksums differ, so this block must be written to this sink diff --git a/xlators/mgmt/glusterd/src/Makefile.am b/xlators/mgmt/glusterd/src/Makefile.am index 8a9248daa..d11dd2af2 100644 --- a/xlators/mgmt/glusterd/src/Makefile.am +++ b/xlators/mgmt/glusterd/src/Makefile.am @@ -1,10 +1,11 @@ xlator_LTLIBRARIES = glusterd.la xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/mgmt glusterd_la_CPPFLAGS = "-DFILTERDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)/filter\"" -glusterd_la_LDFLAGS = -module -avoidversion $(LIBXML2_LIBS) -glusterd_la_SOURCES = glusterd.c glusterd-handler.c glusterd-sm.c glusterd-op-sm.c \ - glusterd-utils.c glusterd-rpc-ops.c glusterd-store.c glusterd-handshake.c \ - glusterd-pmap.c glusterd-volgen.c glusterd-rebalance.c glusterd-quota.c \ +glusterd_la_LDFLAGS = -module -avoidversion $(LIBXML2_LIBS) -lcrypto +glusterd_la_SOURCES = glusterd.c glusterd-handler.c glusterd-sm.c \ + glusterd-op-sm.c glusterd-utils.c glusterd-rpc-ops.c \ + glusterd-store.c glusterd-handshake.c glusterd-pmap.c \ + glusterd-volgen.c glusterd-rebalance.c glusterd-quota.c \ glusterd-geo-rep.c glusterd-replace-brick.c glusterd-log-ops.c \ glusterd-volume-ops.c glusterd-brick-ops.c glusterd-mountbroker.c \ glusterd-syncop.c @@ -13,15 +14,18 @@ glusterd_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \ $(top_builddir)/rpc/xdr/src/libgfxdr.la \ $(top_builddir)/rpc/rpc-lib/src/libgfrpc.la -noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-op-sm.h glusterd-sm.h \ - glusterd-store.h glusterd-mem-types.h glusterd-pmap.h glusterd-volgen.h \ - glusterd-mountbroker.h glusterd-syncop.h +noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-op-sm.h \ + glusterd-sm.h glusterd-store.h glusterd-mem-types.h \ + glusterd-pmap.h glusterd-volgen.h glusterd-mountbroker.h \ + glusterd-syncop.h AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -D$(GF_HOST_OS)\ -I$(top_srcdir)/libglusterfs/src -shared -nostartfiles $(GF_CFLAGS)\ - -I$(rpclibdir) -L$(xlatordir)/ -I$(CONTRIBDIR)/rbtree -I$(top_srcdir)/rpc/xdr/src\ - -I$(top_srcdir)/rpc/rpc-lib/src -I$(CONTRIBDIR)/uuid -I$(top_srcdir)/contrib/md5 -DSBIN_DIR=\"$(sbindir)\"\ - -DDATADIR=\"$(localstatedir)\" -DGSYNCD_PREFIX=\"$(libexecdir)/glusterfs\"\ + -I$(rpclibdir) -L$(xlatordir)/ -I$(CONTRIBDIR)/rbtree \ + -I$(top_srcdir)/rpc/xdr/src -I$(top_srcdir)/rpc/rpc-lib/src \ + -I$(CONTRIBDIR)/uuid \ + -DSBIN_DIR=\"$(sbindir)\" -DDATADIR=\"$(localstatedir)\" \ + -DGSYNCD_PREFIX=\"$(libexecdir)/glusterfs\"\ -DSYNCDAEMON_COMPILE=$(SYNCDAEMON_COMPILE) $(LIBXML2_CFLAGS) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 37899d4be..38e9a987d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -21,6 +21,7 @@ #define _CONFIG_H #include "config.h" #endif +#include <openssl/md5.h> #include <inttypes.h> #include "globals.h" @@ -32,7 +33,6 @@ #include "timer.h" #include "defaults.h" #include "compat.h" -#include "md5.h" #include "run.h" #include "compat-errno.h" #include "statedump.h" @@ -81,6 +81,17 @@ char *glusterd_sock_dir = "/tmp"; static glusterd_lock_t lock; +static void +md5_wrapper(const unsigned char *data, size_t len, char *md5) +{ + unsigned short i = 0; + unsigned short lim = MD5_DIGEST_LENGTH*2+1; + unsigned char scratch[MD5_DIGEST_LENGTH] = {0,}; + MD5(data, len, scratch); + for (; i < MD5_DIGEST_LENGTH; i++) + snprintf(md5 + i * 2, lim-i*2, "%02x", scratch[i]); +} + int32_t glusterd_get_lock_owner (uuid_t *uuid) { @@ -1036,14 +1047,14 @@ glusterd_set_brick_socket_filepath (glusterd_volinfo_t *volinfo, { char export_path[PATH_MAX] = {0,}; char sock_filepath[PATH_MAX] = {0,}; - char md5_sum[MD5_DIGEST_LEN*2+1] = {0,}; + char md5_sum[MD5_DIGEST_LENGTH*2+1] = {0,}; char volume_dir[PATH_MAX] = {0,}; xlator_t *this = NULL; glusterd_conf_t *priv = NULL; int expected_file_len = 0; expected_file_len = strlen (glusterd_sock_dir) + strlen ("/") + - MD5_DIGEST_LEN*2 + strlen (".socket") + 1; + MD5_DIGEST_LENGTH*2 + strlen (".socket") + 1; GF_ASSERT (len >= expected_file_len); this = THIS; GF_ASSERT (this); @@ -1054,9 +1065,7 @@ glusterd_set_brick_socket_filepath (glusterd_volinfo_t *volinfo, GLUSTERD_REMOVE_SLASH_FROM_PATH (brickinfo->path, export_path); snprintf (sock_filepath, PATH_MAX, "%s/run/%s-%s", volume_dir, brickinfo->hostname, export_path); - _get_md5_str (md5_sum, sizeof (md5_sum), - (uint8_t*)sock_filepath, strlen (sock_filepath)); - + md5_wrapper ((unsigned char *) sock_filepath, strlen(sock_filepath), md5_sum); snprintf (sockpath, len, "%s/%s.socket", glusterd_sock_dir, md5_sum); } @@ -2678,12 +2687,11 @@ glusterd_nodesvc_set_socket_filepath (char *rundir, uuid_t uuid, char *socketpath, int len) { char sockfilepath[PATH_MAX] = {0,}; - char md5_str[PATH_MAX] = {0,}; + char md5_str[MD5_DIGEST_LENGTH*2+1] = {0,}; snprintf (sockfilepath, sizeof (sockfilepath), "%s/run-%s", rundir, uuid_utoa (uuid)); - _get_md5_str (md5_str, sizeof (md5_str), - (uint8_t *)sockfilepath, sizeof (sockfilepath)); + md5_wrapper ((unsigned char *) sockfilepath, strlen (sockfilepath), md5_str); snprintf (socketpath, len, "%s/%s.socket", glusterd_sock_dir, md5_str); return 0; diff --git a/xlators/nfs/server/src/Makefile.am b/xlators/nfs/server/src/Makefile.am index a2c76a502..b5fd8586d 100644 --- a/xlators/nfs/server/src/Makefile.am +++ b/xlators/nfs/server/src/Makefile.am @@ -2,16 +2,18 @@ xlator_LTLIBRARIES = server.la xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/nfs nfsrpclibdir = $(top_srcdir)/rpc/rpc-lib/src server_la_LDFLAGS = -module -avoidversion -server_la_SOURCES = nfs.c nfs-common.c nfs-fops.c nfs-inodes.c nfs-generics.c mount3.c nfs3-fh.c nfs3.c nfs3-helpers.c nlm4.c nlmcbk_svc.c +server_la_SOURCES = nfs.c nfs-common.c nfs-fops.c nfs-inodes.c \ + nfs-generics.c mount3.c nfs3-fh.c nfs3.c nfs3-helpers.c nlm4.c \ + nlmcbk_svc.c server_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la -noinst_HEADERS = nfs.h nfs-common.h nfs-fops.h nfs-inodes.h nfs-generics.h mount3.h nfs3-fh.h nfs3.h nfs3-helpers.h nfs-mem-types.h nlm4.h +noinst_HEADERS = nfs.h nfs-common.h nfs-fops.h nfs-inodes.h nfs-generics.h \ + mount3.h nfs3-fh.h nfs3.h nfs3-helpers.h nfs-mem-types.h nlm4.h AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -D$(GF_HOST_OS)\ -DLIBDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)/auth\" \ -I$(top_srcdir)/libglusterfs/src -shared -nostartfiles $(GF_CFLAGS)\ -I$(nfsrpclibdir) -L$(xlatordir)/ -I$(CONTRIBDIR)/rbtree\ - -I$(top_srcdir)/rpc/xdr/src/ \ - -I$(top_srcdir)/contrib/md5/ + -I$(top_srcdir)/rpc/xdr/src/ CLEANFILES = diff --git a/xlators/protocol/legacy/server/src/Makefile.am b/xlators/protocol/legacy/server/src/Makefile.am index 262fec9ea..bfc0b7eb6 100644 --- a/xlators/protocol/legacy/server/src/Makefile.am +++ b/xlators/protocol/legacy/server/src/Makefile.am @@ -15,7 +15,6 @@ noinst_HEADERS = server-protocol.h server-helpers.h server-mem-types.h \ AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -D$(GF_HOST_OS) \ -I$(top_srcdir)/libglusterfs/src -shared -nostartfiles \ - -I$(top_srcdir)/contrib/md5/ \ -DDATADIR=\"$(localstatedir)\" -DCONFDIR=\"$(sysconfdir)/glusterfs\" \ -DLIBDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)/auth\" \ $(GF_CFLAGS) -I$(top_srcdir)/xlators/protocol/legacy/lib/src \ diff --git a/xlators/protocol/server/src/Makefile.am b/xlators/protocol/server/src/Makefile.am index 72a581ddf..0df5894ec 100644 --- a/xlators/protocol/server/src/Makefile.am +++ b/xlators/protocol/server/src/Makefile.am @@ -18,7 +18,6 @@ AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall \ -DLIBDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)/auth\" \ $(GF_CFLAGS) -I$(top_srcdir)/xlators/protocol/lib/src \ -I$(top_srcdir)/rpc/rpc-lib/src/ \ - -I$(top_srcdir)/rpc/xdr/src/ \ - -I$(top_srcdir)/contrib/md5/ + -I$(top_srcdir)/rpc/xdr/src/ CLEANFILES = *~ diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 1c40a12cf..6ce0b27af 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -23,13 +23,14 @@ #include "config.h" #endif +#include <openssl/md5.h> + #include "server.h" #include "server-helpers.h" #include "glusterfs3-xdr.h" #include "glusterfs3.h" #include "compat-errno.h" -#include "md5.h" #include "xdr-nfs3.h" @@ -1471,7 +1472,7 @@ server_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp.weak_checksum = weak_checksum; rsp.strong_checksum.strong_checksum_val = (char *)strong_checksum; - rsp.strong_checksum.strong_checksum_len = MD5_DIGEST_LEN; + rsp.strong_checksum.strong_checksum_len = MD5_DIGEST_LENGTH; } if (op_ret == -1) gf_log (this->name, GF_LOG_INFO, diff --git a/xlators/storage/posix/src/Makefile.am b/xlators/storage/posix/src/Makefile.am index d1d420017..408dcb80d 100644 --- a/xlators/storage/posix/src/Makefile.am +++ b/xlators/storage/posix/src/Makefile.am @@ -11,7 +11,7 @@ noinst_HEADERS = posix.h posix-mem-types.h posix-handle.h AM_CFLAGS = -fPIC -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \ -D$(GF_HOST_OS) -Wall -I$(top_srcdir)/libglusterfs/src -shared \ - -nostartfiles -I$(top_srcdir)/contrib/md5 -I$(top_srcdir)/rpc/xdr/src \ + -nostartfiles -I$(top_srcdir)/rpc/xdr/src \ -I$(top_srcdir)/rpc/rpc-lib/src $(GF_CFLAGS) CLEANFILES = diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 20a9528b0..04c166c54 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -38,7 +38,6 @@ #endif /* GF_BSD_HOST_OS */ #include "glusterfs.h" -#include "md5.h" #include "checksum.h" #include "dict.h" #include "logging.h" diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index bf38bd6ce..2452ddc4d 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -24,6 +24,7 @@ #define __XOPEN_SOURCE 500 +#include <openssl/md5.h> #include <stdint.h> #include <sys/time.h> #include <sys/resource.h> @@ -42,7 +43,6 @@ #endif /* HAVE_LINKAT */ #include "glusterfs.h" -#include "md5.h" #include "checksum.h" #include "dict.h" #include "logging.h" @@ -3739,13 +3739,13 @@ posix_rchecksum (call_frame_t *frame, xlator_t *this, int ret = 0; int32_t weak_checksum = 0; - uint8_t strong_checksum[MD5_DIGEST_LEN]; + unsigned char strong_checksum[MD5_DIGEST_LENGTH]; VALIDATE_OR_GOTO (frame, out); VALIDATE_OR_GOTO (this, out); VALIDATE_OR_GOTO (fd, out); - memset (strong_checksum, 0, MD5_DIGEST_LEN); + memset (strong_checksum, 0, MD5_DIGEST_LENGTH); buf = GF_CALLOC (1, len, gf_posix_mt_char); if (!buf) { @@ -3773,8 +3773,8 @@ posix_rchecksum (call_frame_t *frame, xlator_t *this, goto out; } - weak_checksum = gf_rsync_weak_checksum (buf, len); - gf_rsync_strong_checksum (buf, len, strong_checksum); + weak_checksum = gf_rsync_weak_checksum ((unsigned char *) buf, (size_t) len); + gf_rsync_strong_checksum ((unsigned char *) buf, (size_t) len, (unsigned char *) strong_checksum); GF_FREE (buf); |