Index: dbus/dbus-auth.c
===================================================================
--- dbus/dbus-auth.c	(revision 615)
+++ dbus/dbus-auth.c	(working copy)
@@ -1085,8 +1085,7 @@
   if (!_dbus_string_init (&plaintext))
     return FALSE;
   
-  if (!_dbus_string_append_uint (&plaintext,
-                                 _dbus_getuid ()))
+  if (!_dbus_append_uid (&plaintext))
     goto failed;
 
   if (!_dbus_string_hex_encode (&plaintext, 0,
Index: dbus/dbus-sysdeps-unix.c
===================================================================
--- dbus/dbus-sysdeps-unix.c	(revision 615)
+++ dbus/dbus-sysdeps-unix.c	(working copy)
@@ -1476,6 +1476,15 @@
   return getpid ();
 }
 
+
+
+dbus_bool_t
+_dbus_append_uid (DBusString  *str)
+{
+  return _dbus_string_append_uint(str, _dbus_getuid ());
+}
+
+
 /** Gets our UID
  * @returns process UID
  */
Index: dbus/dbus-sysdeps-win.c
===================================================================
--- dbus/dbus-sysdeps-win.c	(revision 615)
+++ dbus/dbus-sysdeps-win.c	(working copy)
@@ -1891,6 +1891,11 @@
 
 /** @} end of sysdeps-win */
 
+dbus_bool_t
+_dbus_append_uid (DBusString  *str)
+{
+  return _dbus_string_append_uint(str, _dbus_getuid ());
+}
 
 /** Gets our UID
  * @returns process UID
Index: dbus/dbus-sysdeps.h
===================================================================
--- dbus/dbus-sysdeps.h	(revision 615)
+++ dbus/dbus-sysdeps.h	(working copy)
@@ -224,6 +224,7 @@
 unsigned long _dbus_getpid (void);
 dbus_uid_t    _dbus_getuid (void);
 dbus_gid_t    _dbus_getgid (void);
+dbus_bool_t   _dbus_append_uid (DBusString *str);
 
 /** Opaque type representing an atomically-modifiable integer
  * that can be used from multiple threads.
Index: dbus/dbus-auth-script.c
===================================================================
--- dbus/dbus-auth-script.c	(revision 615)
+++ dbus/dbus-auth-script.c	(working copy)
@@ -432,8 +432,7 @@
                     goto out;
                   }
 
-                if (!_dbus_string_append_uint (&username,
-                                               _dbus_getuid ()))
+                if (!_dbus_append_uid (&username))
                   {
                     _dbus_warn ("no memory for userid\n");
                     _dbus_string_free (&username);
