mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
Fixed up 'orrible formatting.
(This used to be commit 73addddb2e038946e38a6a15f46f61148a49ac08)
This commit is contained in:
parent
4da562d4dc
commit
6b60c28acc
@ -52,7 +52,8 @@ static void parse_domain_user(char *domuser, fstring domain, fstring user)
|
||||
|
||||
/* Call winbindd to convert a name to a sid */
|
||||
|
||||
BOOL winbind_lookup_name(const char *name, DOM_SID *sid, enum SID_NAME_USE *name_type)
|
||||
BOOL winbind_lookup_name(const char *name, DOM_SID *sid,
|
||||
enum SID_NAME_USE *name_type)
|
||||
{
|
||||
struct winbindd_request request;
|
||||
struct winbindd_response response;
|
||||
@ -79,7 +80,8 @@ BOOL winbind_lookup_name(const char *name, DOM_SID *sid, enum SID_NAME_USE *name
|
||||
|
||||
/* Call winbindd to convert sid to name */
|
||||
|
||||
BOOL winbind_lookup_sid(DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAME_USE *name_type)
|
||||
BOOL winbind_lookup_sid(DOM_SID *sid, fstring dom_name, fstring name,
|
||||
enum SID_NAME_USE *name_type)
|
||||
{
|
||||
struct winbindd_request request;
|
||||
struct winbindd_response response;
|
||||
@ -103,7 +105,9 @@ BOOL winbind_lookup_sid(DOM_SID *sid, fstring dom_name, fstring name, enum SID_N
|
||||
if (result == NSS_STATUS_SUCCESS) {
|
||||
parse_domain_user(response.data.name.name, dom_name, name);
|
||||
*name_type = (enum SID_NAME_USE)response.data.name.type;
|
||||
DEBUG(10,("winbind_lookup_sid: SUCCESS: SID %s -> %s %s\n", sid_str, dom_name, name ));
|
||||
|
||||
DEBUG(10, ("winbind_lookup_sid: SUCCESS: SID %s -> %s %s\n",
|
||||
sid_str, dom_name, name));
|
||||
}
|
||||
|
||||
return (result == NSS_STATUS_SUCCESS);
|
||||
@ -380,9 +384,7 @@ int winbind_getgroups(char *user, int size, gid_t *list)
|
||||
return result;
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
Utility function. Convert a uid_t to a name if possible.
|
||||
**********************************************************************************/
|
||||
/* Utility function. Convert a uid_t to a name if possible. */
|
||||
|
||||
BOOL winbind_uidtoname(fstring name, uid_t uid)
|
||||
{
|
||||
@ -399,13 +401,13 @@ BOOL winbind_uidtoname(fstring name, uid_t uid)
|
||||
if (name_type != SID_NAME_USER)
|
||||
return False;
|
||||
|
||||
slprintf(name, sizeof(fstring)-1, "%s%s%s", dom_name, lp_winbind_separator(), user_name );
|
||||
slprintf(name, sizeof(fstring)-1, "%s%s%s", dom_name,
|
||||
lp_winbind_separator(), user_name);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
Utility function. Convert a gid_t to a name if possible.
|
||||
**********************************************************************************/
|
||||
/* Utility function. Convert a gid_t to a name if possible. */
|
||||
|
||||
BOOL winbind_gidtoname(fstring name, gid_t gid)
|
||||
{
|
||||
@ -422,13 +424,13 @@ BOOL winbind_gidtoname(fstring name, gid_t gid)
|
||||
if (name_type != SID_NAME_USER)
|
||||
return False;
|
||||
|
||||
slprintf(name, sizeof(fstring)-1, "%s%s%s", dom_name, lp_winbind_separator(), group_name );
|
||||
slprintf(name, sizeof(fstring)-1, "%s%s%s", dom_name,
|
||||
lp_winbind_separator(), group_name);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
Utility function. Convert a name to a uid_t if possible.
|
||||
**********************************************************************************/
|
||||
/* Utility function. Convert a name to a uid_t if possible. */
|
||||
|
||||
BOOL winbind_nametouid(uid_t *puid, char *name)
|
||||
{
|
||||
@ -436,8 +438,8 @@ BOOL winbind_nametouid(uid_t *puid, char *name)
|
||||
enum SID_NAME_USE name_type;
|
||||
|
||||
if (!winbind_lookup_name(name, &sid, &name_type)) {
|
||||
return False;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
if (name_type != SID_NAME_USER)
|
||||
return False;
|
||||
@ -445,9 +447,7 @@ BOOL winbind_nametouid(uid_t *puid, char *name)
|
||||
return winbind_sid_to_uid(puid, &sid);
|
||||
}
|
||||
|
||||
/**********************************************************************************
|
||||
Utility function. Convert a name to a gid_t if possible.
|
||||
**********************************************************************************/
|
||||
/* Utility function. Convert a name to a gid_t if possible. */
|
||||
|
||||
BOOL winbind_nametogid(gid_t *pgid, char *gname)
|
||||
{
|
||||
@ -455,8 +455,8 @@ BOOL winbind_nametogid(gid_t *pgid, char *gname)
|
||||
enum SID_NAME_USE name_type;
|
||||
|
||||
if (!winbind_lookup_name(gname, &g_sid, &name_type)) {
|
||||
return False;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
if (name_type != SID_NAME_DOM_GRP)
|
||||
return False;
|
||||
|
Loading…
x
Reference in New Issue
Block a user