summaryrefslogtreecommitdiff
path: root/src/polkitmateauthenticator.c
diff options
context:
space:
mode:
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);
}