Commit 163f2d14 authored by Giovanni Mascellani's avatar Giovanni Mascellani Committed by Ray Strode

daemon: fix object path derivation for large UIDs

accountsservice exports an object on the system bus
for every user it tracks. The path of the object is
derived from the user's uid.

The format string used for computing the object path
supposes the UID is signed. UIDs are unsigned quantities,
though, so very large UIDs get misrepresented as negative
values in the resulting object path. The negative sign
"-" is invalid in an object path. Under these circumstances,
accountsservice will crash.

This commit corrects the problem, by using a format string
that is appropriate for unsigned values.

https://bugs.freedesktop.org/show_bug.cgi?id=85688
parent 3d6d1259
......@@ -722,8 +722,8 @@ compute_object_path (User *user)
{
gchar *object_path;
object_path = g_strdup_printf ("/org/freedesktop/Accounts/User%ld",
(long) user->uid);
object_path = g_strdup_printf ("/org/freedesktop/Accounts/User%lu",
(gulong) user->uid);
return object_path;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment