ssl_certlocation, etc. will copy any file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apache2 Charm |
New
|
Undecided
|
Unassigned |
Bug Description
ssl_certlocation and friends are documented to copy files from ${CHARM_DIR}/data, but in fact they will copy a file from anywhere on the system, due to the way that os.path.join handles arguments that begin with "/":
>>> os.path.join('/a', 'b', 'c')
'/a/b/c'
>>> os.path.join('/a', 'b', '/c')
'/c'
>>> _
These config items should probably sanitized before use.
---
From a quick survey of our internal deployment configs, these config items are never used as intended and only for its side-effect of being available as a vhost template variable. If the file is not found, the charm logs this and continues.
Given that this charm is more and more likely to be used directly from the charm store, perhaps we should just remove the file-copying functionality and leave the template variables.