From: <av...@us...> - 2010-12-22 15:00:48
|
Revision: 7222 http://openhpi.svn.sourceforge.net/openhpi/?rev=7222&view=rev Author: avpak Date: 2010-12-22 15:00:41 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Feature request #3141721 Fix for #3141723 Modified Paths: -------------- openhpi/trunk/clients/ohparam.c openhpi/trunk/include/oHpi.h openhpi/trunk/marshal/marshal_hpi_types.c openhpi/trunk/openhpid/conf.c Modified: openhpi/trunk/clients/ohparam.c =================================================================== --- openhpi/trunk/clients/ohparam.c 2010-12-22 14:00:06 UTC (rev 7221) +++ openhpi/trunk/clients/ohparam.c 2010-12-22 15:00:41 UTC (rev 7222) @@ -58,7 +58,7 @@ SaErrorT rv = SA_OK; oHpiGlobalParamTypeT paramtype = OHPI_CONF; - char setparam[OH_MAX_TEXT_BUFFER_LENGTH]; + char setparam[OH_PATH_PARAM_MAX_LENGTH]; SaHpiBoolT printusage = FALSE; int i=1; Modified: openhpi/trunk/include/oHpi.h =================================================================== --- openhpi/trunk/include/oHpi.h 2010-12-22 14:00:06 UTC (rev 7221) +++ openhpi/trunk/include/oHpi.h 2010-12-22 15:00:41 UTC (rev 7222) @@ -24,7 +24,6 @@ #include <SaHpi.h> #include <glib.h> -#include <oh_utils.h> #define OH_DEFAULT_DOMAIN_ID 0 @@ -34,6 +33,8 @@ #define OH_SAHPI_INTERFACE_VERSION_MIN_SUPPORTED (SaHpiVersionT)0x020101 /* B.01.01 */ #define OH_SAHPI_INTERFACE_VERSION_MAX_SUPPORTED SAHPI_INTERFACE_VERSION +#define OH_PATH_PARAM_MAX_LENGTH 2048 + #ifdef __cplusplus extern "C" { #endif @@ -85,9 +86,9 @@ //unsigned char Debug; /* 1 = YES, 0 = NO */ //unsigned char DebugTrace; /* !0 = YES, 0 = NO */ //unsigned char DebugLock; /* !0 = YES, 0 = NO */ - char Path[OH_MAX_TEXT_BUFFER_LENGTH]; /* Dir path to openhpi plugins */ - char VarPath[OH_MAX_TEXT_BUFFER_LENGTH]; /* Dir path for openhpi data */ - char Conf[OH_MAX_TEXT_BUFFER_LENGTH]; /* File path of openhpi configuration */ + char Path[OH_PATH_PARAM_MAX_LENGTH]; /* Dir path to openhpi plugins */ + char VarPath[OH_PATH_PARAM_MAX_LENGTH]; /* Dir path for openhpi data */ + char Conf[OH_PATH_PARAM_MAX_LENGTH]; /* File path of openhpi configuration */ } oHpiGlobalParamUnionT; typedef struct { Modified: openhpi/trunk/marshal/marshal_hpi_types.c =================================================================== --- openhpi/trunk/marshal/marshal_hpi_types.c 2010-12-22 14:00:06 UTC (rev 7221) +++ openhpi/trunk/marshal/marshal_hpi_types.c 2010-12-22 15:00:41 UTC (rev 7222) @@ -1114,9 +1114,9 @@ // global param -static cMarshalType GlobalParamPathArray = dArray( OH_MAX_TEXT_BUFFER_LENGTH, SaHpiUint8T, SaHpiUint8Type ); -static cMarshalType GlobalParamVarPathArray = dArray( OH_MAX_TEXT_BUFFER_LENGTH, SaHpiUint8T, SaHpiUint8Type ); -static cMarshalType GlobalParamConfArray = dArray( SAHPI_MAX_TEXT_BUFFER_LENGTH, SaHpiUint8T, SaHpiUint8Type ); +static cMarshalType GlobalParamPathArray = dArray( OH_PATH_PARAM_MAX_LENGTH, SaHpiUint8T, SaHpiUint8Type ); +static cMarshalType GlobalParamVarPathArray = dArray( OH_PATH_PARAM_MAX_LENGTH, SaHpiUint8T, SaHpiUint8Type ); +static cMarshalType GlobalParamConfArray = dArray( OH_PATH_PARAM_MAX_LENGTH, SaHpiUint8T, SaHpiUint8Type ); static cMarshalType oHpiGlobalParamUnionTypeElements[] = { Modified: openhpi/trunk/openhpid/conf.c =================================================================== --- openhpi/trunk/openhpid/conf.c 2010-12-22 14:00:06 UTC (rev 7221) +++ openhpi/trunk/openhpid/conf.c 2010-12-22 15:00:41 UTC (rev 7222) @@ -59,10 +59,10 @@ SaHpiUint32T dat_size_limit; SaHpiUint32T dat_user_limit; SaHpiBoolT dat_save; - char path[OH_MAX_TEXT_BUFFER_LENGTH]; - char varpath[OH_MAX_TEXT_BUFFER_LENGTH]; - char conf[OH_MAX_TEXT_BUFFER_LENGTH]; - char client_conf[OH_MAX_TEXT_BUFFER_LENGTH]; + char path[OH_PATH_PARAM_MAX_LENGTH]; + char varpath[OH_PATH_PARAM_MAX_LENGTH]; + char conf[OH_PATH_PARAM_MAX_LENGTH]; + char client_conf[OH_PATH_PARAM_MAX_LENGTH]; SaHpiBoolT unconfigured; unsigned char read_env; GStaticRecMutex lock; @@ -197,23 +197,23 @@ } } else if (!strcmp("OPENHPI_PATH", name)) { g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.path, 0, OH_MAX_TEXT_BUFFER_LENGTH); - strncpy(global_params.path, value, OH_MAX_TEXT_BUFFER_LENGTH-1); + memset(global_params.path, 0, OH_PATH_PARAM_MAX_LENGTH); + strncpy(global_params.path, value, OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); } else if (!strcmp("OPENHPI_VARPATH", name)) { g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.varpath, 0, OH_MAX_TEXT_BUFFER_LENGTH); - strncpy(global_params.varpath, value, OH_MAX_TEXT_BUFFER_LENGTH-1); + memset(global_params.varpath, 0, OH_PATH_PARAM_MAX_LENGTH); + strncpy(global_params.varpath, value, OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); } else if (!strcmp("OPENHPI_CONF", name)) { g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.conf, 0, OH_MAX_TEXT_BUFFER_LENGTH); - strncpy(global_params.conf, value, OH_MAX_TEXT_BUFFER_LENGTH-1); + memset(global_params.conf, 0, OH_PATH_PARAM_MAX_LENGTH); + strncpy(global_params.conf, value, OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); } else if (!strcmp("OPENHPICLIENT_CONF", name)) { g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.client_conf, 0, OH_MAX_TEXT_BUFFER_LENGTH); - strncpy(global_params.client_conf, value, OH_MAX_TEXT_BUFFER_LENGTH-1); + memset(global_params.client_conf, 0, OH_PATH_PARAM_MAX_LENGTH); + strncpy(global_params.client_conf, value, OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); } else if (!strcmp("OPENHPI_UNCONFIGURED", name)) { if (!strcmp("YES", value)) { @@ -655,28 +655,28 @@ g_static_rec_mutex_lock(&global_params.lock); strncpy(param->u.path, global_params.path, - OH_MAX_TEXT_BUFFER_LENGTH); + OH_PATH_PARAM_MAX_LENGTH); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_VARPATH: g_static_rec_mutex_lock(&global_params.lock); strncpy(param->u.varpath, global_params.varpath, - OH_MAX_TEXT_BUFFER_LENGTH); + OH_PATH_PARAM_MAX_LENGTH); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_CONF: g_static_rec_mutex_lock(&global_params.lock); strncpy(param->u.conf, global_params.conf, - OH_MAX_TEXT_BUFFER_LENGTH); + OH_PATH_PARAM_MAX_LENGTH); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPICLIENT_CONF: g_static_rec_mutex_lock(&global_params.lock); strncpy(param->u.conf, global_params.client_conf, - OH_MAX_TEXT_BUFFER_LENGTH); + OH_PATH_PARAM_MAX_LENGTH); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_UNCONFIGURED: @@ -734,34 +734,34 @@ break; case OPENHPI_PATH: g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.path, 0, OH_MAX_TEXT_BUFFER_LENGTH); + memset(global_params.path, 0, OH_PATH_PARAM_MAX_LENGTH); strncpy(global_params.path, param->u.path, - OH_MAX_TEXT_BUFFER_LENGTH-1); + OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_VARPATH: g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.varpath, 0, OH_MAX_TEXT_BUFFER_LENGTH); + memset(global_params.varpath, 0, OH_PATH_PARAM_MAX_LENGTH); strncpy(global_params.varpath, param->u.varpath, - OH_MAX_TEXT_BUFFER_LENGTH-1); + OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_CONF: g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.conf, 0, OH_MAX_TEXT_BUFFER_LENGTH); + memset(global_params.conf, 0, OH_PATH_PARAM_MAX_LENGTH); strncpy(global_params.conf, param->u.conf, - OH_MAX_TEXT_BUFFER_LENGTH-1); + OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPICLIENT_CONF: g_static_rec_mutex_lock(&global_params.lock); - memset(global_params.conf, 0, OH_MAX_TEXT_BUFFER_LENGTH); + memset(global_params.conf, 0, OH_PATH_PARAM_MAX_LENGTH); strncpy(global_params.client_conf, param->u.conf, - OH_MAX_TEXT_BUFFER_LENGTH-1); + OH_PATH_PARAM_MAX_LENGTH-1); g_static_rec_mutex_unlock(&global_params.lock); break; case OPENHPI_UNCONFIGURED: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |