From 54390d5f2139dc7a031c0e3f478226e09b955494 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Sun, 13 Jan 2013 03:38:53 +0100 Subject: [PATCH] Add check for multiple keys in one invocation --- authorized_key | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authorized_key b/authorized_key index 0ef2cea82da..f65d8bfca65 100644 --- a/authorized_key +++ b/authorized_key @@ -143,6 +143,9 @@ def enforce_state(module, params): key = params["key"] state = params.get("state", "present") + if '\n' in key: + module.fail_json(msg="key= can only contain a single key") + # check current state -- just get the filename, don't create file params["keyfile"] = keyfile(module, user, write=False) keys = readkeys(params["keyfile"]) @@ -174,7 +177,6 @@ def main(): ) ) - params = module.params results = enforce_state(module, module.params) module.exit_json(**results)