[daemon-fix] Fixed sending daemon match rules for kdbus broadcasts
[platform/upstream/dbus.git] / dbus / dbus-auth-script.c
index 79006b9..c1f0c88 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- mode: C; c-file-style: "gnu" -*- */
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /* dbus-auth-script.c Test DBusAuth using a special script file (internal to D-Bus implementation)
  * 
  * Copyright (C) 2003 Red Hat, Inc.
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 #include <config.h>
 
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
 
 #include "dbus-auth-script.h"
 #include "dbus-auth.h"
@@ -223,7 +223,7 @@ auth_set_unix_credentials(DBusAuth  *auth,
   if (uid != DBUS_UID_UNSET)
     _dbus_credentials_add_unix_uid (credentials, uid);
   if (pid != DBUS_PID_UNSET)
-    _dbus_credentials_add_unix_pid (credentials, pid);
+    _dbus_credentials_add_pid (credentials, pid);
 
   _dbus_auth_set_credentials (auth, credentials);
 
@@ -244,7 +244,7 @@ dbus_bool_t
 _dbus_auth_script_run (const DBusString *filename)
 {
   DBusString file;
-  DBusError error;
+  DBusError error = DBUS_ERROR_INIT;
   DBusString line;
   dbus_bool_t retval;
   int line_no;
@@ -276,7 +276,6 @@ _dbus_auth_script_run (const DBusString *filename)
       return FALSE;
     }
 
-  dbus_error_init (&error);
   if (!_dbus_file_get_contents (&file, filename, &error))    {
       _dbus_warn ("Getting contents of %s failed: %s\n",
                   _dbus_string_get_const_data (filename), error.message);
@@ -801,4 +800,4 @@ _dbus_auth_script_run (const DBusString *filename)
 }
 
 /** @} */
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */