[stunnel-users] Possible problem found in init script with 'dirty' config file

Michal Trojnara Michal.Trojnara at mirt.net
Mon Aug 4 22:01:02 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

F. J. Blanco wrote:
> Perhaps a suggestion, a little change here:
> 
> CHROOT=`grep "^chroot" $file|sed "s;.*= *;;"`
> 
> Adding a space filter:
> 
> CHROOT=`grep "^chroot" $file|sed "s;.*= *;;" | tr -d " "`

In fact the parameters can contain "=" or or spaces.  Only trailing
spaces are removed.

Consequently, the line should be more like:

CHROOT=$(grep -i '^[[:space:]]*chroot[[:space:]]*=' $file |
sed 's;[^=]*=[[:space:]]*\(.*[[:graph:]]\).*;\1;')

Mike
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlPf5n4ACgkQ/NU+nXTHMtHWCQCgyujhD/41+ScAgJoExk1Orh6K
1W4AoPpDobecjBSdC93yNLpOlvDcY0cd
=u6oR
-----END PGP SIGNATURE-----



More information about the stunnel-users mailing list