mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
Fix random typos
Found via `codespell v2.1.dev0` `codespell -q 3 -L ans`
This commit is contained in:
parent
e95f448c44
commit
d15d3465a9
11 changed files with 13 additions and 13 deletions
|
@ -18,7 +18,7 @@ import (
|
||||||
"github.com/google/gopacket/layers"
|
"github.com/google/gopacket/layers"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Connection represents an outgoing connecion.
|
// Connection represents an outgoing connection.
|
||||||
type Connection struct {
|
type Connection struct {
|
||||||
Protocol string
|
Protocol string
|
||||||
SrcIP net.IP
|
SrcIP net.IP
|
||||||
|
|
|
@ -10,13 +10,13 @@ var (
|
||||||
IPv6Enabled = Exists("/proc/sys/net/ipv6")
|
IPv6Enabled = Exists("/proc/sys/net/ipv6")
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetHostname returns the name of the host where the damon is running.
|
// GetHostname returns the name of the host where the daemon is running.
|
||||||
func GetHostname() string {
|
func GetHostname() string {
|
||||||
hostname, _ := ioutil.ReadFile("/proc/sys/kernel/hostname")
|
hostname, _ := ioutil.ReadFile("/proc/sys/kernel/hostname")
|
||||||
return strings.Replace(string(hostname), "\n", "", -1)
|
return strings.Replace(string(hostname), "\n", "", -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetKernelVersion returns the name of the host where the damon is running.
|
// GetKernelVersion returns the name of the host where the daemon is running.
|
||||||
func GetKernelVersion() string {
|
func GetKernelVersion() string {
|
||||||
version, _ := ioutil.ReadFile("/proc/sys/kernel/version")
|
version, _ := ioutil.ReadFile("/proc/sys/kernel/version")
|
||||||
return strings.Replace(string(version), "\n", "", -1)
|
return strings.Replace(string(version), "\n", "", -1)
|
||||||
|
|
|
@ -150,9 +150,9 @@ func (q *Queue) Close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *Queue) destroy() {
|
func (q *Queue) destroy() {
|
||||||
// we'll try to exit cleanly, but sometimes nfqueue gets stucked
|
// we'll try to exit cleanly, but sometimes nfqueue gets stuck
|
||||||
time.AfterFunc(5*time.Second, func() {
|
time.AfterFunc(5*time.Second, func() {
|
||||||
log.Warning("queue stucked, closing by timeout")
|
log.Warning("queue stuck, closing by timeout")
|
||||||
if q != nil {
|
if q != nil {
|
||||||
C.close(q.fd)
|
C.close(q.fd)
|
||||||
q.closeNfq()
|
q.closeNfq()
|
||||||
|
|
|
@ -87,7 +87,7 @@ func GetSocketInfo(proto string, srcIP net.IP, srcPort uint, dstIP net.IP, dstPo
|
||||||
return uid, inodes
|
return uid, inodes
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSocketInfoByInode dumps the kernel sockets table and searchs the given
|
// GetSocketInfoByInode dumps the kernel sockets table and searches the given
|
||||||
// inode on it.
|
// inode on it.
|
||||||
func GetSocketInfoByInode(inodeStr string) (*Socket, error) {
|
func GetSocketInfoByInode(inodeStr string) (*Socket, error) {
|
||||||
inode, err := strconv.ParseUint(inodeStr, 10, 32)
|
inode, err := strconv.ParseUint(inodeStr, 10, 32)
|
||||||
|
|
|
@ -95,7 +95,7 @@ func cleanUpCaches() {
|
||||||
|
|
||||||
func getPidByInodeFromCache(inodeKey string) int {
|
func getPidByInodeFromCache(inodeKey string) int {
|
||||||
if _, found := inodesCache[inodeKey]; found == true {
|
if _, found := inodesCache[inodeKey]; found == true {
|
||||||
// sometimes the process may have dissapeared at this point
|
// sometimes the process may have disappeared at this point
|
||||||
if _, err := os.Lstat(fmt.Sprint("/proc/", inodesCache[inodeKey].Pid, "/exe")); err == nil {
|
if _, err := os.Lstat(fmt.Sprint("/proc/", inodesCache[inodeKey].Pid, "/exe")); err == nil {
|
||||||
return inodesCache[inodeKey].Pid
|
return inodesCache[inodeKey].Pid
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ func getPIDFromAuditEvents(inode int, inodeKey string, expect string) (int, int)
|
||||||
return -1, -1
|
return -1, -1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPIDFromINode tries to get the PID from a socket inode follwing these steps:
|
// GetPIDFromINode tries to get the PID from a socket inode following these steps:
|
||||||
// 1. Get the PID from the cache of Inodes.
|
// 1. Get the PID from the cache of Inodes.
|
||||||
// 2. Get the PID from the cache of PIDs.
|
// 2. Get the PID from the cache of PIDs.
|
||||||
// 3. Look for the PID using one of these methods:
|
// 3. Look for the PID using one of these methods:
|
||||||
|
|
|
@ -85,7 +85,7 @@ func (c *Client) Close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProcMonitorMethod returns the monitor method configured.
|
// ProcMonitorMethod returns the monitor method configured.
|
||||||
// If it's not present in the config file, it'll return an emptry string.
|
// If it's not present in the config file, it'll return an empty string.
|
||||||
func (c *Client) ProcMonitorMethod() string {
|
func (c *Client) ProcMonitorMethod() string {
|
||||||
config.RLock()
|
config.RLock()
|
||||||
defer config.RUnlock()
|
defer config.RUnlock()
|
||||||
|
|
|
@ -268,7 +268,7 @@ func (c *Client) listenForNotifications() {
|
||||||
}
|
}
|
||||||
// send the first notification
|
// send the first notification
|
||||||
if err := notisStream.Send(streamReply); err != nil {
|
if err := notisStream.Send(streamReply); err != nil {
|
||||||
log.Error("sending notfication HELLO", err)
|
log.Error("sending notification HELLO", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Info("Start receiving notifications")
|
log.Info("Start receiving notifications")
|
||||||
|
|
|
@ -174,7 +174,7 @@ class ConnectionsTableModel(QStandardItemModel):
|
||||||
self.map.insert(0, {'from':upperBound, 'to':lowerBound, 'hits':rowsInRange})
|
self.map.insert(0, {'from':upperBound, 'to':lowerBound, 'hits':rowsInRange})
|
||||||
self.prependedRowCount += rowsInRange
|
self.prependedRowCount += rowsInRange
|
||||||
if time.time() - starttime > 0.5:
|
if time.time() - starttime > 0.5:
|
||||||
#dont freeze the UI when fetching too many recent rows
|
#don't freeze the UI when fetching too many recent rows
|
||||||
break
|
break
|
||||||
|
|
||||||
self.totalRowCount = 0
|
self.totalRowCount = 0
|
||||||
|
|
|
@ -22,7 +22,7 @@ class LinuxDesktopParser(threading.Thread):
|
||||||
self.apps_by_name = {}
|
self.apps_by_name = {}
|
||||||
# some things are just weird
|
# some things are just weird
|
||||||
# (not really, i don't want to keep track of parent pids
|
# (not really, i don't want to keep track of parent pids
|
||||||
# just because of icons tho, this hack is way easier)
|
# just because of icons though, this hack is way easier)
|
||||||
self.fixes = {
|
self.fixes = {
|
||||||
'/opt/google/chrome/chrome': '/opt/google/chrome/google-chrome',
|
'/opt/google/chrome/chrome': '/opt/google/chrome/google-chrome',
|
||||||
'/usr/lib/firefox/firefox': '/usr/lib/firefox/firefox.sh',
|
'/usr/lib/firefox/firefox': '/usr/lib/firefox/firefox.sh',
|
||||||
|
|
|
@ -459,7 +459,7 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject):
|
||||||
|
|
||||||
context.add_callback(_on_client_closed)
|
context.add_callback(_on_client_closed)
|
||||||
|
|
||||||
# TODO: move to notificatons.py
|
# TODO: move to notifications.py
|
||||||
def new_node_message():
|
def new_node_message():
|
||||||
print("new node connected, listening for client responses...", addr)
|
print("new node connected, listening for client responses...", addr)
|
||||||
while self._exit == False:
|
while self._exit == False:
|
||||||
|
|
Loading…
Add table
Reference in a new issue