@@ -315,10 +315,7 @@ public List<Path> run() {
315315 final Path confPath = new Environment (settings , configPath ).configFile ().toAbsolutePath ();
316316 if (Files .isDirectory (confPath , LinkOption .NOFOLLOW_LINKS )) {
317317 try (Stream <Path > s = Files .walk (confPath )) {
318- return s
319- .distinct ()
320- .filter (p ->checkFilePermissions (p ))
321- .collect (Collectors .toList ());
318+ return s .distinct ().filter (p -> checkFilePermissions (p )).collect (Collectors .toList ());
322319 } catch (Exception e ) {
323320 log .error (e );
324321 return null ;
@@ -348,10 +345,7 @@ public List<String> run() {
348345 final Path confPath = new Environment (settings , configPath ).configFile ().toAbsolutePath ();
349346 if (Files .isDirectory (confPath , LinkOption .NOFOLLOW_LINKS )) {
350347 try (Stream <Path > s = Files .walk (confPath )) {
351- return s
352- .distinct ()
353- .map (p ->sha256 (p ))
354- .collect (Collectors .toList ());
348+ return s .distinct ().map (p -> sha256 (p )).collect (Collectors .toList ());
355349 } catch (Exception e ) {
356350 log .error (e );
357351 return null ;
@@ -421,8 +415,7 @@ private boolean checkFilePermissions(final Path p) {
421415 return true ;
422416 }
423417 } else {
424- if (perms .contains (PosixFilePermission .OWNER_EXECUTE )
425- || perms .contains (PosixFilePermission .GROUP_EXECUTE )
418+ if (perms .contains (PosixFilePermission .OWNER_EXECUTE ) || perms .contains (PosixFilePermission .GROUP_EXECUTE )
426419 || perms .contains (PosixFilePermission .OTHERS_EXECUTE )) {
427420 // no x must be set
428421 return true ;
@@ -776,13 +769,14 @@ public Collection<Object> createComponents(Client localClient, ClusterService cl
776769 adminDns = new AdminDNs (settings );
777770 //final PrincipalExtractor pe = new DefaultPrincipalExtractor();
778771 cr = (IndexBaseConfigurationRepository ) IndexBaseConfigurationRepository .create (settings , this .configPath , threadPool , localClient , clusterService , auditLog , complianceConfig );
772+ cr .subscribeOnChange (ConfigConstants .CONFIGNAME_CONFIG , irr );
779773 final InternalAuthenticationBackend iab = new InternalAuthenticationBackend (cr );
780774 final XFFResolver xffResolver = new XFFResolver (threadPool );
781775 cr .subscribeOnChange (ConfigConstants .CONFIGNAME_CONFIG , xffResolver );
782776 backendRegistry = new BackendRegistry (settings , configPath , adminDns , xffResolver , iab , auditLog , threadPool );
783777 cr .subscribeOnChange (ConfigConstants .CONFIGNAME_CONFIG , backendRegistry );
784778 final ActionGroupHolder ah = new ActionGroupHolder (cr );
785- evaluator = new PrivilegesEvaluator (clusterService , threadPool , cr , ah , resolver , auditLog , settings , privilegesInterceptor , cih );
779+ evaluator = new PrivilegesEvaluator (clusterService , threadPool , cr , ah , resolver , auditLog , settings , privilegesInterceptor , cih , irr , advancedModulesEnabled );
786780
787781 final CompatConfig compatConfig = new CompatConfig (environment );
788782 cr .subscribeOnChange (ConfigConstants .CONFIGNAME_CONFIG , compatConfig );
@@ -1023,6 +1017,9 @@ public Collection<Class<? extends LifecycleComponent>> getGuiceServiceClasses()
10231017 @ Override
10241018 public Function <String , Predicate <String >> getFieldFilter () {
10251019 return index -> {
1020+ if (threadPool == null ) {
1021+ return field -> true ;
1022+ }
10261023 final Map <String , Set <String >> allowedFlsFields = (Map <String , Set <String >>) HeaderHelper
10271024 .deserializeSafeFromHeader (threadPool .getThreadContext (), ConfigConstants .OPENDISTRO_SECURITY_FLS_FIELDS_HEADER );
10281025
@@ -1033,9 +1030,9 @@ public Function<String, Predicate<String>> getFieldFilter() {
10331030 } else {
10341031
10351032 final Set <String > includesExcludes = allowedFlsFields .get (eval );
1033+ final Set includesSet = new HashSet <>(includesExcludes .size ());
1034+ final Set excludesSet = new HashSet <>(includesExcludes .size ());
10361035
1037- final Set <String > includesSet = new HashSet <>(includesExcludes .size ());
1038- final Set <String > excludesSet = new HashSet <>(includesExcludes .size ());
10391036
10401037 for (final String incExc : includesExcludes ) {
10411038 final char firstChar = incExc .charAt (0 );
0 commit comments