/*
SSSD
Authors:
Yassir Elley <yelley@redhat.com>
Copyright (C) 2014 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This file contains a copy of samba's ndr_pull_* functions needed
* to parse a security_descriptor. We are copying them here so that we don't
* have to link against libsamba-security, which is a private samba library
* These functions are taken from:
*/
#include <ndr.h>
#include <gen_ndr/security.h>
static enum ndr_err_code
int ndr_flags,
struct GUID *r)
{
if (ndr_flags & NDR_SCALARS) {
size_clock_seq_0 = 2;
r->clock_seq,
size_node_0 = 6;
}
if (ndr_flags & NDR_BUFFERS) {
}
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
uint8_t *r)
{
uint8_t v;
*r = v;
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
enum security_ace_type *r)
{
uint8_t v;
*r = v;
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
uint32_t *r)
{
uint32_t v;
*r = v;
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
union security_ace_object_type *r)
{
if (ndr_flags & NDR_SCALARS) {
switch (level) {
case SEC_ACE_OBJECT_TYPE_PRESENT: {
break; }
default: {
break; }
}
}
if (ndr_flags & NDR_BUFFERS) {
switch (level) {
break;
default:
break;
}
}
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
union security_ace_object_inherited_type *r)
{
if (ndr_flags & NDR_SCALARS) {
switch (level) {
&r->inherited_type));
break; }
default: {
break; }
}
}
if (ndr_flags & NDR_BUFFERS) {
switch (level) {
break;
default:
break;
}
}
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
struct security_ace_object *r)
{
if (ndr_flags & NDR_SCALARS) {
(ndr,
&r->inherited_type,
}
if (ndr_flags & NDR_BUFFERS) {
}
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
union security_ace_object_ctr *r)
{
if (ndr_flags & NDR_SCALARS) {
switch (level) {
break; }
break; }
case SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT: {
break; }
case SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT: {
break; }
default: {
break; }
}
}
if (ndr_flags & NDR_BUFFERS) {
switch (level) {
break;
break;
break;
break;
default:
break;
}
}
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
struct dom_sid *r)
{
if (ndr_flags & NDR_SCALARS) {
}
ZERO_STRUCT(r->sub_auths);
for (cntr_sub_auths_0 = 0;
cntr_sub_auths_0 < r->num_auths;
cntr_sub_auths_0++) {
}
}
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
struct security_ace *r)
{
if (ndr_flags & NDR_SCALARS) {
"ndr_pull_security_ace: r->size %u < size %u",
}
}
if (ndr_flags & NDR_BUFFERS) {
}
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
enum security_acl_revision *r)
{
uint16_t v;
*r = v;
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
struct security_acl *r)
{
if (ndr_flags & NDR_SCALARS) {
if (r->num_aces > 1000) {
}
size_aces_0 = r->num_aces;
}
}
if (ndr_flags & NDR_BUFFERS) {
size_aces_0 = r->num_aces;
}
}
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
enum security_descriptor_revision *r)
{
uint8_t v;
*r = v;
return NDR_ERR_SUCCESS;
}
static enum ndr_err_code
int ndr_flags,
uint16_t *r)
{
uint16_t v;
*r = v;
return NDR_ERR_SUCCESS;
}
enum ndr_err_code
int ndr_flags,
struct security_descriptor *r)
{
if (ndr_flags & NDR_SCALARS) {
&r->revision));
&r->type));
if (_ptr_owner_sid) {
r->owner_sid,
} else {
}
if (_ptr_group_sid) {
r->group_sid,
} else {
}
if (_ptr_sacl) {
} else {
}
if (_ptr_dacl) {
} else {
}
}
if (ndr_flags & NDR_BUFFERS) {
if (r->owner_sid) {
}
}
if (r->group_sid) {
}
}
if (r->sacl) {
r->sacl));
}
}
if (r->dacl) {
r->dacl));
}
}
}
return NDR_ERR_SUCCESS;
}