mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
quote bsd_shadow
This commit is contained in:
parent
3286bc0833
commit
f68a16310e
@ -9,6 +9,11 @@ try:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from shlex import quote as cmd_quote
|
||||
except ImportError:
|
||||
from pipes import quote as cmd_quote
|
||||
|
||||
# Define the module's virtual name
|
||||
__virtualname__ = 'shadow'
|
||||
|
||||
@ -53,9 +58,9 @@ def info(name):
|
||||
# Get password aging info on FreeBSD
|
||||
# TODO: Implement this for NetBSD, OpenBSD
|
||||
if __salt__['cmd.has_exec']('pw'):
|
||||
cmd = 'pw user show {0} | cut -f6,7 -d:'.format(name)
|
||||
cmd = 'pw user show {0} | cut -f6,7 -d:'.format(cmd_quote(name))
|
||||
try:
|
||||
change, expire = __salt__['cmd.run_all'](cmd)['stdout'].split(':')
|
||||
change, expire = __salt__['cmd.run_all'](cmd, python_shell=True)['stdout'].split(':')
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user