static int vnc_auth_sasl_check_access(VncState *vs)

{

    const void *val;

    int err;



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

    if (err != SASL_OK) {

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

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

	return -1;

    }

    if (val == NULL) {

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

	return -1;

    }

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



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



    return 0;

}

static int vnc_auth_sasl_check_access(VncState *vs)

{

    const void *val;

    int err;



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

    if (err != SASL_OK) {

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

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

	return -1;

    }

    if (val == NULL) {

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

	return -1;

    }

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



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



    return 0;

}

static int FUNC_0(VncState *VAR_0)

{

    const void *VAR_1;

    int VAR_2;



    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)\n",

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

	return -1;

    }

    if (VAR_1 == NULL) {

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

	return -1;

    }

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



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



    return 0;

}

static int FUNC_0(VncState *VAR_0)
{ const void *VAR_1; int VAR_2; 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)\n",
VAR_2, sasl_errstring(VAR_2, NULL, NULL)); return -1; } if (VAR_1 == NULL) { VNC_DEBUG("no client username was found\n"); return -1; } VNC_DEBUG("SASL client username %s\n", (const char *)VAR_1); VAR_0->sasl.username = qemu_strdup((const char*)VAR_1); return 0; }