Date: Wed, 26 Jun 2002 18:55:56 -0700 (PDT) From: Ash Garg <ash@telstra.net> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/39908: releaseName env variable not reference in install.c Message-ID: <200206270155.g5R1tupP096312@www.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 39908
>Category: misc
>Synopsis: releaseName env variable not reference in install.c
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Jun 26 19:00:06 PDT 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206270155.g5R1tupP096312>
