};
+typedef struct {
+ fstring smb_name; /* user name from the client */
+ fstring unix_name; /* unix user name of a validated user */
+ fstring real_name; /* to store real name from password file - simeon */
+ fstring domain; /* domain that the client specified */
+} userdom_struct;
+
typedef struct
{
uid_t uid; /* uid of a validated user */
gid_t gid; /* gid of a validated user */
- fstring requested_name; /* user name from the client */
- fstring name; /* unix user name of a validated user */
- fstring real_name; /* to store real name from password file - simeon */
+ userdom_struct user;
BOOL guest;
/* following groups stuff added by ih */
********************************************************************/
void standard_sub_vuser(char *str, user_struct *vuser)
{
- standard_sub_advanced(-1, vuser->name, "", -1, str);
+ standard_sub_advanced(-1, vuser->user.unix_name, "", -1, str);
}
/*******************************************************************
********************************************************************/
void standard_sub_vsnum(char *str, user_struct *vuser, int snum)
{
- standard_sub_advanced(snum, vuser->name, "", -1, str);
+ standard_sub_advanced(snum, vuser->user.unix_name, "", -1, str);
}
return True;
}
+#if defined(LARGE_SMB_OFF_T)
/****************************************************************************
Pathetically try and map a 64 bit lock offset into 31 bits. I hate Windows :-).
****************************************************************************/
-
static uint32 map_lock_offset(uint32 high, uint32 low)
{
unsigned int i;
return (high|low);
}
+#endif
/****************************************************************************
Actual function that does POSIX locks. Copes with 64 -> 32 bit cruft and
Globals.shmem_size = SHMEM_SIZE;
Globals.stat_cache_size = 50; /* Number of stat translations we'll keep */
Globals.announce_as = ANNOUNCE_AS_NT_SERVER;
- Globals.bUnixRealname = False;
+ Globals.bUnixRealname = True;
#if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT))
Globals.bNISHomeMap = False;
#ifdef WITH_NISPLUS_HOME
&dummy_time, /* pass_must_change_time */
nt_username , /* user_name */
- vuser->real_name, /* full_name */
+ vuser->user.real_name, /* full_name */
logon_script , /* logon_script */
profile_path , /* profile_path */
home_dir , /* home_dir */
ZERO_STRUCT(usr);
/* set up unix credentials from the smb side, to feed over the pipe */
- make_creds_unix(&usr.uxc, vuser->name, vuser->requested_name,
- vuser->real_name, vuser->guest);
+ make_creds_unix(&usr.uxc, vuser->user.unix_name, vuser->user.smb_name,
+ vuser->user.real_name, vuser->guest);
usr.ptr_uxc = 1;
make_creds_unix_sec(&usr.uxs, vuser->uid, vuser->gid,
vuser->n_groups, vuser->groups);
Don't depend on vuser being non-null !!. JRA */
user_struct *vuser = get_valid_user_struct(vuid);
if(vuser != NULL)
- DEBUG(3,(" Username of UID %d is %s\n", (int)vuser->uid, vuser->name));
+ DEBUG(3,(" Username of UID %d is %s\n", (int)vuser->uid,
+ vuser->user.unix_name));
*rparam_len = 6;
*rparam = REALLOC(*rparam,*rparam_len);
/* EEK! the cifsrap.txt doesn't have this in!!!! */
SIVAL(p,usri11_full_name,PTR_DIFF(p2,p)); /* full name */
- pstrcpy(p2,((vuser != NULL) ? vuser->real_name : UserName));
+ pstrcpy(p2,((vuser != NULL) ? vuser->user.real_name : UserName));
p2 = skip_string(p2,1);
}
{
SIVAL(p,60,0); /* auth_flags */
SIVAL(p,64,PTR_DIFF(p2,*rdata)); /* full_name */
- pstrcpy(p2,((vuser != NULL) ? vuser->real_name : UserName));
+ pstrcpy(p2,((vuser != NULL) ? vuser->user.real_name : UserName));
p2 = skip_string(p2,1);
SIVAL(p,68,0); /* urs_comment */
SIVAL(p,72,PTR_DIFF(p2,*rdata)); /* parms */
user_struct *vuser = get_valid_user_struct(vuid);
if (vuser == NULL)
return 0;
- return(vuser->name);
+ return(vuser->user.unix_name);
}
vuser->uid = uid;
vuser->gid = gid;
vuser->guest = guest;
- fstrcpy(vuser->name,unix_name);
- fstrcpy(vuser->requested_name,requested_name);
+ fstrcpy(vuser->user.unix_name,unix_name);
+ fstrcpy(vuser->user.smb_name,requested_name);
vuser->n_groups = 0;
vuser->groups = NULL;
DEBUG(3,("uid %d registered to name %s\n",(int)uid,unix_name));
DEBUG(3, ("Clearing default real name\n"));
- fstrcpy(vuser->real_name, "<Full Name>\0");
+ fstrcpy(vuser->user.real_name, "<Full Name>");
if (lp_unix_realname()) {
- if ((pwfile=sys_getpwnam(vuser->name))!= NULL)
+ if ((pwfile=sys_getpwnam(vuser->user.unix_name))!= NULL)
{
- DEBUG(3, ("User name: %s\tReal name: %s\n",vuser->name,pwfile->pw_gecos));
- fstrcpy(vuser->real_name, pwfile->pw_gecos);
+ DEBUG(3, ("User name: %s\tReal name: %s\n",vuser->user.unix_name,pwfile->pw_gecos));
+ fstrcpy(vuser->user.real_name, pwfile->pw_gecos);
}
}
/* check for a previously registered guest username */
if (!ok && (vuser != 0) && vuser->guest) {
- if (user_ok(vuser->name,snum) &&
- password_ok(vuser->name, password, pwlen, NULL)) {
- fstrcpy(user, vuser->name);
+ if (user_ok(vuser->user.unix_name,snum) &&
+ password_ok(vuser->user.unix_name, password, pwlen, NULL)) {
+ fstrcpy(user, vuser->user.unix_name);
vuser->guest = False;
DEBUG(3,("ACCEPTED: given password with registered user %s\n", user));
ok = True;
/* check for a previously validated username/password pair */
if (!ok && (!lp_revalidate(snum) || lp_security() > SEC_SHARE) &&
(vuser != 0) && !vuser->guest &&
- user_ok(vuser->name,snum)) {
- fstrcpy(user,vuser->name);
+ user_ok(vuser->user.unix_name,snum)) {
+ fstrcpy(user,vuser->user.unix_name);
*guest = False;
DEBUG(3,("ACCEPTED: validated uid ok as non-guest\n"));
ok = True;
if(session_tag != UID_FIELD_INVALID)
vuser = get_valid_user_struct(session_tag);
if(vuser != NULL)
- pstrcpy( sesssetup_user, vuser->requested_name);
+ pstrcpy( sesssetup_user, vuser->user.smb_name);
}
/* does this protocol need to be run as root? */
for (i=0;i<conn->uid_cache.entries;i++)
if (conn->uid_cache.list[i] == vuser->uid) return(True);
- if (!user_ok(vuser->name,snum)) return(False);
+ if (!user_ok(vuser->user.unix_name,snum)) return(False);
i = conn->uid_cache.entries % UID_CACHE_SIZE;
conn->uid_cache.list[i] = vuser->uid;