int vnc_display_password(DisplayState *ds, const char *password)

{

    VncDisplay *vs = vnc_display;



    if (!vs) {

        return -EINVAL;

    }



    if (!password) {

        /* This is not the intention of this interface but err on the side

           of being safe */

        return vnc_display_disable_login(ds);

    }



    if (vs->password) {

        g_free(vs->password);

        vs->password = NULL;

    }

    vs->password = g_strdup(password);

    if (vs->auth == VNC_AUTH_NONE) {

        vs->auth = VNC_AUTH_VNC;

    }



    return 0;

}

int vnc_display_password(DisplayState *ds, const char *password)

{

    VncDisplay *vs = vnc_display;



    if (!vs) {

        return -EINVAL;

    }



    if (!password) {

        



        return vnc_display_disable_login(ds);

    }



    if (vs->password) {

        g_free(vs->password);

        vs->password = NULL;

    }

    vs->password = g_strdup(password);

    if (vs->auth == VNC_AUTH_NONE) {

        vs->auth = VNC_AUTH_VNC;

    }



    return 0;

}

int FUNC_0(DisplayState *VAR_0, const char *VAR_1)

{

    VncDisplay *vs = vnc_display;



    if (!vs) {

        return -EINVAL;

    }



    if (!VAR_1) {

        



        return vnc_display_disable_login(VAR_0);

    }



    if (vs->VAR_1) {

        g_free(vs->VAR_1);

        vs->VAR_1 = NULL;

    }

    vs->VAR_1 = g_strdup(VAR_1);

    if (vs->auth == VNC_AUTH_NONE) {

        vs->auth = VNC_AUTH_VNC;

    }



    return 0;

}

int FUNC_0(DisplayState *VAR_0, const char *VAR_1)
{ VncDisplay *vs = vnc_display; if (!vs) { return -EINVAL; } if (!VAR_1) { return vnc_display_disable_login(VAR_0); } if (vs->VAR_1) { g_free(vs->VAR_1); vs->VAR_1 = NULL; } vs->VAR_1 = g_strdup(VAR_1); if (vs->auth == VNC_AUTH_NONE) { vs->auth = VNC_AUTH_VNC; } return 0; }