changed function name of get_home_dir() to get_unixhome_dir(), to stop
authorLuke Leighton <lkcl@samba.org>
Sun, 12 Dec 1999 21:00:35 +0000 (21:00 +0000)
committerLuke Leighton <lkcl@samba.org>
Sun, 12 Dec 1999 21:00:35 +0000 (21:00 +0000)
clash with gnu readline library.

fixed issue with [homes] service not being there - call lp_add_home()
just before starting the msrpc processing.
(This used to be commit 054195df9b6187c663ede5cf4489499abbdc29fc)

source3/include/proto.h
source3/lib/username.c
source3/lib/util.c
source3/msrpc/msrpcd.c
source3/msrpc/msrpcd_process.c
source3/param/loadparm.c
source3/smbd/password.c
source3/smbd/reply.c
source3/smbd/service.c

index 4ac79a02fdb5a76fd1978928b93ba5279f5fe6f0..3c37085160305fa140ac3813caf6baef0485b128 100644 (file)
@@ -437,7 +437,7 @@ char *ufc_crypt(char *key,char *salt);
 
 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);
@@ -2022,6 +2022,10 @@ BOOL cli_net_sam_sync( const char* srv_name, const char* myhostname,
                                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,
@@ -4566,6 +4570,10 @@ BOOL reload_services(BOOL test);
 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);
index 9f51d066424ab95a5205bf4e7a1129e94d0da013..23bdb54faf29a4479068caf9e678723d0e95e1bc 100644 (file)
@@ -302,7 +302,7 @@ char *uidtoname(uid_t uid)
 /****************************************************************************
 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;
@@ -312,7 +312,7 @@ char *get_home_dir(char *user)
        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;
 }
 
index 7d099282f8402b8c1560cd33b6c87841c53f1fed..25769298be446b917e35c9211c94aa26b55c63b9 100644 (file)
@@ -2091,8 +2091,8 @@ static char *automount_path(char *user_name)
 
        /* 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))
 
@@ -2221,7 +2221,7 @@ void standard_sub(connection_struct *conn,char *str)
                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;
index 942d6f1258a9c9f45611df22e794c587bc1512ed..d6ae3ca642d0562c7c79f946a54883666c44eb80 100644 (file)
@@ -558,7 +558,7 @@ int msrpc_main(int argc,char *argv[])
        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)
index 240087be14d790ff1717fe7645b383f41986949b..35a28d105a21cffa183274327809932199a010b7 100644 (file)
@@ -355,6 +355,7 @@ BOOL msrpcd_init(int c, pipes_struct *p)
 {
        struct user_creds usr;
        gid_t *groups = NULL;
+       char *user;
 
        if (!get_user_creds(c, &usr))
        {
@@ -405,6 +406,19 @@ BOOL msrpcd_init(int c, pipes_struct *p)
 
        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;
 }
 
index b7aef210138ce3fd4a9b4efab25486f72d34bb3e..82755d05a30d11c155a2bdf9c006f386e5084aa4 100644 (file)
@@ -2559,7 +2559,7 @@ static void lp_add_auto_services(char *str)
        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;
                
index fa46a74c14b8727076f385de216c5ed64da16daf..e15e08a1af106e3be11a2a32a517c547a4e698a3 100644 (file)
@@ -470,7 +470,7 @@ BOOL check_hosts_equiv(char *user)
   
   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);
index 10146c1287c4507ef88456483ea095996c226839..fed82b5e545bd2c68d6f34d0b2613631e9d8e320 100644 (file)
@@ -765,7 +765,7 @@ user %s attempted down-level SMB connection\n", user));
       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;
index f0af82fb4e1499df7a7d1fd6037436107d62e504..64abf3de1dd2b4bb823ae61b88b0e28d4b064097 100644 (file)
@@ -91,7 +91,7 @@ int find_service(char *service)
    /* 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)
@@ -101,7 +101,7 @@ int find_service(char *service)
          * 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,