Commit 18918cd2 authored by Matija Obreza's avatar Matija Obreza

Upgraded file-repository-ftpserver has improved support for security checks

- Pass User to FtpUser: ftpserver will switch security context to the specified SID
parent e3a37eb8
......@@ -283,12 +283,14 @@ public class FileRepositoryConfig implements InitializingBean {
} else {
lockoutManager.handleSuccessfulLogin(username);
LOG.info("FTP login successful for {}", username);
try {
return getUserByName(username);
} catch (final FtpException e) {
LOG.warn("FTP login failed", e);
throw new AuthenticationFailedException(e.getMessage(), e);
}
FtpUser ftpUser = new FtpUser(user);
final List<Authority> authorities = new ArrayList<>();
authorities.add(new ConcurrentLoginPermission(10, 0));
authorities.add(new WritePermission());
ftpUser.setAuthorities(authorities);
ftpUser.setHomeDirectory("/");
return ftpUser;
}
} else if (authentication instanceof AnonymousAuthentication) {
......
......@@ -47,7 +47,7 @@ log4j.category.liquibase=debug
#log4j.category.org.genesys2.server.servlet.filter=debug
#log4j.category.org.genesys2.server.servlet.filter.NewGUIFilter=debug
#log4j.category.org.genesys2.spring.config.NewGUIViewResolver=trace
#log4j.category.org.genesys.filerepository.service.ftp=trace
# Internal Hibernate logging is at ERROR
log4j.category.org.hibernate.engine.jdbc=fatal
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment