reject extraneous data passed to mode

strictly permissions are allowed, file type info should not be passed in
alternate fixes #14771
pull/14814/merge
Brian Coca 8 years ago
parent 981f451f0e
commit 8867d73420

@ -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:

Loading…
Cancel
Save