mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
Fixes from audit
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1926 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
c34d7cb20e
commit
cfbb41dcde
@ -19,17 +19,11 @@
|
|||||||
package davmail.exchange.dav;
|
package davmail.exchange.dav;
|
||||||
|
|
||||||
import davmail.util.StringUtil;
|
import davmail.util.StringUtil;
|
||||||
import org.apache.jackrabbit.webdav.header.DepthHeader;
|
|
||||||
import org.apache.jackrabbit.webdav.property.DavPropertyName;
|
|
||||||
import org.apache.jackrabbit.webdav.property.DavPropertyNameIterator;
|
|
||||||
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom Exchange PROPFIND method.
|
* Custom Exchange PROPFIND method.
|
||||||
@ -40,13 +34,17 @@ public class ExchangeSearchMethod extends ExchangeDavMethod {
|
|||||||
|
|
||||||
protected final String searchRequest;
|
protected final String searchRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create search method.
|
||||||
|
*
|
||||||
|
* @param uri method uri
|
||||||
|
* @param searchRequest Exchange search request
|
||||||
|
*/
|
||||||
public ExchangeSearchMethod(String uri, String searchRequest) {
|
public ExchangeSearchMethod(String uri, String searchRequest) {
|
||||||
super(uri);
|
super(uri);
|
||||||
this.searchRequest = searchRequest;
|
this.searchRequest = searchRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected byte[] generateRequestContent() {
|
protected byte[] generateRequestContent() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ package davmail.exchange.ews;
|
|||||||
* DeleteItem disposal type.
|
* DeleteItem disposal type.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"JavaDoc", "UnusedDeclaration"})
|
@SuppressWarnings({"JavaDoc", "UnusedDeclaration"})
|
||||||
public class DeleteType extends AttributeOption {
|
public final class DeleteType extends AttributeOption {
|
||||||
private DeleteType(String value) {
|
private DeleteType(String value) {
|
||||||
super("DeleteType", value);
|
super("DeleteType", value);
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package davmail.exchange.ews;
|
package davmail.exchange.ews;
|
||||||
|
|
||||||
import davmail.exchange.dav.PropertyType;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -1014,7 +1014,7 @@ public class ImapConnection extends AbstractConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void appendEnvelopeHeaderValue(StringBuilder buffer, String value) throws UnsupportedEncodingException {
|
protected void appendEnvelopeHeaderValue(StringBuilder buffer, String value) throws UnsupportedEncodingException {
|
||||||
if (value.indexOf('"') >= 0 || value.indexOf("\\") >= 0) {
|
if (value.indexOf('"') >= 0 || value.indexOf('\\') >= 0) {
|
||||||
buffer.append('{');
|
buffer.append('{');
|
||||||
buffer.append(value.length());
|
buffer.append(value.length());
|
||||||
buffer.append("}\r\n");
|
buffer.append("}\r\n");
|
||||||
|
@ -512,7 +512,7 @@ public class LdapConnection extends AbstractConnection {
|
|||||||
DavGatewayTray.resetIcon();
|
DavGatewayTray.resetIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static final byte[] EMPTY_BYTE_ARRAY= new byte[0];
|
protected static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
|
||||||
|
|
||||||
protected void handleRequest(byte[] inbuf, int offset) throws IOException {
|
protected void handleRequest(byte[] inbuf, int offset) throws IOException {
|
||||||
//dumpBer(inbuf, offset);
|
//dumpBer(inbuf, offset);
|
||||||
@ -545,32 +545,32 @@ public class LdapConnection extends AbstractConnection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// handle other callbacks
|
// handle other callbacks
|
||||||
for (Callback callback:callbacks) {
|
for (Callback callback : callbacks) {
|
||||||
if (callback instanceof AuthorizeCallback) {
|
if (callback instanceof AuthorizeCallback) {
|
||||||
((AuthorizeCallback)callback).setAuthorized(true);
|
((AuthorizeCallback) callback).setAuthorized(true);
|
||||||
} else if (callback instanceof PasswordCallback) {
|
} else if (callback instanceof PasswordCallback) {
|
||||||
if (password != null) {
|
if (password != null) {
|
||||||
((PasswordCallback)callback).setPassword(password.toCharArray());
|
((PasswordCallback) callback).setPassword(password.toCharArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
int status;
|
int status;
|
||||||
if (reqBer.bytesLeft() > 0 && saslServer != null) {
|
if (reqBer.bytesLeft() > 0 && saslServer != null) {
|
||||||
byte[] clientResponse = reqBer.parseOctetString(Ber.ASN_OCTET_STR, null);
|
byte[] clientResponse = reqBer.parseOctetString(Ber.ASN_OCTET_STR, null);
|
||||||
serverResponse = saslServer.evaluateResponse(clientResponse);
|
serverResponse = saslServer.evaluateResponse(clientResponse);
|
||||||
status = LDAP_SUCCESS;
|
status = LDAP_SUCCESS;
|
||||||
|
|
||||||
DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_BIND_USER", currentMessageId, userName));
|
DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_BIND_USER", currentMessageId, userName));
|
||||||
try {
|
try {
|
||||||
session = ExchangeSessionFactory.getInstance(userName, password);
|
session = ExchangeSessionFactory.getInstance(userName, password);
|
||||||
DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_BIND_SUCCESS"));
|
DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_BIND_SUCCESS"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
serverResponse = EMPTY_BYTE_ARRAY;
|
serverResponse = EMPTY_BYTE_ARRAY;
|
||||||
status = LDAP_INVALID_CREDENTIALS;
|
status = LDAP_INVALID_CREDENTIALS;
|
||||||
DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_BIND_INVALID_CREDENTIALS"));
|
DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_BIND_INVALID_CREDENTIALS"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Map<String, String> properties = new HashMap<String, String>();
|
Map<String, String> properties = new HashMap<String, String>();
|
||||||
@ -1630,7 +1630,7 @@ public class LdapConnection extends AbstractConnection {
|
|||||||
try {
|
try {
|
||||||
calendar.setTime(parser.parse(value));
|
calendar.setTime(parser.parse(value));
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
throw new IOException(e);
|
throw new IOException(e + " " + e.getMessage());
|
||||||
}
|
}
|
||||||
if ("birthday".equals(ldapAttribute)) {
|
if ("birthday".equals(ldapAttribute)) {
|
||||||
value = String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));
|
value = String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));
|
||||||
|
@ -23,7 +23,6 @@ import davmail.ui.tray.DavGatewayTray;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import javax.swing.border.LineBorder;
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
@ -68,6 +67,7 @@ public class PasswordPromptDialog extends JDialog {
|
|||||||
|
|
||||||
setTitle(BundleMessage.format("UI_PASSWORD_PROMPT"));
|
setTitle(BundleMessage.format("UI_PASSWORD_PROMPT"));
|
||||||
try {
|
try {
|
||||||
|
//noinspection Since15
|
||||||
setIconImage(DavGatewayTray.getFrameIcon());
|
setIconImage(DavGatewayTray.getFrameIcon());
|
||||||
} catch (NoSuchMethodError error) {
|
} catch (NoSuchMethodError error) {
|
||||||
DavGatewayTray.debug(new BundleMessage("LOG_UNABLE_TO_SET_ICON_IMAGE"));
|
DavGatewayTray.debug(new BundleMessage("LOG_UNABLE_TO_SET_ICON_IMAGE"));
|
||||||
|
@ -381,7 +381,7 @@ public class SettingsFrame extends JFrame {
|
|||||||
allowRemoteField.setSelected(Settings.getBooleanProperty("davmail.allowRemote"));
|
allowRemoteField.setSelected(Settings.getBooleanProperty("davmail.allowRemote"));
|
||||||
|
|
||||||
bindAddressField = new JTextField(Settings.getProperty("davmail.bindAddress"), 15);
|
bindAddressField = new JTextField(Settings.getProperty("davmail.bindAddress"), 15);
|
||||||
clientSoTimeoutField = new JTextField(Settings.getProperty("davmail.clientSoTimeout"), 15);;
|
clientSoTimeoutField = new JTextField(Settings.getProperty("davmail.clientSoTimeout"), 15);
|
||||||
|
|
||||||
certHashField = new JTextField(Settings.getProperty("davmail.server.certificate.hash"), 15);
|
certHashField = new JTextField(Settings.getProperty("davmail.server.certificate.hash"), 15);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user