summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-08-07 12:23:50 +0200
committerrbuj <[email protected]>2022-08-07 12:23:50 +0200
commit0b6e4a388c25fbc35b0eaf801e8a75712355eb9b (patch)
tree82c74c75c7b874674b9353307ad04f22a481c5d4
parent0413510860e133b8d1f166d1ebc167a158f6331f (diff)
downloadmate-polkit-0b6e4a388c25fbc35b0eaf801e8a75712355eb9b.tar.bz2
mate-polkit-0b6e4a388c25fbc35b0eaf801e8a75712355eb9b.tar.xz
Fix -Wsign-conversion warningsign-conversion
-rw-r--r--src/polkitmateauthenticationdialog.c4
-rw-r--r--src/polkitmateauthenticator.c7
2 files changed, 7 insertions, 4 deletions
diff --git a/src/polkitmateauthenticationdialog.c b/src/polkitmateauthenticationdialog.c
index 13123f2..14edc0e 100644
--- a/src/polkitmateauthenticationdialog.c
+++ b/src/polkitmateauthenticationdialog.c
@@ -650,7 +650,7 @@ polkit_mate_authentication_dialog_constructed (GObject *object)
GtkWidget *content_area;
gboolean have_user_combobox;
gchar *s;
- guint rows;
+ gint rows;
dialog = POLKIT_MATE_AUTHENTICATION_DIALOG (object);
@@ -791,7 +791,7 @@ polkit_mate_authentication_dialog_constructed (GObject *object)
rows = 0;
if (dialog->priv->details != NULL)
{
- guint n;
+ gint n;
gchar **keys;
keys = polkit_details_get_keys (dialog->priv->details);
diff --git a/src/polkitmateauthenticator.c b/src/polkitmateauthenticator.c
index 1ce8cc6..94f78c1 100644
--- a/src/polkitmateauthenticator.c
+++ b/src/polkitmateauthenticator.c
@@ -243,11 +243,14 @@ polkit_mate_authenticator_new (const gchar *action_id,
for (l = authenticator->identities, n = 0; l != NULL; l = l->next, n++)
{
PolkitUnixUser *user = POLKIT_UNIX_USER (l->data);
- uid_t uid;
+ gint uid;
struct passwd *passwd;
uid = polkit_unix_user_get_uid (user);
- passwd = getpwuid (uid);
+ if (uid == -1)
+ continue;
+
+ passwd = getpwuid ((uid_t) uid);
authenticator->users[n] = g_strdup (passwd->pw_name);
}