mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
added "domain groups" parameter, allowing you to specify the groups that
the user belongs to. it would be nice to know exactly what the domain groups _are_....
This commit is contained in:
@ -165,6 +165,7 @@ char *lp_nis_home_map_name(void);
|
||||
char *lp_announce_version(void);
|
||||
char *lp_netbios_aliases(void);
|
||||
char *lp_domainsid(void);
|
||||
char *lp_domain_groups(void);
|
||||
BOOL lp_dns_proxy(void);
|
||||
BOOL lp_wins_support(void);
|
||||
BOOL lp_wins_proxy(void);
|
||||
@ -1090,7 +1091,7 @@ BOOL zero_ip(struct in_addr ip);
|
||||
void reset_globals_after_fork();
|
||||
char *client_name(void);
|
||||
char *client_addr(void);
|
||||
char *automount_server(char *username);
|
||||
char *automount_server(char *user_name);
|
||||
void standard_sub_basic(char *str);
|
||||
BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
|
||||
int PutUniCode(char *dst,char *src);
|
||||
@ -1122,3 +1123,4 @@ char *align2(char *q, char *base);
|
||||
char *align_offset(char *q, char *base, int align_offset_len);
|
||||
void dump_data(int level,char *buf1,int len);
|
||||
char *tab_depth(int depth);
|
||||
int make_domain_gids(char *gids_str, DOM_GID *gids);
|
||||
|
@ -4508,3 +4508,31 @@ char *tab_depth(int depth)
|
||||
spaces[depth * 4] = 0;
|
||||
return spaces;
|
||||
}
|
||||
|
||||
int make_domain_gids(char *gids_str, DOM_GID *gids)
|
||||
{
|
||||
char *ptr;
|
||||
pstring s2;
|
||||
int count;
|
||||
|
||||
DEBUG(4,("make_domain_gids: %s\n", gids_str));
|
||||
|
||||
if (gids_str == NULL || *gids_str == 0) return 0;
|
||||
|
||||
for (count = 0, ptr = gids_str; next_token(&ptr, s2, NULL) && count < LSA_MAX_GROUPS; count++)
|
||||
{
|
||||
/* the entries are of the form GID/ATTR, ATTR being optional.*/
|
||||
char *attr;
|
||||
|
||||
attr = strchr(s2,'/');
|
||||
if (attr) *attr++ = 0;
|
||||
if (!attr || !*attr) attr = "7"; /* default value for attribute is 7 */
|
||||
|
||||
gids[count].gid = atoi(s2);
|
||||
gids[count].attr = atoi(attr);
|
||||
|
||||
DEBUG(5,("group id: %d attr: %d\n", gids[count].gid, gids[count].attr));
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -143,6 +143,7 @@ typedef struct
|
||||
char *szAnnounceVersion; /* This is initialised in init_globals */
|
||||
char *szNetbiosAliases;
|
||||
char *szDomainSID;
|
||||
char *szDomainGroups;
|
||||
int max_log_size;
|
||||
int mangled_stack;
|
||||
int max_xmit;
|
||||
@ -442,6 +443,7 @@ struct parm_struct
|
||||
{"valid chars", P_STRING, P_GLOBAL, &Globals.szValidChars, handle_valid_chars},
|
||||
{"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL},
|
||||
{"domain sid", P_USTRING, P_GLOBAL, &Globals.szDomainSID, NULL},
|
||||
{"domain groups", P_USTRING, P_GLOBAL, &Globals.szDomainGroups, NULL},
|
||||
{"domain controller",P_STRING, P_GLOBAL, &Globals.szDomainController,NULL},
|
||||
{"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL},
|
||||
{"character set", P_STRING, P_GLOBAL, &Globals.szCharacterSet, handle_character_set},
|
||||
@ -629,6 +631,7 @@ static void init_globals(void)
|
||||
/* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */
|
||||
string_set(&Globals.szLogonHome, "\\\\%N\\%U");
|
||||
string_set(&Globals.szLogonPath, "\\\\%N\\%U\\profile");
|
||||
string_set(&Globals.szDomainGroups, "776/7");
|
||||
Globals.bLoadPrinters = True;
|
||||
Globals.bUseRhosts = False;
|
||||
Globals.max_packet = 65535;
|
||||
@ -858,6 +861,7 @@ FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion)
|
||||
FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases)
|
||||
|
||||
FN_GLOBAL_STRING(lp_domainsid,&Globals.szDomainSID)
|
||||
FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups)
|
||||
|
||||
FN_GLOBAL_BOOL(lp_dns_proxy,&Globals.bDNSproxy)
|
||||
FN_GLOBAL_BOOL(lp_wins_support,&Globals.bWINSsupport)
|
||||
|
@ -499,6 +499,8 @@ static void api_lsa_sam_logon( user_struct *vuser,
|
||||
|
||||
if (vuser != NULL)
|
||||
{
|
||||
DOM_GID gids[LSA_MAX_GROUPS];
|
||||
int num_gids;
|
||||
NTTIME dummy_time;
|
||||
pstring logon_script;
|
||||
pstring profile_path;
|
||||
@ -527,6 +529,8 @@ static void api_lsa_sam_logon( user_struct *vuser,
|
||||
pstrcpy(home_drive , lp_logon_drive ());
|
||||
pstrcpy(home_dir , lp_logon_home ());
|
||||
|
||||
num_gids = make_domain_gids(lp_domain_groups(), gids);
|
||||
|
||||
sam_logon_in_ssb = False;
|
||||
|
||||
pstrcpy(my_name , myname );
|
||||
@ -553,8 +557,8 @@ static void api_lsa_sam_logon( user_struct *vuser,
|
||||
|
||||
vuser->uid, /* uint32 user_id */
|
||||
vuser->gid, /* uint32 group_id */
|
||||
0, /* uint32 num_groups */
|
||||
NULL, /* DOM_GID *gids */
|
||||
num_gids, /* uint32 num_groups */
|
||||
gids, /* DOM_GID *gids */
|
||||
0x20, /* uint32 user_flgs */
|
||||
|
||||
NULL, /* char sess_key[16] */
|
||||
|
Reference in New Issue
Block a user