diff --git a/CHANGELOG b/CHANGELOG index d74dece..5ed872f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ Maui 3.2.6p21 - Fixed CHECKSUM authentication for maui + slurm. Thanks goes to Eyegene Ryabinkin. + - Fixed 64bit issue. Maui assumed ints were always 8 bytes for 64bit systems even though x86_64 ints are still 4 bytes. This lead to aliasing of large indexed node properties to smaller indexed properties. Maui now triggers off of sizeof(int). Thanks goes to Alexis Cousein. + - Fixed an optimiztion issue with x86_64 systems. -O2 was optimizing out parts of the communication strings. Maui 3.2.6p20 - Fixed a potential security issue when Maui is used with some PBS configurations. diff --git a/include/moab-proto.h b/include/moab-proto.h index da38e24..283e11a 100644 --- a/include/moab-proto.h +++ b/include/moab-proto.h @@ -453,6 +453,7 @@ void MSysShutdown(int); int MSysDestroyObjects(void); int MSysDiagnose(char *,int,long); int MSysStartServer(int); +int M64Init(m64_t *); diff --git a/include/moab.h b/include/moab.h index 70809e8..bcad694 100644 --- a/include/moab.h +++ b/include/moab.h @@ -125,6 +125,7 @@ enum MActivePolicyTypeEnum { #define M32UINT4 unsigned long #define M32UINT8 unsigned long long +/* ints on x86_64 are still 4 bytes */ #ifdef __M64 #define MINTBITS 64 #define MINTLBITS 6 diff --git a/src/mcom/MSU.c b/src/mcom/MSU.c index 76e61d1..0bf02ac 100644 --- a/src/mcom/MSU.c +++ b/src/mcom/MSU.c @@ -1303,9 +1303,11 @@ int MSUSendData( if (DoSocketLayerAuth == TRUE) { + char tmpStr[MMAX_BUFFER]; + time(&Now); - sprintf(TSLine,"%s%ld %s%s", + sprintf(tmpStr,"%s%ld %s%s", MCKeyword[mckTimeStamp], (long)Now, MCKeyword[mckAuth], @@ -1320,7 +1322,7 @@ int MSUSendData( } sprintf(TSLine,"%s %s", - TSLine, + tmpStr, MCKeyword[mckData]); MSecGetChecksum2( diff --git a/src/mcom/MSec.c b/src/mcom/MSec.c index b8c912d..7f7f7e4 100644 --- a/src/mcom/MSec.c +++ b/src/mcom/MSec.c @@ -130,7 +130,6 @@ int MSecMD5GetDigest(char *,int,char *,int,char *,int); -#ifndef __M32COMPAT int M64Init( @@ -143,10 +142,10 @@ int M64Init( M->Is64 = FALSE; - M->INTBC = M32INTBITS; - M->INTLBC = M32INTLBITS; - M->MIntSize = M32INTSIZE; - M->IntShift = M32INTSHIFT; + M->INTBITS = M32INTBITS; + M->INTLBITS = M32INTLBITS; + M->INTSIZE = M32INTSIZE; + M->INTSHIFT = M32INTSHIFT; } else { @@ -154,10 +153,10 @@ int M64Init( M->Is64 = TRUE; - M->INTBC = M64INTBITS; - M->INTLBC = M64INTLBITS; - M->MIntSize = M64INTSIZE; - M->IntShift = M64INTSHIFT; + M->INTBITS = M64INTBITS; + M->INTLBITS = M64INTLBITS; + M->INTSIZE = M64INTSIZE; + M->INTSHIFT = M64INTSHIFT; } MDB(5,fSTRUCT) MLog("INFO: 64Bit enabled: %s UINT4[%d] UINT8[%d]\n", @@ -168,7 +167,6 @@ int M64Init( return(SUCCESS); } /* END M64Init() */ -#endif /* !__M32COMPAT */ diff --git a/src/moab/MPar.c b/src/moab/MPar.c index 9acdc03..d9bd2ae 100644 --- a/src/moab/MPar.c +++ b/src/moab/MPar.c @@ -23,6 +23,7 @@ extern mckpt_t MCP; extern mrm_t MRM[]; extern mstat_t MStat; extern mattrlist_t MAList; +extern m64_t M64; extern const char *MQALType[]; extern const char *MResourceType[]; @@ -1252,7 +1253,7 @@ char *MParBMToString( { P = &MPar[pindex]; - if (!(BM[pindex >> MINTLBITS] & (1 << (pindex % MINTBITS)))) + if (!(BM[pindex >> M64.INTLBITS] & (1 << (pindex % M64.INTBITS)))) continue; if (P->Name[0] == '\0') diff --git a/src/moab/MQOS.c b/src/moab/MQOS.c index 270530e..beaa7f6 100644 --- a/src/moab/MQOS.c +++ b/src/moab/MQOS.c @@ -17,6 +17,7 @@ extern mgcred_t *MUser[]; extern mgcred_t MGroup[]; extern mgcred_t MAcct[]; extern mclass_t MClass[]; +extern m64_t M64; extern const char *MQOSFlags[]; extern const char *MQALType[]; @@ -896,7 +897,7 @@ char *MQOSBMToString( for (bindex = 0;bindex < MAX_MQOS;bindex++) { - if (!(BM[bindex >> MINTLBITS] & (1 << (bindex % MINTBITS)))) + if (!(BM[bindex >> M64.INTLBITS] & (1 << (bindex % M64.INTBITS)))) continue; Q = &MQOS[bindex]; diff --git a/src/moab/MSched.c b/src/moab/MSched.c index 03c6568..424131a 100644 --- a/src/moab/MSched.c +++ b/src/moab/MSched.c @@ -19,6 +19,7 @@ extern msys_t MSystem; extern mframe_t MFrame[]; extern mckpt_t MCP; extern mres_t *MRes[]; +extern m64_t M64; extern int MAQ[]; extern int MUIQ[]; @@ -2256,8 +2257,8 @@ int MJobSelectResourceSet( for (sindex = 0;sindex < MaxSet;sindex++) { - if (N->FBM[SetIndex[sindex] >> MINTLBITS] & - (1 << (SetIndex[sindex] % MINTBITS))) + if (N->FBM[SetIndex[sindex] >> M64.INTLBITS] & + (1 << (SetIndex[sindex] % M64.INTBITS))) { SetCount[sindex] += TC; SetNC[sindex] ++; @@ -2422,8 +2423,8 @@ int MJobSelectResourceSet( { case mrstFeature: - if (N->FBM[SetIndex[sindex] >> MINTLBITS] & - (1 << (SetIndex[sindex] % MINTBITS))) + if (N->FBM[SetIndex[sindex] >> M64.INTLBITS] & + (1 << (SetIndex[sindex] % M64.INTBITS))) { /* node is feasible */ @@ -2576,8 +2577,8 @@ int MJobSelectResourceSet( { case mrstFeature: - if (N->FBM[SetIndex[BestSet] >> MINTLBITS] & - (1 << (SetIndex[BestSet] % MINTBITS))) + if (N->FBM[SetIndex[BestSet] >> M64.INTLBITS] & + (1 << (SetIndex[BestSet] % M64.INTBITS))) { /* node is in set */ diff --git a/src/moab/MSys.c b/src/moab/MSys.c index 2f74d26..67b5e08 100644 --- a/src/moab/MSys.c +++ b/src/moab/MSys.c @@ -38,6 +38,7 @@ mjob_t *MJobTraceBuffer; mrmfunc_t MRMFunc[MAX_MRMTYPE]; msim_t MSim; msys_t MSys; /* cluster layout */ +m64_t M64; mx_t X; int MFQ[MAX_MJOB]; /* terminated by '-1' value */ @@ -98,6 +99,8 @@ int MSysInitialize(mbool_t DoInit) S->X = (void *)&X; + M64Init(&M64); + MOSSyslogInit(S); MUBuildPList((mcfg_t *)MCfg,MParam); diff --git a/src/moab/MTrace.c b/src/moab/MTrace.c index a2b9186..f6ebeb0 100644 --- a/src/moab/MTrace.c +++ b/src/moab/MTrace.c @@ -25,6 +25,7 @@ extern mnode_t *MNode[]; extern mqos_t MQOS[]; extern mpar_t MPar[]; extern mrm_t MRM[]; +extern m64_t M64; extern mframe_t MFrame[]; @@ -1219,7 +1220,7 @@ int MTraceLoadWorkload( J->SpecFlags |= MSim.TraceDefaultJobFlags; - for (index = 0;index < MINTBITS;index++) + for (index = 0;index < M64.INTBITS;index++) { if (!(MSim.TraceIgnoreJobFlags & (1 << index))) continue; diff --git a/src/moab/MUtil.c b/src/moab/MUtil.c index 15b0215..40746bc 100644 --- a/src/moab/MUtil.c +++ b/src/moab/MUtil.c @@ -23,6 +23,7 @@ extern const char *MComp[]; extern const char *MNodeState[]; extern const char *MHRObj[]; extern const char *MResourceType[]; +extern m64_t M64; extern mx_t X; @@ -788,7 +789,7 @@ int MUGetMAttr( return(SUCCESS); } - if ((AttrValue == NULL) || (MapSize < MINTSIZE)) + if ((AttrValue == NULL) || (MapSize < M64.INTSIZE)) { return(FAILURE); } @@ -805,7 +806,7 @@ int MUGetMAttr( if (!strcmp(MAList[AttrIndex][index],AttrValue)) { if (AttrMap != NULL) - AttrMap[index >> MINTLBITS] |= 1 << (index % MINTBITS); + AttrMap[index >> M64.INTLBITS] |= 1 << (index % M64.INTBITS); return(SUCCESS); } @@ -822,7 +823,7 @@ int MUGetMAttr( MUStrCpy(MAList[AttrIndex][index],AttrValue,sizeof(MAList[0][0])); - AttrMap[index >> MINTLBITS] |= 1 << (index % MINTBITS); + AttrMap[index >> M64.INTLBITS] |= 1 << (index % M64.INTBITS); DBG(5,fSTRUCT) DPrint("INFO: added MAList[%s][%d]: '%s'\n", MAttrType[AttrIndex], @@ -1069,7 +1070,7 @@ char *MUListAttrs( Line[0] = '\0'; - for (i = 1;i < MINTBITS;i++) + for (i = 1;i < M64.INTBITS;i++) { if ((Value & (1 << i)) && (MAList[Attr][i][0] != '\0')) { @@ -1097,7 +1098,7 @@ char *MUMAList( int index; int findex; - if ((ValueMap == NULL) || (MapSize < MINTSIZE)) + if ((ValueMap == NULL) || (MapSize < M64.INTSIZE)) { strcpy(Line,NONE); @@ -1106,16 +1107,16 @@ char *MUMAList( Line[0] = '\0'; - for (findex = 0;findex < (MapSize >> MINTSHIFT);findex++) + for (findex = 0;findex < (MapSize >> M64.INTSHIFT);findex++) { - for (index = 0;index < MINTBITS;index++) + for (index = 0;index < M64.INTBITS;index++) { if ((ValueMap[findex] & (1 << index)) && (MAList[AttrIndex][index][0] != '\0')) { sprintf(Line,"%s[%s]", Line, - MAList[AttrIndex][index + findex * MINTBITS]); + MAList[AttrIndex][index + findex * M64.INTBITS]); } } /* END for (index) */ } /* END for (findex) */ @@ -1152,7 +1153,7 @@ char *MAttrFind( return(NULL); } - if ((ValueMap == NULL) || (MapSize < MINTSIZE)) + if ((ValueMap == NULL) || (MapSize < M64.INTSIZE)) { return(NULL); } @@ -1162,7 +1163,7 @@ char *MAttrFind( for (findex = 0;findex < (MapSize >> 2);findex++) { - for (index = 0;index < MINTBITS;index++) + for (index = 0;index < M64.INTBITS;index++) { if ((ValueMap[findex] & (1 << index)) && (MAList[AttrIndex][index][0] != '\0')) @@ -1217,7 +1218,7 @@ char *MUBListAttrs( return(Line); } - for (i = 1;i < MINTBITS;i++) + for (i = 1;i < M64.INTBITS;i++) { if ((Value & (1 << i)) && (MAList[Attr][i][0] != '\0')) { @@ -4121,7 +4122,7 @@ char *MUBMToString( ptr[0] = '\0'; - for (i = 1;i < MINTBITS;i++) + for (i = 1;i < M64.INTBITS;i++) { if ((BM & (1 << i)) && (AList[i] != NULL) && (AList[i][0] != '\0')) { @@ -4252,7 +4253,7 @@ int MUBMOR( int mindex; int len; - len = MAX(1,(MapSize >> MINTLBITS)); + len = MAX(1,(MapSize >> M64.INTLBITS)); for (mindex = 0;mindex < len;mindex++) { @@ -4275,7 +4276,7 @@ int MUBMAND( int mindex; int len; - len = MAX(1,(MapSize >> MINTLBITS)); + len = MAX(1,(MapSize >> M64.INTLBITS)); for (mindex = 0;mindex < len;mindex++) { @@ -5413,7 +5414,7 @@ char *MUMAToString( char *ptr; - if ((ValueMap == NULL) || (MapSize < MINTSIZE)) + if ((ValueMap == NULL) || (MapSize < M64.INTSIZE)) { strcpy(Line,NONE); @@ -5422,14 +5423,14 @@ char *MUMAToString( Line[0] = '\0'; - for (findex = 0;findex < (MapSize >> MINTSHIFT);findex++) + for (findex = 0;findex < (MapSize >> M64.INTSHIFT);findex++) { - for (index = 0;index < MINTBITS;index++) + for (index = 0;index < M64.INTBITS;index++) { if ((ValueMap[findex] & (1 << index)) && (MAList[AttrIndex][index][0] != '\0')) { - ptr = MAList[AttrIndex][index + findex * MINTBITS]; + ptr = MAList[AttrIndex][index + findex * M64.INTBITS]; if (Delim != '\0') { diff --git a/src/server/OUserI.c b/src/server/OUserI.c index 0cb4fde..d3a8b79 100644 --- a/src/server/OUserI.c +++ b/src/server/OUserI.c @@ -33,6 +33,8 @@ int UIProcessCommand( long tmpL; + char tmpLine[MMAX_LINE]; + const char *FName = "UIProcessCommand"; DBG(3,fUI) DPrint("%s(S)\n", @@ -411,16 +413,16 @@ int UIProcessCommand( S->SBufSize = (long)sizeof(SBuffer); - sprintf(S->SBuffer,"%s%d ", - MCKeyword[mckStatusCode], - scFAILURE); + sprintf(tmpLine,"%s%d ", + MCKeyword[mckStatusCode], + scFAILURE); - Align = (int)strlen(S->SBuffer) + (int)strlen(MCKeyword[mckArgs]); + Align = (int)strlen(tmpLine) + (int)strlen(MCKeyword[mckArgs]); sprintf(S->SBuffer,"%s%*s%s", - S->SBuffer, - 16 - (Align % 16), - " ", + tmpLine, + 16 - (Align % 16), + " ", MCKeyword[mckArgs]); HeadSize = (int)strlen(SBuffer); @@ -429,7 +431,7 @@ int UIProcessCommand( if (Function[sindex] != NULL) scode = (*Function[sindex])(args,S->SBuffer + HeadSize,FLAGS,Auth,&S->SBufSize); else - scode = FAILURE; + scode = FAILURE; ptr = S->SBuffer + strlen(MCKeyword[mckStatusCode]); diff --git a/src/server/mclient.c b/src/server/mclient.c index 361cbaa..9d93d90 100644 --- a/src/server/mclient.c +++ b/src/server/mclient.c @@ -10,6 +10,7 @@ #define MAX_MCARGS 128 extern mattrlist_t MAList; +extern m64_t M64; int MCResCreate(char *); int MCJobShow(char *); @@ -563,6 +564,8 @@ int __MCInitialize() DBG(2,fALL) DPrint("%s()\n", FName); + M64Init(&M64); + MUBuildPList(MCfg,MParam); strcpy(C.ServerHost,DEFAULT_MSERVERHOST);