sssd_dbus_request.c revision 91c637615fc45679235b3371792e2eaf63a62b4f
/*
Authors:
Stef Walter <stefw@redhat.com>
Copyright (C) 2014 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "util/sss_utf8.h"
#include "sbus/sssd_dbus.h"
#include "sbus/sssd_dbus_private.h"
#define INTERNAL_ERROR "Internal Error"
{
return 0;
}
struct sbus_request *
struct sbus_interface *intf,
{
struct sbus_request *dbus_req;
if (!dbus_req) {
return NULL;
}
return dbus_req;
}
void
void *handler_data,
{
int ret;
if (invoker_fn != NULL) {
} else if (handler_fn != NULL) {
} else {
}
switch(ret) {
case ERR_SBUS_REQUEST_HANDLED:
case EOK:
return;
case ENOMEM:
break;
default:
break;
}
}
{
if (reply) {
}
return talloc_free(dbus_req);
}
{
#ifdef HAVE_DBUSBASICVALUE
int type;
const DBusBasicValue *value;
bool ok;
while (type != DBUS_TYPE_INVALID) {
if (type == DBUS_TYPE_STRING) {
if (!ok) {
"sbus message argument [%s] contains invalid "
break;
}
}
}
#endif /* HAVE_DBUSBASICVALUE */
return ret;
}
int first_arg_type,
...)
{
int ret;
}
if (!reply) {
return ENOMEM;
}
if (dbret) {
} else {
}
return ret;
}
{
int ret;
return ENOMEM;
}
if (!reply) {
return ENOMEM;
}
return ret;
}
const char *dbus_err_name,
const char *fmt,
...)
{
const char *err_msg_dup = NULL;
if (fmt) {
if (err_msg_dup == NULL) {
return NULL;
}
}
return dberr;
}
struct array_arg {
char **dbus_array;
};
{
return 0;
}
static bool
{
int arg_type;
void **arg_ptr;
/*
* Here we iterate through the entire thing again and look for
* things we need to fix allocation for. Normally certain types
* returned from dbus_message_get_args() and friends require
* later freeing. We tie those to the talloc context here.
*
* The list of argument has already been validated by the previous
* dbus_message_get_args() call, so we can be cheap.
*/
while (arg_type != DBUS_TYPE_INVALID) {
if (arg_type == DBUS_TYPE_ARRAY) {
/* Arrays of these things need to be freed */
if (arg_type == DBUS_TYPE_STRING ||
arg_type == DBUS_TYPE_SIGNATURE) {
/* no kidding ... */
return false;
}
}
/* A non array argument */
} else {
}
/* The next type */
}
return true;
}
bool
int first_arg_type,
...)
{
bool ret = true;
first_arg_type, va)) {
} else {
/* Trying to send the error back to the caller in this case is a joke */
if (!dbus_error_is_set(&error) &&
/* Log other errors and send them back, this include o.f.d.InvalidArgs */
} else {
}
ret = false;
}
return ret;
}
struct sbus_get_sender_id_state {
struct sbus_connection *conn;
char *sender;
};
struct tevent_context *ev,
struct sbus_connection *conn,
const char *sender)
{
struct tevent_req *req;
struct sbus_get_sender_id_state *state;
return NULL;
}
goto immediate;
}
goto immediate;
}
goto immediate;
}
goto immediate;
}
"Looking for identity of sender [%s]\n", sender);
if (ret == HASH_SUCCESS) {
"%s already present in the clients table\n", sender);
goto immediate;
} else if (ret != HASH_ERROR_KEY_NOT_FOUND) {
"Failed to look up %s in the clients table\n", sender);
goto immediate;
}
/* We don't know this sender yet, let's ask the system bus */
/* Connect to the well-known system bus */
"Failed to connect to D-BUS system bus.\n");
goto immediate;
}
/* If we ever need to get the SELinux context or the PID here, we need
* to call GetConnectionCredentials instead
*/
"/org/freedesktop/DBus", /* path */
"org.freedesktop.DBus", /* interface */
"GetConnectionUnixUser");
goto immediate;
}
if (!dbret) {
ret = ERR_INTERNAL;
goto immediate;
}
goto immediate;
}
return req;
} else {
}
}
}
return req;
}
{
struct tevent_req *req;
struct sbus_get_sender_id_state *state;
int ret;
if (!reply) {
/* reply should never be null. This function shouldn't be called
* until reply is valid or timeout has occurred. If reply is NULL
* here, something is seriously wrong and we should bail out.
*/
"Severe error. A reply callback was called but no reply "
"was received and no timeout occurred\n");
goto done;
}
if (!dbret) {
goto done;
}
if (ret != HASH_SUCCESS) {
goto done;
}
done:
} else {
}
}
{
struct sbus_get_sender_id_state *state = \
if (_uid) {
}
return EOK;
}