Project

General

Profile

Bug #23376

Possible bug if there are extra spaces at the beginning or at the end of a value in glidein_config

Added by Marco Mambelli about 2 months ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
Start date:
10/03/2019
Due date:
% Done:

0%

Estimated time:
First Occurred:
Occurs In:
Stakeholders:
Duration:

Description

glidein_config is the file used to communicate between glidein scripts
Extra spaces could end up in the variables
This is unlikely to cause problems since most values are added to glidein_config with a function that protects against it (add_config_value).
No known occurrence happened.

Anyway, the current line used to get values out of glidein_config is:
varname="`grep '^VARNAME ' "$glidein_config" | cut -d ' ' -f 2-`"
Lines are like:
VARNAMEvalue that can have spaces  in the middle
VARNAME2  \t value that can have spaces  in the middle \t

In lines like VARNAME2 with more than one space at the beginning oad/or at the end, those are preserved
Spaces at the beginning or end are not desired:
  1. I'm not expecting to have values, e.g. paths with spaces at the beginning or end
  2. a formatting error or misspelling of an attribute could end up adding an extra unwanted space

The solution should trim the string but preserve the spaces in the middle (even type and number)



Also available in: Atom PDF