Guys, There are many shell/python script files in cloudstack which contain grep or sed commands (which may return greedy results) . Some issues are because of these files, for instance CLOUDSTACK-3540, CLOUDSTACK-3533, CLOUDSATCK-3843.
We need to check all the script files in patches/ and scripts/ directory, and fix the potential issues. [root@centos master]# grep -rl -E "grep|sed" scripts/ | grep -v xml scripts/.pydevproject scripts/storage/checkchildren.sh scripts/storage/installIso.sh scripts/storage/qcow2/create_private_template.sh scripts/storage/qcow2/createtmplt.sh scripts/storage/qcow2/get_domr_kernel.sh scripts/storage/qcow2/listvmtmplt.sh scripts/storage/qcow2/listvolume.sh scripts/storage/qcow2/importmpl.sh scripts/storage/qcow2/createvolume.sh scripts/storage/qcow2/resizevolume.sh scripts/storage/qcow2/createvm.sh scripts/storage/qcow2/listvmdisk.sh scripts/storage/qcow2/managesnapshot.sh scripts/storage/qcow2/listvmdisksize.sh scripts/storage/qcow2/managevolume.sh scripts/storage/qcow2/delvm.sh scripts/storage/qcow2/get_iqn.sh scripts/storage/secondary/installIso.sh scripts/storage/secondary/createtmplt.sh scripts/storage/secondary/listvmtmplt.sh scripts/storage/secondary/cloud-install-sys-tmplt scripts/storage/secondary/listvolume.sh scripts/storage/secondary/create_privatetemplate_from_snapshot_xen.sh scripts/storage/secondary/swift scripts/storage/secondary/createvolume.sh scripts/vm/systemvm/injectkeys.sh scripts/vm/pingtest.sh scripts/vm/hypervisor/versions.sh scripts/vm/hypervisor/kvm/setup_agent.sh scripts/vm/hypervisor/kvm/patchviasocket.pl scripts/vm/hypervisor/kvm/kvmheartbeat.sh scripts/vm/hypervisor/xenserver/mockxcpplugin.py scripts/vm/hypervisor/xenserver/launch_hb.sh scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh scripts/vm/hypervisor/xenserver/upgrade_vnc_config.sh scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh scripts/vm/hypervisor/xenserver/make_migratable.sh scripts/vm/hypervisor/xenserver/vmopspremium scripts/vm/hypervisor/xenserver/cloud-setup-bonding.sh scripts/vm/hypervisor/xenserver/xenserver56fp1/NFSSR.py scripts/vm/hypervisor/xenserver/xenserver56fp1/patch scripts/vm/hypervisor/xenserver/add_to_vcpus_params_live.sh scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh scripts/vm/hypervisor/xenserver/cloud-propagate-vlan.sh scripts/vm/hypervisor/xenserver/xs_cleanup.sh scripts/vm/hypervisor/xenserver/swift scripts/vm/hypervisor/xenserver/hostvmstats.py scripts/vm/hypervisor/xenserver/cloud-clean-vlan.sh scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_from_secondarystorage.sh scripts/vm/hypervisor/xenserver/xcposs/vmopspremium scripts/vm/hypervisor/xenserver/xcposs/create_privatetemplate_from_snapshot.sh scripts/vm/hypervisor/xenserver/xcposs/copy_vhd_to_secondarystorage.sh scripts/vm/hypervisor/xenserver/xcposs/vmopsSnapshot scripts/vm/hypervisor/xenserver/xcposs/vmops scripts/vm/hypervisor/xenserver/xcposs/NFSSR.py scripts/vm/hypervisor/xenserver/xcposs/patch scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh scripts/vm/hypervisor/xenserver/xen-ovs-vif-flows.rules [root@weizhou-centos master]# grep -rl -E "grep|sed" patches/systemvm/ patches/systemvm/debian/systemvm.xml patches/systemvm/debian/xe/xe-linux-distribution patches/systemvm/debian/xe/xe-update-guest-attrs patches/systemvm/debian/xe/xe-daemon patches/systemvm/debian/convert.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_staticroute.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_staticnat.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh patches/systemvm/debian/config/opt/cloud/bin/checks2svpn.sh patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_passwd_server patches/systemvm/debian/config/opt/cloud/bin/vpc_func.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh patches/systemvm/debian/config/opt/cloud/bin/ipsectunnel.sh patches/systemvm/debian/config/opt/cloud/bin/checkbatchs2svpn.sh patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_snat.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_netusage.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_acl.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_loadbalancer.sh patches/systemvm/debian/config/opt/cloud/bin/ilb.sh patches/systemvm/debian/config/opt/cloud/bin/cloud-nic.sh patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh patches/systemvm/debian/config/opt/cloud/bin/serve_password.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_privateGateway.sh patches/systemvm/debian/config/opt/cloud/bin/netusage.sh patches/systemvm/debian/config/opt/cloud/bin/vpc_portforwarding.sh patches/systemvm/debian/config/opt/cloud/bin/passwd_server patches/systemvm/debian/config/opt/cloud/bin/passwd_server_ip patches/systemvm/debian/config/opt/cloud/bin/vmdata_kvm.py patches/systemvm/debian/config/opt/cloud/bin/vpc_privategw_acl.sh patches/systemvm/debian/config/etc/default/cloud-passwd-srvr patches/systemvm/debian/config/etc/default/cloud patches/systemvm/debian/config/etc/apache2/sites-available/default-ssl patches/systemvm/debian/config/etc/apache2/vhostexample.conf patches/systemvm/debian/config/etc/init.d/cloud-early-config patches/systemvm/debian/config/etc/init.d/cloud-passwd-srvr patches/systemvm/debian/config/etc/init.d/postinit patches/systemvm/debian/config/etc/init.d/cloud patches/systemvm/debian/config/etc/iptables/iptables-elbvm patches/systemvm/debian/config/etc/iptables/iptables-consoleproxy patches/systemvm/debian/config/etc/iptables/iptables-vpcrouter patches/systemvm/debian/config/etc/iptables/rules patches/systemvm/debian/config/etc/iptables/iptables-secstorage patches/systemvm/debian/config/etc/iptables/iptables-router patches/systemvm/debian/config/etc/iptables/rt_tables_init patches/systemvm/debian/config/etc/iptables/iptables-ilbvm patches/systemvm/debian/config/etc/vpcdnsmasq.conf patches/systemvm/debian/config/etc/cron.daily/cloud-cleanup patches/systemvm/debian/config/etc/dnsmasq.conf.tmpl patches/systemvm/debian/config/etc/profile.d/cloud.sh patches/systemvm/debian/config/etc/ssh/sshd_config patches/systemvm/debian/config/root/clearUsageRules.sh patches/systemvm/debian/config/root/bumpup_priority.sh patches/systemvm/debian/config/root/dnsmasq.sh patches/systemvm/debian/config/root/firewall_rule.sh patches/systemvm/debian/config/root/func.sh patches/systemvm/debian/config/root/createIpAlias.sh patches/systemvm/debian/config/root/savepassword.sh patches/systemvm/debian/config/root/reconfigLB.sh patches/systemvm/debian/config/root/edithosts.sh patches/systemvm/debian/config/root/userdata.py patches/systemvm/debian/config/root/redundant_router/conntrackd.conf.templ patches/systemvm/debian/config/root/redundant_router/keepalived.conf.templ patches/systemvm/debian/config/root/redundant_router/fault.sh.templ patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh patches/systemvm/debian/config/root/redundant_router/arping_gateways.sh.templ patches/systemvm/debian/config/root/redundant_router/heartbeat.sh.templ patches/systemvm/debian/config/root/redundant_router/services.sh patches/systemvm/debian/config/root/redundant_router/master.sh.templ patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ patches/systemvm/debian/config/root/redundant_router/check_bumpup.sh patches/systemvm/debian/config/root/redundant_router/backup.sh.templ patches/systemvm/debian/config/root/redundant_router/check_heartbeat.sh.templ patches/systemvm/debian/config/root/redundant_router/primary-backup.sh.templ patches/systemvm/debian/config/root/redundant_router/checkrouter.sh.templ patches/systemvm/debian/config/root/firewallRule_egress.sh patches/systemvm/debian/config/root/loadbalancer.sh patches/systemvm/debian/config/root/userdata.sh patches/systemvm/debian/config/root/firewall.sh patches/systemvm/debian/config/root/deleteIpAlias.sh patches/systemvm/debian/buildsystemvm.sh patches/systemvm/debian/vhdconvert.sh patches/systemvm/debian/README patches/systemvm/debian/qemuconvert.sh patches/systemvm/debian/vpn/opt/cloud/bin/vpn_l2tp.sh patches/systemvm/debian/vpn/opt/cloud/bin/vpc_vpn_l2tp.sh -Wei
