[pkg-wpa-devel] r926 - in /wpasupplicant/trunk/debian: changelog patches/40_log_to_specific_file.patch patches/series
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Tue Dec 25 16:37:07 UTC 2007
Author: kelmo-guest
Date: Tue Dec 25 16:37:07 2007
New Revision: 926
URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=926
Log:
* Add debian/patches/40_log_to_specific_file.patch to provide a method of
logging wpa_supplicant debug output to a specific file given on command
line as argument to -F option.
Added:
wpasupplicant/trunk/debian/patches/40_log_to_specific_file.patch
Modified:
wpasupplicant/trunk/debian/changelog
wpasupplicant/trunk/debian/patches/series
Modified: wpasupplicant/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/changelog?rev=926&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/changelog (original)
+++ wpasupplicant/trunk/debian/changelog Tue Dec 25 16:37:07 2007
@@ -29,8 +29,11 @@
EAP methods. Build-depend on libpcsclite-dev.
* Add debian/patches/31_pcsc_funcs_printf_warnings.patch to fix compilation
warnings in src/utils/pcsc_funcs.c.
-
- -- Kel Modderman <kel at otaku42.de> Wed, 26 Dec 2007 02:07:13 +1000
+ * Add debian/patches/40_log_to_specific_file.patch to provide a method of
+ logging wpa_supplicant debug output to a specific file given on command
+ line as argument to -F option.
+
+ -- Kel Modderman <kel at otaku42.de> Wed, 26 Dec 2007 02:28:28 +1000
wpasupplicant (0.6.1~git20071119-1) unstable; urgency=low
Added: wpasupplicant/trunk/debian/patches/40_log_to_specific_file.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/40_log_to_specific_file.patch?rev=926&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/40_log_to_specific_file.patch (added)
+++ wpasupplicant/trunk/debian/patches/40_log_to_specific_file.patch Tue Dec 25 16:37:07 2007
@@ -1,0 +1,161 @@
+--- a/src/utils/wpa_debug.c
++++ b/src/utils/wpa_debug.c
+@@ -227,36 +227,42 @@
+ }
+
+
+-int wpa_debug_open_file(void)
++int wpa_debug_open_file(const char *file)
+ {
+ #ifdef CONFIG_DEBUG_FILE
+ static int count = 0;
+ char fname[64];
+ if (!wpa_debug_use_file)
+ return 0;
++ if (file != NULL && out_file == NULL) {
++ out_file = fopen(file, "a");
++ } else {
+ #ifdef _WIN32
+- os_snprintf(fname, sizeof(fname), "\\Temp\\wpa_supplicant-log-%d.txt",
+- count++);
++ os_snprintf(fname, sizeof(fname), "\\Temp\\wpa_supplicant-log-%d.txt",
++ count++);
+ #else /* _WIN32 */
+- os_snprintf(fname, sizeof(fname), "/tmp/wpa_supplicant-log-%d.txt",
+- count++);
++ os_snprintf(fname, sizeof(fname), "/tmp/wpa_supplicant-log-%d.txt",
++ count++);
+ #endif /* _WIN32 */
+- out_file = fopen(fname, "w");
++ out_file = fopen(fname, "w");
++ }
++ if (out_file == NULL) {
++ wpa_printf(MSG_ERROR, "wpa_debug_open_file: Failed to open output file, "
++ "using standard output");
++ return -1;
++ }
+ #ifndef _WIN32
+- if (out_file)
+- setvbuf(out_file, NULL, _IOLBF, 0);
++ setvbuf(out_file, NULL, _IOLBF, 0);
+ #endif /* _WIN32 */
+- return out_file == NULL ? -1 : 0;
+-#else /* CONFIG_DEBUG_FILE */
+- return 0;
+ #endif /* CONFIG_DEBUG_FILE */
++ return 0;
+ }
+
+
+ void wpa_debug_close_file(void)
+ {
+ #ifdef CONFIG_DEBUG_FILE
+- if (!wpa_debug_use_file)
++ if (!wpa_debug_use_file || out_file == NULL)
+ return;
+ fclose(out_file);
+ out_file = NULL;
+--- a/src/utils/wpa_debug.h
++++ b/src/utils/wpa_debug.h
+@@ -37,7 +37,7 @@
+
+ #else /* CONFIG_NO_STDOUT_DEBUG */
+
+-int wpa_debug_open_file(void);
++int wpa_debug_open_file(const char *file);
+ void wpa_debug_close_file(void);
+
+ /**
+--- a/wpa_supplicant/doc/docbook/wpa_supplicant.sgml
++++ b/wpa_supplicant/doc/docbook/wpa_supplicant.sgml
+@@ -17,6 +17,7 @@
+ <arg>-c<replaceable>config file</replaceable></arg>
+ <arg>-D<replaceable>driver</replaceable></arg>
+ <arg>-P<replaceable>PID_file</replaceable></arg>
++ <arg>-F<replaceable>output file</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+@@ -383,6 +384,13 @@
+ </varlistentry>
+
+ <varlistentry>
++ <term>-F output file</term>
++ <listitem>
++ <para>Log output to specified file.</para>
++ </listitem>
++ </varlistentry>
++
++ <varlistentry>
+ <term>-g global ctrl_interface</term>
+ <listitem>
+ <para>Path to global ctrl_interface socket.</para>
+--- a/wpa_supplicant/main.c
++++ b/wpa_supplicant/main.c
+@@ -40,7 +40,12 @@
+ printf("%s\n\n%s\n"
+ "usage:\n"
+ " wpa_supplicant [-BddfhKLqqtuvwW] [-P<pid file>] "
+- "[-g<global ctrl>] \\\n"
++ "[-g<global ctrl>]"
++#ifdef CONFIG_DEBUG_FILE
++ " [-F<output file>] \\\n"
++#else /* CONFIG_DEBUG_FILE */
++ " \\\n"
++#endif /* CONFIG_DEBUG_FILE */
+ " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
+ "[-p<driver_param>] \\\n"
+ " [-b<br_ifname> [-N -i<ifname> -c<conf> [-C<ctrl>] "
+@@ -67,6 +72,7 @@
+ " -D = driver name\n"
+ #ifdef CONFIG_DEBUG_FILE
+ " -f = Log output to default log location (normally /tmp)\n"
++ " -F = Log output to specified file\n"
+ #endif /* CONFIG_DEBUG_FILE */
+ " -g = global ctrl_interface\n"
+ " -K = include keys (passwords, etc.) in debug output\n"
+@@ -146,7 +152,7 @@
+ wpa_supplicant_fd_workaround();
+
+ for (;;) {
+- c = getopt(argc, argv, "b:Bc:C:D:dfg:hi:KLNp:P:qtuvwW");
++ c = getopt(argc, argv, "b:Bc:C:D:dF:fg:hi:KLNp:P:qtuvwW");
+ if (c < 0)
+ break;
+ switch (c) {
+@@ -179,6 +185,10 @@
+ case 'f':
+ params.wpa_debug_use_file = 1;
+ break;
++ case 'F':
++ params.wpa_debug_use_file = 1;
++ params.wpa_debug_file = optarg;
++ break;
+ #endif /* CONFIG_DEBUG_FILE */
+ case 'g':
+ params.ctrl_interface = optarg;
+--- a/wpa_supplicant/wpa_supplicant.c
++++ b/wpa_supplicant/wpa_supplicant.c
+@@ -1828,7 +1828,7 @@
+ return NULL;
+
+ wpa_debug_use_file = params->wpa_debug_use_file;
+- wpa_debug_open_file();
++ wpa_debug_open_file(params->wpa_debug_file);
+
+ ret = eap_peer_register_methods();
+ if (ret) {
+--- a/wpa_supplicant/wpa_supplicant_i.h
++++ b/wpa_supplicant/wpa_supplicant_i.h
+@@ -154,6 +154,11 @@
+ * wpa_debug_use_file - Write debug to a file (instead of stdout)
+ */
+ int wpa_debug_use_file;
++
++ /**
++ * wpa_debug_file - Write debug to specified file.
++ */
++ char *wpa_debug_file;
+ };
+
+ /**
Modified: wpasupplicant/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/series?rev=926&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/patches/series (original)
+++ wpasupplicant/trunk/debian/patches/series Tue Dec 25 16:37:07 2007
@@ -4,3 +4,4 @@
21_config_driver_madwifi.patch
30_wpa_gui_const_char_warnings.patch
31_pcsc_funcs_printf_warnings.patch
+40_log_to_specific_file.patch
More information about the Pkg-wpa-devel
mailing list