summaryrefslogtreecommitdiffstats
path: root/sandbox/src/sid.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 20:49:23 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 20:49:23 +0000
commite628fde3462899ba06af2fbc5285563c456ed5c4 (patch)
treee3ed3eb98c0044b055606bdf8628191b9b99c17c /sandbox/src/sid.cc
parent23d6315575647756c4be985b895ec2c447e2f088 (diff)
downloadchromium_src-e628fde3462899ba06af2fbc5285563c456ed5c4.zip
chromium_src-e628fde3462899ba06af2fbc5285563c456ed5c4.tar.gz
chromium_src-e628fde3462899ba06af2fbc5285563c456ed5c4.tar.bz2
Emergency revert; rietveld broke; tree broke
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/sid.cc')
-rw-r--r--sandbox/src/sid.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/sandbox/src/sid.cc b/sandbox/src/sid.cc
new file mode 100644
index 0000000..6ed9963
--- /dev/null
+++ b/sandbox/src/sid.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sandbox/src/sid.h"
+
+#include "base/logging.h"
+
+namespace sandbox {
+
+Sid::Sid(const SID *sid) {
+ ::CopySid(SECURITY_MAX_SID_SIZE, sid_, const_cast<SID*>(sid));
+};
+
+Sid::Sid(WELL_KNOWN_SID_TYPE type) {
+ DWORD size_sid = SECURITY_MAX_SID_SIZE;
+ BOOL result = ::CreateWellKnownSid(type, NULL, sid_, &size_sid);
+ DCHECK(result);
+ DBG_UNREFERENCED_LOCAL_VARIABLE(result);
+}
+
+const SID *Sid::GetPSID() const {
+ return reinterpret_cast<SID*>(const_cast<BYTE*>(sid_));
+}
+
+} // namespace sandbox