filter_extensions (const char * const *extensions)
{
        size_t i, j;
        GPtrArray *array = NULL;
        char **filtered_extensions = NULL;

        array = g_ptr_array_new ();

        for (i = 0; extensions[i] != NULL; i++) {
                for (j = 0; gdm_supported_pam_extensions[j] != NULL; j++) {
                        if (g_strcmp0 (extensions[i], gdm_supported_pam_extensions[j]) == 0) {
                                g_ptr_array_add (array, g_strdup (gdm_supported_pam_extensions[j]));
                                break;
                        }
                }
        }
        g_ptr_array_add (array, NULL);

        filtered_extensions = g_strdupv ((char **) array->pdata);

        g_ptr_array_free (array, TRUE);

        return filtered_extensions;
}
filter_extensions (const char * const *extensions)
{
        size_t i, j;
        GPtrArray *array = NULL;
        char **filtered_extensions = NULL;

        array = g_ptr_array_new ();

        for (i = 0; extensions[i] != NULL; i++) {
                for (j = 0; gdm_supported_pam_extensions[j] != NULL; j++) {
                        if (g_strcmp0 (extensions[i], gdm_supported_pam_extensions[j]) == 0) {
                                g_ptr_array_add (array, g_strdup (gdm_supported_pam_extensions[j]));
                                break;
                        }
                }
        }
        g_ptr_array_add (array, NULL);

        filtered_extensions = g_strdupv ((char **) array->pdata);

        g_ptr_array_free (array, TRUE);

        return filtered_extensions;
}