Index: ossp-pkg/lmtp2nntp/lmtp2nntp_config.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_config.c,v rcsdiff -q -kk '-r1.22' '-r1.23' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_config.c,v' 2>/dev/null --- lmtp2nntp_config.c 2002/01/31 13:44:05 1.22 +++ lmtp2nntp_config.c 2002/01/31 13:48:27 1.23 @@ -161,8 +161,7 @@ log1(ctx, TRACE, "--childsmax = \"%s\"", ov->data.s); if ((ctx->option_childsmax = atoi(ov->data.s)) <= 0) { - log1(ctx, ERROR, "option --childsmax, number (%d) out of range", - ctx->option_childsmax); + log1(ctx, ERROR, "option --childsmax, number (%d) out of range", ctx->option_childsmax); throw(0,0,0); } } @@ -242,13 +241,11 @@ ctx->pacl[i].prefixlen = atoi(cp); log2(ctx, DEBUG, "ctx->pacl[%d].prefixlen = %d", i, ctx->pacl[i].prefixlen); if ((rc = sa_addr_create(&(ctx->pacl[i].saa))) != SA_OK) { - log1(ctx, ERROR, "option --acl, create address (internal) failed with \"%s\"", - sa_error(rc)); + log1(ctx, ERROR, "option --acl, create address (internal) failed with \"%s\"", sa_error(rc)); throw(0,0,0); } if ((rc = sa_addr_u2a(ctx->pacl[i].saa, "inet://%s:0", ctx->pacl[i].acl)) != SA_OK) { - log2(ctx, ERROR, "option --acl, parsing address (%s) failed with \"%s\"", - ctx->pacl[i].acl, sa_error(rc)); + log2(ctx, ERROR, "option --acl, parsing address (%s) failed with \"%s\"", ctx->pacl[i].acl, sa_error(rc)); throw(0,0,0); } } @@ -268,13 +265,11 @@ /* dash means stdio */ if (strcmp(ov->data.s, "-") != 0) { //FIXME does this work with popt()? if ((rc = sa_create(&ctx->saServerbind)) != SA_OK) { - log1(ctx, ERROR, "option --bind, creating TCP socket (internal) failed with \"%s\"", - sa_error(rc)); + log1(ctx, ERROR, "option --bind, creating TCP socket (internal) failed with \"%s\"", sa_error(rc)); throw(0,0,0); } if ((rc = sa_addr_create(&ctx->saaServerbind)) != SA_OK) { - log1(ctx, ERROR, "option --bind, create address (internal) failed with \"%s\"", - sa_error(rc)); + log1(ctx, ERROR, "option --bind, create address (internal) failed with \"%s\"", sa_error(rc)); throw(0,0,0); } /* slash means UNIX socket */ @@ -304,32 +299,27 @@ nPerm = ((nPerm << 3) | n); } if (nPerm == -1 || cpPerm[i] != '\0') { - log1(ctx, ERROR, "option --bind, invalid permissions \"%s\"", - cpPerm); + log1(ctx, ERROR, "option --bind, invalid permissions \"%s\"", cpPerm); throw(0,0,0); } } if ((rc = sa_addr_u2a(ctx->saaServerbind, "unix:%s", cpPath)) != SA_OK) { - log2(ctx, ERROR, "option --bind, parsing alternate IO guessing UNIX socket (%s) failed with \"%s\"", - cpPath, sa_error(rc)); + log2(ctx, ERROR, "option --bind, parsing alternate IO guessing UNIX socket (%s) failed with \"%s\"", cpPath, sa_error(rc)); throw(0,0,0); } if ((rc = sa_bind(ctx->saServerbind, ctx->saaServerbind)) != SA_OK) { - log2(ctx, ERROR, "option --bind, bind (%s) failed with \"%s\"", - cpPath, sa_error(rc)); + log2(ctx, ERROR, "option --bind, bind (%s) failed with \"%s\"", cpPath, sa_error(rc)); throw(0,0,0); } if (nPerm != -1) { if (chmod(cpPath, nPerm) == -1) { - log3(ctx, ERROR, "option --bind, chmod (%s, 0%o) failed with \"%s\"", - cpPath, nPerm, strerror(errno)); + log3(ctx, ERROR, "option --bind, chmod (%s, 0%o) failed with \"%s\"", cpPath, nPerm, strerror(errno)); throw(0,0,0); } } if (getuid() == 0 && getuid() != ctx->option_uid) { if (chown(cpPath, ctx->option_uid, -1) == -1) { - log3(ctx, ERROR, "option --bind, chown (%s, %d) failed with \"%s\"", - cpPath, ctx->option_uid, strerror(errno)); + log3(ctx, ERROR, "option --bind, chown (%s, %d) failed with \"%s\"", cpPath, ctx->option_uid, strerror(errno)); throw(0,0,0); } } @@ -338,20 +328,17 @@ /* otherwise assume INET socket */ else { if ((rc = sa_addr_u2a(ctx->saaServerbind, "inet://%s", ov->data.s)) != SA_OK) { - log2(ctx, ERROR, "option --bind, parsing alternate IO guessing INET socket (%s) failed with \"%s\"", - ov->data.s, sa_error(rc)); + log2(ctx, ERROR, "option --bind, parsing alternate IO guessing INET socket (%s) failed with \"%s\"", ov->data.s, sa_error(rc)); throw(0,0,0); } if ((rc = sa_bind(ctx->saServerbind, ctx->saaServerbind)) != SA_OK) { - log2(ctx, ERROR, "option --bind, bind (%s) failed with \"%s\"", - ov->data.s, sa_error(rc)); + log2(ctx, ERROR, "option --bind, bind (%s) failed with \"%s\"", ov->data.s, sa_error(rc)); throw(0,0,0); } } /* for either sockets */ if ((rc = sa_listen(ctx->saServerbind, -1)) != SA_OK) { - log2(ctx, ERROR, "option --bind, listen (%s) failed with \"%s\"", - ov->data.s, sa_error(rc)); + log2(ctx, ERROR, "option --bind, listen (%s) failed with \"%s\"", ov->data.s, sa_error(rc)); throw(0,0,0); } } @@ -368,13 +355,11 @@ log1(ctx, TRACE, "--client = \"%s\"", ov->data.s); if ((rc = sa_addr_create(&ctx->saaClientbind)) != SA_OK) { - log1(ctx, ERROR, "option --client, create address (internal) failed with \"%s\"", - sa_error(rc)); + log1(ctx, ERROR, "option --client, create address (internal) failed with \"%s\"", sa_error(rc)); throw(0,0,0); } if ((rc = sa_addr_u2a(ctx->saaClientbind, "inet://%s", ov->data.s)) != SA_OK) { - log2(ctx, ERROR, "option --client, parsing alternate IO guessing INET socket (%s) failed with \"%s\"", - ov->data.s, sa_error(rc)); + log2(ctx, ERROR, "option --client, parsing alternate IO guessing INET socket (%s) failed with \"%s\"", ov->data.s, sa_error(rc)); throw(0,0,0); } } @@ -401,20 +386,16 @@ cp = str_concat(cp, ":nntp", NULL); //FIXME is this a config var/val? else cp = str_concat(cp, NULL); /* prepare for free() */ - log1(ctx, DEBUG, "cp = \"%s\"", cp); if ((rc = sa_addr_create(&ctx->ns[i].saa)) != SA_OK) { - log1(ctx, ERROR, "option --destination, create address (internal) failed with \"%s\"", - sa_error(rc)); + log1(ctx, ERROR, "option --destination, create address (internal) failed with \"%s\"", sa_error(rc)); throw(0,0,0); } if ((rc = sa_addr_u2a(ctx->ns[i].saa, "inet://%s", cp)) != SA_OK) { - log2(ctx, ERROR, "option --destination, parsing host address (%s) failed with \"%s\"", - cp /*FIXME again, option vs. config */, sa_error(rc)); + log2(ctx, ERROR, "option --destination, parsing host address (%s) failed with \"%s\"", cp /*FIXME again, option vs. config */, sa_error(rc)); throw(0,0,0); } if ((rc = sa_create(&ctx->ns[i].sa)) != SA_OK) { - log2(ctx, ERROR, "option --destination, creating TCP socket (%s) failed with \"%s\"", - cp /*FIXME again, option vs. config */, sa_error(rc)); + log2(ctx, ERROR, "option --destination, creating TCP socket (%s) failed with \"%s\"", cp /*FIXME again, option vs. config */, sa_error(rc)); throw(0,0,0); } free(cp);