Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019.08.28
2019.10.15
10 changes: 6 additions & 4 deletions container_shell/lib/dockage.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ def container_command(username, user_uid, user_gid, create_user, command, runuse
username)

fix_pty_ownership = 'chown {0}:{0} /dev/pts/0 2>/dev/null'.format(username)
everything = "/bin/bash -c '{0} && {1} && {2} ; {3}'".format(make_group,
make_user,
fix_pty_ownership,
run_user)
switch_dir = 'cd /home/{} 2>/dev/null'.format(username)
everything = "/bin/bash -c '{0} && {1} && {2} ; {3} ; {4}'".format(make_group,
make_user,
fix_pty_ownership,
switch_dir,
run_user)
elif command:
everything = command
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_dockage.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_create_no_command(self):
command='',
runuser='/sbin/runuser',
useradd='/sbin/adduser')
expected = "/bin/bash -c '/usr/sbin/groupadd --gid 9001 liz && /sbin/adduser -m --uid 9001 --gid 9001 -s /bin/bash liz 2>/dev/null && chown liz:liz /dev/pts/0 2>/dev/null ; /sbin/runuser liz -l '"
expected = "/bin/bash -c '/usr/sbin/groupadd --gid 9001 liz && /sbin/adduser -m --uid 9001 --gid 9001 -s /bin/bash liz 2>/dev/null && chown liz:liz /dev/pts/0 2>/dev/null ; cd /home/liz 2>/dev/null ; /sbin/runuser liz -l '"

self.assertEqual(cmd, expected)

Expand Down Expand Up @@ -125,7 +125,7 @@ def test_create_command(self):
command='/usr/local/bin/redis-cli',
runuser='/sbin/runuser',
useradd='/sbin/adduser')
expected = '/bin/bash -c \'/usr/sbin/groupadd --gid 9001 liz && /sbin/adduser -m --uid 9001 --gid 9001 -s /bin/bash liz 2>/dev/null && chown liz:liz /dev/pts/0 2>/dev/null ; /sbin/runuser liz -c "/usr/local/bin/redis-cli"\''
expected = '/bin/bash -c \'/usr/sbin/groupadd --gid 9001 liz && /sbin/adduser -m --uid 9001 --gid 9001 -s /bin/bash liz 2>/dev/null && chown liz:liz /dev/pts/0 2>/dev/null ; cd /home/liz 2>/dev/null ; /sbin/runuser liz -c "/usr/local/bin/redis-cli"\''

self.assertEqual(cmd, expected)

Expand Down