- **status**: review --> fixed
- **Comment**:
commit 3c660eef1ad1ca264e1b143151b33378c8f677d2
Author: Hans Nordeback <hans.nordeb...@ericsson.com>
Date: Wed Nov 29 14:44:30 2017 +0100
base: Fix opensaf_scale_out script to handle binary arguments [#2703]
commit 3d753c5847af88107a9321601263fb03cff6170f
Author: Hans Nordeback <hans.nordeb...@ericsson.com>
Date: Wed Nov 29 14:44:30 2017 +0100
base: Fix opensaf_scale_out script to handle binary arguments [#2703]
---
** [tickets:#2703] opensaf_scale_out script could not handle \n as argument**
**Status:** fixed
**Milestone:** 5.18.01
**Created:** Fri Nov 24, 2017 11:46 AM UTC by Per Rodenvall
**Last Updated:** Tue Nov 28, 2017 01:25 PM UTC
**Owner:** Hans Nordebäck
The problem is the fourth script argument that is the optional user data field.
That field could contain a 254-long string that could include none printable
characters as \n.
In the sample code below the script is just interested in the node name that is
the second argument. That could not contain any non-printable characters.
Therefore none printable characters could be removed for this loop with "tr"
Original code:
for node in "$@"; do
node_name=$(echo "$node" | cut -d"$CLM_IFS" -f2)
echo "$node_name" >> "$nodes_cfg_tmp"
done
Modified code:
//# Temporary remove non-printable characters from input argument
arg_without_newline=$(printf "%s" "$@" | tr -cd '[:print:]')
for node in "$arg_without_newline"; do
node_name=$(echo "$node" | cut -d"$CLM_IFS" -f2)
echo "$node_name" >> "$nodes_cfg_tmp"
done
---
Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-tickets mailing list
Opensaf-tickets@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets