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

Location:
branches/samba-3.3.x/source/smbd
Files:
7 edited

Legend:

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

    r224 r411  
    163163                                           rparam, tot_param_sent, this_lparam,
    164164                                           rdata, tot_data_sent, this_ldata);
     165
     166                SSVAL(outbuf,smb_vwv0,lparam);
     167                SSVAL(outbuf,smb_vwv1,ldata);
    165168
    166169                SSVAL(outbuf,smb_vwv3,this_lparam);
  • branches/samba-3.3.x/source/smbd/lanman.c

    r309 r411  
    13531353
    13541354
    1355 static bool srv_comp(struct srv_info_struct *s1,struct srv_info_struct *s2)
     1355static int srv_comp(struct srv_info_struct *s1,struct srv_info_struct *s2)
    13561356{
    13571357        return(strcmp(s1->name,s2->name));
     
    14571457                                s->name, s->type, s->comment, s->domain));
    14581458     
    1459                         if (data_len <= buf_len) {
     1459                        if (data_len < buf_len) {
    14601460                                counted++;
    14611461                                fixed_len += f_len;
     
    18211821                        total++;
    18221822                        data_len += fill_share_info(conn,i,uLevel,0,&f_len,0,&s_len,0);
    1823                         if (data_len <= buf_len) {
     1823                        if (data_len < buf_len) {
    18241824                                counted++;
    18251825                                fixed_len += f_len;
  • branches/samba-3.3.x/source/smbd/mangle_hash.c

    r370 r411  
    336336
    337337        SMB_ASSERT(chartest != NULL);
     338        memset(chartest, '\0', 256);
    338339
    339340        for( s = (const unsigned char *)basechars; *s; s++ ) {
     
    412413        TDB_DATA data_val;
    413414        char mangled_name_key[13];
    414         char *s1;
    415         char *s2;
     415        char *s1 = NULL;
     416        char *s2 = NULL;
    416417
    417418        /* If the cache isn't initialized, give up. */
     
    452453        }
    453454        /* Restore the change we made to the const string. */
    454         *s2 = '.';
     455        if (s2) {
     456                *s2 = '.';
     457        }
    455458}
    456459
  • branches/samba-3.3.x/source/smbd/server.c

    r370 r411  
    12481248        gain_root_group_privilege();
    12491249
     1250        /*
     1251         * Ensure we have CAP_KILL capability set on Linux,
     1252         * where we need this to communicate with threads.
     1253         * This is inherited by new threads, but not by new
     1254         * processes across exec().
     1255         */
     1256        set_effective_capability(KILL_CAPABILITY);
     1257
    12501258        fault_setup((void (*)(void *))exit_server_fault);
    12511259        dump_core_setup("smbd");
  • 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);
  • branches/samba-3.3.x/source/smbd/trans2.c

    r370 r411  
    52495249        char *link_target = NULL;
    52505250        const char *newname = fname;
    5251         NTSTATUS status = NT_STATUS_OK;
    52525251        TALLOC_CTX *ctx = talloc_tos();
    52535252
     
    52685267        if (!link_target) {
    52695268                return NT_STATUS_INVALID_PARAMETER;
    5270         }
    5271 
    5272         /* !widelinks forces the target path to be within the share. */
    5273         /* This means we can interpret the target as a pathname. */
    5274         if (!lp_widelinks(SNUM(conn))) {
    5275                 char *rel_name = NULL;
    5276                 char *last_dirp = NULL;
    5277 
    5278                 if (*link_target == '/') {
    5279                         /* No absolute paths allowed. */
    5280                         return NT_STATUS_ACCESS_DENIED;
    5281                 }
    5282                 rel_name = talloc_strdup(ctx,newname);
    5283                 if (!rel_name) {
    5284                         return NT_STATUS_NO_MEMORY;
    5285                 }
    5286                 last_dirp = strrchr_m(rel_name, '/');
    5287                 if (last_dirp) {
    5288                         last_dirp[1] = '\0';
    5289                 } else {
    5290                         rel_name = talloc_strdup(ctx,"./");
    5291                         if (!rel_name) {
    5292                                 return NT_STATUS_NO_MEMORY;
    5293                         }
    5294                 }
    5295                 rel_name = talloc_asprintf_append(rel_name,
    5296                                 "%s",
    5297                                 link_target);
    5298                 if (!rel_name) {
    5299                         return NT_STATUS_NO_MEMORY;
    5300                 }
    5301 
    5302                 status = check_name(conn, rel_name);
    5303                 if (!NT_STATUS_IS_OK(status)) {
    5304                         return status;
    5305                 }
    53065269        }
    53075270
  • branches/samba-3.3.x/source/smbd/vfs.c

    r206 r411  
    940940        /* Check for widelinks allowed. */
    941941        if (!lp_widelinks(SNUM(conn)) && (strncmp(conn->connectpath, resolved_name, con_path_len) != 0)) {
    942                 DEBUG(2, ("reduce_name: Bad access attempt: %s is a symlink outside the share path", fname));
     942                DEBUG(2, ("reduce_name: Bad access attempt: %s is a symlink outside the share path\n", fname));
    943943                if (free_resolved_name) {
    944944                        SAFE_FREE(resolved_name);
Note: See TracChangeset for help on using the changeset viewer.