summaryrefslogtreecommitdiff
path: root/server/responder/pam
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2009-09-14 09:55:33 +0200
committerSimo Sorce <ssorce@redhat.com>2009-09-14 12:08:57 -0400
commit4039db6e6b34330fec51bc765f40e85bf7b61141 (patch)
tree3902cd568b2c8785f8bb2594ba55c192d669ae9e /server/responder/pam
parentbecd1fdabfe87781a7342c7d5a925fabcbcb9361 (diff)
downloadsssd-4039db6e6b34330fec51bc765f40e85bf7b61141.tar.gz
sssd-4039db6e6b34330fec51bc765f40e85bf7b61141.tar.bz2
sssd-4039db6e6b34330fec51bc765f40e85bf7b61141.zip
make cli_pid mandatory and increase version number of pam protocol
Diffstat (limited to 'server/responder/pam')
-rw-r--r--server/responder/pam/pamsrv_cmd.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/server/responder/pam/pamsrv_cmd.c b/server/responder/pam/pamsrv_cmd.c
index 62cd2a50..671dc087 100644
--- a/server/responder/pam/pamsrv_cmd.c
+++ b/server/responder/pam/pamsrv_cmd.c
@@ -167,6 +167,26 @@ static int pam_parse_in_data_v2(struct sss_names_ctx *snctx,
}
+static int pam_parse_in_data_v3(struct sss_names_ctx *snctx,
+ struct pam_data *pd,
+ uint8_t *body, size_t blen)
+{
+ int ret;
+
+ ret = pam_parse_in_data_v2(snctx, pd, body, blen);
+ if (ret != EOK) {
+ DEBUG(1, ("pam_parse_in_data_v2 failed.\n"));
+ return ret;
+ }
+
+ if (pd->cli_pid == 0) {
+ DEBUG(1, ("Missing client PID.\n"));
+ return EINVAL;
+ }
+
+ return EOK;
+}
+
static int pam_parse_in_data(struct sss_names_ctx *snctx,
struct pam_data *pd,
uint8_t *body, size_t blen)
@@ -440,6 +460,9 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd)
case 2:
ret = pam_parse_in_data_v2(cctx->rctx->names, pd, body, blen);
break;
+ case 3:
+ ret = pam_parse_in_data_v3(cctx->rctx->names, pd, body, blen);
+ break;
default:
DEBUG(1, ("Illegal protocol version [%d].\n",
cctx->cli_protocol_version->version));
@@ -843,8 +866,9 @@ static int pam_cmd_chauthtok(struct cli_ctx *cctx) {
struct cli_protocol_version *register_cli_protocol_version(void)
{
static struct cli_protocol_version pam_cli_protocol_version[] = {
- {1, "2008-09-05", "initial version, \\0 terminated strings"},
+ {3, "2009-09-14", "make cli_pid mandatory"},
{2, "2009-05-12", "new format <type><size><data>"},
+ {1, "2008-09-05", "initial version, \\0 terminated strings"},
{0, NULL, NULL}
};