abrt-handle-event: free more of allocated data

This patch doesn't change the logic of the program,
it only makes cleanup in is_crash_a_dup() and main()
more consistent, closing a few leaks:
* dump_dir_name is a result of realpath(), but wasn't freed.
* four instances of dd_close() are collapsed to one.
* dump_dir_name in main() also was leaking, fix it.
* printing of "DUP_OF_DIR: dir" is made simpler-looking.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Martin Milata <mmilata@redhat.com>
abrt-server: add support for "POST /creation_notification"

The body of this request contains just the dirname of the new
problem dir.
Receipt of this command makes abrt-server run "post-create"
and then "notify[-dup]" on this dir.
The code for running "post-create" is taked from abtrd,
it is to be removed there later.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Martin Milata <mmilata@redhat.com>
abrt-handle-event: create DUMP_LOC/post-create.lock when running "post-create"

If lock can't be created fatally, such as DUMP_LOC doesn't exist,
or filesystem is RO, we won't run "post-create" at all.
Else, if there is another "post-create" holding it,
we wait for up to 100 seconds.

This change depends on create_symlink_lockfile() being exposed
in public API in libreport.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Martin Milata <mmilata@redhat.com>
abrt-server: move create_problem_dir() function down. No code changes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Martin Milata <mmilata@redhat.com>
abrt-server: make create_problem_dir() run "post-create"

Since abrtd will no longer run "post-create" for us,
we need to do it ourselves.

While at it, move free space check to be before dir creation,
not after; and removed redundant load_abrt_conf() call.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Martin Milata <mmilata@redhat.com>
Stop dying in check_free_space(); rename it to low_free_space()

This allows us to still create compat coredump in abrt-hook-ccpp.
We used to just die if DUMP_LOC is too full.

While at it, removed x1.25 in abrt-hook-ccpp, it is vestigial
(we no longer do _trimming of old problems_ there.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Martin Milata <mmilata@redhat.com>
abrt-hook-ccpp: send "POST /creation_notification" after creating problem dir

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Martin Milata <mmilata@redhat.com>
abrtd: disable inotify watch on DUMP_LOC

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Martin Milata <mmilata@redhat.com>