]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
* 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 1ac3d8d1e3f9404963fed44eac5c9ce1f1f32ccc..e83545083d4fd63937090712a8f788595a32d0ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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): 
index 225569fc0ca5bc039db262b84ccd4c6c641a84a6..eb145e49bd25eb9f2b931a2baa71aedd39bca53c 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 9651df74a10a12b8e708709442f1fba7a6c31e40..e47f6e36ab110dce38bb709084e9d91269abdaf0 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 af8ef0805f7e55377f345da71bfb3538573038ca..17c6b179d9098e25d05464dd8e7f55edc8cf132e 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 154619a5c8b5718fa3e9f26d948f183b6f82d32d..0cb92c612302f294e356618de18a4748f8631b6f 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 5f0ec56d6a101ab4952683484d035ebcedd7e029..6e1653e6983f53a5cdb9bdbe3fa2f7f6a945d26a 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 6ef205538f1424da90c58c53ab4f5f342b572b0c..46e2275ac28cf3cdcd0e1390d0ca6bf94784656c 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 ())