Closed robanybody closed 1 year ago
You can edit startwm.sh
(specifically the wm_start
function) to start a specific desktop.
For example, on CentOS 7, instead of calling the wm_start
function, you could add a line like:
. /etc/X11/xinit/Xsession /prog/to/start
where /prog/to/start
could be something like /bin/gnome-session
or a custom script.
well that does not prevent a user from runing an "alternate shell" .
Looks like startwm.sh
would not run if "start a program" option is set to an existing program like usr\bin\lxterminal
.
By the way my startwm.sh
looks like this:
#!/bin/sh
exec /usr/bin/awesome
exit 1
found the place in code and commented it out:
sesman/session.c
if (s->directory != 0) { if (s->directory[0] != 0) { /* don't do anything g_set_current_dir(s->directory); */ } } if (s->program != 0) { if (s->program[0] != 0) { /* prevent use of alternate shell g_execlp3(s->program, s->program, 0); log_message(LOG_LEVEL_ALWAYS, "error starting program %s for user %s - pid %d", s->program, s->username, g_getpid()); */ log_message(LOG_LEVEL_ALWAYS, "attention user %s tried to start program %s for - pid %d we don't allow this", s->username, s->program, g_getpid()); } }
works !
I think removing/commenting out the code that you show is the only solution so far.
so then this is a feature request :-)
Would be nice to have an option to disable "alternative shell / startup program" via config would be even more great if you could put a default program in config would be super awesome, if you could enter an array of allowed programs
Thanks for the review I was not 100% sure whether "g_set_current_dir (s-> directory);" part of the alternative shell
I cannot promise to implement it but I stack it feature request.
Would you be willing to have a look at a pull request implementing a simple configuration option (alternative 1 as suggested by @robanybody) for this?
If you submit one, we'll look at it - thanks!
I take it you're thinking of putting an option in sesman.ini?
Great to hear :)
Yes, I was thinking about the Security section of the sesman.ini, since the code knows about that config anyway. It won't be this week, but I'll take a stab at it.
Sounds like a good place.
A couple of thoughts:-
Any questions, come back to me. I'm fairly occupied for a few days now anyway so there's no rush.
Most importantly, thanks for looking at this!
Fixed by #2634
Hi, is there a way to prevent Users from executing a single application instead of running the intended Desktop? I guess it would make sense to have an option in sesman.ini to set the intended behavior.