test.sh file deleted OS

test.sh file deleted OS  

  By: comsats on May 12, 2022, 1:13 p.m.

I have copied my code to the final submission template. I am using Ubuntu, when I ran test.sh, it deleted my OS completely, did anyone else also face this issue? I want to try to it on my other system now, but how can I avoid that OS is not affected.

 Last edited by: comsats on Aug. 15, 2023, 12:56 p.m., edited 1 time in total.

Re: test.sh file deleted OS  

  By: simon.j on May 12, 2022, 4:09 p.m.

😱 I did not face this issue, I hope you will find a solution quickly !

Re: test.sh file deleted OS  

  By: 王呆鹅 on May 13, 2022, 2:41 a.m.

The same thing happened to me. In test.sh, it will delete some files: rm -r $2/. So if you just run bash test.sh without any parameter, I think it will delete /.

 Last edited by: çŽ‹å‘†é¹… on Aug. 15, 2023, 12:56 p.m., edited 2 times in total.

Re: test.sh file deleted OS  

  By: mayugmaniparambil on May 13, 2022, 2:43 a.m.

This could happen if test.sh is run without specifying any arguments like 'sudo bash test.sh' There are no checks in the bash script for when no arguments are provided?

I think this line ' rm -r $2/* ' test.sh is dangerous as someone could run test.sh unknowingly with no argument or . and result in a deleted os and it doesn's raise any warnings or errors.

This should have been hidden by default or checks should have been in place. I have lost all my data for this project as well as a few others. Luckily I have partial backups.

OTHERS, PLEASE BE CAREFUL.

 Last edited by: mayugmaniparambil on Aug. 15, 2023, 12:56 p.m., edited 4 times in total.

Re: test.sh file deleted OS  

  By: LuukBoulogne on May 13, 2022, 9:05 a.m.

Thank you for your feedback. My apologies for any loss. There is indeed no check in place for the arguments passed to test.sh. We will improve this in future challenges.

Re: test.sh file deleted OS  

  By: LuukBoulogne on May 13, 2022, 9:52 a.m.

A prompt has now been added before deleting to the training baseline

Re: test.sh file deleted OS  

  By: comsats on May 13, 2022, 10:43 a.m.

Hi Luuk,

Can you please give the extension for some days. I tried again with arguments, and it deleted my code files again.

 Last edited by: comsats on Aug. 15, 2023, 12:56 p.m., edited 1 time in total.

Re: test.sh file deleted OS  

  By: LuukBoulogne on May 13, 2022, 12:55 p.m.

Yes. The deadline has now been extended to Sunday May 15th at 6:00 PM (Anywhere on Earth timezone). An announcement about this has been made in the Forum.

Best, Luuk