link: remove root power to link to a directory
authorAlan Cox <alan@linux.intel.com>
Wed, 21 Feb 2018 20:35:48 +0000 (20:35 +0000)
committerAlan Cox <alan@linux.intel.com>
Wed, 21 Feb 2018 20:35:48 +0000 (20:35 +0000)
It's never used, it makes a nasty mess and it breaks the locking

Kernel/syscall_fs3.c

index 4f0f75a..c7c8141 100644 (file)
@@ -178,7 +178,7 @@ arg_t _link(void)
        if (!(ino = n_open(name1, NULLINOPTR)))
                return (-1);
 
-       if (getmode(ino) == MODE_R(F_DIR) && esuper())
+       if (getmode(ino) == MODE_R(F_DIR))
                goto nogood;
 
        if (ino->c_node.i_nlink == 0xFFFF) {