#984846 netcfg: Default hostname hardcoded in netcfg-common

Package:
netcfg
Source:
netcfg
Submitter:
Arnaud Rebillout
Date:
2021-03-09 21:18:03 UTC
Severity:
normal
Tags:
#984846#5
Date:
2021-03-09 04:20:41 UTC
From:
To:
Dear Maintainer,

the default hostname "debian" is hardcoded in two places in the file
netcfg-common.c:

https://salsa.debian.org/installer-team/netcfg/-/blob/master/netcfg-common.c#L1043
https://salsa.debian.org/installer-team/netcfg/-/blob/master/netcfg-common.c#L1069

This was reported in the Kali Linux bugtracker [1].

For Kali, we set the default hostname to 'kali' in the file
'debian/netcfg-common.templates', key 'netcfg/get_hostname', so that the
installer proposes it as the default hostname. It works well, however
one of our user noticed that if they enter an invalid hostname, the
default hostname is set back to 'debian' (since it's hardcoded in
netcfg-common.c).

It would be nice if instead it would default to the value that is set in
'netcfg/get_hostname'. However I'm nost sure how to achieve that, as
I'm not familiar with the netcfg code at all, and it's not clear if we
can still get this value at this moment in the code, or if it has been
overwritten by the user's input.

Cheers,

  Arnaud

[1] https://bugs.kali.org/view.php?id=7070

#984846#10
Date:
2021-03-09 14:39:48 UTC
From:
To:
Hello,

Arnaud Rebillout <arnaudr@kali.org> (2021-03-09):

My first reaction was “we could make that configurable on a per-vendor
fashion” (e.g. via debian/rules) but reading you are already patching
debian/netcfg-common.templates, why aren't you patching the two harcoded
locations in the first place?

That would mean updating a patch on your side, without changing any code
or logic?


Cheers,

#984846#15
Date:
2021-03-09 21:15:19 UTC
From:
To:
Hi,

Le mardi 09 mars 2021, Cyril Brulebois a écrit :

We are patching it because there's no other clean way to change the
default hostname for a derivative, see #719101 for another kali report
related to this.

But it would be really nice if we didn't have to patch any this udeb
(even though it's really not hardwork).

Le mardi 09 mars 2021, Arnaud Rebillout a écrit :

Actually in #719101 I suggested to use a dedicated debconf variable to
control the default value... that value could be used in both places.

Cheers,