Fossil SCM
Fix the file_perm() utility routine so that it actually uses the eFType parameter.
Commit
388b5e59822efeb7b5168676f7f74fd85c2df2b410bc9c8e0083976f1a23c970
Parent
90cb54781480b8a…
3 files changed
+1
-1
+1
-1
+1
-1
+1
-1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -294,11 +294,11 @@ | ||
| 294 | 294 | ** |
| 295 | 295 | ** On windows, this routine returns only PERM_REG. |
| 296 | 296 | */ |
| 297 | 297 | int file_perm(const char *zFilename, int eFType){ |
| 298 | 298 | #if !defined(_WIN32) |
| 299 | - if( !getStat(zFilename, RepoFILE) ){ | |
| 299 | + if( !getStat(zFilename, eFType) ){ | |
| 300 | 300 | if( S_ISREG(fx.fileStat.st_mode) && ((S_IXUSR)&fx.fileStat.st_mode)!=0 ) |
| 301 | 301 | return PERM_EXE; |
| 302 | 302 | else if( db_allow_symlinks() && S_ISLNK(fx.fileStat.st_mode) ) |
| 303 | 303 | return PERM_LNK; |
| 304 | 304 | } |
| 305 | 305 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -294,11 +294,11 @@ | |
| 294 | ** |
| 295 | ** On windows, this routine returns only PERM_REG. |
| 296 | */ |
| 297 | int file_perm(const char *zFilename, int eFType){ |
| 298 | #if !defined(_WIN32) |
| 299 | if( !getStat(zFilename, RepoFILE) ){ |
| 300 | if( S_ISREG(fx.fileStat.st_mode) && ((S_IXUSR)&fx.fileStat.st_mode)!=0 ) |
| 301 | return PERM_EXE; |
| 302 | else if( db_allow_symlinks() && S_ISLNK(fx.fileStat.st_mode) ) |
| 303 | return PERM_LNK; |
| 304 | } |
| 305 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -294,11 +294,11 @@ | |
| 294 | ** |
| 295 | ** On windows, this routine returns only PERM_REG. |
| 296 | */ |
| 297 | int file_perm(const char *zFilename, int eFType){ |
| 298 | #if !defined(_WIN32) |
| 299 | if( !getStat(zFilename, eFType) ){ |
| 300 | if( S_ISREG(fx.fileStat.st_mode) && ((S_IXUSR)&fx.fileStat.st_mode)!=0 ) |
| 301 | return PERM_EXE; |
| 302 | else if( db_allow_symlinks() && S_ISLNK(fx.fileStat.st_mode) ) |
| 303 | return PERM_LNK; |
| 304 | } |
| 305 |
+1
-1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -443,11 +443,11 @@ | ||
| 443 | 443 | tar_begin(-1); |
| 444 | 444 | for(i=3; i<g.argc; i++){ |
| 445 | 445 | Blob file; |
| 446 | 446 | blob_zero(&file); |
| 447 | 447 | blob_read_from_file(&file, g.argv[i], eFType); |
| 448 | - tar_add_file(g.argv[i], &file, file_perm(0,0), file_mtime(0,0)); | |
| 448 | + tar_add_file(g.argv[i], &file, file_perm(0,eFType), file_mtime(0,eFType)); | |
| 449 | 449 | blob_reset(&file); |
| 450 | 450 | } |
| 451 | 451 | tar_finish(&zip); |
| 452 | 452 | blob_write_to_file(&zip, g.argv[2]); |
| 453 | 453 | } |
| 454 | 454 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -443,11 +443,11 @@ | |
| 443 | tar_begin(-1); |
| 444 | for(i=3; i<g.argc; i++){ |
| 445 | Blob file; |
| 446 | blob_zero(&file); |
| 447 | blob_read_from_file(&file, g.argv[i], eFType); |
| 448 | tar_add_file(g.argv[i], &file, file_perm(0,0), file_mtime(0,0)); |
| 449 | blob_reset(&file); |
| 450 | } |
| 451 | tar_finish(&zip); |
| 452 | blob_write_to_file(&zip, g.argv[2]); |
| 453 | } |
| 454 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -443,11 +443,11 @@ | |
| 443 | tar_begin(-1); |
| 444 | for(i=3; i<g.argc; i++){ |
| 445 | Blob file; |
| 446 | blob_zero(&file); |
| 447 | blob_read_from_file(&file, g.argv[i], eFType); |
| 448 | tar_add_file(g.argv[i], &file, file_perm(0,eFType), file_mtime(0,eFType)); |
| 449 | blob_reset(&file); |
| 450 | } |
| 451 | tar_finish(&zip); |
| 452 | blob_write_to_file(&zip, g.argv[2]); |
| 453 | } |
| 454 |
+1
-1
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -592,11 +592,11 @@ | ||
| 592 | 592 | } |
| 593 | 593 | zip_open(); |
| 594 | 594 | for(i=3; i<g.argc; i++){ |
| 595 | 595 | blob_zero(&file); |
| 596 | 596 | blob_read_from_file(&file, g.argv[i], eFType); |
| 597 | - zip_add_file(&sArchive, g.argv[i], &file, file_perm(0,0)); | |
| 597 | + zip_add_file(&sArchive, g.argv[i], &file, file_perm(0,eFType)); | |
| 598 | 598 | blob_reset(&file); |
| 599 | 599 | } |
| 600 | 600 | zip_close(&sArchive); |
| 601 | 601 | blob_write_to_file(&zip, g.argv[2]); |
| 602 | 602 | } |
| 603 | 603 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -592,11 +592,11 @@ | |
| 592 | } |
| 593 | zip_open(); |
| 594 | for(i=3; i<g.argc; i++){ |
| 595 | blob_zero(&file); |
| 596 | blob_read_from_file(&file, g.argv[i], eFType); |
| 597 | zip_add_file(&sArchive, g.argv[i], &file, file_perm(0,0)); |
| 598 | blob_reset(&file); |
| 599 | } |
| 600 | zip_close(&sArchive); |
| 601 | blob_write_to_file(&zip, g.argv[2]); |
| 602 | } |
| 603 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -592,11 +592,11 @@ | |
| 592 | } |
| 593 | zip_open(); |
| 594 | for(i=3; i<g.argc; i++){ |
| 595 | blob_zero(&file); |
| 596 | blob_read_from_file(&file, g.argv[i], eFType); |
| 597 | zip_add_file(&sArchive, g.argv[i], &file, file_perm(0,eFType)); |
| 598 | blob_reset(&file); |
| 599 | } |
| 600 | zip_close(&sArchive); |
| 601 | blob_write_to_file(&zip, g.argv[2]); |
| 602 | } |
| 603 |