X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=radsecproxy.c;h=2276d40b92b8e1f5cfe8d1b4d56ec8b048ae56b3;hb=09d1cff2418a900b587b2113f508984f2417cc11;hp=f65bc070033832d754f9f5e5fe4a6b428da43fee;hpb=17f018e2cfc08146f427b82740c686f4a5024272;p=radsecproxy.git diff --git a/radsecproxy.c b/radsecproxy.c index f65bc07..2276d40 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1634,21 +1634,31 @@ void replyh(struct server *server, unsigned char *buf) { replymsg = radattr2ascii(radmsg_gettype(msg, RAD_Attr_Reply_Message)); if (stationid) { if (replymsg) { - debug(DBG_WARN, "%s for user %s stationid %s from %s (%s) to %s (%s)", - radmsgtype2string(msg->code), username, stationid, server->conf->name, replymsg, from->conf->name, addr2string(from->addr)); + debug(DBG_NOTICE, + "%s for user %s stationid %s from %s (%s) to %s (%s)", + radmsgtype2string(msg->code), username, stationid, + server->conf->name, replymsg, from->conf->name, + addr2string(from->addr)); free(replymsg); } else - debug(DBG_WARN, "%s for user %s stationid %s from %s to %s (%s)", - radmsgtype2string(msg->code), username, stationid, server->conf->name, from->conf->name, addr2string(from->addr)); + debug(DBG_NOTICE, + "%s for user %s stationid %s from %s to %s (%s)", + radmsgtype2string(msg->code), username, stationid, + server->conf->name, from->conf->name, + addr2string(from->addr)); free(stationid); } else { if (replymsg) { - debug(DBG_WARN, "%s for user %s from %s (%s) to %s (%s)", - radmsgtype2string(msg->code), username, server->conf->name, replymsg, from->conf->name, addr2string(from->addr)); + debug(DBG_NOTICE, "%s for user %s from %s (%s) to %s (%s)", + radmsgtype2string(msg->code), username, + server->conf->name, replymsg, from->conf->name, + addr2string(from->addr)); free(replymsg); } else - debug(DBG_WARN, "%s for user %s from %s to %s (%s)", - radmsgtype2string(msg->code), username, server->conf->name, from->conf->name, addr2string(from->addr)); + debug(DBG_NOTICE, "%s for user %s from %s to %s (%s)", + radmsgtype2string(msg->code), username, + server->conf->name, from->conf->name, + addr2string(from->addr)); } free(username); } @@ -3051,8 +3061,8 @@ void getmainconfig(const char *configfile) { debugx(1, DBG_ERR, "configuration error"); if (loglevel != LONG_MIN) { - if (loglevel < 1 || loglevel > 4) - debugx(1, DBG_ERR, "error in %s, value of option LogLevel is %d, must be 1, 2, 3 or 4", configfile, loglevel); + if (loglevel < 1 || loglevel > 5) + debugx(1, DBG_ERR, "error in %s, value of option LogLevel is %d, must be 1, 2, 3, 4 or 5", configfile, loglevel); options.loglevel = (uint8_t)loglevel; } if (addttl != LONG_MIN) { @@ -3077,8 +3087,8 @@ void getargs(int argc, char **argv, uint8_t *foreground, uint8_t *pretend, uint8 *configfile = optarg; break; case 'd': - if (strlen(optarg) != 1 || *optarg < '1' || *optarg > '4') - debugx(1, DBG_ERR, "Debug level must be 1, 2, 3 or 4, not %s", optarg); + if (strlen(optarg) != 1 || *optarg < '1' || *optarg > '5') + debugx(1, DBG_ERR, "Debug level must be 1, 2, 3, 4 or 5, not %s", optarg); *loglevel = *optarg - '0'; break; case 'f': @@ -3091,7 +3101,7 @@ void getargs(int argc, char **argv, uint8_t *foreground, uint8_t *pretend, uint8 *pretend = 1; break; case 'v': - debug(DBG_ERR, "radsecproxy revision $Rev$"); + debug(DBG_ERR, "radsecproxy revision %s", PACKAGE_VERSION); debug(DBG_ERR, "This binary was built with support for the following transports:"); #ifdef RADPROT_UDP debug(DBG_ERR, " UDP"); @@ -3161,10 +3171,10 @@ void *sighandler(void *arg) { } int createpidfile(const char *pidfile) { - int r; + int r = 0; FILE *f = fopen(pidfile, "w"); if (f) - r = fprintf(f, "%d\n", getpid()); + r = fprintf(f, "%ld\n", (long) getpid()); return f && !fclose(f) && r >= 0; } @@ -3210,7 +3220,7 @@ int main(int argc, char **argv) { debugx(1, DBG_ERR, "daemon() failed: %s", strerror(errno)); debug_timestamp_on(); - debug(DBG_INFO, "radsecproxy revision $Rev$ starting"); + debug(DBG_INFO, "radsecproxy revision %s starting", PACKAGE_VERSION); if (pidfile && !createpidfile(pidfile)) debugx(1, DBG_ERR, "failed to create pidfile %s: %s", pidfile, strerror(errno));