Bug 17330

Summary: a bug in the routine reading rc.conf
Product: Base System Reporter: mellon <mellon>
Component: binAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description mellon 2000-03-12 02:50:01 UTC
	
	In usr.sbin/kbdmap/kbdmap.pl, the routine &font_current
        which reads /etc/rc.conf to determine the current font
        does not handle correctly the quotation marks around fontname, 
        which causes later regexp in &vidcontrol to fail, as a
        consequence vidcontrol(1) is not invoked.

How-To-Repeat: 
	Install a non-standard font not matching your LANG vars
        in /etc/rc.conf . Run vidfont(1),
        but do not choose any font, rather exit by Canceling. Your
        font will be changed to the one matching your $LANG, but then
        it'll fail to revert to your default font on exit.
Comment 1 Sheldon Hearn 2000-03-13 15:42:17 UTC
On Sun, 12 Mar 2000 04:41:57 GMT, mellon@pobox.com wrote:

> -	    $font_current = $1 if $1 ne "NO";
> +	    ($font_current = $1) =~ s/"//g  if $1 ne "NO";

Do you agree that the following is preferable?

Ciao,
Sheldon.

Index: kbdmap.pl
===================================================================
RCS file: /home/ncvs/src/usr.sbin/kbdmap/kbdmap.pl,v
retrieving revision 1.10
diff -u -d -r1.10 kbdmap.pl
--- kbdmap.pl	1999/08/28 01:16:39	1.10
+++ kbdmap.pl	2000/03/13 15:41:21
@@ -85,7 +85,7 @@
 
     while(<F>) {
 	/^#/ && next;
-	if (/^\s*font[0-9]+x[0-9]+\s*=\s*(\S+)/) {
+	if (/^\s*font[0-9]+x[0-9]+\s*=\s*\"?([^\s\"]+)\"?/) {
 	    $font_current = $1 if $1 ne "NO";
 	}
     }
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-13 15:42:20 UTC
State Changed
From-To: open->feedback

Waiting for feedback on an alternative patch. 


Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-13 15:42:20 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I'll take this one. 

Comment 4 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-14 09:33:43 UTC
State Changed
From-To: feedback->closed

Committed and merged onto the RELENG_4 and RELENG_3 branches.   
Unfortunately, this one missed 4.0-RELEASE. 

Note that kbdmap.pl is still problematic.  It should really use 
something like a perl wrapper module for Daniel Sobral's libconf, 
which understands /etc/defaults/rc.conf et al, but the problem 
you reported has been fixed. 

Thanks!