debian/canfestival-virtual.postinst
author fbeaulier
Mon, 29 Aug 2011 17:44:49 +0200
changeset 666 9febdd6fdc71
parent 579 3126da40d469
permissions -rwxr-xr-x
patch from Stefan Kratochwil <entwicklung@inovel.de> : canfestival-3-fm3_698.patch
Bug:
If an object dictionary entry was requested whose size exceeds
SDO_MAX_LENGTH_TRANSFERT, the memcpy() call at line 139 of objacces.c overwrites
the memory after *pDestData which causes stack corruption.
-> Bugfix:
The bug was corrected by size checking the requested data. An 'Out of
memory' error message will be generated if the requested data exceeds
SDO_MAX_LENGTH_TRANSFERT.

Additional changes:
Added dynamic buffer allocation for the SDO transfer. This feature can be used
if SDO_DYNAMIC_BUFFER_ALLOCATION is defined in config.h. The size of the
dynamically allocated buffer is controlled with
SDO_DYNAMIC_BUFFER_ALLOCATION_SIZE.
-> Note:
This change removes the detection of OD_LENGTH_DATA_INVALID errors!
531
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     1
#!/bin/sh
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     2
# postinst script for canfestival
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     3
#
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     4
# see: dh_installdeb(1)
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     5
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     6
set -e
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     7
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     8
DLL_LIST=
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
     9
CF_CONFIG=/usr/share/CanFestival-3/objdictgen/canfestival_config.py
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    10
CF_CONFIG_TEMP=/usr/share/CanFestival-3/objdictgen/canfestival_config_ori.py
579
3126da40d469 Fixed : postrm bug when upgrade package
greg
parents: 533
diff changeset
    11
531
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    12
case "$1" in
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    13
    configure)
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    14
    ldconfig
579
3126da40d469 Fixed : postrm bug when upgrade package
greg
parents: 533
diff changeset
    15
    
3126da40d469 Fixed : postrm bug when upgrade package
greg
parents: 533
diff changeset
    16
	# Find canfestival driver library in /usr/lib
3126da40d469 Fixed : postrm bug when upgrade package
greg
parents: 533
diff changeset
    17
	cd /usr/lib
531
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    18
	for file in libcanfestival_can*
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    19
	do
533
4d50417dab22 updated : debian package scripts
greg
parents: 531
diff changeset
    20
		DLL_LIST="'$file',""$DLL_LIST"
531
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    21
	done
579
3126da40d469 Fixed : postrm bug when upgrade package
greg
parents: 533
diff changeset
    22
	
3126da40d469 Fixed : postrm bug when upgrade package
greg
parents: 533
diff changeset
    23
	# copy template config and add the DLL_LIST 
3126da40d469 Fixed : postrm bug when upgrade package
greg
parents: 533
diff changeset
    24
	# do this to display available canfestival plugin list choice in beremiz
531
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    25
	cat $CF_CONFIG_TEMP > $CF_CONFIG
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    26
	echo "DLL_LIST=[$DLL_LIST]" >> $CF_CONFIG
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    27
	;;
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    28
	
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    29
    abort-upgrade|abort-remove|abort-deconfigure)
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    30
    ;;
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    31
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    32
    *)
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    33
        echo "postinst called with unknown argument \`$1'" >&2
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    34
        exit 1
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    35
    ;;
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    36
esac
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    37
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    38
# dh_installdeb will replace this with shell code automatically
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    39
# generated by other debhelper scripts.
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    40
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    41
#DEBHELPER#
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    42
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    43
exit 0
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    44
f912f8d26e98 updated : debian package scripts
greg
parents:
diff changeset
    45