jbonofre opened a new pull request, #3070:
URL: https://github.com/apache/karaf/pull/3070

   Backport of #3044 to `karaf-4.4.x`.
   
   ## Problem
   
   `karaf-4.4.x` has the same check as `main`: `ConfigRepositoryImpl` only 
requires a configuration file to be inside `${karaf.etc}` (#2867). The files 
reserved to `admin` live there too (`users.properties`, and the JMX and command 
ACLs), so a `manager` can overwrite them:
   
   - **via `felix.fileinstall.filename`**: create a new PID and point its 
`felix.fileinstall.filename` at `etc/users.properties` or an ACL file.
   - **via the storage type**: `config:edit --type 
acl.org.apache.karaf.config.cfg jmx` builds the name of the JMX ACL file.
   
   This is reachable from `config:property-set` / `config:update` and from the 
`ConfigMBean`. We handle it as hardening, see #3069.
   
   ## Fix
   
   Same as #3044: a configuration can only be written to its own file. The file 
has to be inside `${karaf.etc}`, use a `cfg`, `config` or JSON extension, and 
be named after the PID (or the factory PID), checked on the canonical path. 
Factory creation also rejects an unsupported storage type. Configurations that 
already have a backing file keep using it.
   
   ## Differences from #3044
   
   None. The commit cherry-picked without conflicts, and adds a `Reported-by` 
trailer.
   
   #3044 isn't merged yet, so any change made there during review should be 
applied here as well.
   
   ## Testing
   
   - [x] `mvn -pl config/core,config/command test` passes on this branch with 
JDK 11 (25 tests), including the 13 `ConfigRepositoryImplContainmentTest` cases.
   
   ## Credit
   
   Reported by <[email protected]>.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to