static int vnc_auth_sasl_check_access(VncState *vs)

{

    const void *val;

    int err;

    int allow;



    err = sasl_getprop(vs->sasl.conn, SASL_USERNAME, &val);

    if (err != SASL_OK) {

        VNC_DEBUG("cannot query SASL username on connection %d (%s), denying access\n",

                  err, sasl_errstring(err, NULL, NULL));

        return -1;

    }

    if (val == NULL) {

        VNC_DEBUG("no client username was found, denying access\n");

        return -1;

    }

    VNC_DEBUG("SASL client username %s\n", (const char *)val);



    vs->sasl.username = g_strdup((const char*)val);



    if (vs->vd->sasl.acl == NULL) {

        VNC_DEBUG("no ACL activated, allowing access\n");

        return 0;

    }



    allow = qemu_acl_party_is_allowed(vs->vd->sasl.acl, vs->sasl.username);



    VNC_DEBUG("SASL client %s %s by ACL\n", vs->sasl.username,

              allow ? "allowed" : "denied");

    return allow ? 0 : -1;

}

static int vnc_auth_sasl_check_access(VncState *vs)

{

    const void *val;

    int err;

    int allow;



    err = sasl_getprop(vs->sasl.conn, SASL_USERNAME, &val);

    if (err != SASL_OK) {

        VNC_DEBUG("cannot query SASL username on connection %d (%s), denying access\n",

                  err, sasl_errstring(err, NULL, NULL));

        return -1;

    }

    if (val == NULL) {

        VNC_DEBUG("no client username was found, denying access\n");

        return -1;

    }

    VNC_DEBUG("SASL client username %s\n", (const char *)val);



    vs->sasl.username = g_strdup((const char*)val);



    if (vs->vd->sasl.acl == NULL) {

        VNC_DEBUG("no ACL activated, allowing access\n");

        return 0;

    }



    allow = qemu_acl_party_is_allowed(vs->vd->sasl.acl, vs->sasl.username);



    VNC_DEBUG("SASL client %s %s by ACL\n", vs->sasl.username,

              allow ? "allowed" : "denied");

    return allow ? 0 : -1;

}

        VNC_DEBUG("cannot query SASL username on connection %d (%s), denying access\n",                   err, sasl_errstring(err, NULL, NULL));         VNC_DEBUG("no client username was found, denying access\n");     VNC_DEBUG("SASL client username %s\n", (const char *)val);         VNC_DEBUG("no ACL activated, allowing access\n");     VNC_DEBUG("SASL client %s %s by ACL\n", vs->sasl.username,               allow ? "allowed" : "denied");                   err, sasl_errstring(err, NULL, NULL));                   err, sasl_errstring(err, NULL, NULL));
static int FUNC_0(VncState *VAR_0)

{

    const void *VAR_1;

    int VAR_2;

    int VAR_3;



    VAR_2 = sasl_getprop(VAR_0->sasl.conn, SASL_USERNAME, &VAR_1);

    if (VAR_2 != SASL_OK) {

        VNC_DEBUG("cannot query SASL username on connection %d (%s), denying access\n",

                  VAR_2, sasl_errstring(VAR_2, NULL, NULL));

        return -1;

    }

    if (VAR_1 == NULL) {

        VNC_DEBUG("no client username was found, denying access\n");

        return -1;

    }

    VNC_DEBUG("SASL client username %s\n", (const char *)VAR_1);



    VAR_0->sasl.username = g_strdup((const char*)VAR_1);



    if (VAR_0->vd->sasl.acl == NULL) {

        VNC_DEBUG("no ACL activated, allowing access\n");

        return 0;

    }



    VAR_3 = qemu_acl_party_is_allowed(VAR_0->vd->sasl.acl, VAR_0->sasl.username);



    VNC_DEBUG("SASL client %s %s by ACL\n", VAR_0->sasl.username,

              VAR_3 ? "allowed" : "denied");

    return VAR_3 ? 0 : -1;

}

static int FUNC_0(VncState *VAR_0)
{ const void *VAR_1; int VAR_2; int VAR_3; VAR_2 = sasl_getprop(VAR_0->sasl.conn, SASL_USERNAME, &VAR_1); if (VAR_2 != SASL_OK) { VNC_DEBUG("cannot query SASL username on connection %d (%s), denying access\n",
VAR_2, sasl_errstring(VAR_2, NULL, NULL)); return -1; } if (VAR_1 == NULL) { VNC_DEBUG("no client username was found, denying access\n"); return -1; } VNC_DEBUG("SASL client username %s\n", (const char *)VAR_1); VAR_0->sasl.username = g_strdup((const char*)VAR_1); if (VAR_0->vd->sasl.acl == NULL) { VNC_DEBUG("no ACL activated, allowing access\n"); return 0; } VAR_3 = qemu_acl_party_is_allowed(VAR_0->vd->sasl.acl, VAR_0->sasl.username); VNC_DEBUG("SASL client %s %s by ACL\n", VAR_0->sasl.username,
VAR_3 ? "allowed" : "denied"); return VAR_3 ? 0 : -1; }