Ignore:
Timestamp:
May 26, 2009, 9:44:50 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/smbd/filename.c

    r149 r228  
    102102
    103103If the saved_last_component != 0, then the unmodified last component
    104 of the pathname is returned there. This is used in an exceptional
    105 case in reply_mv (so far). If saved_last_component == 0 then nothing
     104of the pathname is returned there. If saved_last_component == 0 then nothing
    106105is returned there.
    107106
     
    196195        }
    197196
    198         /*
    199          * Ensure saved_last_component is valid even if file exists.
    200          */
    201 
    202         if(pp_saved_last_component) {
    203                 end = strrchr_m(orig_path, '/');
    204                 if (end) {
    205                         *pp_saved_last_component = talloc_strdup(ctx, end + 1);
    206                 } else {
    207                         *pp_saved_last_component = talloc_strdup(ctx,
    208                                                         orig_path);
    209                 }
    210         }
    211 
    212197        if (!(name = talloc_strdup(ctx, orig_path))) {
    213198                DEBUG(0, ("talloc_strdup failed\n"));
    214199                return NT_STATUS_NO_MEMORY;
    215         }
    216 
    217         if (!lp_posix_pathnames()) {
    218                 stream = strchr_m(name, ':');
    219 
    220                 if (stream != NULL) {
    221                         char *tmp = talloc_strdup(ctx, stream);
    222                         if (tmp == NULL) {
    223                                 TALLOC_FREE(name);
    224                                 return NT_STATUS_NO_MEMORY;
    225                         }
    226                         *stream = '\0';
    227                         stream = tmp;
    228                 }
    229200        }
    230201
     
    241212                        !conn->short_case_preserve) {
    242213                strnorm(name, lp_defaultcase(SNUM(conn)));
     214        }
     215
     216        /*
     217         * Ensure saved_last_component is valid even if file exists.
     218         */
     219
     220        if(pp_saved_last_component) {
     221                end = strrchr_m(name, '/');
     222                if (end) {
     223                        *pp_saved_last_component = talloc_strdup(ctx, end + 1);
     224                } else {
     225                        *pp_saved_last_component = talloc_strdup(ctx,
     226                                                        name);
     227                }
     228        }
     229
     230        if (!lp_posix_pathnames()) {
     231                stream = strchr_m(name, ':');
     232
     233                if (stream != NULL) {
     234                        char *tmp = talloc_strdup(ctx, stream);
     235                        if (tmp == NULL) {
     236                                TALLOC_FREE(name);
     237                                return NT_STATUS_NO_MEMORY;
     238                        }
     239                        *stream = '\0';
     240                        stream = tmp;
     241                }
    243242        }
    244243
Note: See TracChangeset for help on using the changeset viewer.