Changeset 270fd23 in code
- Timestamp:
- Mar 7, 2014, 3:20:42 PM (11 years ago)
- Branches:
- master
- Children:
- a2fadb4
- Parents:
- a6b8c8d
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
icbd.8
ra6b8c8d r270fd23 78 78 Specifies a moderator table that can be used to restrict users who 79 79 can be granted with moderation of any group. 80 The 80 81 .Ar modtab 81 82 file contains one nick per line; empty lines and lines starting with 82 83 a hash symbol are ignored. 84 The 85 .Ar modtab 86 file is inside the chroot. 87 The 88 .Ar modtab 89 file is read at startup and whenever a hangup signal is received. 83 90 .It Fl n 84 91 Disable DNS resolver. -
icbd.c
ra6b8c8d r270fd23 44 44 45 45 uint64_t sessionid; 46 char modtabpath[MAXPATHLEN]; 46 47 char modtab[ICB_MTABLEN][ICB_MAXNICKLEN]; 47 48 int modtabcnt; … … 66 67 void icbd_restrict(void); 67 68 void icbd_write(struct icb_session *, char *, ssize_t); 69 void icbd_signal(int); 68 70 69 71 static inline int icbd_session_cmp(struct icb_session *, struct icb_session *); … … 80 82 main(int argc, char *argv[]) 81 83 { 84 struct event ev_sig; 82 85 struct icbd_callbacks ic = { icbd_drop, icbd_log, icbd_write }; 83 86 const char *cause = NULL; … … 112 115 break; 113 116 case 'M': 114 icbd_modtab(optarg);117 strlcpy(modtabpath, optarg, sizeof modtabpath); 115 118 break; 116 119 case 'n': … … 236 239 237 240 (void)signal(SIGPIPE, SIG_IGN); 241 if (strlen(modtabpath) > 0) { 242 icbd_modtab(modtabpath); 243 signal_set(&ev_sig, SIGHUP, 244 (void (*)(int, short, void *))icbd_signal, NULL); 245 signal_add(&ev_sig, NULL); 246 } 238 247 239 248 (void)event_dispatch(); … … 561 570 } 562 571 572 void 573 icbd_signal(int sig) 574 { 575 switch (sig) { 576 case SIGHUP: 577 if (strlen(modtabpath) > 0) 578 icbd_modtab(modtabpath); 579 break; 580 default: 581 syslog(LOG_WARNING, "unexpected signal %d", sig); 582 break; 583 } 584 } 585 563 586 time_t 564 587 getmonotime(void)
Note:
See TracChangeset
for help on using the changeset viewer.