[CentOS] Very weird problem with handling symbolic links

Mon Sep 17 09:05:00 UTC 2018
Nicolas Kovacs <info at microlinux.fr>

Hi everyone,

I just discovered something very weird on a vanilla CentOS 7
installation. If I create a link to /tmp as a normal user, it looks like
I can't remove this link anymore. Here's what this looks like:

  $ mkdir test_link
  $ cd test_link/
  $ ln -s /tmp/ link_to_tmp
  $ ls -l
  total 0
  lrwxrwxrwx. 1 kikinovak kikinovak 5 Sep 17 10:56 link_to_tmp -> /tmp/
  $ rm link_to_tmp/
  rm: cannot remove ‘link_to_tmp/’: Is a directory
  $ rmdir link_to_tmp/
  rmdir: failed to remove ‘link_to_tmp/’: Not a directory

I tried the same thing on a different box, running Slackware 14.2, and I
can remove my symbolic link without any hassle.

I sense something is very wrong here. Any suggestions?

Niki
-- 
Microlinux - Solutions informatiques durables
7, place de l'église - 30730 Montpezat
Site : https://www.microlinux.fr
Blog : https://blog.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32