reject extraneous data passed to mode

strictly permissions are allowed, file type info should not be passed in
alternate fixes #14771
pull/15204/head
Brian Coca 9 years ago committed by James Cammarata
parent c4dfa888d1
commit 45d070ba3a

@ -863,6 +863,10 @@ class AnsibleModule(object):
msg="mode must be in octal or symbolic form", msg="mode must be in octal or symbolic form",
details=str(e)) details=str(e))
if mode != stat.S_IMODE(mode):
# prevent mode from having extra info orbeing invalid long number
self.fail_json(path=path, msg="Invalid mode supplied", details=str(e))
prev_mode = stat.S_IMODE(path_stat.st_mode) prev_mode = stat.S_IMODE(path_stat.st_mode)
if prev_mode != mode: if prev_mode != mode:

Loading…
Cancel
Save