summaryrefslogtreecommitdiffstats
path: root/cli
Commit message (Collapse)AuthorAgeFilesLines
* cli: avoid unnecessary strtail for geo rep config.Ravishankar N2018-11-111-20/+20
| | | | | | | | | | Found while looking at this function for another patch. Compile Tested Only! Updates bz#1193929 Change-Id: I46a9e95bf4d6609bc122edf86418659369258abe Signed-off-by: Ravishankar N <ravishankar@redhat.com>
* cli: add a warning/confirmation message in peer detach code pathAtin Mukherjee2018-11-091-1/+13
| | | | | | | | | | | | | | | | | On a multi node cluster if one of the node is detached which had active clients mounted through the same server address, this can cause all the clients to loose any volfile changes. This is due to the lack of infra in glusterd to let client know the list of IPs and attempt to connect to other active nodes as failback. Such framework does exist in GD2 but not in GD1. This patch ensures to take a preventive measure to have a warning message thrown to user to ensure all such connected clients are remounted through a different IP. Change-Id: I740b01868abbd75bf0a609cfaf00114d4d78aa96 Fixes: bz#1647074 Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
* all: fix the format string exceptionsAmar Tumballi2018-11-051-1/+1
| | | | | | | | | | | | | | | | Currently, there are possibilities in few places, where a user-controlled (like filename, program parameter etc) string can be passed as 'fmt' for printf(), which can lead to segfault, if the user's string contains '%s', '%d' in it. While fixing it, makes sense to make the explicit check for such issues across the codebase, by making the format call properly. Fixes: CVE-2018-14661 Fixes: bz#1644763 Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* stripe: remove the translator from build and glusterdAmar Tumballi2018-10-312-77/+7
| | | | | | | | | | | | | | | | Based on the proposal to remove few features as they are not actively maintained [1], removing stripe translator from the build. Also make sure there are no regression tests involving stripe translator. [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html Note that this patch aims at removing the translator from build, and a followup patch is needed to remove the code from repository. Updates: bz#1364707 Change-Id: I235b305338f138e29e9f30cba65bc0dadbebbbd5 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* cluster/ec : Prevent volume create without redundant brickSunil Kumar Acharya2018-10-241-3/+3
| | | | | | | | | | | | | Problem: EC volumes can be created without any redundant brick. Solution: Updated the conditional check to avoid volume create without redundant brick. fixes: bz#1642448 Change-Id: I0cb334b1b9378d67fcb8abf793dbe312c3179c0b Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
* glusterd: set integer instead of stringSanju Rakonde2018-10-241-2/+2
| | | | | | | | | | | | | | dict_get_str_boolean expects a integer, so we need to set all the boolean variables as integers to avoid log messages like below: [2018-09-10 03:55:19.236387] I [dict.c:2838:dict_get_str_boolean] (-->/usr/local/lib/libgfrpc.so.0(rpc_clnt_reconnect+0xc2) [0x7ff7a83d0452] -->/usr/local/lib/glusterfs/4.2dev/rpc-transport/socket.so(+0x65b0) [0x7ff7a06cf5b0] -->/usr/local/lib/libglusterfs.so.0(dict_get_str_boolean+0xcf) [0x7ff7a85fc58f] ) 0-dict: key transport.socket.ignore-enoent, integer type asked, has string type [Invalid argument] This patch addresses all such instances in glusterd. Change-Id: I7e1979fcf381363943f4d09b94c3901c403727da updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli: Fix heap-buffer-overflow issue reported by ASANKotresh HR2018-10-241-1/+4
| | | | | | | | | | | | | | | | | | | | GF_MALLOC was being used to allocate memory which is not initialized. strcat is used on it which could result in buffer overflow if it contains garbage before '\0'. So changed it to GF_CALLOC. Traceback: ==23427==ERROR: AddressSanitizer: heap-buffer-overflow ... WRITE of size 5 at 0x6080000083fe thread T3 #0 0x7fb60966991c in __interceptor_strcat ... #1 0x48adc0 in config_parse ... #2 0x48cde8 in cli_cmd_gsync_set_parse ... ... Updates: bz#1633930 Change-Id: I3710f011d8139984b1898265d84d150c9bdc962b Signed-off-by: Kotresh HR <khiremat@redhat.com>
* cli: Fix memory leaks reported by ASANKotresh HR2018-10-121-0/+38
| | | | | | | | | This patch addresses memory leaks other than 'gf_cli_rsp' response structure. Updates: bz#1633930 Change-Id: Idc5940dca623e33bc01004a9324bc435fc60b006 Signed-off-by: Kotresh HR <khiremat@redhat.com>
* cli: Fix memory leaks reported by ASANKotresh HR2018-10-121-64/+52
| | | | | | | | | | 'gf_cli_rsp' structure has 'op_errstr' and 'dict.dict_val' which could get allocated by xdr and should be freed. This patch takes care of all instances of the same. Updates: bz#1633930 Change-Id: I2a5d129ffe85cfca743c89edb45b658f3ce688cb Signed-off-by: Kotresh HR <khiremat@redhat.com>
* cli: memory leak issues reported by asanAmar Tumballi2018-10-092-4/+16
| | | | | | | | | With this fix, a run on 'rpc-coverage.t' passes properly. This should help to get started with other fixes soon! Change-Id: I257ae4e28b9974998a451d3b490cc18c02650ba2 updates: bz#1633930 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* cli: Resource leak coverity fixSanju Rakonde2018-10-081-0/+1
| | | | | | | | This patch fixes CID 1175017. Change-Id: I4968c35489aeb5bfa0461b2edf2a0d73b7f03c14 updates: bz#789278 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli : coverity fix in cli-rl.cSunny Kumar2018-10-051-3/+1
| | | | | | | | | | This patch fixes CID 1395248. Issue : Resource leak updates: bz#789278 Change-Id: I2fd4e36ac2c2a034e56883436abfc5199b095026 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: fix glusterd memory leak cause by "gluster v status volume_name"shujun100862018-10-031-0/+1
| | | | | | | | | | | If use this command every some seconds for example 15s to check gluster brick status, the glusterd will use about 1G memory in a year. free the value of rsp in gf_cli_status_cbk. glusterd allocate the value of rsp and send it to cli, but cli do not free the value, that cause glusterd memory leak. fixes: bz#1635480 Change-Id: I3f19cd0d4b791ae1b35f9664b3a668b1579f1178 Signed-off-by: shujun10086 <shujun.huang@nokia-sbell.com>
* cli: handle negative scenariosSanju Rakonde2018-10-014-17/+79
| | | | | | | | | | | When control flow reaches negative case code block, we added "goto out" statement without assigning ret to -1. This patch assigns return value to -1, before going to the lable "out". Change-Id: I6db651a3c9ca285ade9ee1ca23d0abe6b36fda3a updates: bz#1193929 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* Quota related files: use dict_{setn|getn|deln|get_int32n|set_int32n|set_strn}Yaniv Kaul2018-09-262-6/+13
| | | | | | | | | | | | | | In a previous patch (https://review.gluster.org/20769) we've added the key length to be passed to dict_* funcs, to remove the need to strlen() it. This patch moves some code to use it. Please review carefully. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: If4f425a9827be7c36ccfbb9761006ae824a818c6
* Land part 2 of clang-format changesGluster Ant2018-09-1215-25123/+24747
| | | | | Change-Id: Ia84cc24c8924e6d22d02ac15f611c10e26db99b4 Signed-off-by: Nigel Babu <nigelb@redhat.com>
* Land clang-format changesGluster Ant2018-09-124-350/+364
| | | | Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
* cli: Add warning message while converting to replica 2 configurationkarthik-us2018-09-113-15/+59
| | | | | | | | | | | | | | Currently while creating replica 2 volume we display a warning message of ending up in split-brain. But while converting an existing volume from other configuration to replica 2 by add-brick or remove-brick operations we do not show any such messages. With this fix in add-brick and remove-brick cases also we will display the same warning message and prompt for confirmation if the configuration changes to replica 2. Change-Id: Ifc4ed6994a087d2403894f4e743c4eb41633276b fixes: bz#1627044 Signed-off-by: karthik-us <ksubrahm@redhat.com>
* cli/src/cli-cmd-parser.c: Move to GF_MALLOC() instead of GF_CALLOC() when ↵Yaniv Kaul2018-09-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | possible It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. In some cases, also changed allocation size to be sizeof some struct or type instead of a pointer - easier to read. In some cases, removed redundant strlen() calls by saving the result into a variable. 1. Only done for the straightforward cases. There's room for improvement. 2. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: Ic1531afbf614823628cc8d70bae782d4db7ec033
* cli : fix coverity issue in cli-cmd-parser.cSunny Kumar2018-09-051-13/+8
| | | | | | | | | | | | This patch fixes 1175017 and 1382401. This patch fixes resource leak by validating brick_count is valid or not. If brick_count is not valid we are coming out in "cli_cmd_bricks_parse" without allocating memory to "brick_str" which is eventually pointed by bricks. Change-Id: I8ed0f29495379ec49484c5c4069865db3653506f updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* multiple files: calloc -> mallocYaniv Kaul2018-09-047-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xlators/cluster/stripe/src/stripe-helpers.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/tier.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-layout.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-helper.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/dht/src/dht-common.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/afr/src/afr.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible xlators/cluster/afr/src/afr-inode-read.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/bugs/replicate/bug-1250170-fsync.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/basic/gfapi/gfapi-async-calls-test.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible tests/basic/ec/ec-fast-fgetxattr.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/xdr/src/glusterfs3.h: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/rpc-transport/socket/src/socket.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible rpc/rpc-lib/src/rpc-clnt.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible extras/geo-rep/gsync-sync-gfid.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-xml-output.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-rpc-ops.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-volume.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-system.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-snapshot.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-peer.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible cli/src/cli-cmd-global.c: Move to GF_MALLOC() instead of GF_CALLOC() when possible It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. In some cases, also changed allocation size to be sizeof some struct or type instead of a pointer - easier to read. In some cases, removed redundant strlen() calls by saving the result into a variable. 1. Only done for the straightforward cases. There's room for improvement. 2. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! updates: bz#1193929 Original-Author: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Signed-off-by: Amar Tumballi <amarts@redhat.com> Change-Id: I16274dca4078a1d06ae09a0daf027d734b631ac2
* cli : fix coverity issue in cli-cmd-volume.cSunny Kumar2018-08-311-6/+6
| | | | | | | | This patch fixes 1389756. Change-Id: I72d4f618368545a5dcee0ca59fe87ba6137ab4a1 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: dereferencing null coverity fixSanju Rakonde2018-08-291-1/+1
| | | | | | | | | | CID: 1124489 https://scan6.coverity.com/reports.htm#v42375/p10714/fileInstanceId=85018660&defectInstanceId=25877775&mergedDefectId=577602 updates: bz#789278 Change-Id: I0ebfbc52ecd5e3b70574df5f286116f872514cc6 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli : fix coverity cli-rl.cSunny Kumar2018-08-271-1/+1
| | | | | | | | | | This fixes new coverity issue introduced by commit 5acb74d7da. Fixes 1395188. Change-Id: I629e5f214150672e309abb2fc58f55f1f58d8fb7 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* {cli-cmd-parser|cli-rpc-ops||cli-xml-output}.c: strncpy()->sprintf(), reduce ↵Yaniv Kaul2018-08-243-24/+31
| | | | | | | | | | | | | | | | | | | | | | strlen()'s strncpy may not be very efficient for short strings copied into a large buffer: If the length of src is less than n, strncpy() writes additional null bytes to dest to ensure that a total of n bytes are written. Instead, use snprintf(). Also: - save the result of strlen() and re-use it when possible. - move from GF_CALLOC() to GF_MALLOC() for the strings. - move from strlen to sizeof() for const strings. Compile-tested only! Change-Id: I3cf49c5401ee100a5db6a4954c3d699ec1814c17 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* cli : fix few coverity in cliSunny Kumar2018-08-242-4/+6
| | | | | | | | | | This patch fixes DEADCODE and FORWARD_NULL. CID : 1124495, 1124380, 1124381 Change-Id: I79992e396dbcb1bfe6cd0614d49a8da3f67d648d updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli/src/cli-cmd-parser.c:move to GF_MALLOC() instead of GF_CALLOC() whenYaniv Kaul2018-08-231-1/+1
| | | | | | | | | | | | | | | | It doesn't make sense to calloc (allocate and clear) memory when the code right away fills that memory with data. It may be optimized by the compiler, or have a microscopic performance improvement. Please review carefully, especially for string allocation, with the terminating NULL string. Only compile-tested! Change-Id: I01c67fd535ea4a2b8fa7cb4d89bff52642dc009a updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* cli: Fix invalid access of option_str variableShyamsundarR2018-08-201-2/+7
| | | | | | | | | | | | | | | | | | In function cli_cmd_volume_statedump_options_parse if the wordcount of arguments is exactly 3, then option_str would remain NULL, and hence the function will generate a segmentation fault on the strstr check in its body. This can be triggered when we run the command, `gluster volume statedump <volname>` The fix is to check if option_str is non-NULL before use and also to pass in a duplicated empty string to the dict key "options" when this is NULL. Fixes: bz#1619423 Change-Id: Ic029ab60b64890d92c7a0876a638929495d3aa59 Signed-off-by: ShyamsundarR <srangana@redhat.com>
* build: use standard PKG_CHECK_MODULES for libxml2 availabilityNiels de Vos2018-08-161-3/+2
| | | | | | | | | | | | | In case the development parts of libxml2 are not installed, it was required to re-run ./autogen.sh to cleanup the cached values for the check. This is not nice towards users. By using the standard PKG_CHECK_MODULES for libxml-2.0 the results of the check are not cached and will be probed again when running ./configure. Change-Id: I3c4586e5555a521be5d4fb61bdb873ae0317311a Fixes: bz#1599219 Reported-by: Sachidananda Urs <surs@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com>
* All: remove memset() before sprintf()Yaniv Kaul2018-08-144-327/+26
| | | | | | | | | | | | It's not needed. There's a good chance the compiler is smart enough to remove it anyway, but it can't hurt - I hope. Compile-tested only! Change-Id: Id7c054e146ba630227affa591007803f3046416b updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* build: rename event.h to gf-event.hNiels de Vos2018-07-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Newer FreeBSD versions (noticed with 10.3-RELEASE) provide a event.h file that on occasion gets included instead of the libglusterfs file. When this happens, 'struct event_pool' will not be defined and building will fail with errors like: autoscale-threads.c:18:55: error: incomplete definition of type 'struct event_pool' int thread_count = pool->eventthreadcount; ~~~~^ autoscale-threads.c:17:16: note: forward declaration of 'struct event_pool' struct event_pool *pool = ctx->event_pool; ^ This problem is caused by 'pkg-config --cflags uuid' that adds /usr/local/include to the GF_CPPFLAGS. The use of libuuid is preferred so that the contrib/uuid/ directory can be removed. By renaming event.h to gf-event.h there is no conflict between the different event.h files anymore and compiling on FreeBSD works without issues. Change-Id: Ie69f6b8a4f8f8e9630d39a86693eb74674f0f763 Updates: bz#1607319 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* All: run codespell on the code and fix issues.Yaniv Kaul2018-07-224-6/+6
| | | | | | | | | | | | Please review, it's not always just the comments that were fixed. I've had to revert of course all calls to creat() that were changed to create() ... Only compile-tested! Change-Id: I7d02e82d9766e272a7fd9cc68e51901d69e5aab5 updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
* Fix compile warningsXavi Hernandez2018-07-101-5/+5
| | | | | | | | | | | This patch fixes compile warnings that appear with newer compilers. The solution applied is only to remove the warnings, but it doesn't always solve the problem in the best way. It assumes that the problem will never happen, as the previous code assumed. Change-Id: I6e8470d6c2e2dbd3bd7d324b5fd2f92ffdc3d6ec updates: bz#1193929 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
* cli: change volume create syntax of arbiter volumeAmar Tumballi2018-07-031-25/+31
| | | | | | | fixes: bz#1596524 updates: gluster/glusterd2#515 Change-Id: I8a46fa2fd1fd2b0e9fbcecd3bb18d348aed9c6a9 Signed-off-by: Amar Tumballi <amarts@redhat.com>
* glusterd: glusterd is releasing the locks before timeoutSanju Rakonde2018-05-281-0/+22
| | | | | | | | | | | | | | | | | | | Problem: We introduced lock timer in mgmt v3, which will realease the lock after 3 minutes from command execution. Some commands related to heal/profile will take more time to execute. For these comands timeout is set to 10 minutes. As the lock timer is set to 3 minutes glusterd is releasing the lock after 3 minutes. That means locks are released before the command is completed its execution. Solution: Pass a timeout parameter from cli to glusterd, when there is a change in default timeout value(i.e, default timeout value can be changed through command line or for the commands related to profile/heal we will change the default timeout value to 10 minutes.) glusterd will set the lock timer timeout according to the timeout value passed. Change-Id: I7b7a9a4f95ed44aca39ef9d9907f546bca99c69d fixes: bz#1577731 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli: Fix for gluster volume info --xmlSanju Rakonde2018-05-151-2/+2
| | | | | | | | | | | | Problem: gluster volume info --xml is showing same uuid to all the bricks of a tier volume. Solution: While iterating over hot/cold bricks of a tier volume, use correct iterator. Fixes: bz#1577627 Change-Id: Icf6a9c2a10b9da453abc262a57b7884d6638e3ed Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
* cli/snapshot: ignore errors for snapshot status for ALL/VOLThomas Hindoe Paaboel Andersen2018-05-041-1/+1
| | | | | | | | | | | | | | | | | Currently errors are reported for snapshot status of type ALL and VOL. The intention was to ignore those, but the code gets it wrong. The original condition for ignoring ALL/VOL was removed in Bug 1096610 Change-Id Ifc0ac31d2a9f91e136e87f3b51a629df7dba94e8 And the current logic introduced in Bug 789278 Change-Id I985cea1ef787d239b2632d5a7f467070846f92e4 Change-Id: Ic02ea98fb23b1149264e91b41f2fc2ca916d405f Fixes: bz#1574259 Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
* cli/glusterd: Add warning message in cli for user to checkSusant Palai2018-05-033-8/+26
| | | | | | | | | | | | | | | | | | | | force-migration config for remove-brick operation. The cli will take input from the user before starting "remove-brick" start operation. The message/confirmation looks like the following: <Running remove-brick with cluster.force-migration enabled can result in data corruption. It is safer to disable this option so that files that receive writes during migration are not migrated. Files that are not migrated can then be manually copied after the remove-brick commit operation. Do you want to continue with your current cluster.force-migration settings? (y/n)> And also question for COMMIT_FORCE is changed. Fixes: bz#1572586 Change-Id: Ifdb6b108a646f50339dd196d6e65962864635139 Signed-off-by: Susant Palai <spalai@redhat.com>
* Make glusterfsd binary print statedump & xlator dirPrashanth Pai2018-04-192-7/+0
| | | | | | | | | | | | | | | | | | | | | | | The glusterd2 needs following options, some of which are provided by gluster CLI today: --print-xlatordir --print-statedumpdir --print-logdir However, the CLI package need not be present on the machine running glusterd2. This change adds the above CLI options to glusterfsd binary which glusterd2 depends on. Reverts 9a1ae47c8d60836ae0628a04a153f28c1085c0e8 Related changes: https://review.gluster.org/#/c/19882/ https://github.com/gluster/glusterd2/pull/663 Updates: bz#1193929 Change-Id: I18c123b0d3350d2bd4f2400783e3b94e402a4e29 Signed-off-by: Prashanth Pai <ppai@redhat.com>
* Add CLI option to print XLATORDIRPrashanth Pai2018-04-182-0/+7
| | | | | | | | | | | | | | | | | | glusterfs gets the path to xlator dir from a compile time flag named XLATORDIR which gets passed through a -D flag to GCC. This path is used to find and load xlator shared objects. The XLATORDIR path isn't easily accessible to glusterd2. Glusterd2 currently uses the following command (hack) to get value of XLATORDIR: $ strings -d `which glusterfsd` | awk '/glusterfs/*/xlator$/' This change introduces "print-xlatordir" CLI option to expose XLATORDIR. The option is intentionally not documented. Updates: bz#1193929 Change-Id: Ic7247457600f11cd8d68eb3d0ad2526fdfda0b02 Signed-off-by: Prashanth Pai <ppai@redhat.com>
* glusterd: TLS verification fails while using intermediate CAMohit Agrawal2018-03-191-0/+1
| | | | | | | | | | | | | | | | | | | | | Problem: TLS verification fails while using intermediate CA if mgmt SSL is enabled. Solution: There are two main issue of TLS verification failing 1) not calling ssl_api to set cert_depth 2) The current code does not allow to set certificate depth while MGMT SSL is enabled. After apply this patch to set certificate depth user need to set parameter option transport.socket.ssl-cert-depth <depth> in /var/lib/glusterd/secure_acccess instead to set in /etc/glusterfs/glusterd.vol. At the time of set secure_mgmt in ctx we will check the value of cert-depth and save the value of cert-depth in ctx.If user does not provide any value in cert-depth in that case it will consider default value is 1 BUG: 1555154 Change-Id: I89e9a9e1026e37efb5c20f9ec62b1989ef644f35 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
* build: add --without-server optionNiels de Vos2018-02-191-0/+2
| | | | | | | | | | | | | | | | With Gluster 4.0 we will not provide the server components for EL6 and older. At one point Gluster 4.x will get GlusterD2, which requires Golang tools in the distribution. EL6 does not contain these at the moment. With this change, it is possible to `./configure --without-server` which prevents building glusterd and the xlators for the bricks. Building RPMs can pass `--without server` and the glusterfs-server sub-package will not be created. Change-Id: I97f5ccf9f2c76e60d9af83915fc59fae57ad6d25 BUG: 1074947 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* bitrot : improved cli report after bitrot operatoinSunny Kumar2018-02-011-0/+57
| | | | | | | | | | Improved cli report post bitrot opertaion as previously it was showing output "volume bitrot: success" for all the sucessfull bitrot operations (enable, disable or scrub options). Change-Id: I0857e99f3956221a51cfd1b29a90e1038b90570f BUG: 1539166 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
* cli: Fixed a use_after_freeN Balachandran2018-01-041-1/+2
| | | | | | | | | gf_event in cli_cmd_volume_create_cbk was accessing memory that had already been freed. Change-Id: I447c939fa9b31e18819a62c3b356c14cca390787 BUG: 1530910 Signed-off-by: N Balachandran <nbalacha@redhat.com>
* cli: Fixed coverity issue in cli-cmd-system.cXavier Hernandez2017-12-201-1/+22
| | | | | | | | | | | This patch adds a missing check of the return value of strtok_r() and returns an error if it's NULL. It also fixes a couple of leaks. Change-Id: Ib15d6f843516e44c3bd8790a2e3ad936e357f6d4 BUG: 789278 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* libglusterfs: specify ctx in gf_log_set_loglevelZhang Huan2017-12-061-2/+2
| | | | | | | | | specify ctx in gf_log_set_loglevel, instead of getting it from a thread specific variable. Change-Id: I498f826e8e32231235a6b0005026a27c327727fd BUG: 1521213 Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
* cli: Fix coverity errors for cli-rpc-ops.cKaushal M2017-11-211-34/+106
| | | | | | | | | | | | | Fixes issues 147, 168, 169, 219, 715, 718, 766, 768, 772, 774, 776, 782, 790 from the report at [1]. Also, fixed some other possible static checker errors as well. [1]: https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ BUG: 789278 Change-Id: I985cea1ef787d239b2632d5a7f467070846f92e4 Signed-off-by: Kaushal M <kaushal@redhat.com>
* cli: Fix coverity issues in cli.cMohammed Rafi KC2017-11-081-1/+0
| | | | | | | | This patch fixes coverity issue 536 BUG: 789278 Change-Id: I9fe7b324a3ab1f16b4ee4e63818f93ef71d3405a Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
* cli: Fix several coverity issues in cli-cmd-parser.cXavier Hernandez2017-11-071-99/+173
| | | | | | | | | | | | | | This patch fixes coverity issues 115, 191, 274, 462, 463, 508, 588, 612, 614, 618 and 698 from [1]. Also removed the need for some relatively big arrays as local variables of some functions. [1] https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: I4f435dbdbedc1b6de067084cce3050b620b28391 BUG: 789278 Signed-off-by: Xavier Hernandez <jahernan@redhat.com>
* cli: correct rebalance status elapsed checkN Balachandran2017-11-071-1/+5
| | | | | | | | | Check that elapsed time has crossed 10 mins for at least one rebalance process before displaying the estimates. Change-Id: Ib357a6f0d0125a178e94ede1e31514fdc6ce3593 BUG: 1479528 Signed-off-by: N Balachandran <nbalacha@redhat.com>