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
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/VERSION

    r370 r411  
    2626SAMBA_VERSION_MAJOR=3
    2727SAMBA_VERSION_MINOR=3
    28 SAMBA_VERSION_RELEASE=10
     28SAMBA_VERSION_RELEASE=11
    2929
    3030########################################################
  • branches/samba-3.3.x/source/include/proto.h

    r384 r411  
    60746074void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
    60756075int lp_min_receive_file_size(void);
     6076void widelinks_warning(int snum);
    60766077
    60776078/* The following definitions come from param/params.c  */
  • branches/samba-3.3.x/source/include/smb.h

    r338 r411  
    16851685    KERNEL_OPLOCK_CAPABILITY,
    16861686    DMAPI_ACCESS_CAPABILITY,
    1687     LEASE_CAPABILITY
     1687    LEASE_CAPABILITY,
     1688    KILL_CAPABILITY
    16881689};
    16891690
  • branches/samba-3.3.x/source/lib/system.c

    r309 r411  
    708708#if defined(HAVE_POSIX_CAPABILITIES)
    709709
     710/* This define hasn't made it into the glibc capabilities header yet. */
     711#ifndef SECURE_NO_SETUID_FIXUP
     712#define SECURE_NO_SETUID_FIXUP          2
     713#endif
     714
    710715/**************************************************************************
    711716 Try and abstract process capabilities (for systems that have them).
     
    738743#endif
    739744
     745#if defined(HAVE_PRCTL) && defined(PR_SET_SECUREBITS) && defined(SECURE_NO_SETUID_FIXUP)
     746        /* New way of setting capabilities as "sticky". */
     747
     748        /*
     749         * Use PR_SET_SECUREBITS to prevent setresuid()
     750         * atomically dropping effective capabilities on
     751         * uid change. Only available in Linux kernels
     752         * 2.6.26 and above.
     753         *
     754         * See here:
     755         * http://www.kernel.org/doc/man-pages/online/pages/man7/capabilities.7.html
     756         * for details.
     757         *
     758         * Specifically the CAP_KILL capability we need
     759         * to allow Linux threads under different euids
     760         * to send signals to each other.
     761         */
     762
     763        if (prctl(PR_SET_SECUREBITS, 1 << SECURE_NO_SETUID_FIXUP)) {
     764                DEBUG(0,("set_process_capability: "
     765                        "prctl PR_SET_SECUREBITS failed with error %s\n",
     766                        strerror(errno) ));
     767                return false;
     768        }
     769#endif
     770
    740771        cap = cap_get_proc();
    741772        if (cap == NULL) {
     
    766797#endif
    767798                        break;
     799                case KILL_CAPABILITY:
     800#ifdef CAP_KILL
     801                        cap_vals[num_cap_vals++] = CAP_KILL;
     802#endif
     803                        break;
    768804        }
    769805
     
    775811        }
    776812
    777         cap_set_flag(cap, CAP_EFFECTIVE, num_cap_vals, cap_vals,
    778                 enable ? CAP_SET : CAP_CLEAR);
     813        /*
     814         * Ensure the capability is effective. We assume that as a root
     815         * process it's always permitted.
     816         */
     817
     818        if (cap_set_flag(cap, CAP_EFFECTIVE, num_cap_vals, cap_vals,
     819                        enable ? CAP_SET : CAP_CLEAR) == -1) {
     820                DEBUG(0, ("set_process_capability: cap_set_flag effective "
     821                        "failed (%d): %s\n",
     822                        (int)capability,
     823                        strerror(errno)));
     824                cap_free(cap);
     825                return false;
     826        }
    779827
    780828        /* We never want to pass capabilities down to our children, so make
    781829         * sure they are not inherited.
    782830         */
    783         cap_set_flag(cap, CAP_INHERITABLE, num_cap_vals, cap_vals, CAP_CLEAR);
     831        if (cap_set_flag(cap, CAP_INHERITABLE, num_cap_vals,
     832                        cap_vals, CAP_CLEAR) == -1) {
     833                DEBUG(0, ("set_process_capability: cap_set_flag inheritable "
     834                        "failed (%d): %s\n",
     835                        (int)capability,
     836                        strerror(errno)));
     837                cap_free(cap);
     838                return false;
     839        }
    784840
    785841        if (cap_set_proc(cap) == -1) {
    786                 DEBUG(0, ("set_process_capability: cap_set_proc failed: %s\n",
     842                DEBUG(0, ("set_process_capability: cap_set_flag (%d) failed: %s\n",
     843                        (int)capability,
    787844                        strerror(errno)));
    788845                cap_free(cap);
  • branches/samba-3.3.x/source/libsmb/clirap.c

    r206 r411  
    271271                SIVAL(p,0,func); /* api number */
    272272                p += 2;
    273                 /* Next time through we need to use the continue api */
    274                 func = RAP_NetServerEnum3;
    275 
    276                 if (last_entry) {
    277                         strlcpy(p,"WrLehDOz", sizeof(param)-PTR_DIFF(p,param));
     273
     274                if (func == RAP_NetServerEnum3) {
     275                        strlcpy(p,"WrLehDzz", sizeof(param)-PTR_DIFF(p,param));
    278276                } else {
    279277                        strlcpy(p,"WrLehDz", sizeof(param)-PTR_DIFF(p,param));
     
    294292                 */
    295293                len = push_ascii(p,
    296                                 last_entry ? last_entry : workgroup,
     294                                workgroup,
    297295                                sizeof(param) - PTR_DIFF(p,param) - 1,
    298296                                STR_TERMINATE|STR_UPPER);
     
    303301                }
    304302                p += len;
     303
     304                if (func == RAP_NetServerEnum3) {
     305                        len = push_ascii(p,
     306                                        last_entry ? last_entry : "",
     307                                        sizeof(param) - PTR_DIFF(p,param) - 1,
     308                                        STR_TERMINATE);
     309
     310                        if (len == (size_t)-1) {
     311                                SAFE_FREE(last_entry);
     312                                return false;
     313                        }
     314                        p += len;
     315                }
     316
     317                /* Next time through we need to use the continue api */
     318                func = RAP_NetServerEnum3;
    305319
    306320                if (!cli_api(cli,
     
    365379                                char *s1, *s2;
    366380                                TALLOC_CTX *frame = talloc_stackframe();
     381                                uint32_t entry_stype;
    367382
    368383                                if (p + 26 > rdata_end) {
     
    375390                                cmnt = comment_offset?(rdata+comment_offset):"";
    376391
    377                                 if (comment_offset < 0 || comment_offset > (int)rdrcnt) {
     392                                if (comment_offset < 0 || comment_offset >= (int)rdrcnt) {
    378393                                        TALLOC_FREE(frame);
    379394                                        continue;
     
    388403                                }
    389404
    390                                 stype = IVAL(p,18) & ~SV_TYPE_LOCAL_LIST_ONLY;
     405                                entry_stype = IVAL(p,18) & ~SV_TYPE_LOCAL_LIST_ONLY;
    391406
    392407                                pull_string_talloc(frame,rdata,0,
     
    400415                                }
    401416
    402                                 fn(s1, stype, s2, state);
     417                                fn(s1, entry_stype, s2, state);
    403418                                TALLOC_FREE(frame);
    404419                        }
  • branches/samba-3.3.x/source/libsmb/libsmb_context.c

    r342 r411  
    193193       
    194194        /* Things we have to clean up */
    195         free(smbc_getWorkgroup(context));
    196195        smbc_setWorkgroup(context, NULL);
    197 
    198         free(smbc_getNetbiosName(context));
    199196        smbc_setNetbiosName(context, NULL);
    200 
    201         free(smbc_getUser(context));
    202197        smbc_setUser(context, NULL);
    203198       
     
    424419{
    425420        int pid;
    426         char *user = NULL;
    427421        char *home = NULL;
    428422       
     
    533527                 * FIXME: Is this the best way to get the user info?
    534528                 */
    535                 user = getenv("USER");
     529                char *user = getenv("USER");
    536530                /* walk around as "guest" if no username can be found */
    537531                if (!user) {
     
    547541
    548542                smbc_setUser(context, user);
     543                SAFE_FREE(user);
     544
     545                if (!smbc_getUser(context)) {
     546                        errno = ENOMEM;
     547                        return NULL;
     548                }
    549549        }
    550550       
     
    579579               
    580580                smbc_setNetbiosName(context, netbios_name);
     581                SAFE_FREE(netbios_name);
     582
     583                if (!smbc_getNetbiosName(context)) {
     584                        errno = ENOMEM;
     585                        return NULL;
     586                }
    581587        }
    582588       
     
    600606
    601607                smbc_setWorkgroup(context, workgroup);
     608                SAFE_FREE(workgroup);
     609
     610                if (!smbc_getWorkgroup(context)) {
     611                        errno = ENOMEM;
     612                        return NULL;
     613                }
    602614        }
    603615       
  • branches/samba-3.3.x/source/libsmb/libsmb_dir.c

    r370 r411  
    304304
    305305        /* For each returned entry... */
    306         for (i = 0; i < total_entries; i++) {
     306        for (i = 0; i < info_ctr.ctr.ctr1->count; i++) {
    307307
    308308                /* pull out the share name */
  • branches/samba-3.3.x/source/libsmb/libsmb_path.c

    r221 r411  
    309309                        return -1;
    310310                }
    311                 *pp_server[wl] = '\0';
     311                (*pp_server)[wl] = '\0';
    312312                return 0;
    313313        }
  • branches/samba-3.3.x/source/libsmb/libsmb_setget.c

    r221 r411  
    4040smbc_setNetbiosName(SMBCCTX *c, char * netbios_name)
    4141{
    42         c->netbios_name = netbios_name;
     42        SAFE_FREE(c->netbios_name);
     43        if (netbios_name) {
     44                c->netbios_name = SMB_STRDUP(netbios_name);
     45        }
    4346}
    4447
     
    5457smbc_setWorkgroup(SMBCCTX *c, char * workgroup)
    5558{
    56         c->workgroup = workgroup;
     59        SAFE_FREE(c->workgroup);
     60        if (workgroup) {
     61                c->workgroup = SMB_STRDUP(workgroup);
     62        }
    5763}
    5864
     
    6874smbc_setUser(SMBCCTX *c, char * user)
    6975{
    70         c->user = user;
     76        SAFE_FREE(c->user);
     77        if (user) {
     78                c->user = SMB_STRDUP(user);
     79        }
    7180}
    7281
  • branches/samba-3.3.x/source/nsswitch/pam_winbind.c

    r370 r411  
    10371037        const char *search_location;
    10381038        const char *comma;
     1039        int len;
    10391040
    10401041        if (sid_list_buffer_size > 0) {
     
    10921093                                "to sid, please contact your administrator to see "
    10931094                                "if group %s is valid."), search_location, search_location);
     1095                /*
     1096                 * The lookup of the last name failed..
     1097                 * It results in require_member_of_sid ends with ','
     1098                 * It is malformated parameter here, overwrite the last ','.
     1099                 */
     1100                len = strlen(sid_list_buffer);
     1101                if (len) {
     1102                        if (sid_list_buffer[len - 1] == ',') {
     1103                                sid_list_buffer[len - 1] = '\0';
     1104                        }
     1105                }
    10941106        }
    10951107
  • branches/samba-3.3.x/source/param/loadparm.c

    r407 r411  
    590590        False,                  /* bOnlyUser */
    591591        True,                   /* bMangledNames */
    592 #ifndef __OS2__
    593         /* Future default in newer Samba versions */
    594         True,                   /* bWidelinks */
    595 #else
    596592        False,                  /* bWidelinks */
    597 #endif
    598593        True,                   /* bSymlinks */
    599594        False,                  /* bSyncAlways */
     
    53625357FN_LOCAL_BOOL(lp_onlyuser, bOnlyUser)
    53635358FN_LOCAL_PARM_BOOL(lp_manglednames, bMangledNames)
    5364 FN_LOCAL_BOOL(lp_widelinks, bWidelinks)
    53655359FN_LOCAL_BOOL(lp_symlinks, bSymlinks)
    53665360FN_LOCAL_BOOL(lp_syncalways, bSyncAlways)
     
    96109604        return  Globals.szSocketAddress;
    96119605}
     9606
     9607/*******************************************************************
     9608 Safe wide links checks.
     9609 This helper function always verify the validity of wide links,
     9610 even after a configuration file reload.
     9611********************************************************************/
     9612
     9613static bool lp_widelinks_internal(int snum)
     9614{
     9615        return (bool)(LP_SNUM_OK(snum)? ServicePtrs[(snum)]->bWidelinks :
     9616                        sDefault.bWidelinks);
     9617}
     9618
     9619void widelinks_warning(int snum)
     9620{
     9621        if (lp_unix_extensions() && lp_widelinks_internal(snum)) {
     9622                DEBUG(0,("Share '%s' has wide links and unix extensions enabled. "
     9623                        "These parameters are incompatible. "
     9624                        "Wide links will be disabled for this share.\n",
     9625                        lp_servicename(snum) ));
     9626        }
     9627}
     9628
     9629bool lp_widelinks(int snum)
     9630{
     9631        /* wide links is always incompatible with unix extensions */
     9632        if (lp_unix_extensions()) {
     9633                return false;
     9634        }
     9635
     9636        return lp_widelinks_internal(snum);
     9637}
  • branches/samba-3.3.x/source/passdb/login_cache.c

    r206 r411  
    6868        TDB_DATA databuf;
    6969        LOGIN_CACHE *entry;
     70        uint32_t entry_timestamp = 0, bad_password_time = 0;
    7071
    7172        if (!login_cache_init())
     
    9293                return NULL;
    9394        }
     95        ZERO_STRUCTP(entry);
    9496
    9597        if (tdb_unpack (databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT,
    96                         &entry->entry_timestamp, &entry->acct_ctrl,
    97                         &entry->bad_password_count,
    98                         &entry->bad_password_time) == -1) {
     98                        &entry_timestamp,
     99                        &entry->acct_ctrl,
     100                        &entry->bad_password_count,
     101                        &bad_password_time) == -1) {
    99102                DEBUG(7, ("No cache entry found\n"));
    100103                SAFE_FREE(entry);
     
    102105                return NULL;
    103106        }
     107
     108        /* Deal with possible 64-bit time_t. */
     109        entry->entry_timestamp = (time_t)entry_timestamp;
     110        entry->bad_password_time = (time_t)bad_password_time;
    104111
    105112        SAFE_FREE(databuf.dptr);
     
    116123        TDB_DATA databuf;
    117124        bool ret;
     125        uint32_t entry_timestamp;
     126        uint32_t bad_password_time = (uint32_t)entry.bad_password_time;
    118127
    119128        if (!login_cache_init())
     
    130139        }
    131140
    132         entry.entry_timestamp = time(NULL);
     141        entry_timestamp = (uint32_t)time(NULL);
    133142
    134143        databuf.dsize =
    135144                tdb_pack(NULL, 0, SAM_CACHE_FORMAT,
    136                          entry.entry_timestamp,
     145                         entry_timestamp,
    137146                         entry.acct_ctrl,
    138147                         entry.bad_password_count,
    139                          entry.bad_password_time);
     148                         bad_password_time);
    140149        databuf.dptr = SMB_MALLOC_ARRAY(uint8, databuf.dsize);
    141150        if (!databuf.dptr) {
     
    145154                         
    146155        if (tdb_pack(databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT,
    147                          entry.entry_timestamp,
     156                         entry_timestamp,
    148157                         entry.acct_ctrl,
    149158                         entry.bad_password_count,
    150                          entry.bad_password_time)
     159                         bad_password_time)
    151160            != databuf.dsize) {
    152161                SAFE_FREE(keystr);
  • 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);
  • branches/samba-3.3.x/source/utils/net_rpc.c

    r370 r411  
    588588int net_rpc_getsid(struct net_context *c, int argc, const char **argv)
    589589{
     590        int conn_flags = NET_FLAGS_PDC;
     591
     592        if (!c->opt_user_specified) {
     593                conn_flags |= NET_FLAGS_ANONYMOUS;
     594        }
     595
    590596        if (c->display_usage) {
    591597                d_printf("Usage:\n"
     
    596602
    597603        return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id,
    598                                NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC,
     604                               conn_flags,
    599605                               rpc_getsid_internals,
    600606                               argc, argv);
  • branches/samba-3.3.x/source/web/cgi.c

    r206 r411  
    659659        if (inetd_server) {
    660660                char addr[INET6_ADDRSTRLEN];
    661                 return get_peer_addr(1,addr,sizeof(addr));
     661                get_peer_addr(1,addr,sizeof(addr));
     662                return talloc_strdup(talloc_tos(), addr);
    662663        }
    663664        return getenv("REMOTE_ADDR");
  • branches/samba-3.3.x/source/winbindd/winbindd_cm.c

    r342 r411  
    16191619
    16201620        /* Internal connections never use the network. */
    1621         if (domain->internal) {
     1621        if (domain->internal || !winbindd_can_contact_domain(domain)) {
    16221622                domain->initialized = True;
    16231623                return NT_STATUS_OK;
     
    17471747                        domain->initialized = True;
    17481748
    1749                         if ( !winbindd_can_contact_domain( domain) )
    1750                                 domain->internal = True;
    1751                        
    17521749                        break;
    17531750                }               
  • branches/samba-3.3.x/source/winbindd/winbindd_domain.c

    r206 r411  
    2525#undef DBGC_CLASS
    2626#define DBGC_CLASS DBGC_WINBIND
    27 
    28 static const struct winbindd_child_dispatch_table domain_dispatch_table[];
    29 
    30 void setup_domain_child(struct winbindd_domain *domain,
    31                         struct winbindd_child *child)
    32 {
    33         setup_child(child, domain_dispatch_table,
    34                     "log.wb", domain->name);
    35 
    36         child->domain = domain;
    37 }
    3827
    3928static const struct winbindd_child_dispatch_table domain_dispatch_table[] = {
     
    118107        }
    119108};
     109
     110void setup_domain_child(struct winbindd_domain *domain,
     111                        struct winbindd_child *child)
     112{
     113        setup_child(child, domain_dispatch_table,
     114                    "log.wb", domain->name);
     115
     116        child->domain = domain;
     117}
  • branches/samba-3.3.x/source/winbindd/winbindd_idmap.c

    r206 r411  
    3939#define DBGC_CLASS DBGC_WINBIND
    4040
    41 static const struct winbindd_child_dispatch_table idmap_dispatch_table[];
    42 
    4341static struct winbindd_child static_idmap_child;
    44 
    45 void init_idmap_child(void)
    46 {
    47         setup_child(&static_idmap_child,
    48                     idmap_dispatch_table,
    49                     "log.winbindd", "idmap");
    50 }
    5142
    5243struct winbindd_child *idmap_child(void)
     
    565556        }
    566557};
     558
     559void init_idmap_child(void)
     560{
     561        setup_child(&static_idmap_child,
     562                    idmap_dispatch_table,
     563                    "log.winbindd", "idmap");
     564}
  • branches/samba-3.3.x/source/winbindd/winbindd_locator.c

    r206 r411  
    2828
    2929
    30 static const struct winbindd_child_dispatch_table locator_dispatch_table[];
    31 
    3230static struct winbindd_child static_locator_child;
    33 
    34 void init_locator_child(void)
    35 {
    36         setup_child(&static_locator_child,
    37                     locator_dispatch_table,
    38                     "log.winbindd", "locator");
    39 }
    4031
    4132struct winbindd_child *locator_child(void)
     
    165156        }
    166157};
     158
     159void init_locator_child(void)
     160{
     161        setup_child(&static_locator_child,
     162                    locator_dispatch_table,
     163                    "log.winbindd", "locator");
     164}
Note: See TracChangeset for help on using the changeset viewer.