From nobody@FreeBSD.org  Wed Jun 26 18:58:10 2002
Return-Path: <nobody@FreeBSD.org>
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 6365E37E6BE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 26 Jun 2002 18:55:56 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g5R1tuOT096313
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 26 Jun 2002 18:55:56 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g5R1tupP096312;
	Wed, 26 Jun 2002 18:55:56 -0700 (PDT)
Message-Id: <200206270155.g5R1tupP096312@www.freebsd.org>
Date: Wed, 26 Jun 2002 18:55:56 -0700 (PDT)
From: Ash Garg <ash@telstra.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: releaseName env variable not reference in install.c
X-Send-Pr-Version: www-1.0

>Number:         39908
>Category:       misc
>Synopsis:       releaseName env variable not reference in install.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    matusita
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 26 19:00:06 PDT 2002
>Closed-Date:    Sun Jun 30 19:03:38 PDT 2002
>Last-Modified:  Sun Jun 30 19:03:38 PDT 2002
>Originator:     Ash Garg
>Release:        4.5
>Organization:
Telstra
>Environment:
FreeBSD Pluto.telstra.net 4.5-RELEASE-p5 FreeBSD 4.5-RELEASE-p5 #0: Wed May 29 14:06:20 EST 2002     agarg@Pluto.telstra.net:/usr/obj/usr/src/sys/PLUTO  i386

>Description:
The environment varible releaseName or VAR_RELNAME is not used to get the Release Name when running in the interactive mode even though it has been set. The kern.osrelease is used always.
>How-To-Repeat:
     
>Fix:
Modify the function static char* getRelname(void) in /usr/src/release/sysinstall/install.c to check if the environment variable exists and if it does, then use it.

Original Function
-----------------
static char *
getRelname(void)
{
    static char buf[64];
    int sz = (sizeof buf) - 1;
   
    if (sysctlbyname("kern.osrelease", buf, &sz, NULL, 0) != -1) {
        buf[sz] = '\0';
        return buf;
    }
    else
        return "<unknown>";
        }
}

Modified Function
-----------------static char *
getRelname(void)
{
    static char buf[64];
    int sz = (sizeof buf) - 1;
    
        /* Ash's Mods  Start */
        char* rel;
     
        rel=variable_get(VAR_RELNAME);
        if(rel==NULL)
        {
          /* Mods Finish */
    if (sysctlbyname("kern.osrelease", buf, &sz, NULL, 0) != -1) {
        buf[sz] = '\0';
        return buf;
    }
    else
        return "<unknown>";
        }
        /* Mods Start */
        else
        {
                return rel;
        }
        /* Mods Stop */
}



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: matusita 
State-Changed-When: Thu Jun 27 06:18:48 PDT 2002 
State-Changed-Why:  
It seems that the originator misunderstands the behavior of this funciton. 
Waiting for the feedback. 


Responsible-Changed-From-To: freebsd-bugs->matusita 
Responsible-Changed-By: matusita 
Responsible-Changed-When: Thu Jun 27 06:18:48 PDT 2002 
Responsible-Changed-Why:  
I'll take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39908 

From: Makoto Matsushita <matusita@jp.FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/39908: releaseName env variable not reference in install.c
Date: Thu, 27 Jun 2002 22:18:28 +0900

 ash> The environment varible releaseName or VAR_RELNAME is not used to
 ash> get the Release Name when running in the interactive mode even
 ash> though it has been set. The kern.osrelease is used always.
 
 getRelname() is used for the default vaule of VAR_RELNAME.  It is
 funny that getRelname() refers VAR_RELNAME value.  There is a way to
 change VAR_RELNAME with "Option" menu (and that is what this variable
 is used for).
 
 Would you please explain what is your problem?
 
 -- -
 Makoto `MAR' Matsushita
State-Changed-From-To: feedback->closed 
State-Changed-By: matusita 
State-Changed-When: Sun Jun 30 19:00:00 PDT 2002 
State-Changed-Why:  
After local conversations between the originator, this comes from 
misunderstandings that sysinstall refers environ(7)ment variable. 
Of course this is not true.  If you want to set 'sysinstall' variable, 
you can use command-line argument like: "sysinstall releaseName=blah func". 

The originator happily agreed to close this PR.  Thank you! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39908 
>Unformatted:
