:c:type:`MEMCACHED_PARSE_USER_ERROR`
:c:type:`MEMCACHED_DEPRECATED`
+
+:c:type:`MEMCACHED_UNIX_SOCKET_PATH_TOO_BIG`
--------
SEE ALSO
--------
:manpage:`memcached` :manpage:`libmemcached` :manpage:`memcached_client_error` or :manpage:`memcached_worker_error`
-
MEMCACHED_IN_PROGRESS,
MEMCACHED_SERVER_TEMPORARILY_DISABLED,
MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE,
+ MEMCACHED_UNIX_SOCKET_PATH_TOO_BIG,
MEMCACHED_MAXIMUM_RETURN, /* Always add new error code before */
MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE= MEMCACHED_ERROR
};
memset(&servAddr, 0, sizeof (struct sockaddr_un));
servAddr.sun_family= AF_UNIX;
- strncpy(servAddr.sun_path, server->hostname(), sizeof(servAddr.sun_path)); /* Copy filename */
+ if (strlen(server->hostname()) >= sizeof(servAddr.sun_path)) {
+ return memcached_set_error(*server, MEMCACHED_UNIX_SOCKET_PATH_TOO_BIG, MEMCACHED_AT);
+ }
+ strncpy(servAddr.sun_path, server->hostname(), sizeof(servAddr.sun_path)-1); /* Copy filename */
if (connect(server->fd, (struct sockaddr *)&servAddr, sizeof(servAddr)) == -1)
{
case MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE:
return "SERVER FAILED TO ALLOCATE OBJECT";
+ case MEMCACHED_UNIX_SOCKET_PATH_TOO_BIG:
+ return "UNIX SOCKET PATH TOO LARGE";
+
default:
case MEMCACHED_MAXIMUM_RETURN:
return "INVALID memcached_return_t";
4159057246U, 3425930182U, 2593724503U, 1868899624U,
1769812374U, 2302537950U, 1110330676U, 3365377466U,
1336171666U, 3021258493U, 2334992265U, 3861994737U,
- 3582734124U, 3365377466U };
+ 3582734124U, 3889811103, 3365377466U };
// You have updated the memcache_error messages but not updated docs/tests.
for (int rc= int(MEMCACHED_SUCCESS); rc < int(MEMCACHED_MAXIMUM_RETURN); ++rc)
}
test_compare(values[rc], hash_val);
}
- test_compare(49, int(MEMCACHED_MAXIMUM_RETURN));
+ test_compare(50, int(MEMCACHED_MAXIMUM_RETURN));
return TEST_SUCCESS;
}