libvirt/tools/virt-login-shell.conf
Daniel P. Berrange 8a95d3df48 virt-login-shell: change way we request a login shell
Currently we request a login shell by passing the -l argument
to the shell. This is either hardcoded, or required to be
specified by the user in the virt-login-shell.conf file.

The standard way for login programs to request a shell run
as a login shell is to modify the argv passed to execve()
so that argv[0] contains the relative shell filename
prefixed with a zero. eg instead of doing

  const char **shellargs = ["/bin/bash", "-l", NULL];
  execve(shellargs[0], shellargs, env);

We should be doing

  const char **shellargs = ["-bash", NULL];
  execve("/bin/bash", shellargs, env);

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-06-10 11:03:01 +01:00

31 lines
1.3 KiB
Plaintext

# Master configuration file for the virt-login-shell program.
# All settings described here are optional - if omitted, sensible
# defaults are used.
# By default, virt-login-shell will connect you to a container running
# with the /bin/sh program. Modify the shell variable if you want your
# users to run a different shell or a setup container when joining a
# container. Shell commands must be a list of commands/options separated by
# comma and delimited by square brackets. Defaults to: /bin/sh -l.
# Modify and uncomment the following to modify the login shell.
#
# shell = [ "/bin/bash" ]
#
# Note there is no need to pass a '--login' / '-l' argument since
# virt-login-shell will always request a login shell
# allowed_users specifies the user names of all users that are allowed to
# execute virt-login-shell. You can specify the users as a comma
# separated list of usernames or user groups.
# The list of names support glob syntax.
# To disallow all users (default)
# allowed_users = []
# If you do not specify any names (default) then no one is allowed
# to use this executable.
# To allow fred and joe only
# allowed_users = ["fred", "joe"]
# To allow all users within a specific group prefix the group name with %.
# allowed_users = ["%engineers"]
# To allow all users specify the following
# allowed_users = [ "*" ]