Changeset 6d2739944db9944855aa9c849d3cd30414c45a5b
- Timestamp:
- 12/12/05 20:24:55
(3 years ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1134415495 +0000
- git-parent:
[d708c14a27fec63e1bd463189b5272ae458bd877]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1134415495 +0000
- Message:
Don't recurse in symbolic link - fixes #375
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra483f98 |
r6d27399 |
|
| 369 | 369 | return 0; |
|---|
| 370 | 370 | } |
|---|
| | 371 | |
|---|
| 371 | 372 | /***************************************************************************** |
|---|
| 372 | 373 | * DemuxControl: |
|---|
| … | … | |
| 381 | 382 | return VLC_TRUE; |
|---|
| 382 | 383 | } |
|---|
| | 384 | |
|---|
| 383 | 385 | /***************************************************************************** |
|---|
| 384 | 386 | * ReadDir: read a directory and add its content to the list |
|---|
| 385 | 387 | *****************************************************************************/ |
|---|
| 386 | | static int ReadDir( playlist_t *p_playlist, |
|---|
| 387 | | const char *psz_name, int i_mode, playlist_item_t *p_parent ) |
|---|
| | 388 | static int ReadDir( playlist_t *p_playlist, const char *psz_name, |
|---|
| | 389 | int i_mode, playlist_item_t *p_parent ) |
|---|
| 388 | 390 | { |
|---|
| 389 | 391 | struct dirent **pp_dir_content; |
|---|
| … | … | |
| 466 | 468 | #endif |
|---|
| 467 | 469 | { |
|---|
| | 470 | #if defined( S_ISLNK ) |
|---|
| | 471 | /* |
|---|
| | 472 | * FIXME: there is a ToCToU race condition here; but it is rather tricky^W^W |
|---|
| | 473 | * impossible to fix while keeping some kind of portable code, and maybe even |
|---|
| | 474 | * in a non-portable way. |
|---|
| | 475 | */ |
|---|
| | 476 | if( lstat( psz_uri, &stat_data ) |
|---|
| | 477 | || S_ISLNK(stat_data.st_mode) ) |
|---|
| | 478 | { |
|---|
| | 479 | msg_Dbg( p_playlist, "Skipping directory symlink %s", |
|---|
| | 480 | psz_uri ); |
|---|
| | 481 | free( psz_uri ); |
|---|
| | 482 | continue; |
|---|
| | 483 | } |
|---|
| | 484 | #endif |
|---|
| 468 | 485 | if( i_mode == MODE_NONE ) |
|---|
| 469 | 486 | { |
|---|