reject extraneous data passed to mode

strictly permissions are allowed, file type info should not be passed in
alternate fixes #14771
This commit is contained in:
Brian Coca 2016-03-04 14:41:35 -05:00
parent 981f451f0e
commit 8867d73420

View file

@ -890,6 +890,10 @@ class AnsibleModule(object):
msg="mode must be in octal or symbolic form",
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)
if prev_mode != mode: