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:
parent
981f451f0e
commit
8867d73420
1 changed files with 4 additions and 0 deletions
|
@ -890,6 +890,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…
Reference in a new issue