SnapdClient *client = NULL; // Data structure of snapd access
GError *error = NULL; // Glib error
int ret = 1; // Return value
+# if !CUPS_SNAP
SnapdSnap *snap = NULL; // Data structure of client Snap
- SnapdClient *snapd = NULL; // Data structure of snapd access
+# endif // !CUPS_SNAP
# ifdef AF_LOCAL
const char *cookie; // snapd access cookie
int status = 65535; // Status of client Snap context check
- const char *args[] = // snapctl arguments
+ char *args[] = // snapctl arguments
{
"is-connected",
"--apparmor-label",
if ((cookie = g_getenv("SNAP_COOKIE")) == NULL)
{
cookie = "";
- cupsdLogClient(CUPSD_LOG_WARN, "No SNAP_COOKIE set in the Snap environment.");
+ cupsdLogClient(con, CUPSD_LOG_WARN, "No SNAP_COOKIE set in the Snap environment.");
}
// Do the client Snap context check...
cupsdLogClient(con, CUPSD_LOG_DEBUG, "Classic snap - allowed.");
}
// Check whether the client Snap has the cups-control plug
- else if (!snapd_client_get_connections2_sync(snapd, SNAPD_GET_CONNECTIONS_FLAGS_NONE, snap_name, "cups-control", NULL, NULL, &plugs, NULL, NULL, &error))
+ else if (!snapd_client_get_connections2_sync(client, SNAPD_GET_CONNECTIONS_FLAGS_NONE, snap_name, "cups-control", NULL, NULL, &plugs, NULL, NULL, &error))
{
cupsdLogClient(con, CUPSD_LOG_DEBUG, "Unable to get client Snap plugs: %s", error->message);
ret = 0;