avoid extra info being passed into mode

only permission info is valid
This commit is contained in:
Brian Coca 2016-03-04 14:48:30 -05:00
parent 8494d3867c
commit c3b874755f

View file

@ -663,6 +663,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, only permission info is allowed", details=mode)
prev_mode = stat.S_IMODE(path_stat.st_mode)
if prev_mode != mode: