59 #include <sys/select.h>
60 #include <sys/types.h>
63 #include <libxml/tree.h>
64 #include <libxml/parser.h>
65 #include <libxml/xpath.h>
66 #include <libxml/xpathInternals.h>
67 #include <libxml/relaxng.h>
83 xmlDocPtr rngdoc = NULL;
84 xmlXPathContextPtr xpathCtx = NULL;
85 xmlXPathObjectPtr xpathObj = NULL;
86 xmlRelaxNGParserCtxtPtr rngpctx = NULL;
87 xmlRelaxNGValidCtxtPtr rngctx = NULL;
88 xmlRelaxNGPtr schema = NULL;
89 xmlChar *user_expr = (
unsigned char*)
"//Configuration/Enforcer/Privileges/User";
90 xmlChar *group_expr = (
unsigned char*)
"//Configuration/Enforcer/Privileges/Group";
92 char* filename = NULL;
93 char* rngfilename = OPENDNSSEC_SCHEMA_DIR
"/conf.rng";
94 char* temp_char = NULL;
104 filename =
StrStrdup(OPENDNSSEC_CONFIG_FILE);
108 doc = xmlParseFile(filename);
111 file = fopen(filename,
"r");
113 log_msg(config, LOG_ERR,
"Error: unable to open file \"%s\"", filename);
115 log_msg(config, LOG_ERR,
"Error: unable to parse file \"%s\"", filename);
122 rngdoc = xmlParseFile(rngfilename);
123 if (rngdoc == NULL) {
125 file = fopen(rngfilename,
"r");
127 log_msg(config, LOG_ERR,
"Error: unable to open file \"%s\"", rngfilename);
129 log_msg(config, LOG_ERR,
"Error: unable to parse file \"%s\"", rngfilename);
136 rngpctx = xmlRelaxNGNewDocParserCtxt(rngdoc);
137 if (rngpctx == NULL) {
138 log_msg(config, LOG_ERR,
"Error: unable to create XML RelaxNGs parser context");
143 schema = xmlRelaxNGParse(rngpctx);
144 if (schema == NULL) {
145 log_msg(config, LOG_ERR,
"Error: unable to parse a schema definition resource");
150 rngctx = xmlRelaxNGNewValidCtxt(schema);
151 if (rngctx == NULL) {
152 log_msg(config, LOG_ERR,
"Error: unable to create RelaxNGs validation context based on the schema");
156 xmlRelaxNGSetValidErrors(rngctx,
162 status = xmlRelaxNGValidateDoc(rngctx,doc);
164 log_msg(config, LOG_ERR,
"Error validating file \"%s\"", filename);
170 xpathCtx = xmlXPathNewContext(doc);
171 if(xpathCtx == NULL) {
172 log_msg(config, LOG_ERR,
"Error: unable to create new XPath context");
178 xpathObj = xmlXPathEvalExpression(group_expr, xpathCtx);
179 if(xpathObj == NULL) {
180 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", group_expr);
181 xmlXPathFreeContext(xpathCtx);
185 if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
186 temp_char = (
char*) xmlXPathCastToString(xpathObj);
189 xmlXPathFreeObject(xpathObj);
195 xpathObj = xmlXPathEvalExpression(user_expr, xpathCtx);
196 if(xpathObj == NULL) {
197 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", user_expr);
198 xmlXPathFreeContext(xpathCtx);
202 if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
203 temp_char = (
char*) xmlXPathCastToString(xpathObj);
206 xmlXPathFreeObject(xpathObj);
214 if ((pwd = getpwnam(config->
username)) == NULL) {
215 syslog(LOG_ERR,
"user '%s' does not exist. exiting...\n", config->
username);
218 config->
uid = pwd->pw_uid;
224 if ((grp = getgrnam(config->
groupname)) == NULL) {
225 syslog(LOG_ERR,
"group '%s' does not exist. exiting...\n", config->
groupname);
228 config->
gid = grp->gr_gid;
233 xmlXPathFreeContext(xpathCtx);
234 xmlRelaxNGFree(schema);
235 xmlRelaxNGFreeValidCtxt(rngctx);
236 xmlRelaxNGFreeParserCtxt(rngpctx);
245 void log_init(
int facility,
const char *program_name)
247 openlog(program_name, 0, facility);
251 void log_switch(
int facility,
const char *facility_name,
const char *program_name,
int verbose)
254 openlog(program_name, 0, facility);
256 log_msg(NULL, LOG_INFO,
"Switched log facility to: %s", facility_name);
266 if (config && config->
debug) priority = LOG_ERR;
267 va_start(args, format);
268 vsyslog(priority, format, args);
278 if (strncmp(format,
"ERROR:", 6) == 0) {
279 syslog(LOG_ERR,
"%s", format);
281 else if (strncmp(format,
"INFO:", 5) == 0) {
282 syslog(LOG_INFO,
"%s", format);
284 else if (strncmp(format,
"WARNING:", 8) == 0) {
285 syslog(LOG_WARNING,
"%s", format);
287 else if (strncmp(format,
"DEBUG:", 6) == 0) {
288 syslog(LOG_DEBUG,
"%s", format);
291 syslog(LOG_ERR,
"%s", format);
304 va_start(args, format);
305 vsyslog(LOG_ERR, format, args);
318 va_start(args, format);
319 vsyslog(LOG_INFO, format, args);
324 usage(
const char* prog)
326 fprintf(stderr,
"Usage: %s [OPTION]...\n", prog);
327 fprintf(stderr,
"OpenDNSSEC Enforcer version %s\n\n", VERSION);
328 fprintf(stderr,
"Supported options:\n");
329 fprintf(stderr,
" -c <file> Use alternate conf.xml.\n");
330 fprintf(stderr,
" -d Debug.\n");
331 fprintf(stderr,
" -1 Run once, then exit.\n");
333 fprintf(stderr,
" -P pidfile Specify the PID file to write.\n");
335 fprintf(stderr,
" -V Print version.\n");
336 fprintf(stderr,
" -[?|h] This help.\n");
342 fprintf(stderr,
"%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION);
343 fprintf(stderr,
"Written by %s.\n\n",
AUTHOR_NAME);
344 fprintf(stderr,
"%s. This is free software.\n",
COPYRIGHT_STR);
345 fprintf(stderr,
"See source files for more license information\n");
357 result = fwrite(data, 1, size, file);
360 log_msg(config, LOG_ERR,
"write failed: %s", strerror(errno));
362 }
else if (result < size) {
363 log_msg(config, LOG_ERR,
"short write (disk full?)");
371 readpid(
const char *file)
379 if ((fd = open(file, O_RDONLY)) == -1) {
382 if (((l = read(fd, pidbuf,
sizeof(pidbuf)))) == -1) {
392 pid = strtol(pidbuf, &t, 10);
394 if (*t && *t !=
'\n') {
405 struct stat stat_ret;
410 if (stat(config->
pidfile, &stat_ret) != 0) {
412 if (errno != ENOENT) {
413 log_msg(config, LOG_ERR,
"cannot stat pidfile %s: %s",
414 config->
pidfile, strerror(errno));
418 if (S_ISREG(stat_ret.st_mode)) {
420 if ((oldpid = readpid(config->
pidfile)) == -1) {
422 if (errno != ENOENT) {
423 log_msg(config, LOG_ERR,
"cannot read pidfile %s: %s",
424 config->
pidfile, strerror(errno));
427 if (kill(oldpid, 0) == 0 || errno == EPERM) {
428 log_msg(config, LOG_ERR,
"pidfile %s already exists, "
429 "a process with pid %u is already running. "
430 "If no ods-enforcerd process is running, a previous "
431 "instance didn't shutdown cleanly, please remove this "
432 "file and try again.", config->
pidfile, oldpid);
435 log_msg(config, LOG_WARNING,
"pidfile %s already exists, "
436 "but no process with pid %u is running. "
437 "A previous instance didn't shutdown cleanly, this "
438 "pidfile is stale.", config->
pidfile, oldpid);
445 snprintf(pidbuf,
sizeof(pidbuf),
"%lu\n", (
unsigned long) config->
pid);
447 if ((fd = fopen(config->
pidfile,
"w")) == NULL ) {
451 if (!
write_data(config, fd, pidbuf, strlen(pidbuf))) {
457 if (chown(config->
pidfile, config->
uid, config->
gid) == -1) {
458 log_msg(config, LOG_ERR,
"cannot chown(%u,%u) %s: %s",
459 (
unsigned) config->
uid, (
unsigned) config->
gid,
460 config->
pidfile, strerror(errno));
470 char* directory = NULL;
472 struct stat stat_ret;
473 char *path = getenv(
"PWD");
483 slash = strrchr(directory,
'/');
487 if (stat(directory, &stat_ret) != 0) {
489 if (errno != ENOENT) {
490 log_msg(config, LOG_ERR,
"cannot stat directory %s: %s",
491 directory, strerror(errno));
496 if (S_ISDIR(stat_ret.st_mode)) {
514 struct stat stat_ret;
517 slash = strrchr(parent,
'/');
521 stat(parent, &stat_ret);
523 if (!S_ISDIR(stat_ret.st_mode)) {
531 if (mkdir(path, (S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) != 0) {
532 log_msg(NULL, LOG_ERR,
"cannot create directory %s: %s\n",
533 path, strerror(errno));
538 if (chown(path, config->
uid, config->
gid) == -1) {
539 log_msg(config, LOG_ERR,
"cannot chown(%u,%u) %s: %s",
540 (
unsigned) config->
uid, (
unsigned) config->
gid,
541 path, strerror(errno));
557 while ((c = getopt(*argc, argv,
"1c:hdV?u:P:")) != -1) {
566 config->
debug =
true;
575 config->
gid = getgid();
576 config->
uid = getuid();
583 if (*t !=
'.' || !isdigit(*++t)) {
584 log_msg(config, LOG_ERR,
"-u user or -u uid or -u uid.gid. exiting...");
587 config->
gid = strtol(t, &t, 10);
590 if ((pwd = getpwuid(config->
uid)) == NULL) {
591 log_msg(config, LOG_ERR,
"user id %u does not exist. exiting...", (
unsigned) config->
uid);
594 config->
gid = pwd->pw_gid;
600 if ((pwd = getpwnam(config->
username)) == NULL) {
601 log_msg(config, LOG_ERR,
"user '%s' does not exist. exiting...", config->
username);
604 config->
uid = pwd->pw_uid;
605 config->
gid = pwd->pw_gid;
635 xmlDocPtr doc = NULL;
636 xmlDocPtr rngdoc = NULL;
637 xmlXPathContextPtr xpathCtx = NULL;
638 xmlXPathObjectPtr xpathObj = NULL;
639 xmlRelaxNGParserCtxtPtr rngpctx = NULL;
640 xmlRelaxNGValidCtxtPtr rngctx = NULL;
641 xmlRelaxNGPtr schema = NULL;
642 xmlChar *iv_expr = (
unsigned char*)
"//Configuration/Enforcer/Interval";
643 xmlChar *mk_expr = (
unsigned char*)
"//Configuration/Enforcer/ManualKeyGeneration";
644 xmlChar *rn_expr = (
unsigned char*)
"//Configuration/Enforcer/RolloverNotification";
645 xmlChar *ds_expr = (
unsigned char*)
"//Configuration/Enforcer/DelegationSignerSubmitCommand";
646 xmlChar *litexpr = (
unsigned char*)
"//Configuration/Enforcer/Datastore/SQLite";
647 xmlChar *mysql_host = (
unsigned char*)
"//Configuration/Enforcer/Datastore/MySQL/Host";
648 xmlChar *mysql_port = (
unsigned char*)
"//Configuration/Enforcer/Datastore/MySQL/Host/@port";
649 xmlChar *mysql_db = (
unsigned char*)
"//Configuration/Enforcer/Datastore/MySQL/Database";
650 xmlChar *mysql_user = (
unsigned char*)
"//Configuration/Enforcer/Datastore/MySQL/Username";
651 xmlChar *mysql_pass = (
unsigned char*)
"//Configuration/Enforcer/Datastore/MySQL/Password";
652 xmlChar *log_user_expr = (
unsigned char*)
"//Configuration/Common/Logging/Syslog/Facility";
655 char *logFacilityName;
659 char* filename = NULL;
660 char* rngfilename = OPENDNSSEC_SCHEMA_DIR
"/conf.rng";
662 char* temp_char = NULL;
670 filename =
StrStrdup(OPENDNSSEC_CONFIG_FILE);
674 log_msg(config, LOG_INFO,
"Reading config \"%s\"", filename);
678 doc = xmlParseFile(filename);
681 file = fopen(filename,
"r");
683 log_msg(config, LOG_ERR,
"Error: unable to open file \"%s\"", filename);
685 log_msg(config, LOG_ERR,
"Error: unable to parse file \"%s\"", filename);
693 log_msg(config, LOG_INFO,
"Reading config schema \"%s\"", rngfilename);
695 rngdoc = xmlParseFile(rngfilename);
696 if (rngdoc == NULL) {
698 file = fopen(rngfilename,
"r");
700 log_msg(config, LOG_ERR,
"Error: unable to open file \"%s\"", rngfilename);
702 log_msg(config, LOG_ERR,
"Error: unable to parse file \"%s\"", rngfilename);
709 rngpctx = xmlRelaxNGNewDocParserCtxt(rngdoc);
710 if (rngpctx == NULL) {
711 log_msg(config, LOG_ERR,
"Error: unable to create XML RelaxNGs parser context");
716 schema = xmlRelaxNGParse(rngpctx);
717 if (schema == NULL) {
718 log_msg(config, LOG_ERR,
"Error: unable to parse a schema definition resource");
723 rngctx = xmlRelaxNGNewValidCtxt(schema);
724 if (rngctx == NULL) {
725 log_msg(config, LOG_ERR,
"Error: unable to create RelaxNGs validation context based on the schema");
729 xmlRelaxNGSetValidErrors(rngctx,
735 status = xmlRelaxNGValidateDoc(rngctx,doc);
737 log_msg(config, LOG_ERR,
"Error validating file \"%s\"", filename);
740 xmlRelaxNGFreeValidCtxt(rngctx);
741 xmlRelaxNGFree(schema);
742 xmlRelaxNGFreeParserCtxt(rngpctx);
747 xpathCtx = xmlXPathNewContext(doc);
748 if(xpathCtx == NULL) {
749 log_msg(config, LOG_ERR,
"Error: unable to create new XPath context");
755 xpathObj = xmlXPathEvalExpression(iv_expr, xpathCtx);
756 if(xpathObj == NULL) {
757 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", iv_expr);
758 xmlXPathFreeContext(xpathCtx);
763 temp_char = (
char *)xmlXPathCastToString(xpathObj);
766 log_msg(config, LOG_ERR,
"Error: unable to convert Interval %s to seconds, error: %i", temp_char, status);
770 else if (status == -1) {
771 log_msg(config, LOG_INFO,
"Info: converting %s to seconds; M interpreted as 31 days, Y interpreted as 365 days", temp_char);
775 log_msg(config, LOG_INFO,
"Communication Interval: %i", config->
interval);
778 xmlXPathFreeObject(xpathObj);
781 xpathObj = xmlXPathEvalExpression(mk_expr, xpathCtx);
782 if(xpathObj == NULL) {
783 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", mk_expr);
784 xmlXPathFreeContext(xpathCtx);
789 if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
797 xmlXPathFreeObject(xpathObj);
800 xpathObj = xmlXPathEvalExpression(rn_expr, xpathCtx);
801 if(xpathObj == NULL) {
802 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", rn_expr);
803 xmlXPathFreeContext(xpathCtx);
808 if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
810 temp_char = (
char *)xmlXPathCastToString(xpathObj);
813 log_msg(config, LOG_ERR,
"Error: unable to convert RolloverNotification %s to seconds, error: %i", temp_char, status);
817 else if (status == -1) {
818 log_msg(config, LOG_INFO,
"Info: converting %s to seconds; M interpreted as 31 days, Y interpreted as 365 days", temp_char);
825 xmlXPathFreeObject(xpathObj);
833 xpathObj = xmlXPathEvalExpression(ds_expr, xpathCtx);
834 if(xpathObj == NULL) {
835 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", ds_expr);
836 xmlXPathFreeContext(xpathCtx);
840 if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
845 config->
DSSubmitCmd = (
char *)xmlXPathCastToString(xpathObj);
848 log_msg(config, LOG_INFO,
"Using command: %s to submit DS records", config->
DSSubmitCmd);
850 xmlXPathFreeObject(xpathObj);
853 log_msg(config, LOG_INFO,
"No DS Submit command supplied");
860 xpathObj = xmlXPathEvalExpression(litexpr, xpathCtx);
861 if(xpathObj == NULL) {
862 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", litexpr);
863 xmlXPathFreeContext(xpathCtx);
867 if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
869 if (config->
schema != NULL) {
872 config->
schema = xmlXPathCastToString(xpathObj);
874 log_msg(config, LOG_INFO,
"SQLite database set to: %s", config->
schema);
877 xmlXPathFreeObject(xpathObj);
884 xpathObj = xmlXPathEvalExpression(mysql_host, xpathCtx);
885 if(xpathObj == NULL) {
886 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", mysql_host);
887 xmlXPathFreeContext(xpathCtx);
891 if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
892 if (config->
host != NULL) {
895 config->
host = xmlXPathCastToString(xpathObj);
897 log_msg(config, LOG_INFO,
"MySQL database host set to: %s", config->
host);
900 xmlXPathFreeObject(xpathObj);
903 xpathObj = xmlXPathEvalExpression(mysql_port, xpathCtx);
904 if(xpathObj == NULL) {
905 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", mysql_port);
906 xmlXPathFreeContext(xpathCtx);
910 if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
911 if (config->
port != NULL) {
914 config->
port = xmlXPathCastToString(xpathObj);
916 log_msg(config, LOG_INFO,
"MySQL database port set to: %s", config->
port);
919 xmlXPathFreeObject(xpathObj);
922 xpathObj = xmlXPathEvalExpression(mysql_db, xpathCtx);
923 if(xpathObj == NULL) {
924 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", mysql_db);
925 xmlXPathFreeContext(xpathCtx);
929 if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
930 if (config->
schema != NULL) {
933 config->
schema = xmlXPathCastToString(xpathObj);
935 log_msg(config, LOG_INFO,
"MySQL database schema set to: %s", config->
schema);
940 xmlXPathFreeObject(xpathObj);
943 xpathObj = xmlXPathEvalExpression(mysql_user, xpathCtx);
944 if(xpathObj == NULL) {
945 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", mysql_user);
946 xmlXPathFreeContext(xpathCtx);
950 if(xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
951 if (config->
user != NULL) {
954 config->
user = xmlXPathCastToString(xpathObj);
956 log_msg(config, LOG_INFO,
"MySQL database user set to: %s", config->
user);
961 xmlXPathFreeObject(xpathObj);
964 xpathObj = xmlXPathEvalExpression(mysql_pass, xpathCtx);
965 if(xpathObj == NULL) {
966 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", mysql_pass);
967 xmlXPathFreeContext(xpathCtx);
976 config->
password = xmlXPathCastToString(xpathObj);
978 log_msg(config, LOG_INFO,
"MySQL database password set");
980 xmlXPathFreeObject(xpathObj);
986 log_msg(config, LOG_ERR,
"Error: unable to find complete database connection expression in %s", filename);
987 xmlXPathFreeContext(xpathCtx);
994 log_msg(config, LOG_ERR,
"Error: database in config file %s does not match libksm", filename);
995 xmlXPathFreeContext(xpathCtx);
1001 xpathObj = xmlXPathEvalExpression(log_user_expr, xpathCtx);
1002 if(xpathObj == NULL) {
1003 log_msg(config, LOG_ERR,
"Error: unable to evaluate xpath expression: %s", log_user_expr);
1004 xmlXPathFreeContext(xpathCtx);
1009 if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) {
1011 logFacilityName = (
char *)xmlXPathCastToString(xpathObj);
1015 log_msg(config, LOG_ERR,
"Error: unable to set log user: %s, error: %i", logFacilityName, status);
1021 log_msg(config, LOG_INFO,
"Log User set to: %s", logFacilityName);
1029 log_msg(config, LOG_INFO,
"Using default log user: %s", logFacilityName);
1033 xmlXPathFreeObject(xpathObj);
1039 xmlXPathFreeContext(xpathCtx);
1059 if (lock_fd == NULL) {
1060 log_msg(NULL, LOG_ERR,
"%s could not be opened", lock_filename);
1064 memset(&fl, 0,
sizeof(
struct flock));
1065 fl.l_type = F_WRLCK;
1066 fl.l_whence = SEEK_SET;
1067 fl.l_pid = getpid();
1069 while (fcntl(fileno(lock_fd), F_SETLK, &fl) == -1) {
1070 if (errno == EACCES || errno == EAGAIN) {
1071 log_msg(NULL, LOG_INFO,
"%s already locked, sleep", lock_filename);
1076 select(0, NULL, NULL, NULL, &tv);
1079 log_msg(NULL, LOG_INFO,
"couldn't get lock on %s, %s", lock_filename, strerror(errno));
1092 if (lock_fd == NULL) {
1096 memset(&fl, 0,
sizeof(
struct flock));
1097 fl.l_type = F_UNLCK;
1098 fl.l_whence = SEEK_SET;
1100 if (fcntl(fileno(lock_fd), F_SETLK, &fl) == -1) {
1110 char* case_username = NULL;
1112 if (username == NULL) {
1122 if (strncmp(case_username,
"USER", 4) == 0) {
1123 *usernumber = LOG_USER;
1126 else if (strncmp(case_username,
"KERN", 4) == 0) {
1127 *usernumber = LOG_KERN;
1131 else if (strncmp(case_username,
"MAIL", 4) == 0) {
1132 *usernumber = LOG_MAIL;
1136 else if (strncmp(case_username,
"DAEMON", 6) == 0) {
1137 *usernumber = LOG_DAEMON;
1141 else if (strncmp(case_username,
"AUTH", 4) == 0) {
1142 *usernumber = LOG_AUTH;
1146 else if (strncmp(case_username,
"SYSLOG", 6) == 0) {
1147 *usernumber = LOG_SYSLOG;
1151 else if (strncmp(case_username,
"LPR", 3) == 0) {
1152 *usernumber = LOG_LPR;
1156 else if (strncmp(case_username,
"NEWS", 4) == 0) {
1157 *usernumber = LOG_NEWS;
1161 else if (strncmp(case_username,
"UUCP", 4) == 0) {
1162 *usernumber = LOG_UUCP;
1166 else if (strncmp(case_username,
"AUDIT", 5) == 0) {
1167 *usernumber = LOG_AUDIT;
1171 else if (strncmp(case_username,
"CRON", 4) == 0) {
1172 *usernumber = LOG_CRON;
1175 else if (strncmp(case_username,
"LOCAL0", 6) == 0) {
1176 *usernumber = LOG_LOCAL0;
1178 else if (strncmp(case_username,
"LOCAL1", 6) == 0) {
1179 *usernumber = LOG_LOCAL1;
1181 else if (strncmp(case_username,
"LOCAL2", 6) == 0) {
1182 *usernumber = LOG_LOCAL2;
1184 else if (strncmp(case_username,
"LOCAL3", 6) == 0) {
1185 *usernumber = LOG_LOCAL3;
1187 else if (strncmp(case_username,
"LOCAL4", 6) == 0) {
1188 *usernumber = LOG_LOCAL4;
1190 else if (strncmp(case_username,
"LOCAL5", 6) == 0) {
1191 *usernumber = LOG_LOCAL5;
1193 else if (strncmp(case_username,
"LOCAL6", 6) == 0) {
1194 *usernumber = LOG_LOCAL6;
1196 else if (strncmp(case_username,
"LOCAL7", 6) == 0) {
1197 *usernumber = LOG_LOCAL7;