Skip to content
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

images & containers module too table-column contents sensitive #50

Closed
cevich opened this issue Apr 10, 2014 · 6 comments
Closed

images & containers module too table-column contents sensitive #50

cevich opened this issue Apr 10, 2014 · 6 comments

Comments

@cevich
Copy link
Member

cevich commented Apr 10, 2014

We shouldn't rely on 'multiple-whitespace' delimiter for images and containers table parsing. For example, if a command has too many spaces in it or there's an odd line-wrap somewhere. Instead, the character-offset of each header field seems to be more accurate and I think would be less error-prone.

@cevich cevich added this to the Future Major/Minor Dockertest API revision milestone Apr 10, 2014
@cevich cevich added the bug label Apr 10, 2014
@cevich
Copy link
Member Author

cevich commented Apr 21, 2014

This just needs to be put in place / exercised: baf2d81

@Lorquas
Copy link
Contributor

Lorquas commented Apr 21, 2014

Example output of said breaking on a docker ps -a --no-trunc --size:

9afc741721bc7c616329ed2f65128ee21233bb6c10a440519da8b54174b71834   38f7863a18f7        /bin/sh -c '/bin/echo -e '[default]
access_key=$AWS_ACCESS_KEY
secret_key=$AWS_SECRET_KEY' > /.s3cfg'                             2 weeks ago         Exited (0) 2 weeks ago                                                                                                                                                                                                                                                                                                 thirsty_albattani        71 B

This breaks the get_container_list() in dockertest/containers.py when it calls _parse_jiblets()

@cevich cevich modified the milestones: Dockertest API Version 0.7.1, Future Major/Minor Dockertest API revision Apr 21, 2014
@cevich
Copy link
Member Author

cevich commented Apr 29, 2014

@Lorquas Ohhhh, nice! Yeah, those characters need to be escaped or the table is completely un-parseable. I just reproduced it simply by executing:

docker run b7de3133ff98 bash -c "echo 'line one
line two
line three
' > /tmp/foobar"

There's absolutely no practical way to parse that w/o counting opening/closing tokens. They really should have "COMMAND" as the last column of the table and escape all "special" characters (\n, \e, \r, \g, \b, etc).

@cevich
Copy link
Member Author

cevich commented Apr 29, 2014

Interesting this actually works properly:

docker run b7de3133ff98 bash -c "echo 'this is a really really really really super big really really really really long command' > /tmp/foobar"

So the bug has to do with docker scaling column names when the column data includes special characters (newline in this case)

@cevich
Copy link
Member Author

cevich commented Apr 29, 2014

Okay, the super-duper long line is now covered by unittests: cevich@fd71017 The bug however, needs to be opened and I'll work on getting the new table-parser worked into images and containers module.

@cevich
Copy link
Member Author

cevich commented May 2, 2014

Okay, new table parser is now in #88 and bug is open: https://bugzilla.redhat.com/show_bug.cgi?id=1093108

@cevich cevich closed this as completed May 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants