Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kerl deleted files home directory #8

Open
tholschuh opened this issue Jun 1, 2011 · 4 comments
Open

kerl deleted files home directory #8

tholschuh opened this issue Jun 1, 2011 · 4 comments

Comments

@tholschuh
Copy link

I keep my fingers away from kerl since it deleted a bunch of files in my home directory. There is a very dangerous delete option in the code which should be revised.

@evax
Copy link
Owner

evax commented Jun 1, 2011

I'm sorry about this, can you develop on what happened?
Were you using environment modifiers? Can you please post your .kerlrc file?

@tholschuh
Copy link
Author

I'll survive.. Unfortunately I don't have the kerl files anymore..
deleted everything in wrath. I've looked through the script to reproduce
what happened. As far as I remember I've curled kerl into my ~/bin
directory. I installed R14B02 through kerl but didn't remember it. So
I've compiled 03 myself but the kerl installed 02 in ~/bin was prior on
my path so my installation didn't work. I've tried to delete the kerl
installation with (as I remember):

~$ kerl delete installation .

Problem revolves IMO around ff lines 595 in kerl script.

Other than my problem I like the idea of having a tool organize erlang
installations.

Cheers

On 11-05-31 11:14 PM, evax wrote:

I'm sorry about this, can you develop on what happened?
Were you using environment modifiers? Can you please post your .kerlrc file?

@evax
Copy link
Owner

evax commented Jun 1, 2011

Ok, I think I understand what happened.
Before deleting an installation directory kerl tries to ensure it's really a kerl install dir by looking for an "activate" file.
In your case kerl actually found an "activate" file and deleted the whole directory but it was somehow a "shared" directory (you had other stuff in it before putting a kerl install inside) and kerl assumes its installation dirs are not shared and reserved for its exclusive use.
So to prevent other people to hit the problem I'll update the docs and maybe implement a check on install so that installation fails if the destination already exists and is not empty.
Does it sound like it addresses the issue?

@tholschuh
Copy link
Author

Frankly, I don't think that is enough. When installing ensure the install directory is empty and named by, e.g. build, and that you only remove the named directory when you delete. DO NOT delete on a given argument as in:

rm -rf $3

Do not trust any input! Use absolute paths. Implement a user interaction that asks before delete. Etc.

A "BTW: if you mess up the command, kerl might delete your home directory" in the documentation is not helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants