Hello community,

here is the log from the commit of package yast2-aduc for openSUSE:Factory 
checked in at 2020-05-04 22:01:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-aduc (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-aduc.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-aduc"

Mon May  4 22:01:14 2020 rev:9 rq:800136 version:2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-aduc/yast2-aduc.changes    2019-10-31 
18:18:48.230230921 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-aduc.new.2738/yast2-aduc.changes  
2020-05-04 22:01:21.762593190 +0200
@@ -1,0 +2,6 @@
+Fri May  1 21:13:27 UTC 2020 - dmul...@suse.com
+
+- Bump version 2.1:
+  + yast2-aduc produces a lot of ldap traffic; (bsc#1170998);
+
+-------------------------------------------------------------------

Old:
----
  yast2-aduc-2.0.tar.bz2

New:
----
  yast2-aduc-2.1.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-aduc.spec ++++++
--- /var/tmp/diff_new_pack.yNp3JP/_old  2020-05-04 22:01:22.690595069 +0200
+++ /var/tmp/diff_new_pack.yNp3JP/_new  2020-05-04 22:01:22.698595085 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-aduc
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-aduc
-Version:        2.0
+Version:        2.1
 Release:        0
 Summary:        Active Directory Users and Computers for YaST
 License:        GPL-3.0-only
@@ -57,13 +57,11 @@
 
 %install
 %yast_install
-%yast_metainfo
 
 %files
 %{yast_clientdir}
 %{yast_yncludedir}
 %{yast_desktopdir}
-%{yast_metainfodir}
 %doc %{yast_docdir}
 %license COPYING
 

++++++ yast2-aduc-2.0.tar.bz2 -> yast2-aduc-2.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-aduc-2.0/package/yast2-aduc.changes 
new/yast2-aduc-2.1/package/yast2-aduc.changes
--- old/yast2-aduc-2.0/package/yast2-aduc.changes       2019-10-30 
14:46:28.000000000 +0100
+++ new/yast2-aduc-2.1/package/yast2-aduc.changes       2020-05-04 
20:05:03.000000000 +0200
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Fri May  1 21:13:27 UTC 2020 - dmul...@suse.com
+
+- Bump version 2.1:
+  + yast2-aduc produces a lot of ldap traffic; (bsc#1170998);
+
+-------------------------------------------------------------------
 Wed Oct 30 13:33:56 UTC 2019 - dmul...@suse.com
 
 - Bump version 2.0:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-aduc-2.0/package/yast2-aduc.spec 
new/yast2-aduc-2.1/package/yast2-aduc.spec
--- old/yast2-aduc-2.0/package/yast2-aduc.spec  2019-10-30 14:46:28.000000000 
+0100
+++ new/yast2-aduc-2.1/package/yast2-aduc.spec  2020-05-04 20:05:03.000000000 
+0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-aduc
-Version:        2.0
+Version:        2.1
 Release:        0
 Summary:        Active Directory Users and Computers for YaST
 License:        GPL-3.0-only
@@ -57,13 +57,11 @@
 
 %install
 %yast_install
-%yast_metainfo
 
 %files
 %{yast_clientdir}
 %{yast_yncludedir}
 %{yast_desktopdir}
-%{yast_metainfodir}
 %doc %{yast_docdir}
 %license COPYING
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-aduc-2.0/src/include/aduc/complex.py 
new/yast2-aduc-2.1/src/include/aduc/complex.py
--- old/yast2-aduc-2.0/src/include/aduc/complex.py      2019-10-30 
14:46:28.000000000 +0100
+++ new/yast2-aduc-2.1/src/include/aduc/complex.py      2020-05-04 
20:05:03.000000000 +0200
@@ -44,12 +44,12 @@
             dn = dn.decode('utf-8')
         return self.ldap_search(dn, SCOPE_BASE, '(objectClass=*)', attrs)[-1]
 
-    def objects_list(self, container):
+    def objects_list(self, container, attrs=[]):
         ret = []
-        containers = self.ldap_search(container, SCOPE_ONELEVEL, 
'(&(|(objectClass=organizationalUnit)(objectCategory=Container)(objectClass=builtinDomain))(!(|(cn=System)(cn=Program
 Data))))', [])
+        containers = self.ldap_search(container, SCOPE_ONELEVEL, 
'(&(|(objectClass=organizationalUnit)(objectCategory=Container)(objectClass=builtinDomain))(!(|(cn=System)(cn=Program
 Data))))', attrs)
         if containers:
             ret.extend(containers)
-        objs = self.ldap_search(container, SCOPE_ONELEVEL, 
'(|(objectCategory=person)(objectCategory=group)(objectCategory=computer)(objectCategory=MSMQ-Custom-Recipient)(objectClass=printQueue)(objectCategory=Volume))',
 [])
+        objs = self.ldap_search(container, SCOPE_ONELEVEL, 
'(|(objectCategory=person)(objectCategory=group)(objectCategory=computer)(objectCategory=MSMQ-Custom-Recipient)(objectClass=printQueue)(objectCategory=Volume))',
 attrs)
         if objs:
             ret.extend(objs)
         return ret
@@ -80,13 +80,15 @@
             ycpbuiltins.y2error(traceback.format_exc())
             ycpbuiltins.y2error('ldap.add_s: %s\n' % e.info if e.info else 
e.msg)
             y2error_dialog(e.info if e.info else e.msg)
-            return
+            return None
+        return dn
 
     def add_user(self, user_attrs, container=None, inetorgperson=False):
         if not container:
             container = self.__well_known_container('users')
         if not strcmp(user_attrs['userPassword'], 
user_attrs['confirm_passwd']):
-            raise Exception('The passwords do not match.')
+            y2error_dialog('The passwords do not match.')
+            return None
         attrs = {}
 
         attrs['objectClass'] = ['top', 'person', 'organizationalPerson', 
'user']
@@ -129,7 +131,7 @@
             ycpbuiltins.y2error(traceback.format_exc())
             ycpbuiltins.y2error('ldap.add_s: %s\n' % e.info if e.info else 
e.msg)
             y2error_dialog(e.info if e.info else e.msg)
-            return
+            return None
 
         try:
             if six.PY3:
@@ -151,6 +153,7 @@
         if user_attrs['account_disabled']:
             uac |= 0x0002
         self.ldap_modify(dn, modlist(stringify_ldap({'userAccountControl': 
attrs['userAccountControl']}), stringify_ldap({'userAccountControl': 
[str(uac)]})))
+        return dn
 
     def add_group(self, group_attrs, container=None):
         if not container:
@@ -185,6 +188,7 @@
             ycpbuiltins.y2error(traceback.format_exc())
             ycpbuiltins.y2error('ldap.add_s: %s\n' % e.info if e.info else 
e.msg)
             y2error_dialog(e.info if e.info else e.msg)
+        return dn
 
     def add_computer(self, computer_attrs, container=None):
         if not container:
@@ -211,6 +215,7 @@
             ycpbuiltins.y2error(traceback.format_exc())
             ycpbuiltins.y2error('ldap.add_s: %s\n' % e.info if e.info else 
e.msg)
             y2error_dialog(e.info if e.info else e.msg)
+        return dn
 
     def update(self, dn, orig_map, modattr, addattr):
         dn = dn if isinstance(dn, six.string_types) else dn.decode('utf8')
@@ -255,18 +260,18 @@
             ycpbuiltins.y2error('ldap.rename_s: %s\n' % str(e))
             y2error_dialog(str(e))
 
-    def is_user(self, cn, container):
+    def is_user(self, dn):
         SAM_USER_OBJECT = 0x30000000
-        res = self.search(container, SCOPE_ONELEVEL, '(cn=%s)' % cn, 
['sAMAccountType'])
+        res = self.search(dn, SCOPE_BASE, None, ['sAMAccountType'])
         if len(res) == 1 and 'sAMAccountType' in res[0].keys():
             sAMAccountType = int(str(res[0]['sAMAccountType']))
             if sAMAccountType == SAM_USER_OBJECT:
                 return True
         return False
 
-    def is_user_enabled(self, cn, container):
+    def is_user_enabled(self, dn):
         DISABLED = 0x0002
-        res = self.search(container, SCOPE_ONELEVEL, '(cn=%s)' % cn, 
['userAccountControl'])
+        res = self.search(dn, SCOPE_BASE, None, ['userAccountControl'])
         if len(res) == 1 and 'userAccountControl' in res[0].keys():
             userAccountControl = int(str(res[0]['userAccountControl']))
             if not bool(userAccountControl & DISABLED):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-aduc-2.0/src/include/aduc/dialogs.py 
new/yast2-aduc-2.1/src/include/aduc/dialogs.py
--- old/yast2-aduc-2.0/src/include/aduc/dialogs.py      2019-10-30 
14:46:28.000000000 +0100
+++ new/yast2-aduc-2.1/src/include/aduc/dialogs.py      2020-05-04 
20:05:03.000000000 +0200
@@ -160,7 +160,8 @@
         attr = UI.QueryWidget('attrs', 'Value')
         val = conn.display_schema_value(attr, model.get_value(attr, False))
         new_val = AttrEdit(conn, attr, val).Show()
-        model.set_value(attr, new_val)
+        if new_val:
+            model.set_value(attr, new_val)
 
 CommonTabContents = {
         'editor' : {
@@ -1191,9 +1192,8 @@
 
     def __delete_selected_obj(self, container):
         currentItemName = UI.QueryWidget('items', 'CurrentItem')
-        searchList = self.conn.objects_list(container)
-        currentItem = self.__find_by_name(searchList, currentItemName)
-        if self.__warn_message('Delete', 'Are you sure you want to delete 
\'%s\'?' % currentItem[-1]['name'][-1].decode()):
+        currentItem = self.conn.obj(currentItemName, ['cn', 'name'])
+        if currentItem and self.__warn_message('Delete', 'Are you sure you 
want to delete \'%s\'?' % currentItem[-1]['name'][-1].decode()):
             self.conn.ldap_delete(currentItem[0])
             return currentItem[0].lower().startswith('ou=')
 
@@ -1201,8 +1201,7 @@
         searchList = []
         currentItemName = None
         currentItemName = UI.QueryWidget('items', 'CurrentItem')
-        searchList = self.conn.objects_list(container)
-        currentItem = self.__find_by_name(searchList, currentItemName)
+        currentItem = self.conn.obj(currentItemName)
         if currentItem is None:
             return
         if six.b('computer') in currentItem[1]['objectClass']:
@@ -1312,8 +1311,8 @@
                 enabled = True
                 obj = UI.QueryWidget('items', 'CurrentItem')
                 if obj:
-                    user = self.conn.is_user(obj, current_container)
-                    enabled = self.conn.is_user_enabled(obj, current_container)
+                    user = self.conn.is_user(obj)
+                    enabled = self.conn.is_user_enabled(obj)
                 self.__setup_menus(obj=True, user=user, enabled=enabled)
                 if event['EventReason'] == 'ContextMenuActivated':
                     if obj is None:
@@ -1334,18 +1333,18 @@
             elif str(ret) == 'context_add_contact':
                 contact = NewObjDialog(self.lp, 'contact', 
current_container).Show()
                 if contact:
-                    self.conn.add_contact(contact, current_container)
-                    self.__refresh(current_container, contact['cn'])
+                    dn = self.conn.add_contact(contact, current_container)
+                    self.__refresh(current_container, dn)
             elif str(ret) == 'context_add_user':
                 user = NewObjDialog(self.lp, 'user', current_container).Show()
                 if user:
-                    self.conn.add_user(user, current_container)
-                    self.__refresh(current_container, user['cn'])
+                    dn = self.conn.add_user(user, current_container)
+                    self.__refresh(current_container, dn)
             elif str(ret) == 'context_add_inetorgperson':
                 user = NewObjDialog(self.lp, 'InetOrgPerson', 
current_container).Show()
                 if user:
-                    self.conn.add_user(user, current_container, 
inetorgperson=True)
-                    self.__refresh(current_container, user['cn'])
+                    dn = self.conn.add_user(user, current_container, 
inetorgperson=True)
+                    self.__refresh(current_container, dn)
             elif str(ret) == 'context_add_printer':
                 obj = NewObjDialog(self.lp, 'printQueue', current_container, 
attrs=[('cn', 'Unicode String', 'Common-Name'), ('versionNumber', 'Integer', 
'Version-Number'), ('uNCName', 'Unicode String', 'UNC-Name'), 
('shortServerName', 'Unicode String', 'Short-Server-Name'), ('serverName', 
'Unicode String', 'Server-Name'), ('printerName', 'Unicode String', 
'Printer-Name')]).Show()
                 if obj:
@@ -1370,13 +1369,13 @@
             elif str(ret) == 'context_add_group':
                 group = NewObjDialog(self.lp, 'group', 
current_container).Show()
                 if group:
-                    self.conn.add_group(group, current_container)
-                    self.__refresh(current_container, group['name'])
+                    dn = self.conn.add_group(group, current_container)
+                    self.__refresh(current_container, dn)
             elif str(ret) == 'context_add_computer':
                 computer = NewObjDialog(self.lp, 'computer', 
current_container).Show()
                 if computer:
-                    self.conn.add_computer(computer, current_container)
-                    self.__refresh(current_container, computer['name'])
+                    dn = self.conn.add_computer(computer, current_container)
+                    self.__refresh(current_container, dn)
             elif str(ret) == 'context_move':
                 location = MoveDialog(self.conn).Show()
                 if location:
@@ -1387,10 +1386,8 @@
                             'accounts within the OU.\n' +
                             'Are you sure you want to move this object?')
                     if resp:
-                        currentItemName = UI.QueryWidget('items', 
'CurrentItem')
-                        searchList = self.conn.objects_list(current_container)
-                        currentItem = self.__find_by_name(searchList, 
currentItemName)
-                        dn = currentItem[0]
+                        dn = UI.QueryWidget('items', 'CurrentItem')
+                        currentItem = self.conn.obj(dn, ['cn', 'ou'])
                         newrdn = None
                         if 'cn' in currentItem[-1]:
                             newrdn = 'CN=%s' % 
currentItem[-1]['cn'][-1].decode()
@@ -1412,8 +1409,7 @@
                     Wizard.SetContents('Active Directory Users and Computers', 
self.__aduc_page(), '', False, False)
             elif str(ret) == 'enable':
                 obj = UI.QueryWidget('items', 'CurrentItem')
-                searchList = self.conn.objects_list(current_container)
-                currentItem = self.__find_by_name(searchList, obj)
+                currentItem = self.conn.obj(obj, ['cn', 'name', 
'sAMAccountName'])
                 if currentItem:
                     try:
                         self.conn.enable_account('(sAMAccountName=%s)' % 
currentItem[-1]['sAMAccountName'][-1].decode())
@@ -1423,8 +1419,7 @@
                         MessageBox('Object %s has been enabled.' % obj).Show()
             elif str(ret) == 'disable':
                 obj = UI.QueryWidget('items', 'CurrentItem')
-                searchList = self.conn.objects_list(current_container)
-                currentItem = self.__find_by_name(searchList, obj)
+                currentItem = self.conn.obj(obj, ['cn', 'name', 
'sAMAccountName'])
                 if currentItem:
                     try:
                         self.conn.disable_account('(sAMAccountName=%s)' % 
currentItem[-1]['sAMAccountName'][-1].decode())
@@ -1434,14 +1429,14 @@
                         MessageBox('Object %s has been disabled.' % obj).Show()
             elif str(ret) == 'reset':
                 obj = UI.QueryWidget('items', 'CurrentItem')
-                searchList = self.conn.objects_list(current_container)
-                currentItem = self.__find_by_name(searchList, obj)
+                currentItem = self.conn.obj(obj, ['cn', 'name', 
'sAMAccountName'])
                 if currentItem:
                     password, pwdLastSet, unlock = self.__reset_password()
                     if password:
                         sam = currentItem[-1]['sAMAccountName'][-1].decode()
+                        name = currentItem[-1]['cn'][-1].decode() if 'cn' in 
currentItem[-1] else currentItem[-1]['name'][-1].decode()
                         if self.conn.reset_password(currentItem[0], sam, 
password, pwdLastSet, unlock):
-                            MessageBox('The password for %s has been changed.' 
% obj).Show()
+                            MessageBox('The password for %s has been changed.' 
% name).Show()
             UI.SetApplicationTitle('Active Directory Users and Computers')
         return Symbol(ret)
 
@@ -1519,7 +1514,7 @@
         return None 
 
     def __objects_tab(self, container):
-        items = [Item(obj[1]['cn'][-1] if 'cn' in obj[1] else 
obj[1]['name'][-1], obj[1]['objectClass'][-1].title(), 
obj[1]['description'][-1] if 'description' in obj[1] else '') for obj in 
self.conn.objects_list(container)]
+        items = [Item(Id(obj[0]), obj[1]['cn'][-1] if 'cn' in obj[1] else 
obj[1]['name'][-1], obj[1]['objectClass'][-1].title(), 
obj[1]['description'][-1] if 'description' in obj[1] else '') for obj in 
self.conn.objects_list(container, ['cn', 'name', 'objectClass', 'description'])]
         return Table(Id('items'), Opt('notify', 'immediate', 
'notifyContextMenu'), Header('Name', 'Type', 'Description'), items)
 
     def __sub_tree(self, dn):


Reply via email to