For KDBUS_CMD_NAME_RELEASE:
- -EINVAL Invalid command flags provided
+ -EINVAL Invalid command flags, or invalid name provided
-ESRCH Name is not found found in the registry
-EADDRINUSE Name is owned by a different connection and can't be released
* Copyright (C) 2013-2014 Daniel Mack <daniel@zonque.org>
* Copyright (C) 2013-2014 David Herrmann <dh.herrmann@gmail.com>
* Copyright (C) 2013-2014 Linux Foundation
+ * Copyright (C) 2014 Djalal Harouni
*
* kdbus is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
if (ret < 0)
return -EINVAL;
+ if (!kdbus_name_is_valid(name, false))
+ return -EINVAL;
+
/*
* Do atomic_inc_return here to reserve our slot, then decrement
* it before returning.
if (ret < 0)
return -EINVAL;
+ if (!kdbus_name_is_valid(name, false))
+ return -EINVAL;
+
ret = kdbus_ep_policy_check_see_access(conn->ep, conn, name);
if (ret < 0)
return ret;