[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nufw-devel] [PATCH 1 of 5] Unmix tabs and spaces in plaintext.c
From: |
Mikael Berthe |
Subject: |
[Nufw-devel] [PATCH 1 of 5] Unmix tabs and spaces in plaintext.c |
Date: |
Tue, 25 Oct 2005 19:56:03 +0200 |
# HG changeset patch
# User Mikael Berthe <address@hidden>
# Node ID 1d7ba71e8bcc05d8a2ece8c2ba706f0399047305
# Parent 6a680fc5fa8e7559ca947338fcbcaf47324f19f5
Unmix tabs and spaces in plaintext.c
diff -r 6a680fc5fa8e -r 1d7ba71e8bcc src/nuauth/modules/plaintext/plaintext.c
--- a/src/nuauth/modules/plaintext/plaintext.c Fri Oct 21 12:30:27 2005 +0000
+++ b/src/nuauth/modules/plaintext/plaintext.c Sun Oct 23 19:15:39 2005 +0200
@@ -151,7 +151,7 @@
else {
if (DEBUG_OR_NOT(DEBUG_LEVEL_WARNING,DEBUG_AREA_MAIN))
g_message("%s parse_ports: Malformed line", prefix);
- }
+ }
} else
ports.nbports = 0;
@@ -769,7 +769,7 @@
user = get_rid_of_domain((char*)username);
#ifdef DEBUG_ENABLE
if (DEBUG_OR_NOT(DEBUG_LEVEL_VERBOSE_DEBUG,DEBUG_AREA_MAIN))
- g_message("Looking for group(s) for user %s", user);
+ g_message("Looking for group(s) for user %s", user);
#endif
// Let's look for the first node with matching username
ref.username = (char*)user;
@@ -976,58 +976,59 @@
// ICMP?
if (netdata->protocol == IPPROTO_ICMP) {
- // TODO Check ICMP
- g_message("[plaintext] ICMP code not yet supported! :-(\n");
- g_message("[plaintext] faking ICMP support");
- if (p_acl->proto == IPPROTO_ICMP){
- g_message("[plaintext] ICMP acls");
- }
+ // TODO Check ICMP
+ g_message("[plaintext] ICMP code not yet supported! :-(\n");
+ g_message("[plaintext] faking ICMP support");
+ if (p_acl->proto == IPPROTO_ICMP){
+ g_message("[plaintext] ICMP acls");
+ }
} else {
- // Following is only for TCP / UDP (ports stuff...)
- if (p_acl->proto != IPPROTO_TCP && p_acl->proto != IPPROTO_UDP) {
- g_message("[plaintext] Unsupported protocol: %d",
p_acl->proto);
- continue;
- }
-
- // Check source port
- if (p_acl->src_ports) {
- int found = 0;
- struct T_ports *p_ports;
- GSList *pl_ports = p_acl->src_ports;
- for ( ; pl_ports ; pl_ports = g_slist_next(pl_ports)) {
- p_ports = (struct T_ports*)pl_ports->data;
- if (!p_ports->firstport ||
- ((netdata->source >=
p_ports->firstport) &&
- (netdata->source <=
p_ports->firstport+p_ports->nbports))) {
- found = 1;
- break;
- }
- }
- if (!found)
- continue;
- }
- // Check destination port
- if (p_acl->dst_ports) {
- int found = 0;
- struct T_ports *p_ports;
- GSList *pl_ports = p_acl->dst_ports;
- for ( ; pl_ports ; pl_ports = g_slist_next(pl_ports)) {
- p_ports = (struct T_ports*)pl_ports->data;
- if (!p_ports->firstport ||
- ((netdata->dest >=
p_ports->firstport) &&
- (netdata->dest <=
p_ports->firstport+p_ports->nbports))) {
- found = 1;
- break;
- }
- }
- if (!found)
- continue;
- }
- }
+ // Following is only for TCP / UDP (ports stuff...)
+ if (p_acl->proto != IPPROTO_TCP && p_acl->proto != IPPROTO_UDP) {
+ g_message("[plaintext] Unsupported protocol: %d", p_acl->proto);
+ continue;
+ }
+
+ // Check source port
+ if (p_acl->src_ports) {
+ int found = 0;
+ struct T_ports *p_ports;
+ GSList *pl_ports = p_acl->src_ports;
+ for ( ; pl_ports ; pl_ports = g_slist_next(pl_ports)) {
+ p_ports = (struct T_ports*)pl_ports->data;
+ if (!p_ports->firstport ||
+ ((netdata->source >= p_ports->firstport) &&
+ (netdata->source <=
p_ports->firstport+p_ports->nbports))) {
+ found = 1;
+ break;
+ }
+ }
+ if (!found)
+ continue;
+ }
+ // Check destination port
+ if (p_acl->dst_ports) {
+ int found = 0;
+ struct T_ports *p_ports;
+ GSList *pl_ports = p_acl->dst_ports;
+ for ( ; pl_ports ; pl_ports = g_slist_next(pl_ports)) {
+ p_ports = (struct T_ports*)pl_ports->data;
+ if (!p_ports->firstport ||
+ ((netdata->dest >= p_ports->firstport) &&
+ (netdata->dest <=
p_ports->firstport+p_ports->nbports))) {
+ found = 1;
+ break;
+ }
+ }
+ if (!found)
+ continue;
+ }
+ }
+
// We have a match 8-)
- if (DEBUG_OR_NOT(DEBUG_LEVEL_VERBOSE_DEBUG,DEBUG_AREA_MAIN)){
- g_message("[plaintext] matching with decision %d", p_acl->decision);
- }
+ if (DEBUG_OR_NOT(DEBUG_LEVEL_VERBOSE_DEBUG,DEBUG_AREA_MAIN)){
+ g_message("[plaintext] matching with decision %d", p_acl->decision);
+ }
this_acl=g_new0(struct acl_group, 1);
g_assert(this_acl);
this_acl->answer = p_acl->decision;
@@ -1037,8 +1038,8 @@
#ifdef DEBUG_ENABLE
if (DEBUG_OR_NOT(DEBUG_LEVEL_VERBOSE_DEBUG,DEBUG_AREA_MAIN)){
- g_message("[plaintext] We are leaving acl_check()");
- g_message("(DBG) [plaintext] check_acls leaves with %p", g_list);
+ g_message("[plaintext] We are leaving acl_check()");
+ g_message("(DBG) [plaintext] check_acls leaves with %p", g_list);
}
#endif
return g_list;