Added (unused) origin field in firewall gnome-shell UI.

Added some instructions.
shw_dev
shw 8 years ago
parent 1e84a6e168
commit 4955c6a66b

@ -0,0 +1,10 @@
Before running fw-daemon, make sure to export: GODEBUG=cgocheck=0
Also, here's a default fw-daemon-socks.json config file:
root@subgraph:/# cat /etc/fw-daemon-socks.json
{
"SocksListener": "tcp|127.0.0.1:9998",
"TorSocks": "tcp|127.0.0.1:9050"
}

@ -28,6 +28,7 @@ const DetailSection = new Lang.Class({
this.ipAddr = this._addDetails("IP Address:"); this.ipAddr = this._addDetails("IP Address:");
this.path = this._addDetails("Path:"); this.path = this._addDetails("Path:");
this.pid = this._addDetails("Process ID:"); this.pid = this._addDetails("Process ID:");
this.origin = this._addDetails("Origin:");
this.user = this._addDetails("User:"); this.user = this._addDetails("User:");
}, },
@ -39,10 +40,11 @@ const DetailSection = new Lang.Class({
return msg; return msg;
}, },
setDetails: function(ip, path, pid, user) { setDetails: function(ip, path, pid, user, origin) {
this.ipAddr.text = ip; this.ipAddr.text = ip;
this.path.text = path; this.path.text = path;
this.pid.text = pid.toString(); this.pid.text = pid.toString();
this.origin.text = origin;
this.user.text = user; this.user.text = user;
} }
}); });
@ -449,7 +451,7 @@ const PromptDialog = new Lang.Class({
} }
}, },
update: function(application, icon, path, address, port, ip, user, pid, proto, expanded, expert, action) { update: function(application, icon, path, address, port, ip, origin, user, pid, proto, expanded, expert, action) {
this._address = address; this._address = address;
this._port = port; this._port = port;
@ -478,6 +480,6 @@ const PromptDialog = new Lang.Class({
} }
this.optionList.buttonGroup._setChecked(this.optionList.scopeToIdx(action)) this.optionList.buttonGroup._setChecked(this.optionList.scopeToIdx(action))
this.info.setDetails(ip, path, pid, user); this.info.setDetails(ip, path, pid, user, origin);
}, },
}); });

@ -50,6 +50,7 @@ const FirewallPromptInterface = '<node> \
<arg type="s" direction="in" name="address" /> \ <arg type="s" direction="in" name="address" /> \
<arg type="i" direction="in" name="port" /> \ <arg type="i" direction="in" name="port" /> \
<arg type="s" direction="in" name="ip" /> \ <arg type="s" direction="in" name="ip" /> \
<arg type="s" direction="in" name="origin" /> \
<arg type="s" direction="in" name="user" /> \ <arg type="s" direction="in" name="user" /> \
<arg type="i" direction="in" name="pid" /> \ <arg type="i" direction="in" name="pid" /> \
<arg type="b" direction="in" name="expanded" /> \ <arg type="b" direction="in" name="expanded" /> \
@ -86,11 +87,11 @@ const FirewallPromptHandler = new Lang.Class({
}, },
RequestPromptAsync: function(params, invocation) { RequestPromptAsync: function(params, invocation) {
let [app, icon, path, address, port, ip, user, pid, expanded, expert, action] = params; let [app, icon, path, address, port, ip, origin, user, pid, expanded, expert, action] = params;
this._closeDialog(); this._closeDialog();
this._dialog = new Dialog.PromptDialog(invocation); this._dialog = new Dialog.PromptDialog(invocation);
this._invocation = invocation; this._invocation = invocation;
this._dialog.update(app, icon, path, address, port, ip, user, pid, "TCP", expanded, expert, action); this._dialog.update(app, icon, path, address, port, ip, origin, user, pid, "TCP", expanded, expert, action);
this._dialog.open(); this._dialog.open();
}, },

@ -5,6 +5,8 @@
int nfqueue_cb_new(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_data *nfa, void *data) { int nfqueue_cb_new(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_data *nfa, void *data) {
struct nfqnl_msg_packet_hdr *ph = nfq_get_msg_packet_hdr(nfa); struct nfqnl_msg_packet_hdr *ph = nfq_get_msg_packet_hdr(nfa);
// struct nfqnl_msg_packet_hw *hwph = nfq_get_packet_hw(nfa);
if(ph == NULL) { if(ph == NULL) {
return 1; return 1;

@ -42,7 +42,7 @@ func NewNFQueue(qid uint16) (nfq *nfQueue) {
} }
/* /*
This returns a channel that will recieve packets, This returns a channel that will receive packets,
the user then must call pkt.Accept() or pkt.Drop() the user then must call pkt.Accept() or pkt.Drop()
*/ */
func (this *nfQueue) Process() <-chan *Packet { func (this *nfQueue) Process() <-chan *Packet {

@ -75,6 +75,7 @@ func (p *prompter) processConnection(pc pendingConnection) {
addr, addr,
int32(pc.dstPort()), int32(pc.dstPort()),
pc.dst().String(), pc.dst().String(),
"---",
uidToUser(pc.procInfo().UID), uidToUser(pc.procInfo().UID),
int32(pc.procInfo().Pid), int32(pc.procInfo().Pid),
FirewallConfig.PromptExpanded, FirewallConfig.PromptExpanded,

Loading…
Cancel
Save