Ignore:
Timestamp:
Nov 12, 2012, 5:38:52 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: update branche to 3.5.16

Location:
branches/samba-3.5.x/source3
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/source3/VERSION

    r735 r736  
    2626SAMBA_VERSION_MAJOR=3
    2727SAMBA_VERSION_MINOR=5
    28 SAMBA_VERSION_RELEASE=15
     28SAMBA_VERSION_RELEASE=16
    2929
    3030########################################################
  • branches/samba-3.5.x/source3/auth/auth_server.c

    r414 r736  
    274274                                         auth_serversupplied_info **server_info)
    275275{
    276         struct server_security_state *state = talloc_get_type_abort(
    277                 my_private_data, struct server_security_state);
    278         struct cli_state *cli;
     276        struct server_security_state *state = NULL;
     277        struct cli_state *cli = NULL;
    279278        static bool tested_password_server = False;
    280279        static bool bad_password_server = False;
     
    282281        bool locally_made_cli = False;
    283282
     283        DEBUG(10, ("check_smbserver_security: Check auth for: [%s]\n",
     284                user_info->smb_name));
     285
     286        if (my_private_data == NULL) {
     287                DEBUG(10,("check_smbserver_security: "
     288                        "password server is not connected\n"));
     289                return NT_STATUS_LOGON_FAILURE;
     290        }
     291
     292        state = talloc_get_type_abort(my_private_data, struct server_security_state);
    284293        cli = state->cli;
    285294       
  • branches/samba-3.5.x/source3/include/ads.h

    r414 r736  
    109109                char *schema_path;
    110110                char *config_path;
     111                int ldap_page_size;
    111112        } config;
    112113
  • branches/samba-3.5.x/source3/include/proto.h

    r733 r736  
    39193919
    39203920char *lp_smb_ports(void);
    3921 char *lp_dos_charset(void);
    3922 char *lp_unix_charset(void);
    3923 char *lp_display_charset(void);
     3921const char *lp_dos_charset(void);
     3922const char *lp_unix_charset(void);
     3923const char *lp_display_charset(void);
    39243924char *lp_logfile(void);
    39253925char *lp_configfile(void);
  • branches/samba-3.5.x/source3/lib/debug.c

    r414 r736  
    658658                        fname = SMB_STRDUP(logfname);
    659659                        if (!fname) {
     660                                TALLOC_FREE(logfname);
    660661                                return false;
    661662                        }
    662663                }
     664                TALLOC_FREE(logfname);
    663665        }
    664666
     
    10291031        if( lp_timestamp_logs() || lp_debug_prefix_timestamp() || !(lp_loaded()) ) {
    10301032                char header_str[200];
     1033                char *curtime = current_timestring(talloc_tos(),
     1034                                        lp_debug_hires_timestamp());
    10311035
    10321036                header_str[0] = '\0';
     
    10511055                                 default_classname_table[cls]);
    10521056                }
    1053  
     1057
    10541058                /* Print it all out at once to prevent split syslog output. */
    10551059                if( lp_debug_prefix_timestamp() ) {
    10561060                    (void)Debug1( "[%s, %2d%s] ",
    1057                         current_timestring(talloc_tos(),
    1058                                            lp_debug_hires_timestamp()),
     1061                        curtime,
    10591062                        level, header_str);
    10601063                } else {
    10611064                    (void)Debug1( "[%s, %2d%s] %s(%s)\n",
    1062                         current_timestring(talloc_tos(),
    1063                                            lp_debug_hires_timestamp()),
     1065                        curtime,
    10641066                        level, header_str, location, func );
    10651067                }
     1068                TALLOC_FREE(curtime);
    10661069        }
    10671070
  • branches/samba-3.5.x/source3/libads/ads_status.c

    r414 r736  
    8080                        return NT_STATUS_OK;
    8181                }
     82                if (status.err.rc == LDAP_TIMELIMIT_EXCEEDED) {
     83                        return NT_STATUS_IO_TIMEOUT;
     84                }
    8285                return NT_STATUS_LDAP(status.err.rc);
    8386#endif
  • branches/samba-3.5.x/source3/libads/ads_struct.c

    r414 r736  
    149149        ads->auth.flags = wrap_flags;
    150150
     151        /* Start with a page size of 1000 when the connection is new,
     152         * we will drop it by half we get a timeout.   */
     153        ads->config.ldap_page_size     = 1000;
     154
    151155        return ads;
    152156}
  • branches/samba-3.5.x/source3/libads/ldap.c

    r583 r736  
    925925        cookie_be = ber_alloc_t(LBER_USE_DER);
    926926        if (*cookie) {
    927                 ber_printf(cookie_be, "{iO}", (ber_int_t) 1000, *cookie);
     927                ber_printf(cookie_be, "{iO}", (ber_int_t) ads->config.ldap_page_size, *cookie);
    928928                ber_bvfree(*cookie); /* don't need it from last time */
    929929                *cookie = NULL;
    930930        } else {
    931                 ber_printf(cookie_be, "{io}", (ber_int_t) 1000, "", 0);
     931                ber_printf(cookie_be, "{io}", (ber_int_t) ads->config.ldap_page_size, "", 0);
    932932        }
    933933        ber_flatten(cookie_be, &cookie_bv);
  • branches/samba-3.5.x/source3/libads/ldap_utils.c

    r414 r736  
    6969        while (--count) {
    7070
     71                if (NT_STATUS_EQUAL(ads_ntstatus(status), NT_STATUS_IO_TIMEOUT) && ads->config.ldap_page_size >= 250) {
     72                        int new_page_size = (ads->config.ldap_page_size / 2);
     73                        DEBUG(1, ("Reducing LDAP page size from %d to %d due to IO_TIMEOUT\n",
     74                                  ads->config.ldap_page_size, new_page_size));
     75                        ads->config.ldap_page_size = new_page_size;
     76                }
     77
    7178                if (*res)
    7279                        ads_msgfree(ads, *res);
  • branches/samba-3.5.x/source3/libsmb/clireadwrite.c

    r733 r736  
    8989        struct tevent_req *req, *subreq;
    9090        struct cli_read_andx_state *state;
    91         bool bigoffset = False;
    9291        uint8_t wct = 10;
    9392
     
    116115        SSVAL(state->vwv + 9, 0, 0);
    117116
    118         if ((uint64_t)offset >> 32) {
    119                 bigoffset = true;
     117        if (cli->capabilities & CAP_LARGE_FILES) {
    120118                SIVAL(state->vwv + 10, 0,
    121119                      (((uint64_t)offset)>>32) & 0xffffffff);
    122                 wct += 2;
     120                wct = 12;
     121        } else {
     122                if ((((uint64_t)offset) & 0xffffffff00000000LL) != 0) {
     123                        DEBUG(10, ("cli_read_andx_send got large offset where "
     124                                   "the server does not support it\n"));
     125                        tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
     126                        return tevent_req_post(req, ev);
     127                }
    123128        }
    124129
  • branches/samba-3.5.x/source3/libsmb/clispnego.c

    r590 r736  
    162162                const char *oid_str = NULL;
    163163                asn1_read_OID(data,talloc_autofree_context(),&oid_str);
     164                if (data->has_error) {
     165                        break;
     166                }
    164167                OIDs[i] = CONST_DISCARD(char *, oid_str);
    165168        }
  • branches/samba-3.5.x/source3/libsmb/namequery.c

    r414 r736  
    572572                        "looking for duplicate address/port pairs\n"));
    573573
    574         /* one loop to remove duplicates */
     574        /* One loop to set duplicates to a zero addr. */
    575575        for ( i=0; i<count; i++ ) {
    576576                if ( is_zero_addr((struct sockaddr *)&iplist[i].ss)) {
     
    586586        }
    587587
    588         /* one loop to clean up any holes we left */
    589         /* first ip should never be a zero_ip() */
    590         for (i = 0; i<count; ) {
    591                 if (is_zero_addr((struct sockaddr *)&iplist[i].ss) ) {
    592                         if (i != count-1) {
    593                                 memmove(&iplist[i], &iplist[i+1],
    594                                         (count - i - 1)*sizeof(iplist[i]));
     588        /* Now remove any addresses set to zero above. */
     589        for (i = 0; i < count; i++) {
     590                while (i < count &&
     591                                is_zero_addr((struct sockaddr *)&iplist[i].ss)) {
     592                        if (count-i-1>0) {
     593                                memmove(&iplist[i],
     594                                        &iplist[i+1],
     595                                        (count-i-1)*sizeof(struct ip_service));
    595596                        }
    596597                        count--;
    597                         continue;
    598                 }
    599                 i++;
     598                }
    600599        }
    601600
     
    850849
    851850/********************************************************
    852  convert an array if struct sockaddr_storage to struct ip_service
     851 Convert an array if struct sockaddr_storage to struct ip_service
    853852 return false on failure.  Port is set to PORT_NONE;
     853 pcount is [in/out] - it is the length of ss_list on input,
     854 and the length of return_iplist on output as we remove any
     855 zero addresses from ss_list.
    854856*********************************************************/
    855857
    856858static bool convert_ss2service(struct ip_service **return_iplist,
    857859                const struct sockaddr_storage *ss_list,
    858                 int count)
     860                int *pcount)
    859861{
    860862        int i;
    861 
    862         if ( count==0 || !ss_list )
     863        int orig_count = *pcount;
     864        int real_count = 0;
     865
     866        if (orig_count==0 || !ss_list )
    863867                return False;
    864868
     869        /* Filter out zero addrs. */
     870        for ( i=0; i<orig_count; i++ ) {
     871                if (is_zero_addr((struct sockaddr *)&ss_list[i])) {
     872                        continue;
     873                }
     874                real_count++;
     875        }
     876        if (real_count==0) {
     877                return false;
     878        }
     879
    865880        /* copy the ip address; port will be PORT_NONE */
    866         if ((*return_iplist = SMB_MALLOC_ARRAY(struct ip_service, count)) ==
     881        if ((*return_iplist = SMB_MALLOC_ARRAY(struct ip_service, real_count)) ==
    867882                        NULL) {
    868883                DEBUG(0,("convert_ip2service: malloc failed "
    869                         "for %d enetries!\n", count ));
     884                        "for %d enetries!\n", real_count ));
    870885                return False;
    871886        }
    872887
    873         for ( i=0; i<count; i++ ) {
    874                 (*return_iplist)[i].ss   = ss_list[i];
    875                 (*return_iplist)[i].port = PORT_NONE;
    876         }
    877 
     888        for ( i=0, real_count = 0; i<orig_count; i++ ) {
     889                if (is_zero_addr((struct sockaddr *)&ss_list[i])) {
     890                        continue;
     891                }
     892                (*return_iplist)[real_count].ss   = ss_list[i];
     893                (*return_iplist)[real_count].port = PORT_NONE;
     894                real_count++;
     895        }
     896
     897        *pcount = real_count;
    878898        return true;
    879899}
     
    948968
    949969        status = NT_STATUS_OK;
    950         if (!convert_ss2service(return_iplist, ss_list, *return_count) )
     970        if (!convert_ss2service(return_iplist, ss_list, return_count) )
    951971                status = NT_STATUS_INVALID_PARAMETER;
    952972
     
    10831103
    10841104        status = NT_STATUS_OK;
    1085         if (!convert_ss2service(return_iplist, ss_list, *return_count))
     1105        if (!convert_ss2service(return_iplist, ss_list, return_count))
    10861106                status = NT_STATUS_INVALID_PARAMETER;
    10871107
     
    12311251                memcpy(&ss, res->ai_addr, res->ai_addrlen);
    12321252
     1253                if (is_zero_addr((struct sockaddr *)&ss)) {
     1254                        continue;
     1255                }
     1256
    12331257                *return_count += 1;
    12341258
     
    12641288                            int *return_count)
    12651289{
    1266         int                     i, j;
     1290        int                     i;
    12671291        NTSTATUS                status;
    12681292        TALLOC_CTX              *ctx;
     
    13131337
    13141338        for (i=0;i<numdcs;i++) {
    1315                 numaddrs += MAX(dcs[i].num_ips,1);
     1339                if (!dcs[i].ss_s) {
     1340                        numaddrs += 1;
     1341                } else {
     1342                        numaddrs += dcs[i].num_ips;
     1343                }
    13161344        }
    13171345
     
    13271355
    13281356        *return_count = 0;
    1329         i = 0;
    1330         j = 0;
    1331         while ( i < numdcs && (*return_count<numaddrs) ) {
    1332                 struct ip_service *r = &(*return_iplist)[*return_count];
    1333 
    1334                 r->port = dcs[i].port;
    1335 
    1336                 /* If we don't have an IP list for a name, lookup it up */
    1337 
     1357
     1358        for (i = 0; i < numdcs; i++) {
     1359                /* If we don't have an IP list for a name, look it up */
    13381360                if (!dcs[i].ss_s) {
    1339                         interpret_string_addr(&r->ss, dcs[i].hostname, 0);
    1340                         i++;
    1341                         j = 0;
     1361                        /* We need to get all IP addresses here. */
     1362                        struct addrinfo *res = NULL;
     1363                        struct addrinfo *p;
     1364                        int extra_addrs = 0;
     1365
     1366                        if (!interpret_string_addr_internal(&res,
     1367                                                dcs[i].hostname,
     1368                                                0)) {
     1369                                continue;
     1370                        }
     1371                        /* Add in every IP from the lookup. How
     1372                           many is that ? */
     1373                        for (p = res; p; p = p->ai_next) {
     1374                                if (is_zero_addr((struct sockaddr *)p->ai_addr)) {
     1375                                        continue;
     1376                                }
     1377                                extra_addrs++;
     1378                        }
     1379                        if (extra_addrs > 1) {
     1380                                /* We need to expand the return_iplist array
     1381                                   as we only budgeted for one address. */
     1382                                numaddrs += (extra_addrs-1);
     1383                                *return_iplist = SMB_REALLOC_ARRAY(*return_iplist,
     1384                                                struct ip_service,
     1385                                                numaddrs);
     1386                                if (*return_iplist == NULL) {
     1387                                        if (res) {
     1388                                                freeaddrinfo(res);
     1389                                        }
     1390                                        talloc_destroy(ctx);
     1391                                        return NT_STATUS_NO_MEMORY;
     1392                                }
     1393                        }
     1394                        for (p = res; p; p = p->ai_next) {
     1395                                (*return_iplist)[*return_count].port = dcs[i].port;
     1396                                memcpy(&(*return_iplist)[*return_count].ss,
     1397                                                p->ai_addr,
     1398                                                p->ai_addrlen);
     1399                                if (is_zero_addr((struct sockaddr *)&(*return_iplist)[*return_count].ss)) {
     1400                                        continue;
     1401                                }
     1402                                (*return_count)++;
     1403                                /* Should never happen, but still... */
     1404                                if (*return_count>=numaddrs) {
     1405                                        break;
     1406                                }
     1407                        }
     1408                        if (res) {
     1409                                freeaddrinfo(res);
     1410                        }
    13421411                } else {
    1343                         /* use the IP addresses from the SRV sresponse */
    1344 
    1345                         if ( j >= dcs[i].num_ips ) {
    1346                                 i++;
    1347                                 j = 0;
    1348                                 continue;
    1349                         }
    1350 
    1351                         r->ss = dcs[i].ss_s[j];
    1352                         j++;
    1353                 }
    1354 
    1355                 /* make sure it is a valid IP.  I considered checking the
    1356                  * negative connection cache, but this is the wrong place
    1357                  * for it. Maybe only as a hack. After think about it, if
    1358                  * all of the IP addresses returned from DNS are dead, what
    1359                  * hope does a netbios name lookup have ? The standard reason
    1360                  * for falling back to netbios lookups is that our DNS server
    1361                  * doesn't know anything about the DC's   -- jerry */
    1362 
    1363                 if (!is_zero_addr((struct sockaddr *)&r->ss)) {
    1364                         (*return_count)++;
     1412                        /* use all the IP addresses from the SRV sresponse */
     1413                        int j;
     1414                        for (j = 0; j < dcs[i].num_ips; j++) {
     1415                                (*return_iplist)[*return_count].port = dcs[i].port;
     1416                                (*return_iplist)[*return_count].ss = dcs[i].ss_s[j];
     1417                                if (is_zero_addr((struct sockaddr *)&(*return_iplist)[*return_count].ss)) {
     1418                                        continue;
     1419                                }
     1420                                (*return_count)++;
     1421                                /* Should never happen, but still... */
     1422                                if (*return_count>=numaddrs) {
     1423                                        break;
     1424                                }
     1425                        }
    13651426                }
    13661427        }
     
    14191480                        return NT_STATUS_INVALID_PARAMETER;
    14201481                }
     1482                if (is_zero_addr((struct sockaddr *)&(*return_iplist)->ss)) {
     1483                        SAFE_FREE(*return_iplist);
     1484                        return NT_STATUS_UNSUCCESSFUL;
     1485                }
    14211486                *return_count = 1;
    14221487                return NT_STATUS_OK;
     
    14261491
    14271492        if (namecache_fetch(name, name_type, return_iplist, return_count)) {
     1493                *return_count = remove_duplicate_addrs2(*return_iplist,
     1494                                        *return_count );
    14281495                /* This could be a negative response */
    14291496                if (*return_count > 0) {
     
    15201587        the iplist when the PDC is down will cause two sets of timeouts. */
    15211588
    1522         if ( *return_count ) {
    1523                 *return_count = remove_duplicate_addrs2(*return_iplist,
    1524                                         *return_count );
    1525         }
     1589        *return_count = remove_duplicate_addrs2(*return_iplist, *return_count );
    15261590
    15271591        /* Save in name cache */
     
    15391603        }
    15401604
    1541         namecache_store(name, name_type, *return_count, *return_iplist);
     1605        if (*return_count) {
     1606                namecache_store(name, name_type, *return_count, *return_iplist);
     1607        }
    15421608
    15431609        /* Display some debugging info */
     
    20022068           explicit password servers */
    20032069
    2004         if (local_count) {
    2005                 local_count = remove_duplicate_addrs2(return_iplist,
    2006                                 local_count );
    2007         }
     2070        local_count = remove_duplicate_addrs2(return_iplist, local_count );
    20082071
    20092072        /* For DC's we always prioritize IPv4 due to W2K3 not
  • branches/samba-3.5.x/source3/modules/vfs_default.c

    r596 r736  
    11341134
    11351135#ifdef HAVE_KERNEL_OPLOCKS_LINUX
    1136         /* first set the signal handler */
    1137         if(linux_set_lease_sighandler(fsp->fh->fd) == -1) {
    1138                 return -1;
    1139         }
    1140 
    11411136        result = linux_setlease(fsp->fh->fd, leasetype);
    11421137#else
  • branches/samba-3.5.x/source3/modules/vfs_gpfs.c

    r599 r736  
    587587
    588588        result = gpfs2smb_acl(pacl);
    589         if (result == NULL) {
    590                 goto done;
     589        if (result != NULL) {
     590                errno = 0;
    591591        }
    592592
  • branches/samba-3.5.x/source3/nmbd/nmbd.c

    r596 r736  
    371371
    372372        if ( lp_loaded() ) {
    373                 const char *fname = lp_configfile();
     373                char *fname = lp_configfile();
    374374                if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
    375375                        set_dyn_CONFIGFILE(fname);
    376376                        test = False;
    377377                }
     378                TALLOC_FREE(fname);
    378379        }
    379380
  • branches/samba-3.5.x/source3/param/loadparm.c

    r733 r736  
    53645364
    53655365FN_GLOBAL_STRING(lp_smb_ports, &Globals.smb_ports)
    5366 FN_GLOBAL_STRING(lp_dos_charset, &Globals.dos_charset)
    5367 FN_GLOBAL_STRING(lp_unix_charset, &Globals.unix_charset)
    5368 FN_GLOBAL_STRING(lp_display_charset, &Globals.display_charset)
     5366FN_GLOBAL_CONST_STRING(lp_dos_charset, &Globals.dos_charset)
     5367FN_GLOBAL_CONST_STRING(lp_unix_charset, &Globals.unix_charset)
     5368FN_GLOBAL_CONST_STRING(lp_display_charset, &Globals.display_charset)
    53695369FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile)
    53705370FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile)
     
    93299329        }
    93309330
    9331         lp_add_auto_services(lp_auto_services());
     9331        {
     9332                char *serv = lp_auto_services();
     9333                lp_add_auto_services(serv);
     9334                TALLOC_FREE(serv);
     9335        }
    93329336
    93339337        if (add_ipc) {
  • branches/samba-3.5.x/source3/smbd/notify.c

    r590 r736  
    367367}
    368368
     369static void notify_parent_dir(connection_struct *conn,
     370                                uint32 action, uint32 filter,
     371                                const char *path)
     372{
     373        struct smb_filename smb_fname_parent;
     374        char *parent;
     375        const char *name;
     376        char *oldwd;
     377
     378        if (!parent_dirname(talloc_tos(), path, &parent, &name)) {
     379                DEBUG(1, ("Can't get parent dirname, giving up\n"));
     380                return;
     381        }
     382
     383        ZERO_STRUCT(smb_fname_parent);
     384        smb_fname_parent.base_name = parent;
     385
     386        oldwd = vfs_GetWd(parent, conn);
     387        if (oldwd == NULL) {
     388                DEBUG(1, ("vfs_GetWd failed!\n"));
     389                goto done;
     390        }
     391        if (vfs_ChDir(conn, conn->connectpath) == -1) {
     392                DEBUG(1, ("Could not chdir to connect path!\n"));
     393                goto done;
     394        }
     395
     396        if (SMB_VFS_STAT(conn, &smb_fname_parent) == -1) {
     397                goto chdir_done;
     398        }
     399
     400        notify_onelevel(conn->notify_ctx, action, filter,
     401                        SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st),
     402                        name);
     403chdir_done:
     404        vfs_ChDir(conn, oldwd);
     405done:
     406        TALLOC_FREE(parent);
     407}
     408
    369409void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
    370410                  const char *path)
    371411{
    372         char *fullpath;
    373         char *parent;
    374         const char *name;
     412        char *fullpath = NULL;
    375413
    376414        if (path[0] == '.' && path[1] == '/') {
    377415                path += 2;
    378416        }
    379         if (parent_dirname(talloc_tos(), path, &parent, &name)) {
    380                 struct smb_filename smb_fname_parent;
    381 
    382                 ZERO_STRUCT(smb_fname_parent);
    383                 smb_fname_parent.base_name = parent;
    384 
    385                 if (SMB_VFS_STAT(conn, &smb_fname_parent) != -1) {
    386                         notify_onelevel(conn->notify_ctx, action, filter,
    387                             SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st),
    388                             name);
    389                 }
    390         }
     417        notify_parent_dir(conn, action, filter, path);
    391418
    392419        fullpath = talloc_asprintf(talloc_tos(), "%s/%s", conn->connectpath,
  • branches/samba-3.5.x/source3/smbd/nttrans.c

    r733 r736  
    133133                             total_sent_thistime + alignment_offset
    134134                             + data_alignment_offset);
    135 
    136                 /*
    137                  * We might have had SMBnttranss in req->inbuf, fix that.
    138                  */
    139                 SCVAL(req->outbuf, smb_com, SMBnttrans);
    140135
    141136                /*
     
    30693064        show_msg((char *)req->inbuf);
    30703065
     3066        /* Windows clients expect all replies to
     3067           an NT transact secondary (SMBnttranss 0xA1)
     3068           to have a command code of NT transact
     3069           (SMBnttrans 0xA0). See bug #8989 for details. */
     3070        req->cmd = SMBnttrans;
     3071
    30713072        if (req->wct < 18) {
    30723073                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
  • branches/samba-3.5.x/source3/smbd/open.c

    r733 r736  
    22972297        SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname));
    22982298
    2299         /* Ensure we have a directory attribute. */
    2300         file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
     2299        if (!(file_attributes & FILE_FLAG_POSIX_SEMANTICS)) {
     2300                /* Ensure we have a directory attribute. */
     2301                file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
     2302        }
    23012303
    23022304        DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, "
  • branches/samba-3.5.x/source3/smbd/oplock_linux.c

    r414 r736  
    7575        int ret;
    7676
     77        /* First set the signal handler. */
     78        if (linux_set_lease_sighandler(fd) == -1) {
     79                return -1;
     80        }
    7781        ret = fcntl(fd, F_SETLEASE, leasetype);
    7882        if (ret == -1 && errno == EACCES) {
    7983                set_effective_capability(LEASE_CAPABILITY);
     84                /*
     85                 * Bug 8974 - work around Linux kernel bug
     86                 * https://bugzilla.kernel.org/show_bug.cgi?id=43336.
     87                 * "fcntl(F_SETLEASE) resets signal number when
     88                 *  called multiple times"
     89                 */
     90                if (linux_set_lease_sighandler(fd) == -1) {
     91                        return -1;
     92                }
    8093                ret = fcntl(fd, F_SETLEASE, leasetype);
    8194        }
  • branches/samba-3.5.x/source3/smbd/server.c

    r668 r736  
    804804                        test = False;
    805805                }
     806                TALLOC_FREE(fname);
    806807        }
    807808
  • branches/samba-3.5.x/source3/smbd/service.c

    r480 r736  
    751751                        return NULL;
    752752                }
     753
     754                /* We don't want to replace the original sanitized_username
     755                   as it is the original user given in the connect attempt.
     756                   This is used in '%U' substitutions. */
     757                TALLOC_FREE(forced_serverinfo->sanitized_username);
     758                forced_serverinfo->sanitized_username =
     759                        talloc_move(forced_serverinfo,
     760                                        &conn->server_info->sanitized_username);
    753761
    754762                TALLOC_FREE(conn->server_info);
  • branches/samba-3.5.x/source3/smbd/trans2.c

    r733 r736  
    862862                reply_outbuf(req, 10, total_sent_thistime + alignment_offset
    863863                             + data_alignment_offset);
    864 
    865                 /*
    866                  * We might have SMBtrans2s in req which was transferred to
    867                  * the outbuf, fix that.
    868                  */
    869                 SCVAL(req->outbuf, smb_com, SMBtrans2);
    870864
    871865                /* Set total params and data to be sent */
     
    85858579        show_msg((char *)req->inbuf);
    85868580
     8581        /* Windows clients expect all replies to
     8582           a transact secondary (SMBtranss2 0x33)
     8583           to have a command code of transact
     8584           (SMBtrans2 0x32). See bug #8989
     8585           and also [MS-CIFS] section 2.2.4.47.2
     8586           for details.
     8587        */
     8588        req->cmd = SMBtrans2;
     8589
    85878590        if (req->wct < 8) {
    85888591                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
  • branches/samba-3.5.x/source3/utils/net_ads.c

    r596 r736  
    21572157        attrs = (argv + 1);
    21582158
    2159         rc = ads_do_search_all(ads, ads->config.bind_path,
     2159        rc = ads_do_search_retry(ads, ads->config.bind_path,
    21602160                               LDAP_SCOPE_SUBTREE,
    21612161                               ldap_exp, attrs, &res);
  • branches/samba-3.5.x/source3/winbindd/winbindd.c

    r732 r736  
    6868
    6969        if (lp_loaded()) {
    70                 const char *fname = lp_configfile();
     70                char *fname = lp_configfile();
    7171
    7272                if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
    7373                        set_dyn_CONFIGFILE(fname);
    7474                }
     75                TALLOC_FREE(fname);
    7576        }
    7677
     
    10731074        }
    10741075
     1076        /* We call dump_core_setup one more time because the command line can
     1077         * set the log file or the log-basename and this will influence where
     1078         * cores are stored. Without this call get_dyn_LOGFILEBASE will be
     1079         * the default value derived from build's prefix. For EOM this value
     1080         * is often not related to the path where winbindd is actually run
     1081         * in production.
     1082         */
     1083        dump_core_setup("winbindd");
     1084
    10751085        if (is_daemon && interactive) {
    10761086                d_fprintf(stderr,"\nERROR: "
     
    11071117                exit(1);
    11081118        }
     1119        /* After parsing the configuration file we setup the core path one more time
     1120         * as the log file might have been set in the configuration and cores's
     1121         * path is by default basename(lp_logfile()).
     1122         */
     1123        dump_core_setup("winbindd");
    11091124
    11101125        /* Initialise messaging system */
  • branches/samba-3.5.x/source3/winbindd/winbindd_ads.c

    r414 r736  
    181181
    182182        rc = ads_search_retry(ads, &res, "(objectCategory=user)", attrs);
    183         if (!ADS_ERR_OK(rc) || !res) {
     183        if (!ADS_ERR_OK(rc)) {
    184184                DEBUG(1,("query_user_list ads_search: %s\n", ads_errstr(rc)));
     185                status = ads_ntstatus(rc);
     186        } else if (!res) {
     187                DEBUG(1,("query_user_list ads_search returned NULL res\n"));
     188
    185189                goto done;
    186190        }
     
    326330
    327331        rc = ads_search_retry(ads, &res, filter, attrs);
    328         if (!ADS_ERR_OK(rc) || !res) {
     332        if (!ADS_ERR_OK(rc)) {
     333                status = ads_ntstatus(rc);
    329334                DEBUG(1,("enum_dom_groups ads_search: %s\n", ads_errstr(rc)));
     335                goto done;
     336        } else if (!res) {
     337                DEBUG(1,("enum_dom_groups ads_search returned NULL res\n"));
    330338                goto done;
    331339        }
     
    533541        }
    534542        rc = ads_search_retry(ads, &msg, ldap_exp, attrs);
    535         free(ldap_exp);
     543        SAFE_FREE(ldap_exp);
    536544        TALLOC_FREE(sidstr);
    537         if (!ADS_ERR_OK(rc) || !msg) {
     545        if (!ADS_ERR_OK(rc)) {
    538546                DEBUG(1,("query_user(sid=%s) ads_search: %s\n",
    539547                         sid_string_dbg(sid), ads_errstr(rc)));
    540                 goto done;
     548                return ads_ntstatus(rc);
     549        } else if (!msg) {
     550                DEBUG(1,("query_user(sid=%s) ads_search returned NULL res\n",
     551                         sid_string_dbg(sid)));
     552                return NT_STATUS_INTERNAL_ERROR;
    541553        }
    542554
     
    633645        rc = ads_search_retry(ads, &res, ldap_exp, group_attrs);
    634646
    635         if (!ADS_ERR_OK(rc) || !res) {
     647        if (!ADS_ERR_OK(rc)) {
    636648                DEBUG(1,("lookup_usergroups ads_search member=%s: %s\n", user_dn, ads_errstr(rc)));
    637649                return ads_ntstatus(rc);
    638         }
     650        } else if (!res) {
     651                DEBUG(1,("lookup_usergroups ads_search returned NULL res\n"));
     652                return NT_STATUS_INTERNAL_ERROR;
     653        }
     654
    639655
    640656        count = ads_count_replies(ads, res);
  • branches/samba-3.5.x/source3/winbindd/winbindd_dual.c

    r732 r736  
    3737extern bool override_logfile;
    3838extern struct winbindd_methods cache_methods;
     39
     40static struct winbindd_child *children = NULL;
    3941
    4042/* Read some data from a client connection */
     
    171173                close(state->child->sock);
    172174                state->child->sock = -1;
     175                DLIST_REMOVE(children, state->child);
    173176                tevent_req_error(req, err);
    174177                return;
     
    517520        SMB_ASSERT(child->rpccli != NULL);
    518521}
    519 
    520 struct winbindd_child *children = NULL;
    521522
    522523void winbind_child_died(pid_t pid)
  • branches/samba-3.5.x/source3/winbindd/winbindd_pam.c

    r733 r736  
    13661366                }
    13671367
    1368                 logon_fn = contact_domain->can_do_samlogon_ex
     1368                logon_fn = (contact_domain->can_do_samlogon_ex && domain->can_do_validation6)
    13691369                        ? rpccli_netlogon_sam_network_logon_ex
    13701370                        : rpccli_netlogon_sam_network_logon;
     
    15591559
    15601560        if ( mapped_user != state->request->data.auth.user ) {
    1561                 fstr_sprintf( domain_user, "%s\\%s", name_domain, name_user );
     1561                fstr_sprintf( domain_user, "%s%c%s", name_domain,
     1562                        *lp_winbind_separator(),
     1563                        name_user );
    15621564                safe_strcpy( state->request->data.auth.user, domain_user,
    15631565                             sizeof(state->request->data.auth.user)-1 );
     
    19901992                }
    19911993
    1992                 logon_fn = contact_domain->can_do_samlogon_ex
     1994                logon_fn = (contact_domain->can_do_samlogon_ex && domain->can_do_validation6)
    19931995                        ? rpccli_netlogon_sam_network_logon_ex
    19941996                        : rpccli_netlogon_sam_network_logon;
Note: See TracChangeset for help on using the changeset viewer.