diff options
| -rw-r--r-- | rpc/rpc-transport/socket/src/name.c | 4 | ||||
| -rw-r--r-- | tests/bugs/bug-1046308.t | 19 | 
2 files changed, 21 insertions, 2 deletions
diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c index 1647d5b6b64..c6eae9739ad 100644 --- a/rpc/rpc-transport/socket/src/name.c +++ b/rpc/rpc-transport/socket/src/name.c @@ -285,7 +285,7 @@ af_unix_client_get_remote_sockaddr (rpc_transport_t *this,                  goto err;          } -        if (strlen (connect_path) > UNIX_PATH_MAX) { +        if ((strlen (connect_path) + 1)  > UNIX_PATH_MAX) {                  gf_log (this->name, GF_LOG_ERROR,                          "connect-path value length %"GF_PRI_SIZET" > %d octets",                          strlen (connect_path), UNIX_PATH_MAX); @@ -329,7 +329,7 @@ af_unix_server_get_local_sockaddr (rpc_transport_t *this,  #define UNIX_PATH_MAX 108  #endif -        if (strlen (listen_path) > UNIX_PATH_MAX) { +        if ((strlen (listen_path) + 1)  > UNIX_PATH_MAX) {                  gf_log (this->name, GF_LOG_ERROR,                          "option transport.unix.listen-path has value length "                          "%"GF_PRI_SIZET" > %d", diff --git a/tests/bugs/bug-1046308.t b/tests/bugs/bug-1046308.t new file mode 100644 index 00000000000..cfec3a35d31 --- /dev/null +++ b/tests/bugs/bug-1046308.t @@ -0,0 +1,19 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + +cleanup; + +volname="StartMigrationDuringRebalanceTest" +TEST glusterd +TEST pidof glusterd; + +TEST $CLI volume info; +TEST $CLI volume create $volname $H0:$B0/${volname}{1,2}; +TEST $CLI volume start $volname; +TEST $CLI volume rebalance $volname start; + +cleanup; + + +  | 
