Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formating ObjectSid #220

Open
thdq opened this issue Jun 1, 2020 · 0 comments
Open

Formating ObjectSid #220

thdq opened this issue Jun 1, 2020 · 0 comments

Comments

@thdq
Copy link

thdq commented Jun 1, 2020

Hi, i'm trying read the ObjectSid in string format (Ex: S-1-X-XX-XXXXX...), I can get objectSid in two formats, Array buffer or wrong string, same bellow:

Buffer:

"objectSid": {
    "type": "Buffer",
    "data": [
      1,
      5,
      0,
      0,
      0,
      0,
      0,
      5,
      21,
      0,
      0,
      0,
      119,
      239,
      79,
      55,
      6,
      72,
      69,
      193,
      225,
      119,
      32,
      23,
      173,
      187,
      0,
      0
    ]
  }, 

String (?):

 "objectSid": "\u0001\u0005\u0000\u0000\u0000\u0000\u0000\u0005\u0015\u0000\u0000\u0000w�O7\u0006HE��w \u0017xC\u0000\u0000", 

My method entryParser from Active Directory instance is like this:

entryParser(entry, raw, callback) {
      
        if (raw.hasOwnProperty("objectSid")) { 

          // for wrong string: entry.objectSid = entry.objectSid
          entry.objectSid = raw.objectSid;
        }

        callback(entry);
      },

How I can format the ArrayBuffer from readble string as "S-1-X-XX..." format?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant