summaryrefslogtreecommitdiff
path: root/src/polkitmateauthenticator.c
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 /src/polkitmateauthenticator.c
parent0413510860e133b8d1f166d1ebc167a158f6331f (diff)
downloadmate-polkit-0b6e4a388c25fbc35b0eaf801e8a75712355eb9b.tar.bz2
mate-polkit-0b6e4a388c25fbc35b0eaf801e8a75712355eb9b.tar.xz
Fix -Wsign-conversion warningsign-conversion
Diffstat (limited to 'src/polkitmateauthenticator.c')
-rw-r--r--src/polkitmateauthenticator.c7
1 files changed, 5 insertions, 2 deletions
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);
}