On Mon, 25.04.11 14:38, William Douglas (william.r.doug...@gmail.com) wrote:
> Hello all, heya, > > Below is an updated patch for tmpfile white listing. Hmm, please don't put patches after the "-- " line in your mails. I have trouble responding to your patch mail that way, since my mailer cuts off signatures (i.e. everything after "-- ") automatically on reply. But a few comments: I am not sure I understand why we need another hashmap "kept" for this. The existing two should be fine. Also, why first explode the list of files matching with glob()? The fnmatch() pattern matching looks much simpler and safer to me (and race-free too). You should be able to pass a callback based on the existing find_glob() call to rm_rf(). Would be simpler and more code to reuse. For example, you could move if (hashmap_get(items, sub_path)) .... if (find_glob(globs, sub_path)) .... into your protected() function. And replace the current invocations of the lines above with invocations of protected(). By doing that the existing code would become easier and shorter and simpler to read, even. The rm_rf_children() call needs proper cleanup handling when asprintf() fails due to OOM. You need to release d for example afaics. Otherwise the patch looks fine to me. If you make these changes I am happy to merge it. Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel