summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Mascellani <gio@debian.org>2014-10-31 09:44:55 -0400
committerRay Strode <rstrode@redhat.com>2014-10-31 09:50:51 -0400
commit163f2d14718edcabeffb785dc59f4406959b64c6 (patch)
tree2c13b14d02b7c53be1472cd07f16c90e36470d5d
parent3d6d125917073b06849c336c93e475a5a43c0dd9 (diff)
downloadaccountsservice-163f2d14718edcabeffb785dc59f4406959b64c6.tar.gz
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
-rw-r--r--src/user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/user.c b/src/user.c
index a720fb7..94ef58c 100644
--- a/src/user.c
+++ b/src/user.c
@@ -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;
}