summaryrefslogtreecommitdiffstats
path: root/src/providers/data_provider_be.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-05-20 10:12:47 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-05-20 14:04:56 -0400
commit918c5863cf6f8e7b43c643dd623263df865cc109 (patch)
tree7cfc591ca22775a1b275d897ccf7435b5c2dc864 /src/providers/data_provider_be.c
parent11fde1c71b4dcae312e5fcfecd8db38b6924801c (diff)
downloadsssd-918c5863cf6f8e7b43c643dd623263df865cc109.tar.gz
sssd-918c5863cf6f8e7b43c643dd623263df865cc109.tar.xz
sssd-918c5863cf6f8e7b43c643dd623263df865cc109.zip
Copy pam data from DBus message
Instead of just using references to the pam data inside of the DBus message the data is copied. New the DBus message can be freed at any time and the pam data is part of the memory hierarchy. Additionally it is possible to overwrite the authentication tokens in the DBus message, because it is not used elsewhere.
Diffstat (limited to 'src/providers/data_provider_be.c')
-rw-r--r--src/providers/data_provider_be.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 4ece1b68a..10328a05c 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -536,10 +536,13 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn)
be_req->fn = be_pam_handler_callback;
be_req->pvt = reply;
- pd = talloc_zero(be_req, struct pam_data);
- if (!pd) {
+ dbus_error_init(&dbus_error);
+
+ ret = dp_unpack_pam_request(message, be_req, &pd, &dbus_error);
+ if (!ret) {
+ DEBUG(1,("Failed, to parse message!\n"));
talloc_free(be_req);
- return ENOMEM;
+ return EIO;
}
pd->pam_status = PAM_SYSTEM_ERR;
@@ -549,14 +552,6 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn)
return ENOMEM;
}
- dbus_error_init(&dbus_error);
-
- ret = dp_unpack_pam_request(message, pd, &dbus_error);
- if (!ret) {
- DEBUG(1,("Failed, to parse message!\n"));
- talloc_free(be_req);
- return EIO;
- }
DEBUG(4, ("Got request with the following data\n"));
DEBUG_PAM_DATA(4, pd);