summaryrefslogtreecommitdiffstats
path: root/src/daemon/dumpsocket.h
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-09-14 19:22:05 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-09-14 19:22:05 +0200
commitbfdf82e770def64e204d1becf9640034bcdc19bb (patch)
treee97b51dbcbab89ad8f1baa5f48754465350065a9 /src/daemon/dumpsocket.h
parentd34e82eb33d3f058f6600cbeccf5f2d01dcf9ff6 (diff)
downloadabrt-bfdf82e770def64e204d1becf9640034bcdc19bb.tar.gz
abrt-bfdf82e770def64e204d1becf9640034bcdc19bb.tar.xz
abrt-bfdf82e770def64e204d1becf9640034bcdc19bb.zip
This patch makes abrtd spawn a new process, abrt-server,
for every socket client. This allows for simpler timeout handling using SIGALRM, and makes timers for tracking client timeouts unnecessary. This also allows for debugging and regression testing of abrt-server separately - it can be simply run from command-line and fed commands on stdin. Also it provides a better fault isolation - crash in abrt-server does not take down abrtd. The code is based on dumpsocket.{cpp,h}. Most of dumpsocket.cpp goes to abrt-server.c, a small part goes to Daemon.cpp (i.e. to abrtd). This change will not compile - it does not have dumpsocket.cpp renamed to abrt-server.c, which makes the change easier to read. The next change, which I'll commit after this one, contains only the renaming. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/daemon/dumpsocket.h')
-rw-r--r--src/daemon/dumpsocket.h81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/daemon/dumpsocket.h b/src/daemon/dumpsocket.h
deleted file mode 100644
index 88fe2446..00000000
--- a/src/daemon/dumpsocket.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright (C) 2010 ABRT team
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-#ifndef ABRT_DUMPSOCKET_H
-#define ABRT_DUMPSOCKET_H
-
-/*
-Unix socket in ABRT daemon for creating new dump directories.
-
-Why to use socket for creating dump dirs? Security. When a Python
-script throws unexpected exception, ABRT handler catches it, running
-as a part of that broken Python application. The application is running
-with certain SELinux privileges, for example it can not execute other
-programs, or to create files in /var/cache or anything else required
-to properly fill a dump directory. Adding these privileges to every
-application would weaken the security.
-The most suitable solution is for the Python application
-to open a socket where ABRT daemon is listening, write all relevant
-data to that socket, and close it. ABRT daemon handles the rest.
-
-** Protocol
-
-Initializing new dump:
-open /var/run/abrt.socket
-
-Providing dump data (hook writes to the socket):
--> "PID="
- number 0 - PID_MAX (/proc/sys/kernel/pid_max)
- \0
--> "EXECUTABLE="
- string (maximum length ~MAX_PATH)
- \0
--> "BACKTRACE="
- string (maximum length 1 MB)
- \0
--> "ANALYZER="
- string (maximum length 100 bytes)
- \0
--> "BASENAME="
- string (maximum length 100 bytes, no slashes)
- \0
--> "REASON="
- string (maximum length 512 bytes)
- \0
-
-Finalizing dump creation:
--> "DONE"
- \0
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Initializes the dump socket, usually in /var/run directory
- * (the path depends on compile-time configuration).
- */
-extern void dumpsocket_init();
-
-/* Releases all resources used by dumpsocket. */
-extern void dumpsocket_shutdown();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif