fix bug 190432; fix upstream bugs 4955 4956 4968 4978 4983 4984 4986 5017

This commit is contained in:
jvdias 2006-05-03 00:13:59 +00:00
parent 99ac9d7402
commit f22bcde7fa
10 changed files with 2433 additions and 9 deletions

View File

@ -1,6 +1,6 @@
--- pegasus/rpm/tog-pegasus.rc.initscript 2006-01-30 11:16:24.000000000 -0500
+++ pegasus/rpm/tog-pegasus.rc 2006-04-11 13:57:31.000000000 -0400
@@ -1,80 +1,85 @@
+++ pegasus/rpm/tog-pegasus.rc 2006-05-02 18:44:18.000000000 -0400
@@ -1,80 +1,84 @@
-#//%2006////////////////////////////////////////////////////////////////////////
-#//
-#// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
@ -113,8 +113,7 @@
- [ "$RETVAL" -eq 0 ] && log_success_msg $"$prog stop" || log_failure_msg $"$prog stop"
+ if [ "$RETVAL" -eq 0 ]; then
+ rm -f $LOCKFILE;
+ rm -f /var/run/tog-pegasus/socket/*;
+ rm -f /var/run/tog-pegasus/cimserver.pid;
+ rm -f /var/run/tog-pegasus/*;
+ success;
+ else
+ failure;
@ -140,7 +139,7 @@
condrestart)
pid=`pidofproc $CIMSERVER_BIN`
RETVAL=$?
@@ -83,13 +88,18 @@
@@ -83,13 +87,18 @@
RETVAL=$?;
fi;
;;

605
pegasus-2.5.1-obz4955.patch Normal file
View File

@ -0,0 +1,605 @@
--- pegasus/src/Providers/ManagedSystem/OperatingSystem/OperatingSystem_Linux.cpp.obz4955 2006-01-30 11:18:48.000000000 -0500
+++ pegasus/src/Providers/ManagedSystem/OperatingSystem/OperatingSystem_Linux.cpp 2006-05-02 14:43:14.000000000 -0400
@@ -96,59 +96,75 @@
/**
- getName method of the Linux implementation for the OS Provider
-
- Calls uname() to get the operating system name.
+ getVendorInfo method for Linux implementation of OS Provider
+ Gets the system text from vendor's release file
*/
-Boolean OperatingSystem::getName(String& osName)
+static void getVendorInfo(
+ String& releaseText,
+ String& nameText )
{
- String s, buffer_s;
- Uint32 buffer_index; // rexex match index
+ static const Uint32 MAX_RELEASE_STRING_LEN=128;
char info_file[MAXPATHLEN];
- char buffer[MAXPATHLEN];
+ char buffer[MAX_RELEASE_STRING_LEN];
struct stat statBuf;
- FILE *vf;
- s.clear();
+
for (int ii = 0; LINUX_VENDOR_INFO[ii].vendor_name != NULL ; ii++)
{
- memset(info_file, 0, MAXPATHLEN);
- strcat(info_file, "/etc/");
- strcat(info_file, LINUX_VENDOR_INFO[ii].determining_filename);
-
+ sprintf(info_file, "/etc/%s",
+ LINUX_VENDOR_INFO[ii].determining_filename );
// If the file exists in /etc, we know what distro we're in
if (!stat(info_file, &statBuf))
{
- s.assign(LINUX_VENDOR_INFO[ii].vendor_name);
- s.append(" Distribution");
+ // Set the default OS name
+ nameText.assign(LINUX_VENDOR_INFO[ii].vendor_name);
+ nameText.append(" Distribution");
if (LINUX_VENDOR_INFO[ii].optional_string == NULL)
{
- // try to set s to a more descript value from the etc file
- vf = fopen(info_file, "r");
+ // try to set text to a more descriptive value from the etc file
+ FILE *vf = fopen(info_file, "r");
if (vf)
{
- if (fgets(buffer, MAXPATHLEN, vf) != NULL)
- {
- buffer_s.assign(buffer);
-
- // parse the text to extract Distribution Name
- buffer_index = buffer_s.find(" release");
- if ( buffer_index != PEG_NOT_FOUND )
- {
- // then we have found a valid index into the config file
- s.assign(buffer_s.subString(0,buffer_index));
- }
+ if (fgets(buffer, MAX_RELEASE_STRING_LEN, vf) != NULL)
+ {
+ String buffer_s = buffer;
+
+ // parse the text to extract first line
+ Uint32 buffer_index = buffer_s.find( '\n' );
+ if ( buffer_index != PEG_NOT_FOUND )
+ {
+ // We have found a valid index into the
+ // release string. Now get just the OS name.
+ releaseText = buffer_s.subString(0,buffer_index);
+ buffer_index = releaseText.find( " release" );
+ if ( buffer_index != PEG_NOT_FOUND )
+ {
+ nameText.assign( releaseText.subString(0,buffer_index) );
+ }
+ }
}
fclose(vf);
}
}
+ break;
}
}
- osName.assign(s);
- return true;
+}
+
+/**
+ getName method of the Linux implementation for the OS Provider
+
+ Calls getVendorInfo() to get the operating system name.
+ */
+Boolean OperatingSystem::getName(String& osName)
+{
+ String releaseText;
+ getVendorInfo( releaseText, osName );
+
+ return true;
}
/**
@@ -204,23 +220,24 @@
/**
getCaption method for Linux implementation of OS Provider
- Uses a string constant for the Caption.
+ Gets the text from the system's release file.
*/
Boolean OperatingSystem::getCaption(String& caption)
{
-
- caption.assign("The current Operating System");
-
+ String osName;
+ getVendorInfo( caption, osName );
return true;
}
+/**
+ getDescription method for Linux implementation of OS Provider
+
+ Gets the text from the system's release file.
+ */
Boolean OperatingSystem::getDescription(String& description)
{
-
- description.assign("This instance reflects the Operating System"
- " on which the CIMOM is executing (as distinguished from instances"
- " of other installed operating systems that could be run).");
-
+ String osName;
+ getVendorInfo( description, osName );
return true;
}
--- pegasus/src/Providers/ManagedSystem/OperatingSystem/tests/OSTestClient/OSTestClient.cpp.obz4955 2006-01-30 11:18:49.000000000 -0500
+++ pegasus/src/Providers/ManagedSystem/OperatingSystem/tests/OSTestClient/OSTestClient.cpp 2006-05-02 14:45:05.000000000 -0400
@@ -61,6 +61,8 @@
# include "OSTestClient_VMS.cpp"
#elif defined (PEGASUS_OS_SOLARIS)
# include "OSTestClient_Solaris.cpp"
+#elif defined (PEGASUS_OS_LINUX)
+# include "OSTestClient_Linux.cpp"
# else
# include "OSTestClient_Stub.cpp"
#endif
--- pegasus/src/Providers/ManagedSystem/OperatingSystem/tests/OSTestClient/OSTestClient_Linux.cpp.obz4955 2006-05-02 14:46:08.000000000 -0400
+++ pegasus/src/Providers/ManagedSystem/OperatingSystem/tests/OSTestClient/OSTestClient_Linux.cpp 2006-05-02 14:38:31.000000000 -0400
@@ -0,0 +1,449 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+
+// This file has the OS-specific routines that will be called to get
+// a validation of the CIM information vs. the current test system
+
+#include "OSTestClient.h"
+
+PEGASUS_USING_PEGASUS;
+PEGASUS_USING_STD;
+
+
+static const struct
+{
+ const char *vendor_name;
+ const char *determining_filename;
+ const char *optional_string;
+} LINUX_VENDOR_INFO[] = {
+ { "Caldera", "coas", "Caldera Linux" },
+ { "Corel", "environment.corel", "Corel Linux" },
+ { "Debian GNU/Linux", "debian_version", NULL },
+ { "Mandrake", "mandrake-release", NULL },
+ { "Red Hat", "redhat-release", NULL },
+ { "SuSE", "SuSE-release", NULL },
+ { "Turbolinux", "turbolinux-release", NULL },
+ { NULL, NULL, NULL }
+};
+
+
+/**
+ getVendorInfo method for Linux implementation of OS Provider
+
+ Gets the system text from vendor's release file
+ */
+static void getVendorInfo(
+ String& releaseText,
+ String& nameText )
+{
+ static const Uint32 MAX_RELEASE_STRING_LEN=128;
+ char info_file[MAXPATHLEN];
+ char buffer[MAX_RELEASE_STRING_LEN];
+ struct stat statBuf;
+
+
+ for (int ii = 0; LINUX_VENDOR_INFO[ii].vendor_name != NULL ; ii++)
+ {
+ sprintf(info_file, "/etc/%s",
+ LINUX_VENDOR_INFO[ii].determining_filename );
+
+ // If the file exists in /etc, we know what distro we're in
+ if (!stat(info_file, &statBuf))
+ {
+ // Set the default OS name
+ nameText.assign(LINUX_VENDOR_INFO[ii].vendor_name);
+ nameText.append(" Distribution");
+ if (LINUX_VENDOR_INFO[ii].optional_string == NULL)
+ {
+ // try to set text to a more descriptive value from the etc file
+ FILE *vf = fopen(info_file, "r");
+ if (vf)
+ {
+ if (fgets(buffer, MAX_RELEASE_STRING_LEN, vf) != NULL)
+ {
+ String buffer_s = buffer;
+
+ // parse the text to extract first line
+ Uint32 buffer_index = buffer_s.find( '\n' );
+ if ( buffer_index != PEG_NOT_FOUND )
+ {
+ // We have found a valid index into the
+ // release string. Now get just the OS name.
+ releaseText = buffer_s.subString(0,buffer_index);
+ buffer_index = releaseText.find( " release" );
+ if ( buffer_index != PEG_NOT_FOUND )
+ {
+ nameText.assign( releaseText.subString(0,buffer_index) );
+ }
+ }
+ }
+ fclose(vf);
+ }
+ }
+ break;
+ }
+ }
+}
+
+/**
+ goodCSCreationClassName method for the OS Provider Test Client
+
+ Checks the specified value against the expected value and
+ returns TRUE if valid, else FALSE.
+ */
+Boolean OSTestClient::goodCSCreationClassName(const String &cs_ccn,
+ Boolean verbose)
+{
+ // This assumes the only right answer is CIM_UnitaryComputerSystem
+ // replace with approprate check for the given OS/Provider
+
+ if (verbose)
+ cout<<"Checking " <<cs_ccn<< " against CIM_UnitaryComputerSystem"<<endl;
+ return (String::equalNoCase(cs_ccn, "CIM_UnitaryComputerSystem"));
+}
+
+/*
+ GoodCSName method for the OS Provider Test Client
+
+ Checks the specified value against the expected value and
+ returns TRUE if the same, else FALSE
+ */
+Boolean OSTestClient::goodCSName(const String &csname, Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking " <<csname<< " against hostname " <<endl;
+ cout<<"- No check written for CSName " <<endl;
+
+ // always returns success; replace with appropriate OS/Provider code
+ return true;
+}
+
+/*
+ GoodCreationClassName method for the OS Provider Test Client
+
+ Checks the specified value against the expected value and
+ returns TRUE if the same, else FALSE
+ */
+Boolean OSTestClient::goodCreationClassName(const String &ccn,
+ Boolean verbose)
+{
+ // This assumes the only right answer is CIM_OperatingSystem
+ // replace with approprate check for the given OS/Provider
+
+ if (verbose)
+ cout<<"Checking " << ccn << " against CIM_OperatingSystem"<<endl;
+
+ return (String::equalNoCase(ccn, "CIM_OperatingSystem"));
+}
+
+/*
+ GoodName method for the OS Provider Test Client
+
+ Checks the specified value against the expected value and
+ returns TRUE if the same, else FALSE
+ */
+Boolean OSTestClient::goodName(const String &name, Boolean verbose)
+{
+ String releaseText, osName;
+
+ if (verbose)
+ cout<<"Checking " << name << " against OS name "<<endl;
+ getVendorInfo( releaseText, osName );
+ return (String::equal( name, osName ));
+}
+/* GoodCaption method for the OS Provider Test Client
+
+ Checks the specified value against the expected value
+ and returns TRUE if the same, else FALSE
+ */
+Boolean OSTestClient::goodCaption(const String &cap,
+ Boolean verbose)
+{
+ String releaseText, osName;
+
+ // has check against standard caption
+ if (verbose)
+ cout<<"Checking Caption " << cap << endl;
+ getVendorInfo( releaseText, osName );
+ return (String::equal(cap, releaseText ) );
+}
+
+/*
+ GoodDescription method for the OS Provider Test Client
+
+ Checks the specified value against the expected value and
+ returns TRUE if the same, else FALSE
+ */
+Boolean OSTestClient::goodDescription(const String &desc,
+ Boolean verbose)
+{
+ String releaseText, osName;
+
+ // has check against standard description
+ if (verbose)
+ cout<<"Checking Description " << desc << endl;
+ getVendorInfo( releaseText, osName );
+ return (String::equal(desc, releaseText) );
+}
+
+/*
+ GoodInstallDate method for the OS Provider Test Client
+
+ Checks the specified value against the expected value and
+ returns TRUE if the same, else FALSE
+ */
+Boolean OSTestClient::goodInstallDate(const CIMDateTime &idate,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking InstallDate " << idate.toString() << endl;
+ cout<<"- No check written for InstallDate " << endl;
+ return true;
+}
+
+/*
+ GoodStatus method for the OS Provider Test Client
+
+ Checks the specified value against the expected value and
+ returns TRUE if the same, else FALSE
+ */
+Boolean OSTestClient::goodStatus(const String &stat,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking Status" << stat << endl;
+ cout<<"- No check written for Status " << endl;
+ return true;
+}
+
+/*
+ GoodOSType method for the OS Provider Test Client
+
+ Checks the specified value against the expected value and
+ returns TRUE if the same, else FALSE
+ */
+Boolean OSTestClient::goodOSType(const Uint16 &ostype,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking OSType " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodOtherTypeDescription(const String &otdesc,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking OtherTypeDescription " << otdesc << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodVersion(const String &version, Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking Version " << version << endl;
+ cout<<"- No check written for Version " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodLastBootUpTime(const CIMDateTime &btime,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking LastBootUpTime " << btime.toString() << endl;
+ cout<<"- No check written for LastBootUpTime " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodLocalDateTime(const CIMDateTime &ltime,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking LocalDateTime " << ltime.toString() << endl;
+ cout<<"- No check written for LocalDateTime " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodCurrentTimeZone(const Sint16 &tz, Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking CurrentTimeZone " << tz << endl;
+ cout<<"- No check written for CurrentTimeZone " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodNumberOfLicensedUsers(const Uint32 &nlusers,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking NumberOfLicensedUsers " << nlusers << endl;
+ cout<<"- No check written for NumberOfLicensedUsers " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodNumberOfUsers(const Uint32 &nusers,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking NumberOfUsers " << nusers << endl;
+ cout<<"- No check written for NumberOfUsers " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodNumberOfProcesses(const Uint32 &nprocs,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking NumberOfProcesses " << nprocs << endl;
+ cout<<"- No check written for NumberOfProcesses " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodMaxNumberOfProcesses(const Uint32 &maxprocs,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking MaxNumberOfProcs " << maxprocs << endl;
+ cout<<"- No check written for MaxNumberOfProcesses " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodTotalSwapSpaceSize(const Uint64 &totalswap,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking TotalSwapSpaceSize " << endl;
+ cout<<"- No check written for TotalSwapSpaceSize " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodTotalVirtualMemorySize(const Uint64 &totalvmem,
+ Boolean verbose)
+
+{
+ if (verbose)
+ cout<<"Checking TotalVirtualMemorySize " << endl;
+ cout<<"- No check written for TotalVirtualMemorySize" << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodFreeVirtualMemory(const Uint64 &freevmem,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking FreeVirtualMemory " << endl;
+ cout<<"- No check written for FreeVirtualMemory" << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodFreePhysicalMemory(const Uint64 &freepmem,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking FreePhysicalMemory " << endl;
+ cout<<"- No check written for FreePhysicalMemory" << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodTotalVisibleMemorySize(const Uint64 &totalvmem,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking TotalVisibleMemorySize " << endl;
+ cout<<"- No check written for TotalVisibleMemorySize" << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodSizeStoredInPagingFiles(const Uint64 &pgsize,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking SizeStoredInPagingFiles " << endl;
+ cout<<"- No check written for SizeStoredInPagingFiles" << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodFreeSpaceInPagingFiles(const Uint64 &freepg,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking FreeSpaceInPagingFiles " << endl;
+ cout<<"- No check written for FreeSpaceInPagingFiles" << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodMaxProcessMemorySize(const Uint64 &maxpmem,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking MaxProcessMemSize " << endl;
+ cout<<"- No check written for MaxProcessMemSize " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodDistributed(const Boolean &distr,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking Distributed " << endl;
+ cout<<"- No check written for Distributed " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodMaxProcessesPerUser(const Uint32 &umaxproc,
+ Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking MaxProcsPerUser " << umaxproc << endl;
+ cout<<"- No check written for MaxProcsPerUser " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodOSCapability(const String &cap, Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking OSCapability " << cap << endl;
+ cout<<"- No check written for OSCapability " << endl;
+ return true;
+}
+
+Boolean OSTestClient::goodSystemUpTime(const Uint64 &uptime, Boolean verbose)
+{
+ if (verbose)
+ cout<<"Checking SystemUpTime " << endl;
+ cout<<"- No check written for SystemUpTime " << endl;
+ return true;
+}
+

View File

@ -0,0 +1,92 @@
--- pegasus/src/Pegasus/Common/HTTPConnection.cpp.obz4956 2006-05-02 14:27:39.000000000 -0400
+++ pegasus/src/Pegasus/Common/HTTPConnection.cpp 2006-05-02 15:09:56.000000000 -0400
@@ -1036,10 +1036,20 @@
// reserve space for entire non-chunked message
if (_contentLength > 0)
{
- Uint32 capacity = (Uint32)(_contentLength + _contentOffset + 1);
- _incomingBuffer.reserveCapacity(capacity);
- data = (char *)_incomingBuffer.getData();
- data[capacity-1] = 0;
+ try
+ {
+ Uint32 capacity = (Uint32)(_contentLength + _contentOffset + 1);
+ _incomingBuffer.reserveCapacity(capacity);
+ data = (char *)_incomingBuffer.getData();
+ data[capacity-1] = 0;
+ }catch(const PEGASUS_STD(bad_alloc)&)
+ {
+ _throwEventFailure(HTTP_STATUS_REQUEST_TOO_LARGE,
+ "Error reserving space for non-chunked message");
+ }catch(...)
+ {
+ _throwEventFailure(httpStatusInternal, "unexpected exception");
+ }
}
break;
--- pegasus/src/Pegasus/Common/String.cpp.obz4956 2006-05-02 14:27:39.000000000 -0400
+++ pegasus/src/Pegasus/Common/String.cpp 2006-05-02 15:12:59.000000000 -0400
@@ -51,6 +51,10 @@
#include <unicode/uchar.h>
#endif
+#ifndef PEGASUS_CHECK_FOR_OVERFLOW
+#define PEGASUS_CHECK_FOR_OVERFLOW(capacity) { if (capacity > 0x3FFFFFFF) throw PEGASUS_STD(bad_alloc)(); }
+#endif
+
PEGASUS_NAMESPACE_BEGIN
//==============================================================================
@@ -166,8 +170,7 @@
{
#ifndef PEGASUS_STRING_NO_THROW
- if (x > 0x0FFFFFFF)
- throw PEGASUS_STD(bad_alloc)();
+ PEGASUS_CHECK_FOR_OVERFLOW(x);
#endif
@@ -545,9 +548,7 @@
{
#ifndef PEGASUS_STRING_NO_THROW
- // Any string bigger than this is seriously suspect.
- if (cap > 0x0FFFFFFF)
- throw PEGASUS_STD(bad_alloc)();
+ PEGASUS_CHECK_FOR_OVERFLOW(cap);
#endif
--- pegasus/src/Pegasus/Common/Buffer.cpp.obz4956 2006-03-17 13:59:03.000000000 -0500
+++ pegasus/src/Pegasus/Common/Buffer.cpp 2006-05-02 15:06:06.000000000 -0400
@@ -43,11 +43,17 @@
static const size_t MIN_CAPACITY = 2048;
+#ifndef PEGASUS_CHECK_FOR_OVERFLOW
+#define PEGASUS_CHECK_FOR_OVERFLOW(capacity) { if (capacity > 0x3FFFFFFF) throw PEGASUS_STD(bad_alloc)(); }
+#endif
+
static Uint32 _next_pow_2(Uint32 x)
{
if (x < MIN_CAPACITY)
return MIN_CAPACITY;
+ PEGASUS_CHECK_FOR_OVERFLOW(x);
+
x--;
x |= (x >> 1);
x |= (x >> 2);
@@ -132,7 +138,10 @@
_rep->size = 0;
}
else
+ {
+ PEGASUS_CHECK_FOR_OVERFLOW(_rep->cap);
_rep = _reallocate(_rep, _rep->cap ? (2 * _rep->cap) : MIN_CAPACITY);
+ }
}
void Buffer::insert(size_t pos, const char* data, size_t size)

View File

@ -0,0 +1,65 @@
--- pegasus/src/Pegasus/ProviderManager2/CMPI/CMPI_Broker.cpp.obz4968_upcalls_oop 2006-03-15 07:53:08.000000000 -0500
+++ pegasus/src/Pegasus/ProviderManager2/CMPI/CMPI_Broker.cpp 2006-05-02 14:29:16.000000000 -0400
@@ -313,8 +313,18 @@
CM_ObjectPath(cop)->getNameSpace(),
CM_ObjectPath(cop)->getClassName());
if (rc) CMSetStatus(rc,CMPI_RC_OK);
- CMPI_Object *obj =
- new CMPI_Object(new CMPI_OpEnumeration(new Array<CIMObjectPath>(en)));
+
+ // When running out of process the returned instances don't contain
+ // a name space. Create a writable copy of the array and add the
+ // namespace from the input parameters.
+ Array<CIMObjectPath> * aObj = new Array<CIMObjectPath>(en);
+ for (unsigned int index=0;index < aObj->size(); index++)
+ {
+ (*aObj)[index].setNameSpace(CM_ObjectPath(cop)->getNameSpace());
+ }
+
+ CMPI_Object *obj = new CMPI_Object(new CMPI_OpEnumeration(aObj));
+
return (CMPI_OpEnumeration *)obj->getHdl();
}
@@ -408,8 +418,18 @@
role ? String(role) : String::EMPTY,
resultRole ? String(resultRole) : String::EMPTY);
if (rc) CMSetStatus(rc,CMPI_RC_OK);
- CMPI_Object *obj =
- new CMPI_Object(new CMPI_OpEnumeration(new Array<CIMObjectPath>(en)));
+
+ // When running out of process the returned instances don't contain
+ // a name space. Create a writable copy of the array and add the
+ // namespace from the input parameters.
+ Array<CIMObjectPath> * aObj = new Array<CIMObjectPath>(en);
+ for (unsigned int index=0;index < aObj->size(); index++)
+ {
+ (*aObj)[index].setNameSpace(CM_ObjectPath(cop)->getNameSpace());
+ }
+
+ CMPI_Object *obj = new CMPI_Object(new CMPI_OpEnumeration(aObj));
+
return (CMPI_OpEnumeration *)obj->getHdl();
}
catch (const CIMException &e) {
@@ -493,8 +513,18 @@
resultClass ? CIMName(resultClass) : CIMName(),
role ? String(role) : String::EMPTY);
if (rc) CMSetStatus(rc,CMPI_RC_OK);
- CMPI_Object *obj =
- new CMPI_Object(new CMPI_OpEnumeration(new Array<CIMObjectPath>(en)));
+
+ // When running out of process the returned instances don't contain
+ // a name space. Create a writable copy of the array and add the
+ // namespace from the input parameters.
+ Array<CIMObjectPath> * aObj = new Array<CIMObjectPath>(en);
+ for (unsigned int index=0;index < aObj->size(); index++)
+ {
+ (*aObj)[index].setNameSpace(CM_ObjectPath(cop)->getNameSpace());
+ }
+
+ CMPI_Object *obj = new CMPI_Object(new CMPI_OpEnumeration(aObj));
+
return (CMPI_OpEnumeration *)obj->getHdl();
}
catch (const CIMException &e) {

313
pegasus-2.5.1-obz4978.patch Normal file
View File

@ -0,0 +1,313 @@
--- pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpIndicationHandler.cpp.obz4978 2006-01-30 11:17:54.000000000 -0500
+++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpIndicationHandler.cpp 2006-05-02 15:23:37.000000000 -0400
@@ -62,9 +62,54 @@
PEGASUS_USING_STD;
+#ifdef HPUX_EMANATE
+ static snmpDeliverTrap_emanate snmpTrap;
+#elif defined (PEGASUS_USE_NET_SNMP)
+ static snmpDeliverTrap_netsnmp snmpTrap;
+#else
+ static snmpDeliverTrap_stub snmpTrap;
+#endif
+
+snmpIndicationHandler::snmpIndicationHandler()
+{
+ PEG_METHOD_ENTER (TRC_IND_HANDLER,
+ "snmpIndicationHandler::snmpIndicationHandler");
+ PEG_METHOD_EXIT();
+}
+
void snmpIndicationHandler::initialize(CIMRepository* repository)
{
+ PEG_METHOD_ENTER (TRC_IND_HANDLER,
+ "snmpIndicationHandler::initialize");
+
_repository = repository;
+
+#ifdef PEGASUS_USE_NET_SNMP
+ snmpTrap.initialize();
+#endif
+
+ PEG_METHOD_EXIT();
+}
+
+void snmpIndicationHandler::terminate()
+{
+ PEG_METHOD_ENTER (TRC_IND_HANDLER,
+ "snmpIndicationHandler::terminate");
+
+#ifdef PEGASUS_USE_NET_SNMP
+ snmpTrap.terminate();
+#endif
+
+ PEG_METHOD_EXIT();
+}
+
+snmpIndicationHandler::~snmpIndicationHandler()
+{
+ PEG_METHOD_ENTER (TRC_IND_HANDLER,
+ "snmpIndicationHandler::~snmpIndicationHandler");
+
+
+ PEG_METHOD_EXIT();
}
// l10n - note: ignoring indication language
@@ -153,14 +198,6 @@
// trap destination and SNMP type are defined in handlerInstance
// and passing this instance as it is to deliverTrap() call
-#ifdef HPUX_EMANATE
- static snmpDeliverTrap_emanate emanateTrap;
-#elif defined (PEGASUS_USE_NET_SNMP)
- static snmpDeliverTrap_netsnmp emanateTrap;
-#else
- static snmpDeliverTrap_stub emanateTrap;
-#endif
-
Uint32 targetHostPos = handler.findProperty(CIMName ("TargetHost"));
Uint32 targetHostFormatPos = handler.findProperty(CIMName ("TargetHostFormat"));
Uint32 otherTargetHostFormatPos = handler.findProperty(CIMName (
@@ -263,7 +300,7 @@
handler.getProperty(engineIDPos).getValue().get(engineID);
}
- emanateTrap.deliverTrap(
+ snmpTrap.deliverTrap(
trapOid,
securityName,
targetHost,
@@ -315,6 +352,8 @@
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.FAILED_TO_DELIVER_TRAP",
"Failed to deliver trap."));
}
+
+ PEG_METHOD_EXIT();
}
// This is the dynamic entry point into this dynamic module. The name of
--- pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp.obz4978 2006-01-30 11:17:54.000000000 -0500
+++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.cpp 2006-05-02 15:23:37.000000000 -0400
@@ -41,6 +41,49 @@
PEGASUS_NAMESPACE_BEGIN
+void snmpDeliverTrap_netsnmp::initialize()
+{
+
+ PEG_METHOD_ENTER (TRC_IND_HANDLER,
+ "snmpDeliverTrap_netsnmp::initialize");
+
+ // Defined default MIB modules (in net-snmp-config.h) do not need to be
+ // loaded and loading them can cause some stderr;
+ // use environment variable MIBS to override the default MIB modules.
+ // If there is no MIBS environment variable, add it in.
+ char *envVar;
+ envVar = getenv("MIBS");
+
+ if (envVar == NULL)
+ {
+ putenv("MIBS=");
+ }
+
+ // Initialize the mib reader
+ netsnmp_set_mib_directory("");
+ init_mib();
+
+ // Initializes the SNMP library
+ init_snmp("snmpIndicationHandler");
+
+ // windows32 specific initialization (is a NOOP on unix)
+ SOCK_STARTUP;
+
+ PEG_METHOD_EXIT ();
+
+}
+
+void snmpDeliverTrap_netsnmp::terminate()
+{
+
+ PEG_METHOD_ENTER (TRC_IND_HANDLER,
+ "snmpDeliverTrap_netsnmp::terminate");
+
+ SOCK_CLEANUP;
+
+ PEG_METHOD_EXIT ();
+}
+
void snmpDeliverTrap_netsnmp::deliverTrap(
const String& trapOid,
const String& securityName,
@@ -59,12 +102,12 @@
"snmpDeliverTrap_netsnmp::deliverTrap");
void *sessionHandle;
- struct snmp_session snmpSession, *sessionPtr;
+ struct snmp_session *sessionPtr;
struct snmp_pdu *snmpPdu;
// Creates a SNMP session
- _createSession(targetHost, portNumber, securityName, snmpSession,
+ _createSession(targetHost, portNumber, securityName,
sessionHandle, sessionPtr);
try
@@ -138,7 +181,6 @@
const String & targetHost,
Uint32 portNumber,
const String & securityName,
- snmp_session & snmpSession,
void *&sessionHandle,
snmp_session *&sessionPtr)
{
@@ -148,34 +190,13 @@
Sint32 libErr, sysErr;
char *errStr;
String exceptionStr;
+
+ struct snmp_session snmpSession;
- // Defined default MIB modules (in net-snmp-config.h) do not need to be
- // loaded and loading them can cause some stderr;
- // use environment variable MIBS to override the default MIB modules.
- // If there is no MIBS environment variable, add it in.
-
- char *envVar;
- envVar = getenv("MIBS");
-
- if (envVar == NULL)
{
- putenv("MIBS=");
- }
-
- // Initialize the mib reader
- netsnmp_set_mib_directory("");
- init_mib();
-
- // Initializes the SNMP library
- init_snmp("snmpIndicationHandler");
-
- // Prepares a struct snmp_session that will be used for a set of
- // SNMP transactions
+ AutoMutex autoMut(_sessionInitMutex);
snmp_sess_init(&snmpSession);
- // windows32 specific initialization (is a NOOP on unix)
- SOCK_STARTUP;
-
CString targetHostCStr = targetHost.getCString();
// peername has format: targetHost:portNumber
@@ -183,7 +204,9 @@
1+32));
sprintf(snmpSession.peername, "%s:%u", (const char*)targetHostCStr,
portNumber);
+
sessionHandle = snmp_sess_open(&snmpSession);
+ }
if (sessionHandle == NULL)
{
@@ -196,8 +219,6 @@
free(errStr);
- SOCK_CLEANUP;
-
PEG_METHOD_EXIT ();
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
@@ -276,8 +297,6 @@
snmp_sess_close(sessionHandle);
- SOCK_CLEANUP;
-
PEG_METHOD_EXIT ();
}
--- pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpIndicationHandler.h.obz4978 2006-01-30 11:17:54.000000000 -0500
+++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpIndicationHandler.h 2006-05-02 15:23:37.000000000 -0400
@@ -50,19 +50,13 @@
CIMRepository* _repository;
- snmpIndicationHandler()
- {
- }
-
- virtual ~snmpIndicationHandler()
- {
- }
+ snmpIndicationHandler();
+
+ virtual ~snmpIndicationHandler();
void initialize(CIMRepository* repository);
- void terminate()
- {
- }
+ void terminate();
void handleIndication(
const OperationContext& context,
@@ -71,6 +65,7 @@
CIMInstance& handler,
CIMInstance& subscription,
ContentLanguageList& contentLanguages);
+
};
PEGASUS_NAMESPACE_END
--- pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.h.obz4978 2006-01-30 11:17:54.000000000 -0500
+++ pegasus/src/Pegasus/Handler/snmpIndicationHandler/snmpDeliverTrap_netsnmp.h 2006-05-02 15:23:37.000000000 -0400
@@ -37,6 +37,7 @@
#include <iostream>
+#include <Pegasus/Common/IPC.h>
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include "snmpDeliverTrap.h"
@@ -120,6 +121,10 @@
{
public:
+ void initialize();
+
+ void terminate();
+
void deliverTrap(
const String& trapOid,
const String& securityName,
@@ -135,6 +140,10 @@
private:
+ // Mutex is needed before a session is created. Sessions created
+ // using the Single API do not interact with other SNMP sessions.
+ Mutex _sessionInitMutex;
+
/**
Creates a SNMP session.
@@ -143,7 +152,6 @@
to receive a trap
@param portNumber the port number to receive a trap
@param securityName the human readable community name
- @param snmpSession the SNMP session
@param sessionHandle an opaque pointer of the SNMP session
@param sessionPtr the SNMP session pointer to its associated
struct snmp_session
@@ -153,7 +161,6 @@
void _createSession(const String & targetHost,
Uint32 portNumber,
const String & securityName,
- struct snmp_session & snmpSession,
void *&sessionHandle,
struct snmp_session *&sessionPtr);

View File

@ -0,0 +1,18 @@
--- pegasus/src/Pegasus/ProviderManager2/ProviderAgent/ProviderAgent.cpp.obz4983 2006-02-28 14:53:31.000000000 -0500
+++ pegasus/src/Pegasus/ProviderManager2/ProviderAgent/ProviderAgent.cpp 2006-05-02 15:30:34.000000000 -0400
@@ -589,6 +589,7 @@
// Send request back to the server to process
_providerAgent->_writeResponse(message);
+ delete message;
PEG_METHOD_EXIT();
}
@@ -601,6 +602,7 @@
// Send request back to the server to process
_providerAgent->_writeResponse(response);
+ delete response;
PEG_METHOD_EXIT();
}

269
pegasus-2.5.1-obz4984.patch Normal file
View File

@ -0,0 +1,269 @@
--- pegasus/src/Pegasus/ProviderManager2/OOPProviderManagerRouter.cpp.obz4980 2006-03-15 16:28:36.000000000 -0500
+++ pegasus/src/Pegasus/ProviderManager2/OOPProviderManagerRouter.cpp 2006-05-02 15:34:36.000000000 -0400
@@ -523,6 +523,28 @@
//Out of provider support for OS400 goes here when needed.
#else
+
+# ifndef PEGASUS_DISABLE_PROV_USERCTXT
+ // Get and save the effective user name and the uid/gid for the user
+ // context of the agent process
+
+ String effectiveUserName = System::getEffectiveUserName();
+ PEGASUS_UID_T newUid = (PEGASUS_UID_T) -1;
+ PEGASUS_GID_T newGid = (PEGASUS_GID_T) -1;
+ if (_userName != effectiveUserName)
+ {
+ if (!System::lookupUserId(_userName.getCString(), newUid, newGid))
+ {
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_FAILED,
+ MessageLoaderParms(
+ "ProviderManager.OOPProviderManagerRouter."
+ "USER_CONTEXT_CHANGE_FAILED",
+ "Unable to change user context to \"$0\".", _userName));
+ }
+ }
+# endif
+
pid_t pid = fork();
if (pid < 0)
{
@@ -558,11 +580,11 @@
pipeToAgent->exportReadHandle(readHandle);
pipeFromAgent->exportWriteHandle(writeHandle);
-#ifndef PEGASUS_DISABLE_PROV_USERCTXT
+# ifndef PEGASUS_DISABLE_PROV_USERCTXT
// Set the user context of the Provider Agent process
- if (_userName != System::getEffectiveUserName())
+ if (_userName != effectiveUserName)
{
- if (!System::changeUserContext(_userName.getCString()))
+ if (!System::changeUserContext(newUid, newGid))
{
Tracer::trace(TRC_DISCARDED_DATA, Tracer::LEVEL2,
"System::changeUserContext() failed. userName = %s.",
@@ -575,7 +597,7 @@
_exit(1);
}
}
-#endif
+# endif
execl(agentCommandPathCString, agentCommandPathCString,
readHandle, writeHandle,
@@ -1667,7 +1689,7 @@
request->operationContext.get(IdentityContainer::NAME);
userName = ic.getUserName();
}
- catch (Exception& e)
+ catch (Exception&)
{
// If no IdentityContainer is present, default to the CIM
// Server's user context
--- pegasus/src/Pegasus/Common/SystemVms.cpp.obz4980 2006-01-30 11:17:08.000000000 -0500
+++ pegasus/src/Pegasus/Common/SystemVms.cpp 2006-05-02 15:34:36.000000000 -0400
@@ -674,7 +674,10 @@
#endif
-Boolean System::changeUserContext(const char *userName)
+Boolean System::lookupUserId(
+ const char* userName,
+ PEGASUS_UID_T& uid,
+ PEGASUS_GID_T& gid)
{
const unsigned int PWD_BUFF_SIZE = 1024;
struct passwd pwd;
@@ -697,18 +700,28 @@
return false;
}
+ uid = pwd.pw_uid;
+ gid = pwd.pw_gid;
+
+ return true;
+}
+
+Boolean System::changeUserContext(
+ const PEGASUS_UID_T& uid,
+ const PEGASUS_GID_T& gid)
+{
Tracer::trace(TRC_OS_ABSTRACTION, Tracer::LEVEL4,
"Changing user context to: uid = %d, gid = %d",
- (int) pwd.pw_uid, (int) pwd.pw_gid);
+ (int) uid, (int) gid);
- if (setgid(pwd.pw_gid) != 0)
+ if (setgid(gid) != 0)
{
PEG_TRACE_STRING(TRC_OS_ABSTRACTION, Tracer::LEVEL2,
String("setgid failed: ") + String(strerror(errno)));
return false;
}
- if (setuid(pwd.pw_uid) != 0)
+ if (setuid(uid) != 0)
{
PEG_TRACE_STRING(TRC_OS_ABSTRACTION, Tracer::LEVEL2,
String("setuid failed: ") + String(strerror(errno)));
--- pegasus/src/Pegasus/Common/SystemWindows.cpp.obz4980 2006-02-08 15:50:59.000000000 -0500
+++ pegasus/src/Pegasus/Common/SystemWindows.cpp 2006-05-02 15:34:36.000000000 -0400
@@ -838,7 +838,18 @@
return retVal;
}
-Boolean System::changeUserContext(const char* userName)
+Boolean System::lookupUserId(
+ const char* userName,
+ PEGASUS_UID_T& uid,
+ PEGASUS_GID_T& gid)
+{
+ // ATTN: Implement this method to look up the specified user
+ return false;
+}
+
+Boolean System::changeUserContext(
+ const PEGASUS_UID_T& uid,
+ const PEGASUS_GID_T& gid)
{
// ATTN: Implement this method to change the process user context to the
// specified user
--- pegasus/src/Pegasus/Common/SystemNsk.cpp.obz4980 2006-01-30 11:17:08.000000000 -0500
+++ pegasus/src/Pegasus/Common/SystemNsk.cpp 2006-05-02 15:34:36.000000000 -0400
@@ -157,7 +157,18 @@
return true;
}
-Boolean System::changeUserContext(const char* userName)
+Boolean System::lookupUserId(
+ const char* userName,
+ PEGASUS_UID_T& uid,
+ PEGASUS_GID_T& gid)
+{
+ // ATTN: Implement this method to look up the specified user
+ return false;
+}
+
+Boolean System::changeUserContext(
+ const PEGASUS_UID_T& uid,
+ const PEGASUS_GID_T& gid)
{
// ATTN: Implement this method to change the process user context to the
// specified user
--- pegasus/src/Pegasus/Common/SystemUnix.cpp.obz4980 2006-01-30 11:17:08.000000000 -0500
+++ pegasus/src/Pegasus/Common/SystemUnix.cpp 2006-05-02 15:34:36.000000000 -0400
@@ -1097,8 +1097,12 @@
return retVal;
}
+
#ifndef PEGASUS_OS_OS400
-Boolean System::changeUserContext(const char* userName)
+Boolean System::lookupUserId(
+ const char* userName,
+ PEGASUS_UID_T& uid,
+ PEGASUS_GID_T& gid)
{
const unsigned int PWD_BUFF_SIZE = 1024;
struct passwd pwd;
@@ -1129,18 +1133,28 @@
return false;
}
+ uid = pwd.pw_uid;
+ gid = pwd.pw_gid;
+
+ return true;
+}
+
+Boolean System::changeUserContext(
+ const PEGASUS_UID_T& uid,
+ const PEGASUS_GID_T& gid)
+{
Tracer::trace(TRC_OS_ABSTRACTION, Tracer::LEVEL4,
"Changing user context to: uid = %d, gid = %d",
- (int)pwd.pw_uid, (int)pwd.pw_gid);
+ (int)uid, (int)gid);
- if (setgid(pwd.pw_gid) != 0)
+ if (setgid(gid) != 0)
{
PEG_TRACE_STRING(TRC_OS_ABSTRACTION, Tracer::LEVEL2,
String("setgid failed: ") + String(strerror(errno)));
return false;
}
- if (setuid(pwd.pw_uid) != 0)
+ if (setuid(uid) != 0)
{
PEG_TRACE_STRING(TRC_OS_ABSTRACTION, Tracer::LEVEL2,
String("setuid failed: ") + String(strerror(errno)));
@@ -1150,6 +1164,7 @@
return true;
}
#endif
+
Uint32 System::getPID()
{
//
--- pegasus/src/Pegasus/Common/System.h.obz4980 2006-01-30 11:17:08.000000000 -0500
+++ pegasus/src/Pegasus/Common/System.h 2006-05-02 15:34:36.000000000 -0400
@@ -57,6 +57,16 @@
#endif
#endif
+#ifdef PEGASUS_OS_TYPE_UNIX
+# ifndef PEGASUS_OS_OS400
+# include <unistd.h>
+# endif
+# define PEGASUS_UID_T uid_t
+# define PEGASUS_GID_T gid_t
+#else
+# define PEGASUS_UID_T Uint32
+# define PEGASUS_GID_T Uint32
+#endif
//
// Protocal Type
@@ -246,16 +256,33 @@
static Boolean isGroupMember(const char* userName, const char* groupName);
/**
- Changes the process user context to the specified user.
-
- @param userName User name to set as the process user context.
+ Gets the user and group IDs associated with the specified user.
+ @param userName User name for which to look up user and group IDs.
+ @param uid User ID for the specified user name.
+ @param gid Group ID for the specified user name.
+ @return True if the user and group IDs were retrieved
+ successfully, false otherwise.
+ */
+#ifndef PEGASUS_OS_OS400
+ static Boolean lookupUserId(
+ const char* userName,
+ PEGASUS_UID_T& uid,
+ PEGASUS_GID_T& gid);
+#endif
- @return True if the user context is successfully changed,
- false otherwise.
+ /**
+ Changes the process user context to the specified user and group ID.
+ @param uid User ID to set as the process user context.
+ @param gid Group ID to set as the process group context.
+ @return True if the user context is successfully changed,
+ false otherwise.
*/
#ifndef PEGASUS_OS_OS400
- static Boolean changeUserContext(const char* userName);
+ static Boolean changeUserContext(
+ const PEGASUS_UID_T& uid,
+ const PEGASUS_GID_T& gid);
#endif
+
/**
This function is used to get the process ID of the calling process.

1032
pegasus-2.5.1-obz4986.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -45,13 +45,13 @@
inline void Packer::packReal32(Buffer& out, Real32 x)
{
- packUint32(out, *((Uint32*)&x));
+ packUint32(out, (Uint32)x);
+ packUint32(out, *(reinterpret_cast<Uint32*>(&x)));
}
inline void Packer::packReal64(Buffer& out, Real64 x)
{
- packUint64(out, *((Uint64*)&x));
+ packUint64(out, (Uint64)x);
+ packUint64(out, *(reinterpret_cast<Uint64*>(&x)));
}
inline void Packer::packChar16(Buffer& out, Char16 x)

View File

@ -31,7 +31,7 @@
%define pegasus_uid 66
Version: 2.5.1
Release: 3%{?LINUX_VERSION:.%{LINUX_VERSION}}
Release: 4%{?LINUX_VERSION:.%{LINUX_VERSION}}
Epoch: 2
#
Summary: OpenPegasus WBEM Services for Linux
@ -66,6 +66,13 @@ Patch14: pegasus-2.5.1-obz4945.patch
Patch15: pegasus-2.5.1-PATH_MAX.patch
Patch16: pegasus-2.5.1-HOSTNAME_MAX.patch
Patch17: pegasus-2.5.1-fix_repupgrade.patch
Patch18: pegasus-2.5.1-obz4968_upcalls_oop.patch
Patch19: pegasus-2.5.1-obz4955.patch
Patch20: pegasus-2.5.1-obz4956.patch
Patch21: pegasus-2.5.1-obz4978.patch
Patch22: pegasus-2.5.1-obz4983.patch
Patch23: pegasus-2.5.1-obz4984.patch
Patch24: pegasus-2.5.1-obz4986.patch
#
Conflicts: openwbem
Provides: tog-pegasus-cimserver
@ -132,12 +139,20 @@ The OpenPegasus WBEM tests for the OpenPegasus %{version} Linux rpm.
%patch9 -p1 -b .parallel-make
%patch10 -p1 -b .fix-zseries-flags
%patch11 -p1 -b .fix-tests
%patch12 -p1 -b .AutoPtr-Core
#%patch12 -p1 -b .AutoPtr-Core
#^- now fixed with upstream obz4968 patch
%patch13 -p1 -b .obz4934
%patch14 -p1 -b .obz4945
%patch15 -p1 -b .PATH_MAX
%patch16 -p1 -b .HOSTNAME_MAX
%patch17 -p1 -b .fix_repupgrade
%patch18 -p1 -b .obz4968_upcalls_oop
%patch19 -p1 -b .obz4955
%patch20 -p1 -b .obz4956
%patch21 -p1 -b .obz4978
%patch22 -p1 -b .obz4983
%patch23 -p1 -b .obz4984
%patch24 -p1 -b .obz4986
%build
rm -rf ${RPM_BUILD_ROOT} || :;
@ -163,6 +178,9 @@ make -f RedHat.OpenPegasus.Makefile install prefix=$RPM_BUILD_ROOT libdir=%{_lib
%files
%defattr(0750, root, pegasus, 0750)
%if !%{NODEBUGINFO}
%exclude /usr/lib/debug
%endif
/usr/%{_lib}/*
/usr/sbin/*
/usr/bin/*
@ -272,6 +290,19 @@ fi
:;
%changelog
* Tue May 02 2006 Jason Vas Dias <jvdias@redhat.com> - 2:2.5.1-4
- fix bug 190432: %exclude /usr/lib/debug from RPM
- fix upstream OpenPegasus '2.5.2_APPROVED' bugs, applying upstream patches:
o 4955 : Bogus Description property for OperatingSystem provider
o 4956 : reserveCapacity method may cause size overflow on invalid input
o 4968 : CMPI provider up-calls cause failure with out-of-process
o 4978 : snmpDeliverTrap_netsnmp::_createSession function is not thread safe
o 4983 : Memory leak in OOP indication generation
o 4984 : Forked process hangs in system call
o 4986 : Adding automated test for snmpIndication Handler
( http://cvs.opengroup.org/bugzilla/show_bug.cgi?id=? )
- apply upstream update to 'pegasus-2.5.1-warnings.patch'
* Mon Apr 17 2006 Jason Vas Dias <jvdias@redhat.com> - 2:2.5.1-3
- Fix repupgrade (make it use correct paths)