/* abrt-pyhook-helper.cpp - writes data to the /var/cache/abrt directory with SUID bit Copyright (C) 2009 RedHat inc. 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. */ #include #include /* We can easily get rid of abrtlib (libABRTUtils.so) usage in this file, * but DebugDump will pull it in anyway */ #include "abrtlib.h" #include "DebugDump.h" #if HAVE_CONFIG_H # include #endif #define MAX_BT_SIZE (1024*1024) static char *pid; static char *executable; static char *uuid; static char *cmdline; int main(int argc, char** argv) { // Parse options static const struct option longopts[] = { // name , has_arg , flag, val { "pid" , required_argument, NULL, 'p' }, { "executable", required_argument, NULL, 'e' }, { "uuid" , required_argument, NULL, 'u' }, { "cmdline" , required_argument, NULL, 'c' }, { 0 }, }; int opt; while ((opt = getopt_long(argc, argv, "p:e:u:c:l:", longopts, NULL)) != -1) { switch (opt) { case 'p': pid = optarg; break; case 'e': executable = optarg; break; case 'u': uuid = optarg; break; case 'c': cmdline = optarg; break; default: usage: error_msg_and_die( "Usage: abrt-pyhook-helper [OPTIONS]