Loading src/admin.cpp +2 −2 Changes for src/admin.cpp: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -1317,7 +1317,7 @@ namespace authdb { mrec = (GroupData::MemberUids *)cur.data; char *start=cur.data+sizeof(GroupData::MemberUids); char *start=cur.data+(sizeof(GroupData::MemberUids)-sizeof(uuid_t)); size_t urd=sizeof(AuthHeader),uend=backend->end(); while(urd<uend){ Loading @@ -1337,7 +1337,7 @@ namespace authdb { form << "<option value=\"" << cuuid << "\" "; for(size_t i=0; i<mrec->count; ++i ){ uuid_t *ucmp =(uuid_t*)start+i; uuid_t *ucmp =(uuid_t*)start+(i*sizeof(uuid_t)); if(uuid_compare(*ucmp,curu.uuid) == 0){ form << "selected"; break; Loading src/gpo.cpp +2 −42 Changes for src/gpo.cpp: 2 added lines, 42 removed lines. Original line number Diff line number Diff line Loading @@ -61,48 +61,8 @@ bool authdb::GpoData::getGpoValue(){ } void authdb::GpoData::setAllowed(Allow *allowed){ AuthData *curec=this; uuid_t fuuid; uuid_copy(fuuid,Data.uuid); if(!_Allowed){ while(curec){ if(curec->Data.type == authdb::PolicyData && uuid_compare(curec->Data.uuid,Data.uuid)==0 && strcmp(curec->Data.fieldname,"gpoallowed")==0 ){ _Allowed=&curec->Data; _Allowed->datasize=0; delete[] _Allowed->data; _Allowed->data=nullptr; break; } curec=curec->next(); } } if(!_Allowed){ AuthData::Record rec; _Allowed=&append(rec).Data; } memset(_Allowed,0,sizeof(AuthData::Record)); _Allowed->start=0xFE; uuid_copy(_Allowed->uuid,fuuid); _Allowed->type=DataType::PolicyData; _Allowed->storage=StorageType::BinaryStorage; snprintf(_Allowed->fieldname,255,"%s","gpoallowed"); _Allowed->datasize = sizeof(GpoData::Allow)+(sizeof(uuid_t)*allowed->count); _Allowed->data=new char [_Allowed->datasize]; memset(_Allowed->data,0,_Allowed->datasize); memcpy(_Allowed->data,allowed,sizeof(GpoData::Allow)); char *start =_Allowed->data+sizeof(GpoData::Allow); for(int i=0; i< allowed->count; ++i){ memcpy(start+(i*sizeof(uuid_t)),&allowed->uid[i],sizeof(uuid_t)); } setAuthData<Allow,uuid_t>(DataType::PolicyData,StorageType::BinaryStorage, this,&_Allowed,"groupmembers",allowed->uid,allowed->count); } Loading Loading
src/admin.cpp +2 −2 Changes for src/admin.cpp: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -1317,7 +1317,7 @@ namespace authdb { mrec = (GroupData::MemberUids *)cur.data; char *start=cur.data+sizeof(GroupData::MemberUids); char *start=cur.data+(sizeof(GroupData::MemberUids)-sizeof(uuid_t)); size_t urd=sizeof(AuthHeader),uend=backend->end(); while(urd<uend){ Loading @@ -1337,7 +1337,7 @@ namespace authdb { form << "<option value=\"" << cuuid << "\" "; for(size_t i=0; i<mrec->count; ++i ){ uuid_t *ucmp =(uuid_t*)start+i; uuid_t *ucmp =(uuid_t*)start+(i*sizeof(uuid_t)); if(uuid_compare(*ucmp,curu.uuid) == 0){ form << "selected"; break; Loading
src/gpo.cpp +2 −42 Changes for src/gpo.cpp: 2 added lines, 42 removed lines. Original line number Diff line number Diff line Loading @@ -61,48 +61,8 @@ bool authdb::GpoData::getGpoValue(){ } void authdb::GpoData::setAllowed(Allow *allowed){ AuthData *curec=this; uuid_t fuuid; uuid_copy(fuuid,Data.uuid); if(!_Allowed){ while(curec){ if(curec->Data.type == authdb::PolicyData && uuid_compare(curec->Data.uuid,Data.uuid)==0 && strcmp(curec->Data.fieldname,"gpoallowed")==0 ){ _Allowed=&curec->Data; _Allowed->datasize=0; delete[] _Allowed->data; _Allowed->data=nullptr; break; } curec=curec->next(); } } if(!_Allowed){ AuthData::Record rec; _Allowed=&append(rec).Data; } memset(_Allowed,0,sizeof(AuthData::Record)); _Allowed->start=0xFE; uuid_copy(_Allowed->uuid,fuuid); _Allowed->type=DataType::PolicyData; _Allowed->storage=StorageType::BinaryStorage; snprintf(_Allowed->fieldname,255,"%s","gpoallowed"); _Allowed->datasize = sizeof(GpoData::Allow)+(sizeof(uuid_t)*allowed->count); _Allowed->data=new char [_Allowed->datasize]; memset(_Allowed->data,0,_Allowed->datasize); memcpy(_Allowed->data,allowed,sizeof(GpoData::Allow)); char *start =_Allowed->data+sizeof(GpoData::Allow); for(int i=0; i< allowed->count; ++i){ memcpy(start+(i*sizeof(uuid_t)),&allowed->uid[i],sizeof(uuid_t)); } setAuthData<Allow,uuid_t>(DataType::PolicyData,StorageType::BinaryStorage, this,&_Allowed,"groupmembers",allowed->uid,allowed->count); } Loading