mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
Formatting tidyups to match the rest of the source.
Jeremy.
(This used to be commit 86c5ebcf8f
)
This commit is contained in:
parent
9ec9df5fe4
commit
5b4a2dfd2b
@ -29,10 +29,11 @@ static int next_vuid = VUID_OFFSET;
|
|||||||
static int num_validated_vuids;
|
static int num_validated_vuids;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
check if a uid has been validated, and return an pointer to the user_struct
|
Check if a uid has been validated, and return an pointer to the user_struct
|
||||||
if it has. NULL if not. vuid is biased by an offset. This allows us to
|
if it has. NULL if not. vuid is biased by an offset. This allows us to
|
||||||
tell random client vuid's (normally zero) from valid vuids.
|
tell random client vuid's (normally zero) from valid vuids.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
user_struct *get_valid_user_struct(uint16 vuid)
|
user_struct *get_valid_user_struct(uint16 vuid)
|
||||||
{
|
{
|
||||||
user_struct *usp;
|
user_struct *usp;
|
||||||
@ -54,8 +55,9 @@ user_struct *get_valid_user_struct(uint16 vuid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
invalidate a uid
|
Invalidate a uid.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void invalidate_vuid(uint16 vuid)
|
void invalidate_vuid(uint16 vuid)
|
||||||
{
|
{
|
||||||
user_struct *vuser = get_valid_user_struct(vuid);
|
user_struct *vuser = get_valid_user_struct(vuid);
|
||||||
@ -85,8 +87,9 @@ void invalidate_vuid(uint16 vuid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
invalidate all vuid entries for this process
|
Invalidate all vuid entries for this process.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void invalidate_all_vuids(void)
|
void invalidate_all_vuids(void)
|
||||||
{
|
{
|
||||||
user_struct *usp, *next=NULL;
|
user_struct *usp, *next=NULL;
|
||||||
@ -238,38 +241,44 @@ int register_vuid(auth_serversupplied_info *server_info, const char *smb_name)
|
|||||||
vuser->homes_snum = -1;
|
vuser->homes_snum = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* JRATEST. */
|
||||||
|
if (lp_server_signing() && !vuser->guest && !srv_signing_active()) {
|
||||||
|
/* Try and turn on server signing on the first non-guest sessionsetup. */
|
||||||
|
srv_set_signing(session_key.data, nt_response);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return vuser->vuid;
|
return vuser->vuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
add a name to the session users list
|
Add a name to the session users list.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void add_session_user(const char *user)
|
void add_session_user(const char *user)
|
||||||
{
|
{
|
||||||
fstring suser;
|
fstring suser;
|
||||||
struct passwd *passwd;
|
struct passwd *passwd;
|
||||||
|
|
||||||
if (!(passwd = Get_Pwnam(user))) return;
|
if (!(passwd = Get_Pwnam(user)))
|
||||||
|
return;
|
||||||
|
|
||||||
fstrcpy(suser,passwd->pw_name);
|
fstrcpy(suser,passwd->pw_name);
|
||||||
|
|
||||||
if (suser && *suser && !in_list(suser,session_users,False))
|
if (suser && *suser && !in_list(suser,session_users,False)) {
|
||||||
{
|
if (strlen(suser) + strlen(session_users) + 2 >= sizeof(pstring)) {
|
||||||
if (strlen(suser) + strlen(session_users) + 2 >= sizeof(pstring))
|
DEBUG(1,("Too many session users??\n"));
|
||||||
DEBUG(1,("Too many session users??\n"));
|
} else {
|
||||||
else
|
pstrcat(session_users," ");
|
||||||
{
|
pstrcat(session_users,suser);
|
||||||
pstrcat(session_users," ");
|
}
|
||||||
pstrcat(session_users,suser);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
check if a username is valid
|
Check if a username is valid.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
BOOL user_ok(const char *user,int snum, gid_t *groups, size_t n_groups)
|
BOOL user_ok(const char *user,int snum, gid_t *groups, size_t n_groups)
|
||||||
{
|
{
|
||||||
char **valid, **invalid;
|
char **valid, **invalid;
|
||||||
@ -308,8 +317,9 @@ BOOL user_ok(const char *user,int snum, gid_t *groups, size_t n_groups)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
validate a group username entry. Return the username or NULL
|
Validate a group username entry. Return the username or NULL.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static char *validate_group(char *group, DATA_BLOB password,int snum)
|
static char *validate_group(char *group, DATA_BLOB password,int snum)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_NETGROUP
|
#ifdef HAVE_NETGROUP
|
||||||
|
Loading…
Reference in New Issue
Block a user