cmd.run runas does not properly change user on macOS #43185
Labels
Bug
broken, incorrect, or confusing behavior
P3
Priority 3
Platform
Relates to OS, containers, platform-based utilities like FS, system based apps
severity-medium
3rd level, incorrect or bad functionality, confusing and lacks a work around
stale
Milestone
Description of Issue/Question
On macOS, tools like https://github.com/mas-cli/mas, uses some Apple specific internal call to get user specific informations. When invoked through
cmd.run
with therunas
option set, they will not get the correct user specific data.The problem can be pinpointed to the use of
sudo
instead ofsu
as it can be reproduced directly with these two without involving salt at all (assuming testuser is logged into the AppStore and root is not):Setup
On the mac minion, install https://github.com/mas-cli/mas and log in as
testuser
. Do amas signin testuser@example.com t3stPassw0rd
.Steps to Reproduce Issue
Actual behavior:
Expected behavior:
The expected result can be obtained with this workaround:
Versions Report
==== master ====
Salt Version:
Salt: 2016.11.5
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
Jinja2: 2.9.6
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.5.1
ZMQ: 4.1.6
System Versions:
dist: Ubuntu 16.04 xenial
machine: x86_64
release: 4.8.0-1-amd64
system: Linux
version: Ubuntu 16.04 xenial
==== minion ====
Salt Version:
Salt: 2016.11.5
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
Jinja2: 2.9.6
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.5.1
ZMQ: 4.1.6
System Versions:
dist: Ubuntu 16.04 xenial
machine: x86_64
release: 4.8.0-1-amd64
system: Linux
version: Ubuntu 16.04 xenial
The text was updated successfully, but these errors were encountered: