Commit 06b3cd90 authored by jan.koester's avatar jan.koester
Browse files

fixed gpo

parent 024df2e6
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for src/authdb.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ namespace authdb {
        }

        target->start=0xFE;
        gid=target->ruid;
        std::copy(&gid.value[0],&gid.value[sizeof(uuid_t)],&target->ruid[0]);
        target->type=type;
        target->storage=storage;
        memset(target->fieldname,0,255);
+8 −16
Changes for src/gpo.cpp: 8 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -61,12 +61,12 @@ bool authdb::GpoData::getGpoValue(){
void authdb::GpoData::setAllowed(const std::vector<uuid> &allowed){
    size_t csize=allowed.size();

    char *data=new  char[(csize*sizeof(uuid_t))+sizeof(size_t)];
    memset(data,0,(csize*sizeof(uuid_t))+sizeof(size_t));
    csize*=sizeof(uuid_t);

    std::copy(&csize,&csize+sizeof(size_t),data);
    char *data=new  char[csize];
    memset(data,0,csize);

    csize=sizeof(size_t);
    csize=0;

    for(const uuid &al : allowed){
        std::copy(
@@ -92,19 +92,11 @@ void authdb::GpoData::getAlowed(std::vector<uuid> &allowed){
    }
    size_t asize=0;

    std::copy(_Allowed->data,_Allowed->data+sizeof(size_t),&asize);

    if(asize==0)
        return;

    asize*=sizeof(uuid_t);

    char *start=_Allowed->data+sizeof(size_t);

    for(size_t i =0; i<asize; i+=sizeof(uuid_t) ){
        uuid tmp;
        std::copy(start+i,start+i+sizeof(uuid_t),&tmp.value[0]);
        allowed.push_back(tmp);
    for(size_t i =0; i<_Allowed->datasize; i+=sizeof(uuid_t) ){
        uuid_t tmp;
        std::copy(_Allowed->data+i,_Allowed->data+i+sizeof(uuid_t),&tmp[0]);
        allowed.emplace_back(tmp);
    }
}