diff --git a/src/filesystem/interface.js b/src/filesystem/interface.js index 93e491b..67f5016 100644 --- a/src/filesystem/interface.js +++ b/src/filesystem/interface.js @@ -340,7 +340,7 @@ function FileSystem(options, callback) { { name: 'ftruncate' }, { name: 'futimes' }, { name: 'getxattr', promises: true, absPathArgs: [0] }, - { name: 'lchown' }, + { name: 'lchown', promises:true }, { name: 'link', promises: true, absPathArgs: [0, 1] }, { name: 'lseek' }, { name: 'lstat', promises: true }, diff --git a/tests/spec/fs.chown.spec.js b/tests/spec/fs.chown.spec.js index 575f779..d9bfc73 100644 --- a/tests/spec/fs.chown.spec.js +++ b/tests/spec/fs.chown.spec.js @@ -135,18 +135,6 @@ describe('fs.chown, fs.fchown, fs.lchown', function() { fs.stat('/file', function(err, stats) { if(err) throw err; - expect(stats.uid).to.equal(500); - expect(stats.gid).to.equal(500); - //done(); - }); - }); - - fs.lchown('/file', 500, 500, function(err) { - if(err) throw err; - - fs.lstat('/file', function(err, stats) { - if(err) throw err; - expect(stats.uid).to.equal(500); expect(stats.gid).to.equal(500); done(); @@ -157,6 +145,34 @@ describe('fs.chown, fs.fchown, fs.lchown', function() { }); }); }); + + it('should allow updating gid and uid for a symlink file', function(done) { + var fs = util.fs(); + + fs.open('/file', 'w', function(err, fd) { + if(err) throw err; + + fs.symlink('/file', '/link', function(err) { + if(err) throw err; + + fs.lchown('/link', 600, 600, function(err) { + if(err) throw err; + + fs.lstat('/link', function(err, stats) { + if(err) throw err; + + expect(stats.uid).to.equal(600); + expect(stats.gid).to.equal(600); + + fs.close(fd, function(err) { + if(err) throw err; + done(); + }); + }); + }); + }); + }); + }); });