The Samba-Bugzilla – Attachment 5344 Details for
Bug 6943
eventlogadm uses wrong configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
0001-s3-eventlogadm.c-make-eventlogadm-recognize-a-differ.patch (text/plain), 4.11 KB, created by
Holger Hetterich
on 2010-02-13 13:31:33 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Holger Hetterich
Created:
2010-02-13 13:31:33 UTC
Size:
4.11 KB
patch
obsolete
>From 8220c014e66dc2d602e91901fdbbc0c48adb0609 Mon Sep 17 00:00:00 2001 >From: Holger Hetterich <hhetter@novell.com> >Date: Sat, 13 Feb 2010 20:23:52 +0100 >Subject: [PATCH] s3: eventlogadm.c: make eventlogadm recognize a different configuration files. > >Update the eventlogadm manpage accordingly. >BSO #6943 >--- > docs-xml/manpages-3/eventlogadm.8.xml | 13 +++++++++++++ > source3/utils/eventlogadm.c | 20 ++++++++++++++++---- > 2 files changed, 29 insertions(+), 4 deletions(-) > >diff --git a/docs-xml/manpages-3/eventlogadm.8.xml b/docs-xml/manpages-3/eventlogadm.8.xml >index c104120..7bbded1 100644 >--- a/docs-xml/manpages-3/eventlogadm.8.xml >+++ b/docs-xml/manpages-3/eventlogadm.8.xml >@@ -20,6 +20,7 @@ > <cmdsynopsis> > > <command>eventlogadm</command> >+ <arg><option>-f</option></arg> > <arg><option>-d</option></arg> > <arg><option>-h</option></arg> > <arg choice="plain"><option>-o</option> >@@ -32,6 +33,7 @@ > </cmdsynopsis> > <cmdsynopsis> > <command>eventlogadm</command> >+ <arg><option>-f</option></arg> > <arg><option>-d</option></arg> > <arg><option>-h</option></arg> > <arg choice="plain"><option>-o</option> >@@ -42,6 +44,7 @@ > </cmdsynopsis> > <cmdsynopsis> > <command>eventlogadm</command> >+ <arg><option>-f</option></arg> > <arg><option>-d</option></arg> > <arg><option>-h</option></arg> > <arg choice="plain"><option>-o</option> >@@ -72,6 +75,16 @@ > <title>OPTIONS</title> > > <variablelist> >+ <varlistentry> >+ <term> >+ <option>-f</option> >+ <replaceable>FILENAME</replaceable> >+ </term> >+ <listitem><para> >+ The <command>-f</command> option causes <command>eventlogadm</command> to load the >+ configuration file given as FILENAME instead of the default one used by Samba. >+ </para></listitem> >+ </varlistentry> > > <varlistentry> > <term><option>-d</option></term> >diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c >index 415330f..9e0023d 100644 >--- a/source3/utils/eventlogadm.c >+++ b/source3/utils/eventlogadm.c >@@ -40,6 +40,7 @@ static void usage( char *s ) > printf( " -o addsource <EventlogName> <sourcename> <msgfileDLLname> \tAdds the specified source & DLL eventlog registry entry\n" ); > printf( " -o dump <Eventlog Name> <starting_record>\t\t\t\t\tDump stored eventlog entries on STDOUT\n" ); > printf( "\nMiscellaneous options:\n" ); >+ printf( " -f <filename>\t\t\t\t\t\t\tUse configuration file <filename>.\n"); > printf( " -d\t\t\t\t\t\t\t\tturn debug on\n" ); > printf( " -h\t\t\t\t\t\t\t\tdisplay help\n\n" ); > } >@@ -50,7 +51,7 @@ static void display_eventlog_names( void ) > int i; > > elogs = lp_eventlog_list( ); >- printf( "Active eventlog names (from smb.conf):\n" ); >+ printf( "Active eventlog names:\n" ); > printf( "--------------------------------------\n" ); > if ( elogs ) { > for ( i = 0; elogs[i]; i++ ) { >@@ -220,6 +221,7 @@ int main( int argc, char *argv[] ) > { > int opt, rc; > char *exename; >+ char *configfile = NULL; > TALLOC_CTX *frame = talloc_stackframe(); > > >@@ -229,8 +231,6 @@ int main( int argc, char *argv[] ) > > opt_debug = 0; /* todo set this from getopts */ > >- lp_load(get_dyn_CONFIGFILE(), True, False, False, True); >- > exename = argv[0]; > > /* default */ >@@ -240,7 +240,7 @@ int main( int argc, char *argv[] ) > #if 0 /* TESTING CODE */ > eventlog_add_source( "System", "TestSourceX", "SomeTestPathX" ); > #endif >- while ( ( opt = getopt( argc, argv, "dho:" ) ) != EOF ) { >+ while ( ( opt = getopt( argc, argv, "dho:f:" ) ) != EOF ) { > switch ( opt ) { > > case 'o': >@@ -256,6 +256,10 @@ int main( int argc, char *argv[] ) > case 'd': > opt_debug = 1; > break; >+ case 'f': >+ configfile = talloc_strdup(frame, optarg); >+ break; >+ > } > } > >@@ -268,6 +272,14 @@ int main( int argc, char *argv[] ) > exit( 1 ); > } > >+ if ( configfile == NULL ) { >+ lp_load(get_dyn_CONFIGFILE(), True, False, False, True); >+ } else if (!lp_load(configfile, True, False, False, True)) { >+ printf("Unable to parse configfile '%s'\n",configfile); >+ exit( 1 ); >+ } >+ printf("Using configuration file %s\n", configfile); >+ > /* note that the separate command types should call usage if they need to... */ > while ( 1 ) { > if ( !StrCaseCmp( opname, "addsource" ) ) { >-- >1.6.4.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6943
:
5344
|
5345
|
5346