* reverted global rename of function _dbus_username_from_current_process.
authorRalf Habacker <ralf.habacker@freenet.de>
Thu, 14 Jun 2007 20:08:48 +0000 (20:08 +0000)
committerRalf Habacker <ralf.habacker@freenet.de>
Thu, 14 Jun 2007 20:08:48 +0000 (20:08 +0000)
It needs to much tests to verify that the change does not break anything. I had overseen that the signatures are different (** to *) which requires non trivial changes. This is one *major* disadvantage of elumating oop functionality with c. You are responsible for cleaning every object on every function return point, which could be a nightmare if you are not working with dbus all the days.

ChangeLog
dbus/dbus-auth-script.c
dbus/dbus-auth.c
dbus/dbus-keyring.c
dbus/dbus-sysdeps.h
dbus/dbus-userdb-util.c
dbus/dbus-userdb.c

index 1ac3d8d..e835450 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
 2007-06-14  Ralf Habacker  <ralf.habacker@freenet.de>
+
+       * reverted global rename of function _dbus_username_from_current_process. 
+       It needs to much tests to verify that the change does not break anything. 
+       I had overseen that the signatures are different and requires non
+       trivial changes. 
+       This is one *major* disadvantage of elumating oop functionality with c. 
+       You are responsible for cleaning every object on every function return point, 
+       which could be a nightmare if you are not working with dbus all the days.
+
+2007-06-14  Ralf Habacker  <ralf.habacker@freenet.de>
     
        * dbus/dbus-auth.c (handle_client_initial_response_cookie_sha1_mech): 
        fixed usage of _dbus_append_desired_identity()
index 225569f..eb145e4 100644 (file)
@@ -522,7 +522,7 @@ _dbus_auth_script_run (const DBusString *filename)
                     goto out;
                   }
 
-                if (!_dbus_append_desired_identity (&u) ||
+                if (!_dbus_username_from_current_process (&u) ||
                     !_dbus_string_copy (u, 0, &username,
                                         _dbus_string_get_length (&username)))
                   {
index 9651df7..e47f6e3 100644 (file)
@@ -780,15 +780,15 @@ static dbus_bool_t
 handle_client_initial_response_cookie_sha1_mech (DBusAuth   *auth,
                                                  DBusString *response)
 {
-  const DBusString username;
+  const DBusString *username;
   dbus_bool_t retval;
+
   retval = FALSE;
 
-  _dbus_string_init(&username);
-  if (!_dbus_append_desired_identity (&username))
+  if (!_dbus_username_from_current_process (&username))
     goto out_0;
 
-  if (!_dbus_string_hex_encode (&username, 0,
+  if (!_dbus_string_hex_encode (username, 0,
                                response,
                                _dbus_string_get_length (response)))
     goto out_0;
@@ -796,7 +796,6 @@ handle_client_initial_response_cookie_sha1_mech (DBusAuth   *auth,
   retval = TRUE;
   
  out_0:
-  _dbus_string_free(&username);
   return retval;
 }
 
index af8ef08..17c6b17 100644 (file)
@@ -738,7 +738,7 @@ _dbus_keyring_new_homedir (const DBusString *username,
     {
       const DBusString *const_homedir;
 
-      if (!_dbus_append_desired_identity (&username) ||
+      if (!_dbus_username_from_current_process (&username) ||
           !_dbus_homedir_from_current_process (&const_homedir))
         goto failed;
 
index 154619a..0cb92c6 100644 (file)
@@ -168,7 +168,7 @@ dbus_bool_t _dbus_credentials_add_from_current_process (DBusCredentials  *creden
 dbus_bool_t _dbus_credentials_parse_and_add_desired    (DBusCredentials  *credentials,
                                                         const DBusString *desired_identity);
 
-dbus_bool_t _dbus_append_desired_identity (const DBusString **username);
+dbus_bool_t _dbus_username_from_current_process (const DBusString **username);
 dbus_bool_t _dbus_append_desired_identity       (DBusString *str);
 
 dbus_bool_t _dbus_homedir_from_current_process  (const DBusString **homedir);
index 5f0ec56..6e1653e 100644 (file)
@@ -414,7 +414,7 @@ _dbus_userdb_test (const char *test_data_dir)
   unsigned long *group_ids;
   int n_group_ids, i;
 
-  if (!_dbus_append_desired_identity (&username))
+  if (!_dbus_username_from_current_process (&username))
     _dbus_assert_not_reached ("didn't get username");
 
   if (!_dbus_homedir_from_current_process (&homedir))
index 6ef2055..46e2275 100644 (file)
@@ -360,7 +360,7 @@ _dbus_user_database_flush_system (void)
  * @returns #FALSE if no memory
  */
 dbus_bool_t
-_dbus_append_desired_identity (const DBusString **username)
+_dbus_username_from_current_process (const DBusString **username)
 {
   _dbus_user_database_lock_system ();
   if (!init_system_db ())