struct passwd *hashed_getpwnam(const char *name);
char *uidtoname(uid_t uid);
-char *get_home_dir(char *user);
+char *get_unixhome_dir(char *user);
BOOL map_username(char *user);
const struct passwd *Get_Pwnam(char *user,BOOL allow_change);
BOOL user_ok(char *user,int snum);
SAM_DELTA_HDR *hdr_deltas,
SAM_DELTA_CTR *deltas);
+/*The following definitions come from rpc_client/cli_netlogon_sync.c */
+
+BOOL synchronise_passdb(void);
+
/*The following definitions come from rpc_client/cli_pipe.c */
BOOL create_rpc_bind_resp(struct pwd_info *pwd,
void msrpc_service_init(void);
BOOL reload_services(BOOL test);
+/*The following definitions come from utils/smbpasswd.c */
+
+int main(int argc, char **argv);
+
/*The following definitions come from web/cgi.c */
void cgi_load_variables(FILE *f1);
/****************************************************************************
get a users home directory.
****************************************************************************/
-char *get_home_dir(char *user)
+char *get_unixhome_dir(char *user)
{
const struct passwd *pass;
static pstring home_dir;
if (pass == NULL || pass->pw_dir == NULL) return(NULL);
pstrcpy(home_dir, pass->pw_dir);
- DEBUG(10,("get_home_dir: returning %s for user %s\n", home_dir, user));
+ DEBUG(10,("get_smbhome_dir: returning %s for user %s\n", home_dir, user));
return home_dir;
}
/* use the passwd entry as the default */
/* this will be the default if WITH_AUTOMOUNT is not used or fails */
- /* pstrcpy() copes with get_home_dir() returning NULL */
- pstrcpy(server_path, get_home_dir(user_name));
+ /* pstrcpy() copes with get_unixhome_dir() returning NULL */
+ pstrcpy(server_path, get_unixhome_dir(user_name));
#if (defined(HAVE_NETGROUP) && defined (WITH_AUTOMOUNT))
switch (*(p+1))
{
case 'H':
- if ((home = get_home_dir(conn->user)) != NULL) {
+ if ((home = get_unixhome_dir(conn->user)) != NULL) {
string_sub(p,"%H",home);
} else {
p += 2;
fstrcpy(static_pipe.name, pipe_name);
if (msrpcd_init(ClientMSRPC, &static_pipe))
{
- reload_services(False);
+ reload_services(True);
msrpcd_process(ClientMSRPC, &static_pipe);
}
if (ClientMSRPC != -1)
{
struct user_creds usr;
gid_t *groups = NULL;
+ char *user;
if (!get_user_creds(c, &usr))
{
ZERO_STRUCTP(p->l);
+ user = usr.uxc.user_name;
+ if (!strequal(user,lp_guestaccount(-1)) &&
+ lp_servicenumber(user) < 0)
+ {
+ int homes = lp_servicenumber(HOMES_NAME);
+ char *home = get_unixhome_dir(user);
+ if (homes >= 0 && home)
+ {
+ pstring home_dir;
+ fstrcpy(home_dir, home);
+ lp_add_home(user,homes,home_dir);
+ }
+ }
return True;
}
homes = lp_servicenumber(HOMES_NAME);
for (p=strtok(s,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) {
- char *home = get_home_dir(p);
+ char *home = get_unixhome_dir(p);
if (lp_servicenumber(p) >= 0) continue;
if (lp_use_rhosts())
{
- char *home = get_home_dir(user);
+ char *home = get_unixhome_dir(user);
if (home) {
extern int Client;
slprintf(rhostsfile, sizeof(rhostsfile)-1, "%s/.rhosts", home);
lp_servicenumber(user) < 0)
{
int homes = lp_servicenumber(HOMES_NAME);
- char *home = get_home_dir(user);
+ char *home = get_unixhome_dir(user);
if (homes >= 0 && home)
{
pstring home_dir;
/* now handle the special case of a home directory */
if (iService < 0)
{
- char *phome_dir = get_home_dir(service);
+ char *phome_dir = get_unixhome_dir(service);
pstring home_dir;
if(phome_dir == NULL)
* be a Windows to unix mapped user name.
*/
if(map_username(service))
- phome_dir = get_home_dir(service);
+ phome_dir = get_unixhome_dir(service);
}
DEBUG(3,("checking for home directory %s gave %s\n",service,