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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- "3.5"
- "3.6"

before_install:
Expand Down
7 changes: 5 additions & 2 deletions container_shell/lib/dockage.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ def container_command(username, user_uid, user_gid, create_user, command, runuse
user_gid,
username)

#everything = "/bin/bash -c '{0} && {1}'".format(make_user, run_user)
everything = "/bin/bash -c '{0} && {1} && {2}'".format(make_group, make_user, run_user)
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)
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 && /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 ; /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 && /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 ; /sbin/runuser liz -c "/usr/local/bin/redis-cli"\''

self.assertEqual(cmd, expected)

Expand Down