RFC on file_store()

Pavel Roskin proski at gnu.org
Sat Jun 16 23:14:28 UTC 2001


Hello, Pavel!

> > Sending zeroes is very bad. It means corrupted data on the remote side. Is
> > it possible to send break instead?
>
> Congratulation, you've just discovered problem in fish :-(.
>
> Ok, I knew about this before. Problem is: what to do? Do you think
> dropping connection and reconnecting is the right thing?

I think it should be possible to send EOF to dd without sending it to the
shell. I wouldn't bet on it though.

Dropping connection should be fine if nothing better can be done.

> [There's another ugly problem in fish: Imagine file full of rm -rf /
> being sent to remote. Imagine something wents horribly wrong (both dds
> killed). Hopefully that will just never happen in practice.]

1) Write fish_server and run it with exec. Maybe even upload fish_server
if it's not on the server.

2) Use safe mode in shell:

mkdir $HOME/.fish
ln -s /bin/rm $HOME/.fish/RaNdOmCoOkIe_rm
ln -s /bin/dd $HOME/.fish/RaNdOmCoOkIe_dd
...
PATH=$HOME/.fish/
exec sh -r

Now use RaNdOmCoOkIe_rm to remove files. "rm" won't work and neighter will
"/bin/rm". "RaNdOmCoOkIe" is a random string selected by the client.

Of course, "sh -r" is not portable, so this mode should be optional.

-- 
Regards,
Pavel Roskin





More information about the mc-devel mailing list