You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(34) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
(1) |
Mar
(4) |
Apr
(31) |
May
(15) |
Jun
(33) |
Jul
(3) |
Aug
(7) |
Sep
(2) |
Oct
(7) |
Nov
(2) |
Dec
|
2005 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fr...@us...> - 2003-10-31 15:20:56
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1:/tmp/cvs-serv379 Modified Files: configure configure.in Log Message: correct checking for default access method in configure Index: configure =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- configure 30 Oct 2003 11:45:17 -0000 1.5 +++ configure 31 Oct 2003 15:20:53 -0000 1.6 @@ -3852,13 +3852,8 @@ DEFAULT_ACCESS="" fi; if test x$DEFAULT_ACCESS = x; then - if test $CLASSIC = yes; then - DEFAULT_ACCESS=files - IP_COMMENT=" (default for classic mode)" - else - DEFAULT_ACCESS=postg - IP_COMMENT=" (postgresql database will be used)" - fi + DEFAULT_ACCESS=files + IP_COMMENT=" (default)" else IP_COMMENT=" (set by user)" fi Index: configure.in =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- configure.in 30 Oct 2003 11:45:17 -0000 1.5 +++ configure.in 31 Oct 2003 15:20:53 -0000 1.6 @@ -252,13 +252,8 @@ system.], DEFAULT_ACCESS=$enableval,DEFAULT_ACCESS="") if test x$DEFAULT_ACCESS = x; then - if test $CLASSIC = yes; then - DEFAULT_ACCESS=files - IP_COMMENT=" (default for classic mode)" - else - DEFAULT_ACCESS=postg - IP_COMMENT=" (postgresql database will be used)" - fi + DEFAULT_ACCESS=files + IP_COMMENT=" (default)" else IP_COMMENT=" (set by user)" fi |
From: <kai...@us...> - 2003-10-31 08:06:10
|
Update of /cvsroot/ipac-ng/ipac-ng/access/postgre In directory sc8-pr-cvs1:/tmp/cvs-serv26184/access/postgre Removed Files: postgre.c Log Message: removing 'postgre' access method. --- postgre.c DELETED --- |
From: <kai...@us...> - 2003-10-31 08:04:06
|
Update of /cvsroot/ipac-ng/ipac-ng/access/postgre In directory sc8-pr-cvs1:/tmp/cvs-serv25880/access/postgre Removed Files: Makefile.in Log Message: Removed Files: access/postgre/Makefile.in --- Makefile.in DELETED --- |
From: <kai...@us...> - 2003-10-31 07:29:10
|
Update of /cvsroot/ipac-ng/ipac-ng/agents/iptables In directory sc8-pr-cvs1:/tmp/cvs-serv20531/agents/iptables Modified Files: iptables.c Log Message: removing nonclassic mode - part2 Index: iptables.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/agents/iptables/iptables.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- iptables.c 3 Oct 2003 10:54:08 -0000 1.3 +++ iptables.c 31 Oct 2003 07:29:06 -0000 1.4 @@ -3,7 +3,7 @@ * $Id$ * * postgresql backend to ipac - * Copyright (C) 2001-2002 Al Zaharov + * Copyright (C) 2001-2003 Al Zakharov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -223,28 +223,18 @@ extern void register_match(struct iptables_match *me); extern void register_target(struct iptables_target *me); -static int clear_runfile(char *serv_name, int greedy); - /* plain file ipac interface entries */ int iptables_ipac_init(int flag); int iptables_ipac_set(rule_type **firstrule, int first); int iptables_ipac_read(rule_type **firstrule); -int iptables_ipac_deny(char *login); -int iptables_ipac_accept(char *login); int iptables_ipac_check(void); -int iptables_ipac_remove_user(char *login); -int iptables_ipac_alarm(); static const acc_agent_t interface_entry = { "iptables", iptables_ipac_init, iptables_ipac_set, iptables_ipac_read, - iptables_ipac_deny, - iptables_ipac_accept, iptables_ipac_check, - iptables_ipac_remove_user, - iptables_ipac_alarm, }; const acc_agent_t *ipac_ag_interface_iptables() { @@ -1543,6 +1533,7 @@ return (1); } +/* if ((!is_classic)) { if (!iptc_is_chain("ipac~c_fi", handle)) if (!iptc_create_chain("ipac~c_fi", &handle)) { @@ -1569,6 +1560,7 @@ return (1); } } +*/ return 0; }; @@ -1597,7 +1589,7 @@ fprintf(stderr, "iptables: %s\n", iptc_strerror(errno)); return (1); } - +/* if (!is_classic) { if (iptc_is_chain("ipac~c_fi", handle)) if (!iptc_flush_entries("ipac~c_fi", &handle)) { @@ -1624,6 +1616,7 @@ return (1); } } +*/ // Try to flush our old chains if (access_agent->get_raw_list("iptables", "", &d)) { fprintf(stderr, "access error\n"); @@ -1674,33 +1667,6 @@ return 0; }; -/* - * setup auth host - open access to AUTH_SERVER for all clients - */ -static int -setup_auth_host() -{ - user_list *list; - raw_rule_type d; - bzero((void *) &d, sizeof(raw_rule_type)); - - access_agent->get_user_list(&list); - while(list) { - if (strncmp(list->login, "admin", 5)) { - strcpy(d.dest, "ipac~c_fo"); strcpy(d.snet, authhost); - strcpy(d.dnet, list->ip); strcpy(d.policy, "RETURN"); - if (insert_rule(&d, 0)) - return (1); - strcpy(d.dest, "ipac~c_fi"); strcpy(d.snet, list->ip); - strcpy(d.dnet, authhost); - if (insert_rule(&d, 0)) - return (1); - } - list=list->next; - } - return 0; -} - static int setup_rules(void) { @@ -1723,11 +1689,7 @@ d1 = d; while(d) { /* Trying to implement hierarchic rules */ - if (is_classic) - strcpy(targ, ""); - else - strcpy(targ, d->policy); - + strcpy(targ, ""); strcpy(chain, d->dest); // %-) /* Are we dealing with new chain? if so create it */ @@ -1739,7 +1701,6 @@ return 1; } strcpy(targ, d->name+8); -// strcpy(d->policy, d->name+8); iptc_create_chain(targ, &handle); if (is_classic) fprintf(frunfile, "%s|%%\n", chain); @@ -1766,8 +1727,6 @@ !strncmp(chain, "admin", 5) || ((strlen(d->name)>3) && !memcmp(d->name+strlen(d->name)-3, "~st", 3))) -// append_rule(chain, d->snet, d->sport, d->dnet, d->dport, -// d->protocol, targ, d->iface); strcpy(d->dest, chain); append_rule(d); d=d->next; @@ -1802,70 +1761,28 @@ if (ref!=0) { strcpy(d.dest, "OUTPUT"); strcpy(d.snet, "0/0"); strcpy(d.dnet, "0/0"); strcpy(d.policy, "ipac~i"); -// delete_rule("OUTPUT", "0/0", "", "0/0", "", "", "ipac~i", ""); delete_rule(&d); strcpy(d.dest, "FORWARD"); strcpy(d.policy, "ipac~fi"); -// delete_rule("FORWARD", "0/0", "", "0/0", "", "", "ipac~fi", ""); delete_rule(&d); } iptc_get_references(&ref, "ipac~fo", &handle); if ((ref!=0) && (first==1)) { strcpy(d.dest, "INPUT"); strcpy(d.snet, "0/0"); strcpy(d.dnet, "0/0"); strcpy(d.policy, "ipac~o"); -// delete_rule("INPUT", "0/0", "", "0/0", "", "", "ipac~o", ""); delete_rule(&d); strcpy(d.dest, "FORWARD"); strcpy(d.policy, "ipac~fo"); -// delete_rule("FORWARD", "0/0", "", "0/0", "", "", "ipac~fo", ""); delete_rule(&d); } strcpy(d.dest, "OUTPUT"); strcpy(d.snet, "0/0"); strcpy(d.dnet, "0/0"); strcpy(d.policy, "ipac~i"); -// insert_rule("OUTPUT", "0/0", "", "0/0", "", "", "ipac~i", 0, ""); insert_rule(&d, 0); strcpy(d.dest, "INPUT"); strcpy(d.policy, "ipac~o"); -// insert_rule("INPUT", "0/0", "", "0/0", "", "", "ipac~o", 0, ""); insert_rule(&d, 0); strcpy(d.dest, "FORWARD"); strcpy(d.policy, "ipac~fo"); -// insert_rule("FORWARD", "0/0", "", "0/0", "", "", "ipac~fo", 0, ""); insert_rule(&d, 0); strcpy(d.dest, "FORWARD"); strcpy(d.policy, "ipac~fi"); -// insert_rule("FORWARD", "0/0", "", "0/0", "", "", "ipac~fi", 0, ""); insert_rule(&d, 0); - if (!is_classic) { - iptc_get_references(&ref, "ipac~c_fi", &handle); - if (ref!=0) { - strcpy(d.dest, "OUTPUT"); strcpy(d.policy, "ipac~c_i"); -// delete_rule("OUTPUT", "", "", "", "", "", "ipac~c_i", ""); - delete_rule(&d); - strcpy(d.dest, "FORWARD"); strcpy(d.policy, "ipac~c_fi"); -// delete_rule("FORWARD", "", "", "", "", "", "ipac~c_fi", ""); - delete_rule(&d); - } - iptc_get_references(&ref, "ipac~c_fo", &handle); - if (ref!=0) { - strcpy(d.dest, "INPUT"); strcpy(d.policy, "ipac~c_o"); -// delete_rule("INPUT", "", "", "", "", "", "ipac~c_o", ""); - delete_rule(&d); - strcpy(d.dest, "FORWARD"); strcpy(d.policy, "ipac~c_fo"); -// delete_rule("FORWARD", "", "", "", "", "", "ipac~c_fo", ""); - delete_rule(&d); - } - strcpy(d.dest, "OUTPUT"); strcpy(d.policy, "ipac~c_i"); -// insert_rule("OUTPUT", "", "", "", "", "", "ipac~c_i", 0, ""); - insert_rule(&d, 0); - strcpy(d.dest, "INPUT"); strcpy(d.policy, "ipac~c_o"); -// insert_rule("INPUT", "", "", "", "", "", "ipac~c_o", 0, ""); - insert_rule(&d, 0); - strcpy(d.dest, "FORWARD"); strcpy(d.policy, "ipac~c_fi"); -// insert_rule("FORWARD", "", "", "", "", "", "ipac~c_fi", 0, ""); - insert_rule(&d, 0); - strcpy(d.dest, "FORWARD"); strcpy(d.policy, "ipac~c_fo"); -// insert_rule("FORWARD", "", "", "", "", "", "ipac~c_fo", 0, ""); - insert_rule(&d, 0); - } } - if (!is_classic && authhost!=NULL && strlen(authhost)>2) - setup_auth_host(); iptc_commit(&handle); iptables_ipac_init(0); return 0; @@ -1883,392 +1800,6 @@ return read_iptables(runfile, firstrule); } -/* - * Accept packets to/from host with login name - */ -int -iptables_ipac_accept(char *login) -{ - int logged_in=0; - unsigned int tci=-1,tco=-1,tcfi=-1,tcfo=-1; - char *name; - FILE *frunfile; - char n[MAX_RULE_NAME_LENGTH+10]; - char n1[MAX_RULE_NAME_LENGTH+10]; - char serv_name[MAX_RULE_NAME_LENGTH+10]; - raw_rule_type *d; - raw_rule_type dt; - bzero((void *)&dt, sizeof(raw_rule_type)); - - strcpy(serv_name, login); - name = strsep(&login, " "); - while(strsep(&login, " ")); - - iptables_ipac_init(0); - access_agent->get_raw_list("iptables", name, &d); - - - strcpy(n, name); strcat(n, "~c_i"); - - strcpy(dt.dest, n); -// if (insert_rule(n, "", "", "", "", "", "", 2, "")) { - if (insert_rule(d, 2)) { - logged_in = 1; - delete_num_rule(n, 2); - } - - while(d && !memcmp(d->name, "%chain%", 7)) d = d->next; // skip chains - - strcpy(n, name); strcat(n, " "); - strcpy(n1, name); strcat(n1, "~st"); - - if (!logged_in) { - while(lock(LOCKFILE)); - frunfile = fopen(RUNFILE, "a"); - if (!frunfile) { - fprintf(stderr, "%s: opening runfile \"%s\": %s\n", - me, RUNFILE, strerror(errno)); - return 1; - } - clear_runfile(name, 1); - while (d) { - if ((!strncmp(d->name, n, strlen(n))) || - (!strcmp(d->name, n1))) { - if (!(((strlen(d->dest)>4) && - (!memcmp(d->dest+strlen(d->dest)-4, "~c", 2))) || - ((strlen(d->dest)>5) && - (!memcmp(d->dest+strlen(d->dest)-5, "~c", 2))))) { -// append_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "RETURN", d->iface); - strcpy(d->policy, "RETURN"); - append_rule(d); - } else { -// append_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "DROP", d->iface); - strcpy(d->policy, "DROP"); - append_rule(d); - } - if (((!strncmp(d->dest+strlen(d->dest)-2, "~i", 2)) || - (!strncmp(d->dest+strlen(d->dest)-2, "~o", 2)) || - (!strncmp(d->dest+strlen(d->dest)-3, "~fi", 3)) || - (!strncmp(d->dest+strlen(d->dest)-3, "~fo", 3))) && - (strncmp(d->name+strlen(d->name)-3, "~st", 3))) { - fprintf(frunfile, "%s|%s\n", d->dest, d->name); - } - } - d=d->next; - } - // delete old stopper - strcpy(n1, name); strcat(n1, "~c_fi"); delete_num_rule(n1, 0); - strcpy(n1, name); strcat(n1, "~c_fo"); delete_num_rule(n1, 0); - strcpy(n1, name); strcat(n1, "~c_i"); delete_num_rule(n1, 0); - strcpy(n1, name); strcat(n1, "~c_o"); delete_num_rule(n1, 0); - access_agent->get_raw_list("iptables", name, &d); - while(d && !memcmp(d->name, "%chain%", 7)) d = d->next; - fclose(frunfile); - unlock(LOCKFILE); - } - - while(d) { - if (!strncmp(d->dest+strlen(d->dest)-4, "~c_i", 4)) - tci++; - if (!strncmp(d->dest+strlen(d->dest)-4, "~c_o", 4)) - tco++; - if (!strncmp(d->dest+strlen(d->dest)-5, "~c_fi", 5)) - tcfi++; - if (!strncmp(d->dest+strlen(d->dest)-5, "~c_fo", 5)) - tcfo++; - if (!strcmp(d->name, serv_name)) { - strcpy(d->policy, "RETURN"); - if (!strncmp(d->dest+strlen(d->dest)-4, "~c_i", 4)) { -// replace_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "RETURN", tci, d->iface); - replace_rule(d, tci); - } else if (!strncmp(d->dest+strlen(d->dest)-4, "~c_o", 4)) { -// replace_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "RETURN", tco, d->iface); - replace_rule(d, tco); - } else if (!strncmp(d->dest+strlen(d->dest)-5, "~c_fi", 5)) { -// replace_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "RETURN", tcfi, d->iface); - replace_rule(d, tcfi); - } else if (!strncmp(d->dest+strlen(d->dest)-5, "~c_fo", 5)) { -// replace_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "RETURN", tcfo, d->iface); - replace_rule(d, tcfo); - } - } - d=d->next; - } - iptc_commit(&handle); - iptables_ipac_init(0); - return 0; -} - -static int -clear_runfile(char *serv_name, int greedy) -{ - FILE *frunfile; - char runfile_line[MAX_RULE_NAME_LENGTH + 50], *cp; - struct runfile_line_type *result, *lastline, *cur; - int tmp; - - frunfile=fopen(RUNFILE, "r"); - if (!frunfile) { - fprintf(stderr, "%s: opening runfile \"%s\": %s\n", - me, RUNFILE, strerror(errno)); - return 1; - } - result = NULL; lastline = NULL; - - while(fgets(runfile_line, MAX_RULE_NAME_LENGTH+50, frunfile) != NULL) { - tmp++; - cp = strchr(runfile_line, '\n'); - if (cp) - *cp = '\0'; - if (*runfile_line == '#') - continue; - cur = (struct runfile_line_type *) - xmalloc(sizeof(struct runfile_line_type)); - cur->line = xstrdup(runfile_line); - cur->next = NULL; - if (result == NULL) - result = cur; - else - lastline->next = cur; - lastline = cur; - } - if (!feof(frunfile)) { - fprintf(stderr, "%s: reading \"%s\": %s\n", - me, RUNFILE, strerror(errno)); - fclose(frunfile); - destroy_runfile_lines(result); - result = NULL; - return 1; - } - fclose(frunfile); - frunfile=fopen(RUNFILE, "w"); - if (!frunfile) { - fprintf(stderr, "%s: opening runfile \"%s\": %s\n", - me, RUNFILE, strerror(errno)); - return 1; - } - for (cur=result; cur!=NULL; cur=cur->next) { - cp = strchr(cur->line, '|'); - if (cp == 0) - continue; - if (strcmp(cp+1, serv_name)) { - if (greedy) { - if (strncmp(cp+1, serv_name, strlen(serv_name))) - fprintf(frunfile, "%s\n", cur->line); - } else - fprintf(frunfile, "%s\n", cur->line); - } - } - fclose(frunfile); - destroy_runfile_lines(result); - return 0; -} - -/* - * Deny packet crossing to/from user login - * Warning: there are 2 possible cases: - * a) login=user_name - * in this case we have to close all services - * b) login="user_name - service_name" - * in such case we only need to close that service - * there may be some traffic on the counters for this user. drop this info to spool - */ -int -iptables_ipac_deny(char *login) -{ - raw_rule_type *d, *d1; - int tci=-1,tco=-1,tcfi=-1,tcfo=-1, tmp=0; - char *name; - char n[MAX_RULE_NAME_LENGTH+10]; - char n1[MAX_RULE_NAME_LENGTH+10]; - char serv_name[MAX_RULE_NAME_LENGTH+10]; - timestamp_t t; - FILE *spool; - rule_type *rule = NULL, *lastrule = NULL, *firstrule = NULL, *rule1; - void *ruletree = NULL; - void *node; - struct ipt_counters *counters = NULL; - - strcpy(serv_name, login); - name = strsep(&login, " "); - while(strsep(&login, " ")); - - iptables_ipac_init(0); - access_agent->get_raw_list("iptables", name, &d); - - while(d && !memcmp(d->name, "%chain%", 7)) d = d->next; // skip chains - - d1 = d; - - // entirely delete - if (!strcmp(serv_name, name)) { - while(lock(LOCKFILE)); - while(d) { - if (!(((!strncmp(d->dest+strlen(d->dest)-2, "~i", 2)) || - (!strncmp(d->dest+strlen(d->dest)-2, "~o", 2)) || - (!strncmp(d->dest+strlen(d->dest)-3, "~fi", 3)) || - (!strncmp(d->dest+strlen(d->dest)-3, "~fo", 3))) && - (strncmp(d->name+strlen(d->name)-3, "~st", 3)))) { - d = d->next; - continue; - } - - if (!strncmp(d->dest+strlen(d->dest)-2, "~i", 2)) { - tci++; - counters = iptc_read_counter(d->dest, tci, &handle); - if (!iptc_zero_counter(d->dest, tci, &handle)) - fprintf(stderr, "iptables: %s\n", iptc_strerror(errno)); - } - if (!strncmp(d->dest+strlen(d->dest)-2, "~o", 2)) { - tco++; - counters = iptc_read_counter(d->dest, tco, &handle); - if (!iptc_zero_counter(d->dest, tco, &handle)) - fprintf(stderr, "iptables: %s\n", iptc_strerror(errno)); - } - if (!strncmp(d->dest+strlen(d->dest)-3, "~fi", 3)) { - tcfi++; - counters = iptc_read_counter(d->dest, tcfi, &handle); - if (!iptc_zero_counter(d->dest, tcfi, &handle)) - fprintf(stderr, "iptables: %s\n", iptc_strerror(errno)); - } - if (!strncmp(d->dest+strlen(d->dest)-3, "~fo", 3)) { - tcfo++; - counters = iptc_read_counter(d->dest, tcfo, &handle); - if (!iptc_zero_counter(d->dest, tcfo, &handle)) - fprintf(stderr, "iptables: %s\n", iptc_strerror(errno)); - } - rule = new_rule(); - strcpy(rule->name, d->name); - /* use a binary tree to find rules with same name */ - node = tsearch(rule, &ruletree, rule_compare); - if (*(rule_type **)node != rule) { - free(rule); - rule=*(rule_type **)node; - } else { - if (lastrule != NULL) - lastrule->next = rule; - lastrule = rule; - if (firstrule == NULL) - firstrule = rule; - } - rule->pkts += counters->pcnt; - rule->bytes += counters->bcnt; - d=d->next; - } - rule = firstrule; - rule1 = firstrule; - while(rule) { - if (rule->pkts == 0) { - if (rule == firstrule) { - firstrule = rule->next; - rule1 = rule->next; - } else - rule1->next = rule->next; - free(rule); - rule = rule->next; - } else { - rule1 = rule; - rule = rule->next; - tmp++; - } - } - - if (tmp>0) { - spool=fopen(spoolfile, "a"); - if (spool == NULL) { - fprintf(stderr, "cant open spool file '%s' for append " - "some traffic may be lost.\n%s\n", spoolfile, strerror(errno)); - exit (1); - } - - time(&t); - fprintf(spool, "BILL\n%lu 1\n", t); - fprintf(spool, "( %s\n", hostname); - - rule = firstrule; - while(rule) { - fprintf(spool, "%llu %llu |%s|\n", rule->bytes, rule->pkts, rule->name); - rule = rule->next; - } - fprintf(spool, ")\n\n"); - fclose(spool); - } - free_tree(&ruletree); - d = d1; - - strcpy(n1, name); strcat(n1, "~i"); iptc_flush_entries(n1, &handle); - strcpy(n1, name); strcat(n1, "~o"); iptc_flush_entries(n1, &handle); - strcpy(n1, name); strcat(n1, "~fi"); iptc_flush_entries(n1, &handle); - strcpy(n1, name); strcat(n1, "~fo"); iptc_flush_entries(n1, &handle); - strcpy(n1, name); strcat(n1, "~c_i"); iptc_flush_entries(n1, &handle); - strcpy(n1, name); strcat(n1, "~c_o"); iptc_flush_entries(n1, &handle); - strcpy(n1, name); strcat(n1, "~c_fi"); iptc_flush_entries(n1, &handle); - strcpy(n1, name); strcat(n1, "~c_fo"); iptc_flush_entries(n1, &handle); - strcpy(n1, name); strcat(n1, "~st"); - // find and insert stoppers - while(d) { - if (!strcmp(d->name, n1)) - strcpy(d->policy, "DROP"); -// append_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "DROP", NULL); - append_rule(d); - d=d->next; - } - strcpy(n1, name); strcat(n1, " "); - // greedy deletion - clear_runfile(n1, 1); - unlock(LOCKFILE); - } - - d = d1; - - tci=-1; tco=-1; tcfi=-1; tcfo=-1; - - strcpy(n, name); strcat(n, " "); - strcpy(n1, name); strcat(n1, "~st"); - - while(d) { - if (!strncmp(d->dest+strlen(d->dest)-4, "~c_i", 4)) - tci++; - else if (!strncmp(d->dest+strlen(d->dest)-4, "~c_o", 4)) - tco++; - else if (!strncmp(d->dest+strlen(d->dest)-5, "~c_fi", 5)) - tcfi++; - else if (!strncmp(d->dest+strlen(d->dest)-5, "~c_fo", 5)) - tcfo++; - if (!strcmp(d->name, serv_name)) { - strcpy(d->policy, "DROP"); - if (!strncmp(d->dest+strlen(d->dest)-4, "~c_i", 4)) { -// replace_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "DROP", tci, NULL); - replace_rule(d, tci); - } else if (!strncmp(d->dest+strlen(d->dest)-4, "~c_o", 4)) { -// replace_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "DROP", tco, NULL); - replace_rule(d, tco); - } else if (!strncmp(d->dest+strlen(d->dest)-5, "~c_fi", 5)) { -// replace_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "DROP", tcfi, NULL); - replace_rule(d, tcfi); - } else if (!strncmp(d->dest+strlen(d->dest)-5, "~c_fo", 5)) { -// replace_rule(d->dest, d->snet, d->sport, d->dnet, -// d->dport, d->protocol, "DROP", tcfo, NULL); - replace_rule(d, tcfo); - } - } - d=d->next; - } - iptc_commit(&handle); - iptables_ipac_init(0); - return 0; -} - int iptables_ipac_check(void){ int tmp=0; @@ -2296,39 +1827,6 @@ iptc_commit(&handle); iptables_ipac_init(0); // always do init after commit! } -} - - -int -iptables_ipac_remove_user(char *login) -{ - char tmp[MAX_RULE_NAME_LENGTH]; - - strcpy(tmp, login); - strcpy(tmp+strlen(tmp), "~fo"); - flush_remove_chain(tmp); - strcpy(tmp, login); - strcpy(tmp+strlen(tmp), "~fi"); - flush_remove_chain(tmp); - strcpy(tmp, login); - strcpy(tmp+strlen(tmp), "~c_fi"); - flush_remove_chain(tmp); - strcpy(tmp, login); - strcpy(tmp+strlen(tmp), "~c_fo"); - flush_remove_chain(tmp); - strcpy(tmp, login); - strcpy(tmp+strlen(tmp), "~o"); - flush_remove_chain(tmp); - strcpy(tmp, login); - strcpy(tmp+strlen(tmp), "~i"); - flush_remove_chain(tmp); - strcpy(tmp, login); - strcpy(tmp+strlen(tmp), "~c_i"); - flush_remove_chain(tmp); - strcpy(tmp, login); - strcpy(tmp+strlen(tmp), "~c_o"); - flush_remove_chain(tmp); - return 0; } /* |
From: <kai...@us...> - 2003-10-31 07:29:09
|
Update of /cvsroot/ipac-ng/ipac-ng/agents/ipchains In directory sc8-pr-cvs1:/tmp/cvs-serv20531/agents/ipchains Modified Files: ipchains.c Log Message: removing nonclassic mode - part2 Index: ipchains.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/agents/ipchains/ipchains.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ipchains.c 6 Jul 2003 11:34:52 -0000 1.2 +++ ipchains.c 31 Oct 2003 07:29:06 -0000 1.3 @@ -60,22 +60,14 @@ int ipchains_ipac_init(int flag); int ipchains_ipac_set(rule_type **firstrule, int first); int ipchains_ipac_read(rule_type **firstrule); -int ipchains_ipac_deny(char *login); -int ipchains_ipac_accept(char *login); int ipchains_ipac_check(void); -int ipchains_ipac_remove_user(char *login); -int ipchains_ipac_alarm(); static const acc_agent_t interface_entry = { "ipchains", ipchains_ipac_init, ipchains_ipac_set, ipchains_ipac_read, - ipchains_ipac_deny, - ipchains_ipac_accept, ipchains_ipac_check, - ipchains_ipac_remove_user, - ipchains_ipac_alarm, }; const acc_agent_t *ipac_ag_interface_ipchains() { @@ -663,117 +655,8 @@ return retval; } -int -ipchains_ipac_accept(char *login) -{ - static struct ip_fwuser fw; - raw_rule_type *dat; - unsigned int nsaddrs = 0; - struct in_addr *saddrs = NULL, *daddrs = NULL; - - access_agent->get_raw_list("ipchains", login, &dat); - while(dat) - { - parse_hostnetworkmask(dat->snet, - &saddrs, &(fw.ipfw.fw_smsk), &nsaddrs); - parse_hostnetworkmask(dat->dnet, &daddrs, - &(fw.ipfw.fw_dmsk), &nsaddrs); - if (!dat->protocol[0]=='\0') - fw.ipfw.fw_proto = parse_protocol(dat->protocol); - if (fw.ipfw.fw_proto != IPPROTO_ICMP) - { - parse_ports(dat->sport, fw.ipfw.fw_spts, - fw.ipfw.fw_proto); - parse_ports(dat->dport, fw.ipfw.fw_dpts, - fw.ipfw.fw_proto); - } - strcpy(fw.label, ""); - fw.ipfw.fw_src.s_addr = saddrs[0].s_addr; - fw.ipfw.fw_dst.s_addr = daddrs[0].s_addr; - - if (!memcmp(dat->dest, "out", 3)) - { - strcpy(fw.label, "REJECT"); - ipfwc_delete_entry(CH_CTRL_OUT, &fw); - strcpy(fw.label, ""); - ipfwc_delete_entry(CH_CTRL_OUT, &fw); - ipfwc_append_entry(CH_CTRL_OUT, &fw); - } else { - strcpy(fw.label, "REJECT"); - ipfwc_delete_entry(CH_CTRL_IN, &fw); - strcpy(fw.label, ""); - ipfwc_delete_entry(CH_CTRL_IN, &fw); - ipfwc_append_entry(CH_CTRL_IN, &fw); - } - dat=dat->next; - } - return 0; -} - -int -ipchains_ipac_deny(char *login) -{ - static struct ip_fwuser fw; - raw_rule_type *dat; - unsigned int nsaddrs = 0; - struct in_addr *saddrs = NULL, *daddrs = NULL; - - access_agent->get_raw_list("ipchains", login, &dat); - while(dat) - { - parse_hostnetworkmask(dat->snet, - &saddrs, &(fw.ipfw.fw_smsk), &nsaddrs); - parse_hostnetworkmask(dat->dnet, &daddrs, - &(fw.ipfw.fw_dmsk), &nsaddrs); - if (!dat->protocol[0]=='\0') - fw.ipfw.fw_proto = parse_protocol(dat->protocol); - if (fw.ipfw.fw_proto != IPPROTO_ICMP) - { - parse_ports(dat->sport, fw.ipfw.fw_spts, - fw.ipfw.fw_proto); - parse_ports(dat->dport, fw.ipfw.fw_dpts, - fw.ipfw.fw_proto); - } - strcpy(fw.label, ""); - fw.ipfw.fw_src.s_addr = saddrs[0].s_addr; - fw.ipfw.fw_dst.s_addr = daddrs[0].s_addr; - - if (!memcmp(dat->dest, "out", 3)) - { - strcpy(fw.label, ""); - ipfwc_delete_entry(CH_CTRL_OUT, &fw); - strcpy(fw.label, "REJECT"); - ipfwc_delete_entry(CH_CTRL_OUT, &fw); - ipfwc_append_entry(CH_CTRL_OUT, &fw); - } - else - { - strcpy(fw.label, ""); - ipfwc_delete_entry(CH_CTRL_IN, &fw); - strcpy(fw.label, "REJECT"); - ipfwc_delete_entry(CH_CTRL_IN, &fw); - ipfwc_append_entry(CH_CTRL_IN, &fw); - } - dat=dat->next; - } - return 0; -} - int ipchains_ipac_check(void) { return 0; -} - -int -ipchains_ipac_remove_user(char *login) -{ - return 0; -} - -/* not implemented */ -int -ipchains_ipac_alarm(void) -{ - return 1; } |
From: <kai...@us...> - 2003-10-31 07:29:09
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1:/tmp/cvs-serv20531 Modified Files: ipac.h Log Message: removing nonclassic mode - part2 Index: ipac.h =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/ipac.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ipac.h 28 Sep 2003 11:24:58 -0000 1.3 +++ ipac.h 31 Oct 2003 07:29:06 -0000 1.4 @@ -315,11 +315,7 @@ int (*init)(int flag); int (*set)(rule_type **firstrule, int first); int (*read)(rule_type **firstrule); - int (*deny)(char *login_name); - int (*accept)(char *login_name); int (*check)(void); - int (*remove_user)(char *login); - int (*alarm)(void); }; typedef struct Sacc_agent_t acc_agent_t; |
From: <kai...@us...> - 2003-10-30 11:45:21
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1:/tmp/cvs-serv5024 Modified Files: CHANGELOG batch.y configure configure.in fetchipac.c ipacsum Log Message: start of nonclassic mode removal Index: CHANGELOG =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/CHANGELOG,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- CHANGELOG 4 Oct 2003 00:56:48 -0000 1.13 +++ CHANGELOG 30 Oct 2003 11:45:17 -0000 1.14 @@ -18,6 +18,7 @@ # 1.28 +- start to remove classic mode - logging of database debug messages improved (friedl) - add option '--enable-debug-database' to configure (friedl) - add option '--human-kilo' to ipacsum, the default now is 1K=1024 (friedl) Index: batch.y =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/batch.y,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- batch.y 6 Jul 2003 11:34:51 -0000 1.2 +++ batch.y 30 Oct 2003 11:45:17 -0000 1.3 @@ -20,8 +20,6 @@ extern int print_records(FILE *f, int n, const data_record_type *dr); -extern int check_cash(const data_record_type *data); - static FILE *input; /* a counter for the number of successful performed add commands. */ @@ -56,7 +54,7 @@ %type <rule> rule rules %type <record> record records record_array -%type <n> command_item existing_command_item quit_command add_command bill_command +%type <n> command_item existing_command_item quit_command add_command %type <n> delete_command list_command %% @@ -83,7 +81,6 @@ quit_command | delete_command | add_command - | bill_command | list_command; quit_command: @@ -146,9 +143,6 @@ break; } else n_add_commands++; - // FIXME: ugly, ugly hack. it haven't be here. -// if (!is_classic && access_opened) -// check_cash(p); } /* storage_method->close(); */ free_data_record_type_array($3, n); @@ -157,50 +151,6 @@ | ADD error LF { fprintf(OUTPUT, "ERROR: bad ADD command format:" " expected newline after ADD\n"); - $$=1; - }; - -// same as add, but calls check_cash -bill_command: - BILL LF record_array - { - int n; - data_record_type *p; - - $$=0; - if (!storage_opened && storage_method->open(0) !=0) { - fprintf(OUTPUT, "ERROR: cant open database\n"); - $$=1; - } else if ($3 == NULL) { - $$=1; - } else { - storage_opened = 1; - for (n=0,p=$3; p->machine_name!=NULL; - n++, p++) - { -// timestamp_t before, after, *tlist; - -// while (storage_method->list_timestamps(p->timestamp, -// p->timestamp, &tlist, &before, &after) > 0) -// p->timestamp++; - if (storage_method->store_record(p) - != 0) { - fprintf(OUTPUT, "ERROR: storing record\n"); - $$=1; - break; - } else - n_add_commands++; - // FIXME: ugly, ugly hack. it haven't be here. - if (!is_classic && access_opened) - check_cash(p); - } - /* storage_method->close(); */ - free_data_record_type_array($3, n); - } - } - | BILL error LF { - fprintf(OUTPUT, "ERROR: bad BILL command format:" - " expected newline after BILL\n"); $$=1; }; Index: configure =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure 4 Oct 2003 01:08:55 -0000 1.4 +++ configure 30 Oct 2003 11:45:17 -0000 1.5 @@ -309,7 +309,7 @@ #endif" ac_subdirs_all="$ac_subdirs_all $configure_dirs" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION MANTIME CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT AWK YACC LEX LEXLIB LEX_OUTPUT_ROOT IPCHAINS IPTABLES MKTEMP PERL CPP EGREP TMP DATDELIM STORAGEMETHODS STORAGEMETHODLIBRARYS DEFAULT_STORAGE CLASSIC BILLAGENTS BILLAGENTSLIBRARYS DEFAULT_ACCESS CONFDIR CONFFILE ACCAGENTS ACCAGENTSLIBRARYS DEFAULT_AGENT IPT_LIB_DIR IPFWADM_PROC IPCHAINS_PROC_C IPCHAINS_PROC_N CH_CTRL_IN CH_CTRL_OUT CH_INNAME CH_OUTNAME ipac_datadir RUNFILE PIDFILE RECONFLAG STATUSFILE LOCKFILE DBASE DBASE_PORT WEB_HOST WEB_LOGIN WEB_PASS subdirs LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION MANTIME CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT AWK YACC LEX LEXLIB LEX_OUTPUT_ROOT IPCHAINS IPTABLES MKTEMP PERL CPP EGREP TMP DATDELIM STORAGEMETHODS STORAGEMETHODLIBRARYS DEFAULT_STORAGE BILLAGENTS BILLAGENTSLIBRARYS DEFAULT_ACCESS CONFDIR CONFFILE ACCAGENTS ACCAGENTSLIBRARYS DEFAULT_AGENT IPT_LIB_DIR IPFWADM_PROC IPCHAINS_PROC_C IPCHAINS_PROC_N CH_CTRL_IN CH_CTRL_OUT CH_INNAME CH_OUTNAME ipac_datadir RUNFILE PIDFILE RECONFLAG STATUSFILE LOCKFILE DBASE DBASE_PORT WEB_HOST WEB_LOGIN WEB_PASS subdirs LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -845,7 +845,6 @@ and gdbm and any additional ones which are stored under storage/. The default depends on your system. ---enable-classic=yes|no enable old-styled-only ipac --enable-default-access=access use access agent by default. possible access agents are files (dumb) and gdbm and any additional ones which are stored @@ -3813,30 +3812,6 @@ -echo "$as_me:$LINENO: checking for classic mode ipac" >&5 -echo $ECHO_N "checking for classic mode ipac... $ECHO_C" >&6 -IP_COMMENT="" -# Check whether --enable-classic or --disable-classic was given. -if test "${enable_classic+set}" = set; then - enableval="$enable_classic" - CLASSIC=$enableval -else - CLASSIC="" -fi; -if test x$CLASSIC = x; then - CLASSIC="yes" - IP_COMMENT=" (default)" -else - IP_COMMENT=" (set by user)" -fi -echo "$as_me:$LINENO: result: $CLASSIC$IP_COMMENT" >&5 -echo "${ECHO_T}$CLASSIC$IP_COMMENT" >&6 -cat >>confdefs.h <<_ACEOF -#define EMULATE_CLASSIC "$CLASSIC" -_ACEOF - - - echo "$as_me:$LINENO: checking for available access agents" >&5 echo $ECHO_N "checking for available access agents... $ECHO_C" >&6 BILLAGENTS=`(cd access && find . -type d -print) | @@ -4956,7 +4931,6 @@ s,@STORAGEMETHODS@,$STORAGEMETHODS,;t t s,@STORAGEMETHODLIBRARYS@,$STORAGEMETHODLIBRARYS,;t t s,@DEFAULT_STORAGE@,$DEFAULT_STORAGE,;t t -s,@CLASSIC@,$CLASSIC,;t t s,@BILLAGENTS@,$BILLAGENTS,;t t s,@BILLAGENTSLIBRARYS@,$BILLAGENTSLIBRARYS,;t t s,@DEFAULT_ACCESS@,$DEFAULT_ACCESS,;t t Index: configure.in =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure.in 4 Oct 2003 01:08:55 -0000 1.4 +++ configure.in 30 Oct 2003 11:45:17 -0000 1.5 @@ -211,22 +211,6 @@ AC_DEFINE_UNQUOTED(DEFAULT_STORAGE,"$DEFAULT_STORAGE") AC_SUBST(DEFAULT_STORAGE) -dnl Check for classic mode -AC_MSG_CHECKING([for classic mode ipac]) -IP_COMMENT="" -AC_ARG_ENABLE(classic, -[--enable-classic=yes|no enable old-styled-only ipac], - CLASSIC=$enableval, CLASSIC="") -if test x$CLASSIC = x; then - CLASSIC="yes" - IP_COMMENT=" (default)" -else - IP_COMMENT=" (set by user)" -fi -AC_MSG_RESULT([$CLASSIC$IP_COMMENT]) -AC_DEFINE_UNQUOTED(EMULATE_CLASSIC,"$CLASSIC") -AC_SUBST(CLASSIC) - dnl ----------------------------------- dnl ----- decisions about access agents dnl ----------------------------------- Index: fetchipac.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/fetchipac.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- fetchipac.c 28 Sep 2003 11:24:58 -0000 1.3 +++ fetchipac.c 30 Oct 2003 11:45:17 -0000 1.4 @@ -46,8 +46,6 @@ #include <assert.h> #include "ipac.h" -int is_classic; - int dropzero = 0; int verbose = 0; @@ -94,9 +92,10 @@ int storage_opened = 0; +int is_classic = 1; + int access_opened = 1; -int is_classic; char *storage_method_name = NULL; char *acc_agent_name = DEFAULT_AGENT; char *access_agent_name = DEFAULT_ACCESS; @@ -114,7 +113,6 @@ "fetchipac [options]\n" "options are:\n" "-S|--start\tinitial accounting setup: insert rules and chains\n" -"-c|--classic [yes|no]\t simulate old-styled ipac\n" "-C|--config FILE\t specify config file to use\n" "-b|--batch\texecute commands which are fed via standard input\n" "-H|--hostname\thostname to work with\n" @@ -141,11 +139,7 @@ "-u|--sum {START][,END]\n" "\t\tprint summary for given timeframe\n" "-R|--list-raw\tlist raw accounting rules\n" -"-L|--login USER\tlogs USER in (in case there is enough cash on it's account\n" -"-O|--logoff USER\tkicks USER out\n" -"-U|--user-list\tget userlist\n" "-v|--verbose\tadd one level of verbosity\n" -"-e|--reconfig\treconfigure\n" "See fetchipac(8) for further information.\n"; // check existence of chains and rules in kernel @@ -158,6 +152,7 @@ return acc_agent->check(); } +/* int try_to_login(char *login_name) { @@ -208,7 +203,9 @@ unlock(LOCKFILE); return tmp; } +*/ +/* int try_to_logoff(char *login_name) { @@ -258,7 +255,9 @@ unlock(LOCKFILE); return tmp; } +*/ +/* int get_user_list(void) { @@ -275,6 +274,7 @@ } return 0; } +*/ int list_raw(void) @@ -345,6 +345,7 @@ int setup_agents(void) { +/* setup_access(1); if (!is_classic) { setup_status(); @@ -358,7 +359,8 @@ } } } - return 0; +*/ + return setup_access(1); } /** print the usage message */ @@ -469,6 +471,7 @@ * for traffic on them.. then decrement limits at database and cut off user in * case there are no more bucks */ +/* int check_cash(const data_record_type *data) { @@ -523,6 +526,7 @@ lock(LOCKFILE); return 0; } +*/ int list_timestamps(timestamp_t tstart, timestamp_t tend, char *ahost) { @@ -841,10 +845,7 @@ int main(int argc, char **argv) { rule_type *firstrule = NULL; - char *login_name = NULL; - void *node = NULL; - void *usertree = NULL; int c; timestamp_t t, tstart=0, tend=0; data_record_type data_record; @@ -860,25 +861,20 @@ static struct option long_options[] = { { "agent", required_argument, NULL, 'a' }, - { "login", required_argument, NULL, 'L' }, - { "logoff", required_argument, NULL, 'O' }, { "config", required_argument, NULL, 'C' }, { "filter", required_argument, NULL, 'f' }, { "start", no_argument, NULL, 'S' }, { "list-raw", no_argument, NULL, 'R' }, - { "user-list", no_argument, NULL, 'U' }, { "ahost", required_argument, NULL, 'H' }, { "batch", no_argument, NULL, 'b' }, { "directory", required_argument, NULL, 'd' }, { "help", no_argument, NULL, 'h' }, { "machine-output-format", no_argument, NULL, 'm' }, { "records", optional_argument, NULL, 'r' }, - { "classic", required_argument, NULL, 'c' }, { "storage-method", required_argument, NULL, 's' }, { "timestamps", optional_argument, NULL, 't' }, { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, 'h' }, - { "reconfig", no_argument, NULL, 'e' }, { "sum", optional_argument, NULL, 'u' }, { NULL, 0, NULL, 0 } }; @@ -887,10 +883,7 @@ mode = 0; /* fetch data */ strncpy(conffile, CONFFILE, sizeof(conffile)-1); // default config - if (!memcmp(EMULATE_CLASSIC, "no", 2)) - is_classic = 0; - else - is_classic = 1; + is_classic = 1; /* create array storage_methods */ create_storage_methods(); @@ -922,29 +915,12 @@ case 'f': filter = xstrdup(optarg); break; - case 'c': - if (memcmp(optarg, "yes", 3)) - is_classic = 0; - else - is_classic = 1; - break; case 'C': strncpy(conffile, optarg, sizeof(conffile)-1); break; - case 'L': - login_name = optarg; - mode = 6; - break; - case 'O': - login_name = optarg; - mode = 7; - break; case 'R': mode = 4; break; - case 'U': - mode = 8; - break; case 'd': datadir = optarg; break; @@ -963,9 +939,6 @@ case 's': storage_method_name = optarg; break; - case 'e': - mode = 9; - break; case 't': mode = 1; /* list timestamps */ if (optarg != NULL) { @@ -1075,35 +1048,13 @@ return list_raw(); case 5: return setup_agents(); - case 6: - if (!is_classic) { - if (try_to_login(login_name)) { - printf("Login failed\n"); - return 1; - } else - return 0; - } else { - fprintf(stderr, "Login is not supported in " - "classic mode\n"); - return 1; - } - case 7: - if (!is_classic) - return try_to_logoff(login_name); - else { - fprintf(stderr, "Logoff is not supported in" - " classic mode\n"); - return 1; - } - case 8: - return get_user_list(); case 10: return print_summary(tstart, tend, ahost, filter); } // fetch data if (acc_agent->init(0)) { - printf("Error while initializing accounting agent\n"); + fprintf(stderr, "Error while initializing accounting agent\n"); return 1; } if (check_rules()) { @@ -1170,8 +1121,6 @@ else fprintf(stderr, "%s: storage reports error on store record\n", me); } - if (!is_classic && access_opened) - check_cash(&data_record); /* if our data could not be stored for some reason, * we put it in ASCII representation into a spool @@ -1188,55 +1137,6 @@ } unlock(LOCKFILE); - /* reconfigure, if needed. supported only for neoclassic mode - * we have to store data before reconfiguring - * warning, there are posible traffic loss doing reconfigure - * althought it is very small possibility. in case of data - * blame me loss don't - */ - if ((mode==9) && (!is_classic) && (access_opened)) { - user_list *ul=NULL, *ul1=NULL, *ulist=NULL; - FILE *sf; - char line[MAX_RULE_NAME_LENGTH]; - - if (!(sf = fopen(STATUSFILE, "r"))) { - printf("Can't open status file %s\n", STATUSFILE); - return 1; - } - while(fgets(line, MAX_RULE_NAME_LENGTH, sf)) { - ul = new_user(); - if (ul1 == NULL) - ulist = ul; - else - ul1->next = ul; - ul1=ul; - strcpy(ul->login, line); - } - fclose(sf); - access_agent->get_user_list(&ul1); - - while (ul1) { - node = tsearch(ul1->login, &usertree, rule_compare); - ul1=ul1->next; - } - ul=ulist; - setup_access(0); - setup_status(); - while(ul) { - char *tmp; - tmp = strchr(ul->login, '|'); - if (tmp) { - tmp[0]='\0'; - if (!tfind(ul->login, &usertree, - rule_compare)) - acc_agent->remove_user(ul->login); - else - if (tmp[1]=='a') - try_to_login(ul->login); - } - ul=ul->next; - } - } } if (access_opened) access_agent->close(); Index: ipacsum =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/ipacsum,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ipacsum 4 Oct 2003 00:53:10 -0000 1.8 +++ ipacsum 30 Oct 2003 11:45:17 -0000 1.9 @@ -206,7 +206,7 @@ "l|sfilter=s", "fixed-quantity=s" =>\$fixed_quantity, "H|hostname=s" =>\$hname, - # for backward compatibelity, allow options to be named 'gif-*'. + # for backward compatibility, allow options to be named 'gif-*'. "gif:s", "gif-filename-prefix=s"=>\$png_filename_prefix, "gif-asis", \$png_asis, @@ -244,6 +244,7 @@ "storage-method=s" => \$storage_method, "t|timeframe=s", "version", + "save-memory", "x|exact", ); @@ -268,7 +269,6 @@ &usage; } - #@ DEBUG CODE BEGIN $now = &makeunixtime($opt_debug_current_time) if ($opt_debug_current_time); @@ -286,7 +286,7 @@ $endtime -= 1; } -$exact=1 if ($opt_x || $opt_x); +$exact = 1 if ($opt_x || $opt_x); $replace = 1 if ($opt_r || $opt_r); |
From: <fr...@us...> - 2003-10-05 00:02:54
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/postgre In directory sc8-pr-cvs1:/tmp/cvs-serv30071 Modified Files: postgre.c Log Message: uppercase SQL statements and add missing space to one query Index: postgre.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/postgre/postgre.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- postgre.c 4 Oct 2003 23:56:53 -0000 1.21 +++ postgre.c 5 Oct 2003 00:02:50 -0000 1.22 @@ -126,8 +126,8 @@ return 0; for (rule = firstrule; rule; rule = rule->next) { - sprintf (wh_exec, "insert into logs (rule_name, bytes, pkts, that_time, hostname) " - "values ('%s', '%llu', '%llu', '%lu', '%s')", + sprintf (wh_exec, "INSERT INTO logs (rule_name, bytes, pkts, that_time, hostname) " + "VALUES ('%s', '%llu', '%llu', '%lu', '%s')", rule->name, rule->bytes, rule->pkts, data->timestamp, hostname); DPRINTF ("postgre_stor_store_record\n"); @@ -158,7 +158,7 @@ sprintf (wh_exec, "SELECT distinct that_time FROM logs WHERE "); if (ahost) sprintf (wh_exec+strlen (wh_exec), "hostname = '%s' ", ahost); - sprintf (wh_exec+strlen (wh_exec), "that_time between %lu and %lu" + sprintf (wh_exec+strlen (wh_exec), "that_time between %lu and %lu " "ORDER BY that_time ASC", start, end); DPRINTF ("%s\n", wh_exec); @@ -202,8 +202,8 @@ } if (just_after != NULL) { - sprintf (wh_exec, "select that_time from logs where " - "that_time > %lu order by that_time asc limit 1", end); + sprintf (wh_exec, "SELECT that_time FROM logs WHERE " + "that_time > %lu ORDER BY that_time ASC LIMIT 1", end); DPRINTF ("%s\n", wh_exec); @@ -246,13 +246,13 @@ timestamp_e = timestamp_b; if (ahost) - sprintf (wh_exec, "select count (distinct that_time) from logs " - "where hostname = '%s' and " + sprintf (wh_exec, "SELECT count (distinct that_time) FROM logs " + "WHERE hostname = '%s' and " "that_time between '%lu' and '%lu'", ahost, timestamp_b, timestamp_e); else - sprintf (wh_exec, "select count (distinct that_time) from logs " - "where " + sprintf (wh_exec, "SELECT count (distinct that_time) FROM logs " + "WHERE " "that_time between '%lu' and '%lu'", timestamp_b, timestamp_e); if (filter) @@ -276,19 +276,19 @@ PQclear (res); if (ahost) - sprintf (wh_exec, "select rule_name, bytes, pkts, that_time, hostname from logs " - "where " + sprintf (wh_exec, "SELECT rule_name, bytes, pkts, that_time, hostname FROM logs " + "WHERE " "hostname = '%s' and that_time between '%lu' and '%lu' ", ahost, timestamp_b, timestamp_e); else - sprintf (wh_exec, "select rule_name, bytes, pkts, that_time, hostname from logs " - "where " + sprintf (wh_exec, "SELECT rule_name, bytes, pkts, that_time, hostname FROM logs " + "WHERE " "that_time between '%lu' and '%lu' ", timestamp_b, timestamp_e); if (filter) sprintf (wh_exec+strlen (wh_exec), " and rule_name like '%%%s%%'", filter); - sprintf (wh_exec+strlen (wh_exec), " order by that_time"); + sprintf (wh_exec+strlen (wh_exec), " ORDER BY that_time"); DPRINTF ("%s\n", wh_exec); @@ -374,13 +374,13 @@ timestamp_e = timestamp_b; if (ahost) - sprintf (wh_exec, "select rule_name, sum (bytes), sum (pkts), hostname from logs " - "where " + sprintf (wh_exec, "SELECT rule_name, sum (bytes), sum (pkts), hostname FROM logs " + "WHERE " "hostname = '%s' and that_time between '%lu' and '%lu' ", ahost, timestamp_b, timestamp_e); else - sprintf (wh_exec, "select rule_name, sum (bytes), sum (pkts), hostname from logs " - "where " + sprintf (wh_exec, "SELECT rule_name, sum (bytes), sum (pkts), hostname FROM logs " + "WHERE " "that_time between '%lu' and '%lu' ", timestamp_b, timestamp_e); if (filter) @@ -456,7 +456,7 @@ { char wh_exec[120]; - sprintf (wh_exec, "delete from logs where that_time = '%lu'", timestamp); + sprintf (wh_exec, "DELETE FROM logs WHERE that_time = '%lu'", timestamp); DPRINTF ("postgre_stor_delete_record\n"); DPRINTF ("%s\n", wh_exec); |
From: <fr...@us...> - 2003-10-04 23:56:57
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/postgre In directory sc8-pr-cvs1:/tmp/cvs-serv29244 Modified Files: postgre.c Log Message: added more logging postgre_stor_get_summary: fixed one possible problem when reading the rulename Index: postgre.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/postgre/postgre.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- postgre.c 4 Oct 2003 23:15:58 -0000 1.20 +++ postgre.c 4 Oct 2003 23:56:53 -0000 1.21 @@ -161,6 +161,8 @@ sprintf (wh_exec+strlen (wh_exec), "that_time between %lu and %lu" "ORDER BY that_time ASC", start, end); + DPRINTF ("%s\n", wh_exec); + res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); @@ -180,6 +182,9 @@ if (just_before != NULL) { sprintf (wh_exec, "SELECT that_time FROM logs WHERE " "that_time < %lu ORDER BY that_time DESC LIMIT 1", start); + + DPRINTF ("%s\n", wh_exec); + res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); @@ -199,6 +204,9 @@ if (just_after != NULL) { sprintf (wh_exec, "select that_time from logs where " "that_time > %lu order by that_time asc limit 1", end); + + DPRINTF ("%s\n", wh_exec); + res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); @@ -257,6 +265,9 @@ fprintf (stderr, "PQexec of (%s) command didn't return tuples" " properly\nlibpq says: %s", wh_exec, PQresultErrorMessage (res)); + + DPRINTF ("%s: %s\n", me, PQresultErrorMessage (res)); + PQclear (res); PQfinish(conn); exit (-1); @@ -286,6 +297,9 @@ fprintf (stderr, "PQexec of (%s) command didn't return tuples" " properly\nlibpq says: %s", wh_exec, PQresultErrorMessage (res)); + + DPRINTF ("%s: %s\n", me, PQresultErrorMessage (res)); + PQclear (res); PQfinish(conn); exit (-1); @@ -307,6 +321,9 @@ if (index > nr_timestamps) { fprintf (stderr,"We got more records then timestamps " "were reported before. This should not happen\n"); + + DPRINTF ("%s: %s\n", me, PQresultErrorMessage (res)); + PQclear (res); PQfinish(conn); exit (-1); @@ -346,19 +363,16 @@ data_record_type **data, char *filter) { rule_type *r, *r1 = NULL; - char *buf; int i, nr_timestamps, index; timestamp_t timestamp_akt; char wh_exec[320]; - char *pkts; - char *bytes; + + DPRINTF ("postgre_stor_get_summary (%lu, %lu, **data, %s)\n", + timestamp_b, timestamp_e, (filter!=NULL) ? filter : "NULL"); if (!timestamp_e) timestamp_e = timestamp_b; - /* create record_data_type. */ - *data = (data_record_type *)xmalloc (sizeof (data_record_type)); - if (ahost) sprintf (wh_exec, "select rule_name, sum (bytes), sum (pkts), hostname from logs " "where " @@ -374,16 +388,26 @@ sprintf (wh_exec+strlen (wh_exec), " group by rule_name, hostname"); + DPRINTF ("%s\n", wh_exec); + res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "PQexec of (%s) command didn't return tuples" " properly\nlibpq says: %s", wh_exec, PQresultErrorMessage (res)); + + DPRINTF ("%s: %s\n", me, PQresultErrorMessage (res)); + PQclear (res); PQfinish(conn); exit (-1); } + DPRINTF ("starting to convert data into our format\n"); + + /* create record_data_type. */ + *data = (data_record_type *)xmalloc (sizeof (data_record_type)); + index = -1; timestamp_akt = 0; for (i = 0; i < PQntuples (res); i++) { @@ -394,13 +418,17 @@ if (index > nr_timestamps) { fprintf (stderr,"We got more records then timestamps " "were reported before. This should not happen\n"); + + DPRINTF ("We got more records then timestamps " + "were reported before. This should not happen\n"); + PQclear (res); PQfinish(conn); exit (-1); } - (*data)[index].timestamp = timestamp_akt; - (*data)[index].machine_name = xstrdup ((char *) PQgetvalue (res, i, 3)); - (*data)[index].firstrule = NULL; + (*data)[index].timestamp = timestamp_akt; + (*data)[index].machine_name = xstrdup ((char *) PQgetvalue (res, i, 3)); + (*data)[index].firstrule = NULL; r1 = NULL; } r = new_rule (); @@ -409,16 +437,18 @@ else r1->next = r; r1 = r; - buf = (char *) PQgetvalue (res, i, 0); - bytes = (char *) PQgetvalue (res, i, 1); - r->bytes = strtoull (bytes, &pkts, 0); - pkts = (char *) PQgetvalue (res, i, 2); - r->pkts = strtoull (pkts, &bytes, 0); - strncpy (r->name, buf, PQgetlength (res, i, 0)); - r->name[PQgetlength (res, i, 0)] = '\0'; + + // never copy more than MAX_RULE_NAME_LENGTH+1 bytes from the resulting rule name + strncpy (r->name, (char *) PQgetvalue (res, i, 0), MAX_RULE_NAME_LENGTH+1); + // make sure it's a null terminated string + r->name[MAX_RULE_NAME_LENGTH] = '\0'; + r->bytes = strtoull ((char *) PQgetvalue (res, i, 1), NULL, 10); + r->pkts = strtoull ((char *) PQgetvalue (res, i, 2), NULL, 10); } PQclear (res); + DPRINTF ("data conversion finished\n"); + DPRINTF ("postgre_stor_get_summary returning: %i\n", index+1); return index+1; } |
From: <fr...@us...> - 2003-10-04 23:16:03
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/postgre In directory sc8-pr-cvs1:/tmp/cvs-serv23571 Modified Files: postgre.c Log Message: improve and simplify debugging mode Index: postgre.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/postgre/postgre.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- postgre.c 4 Oct 2003 20:06:27 -0000 1.19 +++ postgre.c 4 Oct 2003 23:15:58 -0000 1.20 @@ -37,6 +37,8 @@ #include <sys/types.h> #include <unistd.h> #include <stdarg.h> +#include <fcntl.h> +#include <sys/stat.h> extern char *ahost; @@ -45,7 +47,11 @@ #ifdef DEBUG_DB #define DEBUG_DB_LOGFILE "dblog" -static FILE *logs; +static int fd; +void debuglog(const char *format, ...); +#define DPRINTF(fmt, args...) debuglog(fmt, ##args) +#else +#define DPRINTF(fmt, args...) #endif static PGconn *conn; @@ -63,9 +69,6 @@ data_record_type **data, char *filter); int postgre_stor_delete_record (timestamp_t timestamp); void postgre_stor_close (); -#ifdef DEBUG_DB -int debuglog(const char *format, ...); -#endif static const storage_method_t interface_entry = { "postgre", @@ -86,11 +89,13 @@ { #ifdef DEBUG_DB char *log_file; - - // open the logfile for appending + + // construct the name of the logfile log_file = xmalloc(strlen(datadir) + sizeof(DEBUG_DB_LOGFILE) + 2); sprintf(log_file, "%s/" DEBUG_DB_LOGFILE, datadir); - logs = fopen (log_file, "a+"); + + // open the logfile for appending + fd = open (log_file, O_CREAT|O_WRONLY|O_APPEND|O_SYNC); #endif conn = PQsetdbLogin (dbhost, dbport, pgoptions, pgtty, dbname, dbuser, @@ -98,16 +103,14 @@ if (PQstatus (conn) == CONNECTION_BAD) { fprintf (stderr, "Connection to database '%s' failed.\n", dbname); fprintf (stderr, "%s", PQerrorMessage (conn)); -#ifdef DEBUG_DB - debuglog ("failed postgre_stor_open\n"); -#endif + + DPRINTF ("failed postgre_stor_open\n"); + PQfinish (conn); return (1); } -#ifdef DEBUG_DB - debuglog ("postgre_stor_open\n"); -#endif + DPRINTF ("postgre_stor_open\n"); storage_opened = 1; return (0); } @@ -127,11 +130,8 @@ "values ('%s', '%llu', '%llu', '%lu', '%s')", rule->name, rule->bytes, rule->pkts, data->timestamp, hostname); -#ifdef DEBUG_DB - debuglog ("postgre_stor_store_record\n"); - debuglog ("%s\n", wh_exec); - fflush (logs); -#endif + DPRINTF ("postgre_stor_store_record\n"); + DPRINTF ("%s\n", wh_exec); res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_COMMAND_OK) { @@ -151,12 +151,9 @@ int ts_list_len = 0; char wh_exec[250]; -#ifdef DEBUG_DB - debuglog ("postgre_stor_list_timestamps (%lu, %lu, **data, %s, %s, %s)\n", + DPRINTF ("postgre_stor_list_timestamps (%lu, %lu, **data, %s, %s, %s)\n", start, end, (just_before!=NULL) ? "*just_before" : "NULL", (just_after!=NULL) ? "*just_after" : "NULL", (ahost!=NULL) ? ahost : "NULL"); - fflush (logs); -#endif sprintf (wh_exec, "SELECT distinct that_time FROM logs WHERE "); if (ahost) @@ -167,10 +164,9 @@ res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); -#ifdef DEBUG_DB - debuglog ("%s: %s\n", me, PQresultErrorMessage (res)); - fflush (logs); -#endif + + DPRINTF ("%s: %s\n", me, PQresultErrorMessage (res)); + return (-1); } ts_list_len = PQntuples (res); @@ -187,10 +183,9 @@ res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); -#ifdef DEBUG_DB - debuglog ("%s: %s\n", me, PQresultErrorMessage (res)); - fflush (logs); -#endif + + DPRINTF ("%s: %s\n", me, PQresultErrorMessage (res)); + if (ts_list) free (ts_list); return (-1); } @@ -207,10 +202,9 @@ res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); -#ifdef DEBUG_DB - debuglog ("%s: %s\n", me, PQresultErrorMessage (res)); - fflush (logs); -#endif + + DPRINTF ("%s: %s\n", me, PQresultErrorMessage (res)); + if (ts_list) free (ts_list); return (-1); } @@ -225,11 +219,7 @@ } -#ifdef DEBUG_DB - debuglog ("postgre_stor_list_timestamps returning: %i\n", ts_list_len); - fflush (logs); -#endif - + DPRINTF ("postgre_stor_list_timestamps returning: %i\n", ts_list_len); return ts_list_len; } @@ -241,11 +231,8 @@ timestamp_t timestamp_akt; char wh_exec[320]; -#ifdef DEBUG_DB - debuglog ("postgre_stor_get_records (%lu, %lu, **data, %s)\n", + DPRINTF ("postgre_stor_get_records (%lu, %lu, **data, %s)\n", timestamp_b, timestamp_e, (filter!=NULL) ? filter : "NULL"); - fflush (logs); -#endif if (!timestamp_e) timestamp_e = timestamp_b; @@ -263,10 +250,7 @@ if (filter) sprintf (wh_exec+strlen (wh_exec), " and rule_name like '%%%s%%'", filter); -#ifdef DEBUG_DB - debuglog ("%s\n", wh_exec); - fflush (logs); -#endif + DPRINTF ("%s\n", wh_exec); res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { @@ -295,10 +279,7 @@ sprintf (wh_exec+strlen (wh_exec), " order by that_time"); -#ifdef DEBUG_DB - debuglog ("%s\n", wh_exec); - fflush (logs); -#endif + DPRINTF ("%s\n", wh_exec); res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { @@ -310,10 +291,7 @@ exit (-1); } -#ifdef DEBUG_DB - debuglog ("starting to convert data into our format\n"); - fflush (logs); -#endif + DPRINTF ("starting to convert data into our format\n"); /* create record_data_type. */ *data = (data_record_type *)xmalloc (sizeof (data_record_type) * nr_timestamps); @@ -354,22 +332,13 @@ r->pkts = strtoull ((char *) PQgetvalue (res, i, 2), NULL, 10); #ifdef DEBUG_DB_LEVEL2 - debuglog ("Record: %s, bytes %llu, pkts %llu\n", r->name, r->bytes, r->pkts); - fflush (logs); + DPRINTF ("Record: %s, bytes %llu, pkts %llu\n", r->name, r->bytes, r->pkts); #endif } PQclear (res); -#ifdef DEBUG_DB - debuglog ("data conversion finished\n"); - fflush (logs); -#endif - -#ifdef DEBUG_DB - debuglog ("postgre_stor_get_records returns %i\n", index+1); - fflush (logs); -#endif - + DPRINTF ("data conversion finished\n"); + DPRINTF ("postgre_stor_get_records returning: %i\n", index+1); return index+1; } @@ -458,11 +427,10 @@ char wh_exec[120]; sprintf (wh_exec, "delete from logs where that_time = '%lu'", timestamp); -#ifdef DEBUG_DB - debuglog ("postgre_stor_delete_record\n"); - debuglog ("%s\n", wh_exec); - fflush (logs); -#endif + + DPRINTF ("postgre_stor_delete_record\n"); + DPRINTF ("%s\n", wh_exec); + res = PQexec (conn, wh_exec); PQclear (res); return 0; @@ -486,10 +454,8 @@ tmp = * (int *) PQgetvalue (res, 0, 0); PQclear (res); -#ifdef DEBUG_DB - debuglog ("postgre_stor_rule_active\n"); - fflush (logs); -#endif + DPRINTF ("postgre_stor_rule_active\n"); + res = PQexec (conn, "CLOSE mycursor"); PQclear (res); res = PQexec (conn, "COMMIT"); @@ -500,21 +466,22 @@ void postgre_stor_close () { + DPRINTF ("postgre_stor_close\n"); + #ifdef DEBUG_DB - debuglog ("postgre_stor_close\n"); - fflush (logs); - fclose (logs); -#endif - + if (fd != -1) { + close (fd); + } +#endif + PQfinish (conn); storage_opened = 0; } #ifdef DEBUG_DB -int debuglog (const char *format, ...) +void debuglog (const char *format, ...) { va_list arg; - int done; time_t tm; char logline[512]; @@ -528,8 +495,9 @@ vsnprintf(logline+strlen(logline), sizeof(logline)-strlen(logline)-1, format, arg); va_end (arg); - done = fprintf (logs, logline); - - return done; + // write the log message to the logfile + if (fd != -1) { + write (fd, logline, strlen(logline)); + } } #endif |
From: <fr...@us...> - 2003-10-04 20:06:33
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/postgre In directory sc8-pr-cvs1:/tmp/cvs-serv26859/storage/postgre Modified Files: postgre.c Log Message: more logging statements debuglog now only calls fprintf once debugging logfile now respects the "--directory" option of fetchipac postgre_stor_get_records: fixed one possible problem when reading the rulename postgre_stor_get_records: convert that_time to long instead of long long because timestamp_t is essential long not long long Index: postgre.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/postgre/postgre.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- postgre.c 4 Oct 2003 00:56:48 -0000 1.18 +++ postgre.c 4 Oct 2003 20:06:27 -0000 1.19 @@ -43,11 +43,8 @@ static char *pgoptions = NULL; static char *pgtty = NULL; -static char *dbname = DBASE; -static char *pgport = DBASE_PORT; - #ifdef DEBUG_DB -static char *log_file = ACCTDIR"/dblog"; +#define DEBUG_DB_LOGFILE "dblog" static FILE *logs; #endif @@ -87,16 +84,28 @@ int postgre_stor_open (int flag) { +#ifdef DEBUG_DB + char *log_file; + + // open the logfile for appending + log_file = xmalloc(strlen(datadir) + sizeof(DEBUG_DB_LOGFILE) + 2); + sprintf(log_file, "%s/" DEBUG_DB_LOGFILE, datadir); + logs = fopen (log_file, "a+"); +#endif + conn = PQsetdbLogin (dbhost, dbport, pgoptions, pgtty, dbname, dbuser, dbpass); if (PQstatus (conn) == CONNECTION_BAD) { fprintf (stderr, "Connection to database '%s' failed.\n", dbname); fprintf (stderr, "%s", PQerrorMessage (conn)); +#ifdef DEBUG_DB + debuglog ("failed postgre_stor_open\n"); +#endif PQfinish (conn); return (1); } + #ifdef DEBUG_DB - logs = fopen (log_file, "a+"); debuglog ("postgre_stor_open\n"); #endif storage_opened = 1; @@ -142,6 +151,13 @@ int ts_list_len = 0; char wh_exec[250]; +#ifdef DEBUG_DB + debuglog ("postgre_stor_list_timestamps (%lu, %lu, **data, %s, %s, %s)\n", + start, end, (just_before!=NULL) ? "*just_before" : "NULL", + (just_after!=NULL) ? "*just_after" : "NULL", (ahost!=NULL) ? ahost : "NULL"); + fflush (logs); +#endif + sprintf (wh_exec, "SELECT distinct that_time FROM logs WHERE "); if (ahost) sprintf (wh_exec+strlen (wh_exec), "hostname = '%s' ", ahost); @@ -151,6 +167,10 @@ res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); +#ifdef DEBUG_DB + debuglog ("%s: %s\n", me, PQresultErrorMessage (res)); + fflush (logs); +#endif return (-1); } ts_list_len = PQntuples (res); @@ -167,6 +187,10 @@ res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); +#ifdef DEBUG_DB + debuglog ("%s: %s\n", me, PQresultErrorMessage (res)); + fflush (logs); +#endif if (ts_list) free (ts_list); return (-1); } @@ -183,6 +207,10 @@ res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "%s: %s\n", me, PQresultErrorMessage (res)); +#ifdef DEBUG_DB + debuglog ("%s: %s\n", me, PQresultErrorMessage (res)); + fflush (logs); +#endif if (ts_list) free (ts_list); return (-1); } @@ -197,6 +225,11 @@ } +#ifdef DEBUG_DB + debuglog ("postgre_stor_list_timestamps returning: %i\n", ts_list_len); + fflush (logs); +#endif + return ts_list_len; } @@ -204,12 +237,15 @@ data_record_type **data, char *filter) { rule_type *r, *r1 = NULL; - char *buf; int i, nr_timestamps, index; timestamp_t timestamp_akt; char wh_exec[320]; - char *pkts; - char *bytes; + +#ifdef DEBUG_DB + debuglog ("postgre_stor_get_records (%lu, %lu, **data, %s)\n", + timestamp_b, timestamp_e, (filter!=NULL) ? filter : "NULL"); + fflush (logs); +#endif if (!timestamp_e) timestamp_e = timestamp_b; @@ -227,6 +263,11 @@ if (filter) sprintf (wh_exec+strlen (wh_exec), " and rule_name like '%%%s%%'", filter); +#ifdef DEBUG_DB + debuglog ("%s\n", wh_exec); + fflush (logs); +#endif + res = PQexec (conn, wh_exec); if (!res || PQresultStatus (res) != PGRES_TUPLES_OK) { fprintf (stderr, "PQexec of (%s) command didn't return tuples" @@ -239,9 +280,6 @@ nr_timestamps = strtol (PQgetvalue (res,0,0),0,0); PQclear (res); - /* create record_data_type. */ - *data = (data_record_type *)xmalloc (sizeof (data_record_type) * nr_timestamps); - if (ahost) sprintf (wh_exec, "select rule_name, bytes, pkts, that_time, hostname from logs " "where " @@ -258,7 +296,6 @@ sprintf (wh_exec+strlen (wh_exec), " order by that_time"); #ifdef DEBUG_DB - debuglog ("postgre_stor_get_record\n"); debuglog ("%s\n", wh_exec); fflush (logs); #endif @@ -273,10 +310,19 @@ exit (-1); } +#ifdef DEBUG_DB + debuglog ("starting to convert data into our format\n"); + fflush (logs); +#endif + + /* create record_data_type. */ + *data = (data_record_type *)xmalloc (sizeof (data_record_type) * nr_timestamps); + index = -1; timestamp_akt = 0; for (i = 0; i < PQntuples (res); i++) { - timestamp_t tstamp_new = strtoull ((char *) PQgetvalue (res,i,3),NULL,0); + // currently timestamp_t is of type time_t which is essentially long + timestamp_t tstamp_new = strtol ((char *) PQgetvalue (res,i,3), NULL, 10); if (tstamp_new != timestamp_akt) { // do we have a new timestamp? timestamp_akt = tstamp_new; index++; @@ -287,31 +333,43 @@ PQfinish(conn); exit (-1); } - (*data)[index].timestamp = timestamp_akt; - (*data)[index].machine_name = xstrdup ((char *) PQgetvalue (res, i, 4)); - (*data)[index].firstrule = NULL; + (*data)[index].timestamp = timestamp_akt; + (*data)[index].machine_name = xstrdup ((char *) PQgetvalue (res, i, 4)); + (*data)[index].firstrule = NULL; r1 = NULL; } + r = new_rule (); if (r1 == NULL) (*data)[index].firstrule = r; else r1->next = r; r1 = r; - buf = (char *) PQgetvalue (res, i, 0); - bytes = (char *) PQgetvalue (res, i, 1); - r->bytes = strtoull (bytes, &pkts, 0); - pkts = (char *) PQgetvalue (res, i, 2); - r->pkts = strtoull (pkts, &bytes, 0); - strncpy (r->name, buf, PQgetlength (res, i, 0)); - r->name[PQgetlength (res, i, 0)] = '\0'; -#ifdef DEBUG_DB - debuglog ("Record: %s, bytes %s, pkts %s\n", r->name, bytes, pkts); + + // never copy more than MAX_RULE_NAME_LENGTH+1 bytes from the resulting rule name + strncpy (r->name, (char *) PQgetvalue (res, i, 0), MAX_RULE_NAME_LENGTH+1); + // make sure it's a null terminated string + r->name[MAX_RULE_NAME_LENGTH] = '\0'; + r->bytes = strtoull ((char *) PQgetvalue (res, i, 1), NULL, 10); + r->pkts = strtoull ((char *) PQgetvalue (res, i, 2), NULL, 10); + +#ifdef DEBUG_DB_LEVEL2 + debuglog ("Record: %s, bytes %llu, pkts %llu\n", r->name, r->bytes, r->pkts); fflush (logs); #endif } PQclear (res); +#ifdef DEBUG_DB + debuglog ("data conversion finished\n"); + fflush (logs); +#endif + +#ifdef DEBUG_DB + debuglog ("postgre_stor_get_records returns %i\n", index+1); + fflush (logs); +#endif + return index+1; } @@ -444,8 +502,8 @@ { #ifdef DEBUG_DB debuglog ("postgre_stor_close\n"); - fclose (logs); fflush (logs); + fclose (logs); #endif PQfinish (conn); @@ -458,17 +516,19 @@ va_list arg; int done; time_t tm; - char datestr[16]; + char logline[512]; // construct the date string like syslog does, eg. Sep 26 00:23:04 tm = time(NULL); - strftime(datestr, sizeof(datestr), "%b %e %H:%M:%S", localtime(&tm)); + strftime(logline, sizeof(logline)-1, "%b %e %H:%M:%S ", localtime(&tm)); - fprintf (logs, "%s fetchipac[%i]: ", datestr, getpid()); + snprintf (logline+strlen(logline), sizeof(logline)-strlen(logline)-1, "fetchipac[%i]: ", getpid()); va_start (arg, format); - done = vfprintf (logs, format, arg); + vsnprintf(logline+strlen(logline), sizeof(logline)-strlen(logline)-1, format, arg); va_end (arg); + + done = fprintf (logs, logline); return done; } |
From: <fr...@us...> - 2003-10-04 11:26:09
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1:/tmp/cvs-serv22191 Removed Files: debug Log Message: remove empty file debug --- debug DELETED --- |
From: <fr...@us...> - 2003-10-04 01:10:01
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1:/tmp/cvs-serv10436 Modified Files: configure configure.in Log Message: correct small optical flaw Index: configure =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure 4 Oct 2003 00:56:48 -0000 1.3 --- configure 4 Oct 2003 01:08:55 -0000 1.4 *************** *** 3963,3966 **** --- 3963,3970 ---- done + echo "$as_me:$LINENO: result: $ACCAGENTS" >&5 + echo "${ECHO_T}$ACCAGENTS" >&6 + + echo "$as_me:$LINENO: checking for default accounting agent" >&5 echo $ECHO_N "checking for default accounting agent... $ECHO_C" >&6 *************** *** 4002,4010 **** accagent_makefiles=`echo $accagent_makefiles|sed -e 's/agents\/iptables\/Makefile//'` fi - - echo "$as_me:$LINENO: result: $ACCAGENTS" >&5 - echo "${ECHO_T}$ACCAGENTS" >&6 - - echo "$as_me:$LINENO: result: $DEFAULT_AGENT$IP_COMMENT" >&5 echo "${ECHO_T}$DEFAULT_AGENT$IP_COMMENT" >&6 --- 4006,4009 ---- Index: configure.in =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure.in 4 Oct 2003 00:56:48 -0000 1.3 --- configure.in 4 Oct 2003 01:08:55 -0000 1.4 *************** *** 337,340 **** --- 337,343 ---- test -n "$ADDLIBS" && LIBS="$LIBS $ADDLIBS" done + AC_SUBST(ACCAGENTS) + AC_MSG_RESULT($ACCAGENTS) + AC_SUBST(ACCAGENTSLIBRARYS) dnl Check for the default accounting agent to use *************** *** 374,381 **** accagent_makefiles=`echo $accagent_makefiles|sed -e 's/agents\/iptables\/Makefile//'` fi - AC_SUBST(ACCAGENTS) - AC_MSG_RESULT($ACCAGENTS) - AC_SUBST(ACCAGENTSLIBRARYS) - AC_MSG_RESULT([$DEFAULT_AGENT$IP_COMMENT]) AC_DEFINE_UNQUOTED(DEFAULT_AGENT,"$DEFAULT_AGENT") --- 377,380 ---- |
From: <fr...@us...> - 2003-10-04 00:56:55
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1:/tmp/cvs-serv8692 Modified Files: CHANGELOG configure configure.in Log Message: add option '--enable-debug-database' to configure, logging of database debug messages improved Index: CHANGELOG =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/CHANGELOG,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CHANGELOG 3 Oct 2003 11:17:27 -0000 1.12 --- CHANGELOG 4 Oct 2003 00:56:48 -0000 1.13 *************** *** 19,22 **** --- 19,24 ---- 1.28 + - logging of database debug messages improved (friedl) + - add option '--enable-debug-database' to configure (friedl) - add option '--human-kilo' to ipacsum, the default now is 1K=1024 (friedl) - make it compile with older gcc's, move variable declarations Index: configure =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure 6 Jul 2003 11:34:51 -0000 1.2 --- configure 4 Oct 2003 00:56:48 -0000 1.3 *************** *** 856,859 **** --- 856,861 ---- and any additional ones which are stored under agents/. The default is iptables. + --enable-debug-database=yes|no switch on debugging of all accesses + to the backend database. Optional Packages: *************** *** 4013,4016 **** --- 4015,4041 ---- + echo "$as_me:$LINENO: checking if database debugging is desired" >&5 + echo $ECHO_N "checking if database debugging is desired... $ECHO_C" >&6 + IP_COMMENT="" + # Check whether --enable-debug-database or --disable-debug-database was given. + if test "${enable_debug_database+set}" = set; then + enableval="$enable_debug_database" + DEBUG_DATABASE=$enableval + else + DEBUG_DATABASE="" + fi; + if test x$DEBUG_DATABASE = x; then + DEBUG_DATABASE="no" + IP_COMMENT=" (default)" + else + IP_COMMENT=" (set by user)" + fi + if test x$DEBUG_DATABASE = xyes; then + CFLAGS="$CFLAGS -DDEBUG_DB" + else + DEBUG_DATABASE="no" + fi + echo "$as_me:$LINENO: result: $DEBUG_DATABASE$IP_COMMENT" >&5 + echo "${ECHO_T}$DEBUG_DATABASE$IP_COMMENT" >&6 if test $cross_compiling = no; then Index: configure.in =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/configure.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure.in 6 Jul 2003 11:34:51 -0000 1.2 --- configure.in 4 Oct 2003 00:56:48 -0000 1.3 *************** *** 382,385 **** --- 382,404 ---- AC_SUBST(DEFAULT_AGENT) + dnl Check if database debugging is on + AC_MSG_CHECKING([if database debugging is desired]) + IP_COMMENT="" + AC_ARG_ENABLE(debug-database, + [--enable-debug-database=yes|no switch on debugging of all accesses + to the backend database.], + DEBUG_DATABASE=$enableval,DEBUG_DATABASE="") + if test x$DEBUG_DATABASE = x; then + DEBUG_DATABASE="no" + IP_COMMENT=" (default)" + else + IP_COMMENT=" (set by user)" + fi + if test x$DEBUG_DATABASE = xyes; then + CFLAGS="$CFLAGS -DDEBUG_DB" + else + DEBUG_DATABASE="no" + fi + AC_MSG_RESULT([$DEBUG_DATABASE$IP_COMMENT]) dnl Check for programs in place. |
From: <fr...@us...> - 2003-10-04 00:56:55
|
Update of /cvsroot/ipac-ng/ipac-ng/storage/postgre In directory sc8-pr-cvs1:/tmp/cvs-serv8692/storage/postgre Modified Files: postgre.c Log Message: add option '--enable-debug-database' to configure, logging of database debug messages improved Index: postgre.c =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/storage/postgre/postgre.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** postgre.c 28 Sep 2003 21:15:09 -0000 1.17 --- postgre.c 4 Oct 2003 00:56:48 -0000 1.18 *************** *** 34,40 **** #include <unistd.h> #include <libpq-fe.h> ! ! //#define DEBUG_POST ! #undef DEBUG_POST extern char *ahost; --- 34,41 ---- #include <unistd.h> #include <libpq-fe.h> ! #include <time.h> ! #include <sys/types.h> ! #include <unistd.h> ! #include <stdarg.h> extern char *ahost; *************** *** 46,51 **** static char *pgport = DBASE_PORT; ! #ifdef DEBUG_POST ! static char *log_file = "/var/lib/ipac/post_log"; static FILE *logs; #endif --- 47,52 ---- static char *pgport = DBASE_PORT; ! #ifdef DEBUG_DB ! static char *log_file = ACCTDIR"/dblog"; static FILE *logs; #endif *************** *** 66,69 **** --- 67,73 ---- int postgre_stor_delete_record (timestamp_t timestamp); void postgre_stor_close (); + #ifdef DEBUG_DB + int debuglog(const char *format, ...); + #endif static const storage_method_t interface_entry = { *************** *** 92,98 **** return (1); } ! #ifdef DEBUG_POST logs = fopen (log_file, "a+"); ! fprintf (logs, "%lu : postgre_stor_open\n", time (NULL)); #endif storage_opened = 1; --- 96,102 ---- return (1); } ! #ifdef DEBUG_DB logs = fopen (log_file, "a+"); ! debuglog ("postgre_stor_open\n"); #endif storage_opened = 1; *************** *** 115,121 **** rule->name, rule->bytes, rule->pkts, data->timestamp, hostname); ! #ifdef DEBUG_POST ! fprintf (logs, "%lu : postgre_stor_store_record\n", time (NULL)); ! fprintf (logs, "%s\n", wh_exec); fflush (logs); #endif --- 119,125 ---- rule->name, rule->bytes, rule->pkts, data->timestamp, hostname); ! #ifdef DEBUG_DB ! debuglog ("postgre_stor_store_record\n"); ! debuglog ("%s\n", wh_exec); fflush (logs); #endif *************** *** 254,260 **** sprintf (wh_exec+strlen (wh_exec), " order by that_time"); ! #ifdef DEBUG_POST ! fprintf (logs, "%lu : postgre_stor_get_record\n", time (NULL)); ! fprintf (logs, "%s\n", wh_exec); fflush (logs); #endif --- 258,264 ---- sprintf (wh_exec+strlen (wh_exec), " order by that_time"); ! #ifdef DEBUG_DB ! debuglog ("postgre_stor_get_record\n"); ! debuglog ("%s\n", wh_exec); fflush (logs); #endif *************** *** 302,307 **** strncpy (r->name, buf, PQgetlength (res, i, 0)); r->name[PQgetlength (res, i, 0)] = '\0'; ! #ifdef DEBUG_POST ! fprintf (logs, "Record: %s, bytes %s, pkts %s\n", r->name, bytes, pkts); fflush (logs); #endif --- 306,311 ---- strncpy (r->name, buf, PQgetlength (res, i, 0)); r->name[PQgetlength (res, i, 0)] = '\0'; ! #ifdef DEBUG_DB ! debuglog ("Record: %s, bytes %s, pkts %s\n", r->name, bytes, pkts); fflush (logs); #endif *************** *** 397,403 **** sprintf (wh_exec, "delete from logs where that_time = '%lu'", timestamp); ! #ifdef DEBUG_POST ! fprintf (logs, "%lu : postgre_stor_delete_record\n", time (NULL)); ! fprintf (logs, "%s\n", wh_exec); fflush (logs); #endif --- 401,407 ---- sprintf (wh_exec, "delete from logs where that_time = '%lu'", timestamp); ! #ifdef DEBUG_DB ! debuglog ("postgre_stor_delete_record\n"); ! debuglog ("%s\n", wh_exec); fflush (logs); #endif *************** *** 425,430 **** PQclear (res); ! #ifdef DEBUG_POST ! fprintf (logs, "%lu : postgre_stor_rule_active\n", time (NULL)); fflush (logs); #endif --- 429,434 ---- PQclear (res); ! #ifdef DEBUG_DB ! debuglog ("postgre_stor_rule_active\n"); fflush (logs); #endif *************** *** 439,444 **** void postgre_stor_close () { ! #ifdef DEBUG_POST ! fprintf (logs, "%lu : postgre_stor_close\n", time (NULL)); fclose (logs); fflush (logs); --- 443,448 ---- void postgre_stor_close () { ! #ifdef DEBUG_DB ! debuglog ("postgre_stor_close\n"); fclose (logs); fflush (logs); *************** *** 448,449 **** --- 452,475 ---- storage_opened = 0; } + + #ifdef DEBUG_DB + int debuglog (const char *format, ...) + { + va_list arg; + int done; + time_t tm; + char datestr[16]; + + // construct the date string like syslog does, eg. Sep 26 00:23:04 + tm = time(NULL); + strftime(datestr, sizeof(datestr), "%b %e %H:%M:%S", localtime(&tm)); + + fprintf (logs, "%s fetchipac[%i]: ", datestr, getpid()); + + va_start (arg, format); + done = vfprintf (logs, format, arg); + va_end (arg); + + return done; + } + #endif |
From: <fr...@us...> - 2003-10-04 00:53:22
|
Update of /cvsroot/ipac-ng/ipac-ng In directory sc8-pr-cvs1:/tmp/cvs-serv8129 Modified Files: ipacsum Log Message: make INSTALLPATH completely controllable by configure, no hardcoded prefix/sbin anymore Index: ipacsum =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/ipacsum,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ipacsum 3 Oct 2003 11:17:27 -0000 1.7 --- ipacsum 4 Oct 2003 00:53:10 -0000 1.8 *************** *** 59,63 **** $exec_prefix="${prefix}"; # =()<$INSTALLPATH="@<INSTALLPATH>@";>()= ! $INSTALLPATH="/usr/local/sbin"; $copyright="(C) 1997 - 2000 Moritz Both\n(C) 2001 - 2003 Al Zaharov"; --- 59,63 ---- $exec_prefix="${prefix}"; # =()<$INSTALLPATH="@<INSTALLPATH>@";>()= ! $INSTALLPATH="${exec_prefix}/sbin"; $copyright="(C) 1997 - 2000 Moritz Both\n(C) 2001 - 2003 Al Zaharov"; |
From: <fr...@us...> - 2003-10-04 00:53:22
|
Update of /cvsroot/ipac-ng/ipac-ng/html/cgi-bin In directory sc8-pr-cvs1:/tmp/cvs-serv8129/html/cgi-bin Modified Files: ipac_cfg.pm Log Message: make INSTALLPATH completely controllable by configure, no hardcoded prefix/sbin anymore Index: ipac_cfg.pm =================================================================== RCS file: /cvsroot/ipac-ng/ipac-ng/html/cgi-bin/ipac_cfg.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ipac_cfg.pm 6 Jul 2003 15:25:32 -0000 1.3 --- ipac_cfg.pm 4 Oct 2003 00:53:10 -0000 1.4 *************** *** 38,42 **** # =()<my $INSTALLPATH="@<INSTALLPATH>@";>()= ! my $INSTALLPATH="/usr/local/sbin"; # =()<my $RECONFLAG="@<RECONFLAG>@";>()= --- 38,42 ---- # =()<my $INSTALLPATH="@<INSTALLPATH>@";>()= ! my $INSTALLPATH="${exec_prefix}/sbin"; # =()<my $RECONFLAG="@<RECONFLAG>@";>()= |