|
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
|
|
#
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
# Please add additional copyright information _after_ the line containing
|
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
|
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
|
|
#
|
|
# ROCK Linux: rock-src/misc/archive/bash_exec_debug.patch
|
|
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
|
|
#
|
|
# This patch file is dual-licensed. It is available under the license the
|
|
# patched project is licensed under, as long as it is an OpenSource license
|
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or 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.
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-END ---
|
|
|
|
--- ./execute_cmd.c.orig 2004-05-11 12:29:15.000000000 +0200
|
|
+++ ./execute_cmd.c 2004-05-11 12:43:59.000000000 +0200
|
|
@@ -3472,6 +3472,23 @@
|
|
int sample_len;
|
|
|
|
SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */
|
|
+ if ( getenv ("BASH_EXEC_DEBUG_FILE") )
|
|
+ {
|
|
+ char *file = getenv ("BASH_EXEC_DEBUG_FILE");
|
|
+ int fd = open (file, O_WRONLY|O_CREAT|O_APPEND, 0666);
|
|
+ if ( fd >= 0 )
|
|
+ {
|
|
+ int i;
|
|
+ write (fd, command, strlen(command));
|
|
+ for (i=0; args[i]; i++)
|
|
+ {
|
|
+ write (fd, " ", 1);
|
|
+ write (fd, args[i], strlen(args[i]));
|
|
+ }
|
|
+ write (fd, "\n", 1);
|
|
+ close (fd);
|
|
+ }
|
|
+ }
|
|
execve (command, args, env);
|
|
i = errno; /* error from execve() */
|
|
SETOSTYPE (1);
|