From fefef13cc93899efc3a8d3eac42ee17ed2bd20ae Mon Sep 17 00:00:00 2001 From: Mitchell McDermott Date: Thu, 9 Feb 2017 15:46:57 +1100 Subject: [PATCH] nassh: Fixed bad unmount function reference. Removed symlink support (Not supported by ChromeOS anyway). Change-Id: I2280579b913cd6241bc7de763e8d1b9c9f488aec Reviewed-on: https://chromium-review.googlesource.com/439789 Reviewed-by: Rob Ginda Tested-by: Mitchell McDermott --- nassh/js/nassh_connect_dialog.js | 3 ++- nassh/js/nassh_sftp_fsp.js | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/nassh/js/nassh_connect_dialog.js b/nassh/js/nassh_connect_dialog.js index 73e095cdd..843505f92 100644 --- a/nassh/js/nassh_connect_dialog.js +++ b/nassh/js/nassh_connect_dialog.js @@ -438,7 +438,8 @@ nassh.ConnectDialog.prototype.mount = function() { */ nassh.ConnectDialog.prototype.unmount = function() { var options = {fileSystemId: this.currentProfileRecord_.id}; - chrome.extension.getBackgroundPage().onUnmountRequested(options, + chrome.extension.getBackgroundPage(). + nassh.sftp.fsp.onUnmountRequested(options, (success) => { this.displayMountButton_(true); }, (error) => { /* do nothing */ }); }; diff --git a/nassh/js/nassh_sftp_fsp.js b/nassh/js/nassh_sftp_fsp.js index 0a9102847..c6e80a4dd 100644 --- a/nassh/js/nassh_sftp_fsp.js +++ b/nassh/js/nassh_sftp_fsp.js @@ -98,7 +98,9 @@ nassh.sftp.fsp.readDirectory = function(directoryHandle, client, sanitizeOptions for(var i = 0; i < response.fileCount; i++) { var file = response.files[i]; - if (file.filename == '.' || file.filename == '..') { + // Skip over the file if it's a '.', '..' or link file + if (file.filename == '.' || file.filename == '..' || + file.permissions & 0x2000) { continue; } @@ -598,7 +600,7 @@ nassh.sftp.fsp.providerMethods = [ // Loop over the provider methods and link them to their handlers. if (chrome.fileSystemProvider) { - nassh.sftp.fsp.providerMethods.forEach(function(item) { - chrome.fileSystemProvider[item].addListener(nassh.sftp.fsp[item]); + nassh.sftp.fsp.providerMethods.forEach(function(provider) { + chrome.fileSystemProvider[provider].addListener(nassh.sftp.fsp[provider]); }); }