Bug 43326 - no hostname validation in system setup (if samba is not selected)
no hostname validation in system setup (if samba is not selected)
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Setup wizard
UCS 4.3
Other Linux
: P5 normal (vote)
: UCS 4.4-0-errata
Assigned To: Johannes Keiser
Florian Best
:
Depends on:
Blocks: 42955
  Show dependency treegraph
 
Reported: 2017-01-11 11:19 CET by Felix Botner
Modified: 2019-05-22 11:49 CEST (History)
7 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.206
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019032221000441
Bug group (optional):
Max CVSS v3 score:


Attachments
Screenshot (35.20 KB, image/png)
2019-05-15 20:14 CEST, Florian Best
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2017-01-11 11:19:15 CET
It is possible to install a 4.1-3 ucs master with a looong hostname (< 15 characters) if samba is not selected as component to install. 

(If samba is selected, one gets a error -> A valid NetBIOS name can not be longer than 13 characters).

I think that is a problem because the subsequent installation of samba on this system breaks samba (join fails, ...).

The hostname.len()<=13 check should be done always, regardless if samba is selected or not.
Comment 1 Erik Damrose univentionstaff 2017-01-11 11:34:48 CET
umc/js/setup/ApplianceWizard.js _validateHostname does not check for length

umc/python/setup/__init__.py validate() marks the hostname check only critical if univention-samba[4] is selected. The warning is returned but never shown when no u-samba package is selected
Comment 2 Stefan Gohmann univentionstaff 2019-01-03 07:23:36 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
Comment 3 Valentin Heidelberger univentionstaff 2019-03-22 12:45:51 CET
Just ran into this in a customer's environment.
Comment 4 Valentin Heidelberger univentionstaff 2019-03-22 12:56:05 CET
IMHO this should definitely be fixed at some point. There's also no warning/check regarding the hostname during the installation of Samba. The problem only becomes apparent when one tries to execute the Samba join script. They log a traceback from setup-s4.sh into join.log.
At that point there might already be a lot set up including servers, user data, apps, and so on. A re-installation with a different hostname is at the very least frustrating at that point.
Comment 5 Florian Best univentionstaff 2019-03-22 13:02:38 CET
We should check for existing samba DC's in the domain and use this as indicator instead of the selected packages (on server/role != master).
Comment 6 Valentin Heidelberger univentionstaff 2019-03-22 13:04:55 CET
(In reply to Florian Best from comment #5)
> We should check for existing samba DC's in the domain and use this as
> indicator instead of the selected packages (on server/role != master).

I think a warning should be shown regardless of existing Samba installations. The customer might be installing a master with a hostname > 15 characters and planning to install Samba later on.
Comment 7 Christian Völker univentionstaff 2019-04-09 14:23:40 CEST
Customers might install their host with an invalid hostname.

Everything works fine until trying to install ucs@school (see bug #42955). 

This is more than annoying to have such a late check for hostname!

Check validity during install. Not later as currently customers have to re-install the entire system.
Comment 8 Johannes Keiser univentionstaff 2019-05-13 12:40:37 CEST
63d3bd7c2c Bug #43326: yaml
92b74d175d Bug #43326: debian changelog
588eeba21d Bug #43326: yaml
c6620cae8b Bug #43326: translations
38b1c32466 Bug #43326: Add warning to system setup if hostname > 13 characters

Successful build
Package: univention-system-setup
Version: 12.0.2-6A~4.4.0.201905131235
Comment 9 Florian Best univentionstaff 2019-05-15 20:14:12 CEST
Created attachment 10030 [details]
Screenshot

This is how it looks. 

Warnung: Der Rechnername ucs-944423456788 is länger als 13 Zeichen. Es wird nicht möglich sein einen Active Directory-kompatiblen Domänencontroller oder UCS@school zu installieren. Der Rechnername kann nach der Installation des UCS-Systems nicht mehr geändert werden. Es wird empfohlen, den Rechnernamen auf maximal 13 Zeichen zu kürzen.

REOPEN: traceback when I select "fast demo"
REOPEN: the german translation of the message can be improved. At least missing a ",": "nicht möglich sein, einen".

OK: YAML
OK: Message on the overview page
OK: DC Master
OK: DC Backup/Slave/Member
OK~: "No domain" (basesystem, which cannot have Samba4 / UCS@school)

Request: setup/validate (wizard)

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 260, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/setup/__init__.py", line 406, in validate
    hostname_length_message = _('A valid NetBIOS name can not be longer than 13 characters. If Samba is installed, the hostname should be shortened.') if hostname_length_critical else _('The hostname %s is longer than 13 characters. It will not be possible to install an Active Directory compatible Domaincontroller (Samba 4) or UCS@school. The hostname cannot be changed after the installation of %s. It is recommended to shorten the hostname to maximal 13 characters.') % (values['hostname'], appliance_str,)
KeyError: 'hostname'
Comment 10 Johannes Keiser univentionstaff 2019-05-21 10:49:11 CEST
cb94bc01dc Bug #43326: yaml
88b3cd920f Bug #43326: Merge branch 'jkeiser/4.4-0/43326' into 4.4-0
bb5877270f Bug #43326: debian changelog
1831a2b7d9 Bug #43326: typo
7001e60787 Bug #43326: fix wrong this.required for _validateHostOrFQDN
793ee55ecb Bug #43326: fix hostname length check skipping other checks
123bf498ea Bug #43326: prevent traceback if not hostname given

Successful build
Package: univention-system-setup
Version: 12.0.2-7A~4.4.0.201905211042
Comment 11 Johannes Keiser univentionstaff 2019-05-21 13:25:53 CEST
651d891cf6 Bug #43326: yaml
e7cf1c8e89 Bug #43326: debian changelog
2c4f2d3aa1 Bug #43326: wording

Successful build
Package: univention-system-setup
Version: 12.0.2-8A~4.4.0.201905211320
Comment 12 Florian Best univentionstaff 2019-05-21 15:46:18 CEST
OK: looks good now
Comment 13 Arvid Requate univentionstaff 2019-05-22 11:49:13 CEST
<http://errata.software-univention.de/ucs/4.4/111.html>