Lines Matching defs:smbd

59 #include "smbd.h"
108 smbd_t smbd;
124 smbd.s_pname = basename(argv[0]);
125 openlog(smbd.s_pname, LOG_PID | LOG_NOWAIT, LOG_DAEMON);
130 if ((uid = getuid()) != smbd.s_uid) {
181 if (smbd.s_fg) {
209 while (!smbd.s_shutting_down) {
210 if (smbd.s_sigval == 0 && smbd.s_refreshes == 0)
213 sigval = atomic_swap_uint(&smbd.s_sigval, 0);
234 smbd.s_shutting_down = B_TRUE;
241 return ((smbd.s_fatal_error) ? SMF_EXIT_ERR_FATAL : SMF_EXIT_OK);
262 rc = smb_init_daemon_priv(PU_RESETGROUPS, smbd.s_uid, smbd.s_gid);
287 openlog(smbd.s_pname, LOG_PID | LOG_NOWAIT, LOG_DAEMON);
312 openlog(smbd.s_pname, LOG_PID | LOG_NOWAIT, LOG_DAEMON);
324 * __init_daemon_priv() since we want smbd to have all privileges so that it
387 * Most privileges, except the ones that are required for smbd, are turn off
412 /* list of privileges for smbd */
451 smbd.s_pid = getpid();
472 smbd.s_loghd = smb_log_create(SMBD_LOGSIZE, SMBD_LOGNAME);
490 smbd.s_secmode = smb_config_get_secmode();
491 if ((rc = smb_domain_init(smbd.s_secmode)) != 0) {
510 smbd.s_door_srv = smbd_door_start();
511 smbd.s_door_opipe = smbd_opipe_start();
512 if (smbd.s_door_srv < 0 || smbd.s_door_opipe < 0) {
534 smbd.s_door_lmshr = smbd_share_start();
535 if (smbd.s_door_lmshr < 0)
546 smbd.s_initialized = B_TRUE;
554 * Shutdown smbd and smbsrv kernel services.
568 while (!smbd.s_initialized)
577 smbd.s_shutting_down = B_TRUE;
598 smbd.s_initialized = B_FALSE;
601 exit((smbd.s_fatal_error) ? SMF_EXIT_ERR_FATAL : SMF_EXIT_OK);
626 rc = pthread_create(&smbd.s_refresh_tid, &tattr, smbd_refresh_monitor,
644 if ((pthread_self() != smbd.s_refresh_tid) &&
645 (smbd.s_refresh_tid != 0)) {
646 (void) pthread_cancel(smbd.s_refresh_tid);
653 * Wait for refresh events. When woken up, update the smbd configuration
664 while (!smbd.s_shutting_down) {
668 while ((atomic_swap_uint(&smbd.s_refreshes, 0) == 0) &&
669 (!smbd.s_shutting_down))
673 if (smbd.s_shutting_down) {
702 smbd.s_refresh_tid = 0;
713 smbd.s_secmode = secmode;
730 return (smbd.s_initialized && !smbd.s_shutting_down);
745 smb_log(smbd.s_loghd, LOG_DEBUG, "%s: online", text);
752 * in target), we assume that another smbd is already running. If there
790 if (smbd.s_kbound) {
807 smbd.s_kbound = B_TRUE;
830 rc = smb_kmod_start(smbd.s_door_opipe, smbd.s_door_lmshr,
831 smbd.s_door_srv);
848 smbd.s_kbound = B_FALSE;
906 rc = pthread_create(&smbd.s_localtime_tid, &attr,
935 if ((last_gmtoff != gmtoff) && smbd.s_kbound) {
981 if (smbd.s_sigval == 0)
982 (void) atomic_swap_uint(&smbd.s_sigval, sigval);
985 atomic_inc_uint(&smbd.s_refreshes);
990 smbd.s_shutting_down = B_TRUE;
1010 smbd.s_uid = pwd->pw_uid;
1013 smbd.s_gid = grp->gr_gid;
1015 smbd.s_fg = smb_config_get_fg_flag();
1020 smbd.s_fg = 1;
1043 (void) fprintf(fp, "Usage: %s [-f]\n", smbd.s_pname);
1062 (void) fprintf(stderr, "smbd: %s\n", buf);