2 * Copyright (c) 2005 Michael Bushkov <bushman@rsu.ru>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in thereg
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #include <sys/cdefs.h>
29 #include <sys/param.h>
30 #include <sys/event.h>
31 #include <sys/socket.h>
48 #include "agents/passwd.h"
49 #include "agents/group.h"
50 #include "agents/services.h"
58 #include "singletons.h"
61 #define CONFIG_PATH "/etc/nscd.conf"
63 #define DEFAULT_CONFIG_PATH "nscd.conf"
65 #define MAX_SOCKET_IO_SIZE 4096
67 struct processing_thread_args {
69 struct configuration *the_configuration;
70 struct runtime_env *the_runtime_env;
73 static void accept_connection(struct kevent *, struct runtime_env *,
74 struct configuration *);
75 static void destroy_cache_(cache);
76 static void destroy_runtime_env(struct runtime_env *);
77 static cache init_cache_(struct configuration *);
78 static struct runtime_env *init_runtime_env(struct configuration *);
79 static void processing_loop(cache, struct runtime_env *,
80 struct configuration *);
81 static void process_socket_event(struct kevent *, struct runtime_env *,
82 struct configuration *);
83 static void process_timer_event(struct kevent *, struct runtime_env *,
84 struct configuration *);
85 static void *processing_thread(void *);
86 static void usage(void) __dead2;
88 void get_time_func(struct timeval *);
94 "usage: nscd [-dnst] [-i cachename] [-I cachename]\n");
99 init_cache_(struct configuration *config)
101 struct cache_params params;
104 struct configuration_entry *config_entry;
107 TRACE_IN(init_cache_);
109 memset(¶ms, 0, sizeof(struct cache_params));
110 params.get_time_func = get_time_func;
111 retval = init_cache(¶ms);
113 size = configuration_get_entries_size(config);
114 for (i = 0; i < size; ++i) {
115 config_entry = configuration_get_entry(config, i);
117 * We should register common entries now - multipart entries
118 * would be registered automatically during the queries.
120 register_cache_entry(retval, (struct cache_entry_params *)
121 &config_entry->positive_cache_params);
122 config_entry->positive_cache_entry = find_cache_entry(retval,
123 config_entry->positive_cache_params.cep.entry_name);
124 assert(config_entry->positive_cache_entry !=
125 INVALID_CACHE_ENTRY);
127 register_cache_entry(retval, (struct cache_entry_params *)
128 &config_entry->negative_cache_params);
129 config_entry->negative_cache_entry = find_cache_entry(retval,
130 config_entry->negative_cache_params.cep.entry_name);
131 assert(config_entry->negative_cache_entry !=
132 INVALID_CACHE_ENTRY);
135 LOG_MSG_2("cache", "cache was successfully initialized");
136 TRACE_OUT(init_cache_);
141 destroy_cache_(cache the_cache)
143 TRACE_IN(destroy_cache_);
144 destroy_cache(the_cache);
145 TRACE_OUT(destroy_cache_);
149 * Socket and kqueues are prepared here. We have one global queue for both
150 * socket and timers events.
152 static struct runtime_env *
153 init_runtime_env(struct configuration *config)
156 struct sockaddr_un serv_addr;
158 struct kevent eventlist;
159 struct timespec timeout;
161 struct runtime_env *retval;
163 TRACE_IN(init_runtime_env);
164 retval = calloc(1, sizeof(*retval));
165 assert(retval != NULL);
167 retval->sockfd = socket(PF_LOCAL, SOCK_STREAM, 0);
169 if (config->force_unlink == 1)
170 unlink(config->socket_path);
172 memset(&serv_addr, 0, sizeof(struct sockaddr_un));
173 serv_addr.sun_family = PF_LOCAL;
174 strlcpy(serv_addr.sun_path, config->socket_path,
175 sizeof(serv_addr.sun_path));
176 serv_addr_len = sizeof(serv_addr.sun_family) +
177 strlen(serv_addr.sun_path) + 1;
179 if (bind(retval->sockfd, (struct sockaddr *)&serv_addr,
180 serv_addr_len) == -1) {
181 close(retval->sockfd);
184 LOG_ERR_2("runtime environment", "can't bind socket to path: "
185 "%s", config->socket_path);
186 TRACE_OUT(init_runtime_env);
189 LOG_MSG_2("runtime environment", "using socket %s",
190 config->socket_path);
193 * Here we're marking socket as non-blocking and setting its backlog
194 * to the maximum value
196 chmod(config->socket_path, config->socket_mode);
197 listen(retval->sockfd, -1);
198 fcntl(retval->sockfd, F_SETFL, O_NONBLOCK);
200 retval->queue = kqueue();
201 assert(retval->queue != -1);
203 EV_SET(&eventlist, retval->sockfd, EVFILT_READ, EV_ADD | EV_ONESHOT,
205 memset(&timeout, 0, sizeof(struct timespec));
206 kevent(retval->queue, &eventlist, 1, NULL, 0, &timeout);
208 LOG_MSG_2("runtime environment", "successfully initialized");
209 TRACE_OUT(init_runtime_env);
214 destroy_runtime_env(struct runtime_env *env)
216 TRACE_IN(destroy_runtime_env);
220 TRACE_OUT(destroy_runtime_env);
224 accept_connection(struct kevent *event_data, struct runtime_env *env,
225 struct configuration *config)
227 struct kevent eventlist[2];
228 struct timespec timeout;
229 struct query_state *qstate;
237 TRACE_IN(accept_connection);
238 fd = accept(event_data->ident, NULL, NULL);
240 LOG_ERR_2("accept_connection", "error %d during accept()",
242 TRACE_OUT(accept_connection);
246 if (getpeereid(fd, &euid, &egid) != 0) {
247 LOG_ERR_2("accept_connection", "error %d during getpeereid()",
249 TRACE_OUT(accept_connection);
253 qstate = init_query_state(fd, sizeof(int), euid, egid);
254 if (qstate == NULL) {
255 LOG_ERR_2("accept_connection", "can't init query_state");
256 TRACE_OUT(accept_connection);
260 memset(&timeout, 0, sizeof(struct timespec));
261 EV_SET(&eventlist[0], fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT,
262 0, qstate->timeout.tv_sec * 1000, qstate);
263 EV_SET(&eventlist[1], fd, EVFILT_READ, EV_ADD | EV_ONESHOT,
264 NOTE_LOWAT, qstate->kevent_watermark, qstate);
265 res = kevent(env->queue, eventlist, 2, NULL, 0, &timeout);
267 LOG_ERR_2("accept_connection", "kevent error");
269 TRACE_OUT(accept_connection);
273 process_socket_event(struct kevent *event_data, struct runtime_env *env,
274 struct configuration *config)
276 struct kevent eventlist[2];
277 struct timeval query_timeout;
278 struct timespec kevent_timeout;
282 struct query_state *qstate;
284 TRACE_IN(process_socket_event);
285 eof_res = event_data->flags & EV_EOF ? 1 : 0;
288 memset(&kevent_timeout, 0, sizeof(struct timespec));
289 EV_SET(&eventlist[0], event_data->ident, EVFILT_TIMER, EV_DELETE,
291 nevents = kevent(env->queue, eventlist, 1, NULL, 0, &kevent_timeout);
293 if (errno == ENOENT) {
294 /* the timer is already handling this event */
295 TRACE_OUT(process_socket_event);
298 /* some other error happened */
299 LOG_ERR_2("process_socket_event", "kevent error, errno"
301 TRACE_OUT(process_socket_event);
305 qstate = (struct query_state *)event_data->udata;
308 * If the buffer that is to be send/received is too large,
309 * we send it implicitly, by using query_io_buffer_read and
310 * query_io_buffer_write functions in the query_state. These functions
311 * use the temporary buffer, which is later send/received in parts.
312 * The code below implements buffer splitting/mergind for send/receive
313 * operations. It also does the actual socket IO operations.
315 if (((qstate->use_alternate_io == 0) &&
316 (qstate->kevent_watermark <= (size_t)event_data->data)) ||
317 ((qstate->use_alternate_io != 0) &&
318 (qstate->io_buffer_watermark <= (size_t)event_data->data))) {
319 if (qstate->use_alternate_io != 0) {
320 switch (qstate->io_buffer_filter) {
322 io_res = query_socket_read(qstate,
324 qstate->io_buffer_watermark);
326 qstate->use_alternate_io = 0;
327 qstate->process_func = NULL;
329 qstate->io_buffer_p += io_res;
330 if (qstate->io_buffer_p ==
332 qstate->io_buffer_size) {
333 qstate->io_buffer_p =
335 qstate->use_alternate_io = 0;
344 if (qstate->use_alternate_io == 0) {
346 res = qstate->process_func(qstate);
347 } while ((qstate->kevent_watermark == 0) &&
348 (qstate->process_func != NULL) &&
352 qstate->process_func = NULL;
355 if ((qstate->use_alternate_io != 0) &&
356 (qstate->io_buffer_filter == EVFILT_WRITE)) {
357 io_res = query_socket_write(qstate, qstate->io_buffer_p,
358 qstate->io_buffer_watermark);
360 qstate->use_alternate_io = 0;
361 qstate->process_func = NULL;
363 qstate->io_buffer_p += io_res;
366 /* assuming that socket was closed */
367 qstate->process_func = NULL;
368 qstate->use_alternate_io = 0;
371 if (((qstate->process_func == NULL) &&
372 (qstate->use_alternate_io == 0)) ||
373 (eof_res != 0) || (res != 0)) {
374 destroy_query_state(qstate);
375 close(event_data->ident);
376 TRACE_OUT(process_socket_event);
380 /* updating the query_state lifetime variable */
381 get_time_func(&query_timeout);
382 query_timeout.tv_usec = 0;
383 query_timeout.tv_sec -= qstate->creation_time.tv_sec;
384 if (query_timeout.tv_sec > qstate->timeout.tv_sec)
385 query_timeout.tv_sec = 0;
387 query_timeout.tv_sec = qstate->timeout.tv_sec -
388 query_timeout.tv_sec;
390 if ((qstate->use_alternate_io != 0) && (qstate->io_buffer_p ==
391 qstate->io_buffer + qstate->io_buffer_size))
392 qstate->use_alternate_io = 0;
394 if (qstate->use_alternate_io == 0) {
396 * If we must send/receive the large block of data,
397 * we should prepare the query_state's io_XXX fields.
398 * We should also substitute its write_func and read_func
399 * with the query_io_buffer_write and query_io_buffer_read,
400 * which will allow us to implicitly send/receive this large
401 * buffer later (in the subsequent calls to the
402 * process_socket_event).
404 if (qstate->kevent_watermark > MAX_SOCKET_IO_SIZE) {
407 * XXX: Uncommenting this code makes nscd(8) fail for
408 * entries larger than a few kB, causing few second
409 * worth of delay for each call to retrieve them.
411 if (qstate->io_buffer != NULL)
412 free(qstate->io_buffer);
414 qstate->io_buffer = calloc(1,
415 qstate->kevent_watermark);
416 assert(qstate->io_buffer != NULL);
418 qstate->io_buffer_p = qstate->io_buffer;
419 qstate->io_buffer_size = qstate->kevent_watermark;
420 qstate->io_buffer_filter = qstate->kevent_filter;
422 qstate->write_func = query_io_buffer_write;
423 qstate->read_func = query_io_buffer_read;
425 if (qstate->kevent_filter == EVFILT_READ)
426 qstate->use_alternate_io = 1;
429 qstate->io_buffer_watermark = MAX_SOCKET_IO_SIZE;
430 EV_SET(&eventlist[1], event_data->ident,
431 qstate->kevent_filter, EV_ADD | EV_ONESHOT,
432 NOTE_LOWAT, MAX_SOCKET_IO_SIZE, qstate);
434 EV_SET(&eventlist[1], event_data->ident,
435 qstate->kevent_filter, EV_ADD | EV_ONESHOT,
436 NOTE_LOWAT, qstate->kevent_watermark, qstate);
439 if (qstate->io_buffer + qstate->io_buffer_size -
440 qstate->io_buffer_p <
441 MAX_SOCKET_IO_SIZE) {
442 qstate->io_buffer_watermark = qstate->io_buffer +
443 qstate->io_buffer_size - qstate->io_buffer_p;
444 EV_SET(&eventlist[1], event_data->ident,
445 qstate->io_buffer_filter,
446 EV_ADD | EV_ONESHOT, NOTE_LOWAT,
447 qstate->io_buffer_watermark,
450 qstate->io_buffer_watermark = MAX_SOCKET_IO_SIZE;
451 EV_SET(&eventlist[1], event_data->ident,
452 qstate->io_buffer_filter, EV_ADD | EV_ONESHOT,
453 NOTE_LOWAT, MAX_SOCKET_IO_SIZE, qstate);
456 EV_SET(&eventlist[0], event_data->ident, EVFILT_TIMER,
457 EV_ADD | EV_ONESHOT, 0, query_timeout.tv_sec * 1000, qstate);
458 kevent(env->queue, eventlist, 2, NULL, 0, &kevent_timeout);
460 TRACE_OUT(process_socket_event);
464 * This routine is called if timer event has been signaled in the kqueue. It
465 * just closes the socket and destroys the query_state.
468 process_timer_event(struct kevent *event_data, struct runtime_env *env,
469 struct configuration *config)
471 struct query_state *qstate;
473 TRACE_IN(process_timer_event);
474 qstate = (struct query_state *)event_data->udata;
475 destroy_query_state(qstate);
476 close(event_data->ident);
477 TRACE_OUT(process_timer_event);
481 * Processing loop is the basic processing routine, that forms a body of each
485 processing_loop(cache the_cache, struct runtime_env *env,
486 struct configuration *config)
488 struct timespec timeout;
489 const int eventlist_size = 1;
490 struct kevent eventlist[eventlist_size];
493 TRACE_MSG("=> processing_loop");
494 memset(&timeout, 0, sizeof(struct timespec));
495 memset(&eventlist, 0, sizeof(struct kevent) * eventlist_size);
498 nevents = kevent(env->queue, NULL, 0, eventlist,
499 eventlist_size, NULL);
501 * we can only receive 1 event on success
504 struct kevent *event_data;
505 event_data = &eventlist[0];
507 if ((int)event_data->ident == env->sockfd) {
508 for (i = 0; i < event_data->data; ++i)
509 accept_connection(event_data, env, config);
511 EV_SET(eventlist, s_runtime_env->sockfd,
512 EVFILT_READ, EV_ADD | EV_ONESHOT,
515 sizeof(struct timespec));
516 kevent(s_runtime_env->queue, eventlist,
517 1, NULL, 0, &timeout);
520 switch (event_data->filter) {
523 process_socket_event(event_data,
527 process_timer_event(event_data,
535 /* this branch shouldn't be currently executed */
539 TRACE_MSG("<= processing_loop");
543 * Wrapper above the processing loop function. It sets the thread signal mask
544 * to avoid SIGPIPE signals (which can happen if the client works incorrectly).
547 processing_thread(void *data)
549 struct processing_thread_args *args;
552 TRACE_MSG("=> processing_thread");
553 args = (struct processing_thread_args *)data;
556 sigaddset(&new, SIGPIPE);
557 if (pthread_sigmask(SIG_BLOCK, &new, NULL) != 0)
558 LOG_ERR_1("processing thread",
559 "thread can't block the SIGPIPE signal");
561 processing_loop(args->the_cache, args->the_runtime_env,
562 args->the_configuration);
564 TRACE_MSG("<= processing_thread");
570 get_time_func(struct timeval *time)
573 memset(&res, 0, sizeof(struct timespec));
574 clock_gettime(CLOCK_MONOTONIC, &res);
576 time->tv_sec = res.tv_sec;
581 * The idea of _nss_cache_cycle_prevention_function is that nsdispatch
582 * will search for this symbol in the executable. This symbol is the
583 * attribute of the caching daemon. So, if it exists, nsdispatch won't try
584 * to connect to the caching daemon and will just ignore the 'cache'
585 * source in the nsswitch.conf. This method helps to avoid cycles and
586 * organize self-performing requests.
588 * (not actually a function; it used to be, but it doesn't make any
589 * difference, as long as it has external linkage)
591 void *_nss_cache_cycle_prevention_function;
594 main(int argc, char *argv[])
596 struct processing_thread_args *thread_args;
599 struct pidfh *pidfile;
602 char const *config_file;
603 char const *error_str;
607 int trace_mode_enabled;
608 int force_single_threaded;
609 int do_not_daemonize;
610 int clear_user_cache_entries, clear_all_cache_entries;
611 char *user_config_entry_name, *global_config_entry_name;
613 int daemon_mode, interactive_mode;
616 /* by default all debug messages are omitted */
619 /* parsing command line arguments */
620 trace_mode_enabled = 0;
621 force_single_threaded = 0;
622 do_not_daemonize = 0;
623 clear_user_cache_entries = 0;
624 clear_all_cache_entries = 0;
626 user_config_entry_name = NULL;
627 global_config_entry_name = NULL;
628 while ((res = getopt(argc, argv, "nstdi:I:")) != -1) {
631 do_not_daemonize = 1;
634 force_single_threaded = 1;
637 trace_mode_enabled = 1;
640 clear_user_cache_entries = 1;
642 if (strcmp(optarg, "all") != 0)
643 user_config_entry_name = strdup(optarg);
646 clear_all_cache_entries = 1;
648 if (strcmp(optarg, "all") != 0)
649 global_config_entry_name =
662 daemon_mode = do_not_daemonize | force_single_threaded |
664 interactive_mode = clear_user_cache_entries | clear_all_cache_entries |
667 if ((daemon_mode != 0) && (interactive_mode != 0)) {
668 LOG_ERR_1("main", "daemon mode and interactive_mode arguments "
669 "can't be used together");
673 if (interactive_mode != 0) {
674 FILE *pidfin = fopen(DEFAULT_PIDFILE_PATH, "r");
677 struct nscd_connection_params connection_params;
678 nscd_connection connection;
683 errx(EXIT_FAILURE, "There is no daemon running.");
685 memset(pidbuf, 0, sizeof(pidbuf));
686 fread(pidbuf, sizeof(pidbuf) - 1, 1, pidfin);
689 if (ferror(pidfin) != 0)
690 errx(EXIT_FAILURE, "Can't read from pidfile.");
692 if (sscanf(pidbuf, "%d", &pid) != 1)
693 errx(EXIT_FAILURE, "Invalid pidfile.");
694 LOG_MSG_1("main", "daemon PID is %d", pid);
697 memset(&connection_params, 0,
698 sizeof(struct nscd_connection_params));
699 connection_params.socket_path = DEFAULT_SOCKET_PATH;
700 connection = open_nscd_connection__(&connection_params);
701 if (connection == INVALID_NSCD_CONNECTION)
702 errx(EXIT_FAILURE, "Can't connect to the daemon.");
704 if (clear_user_cache_entries != 0) {
705 result = nscd_transform__(connection,
706 user_config_entry_name, TT_USER);
709 "user cache transformation failed");
712 "user cache_transformation "
716 if (clear_all_cache_entries != 0) {
718 errx(EXIT_FAILURE, "Only root can initiate "
719 "global cache transformation.");
721 result = nscd_transform__(connection,
722 global_config_entry_name, TT_ALL);
725 "global cache transformation "
729 "global cache transformation "
733 close_nscd_connection__(connection);
735 free(user_config_entry_name);
736 free(global_config_entry_name);
737 return (EXIT_SUCCESS);
740 pidfile = pidfile_open(DEFAULT_PIDFILE_PATH, 0644, &pid);
741 if (pidfile == NULL) {
743 errx(EXIT_FAILURE, "Daemon already running, pid: %d.",
745 warn("Cannot open or create pidfile");
748 if (trace_mode_enabled == 1)
751 /* blocking the main thread from receiving SIGPIPE signal */
752 sigblock(sigmask(SIGPIPE));
755 if (do_not_daemonize == 0) {
756 res = daemon(0, trace_mode_enabled == 0 ? 0 : 1);
758 LOG_ERR_1("main", "can't daemonize myself: %s",
760 pidfile_remove(pidfile);
763 LOG_MSG_1("main", "successfully daemonized");
766 pidfile_write(pidfile);
768 s_agent_table = init_agent_table();
769 register_agent(s_agent_table, init_passwd_agent());
770 register_agent(s_agent_table, init_passwd_mp_agent());
771 register_agent(s_agent_table, init_group_agent());
772 register_agent(s_agent_table, init_group_mp_agent());
773 register_agent(s_agent_table, init_services_agent());
774 register_agent(s_agent_table, init_services_mp_agent());
775 LOG_MSG_1("main", "request agents registered successfully");
778 * Hosts agent can't work properly until we have access to the
779 * appropriate dtab structures, which are used in nsdispatch
782 register_agent(s_agent_table, init_hosts_agent());
785 /* configuration initialization */
786 s_configuration = init_configuration();
787 fill_configuration_defaults(s_configuration);
791 config_file = CONFIG_PATH;
793 res = parse_config_file(s_configuration, config_file, &error_str,
795 if ((res != 0) && (error_str == NULL)) {
796 config_file = DEFAULT_CONFIG_PATH;
797 res = parse_config_file(s_configuration, config_file,
798 &error_str, &error_line);
802 if (error_str != NULL) {
803 LOG_ERR_1("main", "error in configuration file(%s, %d): %s\n",
804 config_file, error_line, error_str);
806 LOG_ERR_1("main", "no configuration file found "
807 "- was looking for %s and %s",
808 CONFIG_PATH, DEFAULT_CONFIG_PATH);
810 destroy_configuration(s_configuration);
814 if (force_single_threaded == 1)
815 s_configuration->threads_num = 1;
817 /* cache initialization */
818 s_cache = init_cache_(s_configuration);
819 if (s_cache == NULL) {
820 LOG_ERR_1("main", "can't initialize the cache");
821 destroy_configuration(s_configuration);
825 /* runtime environment initialization */
826 s_runtime_env = init_runtime_env(s_configuration);
827 if (s_runtime_env == NULL) {
828 LOG_ERR_1("main", "can't initialize the runtime environment");
829 destroy_configuration(s_configuration);
830 destroy_cache_(s_cache);
834 if (s_configuration->threads_num > 1) {
835 threads = calloc(s_configuration->threads_num,
837 for (i = 0; i < s_configuration->threads_num; ++i) {
838 thread_args = malloc(
839 sizeof(*thread_args));
840 thread_args->the_cache = s_cache;
841 thread_args->the_runtime_env = s_runtime_env;
842 thread_args->the_configuration = s_configuration;
844 LOG_MSG_1("main", "thread #%d was successfully created",
846 pthread_create(&threads[i], NULL, processing_thread,
852 for (i = 0; i < s_configuration->threads_num; ++i)
853 pthread_join(threads[i], NULL);
855 LOG_MSG_1("main", "working in single-threaded mode");
856 processing_loop(s_cache, s_runtime_env, s_configuration);
860 /* runtime environment destruction */
861 destroy_runtime_env(s_runtime_env);
863 /* cache destruction */
864 destroy_cache_(s_cache);
866 /* configuration destruction */
867 destroy_configuration(s_configuration);
869 /* agents table destruction */
870 destroy_agent_table(s_agent_table);
872 pidfile_remove(pidfile);
873 return (EXIT_SUCCESS);