Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap-exec: fix detection if cups interface is connected #11616

Merged
merged 3 commits into from
Apr 4, 2022

Commits on Apr 1, 2022

  1. snap-exec: fix detection if cups interface is connected

    The cups interface needs a way to set the environment variable
    `CUPS_SERVER` if the `cups` interface is connected. However we
    have no mechanism for setting environment vars based on interface
    connections currently. To workaround this, the cups work added
    a workaround in `snap-exec` that tried to detect if `cups` is
    connected and when it is set the environment. Unfortunately the
    code in there was too simplistic because it just checked if
    the directory `/var/cups` exists. However ths dir now always
    exists because it's needed as the mount point.
    
    This commit fixes the detection by checking if `/var/cups` is
    a bind mount. This is checked by looking at the `stat()` data
    and the `dev_t` field in there. If they differ it means the
    bind mount exists and the only thing that creates this bind
    mount is the `cups` `MountConnectedPlug()` code.
    
    This is not great but it fixes the spread failure we see
    in the `cups-control` test (which is a real bug) and should
    be good enough until we have a proper interface backend that
    can set environment variables.
    mvo5 committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    0e0a1a4 View commit details
    Browse the repository at this point in the history
  2. tests: re-enable interfaces-cups-control test

    For unknown reasons the error message on unplug changes when I
    run this on my 20.04 system so I updated the tests - this may
    need more investigation.
    mvo5 committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    c38706c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8cdcf30 View commit details
    Browse the repository at this point in the history