Patch-ID# 100524-06
Keywords: Classing Engine
Synopsis: OpenWindows 3.0: Classing Engine (libce) Patch
Date: Oct/05/92

Solaris Release: 1.0 1.0.1 1.1 1.1.1A 1.1.2
 
SunOS Release: 4.1.1 4.1.2 4.1.3 4.1.3_U1A 4.1.4
 
Unbundled Product: OpenWindows

Unbundled Release: 3.0

Topic: OW 3.0 Classing Engine Library Patch

BugId's fixed with this patch: 1077657 1077787 1091437 1086418 1081836

Changes incorporated in this version: 1086418 1081836

Architectures for which this patch is available: sparc

Patches which may conflict with this patch: 

Obsoleted by:

Files included with this patch:
$OPENWINHOME/bin/ce_db_build
$OPENWINHOME/bin/ce_db_merge
$OPENWINHOME/lib/libce.a
$OPENWINHOME/lib/libce.so.0.0
$OPENWINHOME/lib/cetables/cetables
$OPENWINHOME/lib/cetables/fns_mgr.so
$OPENWINHOME/lib/cetables/tns_mgr.so

NOTE: preceded by ucb 4.1.1 /bin/sum :

41675    48 $OPENWINHOME/bin/ce_db_build
56584    48 $OPENWINHOME/bin/ce_db_merge
26499    41 $OPENWINHOME/lib/libce.a
40786    48 $OPENWINHOME/lib/libce.so.0.0
35710   143 $OPENWINHOME/lib/cetables/cetables
56377	 24 $OPENWINHOME/lib/cetables/fns_mgr.so
24646	 24 $OPENWINHOME/lib/cetables/tns_mgr.so

This patch is required for the proper operation of the latest patch 100493
for Binder.

This patch needs to be installed in conjunction with the File manager
3.0 patch, 100462-11

Problem Description:

This jumbo patch fixes the following new bugids :

BUGID   DESCRIPTION
1081836 filemanager always opens files, even if they are in identify "by name" mode
1086418 provide a method of running filemgr without using the classing engine.

	The .desksetdefaults file has a new resource such that
	filemgr does not stage-in files, but still does file-name
	extension matching.

	Filemgr Resource: classingEngineBufferSize

	Denotes how many bytes are read from each file, and passes
	onto the Classing Engine to try to determine the file type.
	(Note: this resource when set to 0, will still do filename
	extension matching)
        
It additionally fixes the following bug ids fixed in the prior patch release :

BUGID   DESCRIPTION
1077657	Multiple free()'s in CE database write code
1077787 ce_db_build with option -from_ascii does not work
1091437 ascii database file yields syntax error if strings contain ".>"


Installation Instructions:
 
The following instructions show how to install the patched libce
software. PLEASE READ ALL OF THE INSTRUCTIONS BEFORE PROCEEDING.

We have also included some information showing how to check
the integrity of classing engine database files and telling what to
do if the files are shown to have been corrupted. This material is
included because at least one libce bug (1077657) is known to corrupt
the classing engine database under certain circumstances. The fix for
this bug is included in this patch; if the database files have
previously been corrupted, however, they must be restored to a normal
state before the classing engine can successfully be used.

The installation of libce is most easily executed as root. We suggest that
you retain a copy of the libce you have been using, renaming it in a 
way that reflects its patch level. This is illustrated below.

    1. su to root

    2. get patch id from current libce.a by typing :

	strings $OPENWINHOME/lib/libce.a | grep 'Patch Id'

    3. if patch_id exists

	mv $OPENWINHOME/lib/libce.a $OPENWINHOME/libce.a-<patchid>
	mv $OPENWINHOME/lib/libce.so.0.0 $OPENWINHOME/libce.so.0.0-<patchid>
	mv $OPENWINHOME/lib/cetables/cetables $OPENWINHOME/cetables/cetables-<patchid> 
	mv $OPENWINHOME/lib/cetables/fns_mgr.so $OPENWINHOME/cetables/fns_mgr.so-<patchid>
	mv $OPENWINHOME/lib/cetables/tns_mgr.so $OPENWINHOME/cetables/tns_mgr.so-<patchid>
	mv $OPENWINHOME/bin/cd_db_build $OPENWINHOME/bin/ce_db_build-<patchid>
	mv $OPENWINHOME/bin/cd_db_merge $OPENWINHOME/bin/ce_db_merge-<patchid>

    else

	mv $OPENWINHOME/lib/libce.a $OPENWINHOME/libce.a-FCS
	mv $OPENWINHOME/lib/libce.so.0.0 $OPENWINHOME/libce.so.0.0-FCS
	mv $OPENWINHOME/lib/cetables/cetables $OPENWINHOME/cetables/cetables-FCS
	mv $OPENWINHOME/lib/cetables/fns_mgr.so $OPENWINHOME/cetables/fns_mgr.so-FCS
	mv $OPENWINHOME/lib/cetables/tns_mgr.so $OPENWINHOME/cetables/tns_mgr.so-FCS
	mv $OPENWINHOME/bin/ce_db_build $OPENWINHOME/bin/ce_db_build-FCS
	mv $OPENWINHOME/bin/ce_db_merge $OPENWINHOME/bin/ce_db_merge-FCS

    Please note : You may not have the $OPENWINHOME/lib/cetables/cetables in
		  the commands above.

    7. Move the new software into place. 

	cp $PATCHDIR/libce.a $OPENWINHOME/lib/libce.a
	cp $PATCHDIR/libce.so.0.0 $OPENWINHOME/lib/libce.so.0.0
	if $OPENWINHOME/lib/cetables does not exist then 

	    mkdir $OPENWINHOME/lib/cetables

	cp $PATCHDIR/fns_mgr.so  $OPENWINHOME/lib/cetables/fns_mgr.so
	cp $PATCHDIR/tns_mgr.so  $OPENWINHOME/lib/cetables/tns_mgr.so
	cp $PATCHDIR/ce_db_build $OPENWINHOME/bin/ce_db_build
	cp $PATCHDIR/ce_db_merge $OPENWINHOME/bin/ce_db_merge

    8. Set the permissions on the new files.

	chmod 644 $OPENWINHOME/lib/libce.a $OPENWINHOME/lib/libce.so.0.0
	chmod 755 $OPENWINHOME/bin/ce_db_build $OPENWINHOME/bin/ce_db_merge
	chmod 755 $OPENWINHOME/lib/cetables/fns_mgr.so $OPENWINHOME/lib/cetables/tns_mgr.so

   9. ranlib -t $OPENWINHOME/lib/libce.a



Checking the Classing Engine Databases:

As mentioned above, we recommend that you check the integrity of
the classing engine databases after installing the new libce files.
An easy and effective way to do this is to use the ce_db_build
program to build an Ascii version of the database files. The Ascii
files themselves are not needed; in the example below, we
specify temporary files in the /tmp area. If the files are built
with no error messages, however, you will know that the database
files have not been corrupted, and the installation is complete.

	ce_db_build user -to_ascii /tmp/user_ce.tmp
	ce_db_build system -to_ascii /tmp/system_ce.tmp
	ce_db_build network -to_ascii /tmp/network_ce.tmp


Normally, these three commands will execute with no messages at all.
If, instead, you receive an error message, you will need to correct
the classing engine database files before using the classing engine.


Correcting the Classing Engine Databases:

Only one database file is shipped with the software. That is the
network database, kept in $OPENWINHOME/lib/cetables. We have supplied
with this patch a copy of that file. To install it, become root, then:

	cp $PATCHDIR/cetables $OPENWINHOME/lib/cetables
	chmod 644 $OPENWINHOME/lib/cetables/cetables

The other two database files are the system database (kept in
/etc/cetables/cetables) and the user database (in ~/.cetables/cetables).
Since there is no standard version of these files, they must be either
(a) restored from backup or (b) recreated as empty files. One way
to recreate these files would be to enter, as root,

	cp /dev/null /etc/cetables/cetables
	cp /dev/null ~/.cetables/cetables
        chmod 644 /etc/cetables/cetables ~/.cetables/cetables 

These steps should suffice to correct database corruption problems.

For further information on classing engine databases, consult the
man pages on filemgr(1) or binder(1) and Chapter 4 of the Desktop
Integration Guide (part # 800-6323-10), or contact your Sun
representative.
