Univention Bugzilla – Attachment 7455 Details for
Bug 39700
univention-system-activation: On non-master systems, root ssh restrictions are not removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
univention-system-setup.patch
univention-system-setup.patch (text/plain), 5.44 KB, created by
Eduard Mai
on 2016-02-05 17:18:47 CET
(
hide
)
Description:
univention-system-setup.patch
Filename:
MIME Type:
Creator:
Eduard Mai
Created:
2016-02-05 17:18:47 CET
Size:
5.44 KB
patch
obsolete
>Index: umc/js/setup/ApplianceWizard.js >=================================================================== >--- umc/js/setup/ApplianceWizard.js (Revision 67254) >+++ umc/js/setup/ApplianceWizard.js (Arbeitskopie) >@@ -717,6 +717,7 @@ > name: 'start/join', > label: _('Start join at the end of the installation'), > value: true, >+ disabled: !!this.ucr['umc/web/appliance/name'], > onChange: lang.hitch(this, function(value) { > this.getWidget('credentials-nonmaster', '_ucs_autosearch_master').set('disabled', !value); > this.getWidget('credentials-nonmaster', '_ucs_address').set('disabled', !value || this.getWidget('credentials-nonmaster', '_ucs_autosearch_master').get('value')); >@@ -2172,11 +2173,18 @@ > _checkCredentials: function() { > var params = {role: this._getRoleForDomainChecks(true)}; > lang.mixin(params, this._getCredentials()); >- return this.standbyDuring(this.umcpCommand('setup/check/credentials', params).then(function(data) { >+ return this.umcpCommand('setup/check/credentials', params).then(function(data) { > return data.result; >- })); >+ }); > }, > >+ _domainHasActivatedLicense: function () { >+ var credentials = this._getCredentials(); >+ return this.umcpCommand('setup/check/license', credentials).then(function(data) { >+ return data.result; >+ }); >+ }, >+ > _getCredentials: function() { > var address, username, password, dns; > var isAdMember = this._isAdMember(); >@@ -2391,11 +2399,21 @@ > } > > if (pageName == 'credentials-ad' || pageName == 'credentials-nonmaster') { >- return this._checkCredentials().then(lang.hitch(this, function(domain) { >+ return this.standbyDuring(this._checkCredentials().then(lang.hitch(this, function(domain) { > var msg = ''; > this._domainName = null; > if (typeof domain == 'string') { > this._domainName = domain; >+ if (this.ucr['umc/web/appliance/name'] && pageName == 'credentials-nonmaster') { >+ return this._domainHasActivatedLicense().then(lang.hitch(this, function(data) { >+ if (!data) { >+ msg = _('App Appliance could not be joined because the license on the DC Master is not activated.'); >+ nextPage = pageName; >+ dialog.alert(msg); >+ } >+ return this._forcePageTemporarily(nextPage); >+ })); >+ } > } else if (domain === false) { > msg = _('Connection refused. Please recheck the password'); > nextPage = pageName; >@@ -2414,7 +2432,7 @@ > } > > return this._forcePageTemporarily(nextPage); >- })); >+ }))); > } > > if (nextPage == 'software') { >Index: umc/setup.xml >=================================================================== >--- umc/setup.xml (Revision 67254) >+++ umc/setup.xml (Arbeitskopie) >@@ -48,5 +48,6 @@ > <command name="setup/check/credentials" function="check_credentials"/> > <command name="setup/set_locale" function="set_locale"/> > <command name="setup/net/progress" function="progress"/> >+ <command name="setup/check/license" function="domain_has_activated_license"/> > </module> > </umc> >Index: umc/python/setup/__init__.py >=================================================================== >--- umc/python/setup/__init__.py (Revision 67254) >+++ umc/python/setup/__init__.py (Arbeitskopie) >@@ -41,7 +41,7 @@ > import subprocess > import json > import locale as _locale >-import lxml.etree >+import lxml.etree > > import notifier > import notifier.threads >@@ -237,8 +237,15 @@ > oldrole = orgValues.get('server/role', '') > newrole = values.get('server/role', oldrole) > if orgValues.get('joined'): >- raise Exception(_('Already joined systems cannot be joined.')) >+ raise UMC_Error(_('Already joined systems cannot be joined.')) > >+ is_appliance = ucr.get('umc/web/appliance/name') != '' >+ is_nonmaster = newrole != "domaincontroller_master" >+ if is_appliance and is_nonmaster: >+ activated = self._domain_has_activated_license(values.get('nameserver1'), username, password) >+ if not activated: >+ raise UMC_Error(_('App Appliance could not be joined because the license on the DC Master is not activated.')) >+ > def _thread(obj, username, password): > # acquire the lock until the scripts have been executed > self._finishedResult = False >@@ -749,6 +756,10 @@ > return result > > @simple_response >+ def domain_has_activated_license(self, nameserver, username, password): >+ return util.domain_has_activated_license(nameserver, username, password) >+ >+ @simple_response > def check_credentials(self, role, dns, nameserver, address, username, password): > if role == 'ad': > try: >Index: umc/python/setup/util.py >=================================================================== >--- umc/python/setup/util.py (Revision 67254) >+++ umc/python/setup/util.py (Arbeitskopie) >@@ -54,6 +54,7 @@ > from univention.management.console.log import MODULE > from univention.management.console.modules import UMC_CommandError > from univention.lib.admember import lookup_adds_dc, failedADConnect >+from univention.lib.umc_connection import UMCConnection > > try: > # execute imports in try/except block as during build test scripts are >@@ -999,3 +1000,15 @@ > ipv4_nameserver=random.choice(ipv4_servers), > ipv6_nameserver=random.choice(ipv6_servers), > ) >+ >+def domain_has_activated_license(nameserver, username, password): >+ fqdn_master = get_fqdn(nameserver) >+ if not fqdn_master: >+ return False >+ connection = UMCConnection(fqdn_master) >+ connection.auth(username, password) >+ result = connection.request('udm/license/info') >+ if result.get('keyID'): >+ return True >+ else: >+ return False
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 39700
: 7455 |
7456
|
7534
|
7536
|
7539