well_known_sids.c revision de38d860e39585486e3ccbb42555196e319c7efd
/*
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2013 Red Hat
Translate well-known SIDs to domains and names
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/>.
*/
#include "util/strtonum.h"
/* Well-Known SIDs are documented in section 2.4.2.4 "Well-Known SID
* Structures" of the "[MS-DTYP]: Windows Data Types" document. */
#define DOM_SID_PREFIX "S-1-5-21-"
#define BUILTIN_SID_PREFIX "S-1-5-32-"
#define BUILTIN_DOM_NAME "BUILTIN"
#define NT_SID_PREFIX "S-1-5-"
#define NT_DOM_NAME "NT AUTHORITY"
#define SPECIAL_SID_PREFIX "S-1-"
#define NULL_DOM_NAME "NULL AUTHORITY"
#define WORLD_DOM_NAME "WORLD AUTHORITY"
#define LOCAL_DOM_NAME "LOCAL AUTHORITY"
#define CREATOR_DOM_NAME "CREATOR AUTHORITY"
struct rid_sid_name {
const char *sid;
const char *name;
};
struct special_map {
const char id_auth;
char rid;
const char *sid;
const char *dom;
const char *name;
};
struct rid_sid_name builtin_map[] = {
};
struct rid_sid_name nt_map[] = {
};
/* The code to handle the SIDs of the Null, World, Local and Creator
* Authorities (id_auth=0,1,2,3 respectively) is optimized to handle only
* single digit id_auth and rid. */
struct special_map sp_map[] = {
};
const char **name)
{
size_t c;
return EINVAL;
}
return EOK;
}
}
return EINVAL;
}
const char **sid)
{
size_t c;
return EOK;
}
}
return EINVAL;
}
struct rid_sid_name *map,
const char **name)
{
char *endptr;
size_t c;
errno = 0;
return EINVAL;
}
return EOK;
}
}
return EINVAL;
}
struct rid_sid_name *map,
const char **sid)
{
size_t c;
return EOK;
}
}
return EINVAL;
}
const char **name)
{
}
{
}
const char **name)
{
}
{
}
const char **name)
{
int ret;
return EINVAL;
}
}
}
}
} else {
}
return ret;
}
const char **sid)
{
int ret;
return EINVAL;
}
}
}
}
} else {
}
return ret;
}