New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
igetwild bash cleanup #3452
Comments
Use bash -e set -e is good practice because it means the script will exit if a command fails, rather than carrying on regardless. Quote variables everywhere in igetwild It's good practice to always quote shell variables (consider, for instance, what would happen if TMPDIR contained a space). Remove tmpfiles on error in igetwild Only remove the tmpfiles at the end of a successful run, or when an error occurs. Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk> Signed-off-by: Terrell Russell <terrellrussell@gmail.com>
…in igetwild We extract a list of filenames from iquest, and then pass them to iget one by one using xargs. The complication is that filenames can contain pretty much any character, and iquest doesn't have the option to separate output records with the NULL byte. So we use the closest we can, which is /\n (iquest always adds the \n). We then replace that /\n sequence with NULL. That gets us most of the way there, but our sequence will still finish "/\n", because sed doesn't see the final newline in its pattern space. So we replace the final / with NULL and then use head to remove the final character (the \n). Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk> Signed-off-by: Terrell Russell <terrellrussell@gmail.com>
Use bash -e set -e is good practice because it means the script will exit if a command fails, rather than carrying on regardless. Quote variables everywhere in igetwild It's good practice to always quote shell variables (consider, for instance, what would happen if TMPDIR contained a space). Remove tmpfiles on error in igetwild Only remove the tmpfiles at the end of a successful run, or when an error occurs. Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk> Signed-off-by: Terrell Russell <terrellrussell@gmail.com>
We extract a list of filenames from iquest, and then pass them to iget one by one using xargs. The complication is that filenames can contain pretty much any character, and iquest doesn't have the option to separate output records with the NULL byte. So we use the closest we can, which is /\n (iquest always adds the \n). We then replace that /\n sequence with NULL. That gets us most of the way there, but our sequence will still finish "/\n", because sed doesn't see the final newline in its pattern space. So we replace the final / with NULL and then use head to remove the final character (the \n). Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk> Signed-off-by: Terrell Russell <terrellrussell@gmail.com>
|
needs cherry-pick to 4-2-stable. |
Use bash -e set -e is good practice because it means the script will exit if a command fails, rather than carrying on regardless. Quote variables everywhere in igetwild It's good practice to always quote shell variables (consider, for instance, what would happen if TMPDIR contained a space). Remove tmpfiles on error in igetwild Only remove the tmpfiles at the end of a successful run, or when an error occurs. Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk> Signed-off-by: Terrell Russell <terrellrussell@gmail.com>
…in igetwild We extract a list of filenames from iquest, and then pass them to iget one by one using xargs. The complication is that filenames can contain pretty much any character, and iquest doesn't have the option to separate output records with the NULL byte. So we use the closest we can, which is /\n (iquest always adds the \n). We then replace that /\n sequence with NULL. That gets us most of the way there, but our sequence will still finish "/\n", because sed doesn't see the final newline in its pattern space. So we replace the final / with NULL and then use head to remove the final character (the \n). Signed-off-by: Matthew Vernon <mv3@sanger.ac.uk> Signed-off-by: Terrell Russell <terrellrussell@gmail.com>
|
thanks @mcv21 |
|
See http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8799
|
No description provided.
The text was updated successfully, but these errors were encountered: