Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit c7c2d13

Browse files
committed
Fix for list-zones and change-password commands
1 parent 92771f0 commit c7c2d13

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.log
22
build
3+
dnsshim-dist

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
DNSSHIM: NIC.br's DNS Secure Hidden Master
22

3+
version 2.2.1
4+
* Fix for list-zones and change-password
5+
36
version 2.2
47
* TLS certificate import fix
58
* overwrite_mname is now an option on xfrd config file

src/br/registro/dnsshim/xfrd/service/UserServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ public Response addUser(AddUserRequest request)
8282
public Response changePassword(ChangePasswordRequest request)
8383
throws DnsshimProtocolException {
8484
DnsshimSession dnsshimSession = sessionCache.get(request.getSessionId());
85-
String username = (String) dnsshimSession.getAttribute("username");
85+
86+
User sessionUser = (User) dnsshimSession.getAttribute("user");
87+
String username = sessionUser.getUsername();
88+
8689
if (!username.equalsIgnoreCase(request.getUsername())) {
8790
throw new DnsshimProtocolException(ProtocolStatusCode.INVALID_USER, "Invalid user");
8891
}
@@ -102,6 +105,7 @@ public Response changePassword(ChangePasswordRequest request)
102105
if (logger.isInfoEnabled()) {
103106
logger.info("Password changed for user " + username);
104107
}
108+
105109
Response response = new Response();
106110
response.setMsg("Password has been changed");
107111
return response;

src/br/registro/dnsshim/xfrd/service/ZoneServiceImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ public ListZonesResponse listZones(ListZonesRequest request) throws IOException,
286286
ListZonesResponse response = new ListZonesResponse();
287287
DnsshimSessionCache dnsshimSessionCache = DnsshimSessionCache.getInstance();
288288
DnsshimSession session = dnsshimSessionCache.get(request.getSessionId());
289-
String username = (String) session.getAttribute("username");
289+
290+
User user = (User) session.getAttribute("user");
291+
String username = user.getUsername();
292+
290293
List<ZoneInfo> zones = zoneInfoDao.findByUser(username);
291294
for (ZoneInfo zone : zones) {
292295
response.addZonename(zone.getZonename());

0 commit comments

Comments
 (0)