Adds name property for getJobs method#4
Adds name property for getJobs method#4jcampbell05 wants to merge 12 commits intoOpenPrinting:masterfrom
Conversation
|
Hi,
I know these checks can be done in sw using python-cups and they aren't used in other parts of code, but IMO it is good habit to think about all situations, which can happen. |
|
I've implemented number 1. I'm not sure how to do number 2, I'm trying to find a good URI validation method. Maybe you could point me in the right direction ? |
|
Ad1) still missing recovering from the issue - cutting 'name' string to be able to get in 'uri' array. This way the bigger string will still overwrite memory behind of memory reserved for 'uri' array -> which can be security issue. |
|
Okay added some validation to make sure its not a reserved character. Not sure how we should handle regex failing to compile so maybe you can help point me in right direction. I now added name trimming (I also moved the debug message to the correct method). Please can you check I'm doing the correct calculations when trimming as I'm not as familiar with manipulating strings in C :) |
|
Looks good - I'll make some tests. Would you mind cleaning up your commits (there are some things which shoudln't be there - like .so files, typos...)? |
|
:) sure will be happy to |
|
Hi, is there any news on this pull request? That's exactly what I need in my project. |
|
@jcampbell05 Hi James, do you intend to work on the PR? @EToniolo if James is not interested, will you take over the PR? |
|
Sorry I forgot about this PR - I'm happy for someone to help get this over the line |
|
From what I can see we just need to do a squash to clean up the history and some unit tests written |
In original cups documentation they allow you to specify a name to view the queue of a printer, pycups only allows you originally to see jobs across all queues. I've now exposed an extra
namekwarg which if specified with the name of a printer will filter it to the jobs of that printer.