tags 206726 patch
thanks

The fix for the issue of -L not working is attached. The problem is that
linux_logo does not use the command line arguments to override the value
defined in the configuration file (/etc/linuxlogo.conf), so if a user sets
'-L random' in the CLI this is what happens:

1.- Linux_logo reads the config file (which contains -L 4) and sets 
    logo_override=1 with a number
2.- Linux_logo parses the command line (since -i is not being used), 
    sets random_logo=1
3.- The code goes and selects a random logo in
    886     if (random_logo) {
    (...)
    939     }
4.- The code continues and sets the logo override:
    941     if (logo_override) {
    (...)
    953     }

Which means that, unlike other options, the -L definition in
/etc/linux_logo.conf overrides the user's -L option. There are two ways to
fix it: either make random_logo / logo_override mutually exclusive or have
the use of '-L' reset the values to prevent previous settings, this is what
I have done in the attached patch.

I've tested it locally and works fine, whatever the value of
/etc/linuxlogo.conf, please apply it to fix this bug.

Regards

Javier

--- linux_logo.c.old    2006-07-08 13:42:31.000000000 +0200
+++ linux_logo.c        2006-07-08 16:42:31.000000000 +0200
@@ -794,6 +794,9 @@
                       break;
             case 'l': settings.display_logo_only=1; break;
             case 'L': 
+                      /* Reset values in case we get this after
+                       * reading the file */
+                      logo_num = 1; logo_override = 0; random_logo = 0;
                       logo_num=strtol(optarg,&endptr,10);
                       if ( endptr == optarg ) {
                          temp_st=strdup(optarg);

Attachment: signature.asc
Description: Digital signature

Reply via email to