← Back to team overview

touch-packages team mailing list archive

[Bug 1377600] [NEW] ufw errors after ctr+c interupt

 

Public bug reported:

in ufw.util.get_netfilter_capabilities

```
    # Cleanup
    cmd([exe, '-F', chain])
    (rc, out) = cmd([exe, '-X', chain])
    if rc != 0:
        raise OSError(errno.ENOENT, out) # pragma: no cover
```

if the `ufw xxx` command is interrupt by ctrl+c, the cleanup is not called,
so every ufw cmd afterwards cause error:

```
ERROR: initcaps
[Errno 2] iptables: Chain already exists.
```

I think we should catch error and cleanup in a finally statement. 
Or cleanup related rules before ufw init.

** Affects: ufw (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: iptables

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ufw in Ubuntu.
https://bugs.launchpad.net/bugs/1377600

Title:
  ufw errors after ctr+c interupt

Status in “ufw” package in Ubuntu:
  New

Bug description:
  in ufw.util.get_netfilter_capabilities

  ```
      # Cleanup
      cmd([exe, '-F', chain])
      (rc, out) = cmd([exe, '-X', chain])
      if rc != 0:
          raise OSError(errno.ENOENT, out) # pragma: no cover
  ```

  if the `ufw xxx` command is interrupt by ctrl+c, the cleanup is not called,
  so every ufw cmd afterwards cause error:

  ```
  ERROR: initcaps
  [Errno 2] iptables: Chain already exists.
  ```

  I think we should catch error and cleanup in a finally statement. 
  Or cleanup related rules before ufw init.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ufw/+bug/1377600/+subscriptions


Follow ups

References