Skip to content

Commit bd8e863

Browse files
committed
firewallsettings.py: Drop enabling IPP client service
IPP client service in firewall was for CUPS broadcast, which is obsoleted technology and neither cupsd or cups-browsed provides it in the present. If user still depends CUPS broadcasts, the service can still be enabled in firewall SW directly.
1 parent 76269f2 commit bd8e863

2 files changed

Lines changed: 22 additions & 40 deletions

File tree

firewallsettings.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,6 @@ def add_service (self, service):
128128
else:
129129
raise FirewallError (e.code, e.msg)
130130

131-
def check_ipp_client_allowed (self):
132-
if not self._get_fw_data ():
133-
return True
134-
135-
return (IPP_CLIENT_SERVICE in self._fw_data.getServices () or
136-
[IPP_CLIENT_PORT, IPP_CLIENT_PROTOCOL] in self._fw_data.getPorts ())
137-
138131
def check_ipp_server_allowed (self):
139132
if not self._get_fw_data ():
140133
return True
@@ -249,11 +242,6 @@ def add_service (self, service):
249242
args.append ("--service=" + service)
250243
self._fw_data = (args, filename)
251244

252-
def check_ipp_client_allowed (self):
253-
return self._check_any_allowed (set(["--port=%s:%s" %
254-
(IPP_CLIENT_PORT, IPP_CLIENT_PROTOCOL),
255-
"--service=" + IPP_CLIENT_SERVICE]))
256-
257245
def check_ipp_server_allowed (self):
258246
return self._check_any_allowed (set(["--port=%s:%s" %
259247
(IPP_SERVER_PORT, IPP_SERVER_PROTOCOL),

newprinter.py

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,41 +2273,35 @@ def fillDeviceTab(self, current_uri=None):
22732273

22742274
def on_firewall_read (self, data):
22752275
f = self.firewall
2276-
allowed = True
2276+
mdns_allowed = False
2277+
22772278
try:
2278-
ipp_allowed = f.check_ipp_client_allowed ()
22792279
mdns_allowed = f.check_mdns_allowed ()
2280-
allowed = (ipp_allowed and mdns_allowed)
22812280

2282-
secondary_text = TEXT_adjust_firewall + "\n\n"
2283-
if not ipp_allowed:
2284-
secondary_text += ("- " +
2285-
_("Allow all incoming IPP Browse packets") +
2286-
"\n")
2287-
f.add_service (firewallsettings.IPP_CLIENT_SERVICE)
2288-
if not mdns_allowed:
2289-
secondary_text += ("- " +
2290-
_("Allow all incoming mDNS traffic") + "\n")
2291-
f.add_service (firewallsettings.MDNS_SERVICE)
2281+
if mdns_allowed:
2282+
debugprint("Firewall all OK, no changes needed")
2283+
return
22922284

2293-
if not allowed:
2294-
debugprint ("Asking for permission to adjust firewall:\n%s" %
2295-
secondary_text)
2296-
dialog = Gtk.MessageDialog (parent=self.NewPrinterWindow,
2297-
modal=True, destroy_with_parent=True,
2298-
message_type=Gtk.MessageType.QUESTION,
2299-
buttons=Gtk.ButtonsType.NONE,
2300-
text= _("Adjust Firewall"))
2301-
dialog.format_secondary_markup (secondary_text)
2302-
dialog.add_buttons (_("Do It Later"), Gtk.ResponseType.NO,
2303-
_("Adjust Firewall"), Gtk.ResponseType.YES)
2304-
dialog.connect ('response', self.adjust_firewall_response)
2305-
dialog.show ()
2285+
secondary_text = TEXT_adjust_firewall + "\n\n"
2286+
secondary_text += ("- " +
2287+
_("Allow all incoming mDNS traffic") + "\n")
2288+
f.add_service (firewallsettings.MDNS_SERVICE)
2289+
2290+
debugprint ("Asking for permission to adjust firewall:\n%s" %
2291+
secondary_text)
2292+
dialog = Gtk.MessageDialog (parent=self.NewPrinterWindow,
2293+
modal=True, destroy_with_parent=True,
2294+
message_type=Gtk.MessageType.QUESTION,
2295+
buttons=Gtk.ButtonsType.NONE,
2296+
text= _("Adjust Firewall"))
2297+
dialog.format_secondary_markup (secondary_text)
2298+
dialog.add_buttons (_("Do It Later"), Gtk.ResponseType.NO,
2299+
_("Adjust Firewall"), Gtk.ResponseType.YES)
2300+
dialog.connect ('response', self.adjust_firewall_response)
2301+
dialog.show ()
23062302
except (dbus.DBusException, Exception):
23072303
nonfatalException ()
23082304

2309-
if allowed:
2310-
debugprint ("Firewall all OK, no changes needed")
23112305

23122306
def adjust_firewall_response (self, dialog, response):
23132307
dialog.destroy ()

0 commit comments

Comments
 (0)