Re: ForceCommand and NFS-shared home directories

This is a discussion on Re: ForceCommand and NFS-shared home directories within the OpenSSH Development forums, part of the Networking and Network Related category; On Mon, 24 Mar 2008, Mikhail Terekhov wrote: > > Yes in cases like my this option would be very ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-24-2008
Ben Lindstrom
 
Posts: n/a
Default Re: ForceCommand and NFS-shared home directories



On Mon, 24 Mar 2008, Mikhail Terekhov wrote:
>
> Yes in cases like my this option would be very useful.
> Meantime do you think that writing a wrapper script for the shell on the
> server that bypasses everything but the predefined in "ForceCommand"
> command would be a reasonable workaround?
>


Since it is sshd and not any shell running the ~/.ssh/rc file. No amount
of workarounds will resolve this. Only change the sshd can change this
behavior.

Taking a glance (because I don't have time to look at it fully right now)
the changes are ...

1. add: int is_forcedcommand; to session.h
2. modify line 1206 (or so) to read:

- /* ignore _PATH_SSH_USER_RC for subsystems */
+ /* ignore _PATH_SSH_USER_RC for subsystems and forced commands */
- if (!s->is_subsystem && (stat(_PATH_SSH_USER_RC, &st) >= 0)) {
+ if (!s->is_subsystem && !s->forcedcommand &&
+ (stat(_PATH_SSH_USER_RC, &st) >= 0)) {
snprintf(cmd, sizeof cmd, "%s -c '%s %s'",
shell, _PATH_BSHELL, _PATH_SSH_USER_RC);
4. Maybe initialize s->is_forcedcommand = 0; (maybe, because we may do a
bzero() or other such magic to clear memory for this struct)
3. Find the right place to set s->is_forcedcommand = 1; (Since I've been
out of the code for too many years. I can't state the right
place at this moment. I assume still somewhere in sessions.c)



- Ben
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/li...enssh-unix-dev
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:21 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0