Skip to contentSkip to conversation

conga ./conga.spec.in.in luci/Makefile luci/si ...

Cluster-devel [email protected] 1 participant 1 message Dec 8, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: kupcevic at sourceware.org 2006-12-08 18:27:32

Modified files:

	.              : conga.spec.in.in 
	luci           : Makefile 
	luci/site      : Makefile 

luci/site/luci/Extensions: HelperFunctions.py StorageReport.py
ricci_communicator.py storage_adapters.py
luci/storage : form-macros
ricci/ricci : SSLInstance.cpp
Added files:
luci/conga_ssl : Makefile SSLClient.cpp SSLClient.h
conga_ssl_lib.cpp setup.py
luci/site/luci/Extensions: conga_ssl.py

Log message:
Improved bz201394: luci doesn't verify ricci's SSL cert against trusted list (part 1 - backend)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.8&r2=1.45.2.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.1&r2=1.20.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/conga_ssl/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/conga_ssl/SSLClient.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/conga_ssl/SSLClient.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/conga_ssl/conga_ssl_lib.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/conga_ssl/setup.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.11&r2=1.11.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_ssl.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/HelperFunctions.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.1&r2=1.4.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20.2.1&r2=1.20.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.9.2.6&r2=1.9.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/storage_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.1&r2=1.7.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.17.2.3&r2=1.17.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/SSLInstance.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.1&r2=1.5.2.2

conga.spec.in.in +5 -4
@@ -126,10 +126,11 @@
 				%{_sbindir}/luci_admin
 				%{_docdir}/luci-%{version}/
 %defattr(-,luci,luci)
+				%{_localstatedir}/lib/luci
+				%{_libdir}/luci/ssl
 %if "%{include_zope_and_plone}" == "yes"
-				%{_libdir}/luci/
+				%{_libdir}/luci/zope
 %endif
-				%{_localstatedir}/lib/luci
 
 %pre -n luci
 if ! /bin/grep luci\:x /etc/group 2>&1 >/dev/null; then
@@ -283,14 +284,14 @@
 
 %changelog
 
-* day month date 2006 Stanko Kupcevic <[email protected]> 0.8-26
+* Fri Dec 08 2006 Stanko Kupcevic <[email protected]> 0.8-26
 
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXX UPDATE NOT RELEASED YET XXXXXXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
 - luci storage: fix bytes->TB conversion
-
+- Improved bz201394: luci doesn't verify ricci's SSL cert against trusted list (part 1 - backend)
 
 
 * Thu Nov 16 2006 Stanko Kupcevic <[email protected]> 0.8-25
luci/Makefile +2 -0
@@ -18,6 +18,7 @@
 
 luci:
 	make -C site
+	make -C conga_ssl
 	make -C utils
 	make -C init.d
 	make -C sysconfig
@@ -46,6 +47,7 @@
 
 	install -d -m 700 ${DESTDIR}/var/lib/luci
 	make -C site install
+	make -C conga_ssl install
 	make -C utils install
 	make -C init.d install
 	make -C sysconfig install

/cvs/cluster/conga/luci/conga_ssl/Makefile,v --> standard output revision 1.1.2.1

- renamed from luci/conga_ssl/Makefile +21 -0
@@ -0,0 +1,21 @@
+
+include ../../make/version.in
+include ../make/defines.mk
+
+
+.PHONY: build
+
+build:
+	python setup.py build
+
+clean:
+	rm -rf build
+	rm -rf ricci
+
+install:
+	install -d ${libdir}/luci
+	install -d ${libdir}/luci/ssl
+	install -m 644 build/lib*/conga_ssl_lib.so ${libdir}/luci/ssl
+
+rebuild: clean build
+

/cvs/cluster/conga/luci/conga_ssl/SSLClient.cpp,v --> standard output revision 1.1.2.1

- renamed from luci/conga_ssl/SSLClient.cpp +552 -0

552 lines not on this page · raw message

/cvs/cluster/conga/luci/conga_ssl/SSLClient.h,v --> standard output revision 1.1.2.1

- renamed from luci/conga_ssl/SSLClient.h +80 -0

80 lines not on this page · raw message

/cvs/cluster/conga/luci/conga_ssl/conga_ssl_lib.cpp,v --> standard output revision 1.1.2.1

- renamed from luci/conga_ssl/conga_ssl_lib.cpp +374 -0

374 lines not on this page · raw message

/cvs/cluster/conga/luci/conga_ssl/setup.py,v --> standard output revision 1.1.2.1

- renamed from luci/conga_ssl/setup.py +37 -0
@@ -0,0 +1,37 @@
+
+from distutils.core import setup, Extension
+
+
+module1 = Extension('conga_ssl_lib',
+                    define_macros = [('MAJOR_VERSION', '0'),
+                                     ('MINOR_VERSION', '8')],
+                    include_dirs = ['../../ricci/include',
+                                    '/usr/include/libxml2'],
+                    libraries = ['ssl', 'xml2'],
+                    #library_dirs = ['/usr/local/lib'],
+                    sources = ['conga_ssl_lib.cpp', 
+                               'SSLClient.cpp', 
+                               '../../ricci/common/ClientSocket.cpp', 
+                               '../../ricci/common/Socket.cpp', 
+                               '../../ricci/common/Logger.cpp', 
+                               '../../ricci/common/Time.cpp', 
+                               '../../ricci/common/File.cpp', 
+                               '../../ricci/common/XML.cpp', 
+                               '../../ricci/common/utils.cpp', 
+                               '../../ricci/common/executils.cpp'])
+
+
+
+setup (name = 'conga_ssl_lib',
+       version = '0.8',
+       description = 'SSL Python bindings for Conga', 
+       author = 'Stanko Kupcevic', 
+       author_email = 'kupcevic at redhat.com',
+       copyright = 'Red Hat, Inc.',
+       license = 'GPL', 
+       url = 'http://www.sourceware.org/cluster/conga',
+       long_description = '''
+       conga_ssl_lib
+       ''',
+       ext_modules = [module1])
+
luci/site/Makefile +1 -0
@@ -82,6 +82,7 @@
 	install -d ${DESTDIR}/var/lib/luci/var/pts
 #	install -m 644 `find luci/var/pts -maxdepth 1 -type f | grep .mo | grep -v \~ | grep -v \#` ${DESTDIR}/var/lib/luci/var/pts
 	install -d ${DESTDIR}/var/lib/luci/var/certs
+	install -d ${DESTDIR}/var/lib/luci/var/certs/peers
 	install -m 644 luci/var/certs/cacert.config ${DESTDIR}/var/lib/luci/var/certs
 	install -d ${DESTDIR}/var/lib/luci/var/stunnel
 

/cvs/cluster/conga/luci/site/luci/Extensions/conga_ssl.py,v --> standard output revision 1.1.2.1

- renamed from luci/site/luci/Extensions/conga_ssl.py +48 -0

48 lines not on this page · raw message

luci/site/luci/Extensions/HelperFunctions.py +68 -5

110 lines not on this page · raw message

luci/site/luci/Extensions/StorageReport.py +2 -15
@@ -1878,17 +1878,8 @@
 
 
 
-def group_systems_by_cluster(self, allowed_systems, cache_it=False):
-    CACHED_INDEX = '_group_systems_by_cluster_cached_result_'
-    session = self.REQUEST.SESSION
-    if session.has_key(CACHED_INDEX):
-        res = session[CACHED_INDEX]
-        if res != None:
-            session.set(CACHED_INDEX, None)
-            return res
-        pass
-    
-    ss = get_systems_statuses(self, allowed_systems)
+def group_systems_by_cluster(self, allowed_systems, from_cache=False):
+    ss = get_systems_statuses(self, allowed_systems, from_cache)
     clusters = {}
     bad_list = []
     for s in ss:
@@ -1912,10 +1903,6 @@
     
     ret = [nonclu_list, clu_list, bad_list]
     
-    if cache_it:
-        session.set(CACHED_INDEX, ret)
-        pass
-    
     return ret
 
 
luci/site/luci/Extensions/ricci_communicator.py +38 -57

182 lines not on this page · raw message

luci/site/luci/Extensions/storage_adapters.py +2 -2
@@ -61,7 +61,7 @@
     #display_clusters = True
     display_clusters = False
     if display_clusters:
-      sorted_data = self.group_systems_by_cluster(systems, cache_it=True)
+      sorted_data = self.group_systems_by_cluster(systems, from_cache=False)
       for sdl in sorted_data[:2]:
         for data in sdl:
           createStorageChooser_inner(url,
@@ -70,7 +70,7 @@
                                      data,
                                      syslist)
     else:
-      sorted_data = get_systems_statuses(self, systems)
+      sorted_data = get_systems_statuses(self, systems, from_cache=False)
       for data in sorted_data:
         createStorageChooser_inner(url,
                                    pagetype,
luci/storage/form-macros +1 -1
@@ -293,7 +293,7 @@
     </form>
    </fieldset> 
    
-   <dl tal:define="tmp_triple   python:here.group_systems_by_cluster(allowed_systems);
+   <dl tal:define="tmp_triple   python:here.group_systems_by_cluster(allowed_systems, from_cache=True);
                    nonclu_list  python:tmp_triple[0];
                    clu_list     python:tmp_triple[1];
                    bad_list     python:tmp_triple[2]">
ricci/ricci/SSLInstance.cpp +9 -3
@@ -137,6 +137,11 @@
   else
     ssl_locks[n]->unlock();
 }
+static pthread_t
+ssl_id_callback(void)
+{
+  return pthread_self();
+}
 
 
 
@@ -157,12 +162,12 @@
       // TODO: random number generator,
       // not on systems with /dev/urandom (eg. Linux)
       
-      // set up lockings
+      // thread support
       ssl_locks.clear();
-      for (int i=0; i<CRYPTO_num_locks(); i++)
+      for (int i=0; i<CRYPTO_num_locks()+1; i++)
 	ssl_locks.push_back(counting_auto_ptr<Mutex>(new Mutex()));
       CRYPTO_set_locking_callback(ssl_mutex_callback);
-      //CRYPTO_set_id_callback(ssl_id_function); not needed on Linux
+      CRYPTO_set_id_callback(ssl_id_callback);
       
       // create context
       if (!ctx)
@@ -354,6 +359,7 @@
   
   // cert present among saved certs?
   client_has_cert();  // make sure cert is saved in _cert_pem
+  MutexLocker l(global_lock);
   for (list<file_cert>::const_iterator iter = authorized_certs.begin();
        iter != authorized_certs.end();
        iter++)