Thread (4 messages) 4 messages, 3 authors, 2016-06-15

Re: [RFC/PATCH] shell: allow 'help' command to disable interactive shell

From: Ethan Reesor <hidden>
Date: 2016-06-15 22:56:07

On Mon, Feb 11, 2013 at 2:01 AM, Junio C Hamano [off-list ref] wrote:
And for the remaining 20% of those who do not like the canned
message but still do not need any custom command, I think it is way
suboptimal to force them to create git-shell-commands directory for
47 users his host gives git-shell access to, and copy the "help"
script to all of them, only to get a customized message.  It would
help them quite a lot if you just called /etc/git/shell-disabled or
some hook that generates a customized message; then there is no need
to add any git-shell-commands directory and a "help" script every
time he gets one new user, no?

For those who _do_ want to give customized commands to their users,
they can already have "help" script to give a friendly message.  It
just felt silly to force sites to create the directory only to
refuse an access to the "custom commands" feature, especially when
the existence of that directory is a signal that the site may want
to give its users an acess to that feature.
Again, would it not be more elegant and powerful to A) have the
shell-disabled message/hook/etc specified by git-config on some level,
be it /etc/gitconfig or ~/.gitconfig, and B) have Jonathan's patch
whereby ~/git-shell-commands/help returning non-zero closes the
connection? Have shell.c read for settings in the pattern:
        [shell "disabled"]
                message = "Hi, this is your server speaking. I've
replaced the usual message."
                command = "/path/to/some/command"
If shell.disabled.command is defined, don't bother with the message.
If it is not, but shell.disabled.message is, display that. If neither
of them are, display the default message, and make that one more
friendly.

Even if that was implemented, there is still an argument for
Jonathan's patch. For example, I'm building a server where
~/git-shell-commands/help does something interesting. But sometimes,
something fails. When that something fails, I want to close the
connection for whatever reason.

So, any reason not to have both (on top of making a better default message)?

--
Ethan Reesor (Gmail)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help