diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authz/store/FileRolesStore.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authz/store/FileRolesStore.java index 637675ea16a..a1bcbe73622 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authz/store/FileRolesStore.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/authz/store/FileRolesStore.java @@ -203,6 +203,8 @@ public class FileRolesStore extends AbstractLifecycleComponent imple if (!names.isEmpty()) { name = new Privilege.Name(names); } + } else if (token == XContentParser.Token.VALUE_NULL) { + continue; } else { logger.error("invalid role definition [{}] in roles file [{}]. [cluster] field value can either " + "be a string or a list of strings, but [{}] was found instead. skipping role...", @@ -264,6 +266,8 @@ public class FileRolesStore extends AbstractLifecycleComponent imple } else { fields = Collections.singletonList(field); } + } else if (token == XContentParser.Token.VALUE_NULL) { + fields = Collections.emptyList(); } } else if ("query".equals(currentFieldName)) { if (token == XContentParser.Token.START_OBJECT) { @@ -320,6 +324,8 @@ public class FileRolesStore extends AbstractLifecycleComponent imple } } continue; + } else if (token == XContentParser.Token.VALUE_NULL) { + continue; } else { logger.error("invalid role definition [{}] in roles file [{}]. " + "could not parse [{}] as index privileges. privilege lists must either " +