*
* 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>
#include "dbus-auth.h"
#include "dbus-string.h"
#include "dbus-list.h"
{
_dbus_verbose ("%s: Received invalid UTF-8 trace data from ANONYMOUS client\n",
DBUS_AUTH_NAME (auth));
-
- {
- DBusString plaintext;
- DBusString encoded;
- _dbus_string_init_const (&plaintext, "D-Bus " VERSION);
- _dbus_string_init (&encoded);
- _dbus_string_hex_encode (&plaintext, 0,
- &encoded,
- 0);
- _dbus_verbose ("%s: try '%s'\n",
- DBUS_AUTH_NAME (auth), _dbus_string_get_const_data (&encoded));
- }
return send_rejected (auth);
}
return FALSE;
if (!_dbus_string_append (&plaintext,
- "libdbus " VERSION))
+ "libdbus " DBUS_VERSION_STRING))
goto failed;
if (!_dbus_string_hex_encode (&plaintext, 0,
case DBUS_AUTH_COMMAND_AGREE_UNIX_FD:
_dbus_assert(auth->unix_fd_possible);
auth->unix_fd_negotiated = TRUE;
- _dbus_verbose("Sucessfully negotiated UNIX FD passing\n");
+ _dbus_verbose("Successfully negotiated UNIX FD passing\n");
return send_begin (auth);
case DBUS_AUTH_COMMAND_ERROR:
}
/**
+ * Creates a new auth conversation object for the client side of kdbus.
+ * In fact it only initialize structures and sets authenticated state
+ * because of different authentication-like mechanism in kdbus - policies
+ * TODO Probably to be checked and modified when kdbus will be documented
+ *
+ * @returns the new object or #NULL if no memory
+ */
+DBusAuth*
+_dbus_auth_client_new_kdbus (void)
+{
+ DBusAuth *auth;
+ DBusString guid_str;
+
+ if (!_dbus_string_init (&guid_str))
+ return NULL;
+
+ auth = _dbus_auth_new (sizeof (DBusAuthClient));
+ if (auth == NULL)
+ {
+ _dbus_string_free (&guid_str);
+ return NULL;
+ }
+
+ DBUS_AUTH_CLIENT (auth)->guid_from_server = guid_str;
+
+ auth->side = auth_side_client;
+ auth->state = &common_state_authenticated;
+ auth->unix_fd_negotiated = TRUE;
+
+ /* Start the auth conversation by sending AUTH for our default
+ * mechanism */
+/* if (!send_auth (auth, &all_mechanisms[0]))
+ {
+ _dbus_auth_unref (auth);
+ return NULL;
+ }*/
+
+ return auth;
+}
+
+/**
* Increments the refcount of an auth object.
*
* @param auth the auth conversation
}
/**
- * Queries whether unix fd passing was sucessfully negotiated.
+ * Queries whether unix fd passing was successfully negotiated.
*
* @param auth the auth conversion
* @returns #TRUE when unix fd passing was negotiated.