Changeset 228 for branches/samba-3.2.x/source/smbd/filename.c
- Timestamp:
- May 26, 2009, 9:44:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/smbd/filename.c
r149 r228 102 102 103 103 If 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 104 of the pathname is returned there. If saved_last_component == 0 then nothing 106 105 is returned there. 107 106 … … 196 195 } 197 196 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 212 197 if (!(name = talloc_strdup(ctx, orig_path))) { 213 198 DEBUG(0, ("talloc_strdup failed\n")); 214 199 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 }229 200 } 230 201 … … 241 212 !conn->short_case_preserve) { 242 213 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 } 243 242 } 244 243
Note:
See TracChangeset
for help on using the changeset viewer.