node.rmdir icon indicating copy to clipboard operation
node.rmdir copied to clipboard

Different behaviour when removing unowned files

Open radare opened this issue 9 years ago • 2 comments

this node module removes the foo/bar directory, but not the foo one. So the directory is not empty The system rm will just not remove anything because the foo/bar file is not owned by the user. So maybe we want to add some extra parameters

mkdir -p foo/bar
chmod 000 foo/bar
sudo chown root foo/bar
rm -rf foo
find foo 2> /dev/null
echo ===================
node index.js > /dev/null
find foo

index.js contains:

const rmdir = require('rmdir');
rmdir ('foo', (err, dirs) => {
        if (err) console.error ('Cannot find dir');
        else console.log(dirs);
});

radare avatar Jan 19 '16 01:01 radare

Also, the callback after removing the files passes the list of removed files/directories and it does contain foo/.. which it shouldnt

radare avatar Jan 19 '16 01:01 radare

As mentioned in another issue I'm not able to fix this right now :(

ben-lin avatar Jan 19 '16 04:01 ben-lin