shw-merge v0.0.11
dma 7 years ago
parent 5f454f2c6b
commit 92276eed47

@ -371,7 +371,7 @@ func (p *Policy) filterPending(rule *Rule) {
for _, pc := range p.pendingQueue {
if rule.match(pc.src(), pc.dst(), pc.dstPort(), pc.hostname(), pc.proto(), pc.procInfo().UID, pc.procInfo().GID, uidToUser(pc.procInfo().UID), gidToGroup(pc.procInfo().GID)) {
log.Infof("Adding rule for: %s", rule.getString(FirewallConfig.LogRedact))
// log.Noticef("%s > %s", rule.getString(FirewallConfig.LogRedact), pc.print())
// log.Noticef("%s > %s", rule.getString(FirewallConfig.LogRedact), pc.print())
if rule.rtype == RULE_ACTION_ALLOW {
pc.accept()
} else if rule.rtype == RULE_ACTION_ALLOW_TLSONLY {
@ -542,19 +542,19 @@ func readFileDirect(filename string) ([]byte, error) {
}
data = data[0:i]
/*
/*
val, err := syscall.Read(fd, data)
if err != nil {
return nil, err
}
*/
*/
syscall.Close(fd)
/*
/*
if val < 65535 {
data = data[0:val]
}
*/
*/
return data, nil
}

@ -1,7 +1,7 @@
package sgfw
import (
// "encoding/binary"
// "encoding/binary"
"fmt"
"io/ioutil"
"net"
@ -236,7 +236,7 @@ func (rl *RuleList) filter(pkt *nfqueue.NFQPacket, src, dst net.IP, dstPort uint
return result
}
}
/**else {
/**else {
log.Notice("+ MATCH FAILED")
} */
}

Loading…
Cancel
Save