local.h: Kept FSTYPE_STRING as Samba for now.
nmbd_browsesync.c: Added bugfix from Matt Chapman mattyc@cyberdude.com
- lmb_browserlist is now a struct ubi_dlList not a
struct browse_cache_record *.
server.c:
smb.h:
uid.c:
password.c: Removed attrs code - it is not used anywhere.
Jeremy
/* what type of filesystem do we want this to show up as in a NT file
manager window? */
-#ifdef HAVE_NT_SMBS
-#define FSTYPE_STRING "NTFS"
-#else /* HAVE_NT_SMBS */
#define FSTYPE_STRING "Samba"
-#endif /* HAVE_NT_SMBS */
/* the default guest account - normally set in the Makefile or smb.conf */
#ifndef GUEST_ACCOUNT
void invalidate_vuid(uint16 vuid);
char *validated_username(uint16 vuid);
int setup_groups(char *user, int uid, int gid, int *p_ngroups,
- int **p_igroups, gid_t **p_groups,
- int **p_attrs);
+ int **p_igroups, gid_t **p_groups);
uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest);
void add_session_user(char *user);
BOOL update_smbpassword_file( char *user, fstring password);
int ngroups;
gid_t *groups;
int *igroups;
- int *attrs;
};
typedef struct
int ngroups;
gid_t *groups;
int *igroups; /* an integer version - some OSes are broken :-( */
- int *attrs;
time_t lastused;
BOOL used;
int n_groups;
gid_t *groups;
int *igroups; /* an integer version - some OSes are broken :-( */
- int *attrs; /* attributes associated with each gid */
int n_sids;
int *sids;
extern fstring global_myworkgroup;
/* This is our local master browser list database. */
-extern struct browse_cache_record *lmb_browserlist;
+extern struct ubi_dlList lmb_browserlist[];
static struct work_record *call_work;
static struct subnet_record *call_subrec;
grantpt(master);
unlockpt(master);
*slave = ptsname(master);
- return (master);
+ if(*slave == NULL) {
+ DEBUG(0,("findpty: Unable to create master/slave pty pair.\n"));
+ return -1;
+ } else {
+ DEBUG(10, ("findpty: Allocated slave pty %s\n", *slave));
+ return (master);
+ }
}
#else /* USE_GRANTPT */
fstrcpy( line, "/dev/ptyXX" );
#endif
}
+ DEBUG(10, ("Invoking '%s' as password change program.\n", passwordprogram));
+
/* execl() password-change application */
if (execl("/bin/sh","sh","-c",passwordprogram,NULL) < 0) {
DEBUG(3,("Bad status returned from %s\n",passwordprogram));
int master;
pid_t pid, wpid;
int wstat;
- BOOL chstat;
+ BOOL chstat = False;
/* allocate a pseudo-terminal device */
if ((master = findpty (&slavedev)) < 0) {
if ((chstat = talktochild(master, chatsequence)) == False) {
DEBUG(3,("Child failed to change password: %s\n",name));
kill(pid, SIGKILL); /* be sure to end this process */
- return(False);
}
if ((wpid = sys_waitpid(pid, &wstat, 0)) < 0) {
DEBUG(3,("The process is no longer waiting!\n\n"));
if(as_root)
unbecome_root(False);
}
- DEBUG(3,("Password change %ssuccessful for user %s\n", (chstat?"":"un"), name));
+
+ if(chstat)
+ DEBUG(3,("Password change %ssuccessful for user %s\n", (chstat?"":"un"), name));
return (chstat);
}
vuser->n_sids = 0;
- /* same number of igroups as groups as attrs */
+ /* same number of igroups as groups */
vuser->n_groups = 0;
if (vuser->groups && (vuser->groups != (gid_t *)vuser->igroups))
free(vuser->groups);
if (vuser->igroups) free(vuser->igroups);
- if (vuser->attrs ) free(vuser->attrs);
if (vuser->sids ) free(vuser->sids);
- vuser->attrs = NULL;
vuser->sids = NULL;
vuser->igroups = NULL;
vuser->groups = NULL;
Setup the groups a user belongs to.
****************************************************************************/
int setup_groups(char *user, int uid, int gid, int *p_ngroups,
- int **p_igroups, gid_t **p_groups,
- int **p_attrs)
+ int **p_igroups, gid_t **p_groups)
{
if (-1 == initgroups(user,gid))
{
{
int i,ngroups;
int *igroups;
- int *attrs;
gid_t grp = 0;
ngroups = getgroups(0,&grp);
if (ngroups <= 0)
ngroups = 32;
igroups = (int *)malloc(sizeof(int)*ngroups);
- attrs = (int *)malloc(sizeof(int)*ngroups);
for (i=0;i<ngroups;i++)
- {
- attrs [i] = 0x7; /* XXXX don't know what NT user attributes are yet! */
igroups[i] = 0x42424242;
- }
ngroups = getgroups(ngroups,(gid_t *)igroups);
if (igroups[0] == 0x42424242)
ngroups = 0;
*p_ngroups = ngroups;
- *p_attrs = attrs;
/* The following bit of code is very strange. It is due to the
fact that some OSes use int* and some use gid_t* for
vuser->n_groups = 0;
vuser->groups = NULL;
vuser->igroups = NULL;
- vuser->attrs = NULL;
/* Find all the groups this uid is in and store them.
Used by become_user() */
setup_groups(unix_name,uid,gid,
&vuser->n_groups,
&vuser->igroups,
- &vuser->groups,
- &vuser->attrs);
+ &vuser->groups);
DEBUG(3,("uid %d registered to name %s\n",uid,unix_name));
pcon->ngroups = 0;
pcon->igroups = NULL;
pcon->groups = NULL;
- pcon->attrs = NULL;
if (!IS_IPC(cnum))
{
/* Find all the groups this uid is in and store them. Used by become_user() */
setup_groups(pcon->user,pcon->uid,pcon->gid,
- &pcon->ngroups,&pcon->igroups,&pcon->groups,&pcon->attrs);
+ &pcon->ngroups,&pcon->igroups,&pcon->groups);
/* check number of connections */
if (!claim_connection(cnum,
int reply_nt1(char *outbuf)
{
/* dual names + lock_and_read + nt SMBs + remote API calls */
- int capabilities = CAP_NT_FIND|CAP_LOCK_AND_READ|CAP_RPC_REMOTE_APIS
-#ifdef HAVE_NT_SMBS
- |CAP_NT_SMBS
-#endif /* HAVE_NT_SMBS */
- ;
+ int capabilities = CAP_NT_FIND|CAP_LOCK_AND_READ|CAP_RPC_REMOTE_APIS |CAP_NT_SMBS;
/*
other valid capabilities which we may support at some time...
{SMBtrans2, "SMBtrans2", reply_trans2, AS_USER },
{SMBtranss2, "SMBtranss2", reply_transs2, AS_USER},
-#ifdef HAVE_NT_SMBS
/* NT PROTOCOL FOLLOWS */
{SMBntcreateX, "SMBntcreateX", reply_ntcreate_and_X, AS_USER | CAN_IPC | QUEUE_IN_OPLOCK },
{SMBnttrans, "SMBnttrans", reply_nttrans, AS_USER | CAN_IPC },
{SMBnttranss, "SMBnttranss", reply_nttranss, AS_USER | CAN_IPC },
{SMBntcancel, "SMBntcancel", reply_ntcancel, AS_USER },
-#endif /* HAVE_NT_SMBS */
/* messaging routines */
{SMBsends,"SMBsends",reply_sends,AS_GUEST},
current_user.groups = conn->groups;
current_user.igroups = conn->igroups;
current_user.ngroups = conn->ngroups;
- current_user.attrs = conn->attrs;
}
else
{
current_user.ngroups = vuser->n_groups;
current_user.groups = vuser->groups;
current_user.igroups = vuser->igroups;
- current_user.attrs = vuser->attrs;
}
if (initial_uid == 0)