News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Minor bug when working with symbolic links.

Started by paulvdh, March 18, 2018, 05:28:31 PM

Previous topic - Next topic

paulvdh

I'm trying out CodeBlocks 16.01 on Linux (Debian testing/Buster) and I hit the first bug within half an hour.
When a link to a file is in a CodeBlocks project and the file is saved, the link is overwritten with a copy of the file.

How to uplicate:
1). Make a link:
asdf@dualcore:~/projects/avr/mumarnet/rollerblinds$ ln -fs ~/projects/avr/lib/timer0/timer0.cpp
asdf@dualcore:~/projects/avr/mumarnet/rollerblinds$ ls -hl timer*
lrwxrwxrwx 1 asdf asdf 45 Mar 18 17:08 timer0.cpp -> /home/asdf/projects/avr/lib/timer0/timer0.cpp
lrwxrwxrwx 1 asdf asdf 43 Mar 18 17:07 timer0.h -> /home/asdf/projects/avr/lib/timer0/timer0.h

2). Open codeblocks, edit timer0.cpp and  [CTRL + s] to save.
3). The link is now overwritten with a copy of the file:
asdf@dualcore:~/projects/avr/mumarnet/rollerblinds$ ls -hl timer*
-rwxr-xr-x 1 asdf asdf 6.5K Mar 18 17:11 timer0.cpp
lrwxrwxrwx 1 asdf asdf   43 Mar 18 17:07 timer0.h -> /home/asdf/projects/avr/lib/timer0/timer0


This also seems to be an very old bug. Apparently it was reported / diagnosed back in 2007.
http://forums.next.codeblocks.org/index.php/topic,5134.0.html

oBFusCATed

This one is fixed in 17.12 as far as I know.
We detect symbolic links and disable the save-to-temp-and-move operation we use.
Probably we should add an option for to disable this safer way for saving files.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]