You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/01/15 19:10:29 UTC

[GitHub] [trafficcontrol] mitchell852 opened a new issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file

mitchell852 opened a new issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file 
URL: https://github.com/apache/trafficcontrol/issues/4298
 
 
   ## I'm submitting a ...
   <!-- (check all that apply with "[x]") -->
   <!--- security vulnerability (STOP!! - see above)-->
   - [x] bug report
   - [ ] new feature / enhancement request
   - [ ] improvement request (usability, performance, tech debt, etc.)
   - [ ] other <!--(Please do not submit support requests here - see above)-->
   
   ## Traffic Control components affected ...
   <!-- (check all that apply with "[x]") -->
   - [ ] CDN in a Box
   - [ ] Documentation
   - [ ] Grove
   - [ ] Traffic Control Client
   - [ ] Traffic Monitor
   - [x] Traffic Ops
   - [ ] Traffic Ops ORT
   - [x] Traffic Portal
   - [ ] Traffic Router
   - [ ] Traffic Stats
   - [ ] Traffic Vault
   - [ ] unknown
   
   ## Current behavior:
   When creating or editing a delivery service of type HTTP*, DNS* or ANY_MAP, a line break in the `remapText` field will result in a malformed remap.config file being deployed to all of the edge caches assigned to the delivery service which can have a negative impact across multiple delivery services (if multiple delivery services are assigned to the cache).
   
   When remapText = foo[line break]bar, the applicable line in remap.config will look like this:
   
   ```
   map	http://edge.demo1.mycdn.ciab.test/     http://origin.infra.ciab.test/  foo
   bar
   map	http://edge.demo2.mycdn.ciab.test/     http://origin2.infra.ciab.test/
   ```
   
   ## Expected / new behavior:
   On API DS create/update, any line breaks in the `remapText` field need to be removed.
   
   ## Minimal reproduction of the problem with instructions:
   1. In TP, create or edit an HTTP*, DNS* or ANY_MAP delivery service and enter a line break in the `Raw Remap Text` field.
   2. Navigate to the assigned servers for DS. Pick one.
   3. View config files for the server.
   4. View the contents of remap.config file and notice the line that doesn't start with `map`
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 edited a comment on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file

Posted by GitBox <gi...@apache.org>.
mitchell852 edited a comment on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file 
URL: https://github.com/apache/trafficcontrol/issues/4298#issuecomment-574842671
 
 
   edge header rewrite values create a hdr_rw_xml-id.config file and you can put multiple lines in the file.
   
   mid header rewrite values create a hdr_rw_mid_xml-id.config file and you can put multiple lines in the file.
   
   regex remap values create a regex_remap_xml-id.config file and you can put multiple lines in the file.
   
   raw remap text is intended to (like @rawlinp said) add one line for any map and append to the existing line for other ds types so multiple lines makes no sense. this i did not know at the time i added the textarea to TP.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 closed issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file

Posted by GitBox <gi...@apache.org>.
ocket8888 closed issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file 
URL: https://github.com/apache/trafficcontrol/issues/4298
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] rawlinp commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file

Posted by GitBox <gi...@apache.org>.
rawlinp commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file 
URL: https://github.com/apache/trafficcontrol/issues/4298#issuecomment-574830060
 
 
   Yes, but it seems like for fields like raw_remap we should prevent newlines, since I'm pretty sure that field is only ever meant to be _the one line_ that goes in remap.config (for ANYMAP DSes), or _appended to the one line_ for other DS types. I think regex_remap might be the same case. Seems like maybe only edge/mid header rewrite fields are _allowed_ to contain newlines, right?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file 
URL: https://github.com/apache/trafficcontrol/issues/4298#issuecomment-574843099
 
 
   > Can we also add form validation to TP to prohibit line breaks in the raw remap field?
   
   yeah, the fix should probably be in the api AND in TP.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] mitchell852 commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file 
URL: https://github.com/apache/trafficcontrol/issues/4298#issuecomment-574842671
 
 
   edge header rewrite values create a hdr_rw_xml-id.config file and you can put multiple lines in the file.
   
   mid header rewrite values create a hdr_rw_mid_xml-id.config file and you can put multiple lines in the file.
   
   regex remap values create a regex_remap_xml-id.config file and you can put multiple lines in the file.
   
   raw remap text is intended to (like @rawlinp said) add one line for any map and append to the existing line for other ds types.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] ocket8888 commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file 
URL: https://github.com/apache/trafficcontrol/issues/4298#issuecomment-574826029
 
 
   Wasn't this a feature? I thought the ability to put in line breaks was added specifically so that you could add multiple lines to `remap.config`? Because people used to have to use `__RETURN__` to make the line breaks.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [trafficcontrol] rawlinp commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file

Posted by GitBox <gi...@apache.org>.
rawlinp commented on issue #4298: Line breaks in DS raw remap text will result in a malformed remap.config file 
URL: https://github.com/apache/trafficcontrol/issues/4298#issuecomment-574820170
 
 
   Can we also add form validation to TP to prohibit line breaks in the raw remap field?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services