Author: gnodet
Date: Thu Jun 7 14:13:14 2012
New Revision: 1347625
URL: http://svn.apache.org/viewvc?rev=1347625&view=rev
Log:
[SSHD-168] SFTP returns wrong ownership information
Modified:
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/SshFile.java
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/filesystem/NativeSshFile.java
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java
Modified:
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/SshFile.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/SshFile.java?rev=1347625&r1=1347624&r2=1347625&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/SshFile.java
(original)
+++ mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/SshFile.java
Thu Jun 7 14:13:14 2012
@@ -45,6 +45,12 @@ public interface SshFile {
String getName();
/**
+ * Get the owner name of the file
+ * @return the name of the owner.
+ */
+ String getOwner();
+
+ /**
* Is it a directory?
* @return true if the {@link SshFile} is a directory
*/
Modified:
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/filesystem/NativeSshFile.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/filesystem/NativeSshFile.java?rev=1347625&r1=1347624&r2=1347625&view=diff
==============================================================================
---
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/filesystem/NativeSshFile.java
(original)
+++
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/filesystem/NativeSshFile.java
Thu Jun 7 14:13:14 2012
@@ -121,6 +121,13 @@ public class NativeSshFile implements Ss
}
/**
+ * Get owner name
+ */
+ public String getOwner() {
+ return userName;
+ }
+
+ /**
* Is it a directory?
*/
public boolean isDirectory() {
Modified:
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java?rev=1347625&r1=1347624&r2=1347625&view=diff
==============================================================================
---
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java
(original)
+++
mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java
Thu Jun 7 14:13:14 2012
@@ -911,7 +911,7 @@ public class SftpSubsystem implements Co
}
private String getLongName(SshFile f) {
- String username = session.getUsername();
+ String username = f.getOwner();
if (username.length() > 8) {
username = username.substring(0, 8);
} else {