added some doc
[util-vserver.git] / util-vserver / lib_internal / unify-unify.c
index 7270532..a3d6a18 100644 (file)
@@ -57,6 +57,10 @@ Unify_unify(char const *src, struct stat const UNUSED *src_stat,
   }
 
   // and rename the old file to this name
+
+  // NOTE: this rename() is race-free; when an attacker makes 'tmpfile' a
+  // directory, the operation would fail; when making it a symlink to a file
+  // or directory, the symlink but not the file/directory would be overridden
   if (rename(dst, tmpfile)==-1) {
     perror("rename()");
     goto err;