Ignore:
Timestamp:
Mar 1, 2010, 3:05:48 PM (15 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3.x to 3.3.11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/smbd/service.c

    r338 r411  
    725725        int ret;
    726726        char addr[INET6_ADDRSTRLEN];
    727         bool on_err_call_dis_hook = false;
    728727        NTSTATUS status;
    729728
     
    926925        }
    927926
    928         /*
    929          * If widelinks are disallowed we need to canonicalise the connect
    930          * path here to ensure we don't have any symlinks in the
    931          * connectpath. We will be checking all paths on this connection are
    932          * below this directory. We must do this after the VFS init as we
    933          * depend on the realpath() pointer in the vfs table. JRA.
    934          */
    935         if (!lp_widelinks(snum)) {
    936                 if (!canonicalize_connect_path(conn)) {
    937                         DEBUG(0, ("canonicalize_connect_path failed "
    938                         "for service %s, path %s\n",
    939                                 lp_servicename(snum),
    940                                 conn->connectpath));
    941                         conn_free(conn);
    942                         *pstatus = NT_STATUS_BAD_NETWORK_NAME;
    943                         return NULL;
    944                 }
    945         }
    946 
    947927        if ((!conn->printer) && (!conn->ipc)) {
    948928                conn->notify_ctx = notify_init(conn, server_id_self(),
     
    952932        }
    953933
    954 /* ROOT Activities: */ 
     934/* ROOT Activities: */
     935        /* explicitly check widelinks here so that we can correctly warn
     936         * in the logs. */
     937        widelinks_warning(snum);
     938
    955939        /*
    956940         * Enforce the max connections parameter.
     
    977961                return NULL;
    978962        } 
     963
     964        /* Invoke VFS make connection hook - must be the first
     965           VFS operation we do. */
     966
     967        if (SMB_VFS_CONNECT(conn, lp_servicename(snum),
     968                            conn->server_info->unix_name) < 0) {
     969                DEBUG(0,("make_connection: VFS make connection failed!\n"));
     970                yield_connection(conn, lp_servicename(snum));
     971                conn_free(conn);
     972                *pstatus = NT_STATUS_UNSUCCESSFUL;
     973                return NULL;
     974        }
     975
     976        /*
     977         * Fix compatibility issue pointed out by Volker.
     978         * We pass the conn->connectpath to the preexec
     979         * scripts as a parameter, so attempt to canonicalize
     980         * it here before calling the preexec scripts.
     981         * We ignore errors here, as it is possible that
     982         * the conn->connectpath doesn't exist yet and
     983         * the preexec scripts will create them.
     984         */
     985
     986        (void)canonicalize_connect_path(conn);
    979987
    980988        /* Preexecs are done here as they might make the dir we are to ChDir
     
    9961004                        DEBUG(1,("root preexec gave %d - failing "
    9971005                                 "connection\n", ret));
     1006                        SMB_VFS_DISCONNECT(conn);
    9981007                        yield_connection(conn, lp_servicename(snum));
    9991008                        conn_free(conn);
     
    10071016                /* No point continuing if they fail the basic checks */
    10081017                DEBUG(0,("Can't become connected user!\n"));
     1018                SMB_VFS_DISCONNECT(conn);
    10091019                yield_connection(conn, lp_servicename(snum));
    10101020                conn_free(conn);
     
    10391049        }
    10401050
     1051        /*
     1052         * If widelinks are disallowed we need to canonicalise the connect
     1053         * path here to ensure we don't have any symlinks in the
     1054         * connectpath. We will be checking all paths on this connection are
     1055         * below this directory. We must do this after the VFS init as we
     1056         * depend on the realpath() pointer in the vfs table. JRA.
     1057         */
     1058        if (!lp_widelinks(snum)) {
     1059                if (!canonicalize_connect_path(conn)) {
     1060                        DEBUG(0, ("canonicalize_connect_path failed "
     1061                        "for service %s, path %s\n",
     1062                                lp_servicename(snum),
     1063                                conn->connectpath));
     1064                        *pstatus = NT_STATUS_BAD_NETWORK_NAME;
     1065                        goto err_root_exit;
     1066                }
     1067        }
     1068
    10411069#ifdef WITH_FAKE_KASERVER
    10421070        if (lp_afs_share(snum)) {
     
    10541082        }
    10551083       
    1056         /* Invoke VFS make connection hook - do this before the VFS_STAT call
    1057            to allow any filesystems needing user credentials to initialize
    1058            themselves. */
    1059 
    1060         if (SMB_VFS_CONNECT(conn, lp_servicename(snum),
    1061                             conn->server_info->unix_name) < 0) {
    1062                 DEBUG(0,("make_connection: VFS make connection failed!\n"));
    1063                 *pstatus = NT_STATUS_UNSUCCESSFUL;
    1064                 goto err_root_exit;
    1065         }
    1066 
    1067         /* Any error exit after here needs to call the disconnect hook. */
    1068         on_err_call_dis_hook = true;
    10691084
    10701085        /* win2000 does not check the permissions on the directory
     
    11391154
    11401155        change_to_root_user();
    1141         if (on_err_call_dis_hook) {
    1142                 /* Call VFS disconnect hook */
    1143                 SMB_VFS_DISCONNECT(conn);
    1144         }
     1156        /* Call VFS disconnect hook */
     1157        SMB_VFS_DISCONNECT(conn);
    11451158        yield_connection(conn, lp_servicename(snum));
    11461159        conn_free(conn);
Note: See TracChangeset for help on using the changeset viewer.