From d62e41d60110ee591c74e7f7bc7ff388cdd088bc Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Sun, 26 Dec 2010 17:02:14 +0000 Subject: [PATCH] *Removed ntfs/fat source and added them as custom libs (makes them easier to update later) *Added sources of the custom libs to the branches *Fixed crash when switching from list layout to grid/carousel layout *Removed 1:1 copy option because its meaningless and almost the same as installing all partitions *Fixed install partition selection. This option needs a reset. Go to settings and reselect your option for this. *Fixed schinese and tchinese language modes (filename bugs. has to be schinese.lang and tchinese.lang like on SVN) *Fixed bug in sound buffer circle *Fixed incorrect behaviour of x-flip when selecting system like (thx Cyan for the patch) *Accept ios revision 65535 for Waninkokos IOSes (thx to PPSainity for pointing it out) *Merged the new theming style branch into trunk. Just as a reminder: ALL old themes will not work until the themers did port it to the new style! *Removed old theme style completely Theme example: The example file of the theme is the Default.them file. It can be found in the SVN trunk. Change in loading of themes: When selecting a theme now a list of all .them files in a folder is displayed. The image folder of that theme has to be in the same folder as the .them file. The image path is defined in the head of the .them file in the line with "Image-Folder: Example\n". --- HBC/META.XML | 4 +- Languages/czech.lang | 453 +- Languages/danish.lang | 492 +- Languages/dutch.lang | 486 +- Languages/english.lang | 270 +- Languages/finnish.lang | 432 +- Languages/french.lang | 501 +- Languages/german.lang | 501 +- Languages/hungarian.lang | 478 +- Languages/italian.lang | 504 +- Languages/japanese.lang | 507 +- Languages/korean.lang | 447 +- Languages/norwegian.lang | 429 +- Languages/polish.lang | 466 +- Languages/portuguese_br.lang | 498 +- Languages/portuguese_pt.lang | 507 +- Languages/russian.lang | 484 +- Languages/schinese.lang | 453 +- Languages/spanish.lang | 501 +- Languages/swedish.lang | 466 +- Languages/tchinese.lang | 507 +- Languages/thai.lang | 462 +- Languages/turkish.lang | 456 +- Makefile | 29 +- Themes/Default.them | 405 ++ gui.pnproj | 2 +- source/FileOperations/DirList.cpp | 4 +- source/GameBootProcess.cpp | 26 +- source/SoundOperations/BufferCircle.hpp | 2 +- source/cheats/cheatmenu.cpp | 4 +- source/libs/libext2fs/bitops.h | 638 -- source/libs/libext2fs/com_err.h | 70 - source/libs/libext2fs/ext2_err.h | 152 - source/libs/libext2fs/ext2_ext_attr.h | 71 - source/libs/libext2fs/ext2_frag.c | 60 - source/libs/libext2fs/ext2_frag.j | 107 - source/libs/libext2fs/ext2_fs.h | 798 --- source/libs/libext2fs/ext2_internal.h | 102 - source/libs/libext2fs/ext2_io.h | 136 - source/libs/libext2fs/ext2_types.h | 18 - source/libs/libext2fs/ext2fs.h | 1572 ----- source/libs/libext2fs/ext3_extents.h | 109 - source/libs/libext2fs/libcustomext2fs.a | Bin 398524 -> 458466 bytes source/libs/libext2fs/mem_allocate.h | 23 - source/libs/libfat/bit_ops.h | 57 - source/libs/libfat/cache.h | 130 - source/libs/libfat/common.h | 79 - source/libs/libfat/directory.c | 1120 --- source/libs/libfat/directory.h | 178 - source/libs/libfat/disc.h | 110 - source/libs/libfat/fat.h | 104 - source/libs/libfat/fat_cache.c | 365 - source/libs/libfat/fat_disc.c | 105 - source/libs/libfat/fatdir.c | 610 -- source/libs/libfat/fatdir.h | 73 - source/libs/libfat/fatfile.c | 1184 ---- source/libs/libfat/fatfile.h | 105 - source/libs/libfat/fatfile_frag.h | 16 + source/libs/libfat/file_allocation_table.c | 383 -- source/libs/libfat/file_allocation_table.h | 70 - source/libs/libfat/filetime.c | 107 - source/libs/libfat/filetime.h | 41 - source/libs/libfat/libcustomfat.a | Bin 0 -> 76192 bytes source/libs/libfat/libfat.c | 249 - source/libs/libfat/libfatversion.h | 10 - source/libs/libfat/lock.h | 56 - source/libs/libfat/mem_allocate.h | 49 - source/libs/libfat/partition.c | 318 - source/libs/libfat/partition.h | 89 - source/libs/libntfs/acls.c | 4293 ------------ source/libs/libntfs/acls.h | 199 - source/libs/libntfs/attrib.c | 6401 ------------------ source/libs/libntfs/attrib.h | 375 - source/libs/libntfs/attrib_frag.c | 5914 ---------------- source/libs/libntfs/attrlist.c | 314 - source/libs/libntfs/attrlist.h | 51 - source/libs/libntfs/bit_ops.h | 57 - source/libs/libntfs/bitmap.c | 300 - source/libs/libntfs/bitmap.h | 96 - source/libs/libntfs/bootsect.c | 285 - source/libs/libntfs/bootsect.h | 42 - source/libs/libntfs/cache.c | 609 -- source/libs/libntfs/cache.h | 119 - source/libs/libntfs/cache2.c | 374 - source/libs/libntfs/cache2.h | 135 - source/libs/libntfs/collate.c | 271 - source/libs/libntfs/collate.h | 34 - source/libs/libntfs/compat.c | 250 - source/libs/libntfs/compat.h | 86 - source/libs/libntfs/compress.c | 1831 ----- source/libs/libntfs/compress.h | 41 - source/libs/libntfs/config.h | 375 - source/libs/libntfs/debug.c | 79 - source/libs/libntfs/debug.h | 47 - source/libs/libntfs/device.c | 730 -- source/libs/libntfs/device.h | 128 - source/libs/libntfs/device_io.c | 40 - source/libs/libntfs/device_io.h | 82 - source/libs/libntfs/dir.c | 2660 -------- source/libs/libntfs/dir.h | 128 - source/libs/libntfs/efs.c | 439 -- source/libs/libntfs/efs.h | 30 - source/libs/libntfs/endians.h | 203 - source/libs/libntfs/gekko_io.c | 647 -- source/libs/libntfs/gekko_io.h | 56 - source/libs/libntfs/index.c | 2063 ------ source/libs/libntfs/index.h | 167 - source/libs/libntfs/inode.c | 1566 ----- source/libs/libntfs/inode.h | 225 - source/libs/libntfs/layout.h | 2661 -------- source/libs/libntfs/lcnalloc.c | 771 --- source/libs/libntfs/lcnalloc.h | 51 - source/libs/libntfs/libcustomntfs.a | Bin 0 -> 582894 bytes source/libs/libntfs/logfile.c | 737 -- source/libs/libntfs/logfile.h | 394 -- source/libs/libntfs/logging.c | 613 -- source/libs/libntfs/logging.h | 118 - source/libs/libntfs/mem_allocate.h | 44 - source/libs/libntfs/mft.c | 1909 ------ source/libs/libntfs/mft.h | 132 - source/libs/libntfs/misc.c | 61 - source/libs/libntfs/misc.h | 30 - source/libs/libntfs/mst.c | 231 - source/libs/libntfs/mst.h | 34 - source/libs/libntfs/ntfs.c | 726 -- source/libs/libntfs/ntfs.h | 150 - source/libs/libntfs/ntfsdir.c | 636 -- source/libs/libntfs/ntfsdir.h | 68 - source/libs/libntfs/ntfsfile.c | 526 -- source/libs/libntfs/ntfsfile.h | 65 - source/libs/libntfs/ntfsfile_frag.c | 579 -- source/libs/libntfs/ntfsfile_frag.h | 15 + source/libs/libntfs/ntfsinternal.c | 846 --- source/libs/libntfs/ntfsinternal.h | 178 - source/libs/libntfs/ntfstime.h | 121 - source/libs/libntfs/object_id.c | 637 -- source/libs/libntfs/object_id.h | 35 - source/libs/libntfs/param.h | 82 - source/libs/libntfs/reparse.c | 1222 ---- source/libs/libntfs/reparse.h | 39 - source/libs/libntfs/runlist.c | 2181 ------ source/libs/libntfs/runlist.h | 90 - source/libs/libntfs/security.c | 5184 -------------- source/libs/libntfs/security.h | 357 - source/libs/libntfs/support.h | 85 - source/libs/libntfs/types.h | 133 - source/libs/libntfs/unistr.c | 1438 ---- source/libs/libntfs/unistr.h | 118 - source/libs/libntfs/volume.c | 1723 ----- source/libs/libntfs/volume.h | 303 - source/libwiigui/OptionList.cpp | 3 + source/libwiigui/gui_customoptionbrowser.cpp | 6 +- source/libwiigui/gui_gamebrowser.cpp | 6 +- source/libwiigui/gui_gamecarousel.cpp | 2 +- source/libwiigui/gui_gamegrid.cpp | 17 +- source/libwiigui/gui_gamegrid.h | 2 + source/main.cpp | 2 +- source/menu.cpp | 2 +- source/menu/GameBrowseMenu.cpp | 207 +- source/menu/menu_partition_selection.cpp | 10 +- source/prompts/DiscBrowser.cpp | 2 +- source/prompts/GameWindow.cpp | 26 +- source/prompts/ProgressWindow.cpp | 18 +- source/prompts/PromptWindows.cpp | 62 +- source/prompts/TitleBrowser.cpp | 4 +- source/prompts/filebrowser.cpp | 2 +- source/settings/CSettings.cpp | 21 +- source/settings/CSettings.h | 1 - source/settings/SettingsPrompts.cpp | 224 +- source/settings/SettingsPrompts.h | 1 + source/settings/menus/CustomPathsSM.cpp | 14 +- source/settings/menus/FlyingButtonsMenu.cpp | 2 +- source/settings/menus/GameLoadSM.cpp | 42 +- source/settings/menus/IndGameLoadSM.cpp | 2 +- source/settings/menus/SettingsMenu.cpp | 1 - source/system/IosLoader.cpp | 4 +- source/themes/CTheme.cpp | 372 +- source/themes/CTheme.h | 174 +- source/themes/Theme_Downloader.cpp | 14 +- source/themes/gettheme.c | 273 + source/themes/gettheme.h | 25 + source/usbloader/frag.c | 5 +- source/usbloader/frag.h | 14 +- source/usbloader/wbfs/wbfs_fat.cpp | 21 +- source/usbloader/wbfs/wbfs_ntfs.cpp | 2 +- source/usbloader/wbfs/wbfs_wbfs.cpp | 27 +- source/utils/encrypt.c | 4 +- source/wad/wad.cpp | 30 +- 188 files changed, 6512 insertions(+), 72437 deletions(-) create mode 100644 Themes/Default.them delete mode 100644 source/libs/libext2fs/bitops.h delete mode 100644 source/libs/libext2fs/com_err.h delete mode 100644 source/libs/libext2fs/ext2_err.h delete mode 100644 source/libs/libext2fs/ext2_ext_attr.h delete mode 100644 source/libs/libext2fs/ext2_frag.c delete mode 100644 source/libs/libext2fs/ext2_frag.j delete mode 100644 source/libs/libext2fs/ext2_fs.h delete mode 100644 source/libs/libext2fs/ext2_internal.h delete mode 100644 source/libs/libext2fs/ext2_io.h delete mode 100644 source/libs/libext2fs/ext2_types.h delete mode 100644 source/libs/libext2fs/ext2fs.h delete mode 100644 source/libs/libext2fs/ext3_extents.h delete mode 100644 source/libs/libext2fs/mem_allocate.h delete mode 100644 source/libs/libfat/bit_ops.h delete mode 100644 source/libs/libfat/cache.h delete mode 100644 source/libs/libfat/common.h delete mode 100644 source/libs/libfat/directory.c delete mode 100644 source/libs/libfat/directory.h delete mode 100644 source/libs/libfat/disc.h delete mode 100644 source/libs/libfat/fat.h delete mode 100644 source/libs/libfat/fat_cache.c delete mode 100644 source/libs/libfat/fat_disc.c delete mode 100644 source/libs/libfat/fatdir.c delete mode 100644 source/libs/libfat/fatdir.h delete mode 100644 source/libs/libfat/fatfile.c delete mode 100644 source/libs/libfat/fatfile.h create mode 100644 source/libs/libfat/fatfile_frag.h delete mode 100644 source/libs/libfat/file_allocation_table.c delete mode 100644 source/libs/libfat/file_allocation_table.h delete mode 100644 source/libs/libfat/filetime.c delete mode 100644 source/libs/libfat/filetime.h create mode 100644 source/libs/libfat/libcustomfat.a delete mode 100644 source/libs/libfat/libfat.c delete mode 100644 source/libs/libfat/libfatversion.h delete mode 100644 source/libs/libfat/lock.h delete mode 100644 source/libs/libfat/mem_allocate.h delete mode 100644 source/libs/libfat/partition.c delete mode 100644 source/libs/libfat/partition.h delete mode 100644 source/libs/libntfs/acls.c delete mode 100644 source/libs/libntfs/acls.h delete mode 100644 source/libs/libntfs/attrib.c delete mode 100644 source/libs/libntfs/attrib.h delete mode 100644 source/libs/libntfs/attrib_frag.c delete mode 100644 source/libs/libntfs/attrlist.c delete mode 100644 source/libs/libntfs/attrlist.h delete mode 100644 source/libs/libntfs/bit_ops.h delete mode 100644 source/libs/libntfs/bitmap.c delete mode 100644 source/libs/libntfs/bitmap.h delete mode 100644 source/libs/libntfs/bootsect.c delete mode 100644 source/libs/libntfs/bootsect.h delete mode 100644 source/libs/libntfs/cache.c delete mode 100644 source/libs/libntfs/cache.h delete mode 100644 source/libs/libntfs/cache2.c delete mode 100644 source/libs/libntfs/cache2.h delete mode 100644 source/libs/libntfs/collate.c delete mode 100644 source/libs/libntfs/collate.h delete mode 100644 source/libs/libntfs/compat.c delete mode 100644 source/libs/libntfs/compat.h delete mode 100644 source/libs/libntfs/compress.c delete mode 100644 source/libs/libntfs/compress.h delete mode 100644 source/libs/libntfs/config.h delete mode 100644 source/libs/libntfs/debug.c delete mode 100644 source/libs/libntfs/debug.h delete mode 100644 source/libs/libntfs/device.c delete mode 100644 source/libs/libntfs/device.h delete mode 100644 source/libs/libntfs/device_io.c delete mode 100644 source/libs/libntfs/device_io.h delete mode 100644 source/libs/libntfs/dir.c delete mode 100644 source/libs/libntfs/dir.h delete mode 100644 source/libs/libntfs/efs.c delete mode 100644 source/libs/libntfs/efs.h delete mode 100644 source/libs/libntfs/endians.h delete mode 100644 source/libs/libntfs/gekko_io.c delete mode 100644 source/libs/libntfs/gekko_io.h delete mode 100644 source/libs/libntfs/index.c delete mode 100644 source/libs/libntfs/index.h delete mode 100644 source/libs/libntfs/inode.c delete mode 100644 source/libs/libntfs/inode.h delete mode 100644 source/libs/libntfs/layout.h delete mode 100644 source/libs/libntfs/lcnalloc.c delete mode 100644 source/libs/libntfs/lcnalloc.h create mode 100644 source/libs/libntfs/libcustomntfs.a delete mode 100644 source/libs/libntfs/logfile.c delete mode 100644 source/libs/libntfs/logfile.h delete mode 100644 source/libs/libntfs/logging.c delete mode 100644 source/libs/libntfs/logging.h delete mode 100644 source/libs/libntfs/mem_allocate.h delete mode 100644 source/libs/libntfs/mft.c delete mode 100644 source/libs/libntfs/mft.h delete mode 100644 source/libs/libntfs/misc.c delete mode 100644 source/libs/libntfs/misc.h delete mode 100644 source/libs/libntfs/mst.c delete mode 100644 source/libs/libntfs/mst.h delete mode 100644 source/libs/libntfs/ntfs.c delete mode 100644 source/libs/libntfs/ntfs.h delete mode 100644 source/libs/libntfs/ntfsdir.c delete mode 100644 source/libs/libntfs/ntfsdir.h delete mode 100644 source/libs/libntfs/ntfsfile.c delete mode 100644 source/libs/libntfs/ntfsfile.h delete mode 100644 source/libs/libntfs/ntfsfile_frag.c create mode 100644 source/libs/libntfs/ntfsfile_frag.h delete mode 100644 source/libs/libntfs/ntfsinternal.c delete mode 100644 source/libs/libntfs/ntfsinternal.h delete mode 100644 source/libs/libntfs/ntfstime.h delete mode 100644 source/libs/libntfs/object_id.c delete mode 100644 source/libs/libntfs/object_id.h delete mode 100644 source/libs/libntfs/param.h delete mode 100644 source/libs/libntfs/reparse.c delete mode 100644 source/libs/libntfs/reparse.h delete mode 100644 source/libs/libntfs/runlist.c delete mode 100644 source/libs/libntfs/runlist.h delete mode 100644 source/libs/libntfs/security.c delete mode 100644 source/libs/libntfs/security.h delete mode 100644 source/libs/libntfs/support.h delete mode 100644 source/libs/libntfs/types.h delete mode 100644 source/libs/libntfs/unistr.c delete mode 100644 source/libs/libntfs/unistr.h delete mode 100644 source/libs/libntfs/volume.c delete mode 100644 source/libs/libntfs/volume.h create mode 100644 source/themes/gettheme.c create mode 100644 source/themes/gettheme.h diff --git a/HBC/META.XML b/HBC/META.XML index e54d45a5..baacf47f 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r1015 - 201012181321 + 1.0 r1018 + 201012212002 Loads games from USB-devices USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times. The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller. diff --git a/Languages/czech.lang b/Languages/czech.lang index 5ce1b23f..14f3cec0 100644 --- a/Languages/czech.lang +++ b/Languages/czech.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: David Jelinek (djelinek@hotmail.com) \n" "Language-Team: r823 - last version on http://djelinek.sweb.cz/_USBLoderGX/czech.lang \n" @@ -25,54 +25,15 @@ msgstr " byl uložen. Soubor nebyl zkontrolován. Nekteré cásti kódu nemusí msgid " is not on the server." msgstr " není na serveru" -msgid "0 (Everyone)" -msgstr "0 (Každý)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Díte 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 hodina" - -msgid "10 min" -msgstr "10 minut" - -msgid "2 (Teen 12+)" -msgstr "2 (Mladistvý 12+)" - -msgid "20 min" -msgstr "20 minut" - msgid "2D Cover Path" msgstr "Cesta k 2D obalum" -msgid "3 (Mature 16+)" -msgstr "3 (Zralý 16+)" - -msgid "3 min" -msgstr "3 minuty" - -msgid "30 min" -msgstr "30 minut" - msgid "3D Cover Path" msgstr "Cesta k 3D obalum" msgid "3D Covers" msgstr "3D Obaly" -msgid "4 (Adults Only 18+)" -msgstr "4 (Pouze dospelí 18+)" - -msgid "5 min" -msgstr "5 minut" - msgid ">> Deleting tickets..." msgstr ">> Odstraňuji tikety..." @@ -136,19 +97,13 @@ msgstr "Všechny možnosti USB Loader GX jsou odemceny" msgid "Alternate DOL" msgstr "Náhradní DOL" -msgid "An Error occured" -msgstr "Došlo k chybe" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Jazyk aplikace" msgid "Apr" msgstr "Dub" -msgid "Are you sure you want to enable Parent Control?" +msgid "Are you sure you want to lock USB Loader GX?" msgstr "" msgid "Are you sure you want to reset?" @@ -166,9 +121,6 @@ msgstr "Autor:" msgid "AutoInit Network" msgstr "Automatický start síte" -msgid "AutoPatch" -msgstr "" - msgid "BCA Codes Path" msgstr "" @@ -199,9 +151,6 @@ msgstr "" msgid "Boot?" msgstr "Spustit?" -msgid "Both" -msgstr "Oboje" - msgid "Can't be formatted" msgstr "Nelze naformátovat" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "Soubor s cheaty je prázdný" -msgid "Checking for Updates" -msgstr "Zjištuji dostupné aktualiazce" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "Konzole" -msgid "Console Default" -msgstr "Puvodní nastavení konzole" - msgid "Console Locked" msgstr "Konzole uzamcena" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Nelze vytvorit GCT soubor" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Zásluhy" msgid "Custom Paths" msgstr "Vlastní cesty" -msgid "Customs/Original" -msgstr "Upravené/Originál" - msgid "DOL Path" msgstr "Cesta k DOL" @@ -365,15 +309,9 @@ msgstr "Stažení potisku DVD" msgid "Disc Artwork Path" msgstr "Cesta k potiskum DVD" -msgid "Disc Default" -msgstr "Puvodní nastavení disku" - msgid "Disc Images" msgstr "Potisky DVD" -msgid "DiskFlip" -msgstr "" - msgid "Display" msgstr "Zobrazení" @@ -404,6 +342,9 @@ msgstr "Prejete si stáhnout toto téma?" msgid "Do you want to format:" msgstr "Prejete si formátovat" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Prejete si použít jiný DOL, který je správný?" @@ -434,26 +375,26 @@ msgstr "Stažení dokonceno" msgid "Download request failed." msgstr "Požadavek na stažení selhal." -msgid "Downloading" -msgstr "Stahování" - msgid "Downloading Page List:" msgstr "Stahuji stránku seznamu:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Stahuji soubor" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Stahuji obrázek:" -msgid "Dutch" -msgstr "Dánsky" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "CHYBA" @@ -464,9 +405,6 @@ msgstr "CHYBA:" msgid "ERROR: Can't set up theme." msgstr "" -msgid "English" -msgstr "Anglicky" - msgid "Error" msgstr "Chyba" @@ -476,15 +414,24 @@ msgstr "Chyba !" msgid "Error 002 fix" msgstr "Oprava chyby 002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Nelze císt disk" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Chyba behem prenosu dat." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Nemohu rozbalit." msgid "Failed to open partition" msgstr "Nelze otevrít diskový oddíl" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "Ún" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formát" @@ -545,15 +486,9 @@ msgstr "Formátuji, cekejte prosím ..." msgid "Free Space" msgstr "Volné místo" -msgid "French" -msgstr "Francouzky" - msgid "Full Shutdown" msgstr "Úplné vypnutí" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "Cesta pro cheat kódy" @@ -566,9 +501,6 @@ msgstr "Nastavení GUI" msgid "GXtheme.cfg not found in any subfolder." msgstr "" -msgid "Game ID" -msgstr "ID hry" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Nahrání hry" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Region hry" - msgid "Game Size" msgstr "Velikost hry" @@ -599,18 +528,12 @@ msgstr "Hra je již nainstalována:" msgid "Game partition" msgstr "" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Hry" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Nemecky" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Vložte SD kartu pro tuto možnost" msgid "Install" msgstr "Instalace" -msgid "Install 1:1 Copy" -msgstr "" - msgid "Install Error!" msgstr "Chyba pri instalaci" @@ -691,21 +611,12 @@ msgstr "Instaluji titul... Ok!" msgid "Installing wad" msgstr "Instaluji WAD" -msgid "Invalid PIN code" -msgstr "" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Zdá se, že máte informace, které by pro nás mohly být užitecné. Odešlete prosím tuto informaci na náš DEV tým." -msgid "Italian" -msgstr "Italsky" - msgid "Jan" msgstr "Led" -msgid "Japanese" -msgstr "Japonsky" - msgid "July" msgstr "Cervenec" @@ -718,9 +629,6 @@ msgstr "Držet" msgid "Keyboard" msgstr "Klávesnice" -msgid "Korean" -msgstr "Korejsky" - msgid "Language File" msgstr "Jazykový soubor" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Cesta k jazykum zmenena" -msgid "Left" -msgstr "Vlevo" - -msgid "Like SysMenu" -msgstr "Jako hlavní menu" - msgid "Load" msgstr "Spustit" -msgid "Load From SD/USB" -msgstr "Nahrát z SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Nahrát soubor z: %s ?" @@ -752,6 +651,9 @@ msgstr "Nahrát soubor z: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Spustit tento DOL jako náhradní DOL?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Nahrávám puvodní jazyk" @@ -761,18 +663,9 @@ msgstr "Nahrávám puvodní hudbu" msgid "Lock Console" msgstr "Zamcení konzole" -msgid "Locked" -msgstr "Zamceno" - -msgid "Loop Directory" +msgid "Lock USB Loader GX" msgstr "" -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" -msgstr "Zvuková smyčka" - msgid "Mar" msgstr "Brez" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "Hlasitost hudby" -msgid "Neither" -msgstr "Žádný" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Detekován nový disk" -msgid "Next" -msgstr "Další" - msgid "No" msgstr "Ne" @@ -839,12 +729,6 @@ msgstr "Není dostupná žádná aktualizace." msgid "No themes found on the site." msgstr "Žádné téma nebylo nalezeno na serveru." -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "Normální" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "Vypnuto" msgid "OK" msgstr "" -msgid "ON" -msgstr "Zapnuto" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Oficiální místo:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Pouze Upravené" - -msgid "Only Original" -msgstr "Pouze originál" - -msgid "Only for Install" -msgstr "Pouze pro instalaci" - -msgid "Original/Customs" -msgstr "Originál/Upravené" - msgid "Parental Control" msgstr "Rodicovský zámek" -msgid "Parental Control disabled" -msgstr "" - msgid "Partition" msgstr "Oddíl" @@ -947,9 +813,6 @@ msgstr "Spušteno" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "Cekejte prosím..." msgid "Power off the Wii" msgstr "Vypnout Wii" -msgid "Prev" -msgstr "Predchozí" - msgid "Prompts Buttons" msgstr "Potvrzovací tlacítka" @@ -974,9 +834,6 @@ msgstr "Publikoval " msgid "Quick Boot" msgstr "Rychlé zavedení" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "Nacítám WAD data... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Návrat do Wii nabídky" -msgid "Right" -msgstr "Vpravo" - msgid "Rumble" msgstr "Vibrace" -msgid "SChinese" -msgstr "Cínsky" - msgid "SFX Volume" msgstr "Hlasitost SFX" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Vyberte DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Zárí" @@ -1085,15 +933,6 @@ msgstr "Zvuk" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Zvuk+BGM" - -msgid "Sound+Quiet" -msgstr "Zvuk+ticho" - -msgid "Spanish" -msgstr "Španelsky" - msgid "Special thanks to:" msgstr "Speciální podekování pro" @@ -1121,24 +960,18 @@ msgstr "Úspešne rozbalené téma." msgid "Successfully installed:" msgstr "Úspešne nainstalováno" -msgid "System Default" -msgstr "Puvodní nastavení systému" - -msgid "TChinese" -msgstr "Cínsky" - msgid "TXT Cheatcodes Path" msgstr "Cesta k TXT cheatum" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Zadaný adresár neexistuje. Chcete ho vytvorit?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "WAD soubor byl nainstalován, ale nelze smazat z SD karty" +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "Instalace WAD souboru selhala s chybou %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Cesta pro uložení témat" @@ -1152,6 +985,9 @@ msgstr "Cesta k tématum" msgid "Theme Title:" msgstr "Název tématu" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Prenos selhal" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB zarízení nenalezeno" msgid "USB Loader GX is protected" msgstr "USB Loader GX je zabezpecen" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Nelze otevrít WAD, který byl nyní stažen (%s)." - msgid "Uninstall" msgstr "Odinstalace" @@ -1201,15 +1039,12 @@ msgstr "Odinstalace WAD" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" +msgid "Unlock USB Loader GX" msgstr "" msgid "Unlock console to use this option." msgstr "Odemknete konzoli pro tuto akci." -msgid "Unlocked" -msgstr "Odemceno" - msgid "Unsupported format, try to extract manually." msgstr "Nepodporovaný formát" @@ -1234,21 +1069,12 @@ msgstr "Zaktualizuj vsechny jazykové soubory" msgid "Update failed" msgstr "Aktualizace selhala" -msgid "Update to" -msgstr "Aktualizováno na" - -msgid "Updating" -msgstr "Aktualizuji" - -msgid "Updating Language Files..." -msgstr "Aktualizuji jazykové soubory..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Aktualizuji jazykové soubory:" -msgid "Updating WiiTDB.zip" -msgstr "Aktualizuji WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Odeslaný ZIP soubor nainstalován do adresáre homebrew" @@ -1280,9 +1106,6 @@ msgstr "Co si prejete zaktualizovat?" msgid "WiFi Features" msgstr "WiFi možnosti" -msgid "Widescreen Fix" -msgstr "Korekce širokoúhlé obrazovky" - msgid "Wii Menu" msgstr "Wii menu" @@ -1310,9 +1133,6 @@ msgstr "Ano" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "" - msgid "You need to select or format a partition" msgstr "" @@ -1377,6 +1197,177 @@ msgstr "z " msgid "seconds left" msgstr "sekund zbývá" +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Každý)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Díte 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 hodina" + +#~ msgid "10 min" +#~ msgstr "10 minut" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Mladistvý 12+)" + +#~ msgid "20 min" +#~ msgstr "20 minut" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Zralý 16+)" + +#~ msgid "3 min" +#~ msgstr "3 minuty" + +#~ msgid "30 min" +#~ msgstr "30 minut" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Pouze dospelí 18+)" + +#~ msgid "5 min" +#~ msgstr "5 minut" + +#~ msgid "An Error occured" +#~ msgstr "Došlo k chybe" + +#~ msgid "Both" +#~ msgstr "Oboje" + +#~ msgid "Checking for Updates" +#~ msgstr "Zjištuji dostupné aktualiazce" + +#~ msgid "Console Default" +#~ msgstr "Puvodní nastavení konzole" + +#~ msgid "Customs/Original" +#~ msgstr "Upravené/Originál" + +#~ msgid "Disc Default" +#~ msgstr "Puvodní nastavení disku" + +#~ msgid "Downloading" +#~ msgstr "Stahování" + +#~ msgid "Dutch" +#~ msgstr "Dánsky" + +#~ msgid "English" +#~ msgstr "Anglicky" + +#~ msgid "French" +#~ msgstr "Francouzky" + +#~ msgid "Game ID" +#~ msgstr "ID hry" + +#~ msgid "Game Region" +#~ msgstr "Region hry" + +#~ msgid "German" +#~ msgstr "Nemecky" + +#~ msgid "Italian" +#~ msgstr "Italsky" + +#~ msgid "Japanese" +#~ msgstr "Japonsky" + +#~ msgid "Korean" +#~ msgstr "Korejsky" + +#~ msgid "Left" +#~ msgstr "Vlevo" + +#~ msgid "Like SysMenu" +#~ msgstr "Jako hlavní menu" + +#~ msgid "Load From SD/USB" +#~ msgstr "Nahrát z SD/USB" + +#~ msgid "Locked" +#~ msgstr "Zamceno" + +#~ msgid "Loop Sound" +#~ msgstr "Zvuková smyčka" + +#~ msgid "Neither" +#~ msgstr "Žádný" + +#~ msgid "Next" +#~ msgstr "Další" + +#~ msgid "Normal" +#~ msgstr "Normální" + +#~ msgid "ON" +#~ msgstr "Zapnuto" + +#~ msgid "Only Customs" +#~ msgstr "Pouze Upravené" + +#~ msgid "Only Original" +#~ msgstr "Pouze originál" + +#~ msgid "Only for Install" +#~ msgstr "Pouze pro instalaci" + +#~ msgid "Original/Customs" +#~ msgstr "Originál/Upravené" + +#~ msgid "Prev" +#~ msgstr "Predchozí" + +#~ msgid "Right" +#~ msgstr "Vpravo" + +#~ msgid "SChinese" +#~ msgstr "Cínsky" + +#~ msgid "Sound+BGM" +#~ msgstr "Zvuk+BGM" + +#~ msgid "Sound+Quiet" +#~ msgstr "Zvuk+ticho" + +#~ msgid "Spanish" +#~ msgstr "Španelsky" + +#~ msgid "System Default" +#~ msgstr "Puvodní nastavení systému" + +#~ msgid "TChinese" +#~ msgstr "Cínsky" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "WAD soubor byl nainstalován, ale nelze smazat z SD karty" + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "Instalace WAD souboru selhala s chybou %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Nelze otevrít WAD, který byl nyní stažen (%s)." + +#~ msgid "Unlocked" +#~ msgstr "Odemceno" + +#~ msgid "Update to" +#~ msgstr "Aktualizováno na" + +#~ msgid "Updating" +#~ msgstr "Aktualizuji" + +#~ msgid "Updating Language Files..." +#~ msgstr "Aktualizuji jazykové soubory..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Aktualizuji WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Korekce širokoúhlé obrazovky" + #~ msgid "Back to Wii Menu" #~ msgstr "Zpet do Wii nabídky" diff --git a/Languages/danish.lang b/Languages/danish.lang index f695b2e7..66573993 100644 --- a/Languages/danish.lang +++ b/Languages/danish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: dorf[dk]\n" "Language-Team: dorf[dk]\n" @@ -25,54 +25,15 @@ msgstr " er blevet gemt. Koderne er ikke blevet kontrolleret. Nogle af koderne v msgid " is not on the server." msgstr " er ikke på serveren." -msgid "0 (Everyone)" -msgstr "0 (Alle)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Børn 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 time" - -msgid "10 min" -msgstr "10 min." - -msgid "2 (Teen 12+)" -msgstr "2 (Unge teenagere 12+)" - -msgid "20 min" -msgstr "20 min." - msgid "2D Cover Path" msgstr "Sti til 2-d covers" -msgid "3 (Mature 16+)" -msgstr "3 (Modne teenagere 16+)" - -msgid "3 min" -msgstr "3 min." - -msgid "30 min" -msgstr "30 min." - msgid "3D Cover Path" msgstr "Sti til 3-d covers" msgid "3D Covers" msgstr "3D-Covers" -msgid "4 (Adults Only 18+)" -msgstr "4 (Voksne 18+)" - -msgid "5 min" -msgstr "5 min." - msgid ">> Deleting tickets..." msgstr ">> Sletter tickets..." @@ -136,20 +97,14 @@ msgstr "Alle USB Loader GX's funktioner er låst op." msgid "Alternate DOL" msgstr "Alternativ DOL" -msgid "An Error occured" -msgstr "Der skete en fejl" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Programsprog" msgid "Apr" msgstr "" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Skal børnelåsen slås til?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Forfatter:" msgid "AutoInit Network" msgstr "AutoInit net" -msgid "AutoPatch" -msgstr "" - msgid "BCA Codes Path" msgstr "Sti til BCA koder" @@ -199,9 +151,6 @@ msgstr "" msgid "Boot?" msgstr "Genstart?" -msgid "Both" -msgstr "Begge" - msgid "Can't be formatted" msgstr "Kan ikke formatteres" @@ -226,9 +175,6 @@ msgstr "Ændre sti til musik" msgid "Cheatfile is blank" msgstr "Cheatfilen er tom" -msgid "Checking for Updates" -msgstr "Leder efter opdateringer" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Forbindelsen er væk..." msgid "Console" msgstr "Konsol" -msgid "Console Default" -msgstr "Konsol-standard" - msgid "Console Locked" msgstr "Konsollen er låst" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Kunne ikke oprette GCT-fil" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Lavet af:" msgid "Custom Paths" msgstr "Sti-indstillinger" -msgid "Customs/Original" -msgstr "Tilpassede/Originale" - msgid "DOL Path" msgstr "Stil til DOL" @@ -365,15 +309,9 @@ msgstr "Download DVD-billeder" msgid "Disc Artwork Path" msgstr "Sti til DVD-billeder" -msgid "Disc Default" -msgstr "Spillets standard" - msgid "Disc Images" msgstr "DVD-billeder" -msgid "DiskFlip" -msgstr "" - msgid "Display" msgstr "Spilinfo." @@ -404,6 +342,9 @@ msgstr "Skal dette tema downloades?" msgid "Do you want to format:" msgstr "Vil du formatere:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Skal den alternative DOL, der med sikkerhed er korrekt, bruges?" @@ -434,26 +375,26 @@ msgstr "Download færdig" msgid "Download request failed." msgstr "Anmodning om download mislykkedes." -msgid "Downloading" -msgstr "Downloader" - msgid "Downloading Page List:" msgstr "Downloader side:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Downloader fil" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Downloader billede:" -msgid "Dutch" -msgstr "Hollandsk" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "FEJL" @@ -464,9 +405,6 @@ msgstr "FEJL:" msgid "ERROR: Can't set up theme." msgstr "FEJL: Temaet kan ikke bruges." -msgid "English" -msgstr "Engelsk" - msgid "Error" msgstr "Fejl" @@ -476,15 +414,24 @@ msgstr "Fejl!" msgid "Error 002 fix" msgstr "Error 002 fix" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "DVDen kunne ikke læses" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Fejl under overførsel af data." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Udpakningen mislykkedes." msgid "Failed to open partition" msgstr "Kunne ikke åbne partition" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formater" @@ -545,15 +486,9 @@ msgstr "Formaterer, vent venligst..." msgid "Free Space" msgstr "Ledig plads" -msgid "French" -msgstr "Fransk" - msgid "Full Shutdown" msgstr "Sluk helt" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "Sti til cheatcodes" @@ -566,9 +501,6 @@ msgstr "Konfigurér GUI" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg blev ikke fundet i nogle undermapper" -msgid "Game ID" -msgstr "Spil-ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Spilindstillinger" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Region" - msgid "Game Size" msgstr "Spilstørrelse" @@ -599,18 +528,12 @@ msgstr "Dette spil er allerede installeret:" msgid "Game partition" msgstr "Spilpartition" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Spil" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Tysk" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Indsæt et SD-kort for at bruge denne indstilling." msgid "Install" msgstr "Installér" -msgid "Install 1:1 Copy" -msgstr "Installér 1:1-kopi" - msgid "Install Error!" msgstr "Installationsfejl!" @@ -691,21 +611,12 @@ msgstr "Installerer titel... Ok!" msgid "Installing wad" msgstr "Installerer WAD" -msgid "Invalid PIN code" -msgstr "Forkert PIN-kode" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Det ser ud til, at du har information, der vil kunne hjælpe os. Vær rar at sende denne information til udviklerne." -msgid "Italian" -msgstr "Italiensk" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "Japansk" - msgid "July" msgstr "Juli" @@ -718,9 +629,6 @@ msgstr "Behold" msgid "Keyboard" msgstr "Tastatur" -msgid "Korean" -msgstr "Koreansk" - msgid "Language File" msgstr "Sprog Fil" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Sti til sprogfiler ændret." -msgid "Left" -msgstr "Venstre" - -msgid "Like SysMenu" -msgstr "Ligesom wii-menuen" - msgid "Load" msgstr "Indlæs" -msgid "Load From SD/USB" -msgstr "Indlæs fra SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Indlæs fil fra %s ?" @@ -752,6 +651,9 @@ msgstr "Indlæs fil fra %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Indlæs denne DOL som alternativ DOL?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Indlæser standardsprog." @@ -761,17 +663,8 @@ msgstr "Indlæser standardmusik." msgid "Lock Console" msgstr "Lås konsol" -msgid "Locked" -msgstr "Låst" - -msgid "Loop Directory" -msgstr "Afspil mappe i løkke" - -msgid "Loop Music" -msgstr "Afspil musik i løkke" - -msgid "Loop Sound" -msgstr "Afspil lyd i løkke" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "" @@ -794,15 +687,12 @@ msgstr "Musik i løkke" msgid "Music Volume" msgstr "Lydstyrke" -msgid "Neither" -msgstr "Ingen" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Har opdaget ny DVD" -msgid "Next" -msgstr "Næste" - msgid "No" msgstr "Nej" @@ -839,12 +729,6 @@ msgstr "Ingen nye opdateringer." msgid "No themes found on the site." msgstr "Der blev ikke fundet nogle temaer på denne site." -msgid "None" -msgstr "Ingen" - -msgid "Normal" -msgstr "Normal" - msgid "Not a WAD file." msgstr "Ikke en WAD-fil." @@ -884,9 +768,6 @@ msgstr "Fra" msgid "OK" msgstr "" -msgid "ON" -msgstr "Til" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Officiel side:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Kun tilpassede" - -msgid "Only Original" -msgstr "Kun originaler" - -msgid "Only for Install" -msgstr "Kun til installering" - -msgid "Original/Customs" -msgstr "Originale/Tilpassede" - msgid "Parental Control" msgstr "Børnelås" -msgid "Parental Control disabled" -msgstr "Børnelåsen er slået fra" - msgid "Partition" msgstr "Partition" @@ -947,9 +813,6 @@ msgstr "Spiltæller" msgid "Play Next" msgstr "Afspil næste" -msgid "Play Once" -msgstr "Afspil én gang" - msgid "Play Previous" msgstr "Afspil forrige" @@ -962,9 +825,6 @@ msgstr "Vent venligst..." msgid "Power off the Wii" msgstr "Sluk Wiien" -msgid "Prev" -msgstr "Forrige" - msgid "Prompts Buttons" msgstr "Knaptekster" @@ -974,9 +834,6 @@ msgstr "Udgivet af" msgid "Quick Boot" msgstr "Hurtig opstart" -msgid "Random Directory Music" -msgstr "Musik fra tilfældig mappe" - msgid "Reading WAD data... Ok!" msgstr "Læser WAD-data... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Tilbage til Wii-menuen" -msgid "Right" -msgstr "Højre" - msgid "Rumble" msgstr "Vibration" -msgid "SChinese" -msgstr "Kinesisk (std.)" - msgid "SFX Volume" msgstr "Lydstyrke for effekter" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Vælg en DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "" @@ -1085,15 +933,6 @@ msgstr "Lyd" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Lyd+BGM" - -msgid "Sound+Quiet" -msgstr "Lyd+Stille" - -msgid "Spanish" -msgstr "Spansk" - msgid "Special thanks to:" msgstr "Specielt tak til:" @@ -1121,24 +960,18 @@ msgstr "Udpakning af tema lykkedes." msgid "Successfully installed:" msgstr "Installationen lykkedes:" -msgid "System Default" -msgstr "System-standard" - -msgid "TChinese" -msgstr "Kinesisk (trad.)" - msgid "TXT Cheatcodes Path" msgstr "Sti til TXTCheatcodes" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Den angivne mappe eksisterer ikke. Skal den oprettes?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "WAD-filen blev installeret. Den kunne ikke slettes fra SD-kortet." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "WAD-installationen mislykkedes med fejl %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Sti til download af temaer" @@ -1152,6 +985,9 @@ msgstr "Sti til temaer" msgid "Theme Title:" msgstr "Tematitel:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Overførslen mislykkedes" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB-enhed ikke fundet" msgid "USB Loader GX is protected" msgstr "USB Loader GX er beskyttet" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Ikke i stand til at åbne den WAD, der blev downloadet (%s)." - msgid "Uninstall" msgstr "Afinstallér" @@ -1201,15 +1039,12 @@ msgstr "Afinstallerer WAD" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Lås børnelåsen op" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Lås op for konsollen for at benytte denne indstilling." -msgid "Unlocked" -msgstr "Låst op" - msgid "Unsupported format, try to extract manually." msgstr "Formatet er ikke understøttet - prøv at udpakke manuelt." @@ -1234,21 +1069,12 @@ msgstr "Opdatér alle sprogfiler" msgid "Update failed" msgstr "Opdateringen mislykkedes" -msgid "Update to" -msgstr "Opdatér til" - -msgid "Updating" -msgstr "Opdaterer..." - -msgid "Updating Language Files..." -msgstr "Opdaterer sprogfiler..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Opdaterer sprogfiler:" -msgid "Updating WiiTDB.zip" -msgstr "Opdaterer WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Den uploadede ZIP-fil er installeret i homebrew-mappen." @@ -1280,9 +1106,6 @@ msgstr "Hvad skal opdateres?" msgid "WiFi Features" msgstr "WiFi-indstillinger" -msgid "Widescreen Fix" -msgstr "Bredformat-fix" - msgid "Wii Menu" msgstr "" @@ -1310,9 +1133,6 @@ msgstr "Ja" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Børnelåsen er ikke slået til. Hvis børnelåsen skal bruges, skal den slås til i Wiiens indstillinger." - msgid "You need to select or format a partition" msgstr "Du skal vælge eller formattere en partition" @@ -1377,6 +1197,210 @@ msgstr "af" msgid "seconds left" msgstr "sekunder tilbage" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Installér 1:1-kopi" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Alle)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Børn 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 time" + +#~ msgid "10 min" +#~ msgstr "10 min." + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Unge teenagere 12+)" + +#~ msgid "20 min" +#~ msgstr "20 min." + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Modne teenagere 16+)" + +#~ msgid "3 min" +#~ msgstr "3 min." + +#~ msgid "30 min" +#~ msgstr "30 min." + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Voksne 18+)" + +#~ msgid "5 min" +#~ msgstr "5 min." + +#~ msgid "An Error occured" +#~ msgstr "Der skete en fejl" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Skal børnelåsen slås til?" + +#~ msgid "Both" +#~ msgstr "Begge" + +#~ msgid "Checking for Updates" +#~ msgstr "Leder efter opdateringer" + +#~ msgid "Console Default" +#~ msgstr "Konsol-standard" + +#~ msgid "Customs/Original" +#~ msgstr "Tilpassede/Originale" + +#~ msgid "Disc Default" +#~ msgstr "Spillets standard" + +#~ msgid "Downloading" +#~ msgstr "Downloader" + +#~ msgid "Dutch" +#~ msgstr "Hollandsk" + +#~ msgid "English" +#~ msgstr "Engelsk" + +#~ msgid "French" +#~ msgstr "Fransk" + +#~ msgid "Game ID" +#~ msgstr "Spil-ID" + +#~ msgid "Game Region" +#~ msgstr "Region" + +#~ msgid "German" +#~ msgstr "Tysk" + +#~ msgid "Invalid PIN code" +#~ msgstr "Forkert PIN-kode" + +#~ msgid "Italian" +#~ msgstr "Italiensk" + +#~ msgid "Japanese" +#~ msgstr "Japansk" + +#~ msgid "Korean" +#~ msgstr "Koreansk" + +#~ msgid "Left" +#~ msgstr "Venstre" + +#~ msgid "Like SysMenu" +#~ msgstr "Ligesom wii-menuen" + +#~ msgid "Load From SD/USB" +#~ msgstr "Indlæs fra SD/USB" + +#~ msgid "Locked" +#~ msgstr "Låst" + +#~ msgid "Loop Directory" +#~ msgstr "Afspil mappe i løkke" + +#~ msgid "Loop Music" +#~ msgstr "Afspil musik i løkke" + +#~ msgid "Loop Sound" +#~ msgstr "Afspil lyd i løkke" + +#~ msgid "Neither" +#~ msgstr "Ingen" + +#~ msgid "Next" +#~ msgstr "Næste" + +#~ msgid "None" +#~ msgstr "Ingen" + +#~ msgid "Normal" +#~ msgstr "Normal" + +#~ msgid "ON" +#~ msgstr "Til" + +#~ msgid "Only Customs" +#~ msgstr "Kun tilpassede" + +#~ msgid "Only Original" +#~ msgstr "Kun originaler" + +#~ msgid "Only for Install" +#~ msgstr "Kun til installering" + +#~ msgid "Original/Customs" +#~ msgstr "Originale/Tilpassede" + +#~ msgid "Parental Control disabled" +#~ msgstr "Børnelåsen er slået fra" + +#~ msgid "Play Once" +#~ msgstr "Afspil én gang" + +#~ msgid "Prev" +#~ msgstr "Forrige" + +#~ msgid "Random Directory Music" +#~ msgstr "Musik fra tilfældig mappe" + +#~ msgid "Right" +#~ msgstr "Højre" + +#~ msgid "SChinese" +#~ msgstr "Kinesisk (std.)" + +#~ msgid "Sound+BGM" +#~ msgstr "Lyd+BGM" + +#~ msgid "Sound+Quiet" +#~ msgstr "Lyd+Stille" + +#~ msgid "Spanish" +#~ msgstr "Spansk" + +#~ msgid "System Default" +#~ msgstr "System-standard" + +#~ msgid "TChinese" +#~ msgstr "Kinesisk (trad.)" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "WAD-filen blev installeret. Den kunne ikke slettes fra SD-kortet." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "WAD-installationen mislykkedes med fejl %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Ikke i stand til at åbne den WAD, der blev downloadet (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Lås børnelåsen op" + +#~ msgid "Unlocked" +#~ msgstr "Låst op" + +#~ msgid "Update to" +#~ msgstr "Opdatér til" + +#~ msgid "Updating" +#~ msgstr "Opdaterer..." + +#~ msgid "Updating Language Files..." +#~ msgstr "Opdaterer sprogfiler..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Opdaterer WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Bredformat-fix" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Børnelåsen er ikke slået til. Hvis børnelåsen skal bruges, skal den slås til i Wiiens indstillinger." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s booter måske ikke korrekt, hvis system menuen ikke er opdateret." diff --git a/Languages/dutch.lang b/Languages/dutch.lang index 4f5d0d4f..c4e8a304 100644 --- a/Languages/dutch.lang +++ b/Languages/dutch.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2010-04-12 07:37+0100\n" "Last-Translator: glowy\n" "Language-Team: tj_cool, glowy\n" @@ -25,54 +25,15 @@ msgstr " is opgeslagen. De tekst is niet gecontroleerd. Delen van de code kunnen msgid " is not on the server." msgstr " staat niet op de server." -msgid "0 (Everyone)" -msgstr "0 (Iedereen 3+)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Kinderen 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 uur" - -msgid "10 min" -msgstr "" - -msgid "2 (Teen 12+)" -msgstr "2 (Tiener 12+)" - -msgid "20 min" -msgstr "" - msgid "2D Cover Path" msgstr "Locatie 2D hoesjes" -msgid "3 (Mature 16+)" -msgstr "3 (Adolescenten 16+)" - -msgid "3 min" -msgstr "" - -msgid "30 min" -msgstr "" - msgid "3D Cover Path" msgstr "Locatie 3D hoesjes" msgid "3D Covers" msgstr "3D Hoesjes" -msgid "4 (Adults Only 18+)" -msgstr "4 (Volwassen 18+)" - -msgid "5 min" -msgstr "" - msgid ">> Deleting tickets..." msgstr ">> Tickets verwijderen..." @@ -136,20 +97,14 @@ msgstr "Alle functies van USB Loader GX zijn vrijgegeven." msgid "Alternate DOL" msgstr "Alternatieve DOL" -msgid "An Error occured" -msgstr "Er is een fout opgetreden" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Applicatie Taal" msgid "Apr" msgstr "" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Weet je zeker dat je ouderlijk toezicht wilt aanzetten?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Auteur:" msgid "AutoInit Network" msgstr "Netwerk Auto init." -msgid "AutoPatch" -msgstr "Automatisch patchen" - msgid "BCA Codes Path" msgstr "Locatie BCA codes" @@ -199,9 +151,6 @@ msgstr "Start/Standaard" msgid "Boot?" msgstr "Start?" -msgid "Both" -msgstr "Beide" - msgid "Can't be formatted" msgstr "Kan niet geformatteerd worden" @@ -226,9 +175,6 @@ msgstr "Verander afspeel locatie" msgid "Cheatfile is blank" msgstr "Cheatbestand is leeg" -msgid "Checking for Updates" -msgstr "Controleren op updates" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Verbinding verbroken..." msgid "Console" msgstr "" -msgid "Console Default" -msgstr "Console standaard" - msgid "Console Locked" msgstr "Console vergrendeld" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Kan GCT bestand niet aanmaken" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "" msgid "Custom Paths" msgstr "Bestandslocaties" -msgid "Customs/Original" -msgstr "Aangepast/Origineel" - msgid "DOL Path" msgstr "Locatie DOL" @@ -365,15 +309,9 @@ msgstr "Download disk labels" msgid "Disc Artwork Path" msgstr "Locatie disk labels" -msgid "Disc Default" -msgstr "Disk standaard" - msgid "Disc Images" msgstr "Disk labels" -msgid "DiskFlip" -msgstr "" - msgid "Display" msgstr "Tonen" @@ -404,6 +342,9 @@ msgstr "Wil je dit thema downloaden?" msgid "Do you want to format:" msgstr "Wil je formatteren:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Wil je de alt DOL gebruiken waarvan is bevestigd dat deze werkt?" @@ -434,26 +375,26 @@ msgstr "Download voltooid" msgid "Download request failed." msgstr "Download aanvraag mislukt." -msgid "Downloading" -msgstr "Downloaden" - msgid "Downloading Page List:" msgstr "Download pagina lijst:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Bestand downloaden" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Afbeelding downloaden:" -msgid "Dutch" -msgstr "Nederlands" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "FOUT" @@ -464,9 +405,6 @@ msgstr "FOUT:" msgid "ERROR: Can't set up theme." msgstr "FOUT: Kan thema niet instellen" -msgid "English" -msgstr "Engels" - msgid "Error" msgstr "Fout" @@ -476,15 +414,24 @@ msgstr "Fout !" msgid "Error 002 fix" msgstr "Herstel fout 002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Fout bij lezen disk" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Fout bij overplaatsen van data." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Uitpakken mislukt." msgid "Failed to open partition" msgstr "Partitie openen mislukt" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "X omwisselen" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formatteer" @@ -545,15 +486,9 @@ msgstr "Bezig met formatteren..." msgid "Free Space" msgstr "Vrije ruimte" -msgid "French" -msgstr "Frans" - msgid "Full Shutdown" msgstr "Volledig uitzetten" -msgid "GAMEID_Gamename" -msgstr "SPELID_Spelnaam" - msgid "GCT Cheatcodes Path" msgstr "Locatie GCT cheatcodes" @@ -566,9 +501,6 @@ msgstr "Menu opties" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg in geen enkele submap gevonden." -msgid "Game ID" -msgstr "Spel ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Spel opties" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Spel Regio" - msgid "Game Size" msgstr "Spel grootte" @@ -599,18 +528,12 @@ msgstr "Spel is al geïnstalleerd:" msgid "Game partition" msgstr "Spel partitie" -msgid "Gamename [GAMEID]" -msgstr "Spelnaam [SPELID]" - msgid "Games" msgstr "Spellen" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Duits" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Voer een SD kaart in om deze optie te gebruiken." msgid "Install" msgstr "Installeer" -msgid "Install 1:1 Copy" -msgstr "Installeer 1:1 kopie" - msgid "Install Error!" msgstr "Installatiefout!" @@ -691,21 +611,12 @@ msgstr "Titel installeren... Ok!" msgid "Installing wad" msgstr "Wad installeren" -msgid "Invalid PIN code" -msgstr "Onjuiste PIN code" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Je hebt informatie gevonden die ons kan helpen. Geeft u alstublieft deze info door aan ons ontwikkelingsteam." -msgid "Italian" -msgstr "Italiaans" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "Japans" - msgid "July" msgstr "Jul" @@ -718,9 +629,6 @@ msgstr "Bijhouden" msgid "Keyboard" msgstr "Toetsenbord" -msgid "Korean" -msgstr "Koreaans" - msgid "Language File" msgstr "Taal bestand" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Locatie taal gewijzigd." -msgid "Left" -msgstr "Links" - -msgid "Like SysMenu" -msgstr "Als SysteemMenu" - msgid "Load" msgstr "Laad" -msgid "Load From SD/USB" -msgstr "Laden van SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Laad bestand van %s ?" @@ -752,6 +651,9 @@ msgstr "Laad bestand van %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Deze DOL als alt DOL gebruiken?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Standaardtaal laden." @@ -761,17 +663,8 @@ msgstr "Standaardmuziek laden." msgid "Lock Console" msgstr "Console vergrendelen" -msgid "Locked" -msgstr "Vergrendeld" - -msgid "Loop Directory" -msgstr "Herhaal Map" - -msgid "Loop Music" -msgstr "Herhaal Muziek" - -msgid "Loop Sound" -msgstr "Geluid herhalen" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "Mrt" @@ -794,15 +687,12 @@ msgstr "Muziek Herhaal Mode" msgid "Music Volume" msgstr "Muziekvolume" -msgid "Neither" -msgstr "Geen" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Nieuwe disk gevonden" -msgid "Next" -msgstr "Volgende" - msgid "No" msgstr "Nee" @@ -839,12 +729,6 @@ msgstr "Geen nieuwe updates." msgid "No themes found on the site." msgstr "Geen thema's gevonden op de site." -msgid "None" -msgstr "Geen" - -msgid "Normal" -msgstr "Normaal" - msgid "Not a WAD file." msgstr "Geen WAD bestand." @@ -884,9 +768,6 @@ msgstr "Uit" msgid "OK" msgstr "" -msgid "ON" -msgstr "Aan" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Officiële site:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Enkel aangepast" - -msgid "Only Original" -msgstr "Enkel origineel" - -msgid "Only for Install" -msgstr "Alleen bij installeren" - -msgid "Original/Customs" -msgstr "Origineel/Aangepast" - msgid "Parental Control" msgstr "Ouderlijk toezicht" -msgid "Parental Control disabled" -msgstr "Ouderlijk toezicht uitgeschakeld" - msgid "Partition" msgstr "Partitie" @@ -947,9 +813,6 @@ msgstr "Gespeeld" msgid "Play Next" msgstr "Speel Volgende" -msgid "Play Once" -msgstr "Speel één maal" - msgid "Play Previous" msgstr "Speel Vorige" @@ -962,9 +825,6 @@ msgstr "Even geduld..." msgid "Power off the Wii" msgstr "Wii uitschakelen" -msgid "Prev" -msgstr "Vorige" - msgid "Prompts Buttons" msgstr "Weergave knoppen" @@ -974,9 +834,6 @@ msgstr "Uitgegeven door" msgid "Quick Boot" msgstr "Snelle start" -msgid "Random Directory Music" -msgstr "Willekeurige Map Muziek" - msgid "Reading WAD data... Ok!" msgstr "WAD data lezen... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Terug naar Wii menu" -msgid "Right" -msgstr "Rechts" - msgid "Rumble" msgstr "Trilfunctie" -msgid "SChinese" -msgstr "SChinees" - msgid "SFX Volume" msgstr "Volume geluidseffecten" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Kies een DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Sep" @@ -1085,15 +933,6 @@ msgstr "Geluid" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Geluid+Achtergrondmuziek" - -msgid "Sound+Quiet" -msgstr "Geluid+Stilte" - -msgid "Spanish" -msgstr "Spaans" - msgid "Special thanks to:" msgstr "Speciale dank aan:" @@ -1121,24 +960,18 @@ msgstr "Thema succesvol uitgepakt." msgid "Successfully installed:" msgstr "Met succes geïnstalleerd:" -msgid "System Default" -msgstr "Systeem standaard" - -msgid "TChinese" -msgstr "Chinees Trad." - msgid "TXT Cheatcodes Path" msgstr "Locatie TXT cheats" msgid "The entered directory does not exist. Would you like to create it?" msgstr "De opgegeven map bestaat niet. Wil je deze aanmaken?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "Het wad bestand is geïnstalleerd. Maar kon niet van de SD kaart verwijderd worden." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "De wad installatie is mislukt met fout %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Thema download locatie" @@ -1152,6 +985,9 @@ msgstr "Locatie thema" msgid "Theme Title:" msgstr "Thema Titel:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Overdracht mislukt." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB Apparaat niet gevonden" msgid "USB Loader GX is protected" msgstr "USB Loader GX is vergrendeld" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Wad is gedownload maar kan niet worden geopend (%s)." - msgid "Uninstall" msgstr "Verwijderen" @@ -1201,15 +1039,12 @@ msgstr "Wad verwijderen" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Ontgrendel ouderlijk toezicht" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Console moet worden vrijgegeven." -msgid "Unlocked" -msgstr "Vrijgegeven" - msgid "Unsupported format, try to extract manually." msgstr "Niet ondersteund formaat, probeer handmatig uit te pakken." @@ -1234,21 +1069,12 @@ msgstr "Alle taalbestanden updaten" msgid "Update failed" msgstr "Update mislukt" -msgid "Update to" -msgstr "Updaten naar" - -msgid "Updating" -msgstr "Updaten" - -msgid "Updating Language Files..." -msgstr "Taalbestanden updaten..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Taalbestanden updaten:" -msgid "Updating WiiTDB.zip" -msgstr "WiiTDB.zip updaten" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Geuploade ZIP is geïnstalleerd in je homebrew locatie." @@ -1280,9 +1106,6 @@ msgstr "Wat wil je updaten?" msgid "WiFi Features" msgstr "WiFi functies" -msgid "Widescreen Fix" -msgstr "Breedbeeld" - msgid "Wii Menu" msgstr "" @@ -1310,9 +1133,6 @@ msgstr "Ja" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Je hebt ouderlijk toezicht niet ingeschakeld. Als je ouderlijk toezicht wilt gebruiken, zet het dan aan in de Wii instellingen." - msgid "You need to select or format a partition" msgstr "Je moet een partitie selecteren of formatteren" @@ -1377,6 +1197,204 @@ msgstr "van" msgid "seconds left" msgstr "seconden over" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Installeer 1:1 kopie" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Iedereen 3+)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Kinderen 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 uur" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Tiener 12+)" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Adolescenten 16+)" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Volwassen 18+)" + +#~ msgid "An Error occured" +#~ msgstr "Er is een fout opgetreden" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Weet je zeker dat je ouderlijk toezicht wilt aanzetten?" + +#~ msgid "AutoPatch" +#~ msgstr "Automatisch patchen" + +#~ msgid "Both" +#~ msgstr "Beide" + +#~ msgid "Checking for Updates" +#~ msgstr "Controleren op updates" + +#~ msgid "Console Default" +#~ msgstr "Console standaard" + +#~ msgid "Customs/Original" +#~ msgstr "Aangepast/Origineel" + +#~ msgid "Disc Default" +#~ msgstr "Disk standaard" + +#~ msgid "Downloading" +#~ msgstr "Downloaden" + +#~ msgid "Dutch" +#~ msgstr "Nederlands" + +#~ msgid "English" +#~ msgstr "Engels" + +#~ msgid "French" +#~ msgstr "Frans" + +#~ msgid "GAMEID_Gamename" +#~ msgstr "SPELID_Spelnaam" + +#~ msgid "Game ID" +#~ msgstr "Spel ID" + +#~ msgid "Game Region" +#~ msgstr "Spel Regio" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "Spelnaam [SPELID]" + +#~ msgid "German" +#~ msgstr "Duits" + +#~ msgid "Invalid PIN code" +#~ msgstr "Onjuiste PIN code" + +#~ msgid "Italian" +#~ msgstr "Italiaans" + +#~ msgid "Japanese" +#~ msgstr "Japans" + +#~ msgid "Korean" +#~ msgstr "Koreaans" + +#~ msgid "Left" +#~ msgstr "Links" + +#~ msgid "Like SysMenu" +#~ msgstr "Als SysteemMenu" + +#~ msgid "Load From SD/USB" +#~ msgstr "Laden van SD/USB" + +#~ msgid "Locked" +#~ msgstr "Vergrendeld" + +#~ msgid "Loop Directory" +#~ msgstr "Herhaal Map" + +#~ msgid "Loop Music" +#~ msgstr "Herhaal Muziek" + +#~ msgid "Loop Sound" +#~ msgstr "Geluid herhalen" + +#~ msgid "Neither" +#~ msgstr "Geen" + +#~ msgid "Next" +#~ msgstr "Volgende" + +#~ msgid "None" +#~ msgstr "Geen" + +#~ msgid "Normal" +#~ msgstr "Normaal" + +#~ msgid "ON" +#~ msgstr "Aan" + +#~ msgid "Only Customs" +#~ msgstr "Enkel aangepast" + +#~ msgid "Only Original" +#~ msgstr "Enkel origineel" + +#~ msgid "Only for Install" +#~ msgstr "Alleen bij installeren" + +#~ msgid "Original/Customs" +#~ msgstr "Origineel/Aangepast" + +#~ msgid "Parental Control disabled" +#~ msgstr "Ouderlijk toezicht uitgeschakeld" + +#~ msgid "Play Once" +#~ msgstr "Speel één maal" + +#~ msgid "Prev" +#~ msgstr "Vorige" + +#~ msgid "Random Directory Music" +#~ msgstr "Willekeurige Map Muziek" + +#~ msgid "Right" +#~ msgstr "Rechts" + +#~ msgid "SChinese" +#~ msgstr "SChinees" + +#~ msgid "Sound+BGM" +#~ msgstr "Geluid+Achtergrondmuziek" + +#~ msgid "Sound+Quiet" +#~ msgstr "Geluid+Stilte" + +#~ msgid "Spanish" +#~ msgstr "Spaans" + +#~ msgid "System Default" +#~ msgstr "Systeem standaard" + +#~ msgid "TChinese" +#~ msgstr "Chinees Trad." + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "Het wad bestand is geïnstalleerd. Maar kon niet van de SD kaart verwijderd worden." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "De wad installatie is mislukt met fout %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Wad is gedownload maar kan niet worden geopend (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Ontgrendel ouderlijk toezicht" + +#~ msgid "Unlocked" +#~ msgstr "Vrijgegeven" + +#~ msgid "Update to" +#~ msgstr "Updaten naar" + +#~ msgid "Updating" +#~ msgstr "Updaten" + +#~ msgid "Updating Language Files..." +#~ msgstr "Taalbestanden updaten..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "WiiTDB.zip updaten" + +#~ msgid "Widescreen Fix" +#~ msgstr "Breedbeeld" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Je hebt ouderlijk toezicht niet ingeschakeld. Als je ouderlijk toezicht wilt gebruiken, zet het dan aan in de Wii instellingen." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Kan mogelijk niet goed opstarten als je Systeem Menu niet up to date is." diff --git a/Languages/english.lang b/Languages/english.lang index d635852f..3f9c5141 100644 --- a/Languages/english.lang +++ b/Languages/english.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -25,54 +25,15 @@ msgstr "" msgid " is not on the server." msgstr "" -msgid "0 (Everyone)" -msgstr "" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "" - -msgid "10 min" -msgstr "" - -msgid "2 (Teen 12+)" -msgstr "" - -msgid "20 min" -msgstr "" - msgid "2D Cover Path" msgstr "" -msgid "3 (Mature 16+)" -msgstr "" - -msgid "3 min" -msgstr "" - -msgid "30 min" -msgstr "" - msgid "3D Cover Path" msgstr "" msgid "3D Covers" msgstr "" -msgid "4 (Adults Only 18+)" -msgstr "" - -msgid "5 min" -msgstr "" - msgid ">> Deleting tickets..." msgstr "" @@ -136,19 +97,13 @@ msgstr "" msgid "Alternate DOL" msgstr "" -msgid "An Error occured" -msgstr "" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "" msgid "Apr" msgstr "" -msgid "Are you sure you want to enable Parent Control?" +msgid "Are you sure you want to lock USB Loader GX?" msgstr "" msgid "Are you sure you want to reset?" @@ -166,9 +121,6 @@ msgstr "" msgid "AutoInit Network" msgstr "" -msgid "AutoPatch" -msgstr "" - msgid "BCA Codes Path" msgstr "" @@ -199,9 +151,6 @@ msgstr "" msgid "Boot?" msgstr "" -msgid "Both" -msgstr "" - msgid "Can't be formatted" msgstr "" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "" -msgid "Checking for Updates" -msgstr "" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "" -msgid "Console Default" -msgstr "" - msgid "Console Locked" msgstr "" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "" msgid "Custom Paths" msgstr "" -msgid "Customs/Original" -msgstr "" - msgid "DOL Path" msgstr "" @@ -365,15 +309,9 @@ msgstr "" msgid "Disc Artwork Path" msgstr "" -msgid "Disc Default" -msgstr "" - msgid "Disc Images" msgstr "" -msgid "DiskFlip" -msgstr "" - msgid "Display" msgstr "" @@ -404,6 +342,9 @@ msgstr "" msgid "Do you want to format:" msgstr "" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "" @@ -434,10 +375,13 @@ msgstr "" msgid "Download request failed." msgstr "" -msgid "Downloading" +msgid "Downloading Page List:" msgstr "" -msgid "Downloading Page List:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" msgstr "" msgid "Downloading file" @@ -446,13 +390,10 @@ msgstr "" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "" -msgid "Dutch" +msgid "Downloading original Discarts" msgstr "" msgid "ERROR" @@ -464,9 +405,6 @@ msgstr "" msgid "ERROR: Can't set up theme." msgstr "" -msgid "English" -msgstr "" - msgid "Error" msgstr "" @@ -476,15 +414,24 @@ msgstr "" msgid "Error 002 fix" msgstr "" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "" +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "" msgid "Failed to open partition" msgstr "" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "" @@ -545,15 +486,9 @@ msgstr "" msgid "Free Space" msgstr "" -msgid "French" -msgstr "" - msgid "Full Shutdown" msgstr "" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "" @@ -566,9 +501,6 @@ msgstr "" msgid "GXtheme.cfg not found in any subfolder." msgstr "" -msgid "Game ID" -msgstr "" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "" - msgid "Game Size" msgstr "" @@ -599,18 +528,12 @@ msgstr "" msgid "Game partition" msgstr "" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "" msgid "Install" msgstr "" -msgid "Install 1:1 Copy" -msgstr "" - msgid "Install Error!" msgstr "" @@ -691,21 +611,12 @@ msgstr "" msgid "Installing wad" msgstr "" -msgid "Invalid PIN code" -msgstr "" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "" -msgid "Italian" -msgstr "" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "" - msgid "July" msgstr "" @@ -718,9 +629,6 @@ msgstr "" msgid "Keyboard" msgstr "" -msgid "Korean" -msgstr "" - msgid "Language File" msgstr "" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "" -msgid "Left" -msgstr "" - -msgid "Like SysMenu" -msgstr "" - msgid "Load" msgstr "" -msgid "Load From SD/USB" -msgstr "" - #, c-format msgid "Load file from: %s ?" msgstr "" @@ -752,6 +651,9 @@ msgstr "" msgid "Load this DOL as alternate DOL?" msgstr "" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "" @@ -761,16 +663,7 @@ msgstr "" msgid "Lock Console" msgstr "" -msgid "Locked" -msgstr "" - -msgid "Loop Directory" -msgstr "" - -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" +msgid "Lock USB Loader GX" msgstr "" msgid "Mar" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "" -msgid "Neither" +msgid "Network is not initiated." msgstr "" msgid "New Disc Detected" msgstr "" -msgid "Next" -msgstr "" - msgid "No" msgstr "" @@ -839,12 +729,6 @@ msgstr "" msgid "No themes found on the site." msgstr "" -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "" msgid "OK" msgstr "" -msgid "ON" -msgstr "" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "" - -msgid "Only Original" -msgstr "" - -msgid "Only for Install" -msgstr "" - -msgid "Original/Customs" -msgstr "" - msgid "Parental Control" msgstr "" -msgid "Parental Control disabled" -msgstr "" - msgid "Partition" msgstr "" @@ -947,9 +813,6 @@ msgstr "" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "" msgid "Power off the Wii" msgstr "" -msgid "Prev" -msgstr "" - msgid "Prompts Buttons" msgstr "" @@ -974,9 +834,6 @@ msgstr "" msgid "Quick Boot" msgstr "" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "" -msgid "Right" -msgstr "" - msgid "Rumble" msgstr "" -msgid "SChinese" -msgstr "" - msgid "SFX Volume" msgstr "" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "" @@ -1085,15 +933,6 @@ msgstr "" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "" - -msgid "Sound+Quiet" -msgstr "" - -msgid "Spanish" -msgstr "" - msgid "Special thanks to:" msgstr "" @@ -1121,23 +960,17 @@ msgstr "" msgid "Successfully installed:" msgstr "" -msgid "System Default" -msgstr "" - -msgid "TChinese" -msgstr "" - msgid "TXT Cheatcodes Path" msgstr "" msgid "The entered directory does not exist. Would you like to create it?" msgstr "" -msgid "The wad file was installed. But It could not be deleted from the SD card." +msgid "The wad file was installed" msgstr "" #, c-format -msgid "The wad installation failed with error %ld" +msgid "The wad installation failed with error %i" msgstr "" msgid "Theme Download Path" @@ -1152,6 +985,9 @@ msgstr "" msgid "Theme Title:" msgstr "" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "" msgid "USB Loader GX is protected" msgstr "" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "" - msgid "Uninstall" msgstr "" @@ -1201,15 +1039,12 @@ msgstr "" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" +msgid "Unlock USB Loader GX" msgstr "" msgid "Unlock console to use this option." msgstr "" -msgid "Unlocked" -msgstr "" - msgid "Unsupported format, try to extract manually." msgstr "" @@ -1234,21 +1069,12 @@ msgstr "" msgid "Update failed" msgstr "" -msgid "Update to" -msgstr "" - -msgid "Updating" -msgstr "" - -msgid "Updating Language Files..." +msgid "Update successfull" msgstr "" msgid "Updating Language Files:" msgstr "" -msgid "Updating WiiTDB.zip" -msgstr "" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "" @@ -1280,9 +1106,6 @@ msgstr "" msgid "WiFi Features" msgstr "" -msgid "Widescreen Fix" -msgstr "" - msgid "Wii Menu" msgstr "" @@ -1310,9 +1133,6 @@ msgstr "" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "" - msgid "You need to select or format a partition" msgstr "" diff --git a/Languages/finnish.lang b/Languages/finnish.lang index 7ce1c2f2..912ecf6f 100644 --- a/Languages/finnish.lang +++ b/Languages/finnish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: c64rmx\n" "Language-Team: \n" @@ -25,54 +25,15 @@ msgstr "" msgid " is not on the server." msgstr "Tiedostoa ei löydy serveriltä" -msgid "0 (Everyone)" -msgstr "0 (Kaikille)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Lapset 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr " 1 tunti" - -msgid "10 min" -msgstr "" - -msgid "2 (Teen 12+)" -msgstr "2 (Teinit 12+)" - -msgid "20 min" -msgstr "" - msgid "2D Cover Path" msgstr "2D Kansien polku" -msgid "3 (Mature 16+)" -msgstr "3 (Teinit 16+)" - -msgid "3 min" -msgstr "" - -msgid "30 min" -msgstr "" - msgid "3D Cover Path" msgstr "3D Kansien polku" msgid "3D Covers" msgstr "3D Kannet" -msgid "4 (Adults Only 18+)" -msgstr "4 (K18)" - -msgid "5 min" -msgstr "" - msgid ">> Deleting tickets..." msgstr ">> Tuhotaan lipukkeita..." @@ -136,19 +97,13 @@ msgstr "Kaikki asetukset on nyt käytettävissä." msgid "Alternate DOL" msgstr "Vaihtoehto DOL" -msgid "An Error occured" -msgstr "Tapahtui virhe" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Ohjelman kieli" msgid "Apr" msgstr "huhti" -msgid "Are you sure you want to enable Parent Control?" +msgid "Are you sure you want to lock USB Loader GX?" msgstr "" msgid "Are you sure you want to reset?" @@ -166,9 +121,6 @@ msgstr "" msgid "AutoInit Network" msgstr "Autom. verkon käynnistys" -msgid "AutoPatch" -msgstr "" - msgid "BCA Codes Path" msgstr "" @@ -199,9 +151,6 @@ msgstr "Käynnistys/Standardi" msgid "Boot?" msgstr "Boottaa?" -msgid "Both" -msgstr "Molemmat" - msgid "Can't be formatted" msgstr "Ei voida formatoida" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "Kooditiedosto tyhjä" -msgid "Checking for Updates" -msgstr "Tarkastetaan päivityksiä" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "Konsoli" -msgid "Console Default" -msgstr "Konsolin oletus" - msgid "Console Locked" msgstr "Konsoli lukittu" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "GCT tiedostoa ei voitu luoda" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Tekijät" msgid "Custom Paths" msgstr "Omat polut" -msgid "Customs/Original" -msgstr "Omat/Alkuperäiset" - msgid "DOL Path" msgstr "DOL:in polku" @@ -365,15 +309,9 @@ msgstr "Levykuvien lataus" msgid "Disc Artwork Path" msgstr "Levykuvien polku" -msgid "Disc Default" -msgstr "Pelin oletus" - msgid "Disc Images" msgstr "Levykuvat" -msgid "DiskFlip" -msgstr "Levynvaihto" - msgid "Display" msgstr "Näyttö" @@ -404,6 +342,9 @@ msgstr "" msgid "Do you want to format:" msgstr "Haluatko formatoida:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Haluatko käyttää vaihtoehtoista DOL tiedostoa jonka tiedetään toimivan?" @@ -434,26 +375,26 @@ msgstr "Lataus valmistunut" msgid "Download request failed." msgstr "" -msgid "Downloading" -msgstr "Lataa" - msgid "Downloading Page List:" msgstr "" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Lataa tiedostoa:" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "" -msgid "Dutch" -msgstr "Hollanti" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "VIRHE" @@ -464,9 +405,6 @@ msgstr "VIRHE:" msgid "ERROR: Can't set up theme." msgstr "" -msgid "English" -msgstr "Englanti" - msgid "Error" msgstr "Virhe" @@ -476,15 +414,24 @@ msgstr "Virhe !" msgid "Error 002 fix" msgstr "Virhe 002 fix" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Virhe luettaessa levyä" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Virhe siirrettäessä dataa." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "" msgid "Failed to open partition" msgstr "Osion avaus epäonnistui" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "helmi" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Käännä-X" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formatoi" @@ -545,15 +486,9 @@ msgstr "Formatoi, odota..." msgid "Free Space" msgstr "Vapaata tilaa" -msgid "French" -msgstr "Ranska" - msgid "Full Shutdown" msgstr "Täysi sammutus" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "GCT Koodien polku" @@ -566,9 +501,6 @@ msgstr "GUI asetukset" msgid "GXtheme.cfg not found in any subfolder." msgstr "" -msgid "Game ID" -msgstr "Peli ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Pelin lataus" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Alue" - msgid "Game Size" msgstr "Pelin koko" @@ -599,18 +528,12 @@ msgstr "Peli on jo asennettu:" msgid "Game partition" msgstr "" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Pelejä" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Saksa" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Aseta SD-kortti käyttääksesi tätä vaihtoehtoa" msgid "Install" msgstr "Asenna" -msgid "Install 1:1 Copy" -msgstr "" - msgid "Install Error!" msgstr "Asennusvirhe!" @@ -691,21 +611,12 @@ msgstr "" msgid "Installing wad" msgstr "Asennetaan wadia" -msgid "Invalid PIN code" -msgstr "" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Näyttää että sinulla on tietoa joka on hyödyllistä meille. Ole ystävällinen ja välitä se kehitystiimille." -msgid "Italian" -msgstr "Italia" - msgid "Jan" msgstr "tammi" -msgid "Japanese" -msgstr "Japani" - msgid "July" msgstr "heinä" @@ -718,9 +629,6 @@ msgstr "Pidä" msgid "Keyboard" msgstr "Näppäimistö" -msgid "Korean" -msgstr "Korea" - msgid "Language File" msgstr "KieliTiedosto" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Kielen polku vaihdettu" -msgid "Left" -msgstr "Vasen" - -msgid "Like SysMenu" -msgstr "Kuin wii-menu" - msgid "Load" msgstr "Lataa" -msgid "Load From SD/USB" -msgstr "Lataa SD:ltä/USB:ltä" - #, c-format msgid "Load file from: %s ?" msgstr "Lataa tiedosto: %s ?" @@ -752,6 +651,9 @@ msgstr "Lataa tiedosto: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Lataa tämä vaihtoehtoisesti tämä dol?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Ladataan standardia kieltä" @@ -761,16 +663,7 @@ msgstr "Ladataan standardia musiikkia" msgid "Lock Console" msgstr "Lukitse konsoli" -msgid "Locked" -msgstr "Lukittu" - -msgid "Loop Directory" -msgstr "" - -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" +msgid "Lock USB Loader GX" msgstr "" msgid "Mar" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "Voimakkuus" -msgid "Neither" -msgstr "Ei kumpikaan" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "" -msgid "Next" -msgstr "Seuraava" - msgid "No" msgstr "Ei" @@ -839,12 +729,6 @@ msgstr "Ei uusia päivityksiä" msgid "No themes found on the site." msgstr "" -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "Normaali" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "Pois" msgid "OK" msgstr "" -msgid "ON" -msgstr "Päälle" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Virallinen sivusto:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Vain omatekoiset" - -msgid "Only Original" -msgstr "Vain alkuperäinen" - -msgid "Only for Install" -msgstr "Ainoastaan asennusta varten" - -msgid "Original/Customs" -msgstr "Alkuperäinen/Omatekoinen" - msgid "Parental Control" msgstr "Valvonta" -msgid "Parental Control disabled" -msgstr "" - msgid "Partition" msgstr "Osio" @@ -947,9 +813,6 @@ msgstr "Pelauksen määrä" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "" msgid "Power off the Wii" msgstr "Sammuta Wii" -msgid "Prev" -msgstr "Edellinen" - msgid "Prompts Buttons" msgstr "Napit" @@ -974,9 +834,6 @@ msgstr "Julkaisu:" msgid "Quick Boot" msgstr "" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "Luetaan WAD:ia... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Palaa Wii menuun" -msgid "Right" -msgstr "Oikea" - msgid "Rumble" msgstr "Värinä" -msgid "SChinese" -msgstr "SKiina" - msgid "SFX Volume" msgstr "Ääniefektien voimakkuus" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Valitse DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "syys" @@ -1085,15 +933,6 @@ msgstr "Ääni" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "" - -msgid "Sound+Quiet" -msgstr "" - -msgid "Spanish" -msgstr "Espanja" - msgid "Special thanks to:" msgstr "Erityiskiitokset" @@ -1121,24 +960,18 @@ msgstr "" msgid "Successfully installed:" msgstr "Asennettu onnistuneesti:" -msgid "System Default" -msgstr "Wiin oletus" - -msgid "TChinese" -msgstr "TKiina" - msgid "TXT Cheatcodes Path" msgstr "TXT koodien polku" msgid "The entered directory does not exist. Would you like to create it?" msgstr "" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "Wad tiedostoa ei asennettu mutta sitä ei voitu tuhota SD-kortilta" +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "Wad asennus epäonnistui: %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "" @@ -1152,6 +985,9 @@ msgstr "Teeman sijainti" msgid "Theme Title:" msgstr "" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB-laitetta ei löytynyt" msgid "USB Loader GX is protected" msgstr "USB Loader GX on suojattu." -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Wadia (%s) jonka juuri latasit ei voitu avata." - msgid "Uninstall" msgstr "Poista" @@ -1201,15 +1039,12 @@ msgstr "Poistetaan wad:ia" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" +msgid "Unlock USB Loader GX" msgstr "" msgid "Unlock console to use this option." msgstr "Avaa konsoli käyttääksesi tätä vaihtoehtoa" -msgid "Unlocked" -msgstr "Avattu" - msgid "Unsupported format, try to extract manually." msgstr "" @@ -1234,21 +1069,12 @@ msgstr "Päivitä kaikki kielitiedostot" msgid "Update failed" msgstr "Päivitys epäonnistui" -msgid "Update to" -msgstr "Päivitä:" - -msgid "Updating" -msgstr "Päivittää" - -msgid "Updating Language Files..." -msgstr "Päivittää kielitiedostoja..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Päivittää kielitiedostoja:" -msgid "Updating WiiTDB.zip" -msgstr "Päivittää WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "" @@ -1280,9 +1106,6 @@ msgstr "Mitä haluat päivittää?" msgid "WiFi Features" msgstr "WiFi ominaisuudet" -msgid "Widescreen Fix" -msgstr "Laajakuva korjaus" - msgid "Wii Menu" msgstr "Wii Menu" @@ -1310,9 +1133,6 @@ msgstr "Kyllä" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "" - msgid "You need to select or format a partition" msgstr "" @@ -1377,6 +1197,156 @@ msgstr "josta" msgid "seconds left" msgstr "sekuntia jäljellä" +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Kaikille)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Lapset 7+)" + +#~ msgid "1 hour" +#~ msgstr " 1 tunti" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Teinit 12+)" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Teinit 16+)" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (K18)" + +#~ msgid "An Error occured" +#~ msgstr "Tapahtui virhe" + +#~ msgid "Both" +#~ msgstr "Molemmat" + +#~ msgid "Checking for Updates" +#~ msgstr "Tarkastetaan päivityksiä" + +#~ msgid "Console Default" +#~ msgstr "Konsolin oletus" + +#~ msgid "Customs/Original" +#~ msgstr "Omat/Alkuperäiset" + +#~ msgid "Disc Default" +#~ msgstr "Pelin oletus" + +#~ msgid "DiskFlip" +#~ msgstr "Levynvaihto" + +#~ msgid "Downloading" +#~ msgstr "Lataa" + +#~ msgid "Dutch" +#~ msgstr "Hollanti" + +#~ msgid "English" +#~ msgstr "Englanti" + +#~ msgid "French" +#~ msgstr "Ranska" + +#~ msgid "Game ID" +#~ msgstr "Peli ID" + +#~ msgid "Game Region" +#~ msgstr "Alue" + +#~ msgid "German" +#~ msgstr "Saksa" + +#~ msgid "Italian" +#~ msgstr "Italia" + +#~ msgid "Japanese" +#~ msgstr "Japani" + +#~ msgid "Korean" +#~ msgstr "Korea" + +#~ msgid "Left" +#~ msgstr "Vasen" + +#~ msgid "Like SysMenu" +#~ msgstr "Kuin wii-menu" + +#~ msgid "Load From SD/USB" +#~ msgstr "Lataa SD:ltä/USB:ltä" + +#~ msgid "Locked" +#~ msgstr "Lukittu" + +#~ msgid "Neither" +#~ msgstr "Ei kumpikaan" + +#~ msgid "Next" +#~ msgstr "Seuraava" + +#~ msgid "Normal" +#~ msgstr "Normaali" + +#~ msgid "ON" +#~ msgstr "Päälle" + +#~ msgid "Only Customs" +#~ msgstr "Vain omatekoiset" + +#~ msgid "Only Original" +#~ msgstr "Vain alkuperäinen" + +#~ msgid "Only for Install" +#~ msgstr "Ainoastaan asennusta varten" + +#~ msgid "Original/Customs" +#~ msgstr "Alkuperäinen/Omatekoinen" + +#~ msgid "Prev" +#~ msgstr "Edellinen" + +#~ msgid "Right" +#~ msgstr "Oikea" + +#~ msgid "SChinese" +#~ msgstr "SKiina" + +#~ msgid "Spanish" +#~ msgstr "Espanja" + +#~ msgid "System Default" +#~ msgstr "Wiin oletus" + +#~ msgid "TChinese" +#~ msgstr "TKiina" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "Wad tiedostoa ei asennettu mutta sitä ei voitu tuhota SD-kortilta" + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "Wad asennus epäonnistui: %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Wadia (%s) jonka juuri latasit ei voitu avata." + +#~ msgid "Unlocked" +#~ msgstr "Avattu" + +#~ msgid "Update to" +#~ msgstr "Päivitä:" + +#~ msgid "Updating" +#~ msgstr "Päivittää" + +#~ msgid "Updating Language Files..." +#~ msgstr "Päivittää kielitiedostoja..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Päivittää WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Laajakuva korjaus" + #~ msgid "Back to Wii Menu" #~ msgstr "Takaisin Wii Menuun" diff --git a/Languages/french.lang b/Languages/french.lang index ad4260f9..06cbe4c4 100644 --- a/Languages/french.lang +++ b/Languages/french.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Kin8\n" "Language-Team: Badablek, Amour, ikya & Kin8\n" @@ -25,54 +25,15 @@ msgstr " sauvegardé. Certains codes ne peuvent fonctionner conjointement. En ca msgid " is not on the server." msgstr " indisponible sur le serveur." -msgid "0 (Everyone)" -msgstr "0 (Tous 3+)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Enfants 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 heure" - -msgid "10 min" -msgstr "10 min." - -msgid "2 (Teen 12+)" -msgstr "2 (Adolescents 12+)" - -msgid "20 min" -msgstr "20 min." - msgid "2D Cover Path" msgstr "Dossier Jaquettes 2D" -msgid "3 (Mature 16+)" -msgstr "3 (Matures 16+)" - -msgid "3 min" -msgstr "3 min." - -msgid "30 min" -msgstr "30 min." - msgid "3D Cover Path" msgstr "Dossier Jaquettes 3D" msgid "3D Covers" msgstr "Jaquettes 3D" -msgid "4 (Adults Only 18+)" -msgstr "4 (Adultes 18+)" - -msgid "5 min" -msgstr "5 min." - msgid ">> Deleting tickets..." msgstr ">> Suppression tickets..." @@ -136,20 +97,14 @@ msgstr "Toutes les fonctionnalités sont déverrouillées." msgid "Alternate DOL" msgstr "DOL Alternatif" -msgid "An Error occured" -msgstr "Une Erreur s'est produite" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Langue d'interface" msgid "Apr" msgstr "Avr" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Confirmation activation du Contrôle Parental ?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Auteur:" msgid "AutoInit Network" msgstr "AutoInit Réseau" -msgid "AutoPatch" -msgstr "" - msgid "BCA Codes Path" msgstr "Dossier Codes BCA" @@ -199,9 +151,6 @@ msgstr "" msgid "Boot?" msgstr "Lancer ?" -msgid "Both" -msgstr "Tous" - msgid "Can't be formatted" msgstr "Formatage impossible" @@ -226,9 +175,6 @@ msgstr "Changer Dossier" msgid "Cheatfile is blank" msgstr "Fichier de triche vide" -msgid "Checking for Updates" -msgstr "Recherche de Mise à Jour" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Connexion perdue..." msgid "Console" msgstr "" -msgid "Console Default" -msgstr "Console par défaut" - msgid "Console Locked" msgstr "Console verrouillée" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Impossible de créer le fichier GCT" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Crédits" msgid "Custom Paths" msgstr "Personnalisation Dossiers" -msgid "Customs/Original" -msgstr "Persos/Originaux" - msgid "DOL Path" msgstr "Dossier DOL Alternatif" @@ -365,15 +309,9 @@ msgstr "Téléch. Labels DVD" msgid "Disc Artwork Path" msgstr "Dossier Labels DVD" -msgid "Disc Default" -msgstr "Disque par défaut" - msgid "Disc Images" msgstr "Labels DVD" -msgid "DiskFlip" -msgstr "Inversion Disque" - msgid "Display" msgstr "Affichage" @@ -404,6 +342,9 @@ msgstr "Voulez-vous télécharger ce thème ?" msgid "Do you want to format:" msgstr "Voulez-vous formater ?" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Voulez-vous utiliser le DOL Alternatif actuellement connu comme correct ?" @@ -434,26 +375,26 @@ msgstr "Téléchargement terminé" msgid "Download request failed." msgstr "Demande de téléchargement échouée" -msgid "Downloading" -msgstr "Téléchargement" - msgid "Downloading Page List:" msgstr "Chargement Prévisualisations:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Téléchargement du fichier" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Téléchargement de l'image:" -msgid "Dutch" -msgstr "Néerlandais" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "ERREUR" @@ -464,9 +405,6 @@ msgstr "ERREUR:" msgid "ERROR: Can't set up theme." msgstr "ERREUR: Configuration thème impossible." -msgid "English" -msgstr "Anglais" - msgid "Error" msgstr "Erreur" @@ -476,15 +414,24 @@ msgstr "Erreur !" msgid "Error 002 fix" msgstr "Correctif Erreur 002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Erreur à la lecture du disque" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Erreur durant le transfert de données." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Extraction échouée." msgid "Failed to open partition" msgstr "Échec accès partition" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "Fév" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Inversion-X" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formater" @@ -545,15 +486,9 @@ msgstr "Formatage en cours, veuillez patienter..." msgid "Free Space" msgstr "Espace restant" -msgid "French" -msgstr "Français" - msgid "Full Shutdown" msgstr "Éteindre" -msgid "GAMEID_Gamename" -msgstr "IDJEU_NomJeu" - msgid "GCT Cheatcodes Path" msgstr "Dossier GCT de Triche" @@ -566,9 +501,6 @@ msgstr "Configuration GUI" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg non trouvé dans aucun sous-dossier." -msgid "Game ID" -msgstr "ID du jeu" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Chargement Jeux" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Région" - msgid "Game Size" msgstr "Taille du jeu" @@ -599,18 +528,12 @@ msgstr "Le jeu est déjà installé:" msgid "Game partition" msgstr "Partition Jeu" -msgid "Gamename [GAMEID]" -msgstr "NomJeu [IDJEU]" - msgid "Games" msgstr "Jeux" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Allemand" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Insérez une carte SD pour utiliser cette option." msgid "Install" msgstr "Installer" -msgid "Install 1:1 Copy" -msgstr "Installer Copie 1:1" - msgid "Install Error!" msgstr "Erreur à l'installation !" @@ -691,21 +611,12 @@ msgstr "Installation titre... OK!" msgid "Installing wad" msgstr "Installation WAD" -msgid "Invalid PIN code" -msgstr "Code PIN invalide" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "SVP, faîtes passer cette information qui serait très utile à la Team USB Loader GX." -msgid "Italian" -msgstr "Italien" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "Japonais" - msgid "July" msgstr "Juil" @@ -718,9 +629,6 @@ msgstr "Garder" msgid "Keyboard" msgstr "Clavier" -msgid "Korean" -msgstr "Coréen" - msgid "Language File" msgstr "Langues" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Dossier Langue changé" -msgid "Left" -msgstr "Gauche" - -msgid "Like SysMenu" -msgstr "Menu système" - msgid "Load" msgstr "Charger" -msgid "Load From SD/USB" -msgstr "Charger sur SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Charger le fichier de: %s ?" @@ -752,6 +651,9 @@ msgstr "Charger le fichier de: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Charger comme DOL alternatif ?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Chargement langue par défaut." @@ -761,17 +663,8 @@ msgstr "Chargement musique standard." msgid "Lock Console" msgstr "Verrouiller la console" -msgid "Locked" -msgstr "Clic pour déverrouiller" - -msgid "Loop Directory" -msgstr "Répéter Dossier" - -msgid "Loop Music" -msgstr "Répéter Musique" - -msgid "Loop Sound" -msgstr "Son en boucle" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "Mars" @@ -794,15 +687,12 @@ msgstr "Mode Boucle Musique" msgid "Music Volume" msgstr "Volume Musique" -msgid "Neither" -msgstr "Aucun" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Nouveau DVD Détecté" -msgid "Next" -msgstr "Suivant" - msgid "No" msgstr "Non" @@ -839,12 +729,6 @@ msgstr "Pas de nouvelle Mise à Jour." msgid "No themes found on the site." msgstr "Aucun thème trouvé sur le site." -msgid "None" -msgstr "Aucun" - -msgid "Normal" -msgstr "4:3" - msgid "Not a WAD file." msgstr "Ce n'est pas un fichier WAD" @@ -884,9 +768,6 @@ msgstr "Inactif" msgid "OK" msgstr "" -msgid "ON" -msgstr "Actif" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Site Officiel:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Personnalisés" - -msgid "Only Original" -msgstr "Originaux" - -msgid "Only for Install" -msgstr "Jeu installé seulement" - -msgid "Original/Customs" -msgstr "Originaux/Persos" - msgid "Parental Control" msgstr "Contrôle Parental" -msgid "Parental Control disabled" -msgstr "Contrôle Parental désactivé" - msgid "Partition" msgstr "" @@ -947,9 +813,6 @@ msgstr "Utilisation" msgid "Play Next" msgstr "Jouer Suiv." -msgid "Play Once" -msgstr "Jouer 1 fois" - msgid "Play Previous" msgstr "Jouer Précéd." @@ -962,9 +825,6 @@ msgstr "Veuillez patienter..." msgid "Power off the Wii" msgstr "Éteindre la Wii" -msgid "Prev" -msgstr "Précédent" - msgid "Prompts Buttons" msgstr "Interface" @@ -974,9 +834,6 @@ msgstr "Publié par" msgid "Quick Boot" msgstr "Démarrage rapide" -msgid "Random Directory Music" -msgstr "Aléatoire" - msgid "Reading WAD data... Ok!" msgstr "Lecture données WAD... OK!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Retourner au menu Wii" -msgid "Right" -msgstr "Droite" - msgid "Rumble" msgstr "Vibrations" -msgid "SChinese" -msgstr "Chinois simplifié" - msgid "SFX Volume" msgstr "Volume SFX" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Choisir un DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "" @@ -1085,15 +933,6 @@ msgstr "Sons" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Son + Fond sonore" - -msgid "Sound+Quiet" -msgstr "Son + Silence" - -msgid "Spanish" -msgstr "Espagnol" - msgid "Special thanks to:" msgstr "Remerciements spéciaux à:" @@ -1121,24 +960,18 @@ msgstr "Succès de l'extraction du thème." msgid "Successfully installed:" msgstr "Installé avec succès:" -msgid "System Default" -msgstr "Système par défaut" - -msgid "TChinese" -msgstr "Chinois traditionnel" - msgid "TXT Cheatcodes Path" msgstr "Dossier TXT de Triche" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Répertoire indiqué inexistant. Souhaitez-vous le créer ?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "Le Wad a été installé. Mais ne peut être supprimé de la carte SD." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "L'installation WAD a échoué avec erreur %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Dossier Thèmes Téléch." @@ -1152,6 +985,9 @@ msgstr "Dossier Thème" msgid "Theme Title:" msgstr "Titre du Thème:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Echec Transfert" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "Périphérique USB introuvable" msgid "USB Loader GX is protected" msgstr "USB Loader GX est verrouillé" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Ouverture du WAD impossible (%s)." - msgid "Uninstall" msgstr "Désinstaller" @@ -1201,15 +1039,12 @@ msgstr "Désinstallation wad" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Déverrouiller Contrôle Parental" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Cette option requiert le déverrouillage de l'interface." -msgid "Unlocked" -msgstr "Clic pour verrouiller" - msgid "Unsupported format, try to extract manually." msgstr "Format non supporté, essayez d'extraire manuellement." @@ -1234,21 +1069,12 @@ msgstr "Mise à Jour tous fichiers Langue" msgid "Update failed" msgstr "Mise à Jour échouée" -msgid "Update to" -msgstr "vers la" - -msgid "Updating" -msgstr "Mise à Jour" - -msgid "Updating Language Files..." -msgstr "Mise à Jour Fichiers Langue..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Mise à Jour Fichiers Langue:" -msgid "Updating WiiTDB.zip" -msgstr "Mise à Jour WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Fichier ZIP envoyé et installé dans le répertoire homebrew." @@ -1280,9 +1106,6 @@ msgstr "Choix Mise à Jour" msgid "WiFi Features" msgstr "Connexion WiFi" -msgid "Widescreen Fix" -msgstr "16:9" - msgid "Wii Menu" msgstr "Menu Wii" @@ -1310,9 +1133,6 @@ msgstr "Oui" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Contrôle Parental désactivé. Si vous voulez l'utiliser, activez-le dans les Paramètres de votre Wii." - msgid "You need to select or format a partition" msgstr "Vous devez choisir ou formater une partition" @@ -1377,6 +1197,219 @@ msgstr "sur" msgid "seconds left" msgstr "secondes restantes" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Installer Copie 1:1" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Tous 3+)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Enfants 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 heure" + +#~ msgid "10 min" +#~ msgstr "10 min." + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Adolescents 12+)" + +#~ msgid "20 min" +#~ msgstr "20 min." + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Matures 16+)" + +#~ msgid "3 min" +#~ msgstr "3 min." + +#~ msgid "30 min" +#~ msgstr "30 min." + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Adultes 18+)" + +#~ msgid "5 min" +#~ msgstr "5 min." + +#~ msgid "An Error occured" +#~ msgstr "Une Erreur s'est produite" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Confirmation activation du Contrôle Parental ?" + +#~ msgid "Both" +#~ msgstr "Tous" + +#~ msgid "Checking for Updates" +#~ msgstr "Recherche de Mise à Jour" + +#~ msgid "Console Default" +#~ msgstr "Console par défaut" + +#~ msgid "Customs/Original" +#~ msgstr "Persos/Originaux" + +#~ msgid "Disc Default" +#~ msgstr "Disque par défaut" + +#~ msgid "DiskFlip" +#~ msgstr "Inversion Disque" + +#~ msgid "Downloading" +#~ msgstr "Téléchargement" + +#~ msgid "Dutch" +#~ msgstr "Néerlandais" + +#~ msgid "English" +#~ msgstr "Anglais" + +#~ msgid "French" +#~ msgstr "Français" + +#~ msgid "GAMEID_Gamename" +#~ msgstr "IDJEU_NomJeu" + +#~ msgid "Game ID" +#~ msgstr "ID du jeu" + +#~ msgid "Game Region" +#~ msgstr "Région" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "NomJeu [IDJEU]" + +#~ msgid "German" +#~ msgstr "Allemand" + +#~ msgid "Invalid PIN code" +#~ msgstr "Code PIN invalide" + +#~ msgid "Italian" +#~ msgstr "Italien" + +#~ msgid "Japanese" +#~ msgstr "Japonais" + +#~ msgid "Korean" +#~ msgstr "Coréen" + +#~ msgid "Left" +#~ msgstr "Gauche" + +#~ msgid "Like SysMenu" +#~ msgstr "Menu système" + +#~ msgid "Load From SD/USB" +#~ msgstr "Charger sur SD/USB" + +#~ msgid "Locked" +#~ msgstr "Clic pour déverrouiller" + +#~ msgid "Loop Directory" +#~ msgstr "Répéter Dossier" + +#~ msgid "Loop Music" +#~ msgstr "Répéter Musique" + +#~ msgid "Loop Sound" +#~ msgstr "Son en boucle" + +#~ msgid "Neither" +#~ msgstr "Aucun" + +#~ msgid "Next" +#~ msgstr "Suivant" + +#~ msgid "None" +#~ msgstr "Aucun" + +#~ msgid "Normal" +#~ msgstr "4:3" + +#~ msgid "ON" +#~ msgstr "Actif" + +#~ msgid "Only Customs" +#~ msgstr "Personnalisés" + +#~ msgid "Only Original" +#~ msgstr "Originaux" + +#~ msgid "Only for Install" +#~ msgstr "Jeu installé seulement" + +#~ msgid "Original/Customs" +#~ msgstr "Originaux/Persos" + +#~ msgid "Parental Control disabled" +#~ msgstr "Contrôle Parental désactivé" + +#~ msgid "Play Once" +#~ msgstr "Jouer 1 fois" + +#~ msgid "Prev" +#~ msgstr "Précédent" + +#~ msgid "Random Directory Music" +#~ msgstr "Aléatoire" + +#~ msgid "Right" +#~ msgstr "Droite" + +#~ msgid "SChinese" +#~ msgstr "Chinois simplifié" + +#~ msgid "Sound+BGM" +#~ msgstr "Son + Fond sonore" + +#~ msgid "Sound+Quiet" +#~ msgstr "Son + Silence" + +#~ msgid "Spanish" +#~ msgstr "Espagnol" + +#~ msgid "System Default" +#~ msgstr "Système par défaut" + +#~ msgid "TChinese" +#~ msgstr "Chinois traditionnel" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "Le Wad a été installé. Mais ne peut être supprimé de la carte SD." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "L'installation WAD a échoué avec erreur %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Ouverture du WAD impossible (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Déverrouiller Contrôle Parental" + +#~ msgid "Unlocked" +#~ msgstr "Clic pour verrouiller" + +#~ msgid "Update to" +#~ msgstr "vers la" + +#~ msgid "Updating" +#~ msgstr "Mise à Jour" + +#~ msgid "Updating Language Files..." +#~ msgstr "Mise à Jour Fichiers Langue..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Mise à Jour WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "16:9" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Contrôle Parental désactivé. Si vous voulez l'utiliser, activez-le dans les Paramètres de votre Wii." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Peut ne pas démarrer correctement si votre Menu Système n'est pas à jour." diff --git a/Languages/german.lang b/Languages/german.lang index ea4627a9..a97ca3b8 100644 --- a/Languages/german.lang +++ b/Languages/german.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: ZEN.13\n" "Language-Team: Snoozer, wishmasterf, Bertilax, ZEN.13\n" @@ -25,54 +25,15 @@ msgstr " wurde gespeichert. Möglicherweise funktionieren einige der Codes nicht msgid " is not on the server." msgstr " ist nicht auf dem Server." -msgid "0 (Everyone)" -msgstr "0 (Jeder)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Kinder 7+) " - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 Stunde" - -msgid "10 min" -msgstr "10 Minuten" - -msgid "2 (Teen 12+)" -msgstr "2 (Jugendliche 12+)" - -msgid "20 min" -msgstr "20 Minuten" - msgid "2D Cover Path" msgstr "2D Cover" -msgid "3 (Mature 16+)" -msgstr "3 (Erwachsene 16+)" - -msgid "3 min" -msgstr "3 Minuten" - -msgid "30 min" -msgstr "30 Minuten" - msgid "3D Cover Path" msgstr "3D Cover" msgid "3D Covers" msgstr "3D Cover" -msgid "4 (Adults Only 18+)" -msgstr "4 (Erwachsene 18+)" - -msgid "5 min" -msgstr "5 Minuten" - msgid ">> Deleting tickets..." msgstr ">> Lösche Tickets..." @@ -136,20 +97,14 @@ msgstr "Alle Funktionen des USB Loader GX sind jetzt freigeschaltet." msgid "Alternate DOL" msgstr "Alternative DOL" -msgid "An Error occured" -msgstr "Ein Fehler ist aufgetreten." - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Sprache" msgid "Apr" msgstr "April" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Bist du sicher, das du die Altersbeschränkung aktivieren möchtest?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Autor:" msgid "AutoInit Network" msgstr "AutoInit Netzwerk" -msgid "AutoPatch" -msgstr "" - msgid "BCA Codes Path" msgstr "BCA Codes" @@ -199,9 +151,6 @@ msgstr "Bootstandard (cIOS)" msgid "Boot?" msgstr "Kanal starten?" -msgid "Both" -msgstr "ID und Region" - msgid "Can't be formatted" msgstr "Kann nicht formatiert werden." @@ -226,9 +175,6 @@ msgstr "Pfad ändern" msgid "Cheatfile is blank" msgstr "Cheatdatei ist leer" -msgid "Checking for Updates" -msgstr "Suche nach Updates" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Verbindung abgebrochen..." msgid "Console" msgstr "Konsolenstatus" -msgid "Console Default" -msgstr "Konsolenstandard" - msgid "Console Locked" msgstr "Konsole gesperrt" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "GCT Datei konnte nicht erstellt werden." +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "" msgid "Custom Paths" msgstr "Pfade anpassen" -msgid "Customs/Original" -msgstr "Community/Original" - msgid "DOL Path" msgstr "Alternative DOL" @@ -365,15 +309,9 @@ msgstr "Disc Cover Download" msgid "Disc Artwork Path" msgstr "Disc Cover" -msgid "Disc Default" -msgstr "Discstandard" - msgid "Disc Images" msgstr "Disc Cover" -msgid "DiskFlip" -msgstr "DiscFlip" - msgid "Display" msgstr "Spielinfos anzeigen" @@ -404,6 +342,9 @@ msgstr "Dieses Theme herunterladen?" msgid "Do you want to format:" msgstr "Formatieren:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Die bekannte Alternative DOL verwenden?" @@ -434,26 +375,26 @@ msgstr "Download abgeschlossen" msgid "Download request failed." msgstr "Downloadanfrage fehlgeschlagen" -msgid "Downloading" -msgstr "Dateien werden heruntergeladen" - msgid "Downloading Page List:" msgstr "Liste der nächsten Seite wird geladen:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Theme wird heruntergeladen" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Weitere Vorschaubilder werden geladen:" -msgid "Dutch" -msgstr "Niederländisch" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "FEHLER" @@ -464,9 +405,6 @@ msgstr "FEHLER:" msgid "ERROR: Can't set up theme." msgstr "FEHLER: Theme kann nicht konfiguriert werden." -msgid "English" -msgstr "Englisch" - msgid "Error" msgstr "Fehler" @@ -476,15 +414,24 @@ msgstr "Fehler !" msgid "Error 002 fix" msgstr "ERROR #002 beheben" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Fehler beim Lesen der Disc" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Fehler während der Datenübertragung." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Entpacken fehlgeschlagen." msgid "Failed to open partition" msgstr "Öffnen der Partition fehlgeschlagen" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "Februar" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formatieren" @@ -545,15 +486,9 @@ msgstr "Formatiere, bitte warten..." msgid "Free Space" msgstr "Freier Speicher" -msgid "French" -msgstr "Französisch" - msgid "Full Shutdown" msgstr "WiiConnect24 aus" -msgid "GAMEID_Gamename" -msgstr "SPIELID_Spielname" - msgid "GCT Cheatcodes Path" msgstr "GCT Cheatdateien" @@ -566,9 +501,6 @@ msgstr "GUI Einstellungen" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg in keinem Unterordner gefunden." -msgid "Game ID" -msgstr "Spiel ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Spieleinstellungen" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Region" - msgid "Game Size" msgstr "Größe" @@ -599,18 +528,12 @@ msgstr "Spiel ist bereits installiert:" msgid "Game partition" msgstr "Spielpartition" -msgid "Gamename [GAMEID]" -msgstr "Spielname [SPIELID]" - msgid "Games" msgstr "Spiele" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Deutsch" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "SD Karte einlegen um diese Option zu nutzen." msgid "Install" msgstr "Installieren" -msgid "Install 1:1 Copy" -msgstr "1:1 Kopie installieren" - msgid "Install Error!" msgstr "Installationsfehler!" @@ -691,21 +611,12 @@ msgstr "Installiere Title... OK!" msgid "Installing wad" msgstr "Installiere WAD" -msgid "Invalid PIN code" -msgstr "Ungültiger PIN Code" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Es scheint als ob du Informationen hast, die hilfreich für uns sein könnten. Bitte sende diese Information ans DEV Team." -msgid "Italian" -msgstr "Italienisch" - msgid "Jan" msgstr "Januar" -msgid "Japanese" -msgstr "Japanisch" - msgid "July" msgstr "Juli" @@ -718,9 +629,6 @@ msgstr "Behalten" msgid "Keyboard" msgstr "Tastatur" -msgid "Korean" -msgstr "Koreanisch" - msgid "Language File" msgstr "Sprachdatei" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Pfad geändert" -msgid "Left" -msgstr "Links" - -msgid "Like SysMenu" -msgstr "System Menü" - msgid "Load" msgstr "Laden" -msgid "Load From SD/USB" -msgstr "von SD/USB laden" - #, c-format msgid "Load file from: %s ?" msgstr "Datei von %s laden?" @@ -752,6 +651,9 @@ msgstr "Datei von %s laden?" msgid "Load this DOL as alternate DOL?" msgstr "Diese DOL als Alternative DOL laden?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Lade Standardsprache." @@ -761,17 +663,8 @@ msgstr "Lade Standardmusik." msgid "Lock Console" msgstr "Konsole sperren" -msgid "Locked" -msgstr "Gesperrt" - -msgid "Loop Directory" -msgstr "Verzeichnis wiederholen" - -msgid "Loop Music" -msgstr "Scheife" - -msgid "Loop Sound" -msgstr "Wiederholung" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "März" @@ -794,15 +687,12 @@ msgstr "HGM Wiederholung" msgid "Music Volume" msgstr "Musik Lautstärke" -msgid "Neither" -msgstr "Keine" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Neu Disc im Laufwerk festgestellt" -msgid "Next" -msgstr "Weiter" - msgid "No" msgstr "Nein" @@ -839,12 +729,6 @@ msgstr "Keine Updates verfügbar." msgid "No themes found on the site." msgstr "Keine Themes auf der Seite gefunden." -msgid "None" -msgstr "Keine" - -msgid "Normal" -msgstr "Normal (4:3)" - msgid "Not a WAD file." msgstr "Das ist keine WAD Datei." @@ -884,9 +768,6 @@ msgstr "AUS" msgid "OK" msgstr "" -msgid "ON" -msgstr "AN" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Offizielle Seite:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "nur Community" - -msgid "Only Original" -msgstr "nur Originale" - -msgid "Only for Install" -msgstr "nur beim Installieren" - -msgid "Original/Customs" -msgstr "Original/Community" - msgid "Parental Control" msgstr "Altersbeschränkung" -msgid "Parental Control disabled" -msgstr "Altersbeschränkung ausgeschaltet" - msgid "Partition" msgstr "" @@ -947,9 +813,6 @@ msgstr "Spielzähler" msgid "Play Next" msgstr "Nächster Titel" -msgid "Play Once" -msgstr "Einmal abspielen" - msgid "Play Previous" msgstr "Vorheriger Titel" @@ -962,9 +825,6 @@ msgstr "Bitte warten..." msgid "Power off the Wii" msgstr "Wii ausschalten" -msgid "Prev" -msgstr "Zurück" - msgid "Prompts Buttons" msgstr "Anzeige" @@ -974,9 +834,6 @@ msgstr "Veröffentlicht von" msgid "Quick Boot" msgstr "Schnelles Laden" -msgid "Random Directory Music" -msgstr "Zufällig" - msgid "Reading WAD data... Ok!" msgstr "Lese WAD Daten... OK!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Zurück zum Wii Menü" -msgid "Right" -msgstr "Rechts" - msgid "Rumble" msgstr "" -msgid "SChinese" -msgstr "Vereinfachtes Chinesisch" - msgid "SFX Volume" msgstr "SFX Lautstärke" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "wähle eine DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "September" @@ -1085,15 +933,6 @@ msgstr "Ton" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "mit Hintergrundmusik" - -msgid "Sound+Quiet" -msgstr "ohne Hintergrundmusik" - -msgid "Spanish" -msgstr "Spanisch" - msgid "Special thanks to:" msgstr "Besonderen Dank an:" @@ -1121,24 +960,18 @@ msgstr "Theme erfolgreich entpackt." msgid "Successfully installed:" msgstr "Erfolgreich installiert:" -msgid "System Default" -msgstr "Konsolenstandard" - -msgid "TChinese" -msgstr "Traditionelles Chinesisch" - msgid "TXT Cheatcodes Path" msgstr "TXT Cheatdateien" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Das eingegebene Verzeichnis existiert nicht. Möchtest du es erstellen?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "Die WAD Datei wurde installiert. Sie konnte aber nicht von der SD Karte gelöscht werden." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "Die WAD Installation schlug fehl durch Fehler %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Theme Downloader" @@ -1152,6 +985,9 @@ msgstr "Theme" msgid "Theme Title:" msgstr "Name:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Übertragung fehlgeschlagen" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB Gerät nicht gefunden." msgid "USB Loader GX is protected" msgstr "USB Loader GX ist jetzt geschützt." -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Die WAD Datei, die gerade heruntergeladen wurde (%s), konnte nicht geöffnet werden." - msgid "Uninstall" msgstr "Deinstallieren" @@ -1201,15 +1039,12 @@ msgstr "Deinstalliere WAD" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Altersbeschränkung deaktivieren" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Entsperre den Loader, um diese Option zu nutzen." -msgid "Unlocked" -msgstr "Entsperrt" - msgid "Unsupported format, try to extract manually." msgstr "Nicht unterstütztes Format. Versuch es manuell zu Entpacken." @@ -1234,21 +1069,12 @@ msgstr "Sprachdateien aktualisieren" msgid "Update failed" msgstr "Update fehlgeschlagen" -msgid "Update to" -msgstr "Aktualisiere auf" - -msgid "Updating" -msgstr "Aktualisiere" - -msgid "Updating Language Files..." -msgstr "Aktualisiere Sprachdateien..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Aktualisiere Sprachdateien:" -msgid "Updating WiiTDB.zip" -msgstr "Aktualisiere WiiTDB" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Die hochgeladene ZIP Datei wurde ins Homebrew Verzeichnis installiert." @@ -1280,9 +1106,6 @@ msgstr "Was möchtest du aktualisieren?" msgid "WiFi Features" msgstr "WiFi Fähigkeiten" -msgid "Widescreen Fix" -msgstr "Breitbild (16:9)" - msgid "Wii Menu" msgstr "Wii Menü" @@ -1310,9 +1133,6 @@ msgstr "Ja" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Du hast die Wii-Altersbeschränkung nicht aktiviert. Wenn du sie nutzen möchtest, aktiviere sie in den Wii-Systemeinstellungen." - msgid "You need to select or format a partition" msgstr "Du must eine Partition auswählen oder formatieren." @@ -1377,6 +1197,219 @@ msgstr "von" msgid "seconds left" msgstr "Sekunden verbleiben" +#~ msgid "Install 1:1 Copy" +#~ msgstr "1:1 Kopie installieren" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Jeder)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Kinder 7+) " + +#~ msgid "1 hour" +#~ msgstr "1 Stunde" + +#~ msgid "10 min" +#~ msgstr "10 Minuten" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Jugendliche 12+)" + +#~ msgid "20 min" +#~ msgstr "20 Minuten" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Erwachsene 16+)" + +#~ msgid "3 min" +#~ msgstr "3 Minuten" + +#~ msgid "30 min" +#~ msgstr "30 Minuten" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Erwachsene 18+)" + +#~ msgid "5 min" +#~ msgstr "5 Minuten" + +#~ msgid "An Error occured" +#~ msgstr "Ein Fehler ist aufgetreten." + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Bist du sicher, das du die Altersbeschränkung aktivieren möchtest?" + +#~ msgid "Both" +#~ msgstr "ID und Region" + +#~ msgid "Checking for Updates" +#~ msgstr "Suche nach Updates" + +#~ msgid "Console Default" +#~ msgstr "Konsolenstandard" + +#~ msgid "Customs/Original" +#~ msgstr "Community/Original" + +#~ msgid "Disc Default" +#~ msgstr "Discstandard" + +#~ msgid "DiskFlip" +#~ msgstr "DiscFlip" + +#~ msgid "Downloading" +#~ msgstr "Dateien werden heruntergeladen" + +#~ msgid "Dutch" +#~ msgstr "Niederländisch" + +#~ msgid "English" +#~ msgstr "Englisch" + +#~ msgid "French" +#~ msgstr "Französisch" + +#~ msgid "GAMEID_Gamename" +#~ msgstr "SPIELID_Spielname" + +#~ msgid "Game ID" +#~ msgstr "Spiel ID" + +#~ msgid "Game Region" +#~ msgstr "Region" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "Spielname [SPIELID]" + +#~ msgid "German" +#~ msgstr "Deutsch" + +#~ msgid "Invalid PIN code" +#~ msgstr "Ungültiger PIN Code" + +#~ msgid "Italian" +#~ msgstr "Italienisch" + +#~ msgid "Japanese" +#~ msgstr "Japanisch" + +#~ msgid "Korean" +#~ msgstr "Koreanisch" + +#~ msgid "Left" +#~ msgstr "Links" + +#~ msgid "Like SysMenu" +#~ msgstr "System Menü" + +#~ msgid "Load From SD/USB" +#~ msgstr "von SD/USB laden" + +#~ msgid "Locked" +#~ msgstr "Gesperrt" + +#~ msgid "Loop Directory" +#~ msgstr "Verzeichnis wiederholen" + +#~ msgid "Loop Music" +#~ msgstr "Scheife" + +#~ msgid "Loop Sound" +#~ msgstr "Wiederholung" + +#~ msgid "Neither" +#~ msgstr "Keine" + +#~ msgid "Next" +#~ msgstr "Weiter" + +#~ msgid "None" +#~ msgstr "Keine" + +#~ msgid "Normal" +#~ msgstr "Normal (4:3)" + +#~ msgid "ON" +#~ msgstr "AN" + +#~ msgid "Only Customs" +#~ msgstr "nur Community" + +#~ msgid "Only Original" +#~ msgstr "nur Originale" + +#~ msgid "Only for Install" +#~ msgstr "nur beim Installieren" + +#~ msgid "Original/Customs" +#~ msgstr "Original/Community" + +#~ msgid "Parental Control disabled" +#~ msgstr "Altersbeschränkung ausgeschaltet" + +#~ msgid "Play Once" +#~ msgstr "Einmal abspielen" + +#~ msgid "Prev" +#~ msgstr "Zurück" + +#~ msgid "Random Directory Music" +#~ msgstr "Zufällig" + +#~ msgid "Right" +#~ msgstr "Rechts" + +#~ msgid "SChinese" +#~ msgstr "Vereinfachtes Chinesisch" + +#~ msgid "Sound+BGM" +#~ msgstr "mit Hintergrundmusik" + +#~ msgid "Sound+Quiet" +#~ msgstr "ohne Hintergrundmusik" + +#~ msgid "Spanish" +#~ msgstr "Spanisch" + +#~ msgid "System Default" +#~ msgstr "Konsolenstandard" + +#~ msgid "TChinese" +#~ msgstr "Traditionelles Chinesisch" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "Die WAD Datei wurde installiert. Sie konnte aber nicht von der SD Karte gelöscht werden." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "Die WAD Installation schlug fehl durch Fehler %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Die WAD Datei, die gerade heruntergeladen wurde (%s), konnte nicht geöffnet werden." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Altersbeschränkung deaktivieren" + +#~ msgid "Unlocked" +#~ msgstr "Entsperrt" + +#~ msgid "Update to" +#~ msgstr "Aktualisiere auf" + +#~ msgid "Updating" +#~ msgstr "Aktualisiere" + +#~ msgid "Updating Language Files..." +#~ msgstr "Aktualisiere Sprachdateien..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Aktualisiere WiiTDB" + +#~ msgid "Widescreen Fix" +#~ msgstr "Breitbild (16:9)" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Du hast die Wii-Altersbeschränkung nicht aktiviert. Wenn du sie nutzen möchtest, aktiviere sie in den Wii-Systemeinstellungen." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s startet evtl. nicht richtig, falls dein System Menü nicht aktuell ist." diff --git a/Languages/hungarian.lang b/Languages/hungarian.lang index 0e75f042..9a8425c1 100644 --- a/Languages/hungarian.lang +++ b/Languages/hungarian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-12-29 11:05+0100\n" "Last-Translator: Springdale\n" "Language-Team: Tusk, Springdale\n" @@ -25,54 +25,15 @@ msgstr "elmentve. A fájl nincs ellenõrizve, és egyes kódok nem feltétlenül msgid " is not on the server." msgstr "nincs a szerveren." -msgid "0 (Everyone)" -msgstr "0 (Mindenkinek)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Gyermekeknek 12+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 óra" - -msgid "10 min" -msgstr "10 perc" - -msgid "2 (Teen 12+)" -msgstr "2 (Tinédzserek 14+)" - -msgid "20 min" -msgstr "20 perc" - msgid "2D Cover Path" msgstr "2D Boritó Útvonala" -msgid "3 (Mature 16+)" -msgstr "3 (Kamaszok 16+)" - -msgid "3 min" -msgstr "3 perc" - -msgid "30 min" -msgstr "30 perc" - msgid "3D Cover Path" msgstr "3D Boritó Útvonala" msgid "3D Covers" msgstr "3D Borítók" -msgid "4 (Adults Only 18+)" -msgstr "4 (Felnõtteknek 18+)" - -msgid "5 min" -msgstr "5 perc" - msgid ">> Deleting tickets..." msgstr ">> Ticket-ek törlése..." @@ -136,20 +97,14 @@ msgstr "Az USB Loader GX minden funkciója elérhetõ." msgid "Alternate DOL" msgstr "Alternatív DOL" -msgid "An Error occured" -msgstr "Hiba történt" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Nyelv" msgid "Apr" msgstr "Ápr" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Szülõi felügyelet bekapcsolása?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Készítõ:" msgid "AutoInit Network" msgstr "Hálózat AutoInit" -msgid "AutoPatch" -msgstr "" - msgid "BCA Codes Path" msgstr "BCA kód útvonal" @@ -199,9 +151,6 @@ msgstr "Boot/Alapértelmezett" msgid "Boot?" msgstr "" -msgid "Both" -msgstr "Mindkettõ" - msgid "Can't be formatted" msgstr "Nem Formázható" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "A cheat-fájl üres" -msgid "Checking for Updates" -msgstr "Frissitések keresése..." - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "A kapcsolat megszakadt..." msgid "Console" msgstr "Konzol" -msgid "Console Default" -msgstr "Konzol Alapértelmezett" - msgid "Console Locked" msgstr "Konzol Zárolva" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Nem hozható létre GCT fájl" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Készítõk" msgid "Custom Paths" msgstr "Egyéni útvonalak" -msgid "Customs/Original" -msgstr "Egyéni/Eredeti" - msgid "DOL Path" msgstr "DOL Útvonal" @@ -365,15 +309,9 @@ msgstr "Lemezfotó letöltése" msgid "Disc Artwork Path" msgstr "Lemezképek Útvonala" -msgid "Disc Default" -msgstr "Lemez Alapértelmezettje" - msgid "Disc Images" msgstr "Lemezfotók" -msgid "DiskFlip" -msgstr "Lemezforgatás" - msgid "Display" msgstr "Játékinfo megj." @@ -404,6 +342,9 @@ msgstr "Téma letöltése?" msgid "Do you want to format:" msgstr "Formázás?" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Köztudottan működõ alternatív DOL használata?" @@ -434,26 +375,26 @@ msgstr "Letöltés kész" msgid "Download request failed." msgstr "Sikertelen letöltési kérelem." -msgid "Downloading" -msgstr "Letöltés" - msgid "Downloading Page List:" msgstr "Lista letöltése:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Fájl letöltése" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Kép letöltése:" -msgid "Dutch" -msgstr "Holland" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "HIBA" @@ -464,9 +405,6 @@ msgstr "HIBA:" msgid "ERROR: Can't set up theme." msgstr "HIBA: Téma nem állítható be" -msgid "English" -msgstr "Angol" - msgid "Error" msgstr "Hiba" @@ -476,15 +414,24 @@ msgstr "Hiba !" msgid "Error 002 fix" msgstr "Error 02 javítás" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Lemezolvasási hiba" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Adatátviteli hiba." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "A kicsomagolás nem sikerült." msgid "Failed to open partition" msgstr "Hiba a partíció megnyitásakor" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formázás" @@ -545,15 +486,9 @@ msgstr "Formatálás folyamatban, kérlek várj..." msgid "Free Space" msgstr "Szabad Hely" -msgid "French" -msgstr "Francia" - msgid "Full Shutdown" msgstr "Teljes Kikapcsolás" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "Kódok Útvonala" @@ -566,9 +501,6 @@ msgstr "Kezelõfelület" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg nem található." -msgid "Game ID" -msgstr "Játék ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Játék Betöltés" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Játék Régió" - msgid "Game Size" msgstr "Játék Méret" @@ -599,18 +528,12 @@ msgstr "A játék már fel van telepítve:" msgid "Game partition" msgstr "Játék partíció" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Játékok" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Német" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Helyezz be egy SD Kártyát, hogy használhasd ezt a lehetõséget." msgid "Install" msgstr "Telepítés" -msgid "Install 1:1 Copy" -msgstr "1:1 másolat telepítése" - msgid "Install Error!" msgstr "Telepítési Hiba!" @@ -691,21 +611,12 @@ msgstr "Title telepítése... Ok!" msgid "Installing wad" msgstr "Wad telepítése" -msgid "Invalid PIN code" -msgstr "Hibás PIN kód" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Számunkra segítõ információid lehetnek - kérlek továbbítsd ezeket a fejlesztõi csapat felé." -msgid "Italian" -msgstr "Olasz" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "Japán" - msgid "July" msgstr "Júl" @@ -718,9 +629,6 @@ msgstr "Megtartás" msgid "Keyboard" msgstr "Billenyûzet" -msgid "Korean" -msgstr "Koreai" - msgid "Language File" msgstr "Nyelvi fájl" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Nyelvek útvonala megváltozott." -msgid "Left" -msgstr "Balra" - -msgid "Like SysMenu" -msgstr "Mint a Rendszermenü" - msgid "Load" msgstr "Betöltés" -msgid "Load From SD/USB" -msgstr "Betöltés SD/USB-rõl" - #, c-format msgid "Load file from: %s ?" msgstr "Fájl betöltése innen: %s ?" @@ -752,6 +651,9 @@ msgstr "Fájl betöltése innen: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "DOL betöltése alternatív DOL-ként?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Alapnyelv betõltése" @@ -761,18 +663,9 @@ msgstr "Alapzene betõltése" msgid "Lock Console" msgstr "Konzol Lezárása" -msgid "Locked" -msgstr "Lezárva" - -msgid "Loop Directory" +msgid "Lock USB Loader GX" msgstr "" -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" -msgstr "Folyamatos hang" - msgid "Mar" msgstr "Már" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "Zene Hangerõ" -msgid "Neither" -msgstr "Egyik sem" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Új lemez észlelve" -msgid "Next" -msgstr "Következõ" - msgid "No" msgstr "Nem" @@ -839,12 +729,6 @@ msgstr "Nincs elérhetõ frissítés." msgid "No themes found on the site." msgstr "Nem találhatóak témák az oldalon." -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "Normális" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "KI" msgid "OK" msgstr "" -msgid "ON" -msgstr "BE" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Hivatalos oldal:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Csak egyéni" - -msgid "Only Original" -msgstr "Csak eredeti" - -msgid "Only for Install" -msgstr "Csak telepítéshez" - -msgid "Original/Customs" -msgstr "Eredeti/Egyéni" - msgid "Parental Control" msgstr "Szülõi Felügyelet" -msgid "Parental Control disabled" -msgstr "Szülõi felügyelet kikapcsolva" - msgid "Partition" msgstr "Partició" @@ -947,9 +813,6 @@ msgstr "Indítások" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "Kérlek várj..." msgid "Power off the Wii" msgstr "Wii kikapcsolása" -msgid "Prev" -msgstr "Elõzõ" - msgid "Prompts Buttons" msgstr "Gyors Gombok" @@ -974,9 +834,6 @@ msgstr "Kiadta" msgid "Quick Boot" msgstr "Gyors Boot" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "WAD adat olvasás... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Vissza a Wii Menübe" -msgid "Right" -msgstr "Jobb" - msgid "Rumble" msgstr "Rezgés" -msgid "SChinese" -msgstr "SKínai" - msgid "SFX Volume" msgstr "Effekt Hangerõ" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "DOL kiválasztása" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Szep" @@ -1085,15 +933,6 @@ msgstr "Hang" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Hang+háttérzene" - -msgid "Sound+Quiet" -msgstr "Csak hang" - -msgid "Spanish" -msgstr "Spanyol" - msgid "Special thanks to:" msgstr "Külön Köszönet:" @@ -1121,24 +960,18 @@ msgstr "Téma kicsomagolva." msgid "Successfully installed:" msgstr "Sikeresen telepítve:" -msgid "System Default" -msgstr "Rendszer Alapértelmezett" - -msgid "TChinese" -msgstr "Tradicionális Kínai" - msgid "TXT Cheatcodes Path" msgstr "TXT Cheatkódok Útvonala" msgid "The entered directory does not exist. Would you like to create it?" msgstr "A megadott könyvtár nem létezik. Létrehozzuk?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "A wad fájl telepítése megtörtént, de nem volt törölhetõ az SD kártyáról." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "A wad telepítés nem sikerült - hiba %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Téma Letöltés Útvonal" @@ -1152,6 +985,9 @@ msgstr "Témák Útvonala" msgid "Theme Title:" msgstr "Téma címe:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Átviteli hiba." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB Meghajtó nem található" msgid "USB Loader GX is protected" msgstr "USB Loader GX levédve" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Az épp letöltött wad megnyitása nem sikerült (%s)." - msgid "Uninstall" msgstr "Törlés" @@ -1201,15 +1039,12 @@ msgstr "Wad törlése" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Szülõi felügyelet feloldása" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Zárolva a program, ezt nem használhatod." -msgid "Unlocked" -msgstr "Feloldva" - msgid "Unsupported format, try to extract manually." msgstr "Nem támogatott formátum, próbáld manuálisan kicsomagolni." @@ -1234,21 +1069,12 @@ msgstr "Minden nyelvi fájl frissítése" msgid "Update failed" msgstr "Frissítési hiba" -msgid "Update to" -msgstr "Frissítés ide: " - -msgid "Updating" -msgstr "Frissítés" - -msgid "Updating Language Files..." -msgstr "Nyelvi fájlok frissítése..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Nyelvi fájlok frissítése:" -msgid "Updating WiiTDB.zip" -msgstr "WiiTDB.zip frissítése" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Feltöltött ZIP fájl telepítve a Homebrew mappába." @@ -1280,9 +1106,6 @@ msgstr "Mit szeretnél frissíteni?" msgid "WiFi Features" msgstr "WiFi Sajátosságok" -msgid "Widescreen Fix" -msgstr "Szélesvászon Fix" - msgid "Wii Menu" msgstr "Wii Menü" @@ -1310,9 +1133,6 @@ msgstr "Igen" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "A szülõi felügyelet nincs bekapcsolva - bekapcsolható a Wii Beállításokban." - msgid "You need to select or format a partition" msgstr "Választanod vagy formáznod kell egy partíciót" @@ -1377,6 +1197,198 @@ msgstr "./" msgid "seconds left" msgstr "hátralévõ másodperc" +#~ msgid "Install 1:1 Copy" +#~ msgstr "1:1 másolat telepítése" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Mindenkinek)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Gyermekeknek 12+)" + +#~ msgid "1 hour" +#~ msgstr "1 óra" + +#~ msgid "10 min" +#~ msgstr "10 perc" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Tinédzserek 14+)" + +#~ msgid "20 min" +#~ msgstr "20 perc" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Kamaszok 16+)" + +#~ msgid "3 min" +#~ msgstr "3 perc" + +#~ msgid "30 min" +#~ msgstr "30 perc" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Felnõtteknek 18+)" + +#~ msgid "5 min" +#~ msgstr "5 perc" + +#~ msgid "An Error occured" +#~ msgstr "Hiba történt" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Szülõi felügyelet bekapcsolása?" + +#~ msgid "Both" +#~ msgstr "Mindkettõ" + +#~ msgid "Checking for Updates" +#~ msgstr "Frissitések keresése..." + +#~ msgid "Console Default" +#~ msgstr "Konzol Alapértelmezett" + +#~ msgid "Customs/Original" +#~ msgstr "Egyéni/Eredeti" + +#~ msgid "Disc Default" +#~ msgstr "Lemez Alapértelmezettje" + +#~ msgid "DiskFlip" +#~ msgstr "Lemezforgatás" + +#~ msgid "Downloading" +#~ msgstr "Letöltés" + +#~ msgid "Dutch" +#~ msgstr "Holland" + +#~ msgid "English" +#~ msgstr "Angol" + +#~ msgid "French" +#~ msgstr "Francia" + +#~ msgid "Game ID" +#~ msgstr "Játék ID" + +#~ msgid "Game Region" +#~ msgstr "Játék Régió" + +#~ msgid "German" +#~ msgstr "Német" + +#~ msgid "Invalid PIN code" +#~ msgstr "Hibás PIN kód" + +#~ msgid "Italian" +#~ msgstr "Olasz" + +#~ msgid "Japanese" +#~ msgstr "Japán" + +#~ msgid "Korean" +#~ msgstr "Koreai" + +#~ msgid "Left" +#~ msgstr "Balra" + +#~ msgid "Like SysMenu" +#~ msgstr "Mint a Rendszermenü" + +#~ msgid "Load From SD/USB" +#~ msgstr "Betöltés SD/USB-rõl" + +#~ msgid "Locked" +#~ msgstr "Lezárva" + +#~ msgid "Loop Sound" +#~ msgstr "Folyamatos hang" + +#~ msgid "Neither" +#~ msgstr "Egyik sem" + +#~ msgid "Next" +#~ msgstr "Következõ" + +#~ msgid "Normal" +#~ msgstr "Normális" + +#~ msgid "ON" +#~ msgstr "BE" + +#~ msgid "Only Customs" +#~ msgstr "Csak egyéni" + +#~ msgid "Only Original" +#~ msgstr "Csak eredeti" + +#~ msgid "Only for Install" +#~ msgstr "Csak telepítéshez" + +#~ msgid "Original/Customs" +#~ msgstr "Eredeti/Egyéni" + +#~ msgid "Parental Control disabled" +#~ msgstr "Szülõi felügyelet kikapcsolva" + +#~ msgid "Prev" +#~ msgstr "Elõzõ" + +#~ msgid "Right" +#~ msgstr "Jobb" + +#~ msgid "SChinese" +#~ msgstr "SKínai" + +#~ msgid "Sound+BGM" +#~ msgstr "Hang+háttérzene" + +#~ msgid "Sound+Quiet" +#~ msgstr "Csak hang" + +#~ msgid "Spanish" +#~ msgstr "Spanyol" + +#~ msgid "System Default" +#~ msgstr "Rendszer Alapértelmezett" + +#~ msgid "TChinese" +#~ msgstr "Tradicionális Kínai" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "A wad fájl telepítése megtörtént, de nem volt törölhetõ az SD kártyáról." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "A wad telepítés nem sikerült - hiba %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Az épp letöltött wad megnyitása nem sikerült (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Szülõi felügyelet feloldása" + +#~ msgid "Unlocked" +#~ msgstr "Feloldva" + +#~ msgid "Update to" +#~ msgstr "Frissítés ide: " + +#~ msgid "Updating" +#~ msgstr "Frissítés" + +#~ msgid "Updating Language Files..." +#~ msgstr "Nyelvi fájlok frissítése..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "WiiTDB.zip frissítése" + +#~ msgid "Widescreen Fix" +#~ msgstr "Szélesvászon Fix" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "A szülõi felügyelet nincs bekapcsolva - bekapcsolható a Wii Beállításokban." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Lehet, hogy nem fut megfelelõen, ha a System Menu nem a legfrissebb." diff --git a/Languages/italian.lang b/Languages/italian.lang index 469bff74..6082aa9e 100644 --- a/Languages/italian.lang +++ b/Languages/italian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2010-02-21 08:00+0200\n" "Last-Translator: Cambo \n" "Language-Team: FoxeJoe, Cambo\n" @@ -25,54 +25,15 @@ msgstr " è stato salvato. Parte del codice potrebbe non funzionare correttament msgid " is not on the server." msgstr " non è disponibile sul server." -msgid "0 (Everyone)" -msgstr "0 (Tutti)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Bambini 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 ora" - -msgid "10 min" -msgstr "10 minuti" - -msgid "2 (Teen 12+)" -msgstr "2 (Ragazzini 12+)" - -msgid "20 min" -msgstr "20 minuti" - msgid "2D Cover Path" msgstr "Percorso Copertine 2D" -msgid "3 (Mature 16+)" -msgstr "3 (Ragazzi 16+)" - -msgid "3 min" -msgstr "3 minuti" - -msgid "30 min" -msgstr "30 minuti" - msgid "3D Cover Path" msgstr "Percorso Copertine 3D" msgid "3D Covers" msgstr "Copertine 3D" -msgid "4 (Adults Only 18+)" -msgstr "4 (Maggiorenni 18+)" - -msgid "5 min" -msgstr "5 minuti" - msgid ">> Deleting tickets..." msgstr ">> Eliminazione ticket..." @@ -136,20 +97,14 @@ msgstr "Tutte le funzioni di USB Loader GX sono sbloccate." msgid "Alternate DOL" msgstr "DOL Alternativo" -msgid "An Error occured" -msgstr "C'è stato un errore" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Percorso Lingua" msgid "Apr" msgstr "aprile" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Sei sicuro di voler attivare il Controllo Genitori?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Autore:" msgid "AutoInit Network" msgstr "Inizializz. Rete Automatica" -msgid "AutoPatch" -msgstr "Correzione automatica" - msgid "BCA Codes Path" msgstr "Percorso Codici BCA" @@ -199,9 +151,6 @@ msgstr "Riavvio/Standard" msgid "Boot?" msgstr "Vuoi riavviare?" -msgid "Both" -msgstr "Entrambi" - msgid "Can't be formatted" msgstr "Non si può formattare" @@ -226,9 +175,6 @@ msgstr "Modifica Percorso Suoni" msgid "Cheatfile is blank" msgstr "il file dei trucchi è vuoto" -msgid "Checking for Updates" -msgstr "Verifica Aggiornamenti" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Connessione persa..." msgid "Console" msgstr "Terminale" -msgid "Console Default" -msgstr "Predefinita Console" - msgid "Console Locked" msgstr "Console Bloccata" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Non è stato possibile creare il file GCT" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "" msgid "Custom Paths" msgstr "Impostazione Percorsi (Directory)" -msgid "Customs/Original" -msgstr "Modific./Origin." - msgid "DOL Path" msgstr "Percorso File DOL" @@ -365,15 +309,9 @@ msgstr "Scaricamento Imm. Disco" msgid "Disc Artwork Path" msgstr "Percorso Imm. Disco" -msgid "Disc Default" -msgstr "Predefinita Disco" - msgid "Disc Images" msgstr "Immagini Disco" -msgid "DiskFlip" -msgstr "Gira i dischi" - msgid "Display" msgstr "Visualizza" @@ -404,6 +342,9 @@ msgstr "Vuoi scaricare questo tema?" msgid "Do you want to format:" msgstr "Vuoi formattare:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Vuoi utilizzare il DOL alternativo funzionante?" @@ -434,26 +375,26 @@ msgstr "Ho finito di scaricare" msgid "Download request failed." msgstr "Richiesta di download fallita." -msgid "Downloading" -msgstr "Sto scaricando" - msgid "Downloading Page List:" msgstr "Sto scaricando l'elenco:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Sto scaricando il file" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Sto scaricando l'immagine:" -msgid "Dutch" -msgstr "Olandese" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "ERRORE" @@ -464,9 +405,6 @@ msgstr "ERRORE:" msgid "ERROR: Can't set up theme." msgstr "ERRORE: Impossibile configurare il tema." -msgid "English" -msgstr "Inglese" - msgid "Error" msgstr "Errore" @@ -476,15 +414,24 @@ msgstr "Errore !" msgid "Error 002 fix" msgstr "Correzione Error002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Errore Lettura Disco" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Errore durante il trasferimento dei dati." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Scompattamento fallito." msgid "Failed to open partition" msgstr "Non si accede alla partizione" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "febbraio" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Scorrimento Dischi" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formatta" @@ -545,15 +486,9 @@ msgstr "Sto Formattando, prego attendere..." msgid "Free Space" msgstr "Spazio libero" -msgid "French" -msgstr "Francese" - msgid "Full Shutdown" msgstr "Completo" -msgid "GAMEID_Gamename" -msgstr "IDGIOCO_Nomegioco" - msgid "GCT Cheatcodes Path" msgstr "Percorso Trucchi in GCT" @@ -566,9 +501,6 @@ msgstr "Impostazioni Loader" msgid "GXtheme.cfg not found in any subfolder." msgstr "Nessuna sottocartella contiene il file GXtheme.cfg." -msgid "Game ID" -msgstr "ID Gioco" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Impostazioni Giochi" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Regione Gioco" - msgid "Game Size" msgstr "Dimensione Gioco" @@ -599,18 +528,12 @@ msgstr "Gioco già installato:" msgid "Game partition" msgstr "Partizione gioco" -msgid "Gamename [GAMEID]" -msgstr "Nomegioco [IDGIOCO]" - msgid "Games" msgstr "Giochi" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Tedesco" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Inserire scheda SD per questa opzione" msgid "Install" msgstr "Installa" -msgid "Install 1:1 Copy" -msgstr "Installa copia 1:1" - msgid "Install Error!" msgstr "Errore Installazione!" @@ -691,21 +611,12 @@ msgstr "Sto installando il titolo... Ok!" msgid "Installing wad" msgstr "Sto installando il WAD" -msgid "Invalid PIN code" -msgstr "Codice PIN non valido" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Hai informazioni che potrebbero esserci utili. Per favore, comunicale al team di sviluppo." -msgid "Italian" -msgstr "Italiano" - msgid "Jan" msgstr "gennaio" -msgid "Japanese" -msgstr "Giapponese" - msgid "July" msgstr "luglio" @@ -718,9 +629,6 @@ msgstr "Mantieni" msgid "Keyboard" msgstr "Tastiera" -msgid "Korean" -msgstr "Coreano" - msgid "Language File" msgstr "File Lingue" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Percorso Lingue modificato" -msgid "Left" -msgstr "Sinistra" - -msgid "Like SysMenu" -msgstr "Come SysMenu" - msgid "Load" msgstr "Carica" -msgid "Load From SD/USB" -msgstr "Caricamento da SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Vuoi caricare il file da: %s ?" @@ -752,6 +651,9 @@ msgstr "Vuoi caricare il file da: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Vuoi caricare questo DOL come DOL alternativo?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Caricamento Lingua Standard." @@ -761,17 +663,8 @@ msgstr "Caricamento Musica std." msgid "Lock Console" msgstr "Blocco Console" -msgid "Locked" -msgstr "Bloccato" - -msgid "Loop Directory" -msgstr "Cartella Cicli" - -msgid "Loop Music" -msgstr "Musica Ripetuta" - -msgid "Loop Sound" -msgstr "Suono Ripetuto" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "marzo" @@ -794,15 +687,12 @@ msgstr "Modalità Musica Ripetuta" msgid "Music Volume" msgstr "Volume" -msgid "Neither" -msgstr "Nessuno" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Trovato Nuovo Disco" -msgid "Next" -msgstr "Avanti" - msgid "No" msgstr "" @@ -839,12 +729,6 @@ msgstr "Nessun Aggiornamento." msgid "No themes found on the site." msgstr "Nessun tema trovato sul sito." -msgid "None" -msgstr "Nessuno" - -msgid "Normal" -msgstr "Normale" - msgid "Not a WAD file." msgstr "Non è un file WAD." @@ -884,9 +768,6 @@ msgstr "Disattivato" msgid "OK" msgstr "" -msgid "ON" -msgstr "Attivato" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Sito Ufficiale:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Modificate" - -msgid "Only Original" -msgstr "Originali" - -msgid "Only for Install" -msgstr "Installa Solamente" - -msgid "Original/Customs" -msgstr "Origin./Modific." - msgid "Parental Control" msgstr "Controllo Genitori" -msgid "Parental Control disabled" -msgstr "Controllo Genitori disabilitato" - msgid "Partition" msgstr "Partizione" @@ -947,9 +813,6 @@ msgstr "Giocati" msgid "Play Next" msgstr "Suona Successiva" -msgid "Play Once" -msgstr "Suona una volta" - msgid "Play Previous" msgstr "Suona Precedente" @@ -962,9 +825,6 @@ msgstr "Attendere prego..." msgid "Power off the Wii" msgstr "Spegnimento Wii" -msgid "Prev" -msgstr "Indietro" - msgid "Prompts Buttons" msgstr "Pulsanti" @@ -974,9 +834,6 @@ msgstr "Pubblicato da" msgid "Quick Boot" msgstr "Avvio Veloce" -msgid "Random Directory Music" -msgstr "Cartella Musica Casuale" - msgid "Reading WAD data... Ok!" msgstr "Sto leggendo i dati del WAD... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Torna al Menu Wii" -msgid "Right" -msgstr "Destra" - msgid "Rumble" msgstr "Vibrazione" -msgid "SChinese" -msgstr "Cinese Moderno" - msgid "SFX Volume" msgstr "Volume SFX" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Seleziona un file DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "settembre" @@ -1085,15 +933,6 @@ msgstr "Audio" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Suono+BGM" - -msgid "Sound+Quiet" -msgstr "Suono+Silenzio" - -msgid "Spanish" -msgstr "Spagnolo" - msgid "Special thanks to:" msgstr "Un ringraziamento speciale a:" @@ -1121,24 +960,18 @@ msgstr "Tema scompattato con successo." msgid "Successfully installed:" msgstr "Installato con successo:" -msgid "System Default" -msgstr "Predefinita Sistema" - -msgid "TChinese" -msgstr "Cinese Tradizionale" - msgid "TXT Cheatcodes Path" msgstr "Percorso Trucchi in TXT" msgid "The entered directory does not exist. Would you like to create it?" msgstr "La cartella indicata non esiste. Vuoi crearla?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "File Wad installato. Non si può però eliminare dalla scheda SD." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "L'installazione del WAD è fallita con errore %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Percorso Download Temi" @@ -1152,6 +985,9 @@ msgstr "Percorso Tema" msgid "Theme Title:" msgstr "Titolo del tema:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Trasferimento fallito." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "Dispositivo USB non Trovato" msgid "USB Loader GX is protected" msgstr "USB Loader GX è Protetto" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Non riesco ad aprire il wad da poco scaricato (%s)." - msgid "Uninstall" msgstr "Disinstalla" @@ -1201,15 +1039,12 @@ msgstr "Disinstalla WAD" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Sblocca Controllo Genitori" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Sblocca la Console per usare questa opzione." -msgid "Unlocked" -msgstr "Sbloccato" - msgid "Unsupported format, try to extract manually." msgstr "Formato non supportato, provare a scompattare manualmente." @@ -1234,21 +1069,12 @@ msgstr "Aggiorna tutti i file delle lingue" msgid "Update failed" msgstr "Aggiornamento Fallito" -msgid "Update to" -msgstr "Aggiornamento alla" - -msgid "Updating" -msgstr "Aggiornamento" - -msgid "Updating Language Files..." -msgstr "Aggiornamento file delle lingue..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Aggiornamento file delle lingue:" -msgid "Updating WiiTDB.zip" -msgstr "Aggiornamento file WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "File ZIP installato nella cartella Homebrew" @@ -1280,9 +1106,6 @@ msgstr "Che cosa vuoi aggiornare?" msgid "WiFi Features" msgstr "Caratteristiche WiFi" -msgid "Widescreen Fix" -msgstr "Widescreen" - msgid "Wii Menu" msgstr "Menu Wii" @@ -1310,9 +1133,6 @@ msgstr "Sì" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Il Controllo Genitori non è attivo. Se vuoi utilizzare il Controllo Genitori abilitalo nelle Impostazioni della Wii." - msgid "You need to select or format a partition" msgstr "Occorre selezionare o formattare una partizione" @@ -1377,6 +1197,222 @@ msgstr "di" msgid "seconds left" msgstr "secondi mancanti" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Installa copia 1:1" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Tutti)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Bambini 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 ora" + +#~ msgid "10 min" +#~ msgstr "10 minuti" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Ragazzini 12+)" + +#~ msgid "20 min" +#~ msgstr "20 minuti" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Ragazzi 16+)" + +#~ msgid "3 min" +#~ msgstr "3 minuti" + +#~ msgid "30 min" +#~ msgstr "30 minuti" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Maggiorenni 18+)" + +#~ msgid "5 min" +#~ msgstr "5 minuti" + +#~ msgid "An Error occured" +#~ msgstr "C'è stato un errore" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Sei sicuro di voler attivare il Controllo Genitori?" + +#~ msgid "AutoPatch" +#~ msgstr "Correzione automatica" + +#~ msgid "Both" +#~ msgstr "Entrambi" + +#~ msgid "Checking for Updates" +#~ msgstr "Verifica Aggiornamenti" + +#~ msgid "Console Default" +#~ msgstr "Predefinita Console" + +#~ msgid "Customs/Original" +#~ msgstr "Modific./Origin." + +#~ msgid "Disc Default" +#~ msgstr "Predefinita Disco" + +#~ msgid "DiskFlip" +#~ msgstr "Gira i dischi" + +#~ msgid "Downloading" +#~ msgstr "Sto scaricando" + +#~ msgid "Dutch" +#~ msgstr "Olandese" + +#~ msgid "English" +#~ msgstr "Inglese" + +#~ msgid "French" +#~ msgstr "Francese" + +#~ msgid "GAMEID_Gamename" +#~ msgstr "IDGIOCO_Nomegioco" + +#~ msgid "Game ID" +#~ msgstr "ID Gioco" + +#~ msgid "Game Region" +#~ msgstr "Regione Gioco" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "Nomegioco [IDGIOCO]" + +#~ msgid "German" +#~ msgstr "Tedesco" + +#~ msgid "Invalid PIN code" +#~ msgstr "Codice PIN non valido" + +#~ msgid "Italian" +#~ msgstr "Italiano" + +#~ msgid "Japanese" +#~ msgstr "Giapponese" + +#~ msgid "Korean" +#~ msgstr "Coreano" + +#~ msgid "Left" +#~ msgstr "Sinistra" + +#~ msgid "Like SysMenu" +#~ msgstr "Come SysMenu" + +#~ msgid "Load From SD/USB" +#~ msgstr "Caricamento da SD/USB" + +#~ msgid "Locked" +#~ msgstr "Bloccato" + +#~ msgid "Loop Directory" +#~ msgstr "Cartella Cicli" + +#~ msgid "Loop Music" +#~ msgstr "Musica Ripetuta" + +#~ msgid "Loop Sound" +#~ msgstr "Suono Ripetuto" + +#~ msgid "Neither" +#~ msgstr "Nessuno" + +#~ msgid "Next" +#~ msgstr "Avanti" + +#~ msgid "None" +#~ msgstr "Nessuno" + +#~ msgid "Normal" +#~ msgstr "Normale" + +#~ msgid "ON" +#~ msgstr "Attivato" + +#~ msgid "Only Customs" +#~ msgstr "Modificate" + +#~ msgid "Only Original" +#~ msgstr "Originali" + +#~ msgid "Only for Install" +#~ msgstr "Installa Solamente" + +#~ msgid "Original/Customs" +#~ msgstr "Origin./Modific." + +#~ msgid "Parental Control disabled" +#~ msgstr "Controllo Genitori disabilitato" + +#~ msgid "Play Once" +#~ msgstr "Suona una volta" + +#~ msgid "Prev" +#~ msgstr "Indietro" + +#~ msgid "Random Directory Music" +#~ msgstr "Cartella Musica Casuale" + +#~ msgid "Right" +#~ msgstr "Destra" + +#~ msgid "SChinese" +#~ msgstr "Cinese Moderno" + +#~ msgid "Sound+BGM" +#~ msgstr "Suono+BGM" + +#~ msgid "Sound+Quiet" +#~ msgstr "Suono+Silenzio" + +#~ msgid "Spanish" +#~ msgstr "Spagnolo" + +#~ msgid "System Default" +#~ msgstr "Predefinita Sistema" + +#~ msgid "TChinese" +#~ msgstr "Cinese Tradizionale" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "File Wad installato. Non si può però eliminare dalla scheda SD." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "L'installazione del WAD è fallita con errore %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Non riesco ad aprire il wad da poco scaricato (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Sblocca Controllo Genitori" + +#~ msgid "Unlocked" +#~ msgstr "Sbloccato" + +#~ msgid "Update to" +#~ msgstr "Aggiornamento alla" + +#~ msgid "Updating" +#~ msgstr "Aggiornamento" + +#~ msgid "Updating Language Files..." +#~ msgstr "Aggiornamento file delle lingue..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Aggiornamento file WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Widescreen" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Il Controllo Genitori non è attivo. Se vuoi utilizzare il Controllo Genitori abilitalo nelle Impostazioni della Wii." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Potrebbe non essere caricato correttamente se il tuo System Menu non è aggiornato." diff --git a/Languages/japanese.lang b/Languages/japanese.lang index c8af9c32..f58df13c 100644 --- a/Languages/japanese.lang +++ b/Languages/japanese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: hosigumayuugi\n" "Language-Team: hosigumayuugi\n" @@ -25,54 +25,15 @@ msgstr "に保存されました。使用は 自己責任でお願いします msgid " is not on the server." msgstr "はサーバーにありません" -msgid "0 (Everyone)" -msgstr "0(セットしない)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1(C以上を制限)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1時間" - -msgid "10 min" -msgstr "10分" - -msgid "2 (Teen 12+)" -msgstr "2(D以上を制限)" - -msgid "20 min" -msgstr "20分" - msgid "2D Cover Path" msgstr "2Dカバーのパス" -msgid "3 (Mature 16+)" -msgstr "3(Z以上を制限)" - -msgid "3 min" -msgstr "3分" - -msgid "30 min" -msgstr "30分" - msgid "3D Cover Path" msgstr "3Dカバーのパス" msgid "3D Covers" msgstr "3Dカバー" -msgid "4 (Adults Only 18+)" -msgstr "4(Zを制限)" - -msgid "5 min" -msgstr "5分" - msgid ">> Deleting tickets..." msgstr ">> チケットを削除します" @@ -136,20 +97,14 @@ msgstr "GXの使用者制限が解除されました" msgid "Alternate DOL" msgstr "代理DOL起動" -msgid "An Error occured" -msgstr "エラーが起きました" - -msgid "Anti" -msgstr "排除する" - msgid "App Language" msgstr "使用言語" msgid "Apr" msgstr "4月" -msgid "Are you sure you want to enable Parent Control?" -msgstr "使用制限機能を使用しますか?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "制作者:" msgid "AutoInit Network" msgstr "自動接続機能" -msgid "AutoPatch" -msgstr "自動パッチ" - msgid "BCA Codes Path" msgstr "BCAコードのパス" @@ -199,9 +151,6 @@ msgstr "使用するcIOS" msgid "Boot?" msgstr "起動しますか?" -msgid "Both" -msgstr "IDとリージョンを表示" - msgid "Can't be formatted" msgstr "初期化できません" @@ -226,9 +175,6 @@ msgstr "プレイパスを変更" msgid "Cheatfile is blank" msgstr "チートファイルがありません" -msgid "Checking for Updates" -msgstr "最新版を確認中" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "接続失敗・・・" msgid "Console" msgstr "状態" -msgid "Console Default" -msgstr "GXのデフォルト" - msgid "Console Locked" msgstr "GXはロックされています" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "GCTファイルを作成できませんでした" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "提供・協力" msgid "Custom Paths" msgstr "パスを変更" -msgid "Customs/Original" -msgstr "カスタムを優先" - msgid "DOL Path" msgstr "DOLのパス" @@ -365,15 +309,9 @@ msgstr "使用するディスク画像" msgid "Disc Artwork Path" msgstr "ディスク画像のパス" -msgid "Disc Default" -msgstr "ディスクのデフォルト" - msgid "Disc Images" msgstr "ディスク画像" -msgid "DiskFlip" -msgstr "ディスクの回転風" - msgid "Display" msgstr "ゲーム情報" @@ -404,6 +342,9 @@ msgstr "ダウンロードしますか?" msgid "Do you want to format:" msgstr "初期化しますか?" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "既知の代替DOLを利用しますか?" @@ -434,26 +375,26 @@ msgstr "ダウンロードが終了しました" msgid "Download request failed." msgstr "ダウンロードに失敗しました" -msgid "Downloading" -msgstr "ダウンロードします" - msgid "Downloading Page List:" msgstr "リストをダウンロード中" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "ファイルをダウンロード中" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "画像をダウンロード中" -msgid "Dutch" -msgstr "オランダ語" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "エラー" @@ -464,9 +405,6 @@ msgstr "エラー:" msgid "ERROR: Can't set up theme." msgstr "テーマを適用できませんでした" -msgid "English" -msgstr "英語" - msgid "Error" msgstr "エラー" @@ -476,15 +414,24 @@ msgstr "エラー!" msgid "Error 002 fix" msgstr "Error002対策" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "読み込みに失敗しました" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "転送中にエラーが発生しました" +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "解凍に失敗しました" msgid "Failed to open partition" msgstr "領域を開けませんでした" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "2月" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "ゲームリストの回転" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "初期化" @@ -545,15 +486,9 @@ msgstr "初期化中です、暫くお待ち下さい..." msgid "Free Space" msgstr "空き" -msgid "French" -msgstr "フランス語" - msgid "Full Shutdown" msgstr "シャットダウン" -msgid "GAMEID_Gamename" -msgstr "ゲームID_ゲーム名" - msgid "GCT Cheatcodes Path" msgstr "GCTファイルのパス" @@ -566,9 +501,6 @@ msgstr "基本設定" msgid "GXtheme.cfg not found in any subfolder." msgstr "設定ファイルが見つかりません" -msgid "Game ID" -msgstr "IDのみ" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "読み込みの設定" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "リージョンのみ" - msgid "Game Size" msgstr "サイズ" @@ -599,18 +528,12 @@ msgstr "このゲームは既にインストールされています:" msgid "Game partition" msgstr "ゲーム領域のみ" -msgid "Gamename [GAMEID]" -msgstr "ゲーム名 [ゲームID]" - msgid "Games" msgstr "総ゲーム数" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "ドイツ語" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "このオプションを使用するためSDカードを挿入し msgid "Install" msgstr "インストール" -msgid "Install 1:1 Copy" -msgstr "フルコピー" - msgid "Install Error!" msgstr "インストールエラー!" @@ -691,21 +611,12 @@ msgstr "タイトルをインストール...成功!" msgid "Installing wad" msgstr "WADをインストールします" -msgid "Invalid PIN code" -msgstr "暗証番号を間違えています" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "この情報は開発者までお知らせください" -msgid "Italian" -msgstr "イタリア語" - msgid "Jan" msgstr "1月" -msgid "Japanese" -msgstr "日本語" - msgid "July" msgstr "7月" @@ -718,9 +629,6 @@ msgstr "保存" msgid "Keyboard" msgstr "キーボードのタイプ" -msgid "Korean" -msgstr "韓国語" - msgid "Language File" msgstr "言語ファイル" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "言語のパスを変更しました" -msgid "Left" -msgstr "左ボタンで" - -msgid "Like SysMenu" -msgstr "Wiiメニュー風" - msgid "Load" msgstr "はじめる" -msgid "Load From SD/USB" -msgstr "SD/USBからロード" - #, c-format msgid "Load file from: %s ?" msgstr "%sからファイルをロードしますか?" @@ -752,6 +651,9 @@ msgstr "%sからファイルをロードしますか?" msgid "Load this DOL as alternate DOL?" msgstr "このDOLを代替DOLとしてロードしますか?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "標準の言語に変更しますか" @@ -761,17 +663,8 @@ msgstr "初期設定に戻しますか" msgid "Lock Console" msgstr "GXをロック" -msgid "Locked" -msgstr "ロックされています" - -msgid "Loop Directory" -msgstr "フォルダ内でループ" - -msgid "Loop Music" -msgstr "ループさせる" - -msgid "Loop Sound" -msgstr "ループさせる" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "3月" @@ -794,15 +687,12 @@ msgstr "ループ機能" msgid "Music Volume" msgstr "BGMの音量" -msgid "Neither" -msgstr "非表示" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "新しいディスクが検出されました" -msgid "Next" -msgstr "左へ" - msgid "No" msgstr "いいえ" @@ -839,12 +729,6 @@ msgstr "更新はありません" msgid "No themes found on the site." msgstr "テーマが見つかりません" -msgid "None" -msgstr "なし" - -msgid "Normal" -msgstr "ワイド" - msgid "Not a WAD file." msgstr "WADファイルではありません" @@ -884,9 +768,6 @@ msgstr "使わない" msgid "OK" msgstr "" -msgid "ON" -msgstr "使う" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "公式サイト:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "カスタムのみ" - -msgid "Only Original" -msgstr "公式のみ" - -msgid "Only for Install" -msgstr "インストール中のみ" - -msgid "Original/Customs" -msgstr "公式を優先" - msgid "Parental Control" msgstr "ペアレンタルコントロール" -msgid "Parental Control disabled" -msgstr "使用制限機能を無効にしました" - msgid "Partition" msgstr "使用する領域" @@ -947,9 +813,6 @@ msgstr "プレイ回数" msgid "Play Next" msgstr "次へ" -msgid "Play Once" -msgstr "一度だけ再生" - msgid "Play Previous" msgstr "前へ" @@ -962,9 +825,6 @@ msgstr "しばらくお待ちください" msgid "Power off the Wii" msgstr "Wiiの電源を切る" -msgid "Prev" -msgstr "左へ" - msgid "Prompts Buttons" msgstr "ウインドウサイズ" @@ -974,9 +834,6 @@ msgstr "発売元:" msgid "Quick Boot" msgstr "ワンボタン起動" -msgid "Random Directory Music" -msgstr "フォルダ内でランダム再生" - msgid "Reading WAD data... Ok!" msgstr "WADデータの読み込み...成功!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Wiiメニューへもどる" -msgid "Right" -msgstr "右ボタンで" - msgid "Rumble" msgstr "Wiiリモコンの振動機能" -msgid "SChinese" -msgstr "簡体中国語" - msgid "SFX Volume" msgstr "効果音の音量" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "DOLを選択" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "9月" @@ -1085,15 +933,6 @@ msgstr "サウンド" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "サウンドとBGM" - -msgid "Sound+Quiet" -msgstr "サウンドのみ" - -msgid "Spanish" -msgstr "スペイン語" - msgid "Special thanks to:" msgstr "スペシャルサンクス:" @@ -1121,24 +960,18 @@ msgstr "テーマの解凍を完了しました." msgid "Successfully installed:" msgstr "このゲームをインストールしました" -msgid "System Default" -msgstr "Wiiのデフォルト" - -msgid "TChinese" -msgstr "繁体中国語" - msgid "TXT Cheatcodes Path" msgstr "TXTコードのパス" msgid "The entered directory does not exist. Would you like to create it?" msgstr "ディレクトリがありません。作りますか?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "WADファイルをインストールしましたが、SDから削除できませんでした" +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "WADのインストールはエラー:%ldで失敗しました" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "テーマを保存するパス" @@ -1152,6 +985,9 @@ msgstr "テーマのパス" msgid "Theme Title:" msgstr "テーマ名:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "転送を失敗しました" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USBデバイスを検出できませんでした" msgid "USB Loader GX is protected" msgstr "USB Loaderは保護されています" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "ダウンロード中のためWADを開けません (%s)." - msgid "Uninstall" msgstr "アンインストール" @@ -1201,15 +1039,12 @@ msgstr "WADをアンインストール" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "使用制限機能を解除" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "ロックを解除してください" -msgid "Unlocked" -msgstr "ロックされていません" - msgid "Unsupported format, try to extract manually." msgstr "非対応の形式なので自己解凍してください" @@ -1234,21 +1069,12 @@ msgstr "全言語ファイルを更新" msgid "Update failed" msgstr "更新に失敗しました" -msgid "Update to" -msgstr "最新版:" - -msgid "Updating" -msgstr "更新中 -" - -msgid "Updating Language Files..." -msgstr "言語ファイルを更新中..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "言語ファイルを更新中:" -msgid "Updating WiiTDB.zip" -msgstr "WiiTDB.zipを更新中" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "インストール済みディレクトリにZIPを送信しました" @@ -1280,9 +1106,6 @@ msgstr "何を更新しますか?" msgid "WiFi Features" msgstr "ネットワーク対応" -msgid "Widescreen Fix" -msgstr "普通" - msgid "Wii Menu" msgstr "Wiiメニューへ" @@ -1310,9 +1133,6 @@ msgstr "はい" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Wii本体設定で使用制限機能を有効にしてください" - msgid "You need to select or format a partition" msgstr "領域を選択するか初期化してください" @@ -1377,6 +1197,225 @@ msgstr "中" msgid "seconds left" msgstr "秒で完了" +#~ msgid "Install 1:1 Copy" +#~ msgstr "フルコピー" + +#~ msgid "0 (Everyone)" +#~ msgstr "0(セットしない)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1(C以上を制限)" + +#~ msgid "1 hour" +#~ msgstr "1時間" + +#~ msgid "10 min" +#~ msgstr "10分" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2(D以上を制限)" + +#~ msgid "20 min" +#~ msgstr "20分" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3(Z以上を制限)" + +#~ msgid "3 min" +#~ msgstr "3分" + +#~ msgid "30 min" +#~ msgstr "30分" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4(Zを制限)" + +#~ msgid "5 min" +#~ msgstr "5分" + +#~ msgid "An Error occured" +#~ msgstr "エラーが起きました" + +#~ msgid "Anti" +#~ msgstr "排除する" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "使用制限機能を使用しますか?" + +#~ msgid "AutoPatch" +#~ msgstr "自動パッチ" + +#~ msgid "Both" +#~ msgstr "IDとリージョンを表示" + +#~ msgid "Checking for Updates" +#~ msgstr "最新版を確認中" + +#~ msgid "Console Default" +#~ msgstr "GXのデフォルト" + +#~ msgid "Customs/Original" +#~ msgstr "カスタムを優先" + +#~ msgid "Disc Default" +#~ msgstr "ディスクのデフォルト" + +#~ msgid "DiskFlip" +#~ msgstr "ディスクの回転風" + +#~ msgid "Downloading" +#~ msgstr "ダウンロードします" + +#~ msgid "Dutch" +#~ msgstr "オランダ語" + +#~ msgid "English" +#~ msgstr "英語" + +#~ msgid "French" +#~ msgstr "フランス語" + +#~ msgid "GAMEID_Gamename" +#~ msgstr "ゲームID_ゲーム名" + +#~ msgid "Game ID" +#~ msgstr "IDのみ" + +#~ msgid "Game Region" +#~ msgstr "リージョンのみ" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "ゲーム名 [ゲームID]" + +#~ msgid "German" +#~ msgstr "ドイツ語" + +#~ msgid "Invalid PIN code" +#~ msgstr "暗証番号を間違えています" + +#~ msgid "Italian" +#~ msgstr "イタリア語" + +#~ msgid "Japanese" +#~ msgstr "日本語" + +#~ msgid "Korean" +#~ msgstr "韓国語" + +#~ msgid "Left" +#~ msgstr "左ボタンで" + +#~ msgid "Like SysMenu" +#~ msgstr "Wiiメニュー風" + +#~ msgid "Load From SD/USB" +#~ msgstr "SD/USBからロード" + +#~ msgid "Locked" +#~ msgstr "ロックされています" + +#~ msgid "Loop Directory" +#~ msgstr "フォルダ内でループ" + +#~ msgid "Loop Music" +#~ msgstr "ループさせる" + +#~ msgid "Loop Sound" +#~ msgstr "ループさせる" + +#~ msgid "Neither" +#~ msgstr "非表示" + +#~ msgid "Next" +#~ msgstr "左へ" + +#~ msgid "None" +#~ msgstr "なし" + +#~ msgid "Normal" +#~ msgstr "ワイド" + +#~ msgid "ON" +#~ msgstr "使う" + +#~ msgid "Only Customs" +#~ msgstr "カスタムのみ" + +#~ msgid "Only Original" +#~ msgstr "公式のみ" + +#~ msgid "Only for Install" +#~ msgstr "インストール中のみ" + +#~ msgid "Original/Customs" +#~ msgstr "公式を優先" + +#~ msgid "Parental Control disabled" +#~ msgstr "使用制限機能を無効にしました" + +#~ msgid "Play Once" +#~ msgstr "一度だけ再生" + +#~ msgid "Prev" +#~ msgstr "左へ" + +#~ msgid "Random Directory Music" +#~ msgstr "フォルダ内でランダム再生" + +#~ msgid "Right" +#~ msgstr "右ボタンで" + +#~ msgid "SChinese" +#~ msgstr "簡体中国語" + +#~ msgid "Sound+BGM" +#~ msgstr "サウンドとBGM" + +#~ msgid "Sound+Quiet" +#~ msgstr "サウンドのみ" + +#~ msgid "Spanish" +#~ msgstr "スペイン語" + +#~ msgid "System Default" +#~ msgstr "Wiiのデフォルト" + +#~ msgid "TChinese" +#~ msgstr "繁体中国語" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "WADファイルをインストールしましたが、SDから削除できませんでした" + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "WADのインストールはエラー:%ldで失敗しました" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "ダウンロード中のためWADを開けません (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "使用制限機能を解除" + +#~ msgid "Unlocked" +#~ msgstr "ロックされていません" + +#~ msgid "Update to" +#~ msgstr "最新版:" + +#~ msgid "Updating" +#~ msgstr "更新中 -" + +#~ msgid "Updating Language Files..." +#~ msgstr "言語ファイルを更新中..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "WiiTDB.zipを更新中" + +#~ msgid "Widescreen Fix" +#~ msgstr "普通" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Wii本体設定で使用制限機能を有効にしてください" + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Wiiが更新されていなければ正常に起動できない可能性があります" diff --git a/Languages/korean.lang b/Languages/korean.lang index db59cb80..8b9a467b 100644 --- a/Languages/korean.lang +++ b/Languages/korean.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: nextos@korea.com\n" "Language-Team: \n" @@ -25,54 +25,15 @@ msgstr " 저장됨. 문자는 검증되지 않았음. 몇몇의 코드는 정상 msgid " is not on the server." msgstr " 은 서버에 없어요." -msgid "0 (Everyone)" -msgstr "0 (모두다)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (7세 이상)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 시간" - -msgid "10 min" -msgstr "10 분" - -msgid "2 (Teen 12+)" -msgstr "2 (12세 이상)" - -msgid "20 min" -msgstr "20 분" - msgid "2D Cover Path" msgstr "2D 표지 경로" -msgid "3 (Mature 16+)" -msgstr "3 (16세 이상)" - -msgid "3 min" -msgstr "3 분" - -msgid "30 min" -msgstr "30 분" - msgid "3D Cover Path" msgstr "3D 표지 경로" msgid "3D Covers" msgstr "3D 커버" -msgid "4 (Adults Only 18+)" -msgstr "4 (성인 18세 이상)" - -msgid "5 min" -msgstr "5 분" - msgid ">> Deleting tickets..." msgstr ">> 티켓 삭제중..." @@ -136,19 +97,13 @@ msgstr "모든 USB로더 GX 기능 잠금 해제." msgid "Alternate DOL" msgstr "Alternate DOL" -msgid "An Error occured" -msgstr "에러 발생" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "USB 로더 언어" msgid "Apr" msgstr "4월" -msgid "Are you sure you want to enable Parent Control?" +msgid "Are you sure you want to lock USB Loader GX?" msgstr "" msgid "Are you sure you want to reset?" @@ -166,9 +121,6 @@ msgstr "" msgid "AutoInit Network" msgstr "자동네트웍설정" -msgid "AutoPatch" -msgstr "자동 패치" - msgid "BCA Codes Path" msgstr "" @@ -199,9 +151,6 @@ msgstr "기본 부팅설정" msgid "Boot?" msgstr "부팅?" -msgid "Both" -msgstr "둘다" - msgid "Can't be formatted" msgstr "포맷할 수 없습니다." @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "치트화일 내용없음" -msgid "Checking for Updates" -msgstr "업데이트 확인" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "콘솔" -msgid "Console Default" -msgstr "콘솔 기본값" - msgid "Console Locked" msgstr "콘솔 잠김" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "GCT 파일을 생성할수 없음" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Credits" msgid "Custom Paths" msgstr "Custom Paths" -msgid "Customs/Original" -msgstr "커스텀/오리지널" - msgid "DOL Path" msgstr "DOL 패치" @@ -365,15 +309,9 @@ msgstr "디스크 이미지 다운로드" msgid "Disc Artwork Path" msgstr "디스크 이미지 경로" -msgid "Disc Default" -msgstr "디스크 기본값" - msgid "Disc Images" msgstr "디스크 이미지" -msgid "DiskFlip" -msgstr "디스크 플립" - msgid "Display" msgstr "화면 표시" @@ -404,6 +342,9 @@ msgstr "" msgid "Do you want to format:" msgstr "포맷하겠습니까:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "정말로 Alt. DOL을 사용할까요?" @@ -434,26 +375,26 @@ msgstr "다운로드 완료" msgid "Download request failed." msgstr "" -msgid "Downloading" -msgstr "다운로딩중" - msgid "Downloading Page List:" msgstr "" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "파일 다운로드 중:" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "" -msgid "Dutch" -msgstr "네덜란드어" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "에러" @@ -464,9 +405,6 @@ msgstr "에러:" msgid "ERROR: Can't set up theme." msgstr "" -msgid "English" -msgstr "영어" - msgid "Error" msgstr "에러" @@ -476,15 +414,24 @@ msgstr "에러 !" msgid "Error 002 fix" msgstr "Error 002 fix" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "디스크 읽기 오류" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "데이터 전송중 에러." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "" msgid "Failed to open partition" msgstr "파티션 열기 실패" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "2월" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "좌/우 설정" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "포맷" @@ -545,15 +486,9 @@ msgstr "포맷 중. 기다려 주세요..." msgid "Free Space" msgstr "여유 공간" -msgid "French" -msgstr "불어" - msgid "Full Shutdown" msgstr "완전히 끄기" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "치트코드 경로" @@ -566,9 +501,6 @@ msgstr "GUI 설정" msgid "GXtheme.cfg not found in any subfolder." msgstr "" -msgid "Game ID" -msgstr "게임 ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "게임 로드" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "지역" - msgid "Game Size" msgstr "게임 용량" @@ -599,18 +528,12 @@ msgstr "게임이 이미 설치되어 있습니다." msgid "Game partition" msgstr "" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "게임" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "독일어" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "이 옵션을 사용할 SD카드를 넣으세요." msgid "Install" msgstr "설치" -msgid "Install 1:1 Copy" -msgstr "" - msgid "Install Error!" msgstr "설치 에러!" @@ -691,21 +611,12 @@ msgstr "타이틀 설치중... Ok!" msgid "Installing wad" msgstr "Wad 설치중" -msgid "Invalid PIN code" -msgstr "" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "우리를 도울수 있는 정보를 가지고 있군요. 이정보를 DEV 팀에 전달해주세요." -msgid "Italian" -msgstr "이태리어" - msgid "Jan" msgstr "1월" -msgid "Japanese" -msgstr "일본어" - msgid "July" msgstr "7월" @@ -718,9 +629,6 @@ msgstr "보관" msgid "Keyboard" msgstr "키보드" -msgid "Korean" -msgstr "한국어" - msgid "Language File" msgstr "언어화일" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "언어경로 변경됨." -msgid "Left" -msgstr "왼쪽" - -msgid "Like SysMenu" -msgstr "시스템 메뉴처럼" - msgid "Load" msgstr "로드" -msgid "Load From SD/USB" -msgstr "" - #, c-format msgid "Load file from: %s ?" msgstr "화일 로드는 %s 에서?" @@ -752,6 +651,9 @@ msgstr "화일 로드는 %s 에서?" msgid "Load this DOL as alternate DOL?" msgstr "이 DOL화일을 alternate DOL로 로딩할까요?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "표준 언어로 로딩." @@ -761,16 +663,7 @@ msgstr "표중 음악으로 로딩." msgid "Lock Console" msgstr "콘솔 잠금" -msgid "Locked" -msgstr "잠김" - -msgid "Loop Directory" -msgstr "" - -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" +msgid "Lock USB Loader GX" msgstr "" msgid "Mar" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "음량" -msgid "Neither" -msgstr "표시 없음" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "" -msgid "Next" -msgstr "다음" - msgid "No" msgstr "아니오" @@ -839,12 +729,6 @@ msgstr "새로운 업데이트 없음." msgid "No themes found on the site." msgstr "" -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "일반" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "꺼짐" msgid "OK" msgstr "확인" -msgid "ON" -msgstr "켜짐" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "공식 사이트:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "사용자 설정만" - -msgid "Only Original" -msgstr "원본만" - -msgid "Only for Install" -msgstr "인스톨만" - -msgid "Original/Customs" -msgstr "원본/사용자설정" - msgid "Parental Control" msgstr "자녀보호기능" -msgid "Parental Control disabled" -msgstr "" - msgid "Partition" msgstr "파티션" @@ -947,9 +813,6 @@ msgstr "실행 횟수" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "" msgid "Power off the Wii" msgstr "Wii 전원 끄기" -msgid "Prev" -msgstr "이전" - msgid "Prompts Buttons" msgstr "프롬프트/버튼" @@ -974,9 +834,6 @@ msgstr "출판자" msgid "Quick Boot" msgstr "게임 바로실행" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "WAD 데이터 읽기... 성공!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "위 메뉴로 돌아가기" -msgid "Right" -msgstr "오른쪽" - msgid "Rumble" msgstr "진동" -msgid "SChinese" -msgstr "중국어(간체)" - msgid "SFX Volume" msgstr "SFX 볼륨" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "9월" @@ -1085,15 +933,6 @@ msgstr "소리" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "" - -msgid "Sound+Quiet" -msgstr "" - -msgid "Spanish" -msgstr "스페인어" - msgid "Special thanks to:" msgstr "Special thanks to:" @@ -1121,24 +960,18 @@ msgstr "" msgid "Successfully installed:" msgstr "설치 성공:" -msgid "System Default" -msgstr "시스템 기본값" - -msgid "TChinese" -msgstr "중국어(번체)" - msgid "TXT Cheatcodes Path" msgstr "TXT 치트코드 경로" msgid "The entered directory does not exist. Would you like to create it?" msgstr "" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "WAD화일이 인스톨됨. 하지만 SD 카드에서 삭제할수 없음." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "WAD 인스톨 실패 에러 %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "" @@ -1152,6 +985,9 @@ msgstr "테마 경로" msgid "Theme Title:" msgstr "" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB 장치가 없습니다." msgid "USB Loader GX is protected" msgstr "USB 로더 GX 잠김 상태" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "방금 다운로드한 wad화일(%s)을 열수가 없음." - msgid "Uninstall" msgstr "제거" @@ -1201,15 +1039,12 @@ msgstr "WAD 언인스톨" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" +msgid "Unlock USB Loader GX" msgstr "" msgid "Unlock console to use this option." msgstr "이 옵션을 사용하기 위해 콘솔을 잠금해제" -msgid "Unlocked" -msgstr "잠금해제" - msgid "Unsupported format, try to extract manually." msgstr "" @@ -1234,21 +1069,12 @@ msgstr "모든 언어화일 업데이트" msgid "Update failed" msgstr "업데이트 실패" -msgid "Update to" -msgstr "감사" - -msgid "Updating" -msgstr "업데이트중" - -msgid "Updating Language Files..." -msgstr "언어화일 업데이트중..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "언어화일 업데이트중:" -msgid "Updating WiiTDB.zip" -msgstr "WiiTDB.zip 업데이트중" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "" @@ -1280,9 +1106,6 @@ msgstr "무엇을 업데이트 할까요?" msgid "WiFi Features" msgstr "WiFi 형태" -msgid "Widescreen Fix" -msgstr "와이드 스크린에 맞춤" - msgid "Wii Menu" msgstr "Wii 메뉴로" @@ -1310,9 +1133,6 @@ msgstr "예" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "" - msgid "You need to select or format a partition" msgstr "" @@ -1377,6 +1197,171 @@ msgstr "중" msgid "seconds left" msgstr "초 남았습니다" +#~ msgid "0 (Everyone)" +#~ msgstr "0 (모두다)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (7세 이상)" + +#~ msgid "1 hour" +#~ msgstr "1 시간" + +#~ msgid "10 min" +#~ msgstr "10 분" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (12세 이상)" + +#~ msgid "20 min" +#~ msgstr "20 분" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (16세 이상)" + +#~ msgid "3 min" +#~ msgstr "3 분" + +#~ msgid "30 min" +#~ msgstr "30 분" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (성인 18세 이상)" + +#~ msgid "5 min" +#~ msgstr "5 분" + +#~ msgid "An Error occured" +#~ msgstr "에러 발생" + +#~ msgid "AutoPatch" +#~ msgstr "자동 패치" + +#~ msgid "Both" +#~ msgstr "둘다" + +#~ msgid "Checking for Updates" +#~ msgstr "업데이트 확인" + +#~ msgid "Console Default" +#~ msgstr "콘솔 기본값" + +#~ msgid "Customs/Original" +#~ msgstr "커스텀/오리지널" + +#~ msgid "Disc Default" +#~ msgstr "디스크 기본값" + +#~ msgid "DiskFlip" +#~ msgstr "디스크 플립" + +#~ msgid "Downloading" +#~ msgstr "다운로딩중" + +#~ msgid "Dutch" +#~ msgstr "네덜란드어" + +#~ msgid "English" +#~ msgstr "영어" + +#~ msgid "French" +#~ msgstr "불어" + +#~ msgid "Game ID" +#~ msgstr "게임 ID" + +#~ msgid "Game Region" +#~ msgstr "지역" + +#~ msgid "German" +#~ msgstr "독일어" + +#~ msgid "Italian" +#~ msgstr "이태리어" + +#~ msgid "Japanese" +#~ msgstr "일본어" + +#~ msgid "Korean" +#~ msgstr "한국어" + +#~ msgid "Left" +#~ msgstr "왼쪽" + +#~ msgid "Like SysMenu" +#~ msgstr "시스템 메뉴처럼" + +#~ msgid "Locked" +#~ msgstr "잠김" + +#~ msgid "Neither" +#~ msgstr "표시 없음" + +#~ msgid "Next" +#~ msgstr "다음" + +#~ msgid "Normal" +#~ msgstr "일반" + +#~ msgid "ON" +#~ msgstr "켜짐" + +#~ msgid "Only Customs" +#~ msgstr "사용자 설정만" + +#~ msgid "Only Original" +#~ msgstr "원본만" + +#~ msgid "Only for Install" +#~ msgstr "인스톨만" + +#~ msgid "Original/Customs" +#~ msgstr "원본/사용자설정" + +#~ msgid "Prev" +#~ msgstr "이전" + +#~ msgid "Right" +#~ msgstr "오른쪽" + +#~ msgid "SChinese" +#~ msgstr "중국어(간체)" + +#~ msgid "Spanish" +#~ msgstr "스페인어" + +#~ msgid "System Default" +#~ msgstr "시스템 기본값" + +#~ msgid "TChinese" +#~ msgstr "중국어(번체)" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "WAD화일이 인스톨됨. 하지만 SD 카드에서 삭제할수 없음." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "WAD 인스톨 실패 에러 %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "방금 다운로드한 wad화일(%s)을 열수가 없음." + +#~ msgid "Unlocked" +#~ msgstr "잠금해제" + +#~ msgid "Update to" +#~ msgstr "감사" + +#~ msgid "Updating" +#~ msgstr "업데이트중" + +#~ msgid "Updating Language Files..." +#~ msgstr "언어화일 업데이트중..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "WiiTDB.zip 업데이트중" + +#~ msgid "Widescreen Fix" +#~ msgstr "와이드 스크린에 맞춤" + #~ msgid "Back to Wii Menu" #~ msgstr "Wii 메뉴로 놀아가기" diff --git a/Languages/norwegian.lang b/Languages/norwegian.lang index df11a370..3e129289 100644 --- a/Languages/norwegian.lang +++ b/Languages/norwegian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: raschi\n" "Language-Team: raschi\n" @@ -25,54 +25,15 @@ msgstr " har blitt lagret. Teksten har ikke blitt verifisert. Noe av koden vil msgid " is not on the server." msgstr " finnes ikke på serveren." -msgid "0 (Everyone)" -msgstr "0 (Alle)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Barn 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 time" - -msgid "10 min" -msgstr "" - -msgid "2 (Teen 12+)" -msgstr "2 (Ungdom 12+)" - -msgid "20 min" -msgstr "" - msgid "2D Cover Path" msgstr "2D Cover sti" -msgid "3 (Mature 16+)" -msgstr "3 (Ungdom 16+)" - -msgid "3 min" -msgstr "" - -msgid "30 min" -msgstr "" - msgid "3D Cover Path" msgstr "3D Cover sti" msgid "3D Covers" msgstr "3D cover" -msgid "4 (Adults Only 18+)" -msgstr "4 (Voksen 18+)" - -msgid "5 min" -msgstr "" - msgid ">> Deleting tickets..." msgstr ">> Sletter tickets..." @@ -136,19 +97,13 @@ msgstr "Alle funksjonene til USB Loader GX er opplåst." msgid "Alternate DOL" msgstr "Alternativ DOL" -msgid "An Error occured" -msgstr "En feil oppstod" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Program språk" msgid "Apr" msgstr "" -msgid "Are you sure you want to enable Parent Control?" +msgid "Are you sure you want to lock USB Loader GX?" msgstr "" msgid "Are you sure you want to reset?" @@ -166,9 +121,6 @@ msgstr "Forfatter:" msgid "AutoInit Network" msgstr "Autostart nettverk" -msgid "AutoPatch" -msgstr "" - msgid "BCA Codes Path" msgstr "" @@ -199,9 +151,6 @@ msgstr "Boot/Standard" msgid "Boot?" msgstr "Start?" -msgid "Both" -msgstr "Begge" - msgid "Can't be formatted" msgstr "Kan ikke formateres" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "Juksefil er blank" -msgid "Checking for Updates" -msgstr "Søker etter oppdateringer" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "Konsoll" -msgid "Console Default" -msgstr "Konsoll Standard" - msgid "Console Locked" msgstr "Konsoll låst" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Kan ikke opprette GCT fil" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Medvirkende" msgid "Custom Paths" msgstr "Endre stier" -msgid "Customs/Original" -msgstr "Custom/Original" - msgid "DOL Path" msgstr "DOL sti" @@ -365,15 +309,9 @@ msgstr "Platebilde nedlasting" msgid "Disc Artwork Path" msgstr "Platebilde sti" -msgid "Disc Default" -msgstr "Spill Standard" - msgid "Disc Images" msgstr "Plate bilder" -msgid "DiskFlip" -msgstr "Snu plate" - msgid "Display" msgstr "Vis" @@ -404,6 +342,9 @@ msgstr "Vil du laste ned dette temaet?" msgid "Do you want to format:" msgstr "Vil du formatere:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Vil du bruke alt DOL filen som er kjent for å være riktig?" @@ -434,26 +375,26 @@ msgstr "Nedlasting ferdig" msgid "Download request failed." msgstr "Nedlast spørring feilet." -msgid "Downloading" -msgstr "Laster ned" - msgid "Downloading Page List:" msgstr "Laster ned side liste:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Laster ned fil" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Laster ned bilde:" -msgid "Dutch" -msgstr "Nederlandsk" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "FEIL" @@ -464,9 +405,6 @@ msgstr "FEIL:" msgid "ERROR: Can't set up theme." msgstr "" -msgid "English" -msgstr "Engelsk" - msgid "Error" msgstr "Feil" @@ -476,15 +414,24 @@ msgstr "Feil !" msgid "Error 002 fix" msgstr "Error 002 fiks" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Feil ved lesing av plate" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Feil ved overføring av data." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Utpakking feilet." msgid "Failed to open partition" msgstr "Feil ved åpning av partisjon" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formatér" @@ -545,15 +486,9 @@ msgstr "Formaterer, vennligst vent..." msgid "Free Space" msgstr "Ledig plass" -msgid "French" -msgstr "Fransk" - msgid "Full Shutdown" msgstr "Skru helt av" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "GCT Juksekode sti" @@ -566,9 +501,6 @@ msgstr "GUI innstillinger" msgid "GXtheme.cfg not found in any subfolder." msgstr "" -msgid "Game ID" -msgstr "Spill ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Lasting av spill" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Region" - msgid "Game Size" msgstr "Spill størrelse" @@ -599,18 +528,12 @@ msgstr "Spillet er allerede installert:" msgid "Game partition" msgstr "" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Spill" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Tysk" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Sett inn et SD-kort for å bruke innstillingen." msgid "Install" msgstr "Installér" -msgid "Install 1:1 Copy" -msgstr "" - msgid "Install Error!" msgstr "Installasjonsfeil!" @@ -691,21 +611,12 @@ msgstr "Installerer tittel... OK!" msgid "Installing wad" msgstr "Installerer WAD" -msgid "Invalid PIN code" -msgstr "" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Det ser ut til at du har informasjon som kan være nyttig for oss. Vennligst videresend denne informasjonen til utviklerteamet." -msgid "Italian" -msgstr "Italiensk" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "Japansk" - msgid "July" msgstr "Jul" @@ -718,9 +629,6 @@ msgstr "Behold" msgid "Keyboard" msgstr "Tastatur" -msgid "Korean" -msgstr "Koreansk" - msgid "Language File" msgstr "Språk Fil" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Språksti endret." -msgid "Left" -msgstr "Venstre" - -msgid "Like SysMenu" -msgstr "Lik Systemmeny" - msgid "Load" msgstr "Start" -msgid "Load From SD/USB" -msgstr "Start fra SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Start fil fra: %s ?" @@ -752,6 +651,9 @@ msgstr "Start fil fra: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Last denne DOL som alternativ DOL?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Laster standard språk." @@ -761,16 +663,7 @@ msgstr "Laster standard musikk." msgid "Lock Console" msgstr "Lås konsoll" -msgid "Locked" -msgstr "Låst" - -msgid "Loop Directory" -msgstr "" - -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" +msgid "Lock USB Loader GX" msgstr "" msgid "Mar" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "Musikk volum" -msgid "Neither" -msgstr "Ingen" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Ny plate oppdaget" -msgid "Next" -msgstr "Neste" - msgid "No" msgstr "Nei" @@ -839,12 +729,6 @@ msgstr "Ingen nye oppdateringer." msgid "No themes found on the site." msgstr "Ingen temaer funnet på websiden." -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "AV" msgid "OK" msgstr "" -msgid "ON" -msgstr "PÅ" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Offisiell nettside:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Kun custom" - -msgid "Only Original" -msgstr "Kun original" - -msgid "Only for Install" -msgstr "Kun for installering" - -msgid "Original/Customs" -msgstr "Original/Custom" - msgid "Parental Control" msgstr "Foreldrekontroll" -msgid "Parental Control disabled" -msgstr "" - msgid "Partition" msgstr "Partisjon" @@ -947,9 +813,6 @@ msgstr "Ganger spilt" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "Vennligst vent..." msgid "Power off the Wii" msgstr "Skru av Wii" -msgid "Prev" -msgstr "Forrige" - msgid "Prompts Buttons" msgstr "Dialog knapper" @@ -974,9 +834,6 @@ msgstr "Publisert av" msgid "Quick Boot" msgstr "Hurtig start" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "Leser WAD data... OK!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Tilbake til Wii meny" -msgid "Right" -msgstr "Høyre" - msgid "Rumble" msgstr "Vibrasjon" -msgid "SChinese" -msgstr "S.Kinesisk" - msgid "SFX Volume" msgstr "Effekt volum" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Velg en DOL fil" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Sep" @@ -1085,15 +933,6 @@ msgstr "Lyd" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "" - -msgid "Sound+Quiet" -msgstr "" - -msgid "Spanish" -msgstr "Spansk" - msgid "Special thanks to:" msgstr "Spesielt takk til:" @@ -1121,24 +960,18 @@ msgstr "Vellykket utpakking av tema." msgid "Successfully installed:" msgstr "Vellykket installering:" -msgid "System Default" -msgstr "System Standard" - -msgid "TChinese" -msgstr "T.Kinesisk" - msgid "TXT Cheatcodes Path" msgstr "TXTjuksekode sti" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Valgt mappe finnes ikke. Vil du opprette den?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "WAD filen ble installert. Men ble ikke slettet fra SD kort." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "WAD installasjonen feilet med feilkode %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Tema nedlasting sti" @@ -1152,6 +985,9 @@ msgstr "Tema sti" msgid "Theme Title:" msgstr "Tema tittel:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Overføring feilet." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB enhet ikke funnet" msgid "USB Loader GX is protected" msgstr "USB Loader GX er beskyttet" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Kan ikke åpne nedlastet WAD fil (%s)." - msgid "Uninstall" msgstr "Avinstallér" @@ -1201,15 +1039,12 @@ msgstr "Avinstallerer WAD" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" +msgid "Unlock USB Loader GX" msgstr "" msgid "Unlock console to use this option." msgstr "Lås opp konsollen for å bruke denne innstillingen." -msgid "Unlocked" -msgstr "Opplåst" - msgid "Unsupported format, try to extract manually." msgstr "Format ikke støttet, prøv å pakk ut manuelt." @@ -1234,21 +1069,12 @@ msgstr "Oppdater alle språkfiler" msgid "Update failed" msgstr "Mislykket oppdatering" -msgid "Update to" -msgstr "Oppdater til" - -msgid "Updating" -msgstr "Oppdaterer" - -msgid "Updating Language Files..." -msgstr "Oppdaterer språkfiler..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Oppdaterer språkfiler:" -msgid "Updating WiiTDB.zip" -msgstr "Oppdaterer WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Opplastet ZIP fil installert i homebrew mappen." @@ -1280,9 +1106,6 @@ msgstr "Hva vil du oppdatere?" msgid "WiFi Features" msgstr "WiFi egenskaper" -msgid "Widescreen Fix" -msgstr "Widescreen fiks" - msgid "Wii Menu" msgstr "Wii Meny" @@ -1310,9 +1133,6 @@ msgstr "Ja" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "" - msgid "You need to select or format a partition" msgstr "" @@ -1377,6 +1197,153 @@ msgstr "av" msgid "seconds left" msgstr "sekunder gjenstår" +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Alle)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Barn 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 time" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Ungdom 12+)" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Ungdom 16+)" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Voksen 18+)" + +#~ msgid "An Error occured" +#~ msgstr "En feil oppstod" + +#~ msgid "Both" +#~ msgstr "Begge" + +#~ msgid "Checking for Updates" +#~ msgstr "Søker etter oppdateringer" + +#~ msgid "Console Default" +#~ msgstr "Konsoll Standard" + +#~ msgid "Customs/Original" +#~ msgstr "Custom/Original" + +#~ msgid "Disc Default" +#~ msgstr "Spill Standard" + +#~ msgid "DiskFlip" +#~ msgstr "Snu plate" + +#~ msgid "Downloading" +#~ msgstr "Laster ned" + +#~ msgid "Dutch" +#~ msgstr "Nederlandsk" + +#~ msgid "English" +#~ msgstr "Engelsk" + +#~ msgid "French" +#~ msgstr "Fransk" + +#~ msgid "Game ID" +#~ msgstr "Spill ID" + +#~ msgid "Game Region" +#~ msgstr "Region" + +#~ msgid "German" +#~ msgstr "Tysk" + +#~ msgid "Italian" +#~ msgstr "Italiensk" + +#~ msgid "Japanese" +#~ msgstr "Japansk" + +#~ msgid "Korean" +#~ msgstr "Koreansk" + +#~ msgid "Left" +#~ msgstr "Venstre" + +#~ msgid "Like SysMenu" +#~ msgstr "Lik Systemmeny" + +#~ msgid "Load From SD/USB" +#~ msgstr "Start fra SD/USB" + +#~ msgid "Locked" +#~ msgstr "Låst" + +#~ msgid "Neither" +#~ msgstr "Ingen" + +#~ msgid "Next" +#~ msgstr "Neste" + +#~ msgid "ON" +#~ msgstr "PÅ" + +#~ msgid "Only Customs" +#~ msgstr "Kun custom" + +#~ msgid "Only Original" +#~ msgstr "Kun original" + +#~ msgid "Only for Install" +#~ msgstr "Kun for installering" + +#~ msgid "Original/Customs" +#~ msgstr "Original/Custom" + +#~ msgid "Prev" +#~ msgstr "Forrige" + +#~ msgid "Right" +#~ msgstr "Høyre" + +#~ msgid "SChinese" +#~ msgstr "S.Kinesisk" + +#~ msgid "Spanish" +#~ msgstr "Spansk" + +#~ msgid "System Default" +#~ msgstr "System Standard" + +#~ msgid "TChinese" +#~ msgstr "T.Kinesisk" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "WAD filen ble installert. Men ble ikke slettet fra SD kort." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "WAD installasjonen feilet med feilkode %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Kan ikke åpne nedlastet WAD fil (%s)." + +#~ msgid "Unlocked" +#~ msgstr "Opplåst" + +#~ msgid "Update to" +#~ msgstr "Oppdater til" + +#~ msgid "Updating" +#~ msgstr "Oppdaterer" + +#~ msgid "Updating Language Files..." +#~ msgstr "Oppdaterer språkfiler..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Oppdaterer WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Widescreen fiks" + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s vil kanskje ikke starte riktig hvis System Menyen ikke er oppdatert." diff --git a/Languages/polish.lang b/Languages/polish.lang index f4b6dacb..29ba4fec 100644 --- a/Languages/polish.lang +++ b/Languages/polish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: ziom666 (zadania_prog@vp.pl)\n" "Language-Team: \n" @@ -25,54 +25,15 @@ msgstr " zapisano. Plik tekstowy nie zostal zweryfikowany. Niektore z kodow, mog msgid " is not on the server." msgstr " nie istnieje na serwerze" -msgid "0 (Everyone)" -msgstr "0 (dla kazdego)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (dziecko 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 godzina" - -msgid "10 min" -msgstr "" - -msgid "2 (Teen 12+)" -msgstr "2 (mlodziez 12+)" - -msgid "20 min" -msgstr "" - msgid "2D Cover Path" msgstr "Sciezka okladek 2D" -msgid "3 (Mature 16+)" -msgstr "3 (dojrzaly 16+)" - -msgid "3 min" -msgstr "" - -msgid "30 min" -msgstr "" - msgid "3D Cover Path" msgstr "Sciezka okladek 3D" msgid "3D Covers" msgstr "Okladki 3D" -msgid "4 (Adults Only 18+)" -msgstr "4 (tylko dla doroslych 18+)" - -msgid "5 min" -msgstr "" - msgid ">> Deleting tickets..." msgstr ">> Usuwanie ticketu..." @@ -136,20 +97,14 @@ msgstr "USB Loader GX odblokowany" msgid "Alternate DOL" msgstr "Alternatywny DOL" -msgid "An Error occured" -msgstr "Wystapil blad" - -msgid "Anti" -msgstr "Anty" - msgid "App Language" msgstr "Jezyk" msgid "Apr" msgstr "Kwiecien" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Czy na pewno wlaczyc kontrole rodzicielska?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Autor: " msgid "AutoInit Network" msgstr "Autoinicjalizacja sieci" -msgid "AutoPatch" -msgstr "Automatyczny patch" - msgid "BCA Codes Path" msgstr "Sciezka kodow BCA" @@ -199,9 +151,6 @@ msgstr "" msgid "Boot?" msgstr "" -msgid "Both" -msgstr "Oba" - msgid "Can't be formatted" msgstr "Nie mozna sformatowac" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "Plik z kodami pusty" -msgid "Checking for Updates" -msgstr "Sprawdzanie aktualizacji" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Utracono polaczenie..." msgid "Console" msgstr "Konsola" -msgid "Console Default" -msgstr "Domyslne ustawienia konsoli" - msgid "Console Locked" msgstr "Konsola zablokowana" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Nie udalo sie stworzyc pliku GCT" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "" msgid "Custom Paths" msgstr "Sciezki" -msgid "Customs/Original" -msgstr "" - msgid "DOL Path" msgstr "Sciezka plikow .DOL" @@ -365,15 +309,9 @@ msgstr "Pobierz obrazki" msgid "Disc Artwork Path" msgstr "Sciezka do obrazkow plyt" -msgid "Disc Default" -msgstr "Domyslny dysk" - msgid "Disc Images" msgstr "Obrazki plyt" -msgid "DiskFlip" -msgstr "Obrot plytami" - msgid "Display" msgstr "Wyswietl" @@ -404,6 +342,9 @@ msgstr "Pobrac temat?" msgid "Do you want to format:" msgstr "Sformatowac:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Uzyc alternatywnego pliku DOL?" @@ -434,26 +375,26 @@ msgstr "Zakonczono pobieranie" msgid "Download request failed." msgstr "Prosba pobierania nieudana" -msgid "Downloading" -msgstr "Trwa pobieranie" - msgid "Downloading Page List:" msgstr "Pobieranie listy stron:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Pobieranie pliku" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Pobieranie obrazka:" -msgid "Dutch" -msgstr "holenderski" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "Blad" @@ -464,9 +405,6 @@ msgstr "Blad:" msgid "ERROR: Can't set up theme." msgstr "Blad: nie mozna ustawic tematu" -msgid "English" -msgstr "angielski" - msgid "Error" msgstr "Blad" @@ -476,15 +414,24 @@ msgstr "Blad !" msgid "Error 002 fix" msgstr "Poprawka bledu 002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Blad odczytu plyty" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Blad podczas transferu danych" +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Nie udalo sie rozpakowac" msgid "Failed to open partition" msgstr "Nie udalo sie otworzyc partycji" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "Luty" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Obrot na osi X" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Sformatuj" @@ -545,15 +486,9 @@ msgstr "Formatowanie, prosze czekac..." msgid "Free Space" msgstr "Wolnego miejsca" -msgid "French" -msgstr "francuski" - msgid "Full Shutdown" msgstr "Pelne zamkniecie" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "Sciezka kodow GCT" @@ -566,9 +501,6 @@ msgstr "Ustawienia interfejsu graficznego" msgid "GXtheme.cfg not found in any subfolder." msgstr "Nie znaleziono pliku GXtheme.cfg" -msgid "Game ID" -msgstr "ID gry" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Zaladuj gre" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Region" - msgid "Game Size" msgstr "Rozmiar gry" @@ -599,18 +528,12 @@ msgstr "Gra jest juz zainstalowana:" msgid "Game partition" msgstr "Partycje z grami" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Liczba gier" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "niemiecki" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Wloz karte SD, aby uzyc tej opcji" msgid "Install" msgstr "Zainstaluj" -msgid "Install 1:1 Copy" -msgstr "Zainstaluj kopie 1:1" - msgid "Install Error!" msgstr "Blad instalacji" @@ -691,21 +611,12 @@ msgstr "Instalowanie tytulu... Ok!" msgid "Installing wad" msgstr "Instalowanie wad" -msgid "Invalid PIN code" -msgstr "Bledny kod PIN" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "" -msgid "Italian" -msgstr "wloski" - msgid "Jan" msgstr "Styczen" -msgid "Japanese" -msgstr "japonski" - msgid "July" msgstr "lipiec" @@ -718,9 +629,6 @@ msgstr "Trzymaj" msgid "Keyboard" msgstr "Klawiatura" -msgid "Korean" -msgstr "koreanski" - msgid "Language File" msgstr "Plik jezykowy" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Sciezka do plikow jezykowych zmieniona" -msgid "Left" -msgstr "Lewo" - -msgid "Like SysMenu" -msgstr "Podobnie do menu systemowego" - msgid "Load" msgstr "Zaladuj" -msgid "Load From SD/USB" -msgstr "Zaladuj z SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Zaladowac plik z: %s ?" @@ -752,6 +651,9 @@ msgstr "Zaladowac plik z: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Zaladowac ten DOL jako alternatywnt?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "ladowanie standardowego jezyka." @@ -761,18 +663,9 @@ msgstr "ladowanie standardowej muzyki" msgid "Lock Console" msgstr "Zablokuj konsole" -msgid "Locked" -msgstr "Zablokowano" - -msgid "Loop Directory" +msgid "Lock USB Loader GX" msgstr "" -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" -msgstr "Zapetl dzwieki" - msgid "Mar" msgstr "Marzec" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "Poziom glosnosci" -msgid "Neither" -msgstr "zadne" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Wykryto nowy dysk" -msgid "Next" -msgstr "nastepny" - msgid "No" msgstr "Nie" @@ -839,12 +729,6 @@ msgstr "Posiadasz aktualna wersje" msgid "No themes found on the site." msgstr "Nie znaleziono tematow na tej stronie" -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "Standardowe" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "Wylacz" msgid "OK" msgstr "" -msgid "ON" -msgstr "Wlacz" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Strona oficjalna:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Tylko nieoryginalne" - -msgid "Only Original" -msgstr "Tylko oryginalne" - -msgid "Only for Install" -msgstr "Tylko dla instalacji" - -msgid "Original/Customs" -msgstr "Mieszane" - msgid "Parental Control" msgstr "Kontrola rodzicielska" -msgid "Parental Control disabled" -msgstr "Kontrola rodzicielska wylaczona" - msgid "Partition" msgstr "Partycja" @@ -947,9 +813,6 @@ msgstr "Licznik" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "Prosze czekac..." msgid "Power off the Wii" msgstr "Wylacz Wii" -msgid "Prev" -msgstr "Poprzedni" - msgid "Prompts Buttons" msgstr "" @@ -974,9 +834,6 @@ msgstr "" msgid "Quick Boot" msgstr "Szybkie ladowanie" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "Odczyt danych WAD...Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Powrot do Wii Menu" -msgid "Right" -msgstr "Prawo" - msgid "Rumble" msgstr "Wibracje" -msgid "SChinese" -msgstr "uproszczony chinski" - msgid "SFX Volume" msgstr "Poziom glosnosci SFX" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Wybierz plik DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Wrzesien" @@ -1085,15 +933,6 @@ msgstr "Dzwiek" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Dzwieki i muzyka w tle" - -msgid "Sound+Quiet" -msgstr "Dzwieki i cisza" - -msgid "Spanish" -msgstr "hiszpanski" - msgid "Special thanks to:" msgstr "Specjalne podziekowania" @@ -1121,24 +960,18 @@ msgstr "Pomyslnie rozpakowano temat." msgid "Successfully installed:" msgstr "Pomyslnie zainstalowano:" -msgid "System Default" -msgstr "Domyslne ustawienia systemowe" - -msgid "TChinese" -msgstr "chinski" - msgid "TXT Cheatcodes Path" msgstr "Sciezka kodow TXT" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Katalog nie istnieje. Utworzyc?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "Zainstalowano plik wad, ale nie mozna go usunac z karty SD" +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "Instalacja wad zakonczona bledek %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Sciezka tematow" @@ -1152,6 +985,9 @@ msgstr "Sciezka skorek" msgid "Theme Title:" msgstr "Tytul:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Niepowodzenie." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "Nie znaleziono urzadzenia USB" msgid "USB Loader GX is protected" msgstr "USB Loader GX zabezpieczony" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Nie udalo sie zainstalowac dopiero co pobranego pliku (%s)" - msgid "Uninstall" msgstr "Odinstaluj" @@ -1201,15 +1039,12 @@ msgstr "Odinstalowywanie wad" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Odblokuj kontrole rodzicielska" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Odblokuj konsole, aby uzyc tej opcji" -msgid "Unlocked" -msgstr "Odblokowano" - msgid "Unsupported format, try to extract manually." msgstr "Niewspierany format, sprobuj rozpakowac recznie" @@ -1234,21 +1069,12 @@ msgstr "Zaktualizuj wszystkie pliki jezykowe" msgid "Update failed" msgstr "Nie udalo sie zaktualizowac" -msgid "Update to" -msgstr "Aktualizuj do" - -msgid "Updating" -msgstr "Aktualizowanie" - -msgid "Updating Language Files..." -msgstr "Aktualizacja plikow jezykowych..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Aktualizacja plikow jezykowych:" -msgid "Updating WiiTDB.zip" -msgstr "Aktualizacja WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Wyslany plik ZIP zainstalowano w katalogu homebrew" @@ -1280,9 +1106,6 @@ msgstr "Rodzaj aktualizacji" msgid "WiFi Features" msgstr "Opcje WiFi" -msgid "Widescreen Fix" -msgstr "Popraw ekran panoramiczny" - msgid "Wii Menu" msgstr "" @@ -1310,9 +1133,6 @@ msgstr "Tak" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Nie masz wlaczonej kontroli rodzicielskiej. Jesli chcesz jej uzywac, uruchom ja w ustawieniach Wii." - msgid "You need to select or format a partition" msgstr "Musisz wybrac, lub sformatowac partycje" @@ -1377,6 +1197,186 @@ msgstr "z" msgid "seconds left" msgstr "sekund pozostalo" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Zainstaluj kopie 1:1" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (dla kazdego)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (dziecko 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 godzina" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (mlodziez 12+)" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (dojrzaly 16+)" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (tylko dla doroslych 18+)" + +#~ msgid "An Error occured" +#~ msgstr "Wystapil blad" + +#~ msgid "Anti" +#~ msgstr "Anty" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Czy na pewno wlaczyc kontrole rodzicielska?" + +#~ msgid "AutoPatch" +#~ msgstr "Automatyczny patch" + +#~ msgid "Both" +#~ msgstr "Oba" + +#~ msgid "Checking for Updates" +#~ msgstr "Sprawdzanie aktualizacji" + +#~ msgid "Console Default" +#~ msgstr "Domyslne ustawienia konsoli" + +#~ msgid "Disc Default" +#~ msgstr "Domyslny dysk" + +#~ msgid "DiskFlip" +#~ msgstr "Obrot plytami" + +#~ msgid "Downloading" +#~ msgstr "Trwa pobieranie" + +#~ msgid "Dutch" +#~ msgstr "holenderski" + +#~ msgid "English" +#~ msgstr "angielski" + +#~ msgid "French" +#~ msgstr "francuski" + +#~ msgid "Game ID" +#~ msgstr "ID gry" + +#~ msgid "Game Region" +#~ msgstr "Region" + +#~ msgid "German" +#~ msgstr "niemiecki" + +#~ msgid "Invalid PIN code" +#~ msgstr "Bledny kod PIN" + +#~ msgid "Italian" +#~ msgstr "wloski" + +#~ msgid "Japanese" +#~ msgstr "japonski" + +#~ msgid "Korean" +#~ msgstr "koreanski" + +#~ msgid "Left" +#~ msgstr "Lewo" + +#~ msgid "Like SysMenu" +#~ msgstr "Podobnie do menu systemowego" + +#~ msgid "Load From SD/USB" +#~ msgstr "Zaladuj z SD/USB" + +#~ msgid "Locked" +#~ msgstr "Zablokowano" + +#~ msgid "Loop Sound" +#~ msgstr "Zapetl dzwieki" + +#~ msgid "Neither" +#~ msgstr "zadne" + +#~ msgid "Next" +#~ msgstr "nastepny" + +#~ msgid "Normal" +#~ msgstr "Standardowe" + +#~ msgid "ON" +#~ msgstr "Wlacz" + +#~ msgid "Only Customs" +#~ msgstr "Tylko nieoryginalne" + +#~ msgid "Only Original" +#~ msgstr "Tylko oryginalne" + +#~ msgid "Only for Install" +#~ msgstr "Tylko dla instalacji" + +#~ msgid "Original/Customs" +#~ msgstr "Mieszane" + +#~ msgid "Parental Control disabled" +#~ msgstr "Kontrola rodzicielska wylaczona" + +#~ msgid "Prev" +#~ msgstr "Poprzedni" + +#~ msgid "Right" +#~ msgstr "Prawo" + +#~ msgid "SChinese" +#~ msgstr "uproszczony chinski" + +#~ msgid "Sound+BGM" +#~ msgstr "Dzwieki i muzyka w tle" + +#~ msgid "Sound+Quiet" +#~ msgstr "Dzwieki i cisza" + +#~ msgid "Spanish" +#~ msgstr "hiszpanski" + +#~ msgid "System Default" +#~ msgstr "Domyslne ustawienia systemowe" + +#~ msgid "TChinese" +#~ msgstr "chinski" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "Zainstalowano plik wad, ale nie mozna go usunac z karty SD" + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "Instalacja wad zakonczona bledek %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Nie udalo sie zainstalowac dopiero co pobranego pliku (%s)" + +#~ msgid "Unlock Parental Control" +#~ msgstr "Odblokuj kontrole rodzicielska" + +#~ msgid "Unlocked" +#~ msgstr "Odblokowano" + +#~ msgid "Update to" +#~ msgstr "Aktualizuj do" + +#~ msgid "Updating" +#~ msgstr "Aktualizowanie" + +#~ msgid "Updating Language Files..." +#~ msgstr "Aktualizacja plikow jezykowych..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Aktualizacja WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Popraw ekran panoramiczny" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Nie masz wlaczonej kontroli rodzicielskiej. Jesli chcesz jej uzywac, uruchom ja w ustawieniach Wii." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Moze nie ladowac sie poprawnie, jesli nie masz aktualnego menu systemowego" diff --git a/Languages/portuguese_br.lang b/Languages/portuguese_br.lang index 741ed760..b79b3d09 100644 --- a/Languages/portuguese_br.lang +++ b/Languages/portuguese_br.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-23 18:52+0200\n" "Last-Translator: aniemotion\n" "Language-Team: boto12, aniemotion\n" @@ -25,54 +25,15 @@ msgstr " foi salvo. O texto não foi verificado. Parte do código pode não func msgid " is not on the server." msgstr " não está no servidor." -msgid "0 (Everyone)" -msgstr "0 (Todos)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Crianças 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 hora" - -msgid "10 min" -msgstr "10 minutos" - -msgid "2 (Teen 12+)" -msgstr "2 (Adolescente 12+)" - -msgid "20 min" -msgstr "20 minutos" - msgid "2D Cover Path" msgstr "Pasta Capas 2D" -msgid "3 (Mature 16+)" -msgstr "3 (Adulto 16+)" - -msgid "3 min" -msgstr "3 minutos" - -msgid "30 min" -msgstr "30 minutos" - msgid "3D Cover Path" msgstr "Pasta Capas 3D" msgid "3D Covers" msgstr "Capas 3D" -msgid "4 (Adults Only 18+)" -msgstr "4 (Adultos 18+)" - -msgid "5 min" -msgstr "5 minutos" - msgid ">> Deleting tickets..." msgstr ">> Eliminando tickets..." @@ -136,20 +97,14 @@ msgstr "As configurações estão desbloqueadas." msgid "Alternate DOL" msgstr "DOL alternativo" -msgid "An Error occured" -msgstr "Ocorreu um Erro" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Idioma" msgid "Apr" msgstr "Abr" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Tem certeza que você deseja ligar o Controle de Pais?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Autor:" msgid "AutoInit Network" msgstr "Auto-iniciar Rede" -msgid "AutoPatch" -msgstr "Patch automático" - msgid "BCA Codes Path" msgstr "Caminho do BCA Codes" @@ -199,9 +151,6 @@ msgstr "Carregar/Standard" msgid "Boot?" msgstr "Carregar?" -msgid "Both" -msgstr "Ambos" - msgid "Can't be formatted" msgstr "Não pode pode ser formatado" @@ -226,9 +175,6 @@ msgstr "Alterar Caminho para Play" msgid "Cheatfile is blank" msgstr "arquivo de truques vazio" -msgid "Checking for Updates" -msgstr "Procurando Atualizações" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "Configuração" -msgid "Console Default" -msgstr "Configurações padrões" - msgid "Console Locked" msgstr "Configuração Bloqueada" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Não foi possível criar o arquivo GCT" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Créditos" msgid "Custom Paths" msgstr "Personalização de Pastas" -msgid "Customs/Original" -msgstr "Alternativas/Originais" - msgid "DOL Path" msgstr "Pasta DOL" @@ -365,15 +309,9 @@ msgstr "Baixar Imagens Disco" msgid "Disc Artwork Path" msgstr "Pasta Imagens Disco" -msgid "Disc Default" -msgstr "Disco Padrão" - msgid "Disc Images" msgstr "Imagens de Disco" -msgid "DiskFlip" -msgstr "Voltar Disco" - msgid "Display" msgstr "Mostrar" @@ -404,6 +342,9 @@ msgstr "Deseja baixar este tema?" msgid "Do you want to format:" msgstr "Deseja FORMATAR:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Deseja usar o DOL alternativo que pensa ser o correcto?" @@ -434,26 +375,26 @@ msgstr "Download Terminado" msgid "Download request failed." msgstr "Download requerido falhou" -msgid "Downloading" -msgstr "Baixando" - msgid "Downloading Page List:" msgstr "Baixando lista de paginas:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Baixando arquivo" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Baixando imagem:" -msgid "Dutch" -msgstr "Holandês" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "ERRO" @@ -464,9 +405,6 @@ msgstr "ERRO:" msgid "ERROR: Can't set up theme." msgstr "ERRO: Impossível aplicar tema" -msgid "English" -msgstr "Inglês" - msgid "Error" msgstr "Erro" @@ -476,15 +414,24 @@ msgstr "Erro !" msgid "Error 002 fix" msgstr "Correção Erro 002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Erro ao ler o Disco" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Erro na transferência de dados." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Falha ao extrair" msgid "Failed to open partition" msgstr "Falha ao abrir partição" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "Fev" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Paginação Horizontal" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formatar" @@ -545,15 +486,9 @@ msgstr "Formatando, por favor aguarde..." msgid "Free Space" msgstr "Espaço Livre" -msgid "French" -msgstr "Francês" - msgid "Full Shutdown" msgstr "Desligar" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "Pasta Truques" @@ -566,9 +501,6 @@ msgstr "Definições de Interface" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg não encontrado em nenhuma subpasta" -msgid "Game ID" -msgstr "ID do Jogo" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Carregando Jogos" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Região" - msgid "Game Size" msgstr "Tamanho do Jogo" @@ -599,18 +528,12 @@ msgstr "Este jogo já está instalado:" msgid "Game partition" msgstr "Partição de Game" -msgid "Gamename [GAMEID]" -msgstr "Nome do Jogo [GAMEID]" - msgid "Games" msgstr "Jogos" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Alemão" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Insira um cartão SD para usar esta funcionalidade." msgid "Install" msgstr "Instalar" -msgid "Install 1:1 Copy" -msgstr "Instalar 1:1 Copy" - msgid "Install Error!" msgstr "Erro de Instalação!" @@ -691,21 +611,12 @@ msgstr "Instalando título... Ok!" msgid "Installing wad" msgstr "Instalando wad" -msgid "Invalid PIN code" -msgstr "Código PIN inválido" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Parece que tem uma informação que pode ser útil. Por favor envie esta informação a nossa equipe de desenvolvimento." -msgid "Italian" -msgstr "Italiano" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "Japonês" - msgid "July" msgstr "Jul" @@ -718,9 +629,6 @@ msgstr "Manter" msgid "Keyboard" msgstr "Teclado" -msgid "Korean" -msgstr "Coreano" - msgid "Language File" msgstr "Idiomas" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Caminho para o arquivo de Idioma alterado." -msgid "Left" -msgstr "Esquerda" - -msgid "Like SysMenu" -msgstr "Igual ao Menu do Wii" - msgid "Load" msgstr "Carregar" -msgid "Load From SD/USB" -msgstr "Carregar do SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Carregar arquivo de: %s ?" @@ -752,6 +651,9 @@ msgstr "Carregar arquivo de: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Carregar este DOL como DOL alternativo?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Carregado idioma padrão." @@ -761,17 +663,8 @@ msgstr "Carregando música padrão." msgid "Lock Console" msgstr "Bloquear Configurações" -msgid "Locked" -msgstr "Bloqueado" - -msgid "Loop Directory" -msgstr "Repitir Diretório" - -msgid "Loop Music" -msgstr "Repitir Música" - -msgid "Loop Sound" -msgstr "Repitir Som" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "" @@ -794,15 +687,12 @@ msgstr "Modo Repetição de Música" msgid "Music Volume" msgstr "Volume da Música" -msgid "Neither" -msgstr "Nenhum" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Detectado Novo Disco" -msgid "Next" -msgstr "Próximo" - msgid "No" msgstr "Não" @@ -839,12 +729,6 @@ msgstr "Não existem novas atualizações." msgid "No themes found on the site." msgstr "Nenhum tema encontrado no site" -msgid "None" -msgstr "Nenhum" - -msgid "Normal" -msgstr "" - msgid "Not a WAD file." msgstr "Não é um arquivo Wad" @@ -884,9 +768,6 @@ msgstr "Desligado" msgid "OK" msgstr "" -msgid "ON" -msgstr "Ligado" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Site Oficial:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Apenas Alternativas" - -msgid "Only Original" -msgstr "Apenas Originais" - -msgid "Only for Install" -msgstr "Apenas na instalação" - -msgid "Original/Customs" -msgstr "Originais/Alternativas" - msgid "Parental Control" msgstr "Controle de Pais" -msgid "Parental Control disabled" -msgstr "Controle dos Pais desligado" - msgid "Partition" msgstr "Partição" @@ -947,9 +813,6 @@ msgstr "Vezes jogadas" msgid "Play Next" msgstr "Tocar Próximo" -msgid "Play Once" -msgstr "Tocar uma só vez" - msgid "Play Previous" msgstr "Tocar Anteior" @@ -962,9 +825,6 @@ msgstr "Por favor aguarde..." msgid "Power off the Wii" msgstr "Desligar o Wii" -msgid "Prev" -msgstr "Anterior" - msgid "Prompts Buttons" msgstr "Mensagens/Botões" @@ -974,9 +834,6 @@ msgstr "Publicado por" msgid "Quick Boot" msgstr "Inicialização Rápida" -msgid "Random Directory Music" -msgstr "Diretótio Aleatório de Músicas" - msgid "Reading WAD data... Ok!" msgstr "Lendo dados do WAD... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Voltar ao Menu do Wii" -msgid "Right" -msgstr "Direita" - msgid "Rumble" msgstr "Vibração" -msgid "SChinese" -msgstr "Chinês Simplificado" - msgid "SFX Volume" msgstr "Volume dos Efeitos" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Selecionar um DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Set" @@ -1085,15 +933,6 @@ msgstr "Audio" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Som+Music de Fundo" - -msgid "Sound+Quiet" -msgstr "Som+Quieto" - -msgid "Spanish" -msgstr "Espanhol" - msgid "Special thanks to:" msgstr "Agradecimentos especiais para:" @@ -1121,24 +960,18 @@ msgstr "Tema extraido com sucesso." msgid "Successfully installed:" msgstr "Instalado com Sucesso:" -msgid "System Default" -msgstr "Padrão do Sistema" - -msgid "TChinese" -msgstr "Chinês Tradicional" - msgid "TXT Cheatcodes Path" msgstr "Pasta Dicas" msgid "The entered directory does not exist. Would you like to create it?" msgstr "O diretorio não existe. Gostaria de cria-lo?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "O arquivo wad foi instalado mas não foi possível eliminá-lo do cartão SD." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "A instalação do wad falhou com o seguinte erro: %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Pasta de Temas Baixados" @@ -1152,6 +985,9 @@ msgstr "Pasta Temas" msgid "Theme Title:" msgstr "Titulo do Tema:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Falhou a transferencia" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "Dispositivo USB não encontrado" msgid "USB Loader GX is protected" msgstr "O USB Loader GX está bloqueado" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Não é possível abrir o arquivo wad baixado (%s)." - msgid "Uninstall" msgstr "Desinstalar" @@ -1201,15 +1039,12 @@ msgstr "Desinstalando wad" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Desbloquear Controle de Pais" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Desbloquear configuração antes de usar esta opção." -msgid "Unlocked" -msgstr "Desbloqueado" - msgid "Unsupported format, try to extract manually." msgstr "Formato não suportado, tente extrair manualmente." @@ -1234,21 +1069,12 @@ msgstr "Atualizar todos os arquivos de Idioma" msgid "Update failed" msgstr "Erro ao atualizar" -msgid "Update to" -msgstr "Atualizando para" - -msgid "Updating" -msgstr "Atualizando" - -msgid "Updating Language Files..." -msgstr "Atualizando arquivos de Idioma..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Atualizando arquivos de Idioma:" -msgid "Updating WiiTDB.zip" -msgstr "Atualizando WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Arquivo ZIP enviado y instalado no diretório homebrew." @@ -1280,9 +1106,6 @@ msgstr "O que deseja atualizar?" msgid "WiFi Features" msgstr "Rede sem fios" -msgid "Widescreen Fix" -msgstr "Correção 16:9" - msgid "Wii Menu" msgstr "Menu do Wii" @@ -1310,9 +1133,6 @@ msgstr "Sim" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Você não tem o Controle de Pais ligado. Se você deseja usar o Controle de Pais, ligue-o nas Configurações do Wii." - msgid "You need to select or format a partition" msgstr "Você precisa selecionar ou formatar uma partição" @@ -1377,6 +1197,216 @@ msgstr "de" msgid "seconds left" msgstr "segundos restantes" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Instalar 1:1 Copy" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Todos)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Crianças 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 hora" + +#~ msgid "10 min" +#~ msgstr "10 minutos" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Adolescente 12+)" + +#~ msgid "20 min" +#~ msgstr "20 minutos" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Adulto 16+)" + +#~ msgid "3 min" +#~ msgstr "3 minutos" + +#~ msgid "30 min" +#~ msgstr "30 minutos" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Adultos 18+)" + +#~ msgid "5 min" +#~ msgstr "5 minutos" + +#~ msgid "An Error occured" +#~ msgstr "Ocorreu um Erro" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Tem certeza que você deseja ligar o Controle de Pais?" + +#~ msgid "AutoPatch" +#~ msgstr "Patch automático" + +#~ msgid "Both" +#~ msgstr "Ambos" + +#~ msgid "Checking for Updates" +#~ msgstr "Procurando Atualizações" + +#~ msgid "Console Default" +#~ msgstr "Configurações padrões" + +#~ msgid "Customs/Original" +#~ msgstr "Alternativas/Originais" + +#~ msgid "Disc Default" +#~ msgstr "Disco Padrão" + +#~ msgid "DiskFlip" +#~ msgstr "Voltar Disco" + +#~ msgid "Downloading" +#~ msgstr "Baixando" + +#~ msgid "Dutch" +#~ msgstr "Holandês" + +#~ msgid "English" +#~ msgstr "Inglês" + +#~ msgid "French" +#~ msgstr "Francês" + +#~ msgid "Game ID" +#~ msgstr "ID do Jogo" + +#~ msgid "Game Region" +#~ msgstr "Região" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "Nome do Jogo [GAMEID]" + +#~ msgid "German" +#~ msgstr "Alemão" + +#~ msgid "Invalid PIN code" +#~ msgstr "Código PIN inválido" + +#~ msgid "Italian" +#~ msgstr "Italiano" + +#~ msgid "Japanese" +#~ msgstr "Japonês" + +#~ msgid "Korean" +#~ msgstr "Coreano" + +#~ msgid "Left" +#~ msgstr "Esquerda" + +#~ msgid "Like SysMenu" +#~ msgstr "Igual ao Menu do Wii" + +#~ msgid "Load From SD/USB" +#~ msgstr "Carregar do SD/USB" + +#~ msgid "Locked" +#~ msgstr "Bloqueado" + +#~ msgid "Loop Directory" +#~ msgstr "Repitir Diretório" + +#~ msgid "Loop Music" +#~ msgstr "Repitir Música" + +#~ msgid "Loop Sound" +#~ msgstr "Repitir Som" + +#~ msgid "Neither" +#~ msgstr "Nenhum" + +#~ msgid "Next" +#~ msgstr "Próximo" + +#~ msgid "None" +#~ msgstr "Nenhum" + +#~ msgid "ON" +#~ msgstr "Ligado" + +#~ msgid "Only Customs" +#~ msgstr "Apenas Alternativas" + +#~ msgid "Only Original" +#~ msgstr "Apenas Originais" + +#~ msgid "Only for Install" +#~ msgstr "Apenas na instalação" + +#~ msgid "Original/Customs" +#~ msgstr "Originais/Alternativas" + +#~ msgid "Parental Control disabled" +#~ msgstr "Controle dos Pais desligado" + +#~ msgid "Play Once" +#~ msgstr "Tocar uma só vez" + +#~ msgid "Prev" +#~ msgstr "Anterior" + +#~ msgid "Random Directory Music" +#~ msgstr "Diretótio Aleatório de Músicas" + +#~ msgid "Right" +#~ msgstr "Direita" + +#~ msgid "SChinese" +#~ msgstr "Chinês Simplificado" + +#~ msgid "Sound+BGM" +#~ msgstr "Som+Music de Fundo" + +#~ msgid "Sound+Quiet" +#~ msgstr "Som+Quieto" + +#~ msgid "Spanish" +#~ msgstr "Espanhol" + +#~ msgid "System Default" +#~ msgstr "Padrão do Sistema" + +#~ msgid "TChinese" +#~ msgstr "Chinês Tradicional" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "O arquivo wad foi instalado mas não foi possível eliminá-lo do cartão SD." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "A instalação do wad falhou com o seguinte erro: %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Não é possível abrir o arquivo wad baixado (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Desbloquear Controle de Pais" + +#~ msgid "Unlocked" +#~ msgstr "Desbloqueado" + +#~ msgid "Update to" +#~ msgstr "Atualizando para" + +#~ msgid "Updating" +#~ msgstr "Atualizando" + +#~ msgid "Updating Language Files..." +#~ msgstr "Atualizando arquivos de Idioma..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Atualizando WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Correção 16:9" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Você não tem o Controle de Pais ligado. Se você deseja usar o Controle de Pais, ligue-o nas Configurações do Wii." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Pode não carregar corretamente se seu sistema não estiver atualizado." diff --git a/Languages/portuguese_pt.lang b/Languages/portuguese_pt.lang index 5753ed89..c3545a66 100644 --- a/Languages/portuguese_pt.lang +++ b/Languages/portuguese_pt.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2010-03-22 10:55-0000\n" "Last-Translator: Sky8000\n" "Language-Team: Sky8000 \n" @@ -25,54 +25,15 @@ msgstr " foi guardado. O texto não foi verificado. Parte do código pode não f msgid " is not on the server." msgstr " não está no servidor." -msgid "0 (Everyone)" -msgstr "0 (Todos)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Crianças 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 hora" - -msgid "10 min" -msgstr "10 minutos" - -msgid "2 (Teen 12+)" -msgstr "2 (Adolescente 12+)" - -msgid "20 min" -msgstr "20 minutos" - msgid "2D Cover Path" msgstr "Pasta Capas 2D" -msgid "3 (Mature 16+)" -msgstr "3 (Adulto 16+)" - -msgid "3 min" -msgstr "3 minutos" - -msgid "30 min" -msgstr "30 minutos" - msgid "3D Cover Path" msgstr "Pasta Capas 3D" msgid "3D Covers" msgstr "Capas 3D" -msgid "4 (Adults Only 18+)" -msgstr "4 (Adultos 18+)" - -msgid "5 min" -msgstr "5 minutos" - msgid ">> Deleting tickets..." msgstr ">> Eliminando tickets..." @@ -136,20 +97,14 @@ msgstr "As configurações estão desbloqueadas." msgid "Alternate DOL" msgstr "DOL alternativo" -msgid "An Error occured" -msgstr "Ocurreu um Erro" - -msgid "Anti" -msgstr "Anti" - msgid "App Language" msgstr "Idioma" msgid "Apr" msgstr "Abr" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Tem a certeza que pretende activar o Controlo Parental?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Autor:" msgid "AutoInit Network" msgstr "Auto-iniciar Rede" -msgid "AutoPatch" -msgstr "Patch automático" - msgid "BCA Codes Path" msgstr "Pasta Códigos BCA" @@ -199,9 +151,6 @@ msgstr "Arranque/Standard" msgid "Boot?" msgstr "Carregar?" -msgid "Both" -msgstr "Ambos" - msgid "Can't be formatted" msgstr "Não pode ser formatado" @@ -226,9 +175,6 @@ msgstr "Alterar Pasta de Músicas" msgid "Cheatfile is blank" msgstr "Ficheiro de truques vazio" -msgid "Checking for Updates" -msgstr "Procurando Actualizações" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Ligação perdida..." msgid "Console" msgstr "Configuração" -msgid "Console Default" -msgstr "Predefinição Consola" - msgid "Console Locked" msgstr "Configuração Bloqueada" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Não foi possível criar o ficheiro GCT" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Créditos" msgid "Custom Paths" msgstr "Personalização de Pastas" -msgid "Customs/Original" -msgstr "Alternativas/Originais" - msgid "DOL Path" msgstr "Pasta DOL" @@ -365,15 +309,9 @@ msgstr "Descaregar Imagens Disco" msgid "Disc Artwork Path" msgstr "Pasta Imagens Disco" -msgid "Disc Default" -msgstr "Predefinição Disco" - msgid "Disc Images" msgstr "Imagens de Disco" -msgid "DiskFlip" -msgstr "Voltar Disco" - msgid "Display" msgstr "Mostrar" @@ -404,6 +342,9 @@ msgstr "Deseja descarregar este tema?" msgid "Do you want to format:" msgstr "Deseja FORMATAR:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Pretende usar o DOL alternativo que se pensa ser o correcto?" @@ -434,26 +375,26 @@ msgstr "Download Terminado" msgid "Download request failed." msgstr "O pedido de download falhou." -msgid "Downloading" -msgstr "Descarregando" - msgid "Downloading Page List:" msgstr "Descarregando Lista de Páginas:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Descarregando ficheiro:" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Descarregando imagem:" -msgid "Dutch" -msgstr "Holandês" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "ERRO" @@ -464,9 +405,6 @@ msgstr "ERRO:" msgid "ERROR: Can't set up theme." msgstr "ERRO: Impossível configurar tema." -msgid "English" -msgstr "Inglês" - msgid "Error" msgstr "Erro" @@ -476,15 +414,24 @@ msgstr "Erro !" msgid "Error 002 fix" msgstr "Correcção Erro 002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Erro ao ler o Disco" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Erro na transferência de dados." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Falha ao extrair ficheiros." msgid "Failed to open partition" msgstr "Falha ao abrir partição" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "Fev" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Paginação Horizontal" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formatar" @@ -545,15 +486,9 @@ msgstr "Formatando, por favor aguarde..." msgid "Free Space" msgstr "Espaço Livre" -msgid "French" -msgstr "Francês" - msgid "Full Shutdown" msgstr "Desligar" -msgid "GAMEID_Gamename" -msgstr "IDJOGO_NomeJogo" - msgid "GCT Cheatcodes Path" msgstr "Pasta ficheiros GCT" @@ -566,9 +501,6 @@ msgstr "Definições do Interface" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg não encontrado em nenhuma sub-pasta." -msgid "Game ID" -msgstr "ID do Jogo" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Carregamento de Jogos" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Região" - msgid "Game Size" msgstr "Tamanho do Jogo" @@ -599,18 +528,12 @@ msgstr "O jogo já está instalado:" msgid "Game partition" msgstr "Partição de Jogos" -msgid "Gamename [GAMEID]" -msgstr "NomeJogo [IDJOGO]" - msgid "Games" msgstr "Jogos" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Alemão" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Insira um cartão SD para usar esta funcionalidade." msgid "Install" msgstr "Instalar" -msgid "Install 1:1 Copy" -msgstr "Instalar Cópia 1:1" - msgid "Install Error!" msgstr "Erro de Instalação!" @@ -691,21 +611,12 @@ msgstr "Instalando título... Ok!" msgid "Installing wad" msgstr "Instalando wad" -msgid "Invalid PIN code" -msgstr "PIN inválido" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Parece que tem informação que pode ser útil. Por favor envie esta informação à equipa de desenvolvimento." -msgid "Italian" -msgstr "Italiano" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "Japonês" - msgid "July" msgstr "Jul" @@ -718,9 +629,6 @@ msgstr "Manter" msgid "Keyboard" msgstr "Teclado" -msgid "Korean" -msgstr "Coreano" - msgid "Language File" msgstr "Idiomas" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Pasta para o ficheiro de Idioma alterada." -msgid "Left" -msgstr "Esquerda" - -msgid "Like SysMenu" -msgstr "Igual ao Menu da Wii" - msgid "Load" msgstr "Carregar" -msgid "Load From SD/USB" -msgstr "Carregar do SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Carregar ficheiro de: %s ?" @@ -752,6 +651,9 @@ msgstr "Carregar ficheiro de: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Carregar este DOL como DOL alternativo?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Carregado idioma padrão." @@ -761,17 +663,8 @@ msgstr "Carregando música padrão." msgid "Lock Console" msgstr "Bloquear Configurações" -msgid "Locked" -msgstr "Bloqueado" - -msgid "Loop Directory" -msgstr "Repetir Pasta" - -msgid "Loop Music" -msgstr "Repetir Música" - -msgid "Loop Sound" -msgstr "Repetir Sons" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "" @@ -794,15 +687,12 @@ msgstr "Modo de Repetição" msgid "Music Volume" msgstr "Volume Música" -msgid "Neither" -msgstr "Nenhum" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Novo Disco Detectado" -msgid "Next" -msgstr "Próximo" - msgid "No" msgstr "Não" @@ -839,12 +729,6 @@ msgstr "Não existem novas actualizações." msgid "No themes found on the site." msgstr "Nenhum tema encontrado no site." -msgid "None" -msgstr "Nenhum" - -msgid "Normal" -msgstr "Normal" - msgid "Not a WAD file." msgstr "Não é um ficheiro WAD." @@ -884,9 +768,6 @@ msgstr "Desligado" msgid "OK" msgstr "" -msgid "ON" -msgstr "Ligado" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Site Oficial:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Apenas Alternativas" - -msgid "Only Original" -msgstr "Apenas Originais" - -msgid "Only for Install" -msgstr "Apenas na instalação" - -msgid "Original/Customs" -msgstr "Originais/Alternativas" - msgid "Parental Control" msgstr "Controlo Parental" -msgid "Parental Control disabled" -msgstr "Controlo Parental inactivo" - msgid "Partition" msgstr "Partição" @@ -947,9 +813,6 @@ msgstr "Vezes jogadas" msgid "Play Next" msgstr "Próxima" -msgid "Play Once" -msgstr "Tocar uma vez" - msgid "Play Previous" msgstr "Anterior" @@ -962,9 +825,6 @@ msgstr "Por favor aguarde..." msgid "Power off the Wii" msgstr "Desligar a Wii" -msgid "Prev" -msgstr "Anterior" - msgid "Prompts Buttons" msgstr "Mensagens/Botões" @@ -974,9 +834,6 @@ msgstr "Publicado por" msgid "Quick Boot" msgstr "Arranque Rápido" -msgid "Random Directory Music" -msgstr "Pasta de Música Aleatória" - msgid "Reading WAD data... Ok!" msgstr "Lendo dados do WAD... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Voltar ao Menu da Wii" -msgid "Right" -msgstr "Direita" - msgid "Rumble" msgstr "Vibração" -msgid "SChinese" -msgstr "Chinês Simplificado" - msgid "SFX Volume" msgstr "Volume Efeitos" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Seleccionar o DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Set" @@ -1085,15 +933,6 @@ msgstr "Audio" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Efeitos+Musica" - -msgid "Sound+Quiet" -msgstr "Efeitos+Silêncio" - -msgid "Spanish" -msgstr "Espanhol" - msgid "Special thanks to:" msgstr "Agradecimentos especiais para:" @@ -1121,24 +960,18 @@ msgstr "Tema extraído com sucesso." msgid "Successfully installed:" msgstr "Instalado com Sucesso:" -msgid "System Default" -msgstr "Predefinição Sistema" - -msgid "TChinese" -msgstr "Chinês Tradicional" - msgid "TXT Cheatcodes Path" msgstr "Pasta Dicas" msgid "The entered directory does not exist. Would you like to create it?" msgstr "A pasta não existe, pretende criá-la?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "O ficheiro wad foi instalado mas não foi possível eliminá-lo do cartão SD." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "A instalação do wad falhou com o seguinte erro: %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Pasta Download Temas" @@ -1152,6 +985,9 @@ msgstr "Pasta Temas" msgid "Theme Title:" msgstr "Título do Tema:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "A transferência falhou." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "Dispositivo USB não encontrado" msgid "USB Loader GX is protected" msgstr "O USB Loader GX está bloqueado" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Não é possível abrir o ficheiro wad descarregado (%s)." - msgid "Uninstall" msgstr "Desinstalar" @@ -1201,15 +1039,12 @@ msgstr "Desinstalando wad" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Desbloquear Controlo Parental" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Desbloquear configuração antes de usar esta opção." -msgid "Unlocked" -msgstr "Desbloqueado" - msgid "Unsupported format, try to extract manually." msgstr "Formato não suportado, tente extrair manualmente." @@ -1234,21 +1069,12 @@ msgstr "Actualizar todos os ficheiros de Idioma" msgid "Update failed" msgstr "Erro ao actualizar" -msgid "Update to" -msgstr "Actualizando para" - -msgid "Updating" -msgstr "Actualizando" - -msgid "Updating Language Files..." -msgstr "Actualizando ficheiros de Idioma..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Actualizando ficheiros de Idioma:" -msgid "Updating WiiTDB.zip" -msgstr "Actualizando WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Ficheiro ZIP instalado na pasta do Homebrew." @@ -1280,9 +1106,6 @@ msgstr "Que componente deseja actualizar?" msgid "WiFi Features" msgstr "Rede sem fios" -msgid "Widescreen Fix" -msgstr "Correcção 16:9" - msgid "Wii Menu" msgstr "Menu da Wii" @@ -1310,9 +1133,6 @@ msgstr "Sim" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "O Controlo Parental não está activo. Se deseja utilizar o Controlo Parental active-o na configuração da Wii (Wii Settings)." - msgid "You need to select or format a partition" msgstr "Necessita seleccionar ou formatar uma partição" @@ -1377,6 +1197,225 @@ msgstr "de" msgid "seconds left" msgstr "segundos restantes" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Instalar Cópia 1:1" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Todos)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Crianças 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 hora" + +#~ msgid "10 min" +#~ msgstr "10 minutos" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Adolescente 12+)" + +#~ msgid "20 min" +#~ msgstr "20 minutos" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Adulto 16+)" + +#~ msgid "3 min" +#~ msgstr "3 minutos" + +#~ msgid "30 min" +#~ msgstr "30 minutos" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Adultos 18+)" + +#~ msgid "5 min" +#~ msgstr "5 minutos" + +#~ msgid "An Error occured" +#~ msgstr "Ocurreu um Erro" + +#~ msgid "Anti" +#~ msgstr "Anti" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Tem a certeza que pretende activar o Controlo Parental?" + +#~ msgid "AutoPatch" +#~ msgstr "Patch automático" + +#~ msgid "Both" +#~ msgstr "Ambos" + +#~ msgid "Checking for Updates" +#~ msgstr "Procurando Actualizações" + +#~ msgid "Console Default" +#~ msgstr "Predefinição Consola" + +#~ msgid "Customs/Original" +#~ msgstr "Alternativas/Originais" + +#~ msgid "Disc Default" +#~ msgstr "Predefinição Disco" + +#~ msgid "DiskFlip" +#~ msgstr "Voltar Disco" + +#~ msgid "Downloading" +#~ msgstr "Descarregando" + +#~ msgid "Dutch" +#~ msgstr "Holandês" + +#~ msgid "English" +#~ msgstr "Inglês" + +#~ msgid "French" +#~ msgstr "Francês" + +#~ msgid "GAMEID_Gamename" +#~ msgstr "IDJOGO_NomeJogo" + +#~ msgid "Game ID" +#~ msgstr "ID do Jogo" + +#~ msgid "Game Region" +#~ msgstr "Região" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "NomeJogo [IDJOGO]" + +#~ msgid "German" +#~ msgstr "Alemão" + +#~ msgid "Invalid PIN code" +#~ msgstr "PIN inválido" + +#~ msgid "Italian" +#~ msgstr "Italiano" + +#~ msgid "Japanese" +#~ msgstr "Japonês" + +#~ msgid "Korean" +#~ msgstr "Coreano" + +#~ msgid "Left" +#~ msgstr "Esquerda" + +#~ msgid "Like SysMenu" +#~ msgstr "Igual ao Menu da Wii" + +#~ msgid "Load From SD/USB" +#~ msgstr "Carregar do SD/USB" + +#~ msgid "Locked" +#~ msgstr "Bloqueado" + +#~ msgid "Loop Directory" +#~ msgstr "Repetir Pasta" + +#~ msgid "Loop Music" +#~ msgstr "Repetir Música" + +#~ msgid "Loop Sound" +#~ msgstr "Repetir Sons" + +#~ msgid "Neither" +#~ msgstr "Nenhum" + +#~ msgid "Next" +#~ msgstr "Próximo" + +#~ msgid "None" +#~ msgstr "Nenhum" + +#~ msgid "Normal" +#~ msgstr "Normal" + +#~ msgid "ON" +#~ msgstr "Ligado" + +#~ msgid "Only Customs" +#~ msgstr "Apenas Alternativas" + +#~ msgid "Only Original" +#~ msgstr "Apenas Originais" + +#~ msgid "Only for Install" +#~ msgstr "Apenas na instalação" + +#~ msgid "Original/Customs" +#~ msgstr "Originais/Alternativas" + +#~ msgid "Parental Control disabled" +#~ msgstr "Controlo Parental inactivo" + +#~ msgid "Play Once" +#~ msgstr "Tocar uma vez" + +#~ msgid "Prev" +#~ msgstr "Anterior" + +#~ msgid "Random Directory Music" +#~ msgstr "Pasta de Música Aleatória" + +#~ msgid "Right" +#~ msgstr "Direita" + +#~ msgid "SChinese" +#~ msgstr "Chinês Simplificado" + +#~ msgid "Sound+BGM" +#~ msgstr "Efeitos+Musica" + +#~ msgid "Sound+Quiet" +#~ msgstr "Efeitos+Silêncio" + +#~ msgid "Spanish" +#~ msgstr "Espanhol" + +#~ msgid "System Default" +#~ msgstr "Predefinição Sistema" + +#~ msgid "TChinese" +#~ msgstr "Chinês Tradicional" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "O ficheiro wad foi instalado mas não foi possível eliminá-lo do cartão SD." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "A instalação do wad falhou com o seguinte erro: %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Não é possível abrir o ficheiro wad descarregado (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Desbloquear Controlo Parental" + +#~ msgid "Unlocked" +#~ msgstr "Desbloqueado" + +#~ msgid "Update to" +#~ msgstr "Actualizando para" + +#~ msgid "Updating" +#~ msgstr "Actualizando" + +#~ msgid "Updating Language Files..." +#~ msgstr "Actualizando ficheiros de Idioma..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Actualizando WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Correcção 16:9" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "O Controlo Parental não está activo. Se deseja utilizar o Controlo Parental active-o na configuração da Wii (Wii Settings)." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Pode não carregar correctamente se o System Menu estiver desactualizado." diff --git a/Languages/russian.lang b/Languages/russian.lang index 439ea987..b60178bb 100644 --- a/Languages/russian.lang +++ b/Languages/russian.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: nikolai_ca\n" "Language-Team: Kir, alendit, nikolai_ca\n" @@ -25,54 +25,15 @@ msgstr " был сохранен. Текст не был проверен. Не msgid " is not on the server." msgstr " не найден на сервере" -msgid "0 (Everyone)" -msgstr "0 (Для всех)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Дети 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 час" - -msgid "10 min" -msgstr "10 мин." - -msgid "2 (Teen 12+)" -msgstr "2 (Подростки 12+)" - -msgid "20 min" -msgstr "20 мин." - msgid "2D Cover Path" msgstr "Путь к 2D обложкам" -msgid "3 (Mature 16+)" -msgstr "3 (Подростки 16+)" - -msgid "3 min" -msgstr "3 мин." - -msgid "30 min" -msgstr "30 мин." - msgid "3D Cover Path" msgstr "Путь к 3D обложкам" msgid "3D Covers" msgstr "3D Обложки" -msgid "4 (Adults Only 18+)" -msgstr "4 (Взрослые 18+)" - -msgid "5 min" -msgstr "5 мин." - msgid ">> Deleting tickets..." msgstr ">> Удаление тикетов...." @@ -136,20 +97,14 @@ msgstr "Все функции USB Loader GX разблокированы." msgid "Alternate DOL" msgstr "Альтернативный DOL" -msgid "An Error occured" -msgstr "Произошла ошибка" - -msgid "Anti" -msgstr "Анти" - msgid "App Language" msgstr "Язык приложения" msgid "Apr" msgstr "Апр" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Вы действительно хотите включить Родительский Контроль?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Автор:" msgid "AutoInit Network" msgstr "АвтоИнициализация Сети" -msgid "AutoPatch" -msgstr "Авто Патч" - msgid "BCA Codes Path" msgstr "Путь к кодам BCA" @@ -199,9 +151,6 @@ msgstr "Загрузка/Стандарт" msgid "Boot?" msgstr "Загрузить?" -msgid "Both" -msgstr "Оба" - msgid "Can't be formatted" msgstr "Невозможно отформатировать" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "Файл с читами пустой" -msgid "Checking for Updates" -msgstr "Проверяю обновления" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Связь потеряна..." msgid "Console" msgstr "Консоль" -msgid "Console Default" -msgstr "По умолчанию (консоль)" - msgid "Console Locked" msgstr "Консоль заблокирована" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Не могу создать GCT файл" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Об авторах" msgid "Custom Paths" msgstr "Изменение путей" -msgid "Customs/Original" -msgstr "Измененный/Оригинальные" - msgid "DOL Path" msgstr "Путь к DOL" @@ -365,15 +309,9 @@ msgstr "Загрузка изображений диска" msgid "Disc Artwork Path" msgstr "Путь к изображениям дисков" -msgid "Disc Default" -msgstr "По умолчанию (диск)" - msgid "Disc Images" msgstr "Изображения дисков" -msgid "DiskFlip" -msgstr "ДискФлип" - msgid "Display" msgstr "Отображать" @@ -404,6 +342,9 @@ msgstr "Вы действительно хотите загрузить эту msgid "Do you want to format:" msgstr "Вы хотите отформатировать:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Вы хотите использовать DOL, который считается правильным?" @@ -434,26 +375,26 @@ msgstr "Скачивание завершено" msgid "Download request failed." msgstr "Запрос на загрузку завершился с ошибкоа." -msgid "Downloading" -msgstr "Скачиваю" - msgid "Downloading Page List:" msgstr "Загружается список страниц:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Скачиваю файл:" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Загружается картинка:" -msgid "Dutch" -msgstr "Голландский" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "ОШИБКА" @@ -464,9 +405,6 @@ msgstr "ОШИБКА:" msgid "ERROR: Can't set up theme." msgstr "ОШИБКА: Не удалось установить тему." -msgid "English" -msgstr "Английский" - msgid "Error" msgstr "Ошибка" @@ -476,15 +414,24 @@ msgstr "Ошибка !" msgid "Error 002 fix" msgstr "Фикс ошибки 002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Ошибка чтения диска" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Ошибка при передаче данных." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Не удалось распаковать." msgid "Failed to open partition" msgstr "Не удалось открыть раздел" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "Фев" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Flip-X" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Форматировать" @@ -545,15 +486,9 @@ msgstr "Форматирую, пожалуйста подождите..." msgid "Free Space" msgstr "Свободное пространство" -msgid "French" -msgstr "Французский" - msgid "Full Shutdown" msgstr "Полное отключение" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "Путь к читам" @@ -566,9 +501,6 @@ msgstr "Настройки интерфейса" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg не найден ни в одном каталоге." -msgid "Game ID" -msgstr "ID игры" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "загрузка игры" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Регион игры" - msgid "Game Size" msgstr "Размер игры" @@ -599,18 +528,12 @@ msgstr "Игра уже установлена:" msgid "Game partition" msgstr "Раздел игры" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Игры" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Немецкий" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Для использования этой функции нужна SD msgid "Install" msgstr "Установка" -msgid "Install 1:1 Copy" -msgstr "Установка копии 1:1" - msgid "Install Error!" msgstr "Ошибка установки!" @@ -691,21 +611,12 @@ msgstr "Установка тайтла... ОК!" msgid "Installing wad" msgstr "Установка WAD" -msgid "Invalid PIN code" -msgstr "Неправильный PIN-код" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Возможно что у Вас есть информация полезная нам. Пожалуйста передайте эту информацию команде разработчиков." -msgid "Italian" -msgstr "Итальянский" - msgid "Jan" msgstr "Янв" -msgid "Japanese" -msgstr "Японский" - msgid "July" msgstr "Июл" @@ -718,9 +629,6 @@ msgstr "Сохранить" msgid "Keyboard" msgstr "Клавиатура" -msgid "Korean" -msgstr "Корейский" - msgid "Language File" msgstr "Языковой файл" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Путь к языкам изменен" -msgid "Left" -msgstr "Налево" - -msgid "Like SysMenu" -msgstr "как SysMenu" - msgid "Load" msgstr "Загрузить" -msgid "Load From SD/USB" -msgstr "Загрузка с SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Загрузить файл из %s ?" @@ -752,6 +651,9 @@ msgstr "Загрузить файл из %s ?" msgid "Load this DOL as alternate DOL?" msgstr "Загрузить этот DOL в качестве альтернативного ?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Загрузка языка по умолчанию" @@ -761,18 +663,9 @@ msgstr "Загрузка стандартной музыки" msgid "Lock Console" msgstr "Заблокировать консоль" -msgid "Locked" -msgstr "Заблокировано" - -msgid "Loop Directory" +msgid "Lock USB Loader GX" msgstr "" -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" -msgstr "Зациклить звут" - msgid "Mar" msgstr "Мар" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "Громкость" -msgid "Neither" -msgstr "Ни то, ни другое" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Обнаружен новый диск" -msgid "Next" -msgstr "Следующий" - msgid "No" msgstr "Нет" @@ -839,12 +729,6 @@ msgstr "Нет обновлений" msgid "No themes found on the site." msgstr "На сайте не найдено ни одной темы" -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "Обычный" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "ВЫКЛ" msgid "OK" msgstr "OK" -msgid "ON" -msgstr "ВКЛ" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Оф. сайт:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Только измененные" - -msgid "Only Original" -msgstr "Только оригинальные" - -msgid "Only for Install" -msgstr "Только при установке" - -msgid "Original/Customs" -msgstr "Измененные/Модифицированные" - msgid "Parental Control" msgstr "Родительский Контроль" -msgid "Parental Control disabled" -msgstr "Родительский Контроль выключен" - msgid "Partition" msgstr "Раздел" @@ -947,9 +813,6 @@ msgstr "Запущено раз" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "Пожалуйста подождите..." msgid "Power off the Wii" msgstr "Выключить Wii" -msgid "Prev" -msgstr "Предыдущий" - msgid "Prompts Buttons" msgstr "Кнопки приглашения" @@ -974,9 +834,6 @@ msgstr "Опубликовано: " msgid "Quick Boot" msgstr "Быстрая загрузка" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "Чтение данных WAD... ОК!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Вернуться в меню Wii" -msgid "Right" -msgstr "Направо" - msgid "Rumble" msgstr "Вибрация" -msgid "SChinese" -msgstr "Упрощенный китайский" - msgid "SFX Volume" msgstr "Громкость эффектов" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Выберите DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Сен" @@ -1085,15 +933,6 @@ msgstr "Звук" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Звук и фоновая музыка" - -msgid "Sound+Quiet" -msgstr "Звук и тишина" - -msgid "Spanish" -msgstr "Испанский" - msgid "Special thanks to:" msgstr "Отдельные благодарности" @@ -1121,24 +960,18 @@ msgstr "Успешно извлечена тема." msgid "Successfully installed:" msgstr "Успешно установлено:" -msgid "System Default" -msgstr "По умолчанию" - -msgid "TChinese" -msgstr "Традиционный китайский" - msgid "TXT Cheatcodes Path" msgstr "Путь к TXT читкодам" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Заданный каталог не существует. Хотите создать его?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "WAD файл установлен, но он не может быть удален с карты SD." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "Установка WAD не удалась, код ошибки %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Путь для загрузки темы" @@ -1152,6 +985,9 @@ msgstr "Путь к темам" msgid "Theme Title:" msgstr "Заголовок темы:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Передача не удалась." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB устройство не найдено" msgid "USB Loader GX is protected" msgstr "USB Loader GX заблокирован" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Не могу открыть скачанный WAD (%s)" - msgid "Uninstall" msgstr "Деинсталлировать" @@ -1201,15 +1039,12 @@ msgstr "Деинсталлируется wad" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Разблокировать Родительский Контроль" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Для изменения параметра разблокируйте консоль." -msgid "Unlocked" -msgstr "Разблокировано" - msgid "Unsupported format, try to extract manually." msgstr "Формат не поддерживается, попробуйте распаковать самостоятельно." @@ -1234,21 +1069,12 @@ msgstr "Обновить все языковые файлы" msgid "Update failed" msgstr "Обновление не удалось" -msgid "Update to" -msgstr "Обновить до" - -msgid "Updating" -msgstr "обновляю" - -msgid "Updating Language Files..." -msgstr "Обновление языковых файлов..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Обновление языковых файлов:" -msgid "Updating WiiTDB.zip" -msgstr "Обновление WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Загруженный ZIP-файл установлен в каталог homebrew" @@ -1280,9 +1106,6 @@ msgstr "Что Вы хотите обновить?" msgid "WiFi Features" msgstr "свойства WiFi" -msgid "Widescreen Fix" -msgstr "Широкоформатный фикс" - msgid "Wii Menu" msgstr "Меню Wii" @@ -1310,9 +1133,6 @@ msgstr "Да" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "У Вас не включен Родительский Контроль. Если вы хотите использовать Родительский Контроль, включите его в установках Wii." - msgid "You need to select or format a partition" msgstr "" @@ -1377,6 +1197,204 @@ msgstr "из" msgid "seconds left" msgstr "секунд осталось" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Установка копии 1:1" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Для всех)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Дети 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 час" + +#~ msgid "10 min" +#~ msgstr "10 мин." + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Подростки 12+)" + +#~ msgid "20 min" +#~ msgstr "20 мин." + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Подростки 16+)" + +#~ msgid "3 min" +#~ msgstr "3 мин." + +#~ msgid "30 min" +#~ msgstr "30 мин." + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Взрослые 18+)" + +#~ msgid "5 min" +#~ msgstr "5 мин." + +#~ msgid "An Error occured" +#~ msgstr "Произошла ошибка" + +#~ msgid "Anti" +#~ msgstr "Анти" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Вы действительно хотите включить Родительский Контроль?" + +#~ msgid "AutoPatch" +#~ msgstr "Авто Патч" + +#~ msgid "Both" +#~ msgstr "Оба" + +#~ msgid "Checking for Updates" +#~ msgstr "Проверяю обновления" + +#~ msgid "Console Default" +#~ msgstr "По умолчанию (консоль)" + +#~ msgid "Customs/Original" +#~ msgstr "Измененный/Оригинальные" + +#~ msgid "Disc Default" +#~ msgstr "По умолчанию (диск)" + +#~ msgid "DiskFlip" +#~ msgstr "ДискФлип" + +#~ msgid "Downloading" +#~ msgstr "Скачиваю" + +#~ msgid "Dutch" +#~ msgstr "Голландский" + +#~ msgid "English" +#~ msgstr "Английский" + +#~ msgid "French" +#~ msgstr "Французский" + +#~ msgid "Game ID" +#~ msgstr "ID игры" + +#~ msgid "Game Region" +#~ msgstr "Регион игры" + +#~ msgid "German" +#~ msgstr "Немецкий" + +#~ msgid "Invalid PIN code" +#~ msgstr "Неправильный PIN-код" + +#~ msgid "Italian" +#~ msgstr "Итальянский" + +#~ msgid "Japanese" +#~ msgstr "Японский" + +#~ msgid "Korean" +#~ msgstr "Корейский" + +#~ msgid "Left" +#~ msgstr "Налево" + +#~ msgid "Like SysMenu" +#~ msgstr "как SysMenu" + +#~ msgid "Load From SD/USB" +#~ msgstr "Загрузка с SD/USB" + +#~ msgid "Locked" +#~ msgstr "Заблокировано" + +#~ msgid "Loop Sound" +#~ msgstr "Зациклить звут" + +#~ msgid "Neither" +#~ msgstr "Ни то, ни другое" + +#~ msgid "Next" +#~ msgstr "Следующий" + +#~ msgid "Normal" +#~ msgstr "Обычный" + +#~ msgid "ON" +#~ msgstr "ВКЛ" + +#~ msgid "Only Customs" +#~ msgstr "Только измененные" + +#~ msgid "Only Original" +#~ msgstr "Только оригинальные" + +#~ msgid "Only for Install" +#~ msgstr "Только при установке" + +#~ msgid "Original/Customs" +#~ msgstr "Измененные/Модифицированные" + +#~ msgid "Parental Control disabled" +#~ msgstr "Родительский Контроль выключен" + +#~ msgid "Prev" +#~ msgstr "Предыдущий" + +#~ msgid "Right" +#~ msgstr "Направо" + +#~ msgid "SChinese" +#~ msgstr "Упрощенный китайский" + +#~ msgid "Sound+BGM" +#~ msgstr "Звук и фоновая музыка" + +#~ msgid "Sound+Quiet" +#~ msgstr "Звук и тишина" + +#~ msgid "Spanish" +#~ msgstr "Испанский" + +#~ msgid "System Default" +#~ msgstr "По умолчанию" + +#~ msgid "TChinese" +#~ msgstr "Традиционный китайский" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "WAD файл установлен, но он не может быть удален с карты SD." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "Установка WAD не удалась, код ошибки %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Не могу открыть скачанный WAD (%s)" + +#~ msgid "Unlock Parental Control" +#~ msgstr "Разблокировать Родительский Контроль" + +#~ msgid "Unlocked" +#~ msgstr "Разблокировано" + +#~ msgid "Update to" +#~ msgstr "Обновить до" + +#~ msgid "Updating" +#~ msgstr "обновляю" + +#~ msgid "Updating Language Files..." +#~ msgstr "Обновление языковых файлов..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Обновление WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Широкоформатный фикс" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "У Вас не включен Родительский Контроль. Если вы хотите использовать Родительский Контроль, включите его в установках Wii." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s может не загрузиться правильно если ваше Системное Меню не последней версии" diff --git a/Languages/schinese.lang b/Languages/schinese.lang index 3cd3038b..b1a28711 100644 --- a/Languages/schinese.lang +++ b/Languages/schinese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: knife.hu kavid\n" "Language-Team: kavid\n" @@ -25,54 +25,15 @@ msgstr "已经被保存.内容尚未验证.部分代码可能无法作用.如果 msgid " is not on the server." msgstr "不在服务器上" -msgid "0 (Everyone)" -msgstr "0 (全年龄)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (7岁以上)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 小时" - -msgid "10 min" -msgstr "10 分钟" - -msgid "2 (Teen 12+)" -msgstr "2 (12岁以上)" - -msgid "20 min" -msgstr "20 分钟" - msgid "2D Cover Path" msgstr "2D封面路径" -msgid "3 (Mature 16+)" -msgstr "3 (16岁以上)" - -msgid "3 min" -msgstr "3 分钟" - -msgid "30 min" -msgstr "30 分钟" - msgid "3D Cover Path" msgstr "3D封面路径" msgid "3D Covers" msgstr "3D 封面" -msgid "4 (Adults Only 18+)" -msgstr "4 (18岁以上成人)" - -msgid "5 min" -msgstr "5 分钟" - msgid ">> Deleting tickets..." msgstr ">> 删除 tickets..." @@ -136,19 +97,13 @@ msgstr "USB Loader GX 功能已解锁." msgid "Alternate DOL" msgstr "可选择Alt DOL文件" -msgid "An Error occured" -msgstr "发生一个错误" - -msgid "Anti" -msgstr "防止" - msgid "App Language" msgstr "语言设定" msgid "Apr" msgstr "四月" -msgid "Are you sure you want to enable Parent Control?" +msgid "Are you sure you want to lock USB Loader GX?" msgstr "" msgid "Are you sure you want to reset?" @@ -166,9 +121,6 @@ msgstr "" msgid "AutoInit Network" msgstr "自动检测网络" -msgid "AutoPatch" -msgstr "自动修改" - msgid "BCA Codes Path" msgstr "" @@ -199,9 +151,6 @@ msgstr "启动/标准" msgid "Boot?" msgstr "启动?" -msgid "Both" -msgstr "全部" - msgid "Can't be formatted" msgstr "无法格式化" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "作弊码文件是空的" -msgid "Checking for Updates" -msgstr "检测软件最新版本" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "控制台" -msgid "Console Default" -msgstr "主机默认" - msgid "Console Locked" msgstr "主机锁定" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "无法建立 GCT 文件" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "作者信息" msgid "Custom Paths" msgstr "自定义路径" -msgid "Customs/Original" -msgstr "自定义/官方" - msgid "DOL Path" msgstr "DOL 路径" @@ -365,15 +309,9 @@ msgstr "光盘图片下载" msgid "Disc Artwork Path" msgstr "光盘图片路径" -msgid "Disc Default" -msgstr "游戏默认" - msgid "Disc Images" msgstr "光盘图片" -msgid "DiskFlip" -msgstr "光盘滑动" - msgid "Display" msgstr "显示" @@ -404,6 +342,9 @@ msgstr "" msgid "Do you want to format:" msgstr "是否格式化:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "使用这个已知是正确的 Alt DOL 文件?" @@ -434,26 +375,26 @@ msgstr "下载完成" msgid "Download request failed." msgstr "" -msgid "Downloading" -msgstr "下载" - msgid "Downloading Page List:" msgstr "" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "下载文件:" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "" -msgid "Dutch" -msgstr "荷文" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "错误" @@ -464,9 +405,6 @@ msgstr "错误:" msgid "ERROR: Can't set up theme." msgstr "" -msgid "English" -msgstr "英文" - msgid "Error" msgstr "错误" @@ -476,15 +414,24 @@ msgstr "错误 !" msgid "Error 002 fix" msgstr "002 错误修正" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "读取光盘错误" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "传送数据错误." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "" msgid "Failed to open partition" msgstr "打开分区失败" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "二月" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "按键规则" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "格式化" @@ -545,15 +486,9 @@ msgstr "格式化中, 请稍候..." msgid "Free Space" msgstr "剩余空间" -msgid "French" -msgstr "法文" - msgid "Full Shutdown" msgstr "完全关机" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "作弊码路径" @@ -566,9 +501,6 @@ msgstr "界面设置" msgid "GXtheme.cfg not found in any subfolder." msgstr "" -msgid "Game ID" -msgstr "游戏 ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "游戏载入" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "游戏区域" - msgid "Game Size" msgstr "游戏容量" @@ -599,18 +528,12 @@ msgstr "已安装的游戏:" msgid "Game partition" msgstr "" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "游戏" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "德文" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "插入 SD 卡使用此功能." msgid "Install" msgstr "安装" -msgid "Install 1:1 Copy" -msgstr "" - msgid "Install Error!" msgstr "安装错误!" @@ -691,21 +611,12 @@ msgstr "安装 title... 完成!" msgid "Installing wad" msgstr "安裝 WAD" -msgid "Invalid PIN code" -msgstr "" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "看來你有一些能帮到我们的信息.请将这些信息发送给开发团队.%s - %i" -msgid "Italian" -msgstr "意大利文" - msgid "Jan" msgstr "一月" -msgid "Japanese" -msgstr "日文" - msgid "July" msgstr "七月" @@ -718,9 +629,6 @@ msgstr "保持" msgid "Keyboard" msgstr "键盘" -msgid "Korean" -msgstr "韩文" - msgid "Language File" msgstr "语言文件" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "语言文件路径已变更" -msgid "Left" -msgstr "左" - -msgid "Like SysMenu" -msgstr "同系统选单" - msgid "Load" msgstr "载入" -msgid "Load From SD/USB" -msgstr "从 SD/USB 载入" - #, c-format msgid "Load file from: %s ?" msgstr "从%s 载入文件?" @@ -752,6 +651,9 @@ msgstr "从%s 载入文件?" msgid "Load this DOL as alternate DOL?" msgstr "载入这个 DOL 作为 ALT DOL?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "载入标准语言" @@ -761,16 +663,7 @@ msgstr "载入标准音乐." msgid "Lock Console" msgstr "锁定控制台" -msgid "Locked" -msgstr "已锁定" - -msgid "Loop Directory" -msgstr "" - -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" +msgid "Lock USB Loader GX" msgstr "" msgid "Mar" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "音量" -msgid "Neither" -msgstr "全不" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "新光盘已检测" -msgid "Next" -msgstr "往后" - msgid "No" msgstr "否" @@ -839,12 +729,6 @@ msgstr "没有可用更新" msgid "No themes found on the site." msgstr "" -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "一般" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "关闭" msgid "OK" msgstr "确定" -msgid "ON" -msgstr "开启" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "官方网址:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "仅自定义" - -msgid "Only Original" -msgstr "仅官方" - -msgid "Only for Install" -msgstr "仅安装" - -msgid "Original/Customs" -msgstr "官方/自定义" - msgid "Parental Control" msgstr "家长控制" -msgid "Parental Control disabled" -msgstr "" - msgid "Partition" msgstr "分区" @@ -947,9 +813,6 @@ msgstr "游戏计数" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "请等待..." msgid "Power off the Wii" msgstr "关闭 Wii 主机" -msgid "Prev" -msgstr "往前" - msgid "Prompts Buttons" msgstr "显示校正" @@ -974,9 +834,6 @@ msgstr "发行" msgid "Quick Boot" msgstr "快速启动" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "读取 WAD 数据... 完成!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "返回 Wii 主菜单" -msgid "Right" -msgstr "右" - msgid "Rumble" msgstr "震动" -msgid "SChinese" -msgstr "简体中文" - msgid "SFX Volume" msgstr "SFX 音量" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "选择一个 DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "九月" @@ -1085,15 +933,6 @@ msgstr "声音" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "" - -msgid "Sound+Quiet" -msgstr "" - -msgid "Spanish" -msgstr "西班牙文" - msgid "Special thanks to:" msgstr "特别感谢" @@ -1121,24 +960,18 @@ msgstr "" msgid "Successfully installed:" msgstr "成功安装:" -msgid "System Default" -msgstr "系统默认" - -msgid "TChinese" -msgstr "繁体中文" - msgid "TXT Cheatcodes Path" msgstr "TXT 作弊码文件路径" msgid "The entered directory does not exist. Would you like to create it?" msgstr "已进入的目录不存在。你想要创建一个目录吗?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "WAD 已安装,但文件无法从 SD 卡中删除." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "WAD 安装失败,错误号 %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "" @@ -1152,6 +985,9 @@ msgstr "主题路径" msgid "Theme Title:" msgstr "" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "找不到 USB 设备" msgid "USB Loader GX is protected" msgstr "USB Loader GX 被锁定" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "不能打开刚下载的 WAD 文件 (%s)." - msgid "Uninstall" msgstr "删除" @@ -1201,15 +1039,12 @@ msgstr "卸载 WAD" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" +msgid "Unlock USB Loader GX" msgstr "" msgid "Unlock console to use this option." msgstr "请解锁后使用此功能" -msgid "Unlocked" -msgstr "已解锁" - msgid "Unsupported format, try to extract manually." msgstr "" @@ -1234,21 +1069,12 @@ msgstr "升级全部语言文件" msgid "Update failed" msgstr "升级失败" -msgid "Update to" -msgstr "升级到" - -msgid "Updating" -msgstr "升级中" - -msgid "Updating Language Files..." -msgstr "升级语言文件..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "正在升级语言文件:" -msgid "Updating WiiTDB.zip" -msgstr "正在升级 WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "上传已安装Zip文件到自制程序目录" @@ -1280,9 +1106,6 @@ msgstr "要升级么?" msgid "WiFi Features" msgstr "WiFi 功能" -msgid "Widescreen Fix" -msgstr "宽屏校正" - msgid "Wii Menu" msgstr "Wii 系统菜单" @@ -1310,9 +1133,6 @@ msgstr "是" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "" - msgid "You need to select or format a partition" msgstr "" @@ -1377,6 +1197,177 @@ msgstr "的" msgid "seconds left" msgstr "剩余秒数" +#~ msgid "0 (Everyone)" +#~ msgstr "0 (全年龄)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (7岁以上)" + +#~ msgid "1 hour" +#~ msgstr "1 小时" + +#~ msgid "10 min" +#~ msgstr "10 分钟" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (12岁以上)" + +#~ msgid "20 min" +#~ msgstr "20 分钟" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (16岁以上)" + +#~ msgid "3 min" +#~ msgstr "3 分钟" + +#~ msgid "30 min" +#~ msgstr "30 分钟" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (18岁以上成人)" + +#~ msgid "5 min" +#~ msgstr "5 分钟" + +#~ msgid "An Error occured" +#~ msgstr "发生一个错误" + +#~ msgid "Anti" +#~ msgstr "防止" + +#~ msgid "AutoPatch" +#~ msgstr "自动修改" + +#~ msgid "Both" +#~ msgstr "全部" + +#~ msgid "Checking for Updates" +#~ msgstr "检测软件最新版本" + +#~ msgid "Console Default" +#~ msgstr "主机默认" + +#~ msgid "Customs/Original" +#~ msgstr "自定义/官方" + +#~ msgid "Disc Default" +#~ msgstr "游戏默认" + +#~ msgid "DiskFlip" +#~ msgstr "光盘滑动" + +#~ msgid "Downloading" +#~ msgstr "下载" + +#~ msgid "Dutch" +#~ msgstr "荷文" + +#~ msgid "English" +#~ msgstr "英文" + +#~ msgid "French" +#~ msgstr "法文" + +#~ msgid "Game ID" +#~ msgstr "游戏 ID" + +#~ msgid "Game Region" +#~ msgstr "游戏区域" + +#~ msgid "German" +#~ msgstr "德文" + +#~ msgid "Italian" +#~ msgstr "意大利文" + +#~ msgid "Japanese" +#~ msgstr "日文" + +#~ msgid "Korean" +#~ msgstr "韩文" + +#~ msgid "Left" +#~ msgstr "左" + +#~ msgid "Like SysMenu" +#~ msgstr "同系统选单" + +#~ msgid "Load From SD/USB" +#~ msgstr "从 SD/USB 载入" + +#~ msgid "Locked" +#~ msgstr "已锁定" + +#~ msgid "Neither" +#~ msgstr "全不" + +#~ msgid "Next" +#~ msgstr "往后" + +#~ msgid "Normal" +#~ msgstr "一般" + +#~ msgid "ON" +#~ msgstr "开启" + +#~ msgid "Only Customs" +#~ msgstr "仅自定义" + +#~ msgid "Only Original" +#~ msgstr "仅官方" + +#~ msgid "Only for Install" +#~ msgstr "仅安装" + +#~ msgid "Original/Customs" +#~ msgstr "官方/自定义" + +#~ msgid "Prev" +#~ msgstr "往前" + +#~ msgid "Right" +#~ msgstr "右" + +#~ msgid "SChinese" +#~ msgstr "简体中文" + +#~ msgid "Spanish" +#~ msgstr "西班牙文" + +#~ msgid "System Default" +#~ msgstr "系统默认" + +#~ msgid "TChinese" +#~ msgstr "繁体中文" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "WAD 已安装,但文件无法从 SD 卡中删除." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "WAD 安装失败,错误号 %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "不能打开刚下载的 WAD 文件 (%s)." + +#~ msgid "Unlocked" +#~ msgstr "已解锁" + +#~ msgid "Update to" +#~ msgstr "升级到" + +#~ msgid "Updating" +#~ msgstr "升级中" + +#~ msgid "Updating Language Files..." +#~ msgstr "升级语言文件..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "正在升级 WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "宽屏校正" + #~ msgid "Back to Wii Menu" #~ msgstr "返回 Wii 系统菜单" diff --git a/Languages/spanish.lang b/Languages/spanish.lang index 6a1f18dd..4c6f3a6a 100644 --- a/Languages/spanish.lang +++ b/Languages/spanish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: SirPalax\n" "Language-Team: Penn, SirPalax\n" @@ -25,54 +25,15 @@ msgstr " ha sido Guardado. Algún código puede no funcionar correctamente. Si e msgid " is not on the server." msgstr " no existe en el servidor." -msgid "0 (Everyone)" -msgstr "0 (Todos)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Niños 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 hora" - -msgid "10 min" -msgstr "10 min." - -msgid "2 (Teen 12+)" -msgstr "2 (Adolescentes 12+)" - -msgid "20 min" -msgstr "20 min." - msgid "2D Cover Path" msgstr "Ruta Carátulas 2D" -msgid "3 (Mature 16+)" -msgstr "3 (Jóvenes 16+)" - -msgid "3 min" -msgstr "3 min." - -msgid "30 min" -msgstr "30 min." - msgid "3D Cover Path" msgstr "Ruta Carátulas 3D" msgid "3D Covers" msgstr "3D" -msgid "4 (Adults Only 18+)" -msgstr "4 (Sólo Adultos 18+)" - -msgid "5 min" -msgstr "5 min." - msgid ">> Deleting tickets..." msgstr ">> Borrando tickets..." @@ -136,20 +97,14 @@ msgstr "Todas las características del USB Loader GX desbloqueadas." msgid "Alternate DOL" msgstr "DOL Alternativo" -msgid "An Error occured" -msgstr "Ocurrió un Error" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Idioma Aplicación" msgid "Apr" msgstr "Abr" -msgid "Are you sure you want to enable Parent Control?" -msgstr "¿Estás seguro de querer activar el Control Parental?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Autor:" msgid "AutoInit Network" msgstr "AutoIniciar la Red" -msgid "AutoPatch" -msgstr "AutoParchear" - msgid "BCA Codes Path" msgstr "Ruta Códigos BCA" @@ -199,9 +151,6 @@ msgstr "Inicio/Estándar" msgid "Boot?" msgstr "¿Ejecutar?" -msgid "Both" -msgstr "Ambos" - msgid "Can't be formatted" msgstr "No se puede formatear" @@ -226,9 +175,6 @@ msgstr "Cambiar Ruta" msgid "Cheatfile is blank" msgstr "El archivo de Trucos está vacio" -msgid "Checking for Updates" -msgstr "Comprobando actualizaciones" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Conexión perdida..." msgid "Console" msgstr "Consola" -msgid "Console Default" -msgstr "Pred. Consola" - msgid "Console Locked" msgstr "Consola Bloqueada" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "¡No se pudo crear el archivo GCT!" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Créditos" msgid "Custom Paths" msgstr "Personalizar Rutas" -msgid "Customs/Original" -msgstr "Artísticas/Originales" - msgid "DOL Path" msgstr "Ruta del DOL" @@ -365,15 +309,9 @@ msgstr "Descarga Imagen Discos" msgid "Disc Artwork Path" msgstr "Ruta Imagen Discos" -msgid "Disc Default" -msgstr "Pred. Disco" - msgid "Disc Images" msgstr "Imagen Discos" -msgid "DiskFlip" -msgstr "GiraDiscos" - msgid "Display" msgstr "Mostrar" @@ -404,6 +342,9 @@ msgstr "¿Quieres descargar este Tema?" msgid "Do you want to format:" msgstr "Quieres formatear:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "¿Quieres usar el DOL Alternativo que se sabe es correcto?" @@ -434,26 +375,26 @@ msgstr "Descarga completada" msgid "Download request failed." msgstr "Error al solicitar la descarga." -msgid "Downloading" -msgstr "Descargando" - msgid "Downloading Page List:" msgstr "Descargando Lista de Páginas:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Descargando archivo" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Descargando imagen:" -msgid "Dutch" -msgstr "Holandés" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "" @@ -464,9 +405,6 @@ msgstr "" msgid "ERROR: Can't set up theme." msgstr "ERROR: No se puede configurar el tema." -msgid "English" -msgstr "Inglés" - msgid "Error" msgstr "" @@ -476,15 +414,24 @@ msgstr "¡Error!" msgid "Error 002 fix" msgstr "Parchear Error 002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Error leyendo Disco" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Error durante la transferencia de datos." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "No se ha podido extraer" msgid "Failed to open partition" msgstr "No se ha podido abrir la partición" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Desplazamiento X" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formateo" @@ -545,15 +486,9 @@ msgstr "Formateando, por favor espera..." msgid "Free Space" msgstr "Espacio Libre" -msgid "French" -msgstr "Francés" - msgid "Full Shutdown" msgstr "Apagado Total" -msgid "GAMEID_Gamename" -msgstr "IDdelJuego_NombreDelJuego" - msgid "GCT Cheatcodes Path" msgstr "Ruta de Trucos GCT" @@ -566,9 +501,6 @@ msgstr "Configuración de la GUI" msgid "GXtheme.cfg not found in any subfolder." msgstr "No se encuentra GXtheme.cfg en ninguna subcarpeta." -msgid "Game ID" -msgstr "ID del Juego" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Configuración de los Juegos" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Región" - msgid "Game Size" msgstr "Tamaño del Juego" @@ -599,18 +528,12 @@ msgstr "El juego ya estaba instalado:" msgid "Game partition" msgstr "Partición de Juegos" -msgid "Gamename [GAMEID]" -msgstr "NombreDelJuego [IDdelJuego]" - msgid "Games" msgstr "Juegos" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Alemán" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Insertar SD para usar esta opción" msgid "Install" msgstr "Instalar" -msgid "Install 1:1 Copy" -msgstr "Instalar Copias 1:1" - msgid "Install Error!" msgstr "¡Error de Instalación!" @@ -691,21 +611,12 @@ msgstr "Instalando título... ¡Correcto!" msgid "Installing wad" msgstr "Instalando el WAD" -msgid "Invalid PIN code" -msgstr "Código PIN erróneo" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Parece que tienes alguna información que puede ser útil para nosotros. Por favor envía esta información al equipo desarrollador." -msgid "Italian" -msgstr "Italiano" - msgid "Jan" msgstr "Ene" -msgid "Japanese" -msgstr "Japonés" - msgid "July" msgstr "Jul" @@ -718,9 +629,6 @@ msgstr "Mantener" msgid "Keyboard" msgstr "Teclado" -msgid "Korean" -msgstr "Coreano" - msgid "Language File" msgstr "Idiomas" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Ruta de idioma cambiada." -msgid "Left" -msgstr "Izquierda" - -msgid "Like SysMenu" -msgstr "Como Menú Sist." - msgid "Load" msgstr "Cargar" -msgid "Load From SD/USB" -msgstr "Cargar desde SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "¿Cargar el archivo desde: %s ?" @@ -752,6 +651,9 @@ msgstr "¿Cargar el archivo desde: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "¿Cargar este DOL como DOL Alternativo?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Cargando idioma estándar." @@ -761,17 +663,8 @@ msgstr "Cargando música estándar." msgid "Lock Console" msgstr "Bloquear consola" -msgid "Locked" -msgstr "Bloqueada" - -msgid "Loop Directory" -msgstr "Carpeta de bucle" - -msgid "Loop Music" -msgstr "Bucle musical" - -msgid "Loop Sound" -msgstr "Bucle de sonido" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "" @@ -794,15 +687,12 @@ msgstr "Modo Bucle Musical" msgid "Music Volume" msgstr "Volumen de la Música" -msgid "Neither" -msgstr "Ninguno" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Nuevo Disco Detectado" -msgid "Next" -msgstr "Siguiente" - msgid "No" msgstr "" @@ -839,12 +729,6 @@ msgstr "No hay nuevas actualizaciones." msgid "No themes found on the site." msgstr "No hay Temas en este sitio." -msgid "None" -msgstr "Ninguno" - -msgid "Normal" -msgstr "" - msgid "Not a WAD file." msgstr "No es un archivo WAD." @@ -884,9 +768,6 @@ msgstr "Apagado" msgid "OK" msgstr "Aceptar" -msgid "ON" -msgstr "Encendido" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Página Oficial:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Sólo Artísticas" - -msgid "Only Original" -msgstr "Sólo Originales" - -msgid "Only for Install" -msgstr "Sólo al instalar" - -msgid "Original/Customs" -msgstr "Originales/Artísticas" - msgid "Parental Control" msgstr "Control Parental" -msgid "Parental Control disabled" -msgstr "Control Parental desactivado" - msgid "Partition" msgstr "Partición" @@ -947,9 +813,6 @@ msgstr "Partidas" msgid "Play Next" msgstr "Oír Siguiente" -msgid "Play Once" -msgstr "Oir una vez" - msgid "Play Previous" msgstr "Oír Anterior" @@ -962,9 +825,6 @@ msgstr "Por favor, espera..." msgid "Power off the Wii" msgstr "Apagar la Wii" -msgid "Prev" -msgstr "Ant." - msgid "Prompts Buttons" msgstr "Botones" @@ -974,9 +834,6 @@ msgstr "Publicado por" msgid "Quick Boot" msgstr "Inicio Rápido" -msgid "Random Directory Music" -msgstr "Aleatorio de la carpeta musical" - msgid "Reading WAD data... Ok!" msgstr "Leyendo datos del WAD... ¡Correcto!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Volver a Menú Wii" -msgid "Right" -msgstr "Derecha" - msgid "Rumble" msgstr "Vibración" -msgid "SChinese" -msgstr "Chino S." - msgid "SFX Volume" msgstr "Volumen de los Efectos" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Seleccionar DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "" @@ -1085,15 +933,6 @@ msgstr "Sonido" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Sonido+Música Fondo" - -msgid "Sound+Quiet" -msgstr "Sonido+Silencio" - -msgid "Spanish" -msgstr "Español" - msgid "Special thanks to:" msgstr "Agradecimientos especiales a:" @@ -1121,24 +960,18 @@ msgstr "Tema extraido correctamente." msgid "Successfully installed:" msgstr "Instalado correctamente:" -msgid "System Default" -msgstr "Pred. Sistema" - -msgid "TChinese" -msgstr "Chino T." - msgid "TXT Cheatcodes Path" msgstr "Ruta de Trucos TXT" msgid "The entered directory does not exist. Would you like to create it?" msgstr "La carpeta especificada no existe. ¿Quieres crearla?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "El archivo WAD se ha instalado. Pero no puede ser borrado de la tarjeta SD." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "La instalación del WAD falló con el error %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Ruta Descarga Temas" @@ -1152,6 +985,9 @@ msgstr "Ruta del Tema" msgid "Theme Title:" msgstr "Título del Tema:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Error en la transferencia." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB no encontrado" msgid "USB Loader GX is protected" msgstr "USB Loader GX está protegido" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "No se puede abrir el WAD que acabas de descargar (%s)." - msgid "Uninstall" msgstr "Desinstalar" @@ -1201,15 +1039,12 @@ msgstr "Desinstalando el WAD" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Desbloquear Control Parental" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Desbloquea la consola para usar esta opción." -msgid "Unlocked" -msgstr "Desbloqueada" - msgid "Unsupported format, try to extract manually." msgstr "Formato no soportado, prueba a extraer manualmente." @@ -1234,21 +1069,12 @@ msgstr "Actualizar todos los archivos de Idiomas" msgid "Update failed" msgstr "Error en la Actualización" -msgid "Update to" -msgstr "Descargando la" - -msgid "Updating" -msgstr "Actualizando" - -msgid "Updating Language Files..." -msgstr "Actualizando archivos de Idiomas..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Actualizando archivos de Idiomas:" -msgid "Updating WiiTDB.zip" -msgstr "Actualizando WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Enviado archivo ZIP instalado en la carpeta homebrew." @@ -1280,9 +1106,6 @@ msgstr "¿Qué quieres actualizar?" msgid "WiFi Features" msgstr "Características WiFi" -msgid "Widescreen Fix" -msgstr "Ajuste panorámico" - msgid "Wii Menu" msgstr "Menú de Wii" @@ -1310,9 +1133,6 @@ msgstr "Sí" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "No tienes el Control Parental activado. Si quieres usar el Control Parental, actívalo en la Configuración de la Wii." - msgid "You need to select or format a partition" msgstr "Necesitas seleccionar o formatear una partición" @@ -1377,6 +1197,219 @@ msgstr "de" msgid "seconds left" msgstr "segundos restantes" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Instalar Copias 1:1" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Todos)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Niños 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 hora" + +#~ msgid "10 min" +#~ msgstr "10 min." + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Adolescentes 12+)" + +#~ msgid "20 min" +#~ msgstr "20 min." + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Jóvenes 16+)" + +#~ msgid "3 min" +#~ msgstr "3 min." + +#~ msgid "30 min" +#~ msgstr "30 min." + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Sólo Adultos 18+)" + +#~ msgid "5 min" +#~ msgstr "5 min." + +#~ msgid "An Error occured" +#~ msgstr "Ocurrió un Error" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "¿Estás seguro de querer activar el Control Parental?" + +#~ msgid "AutoPatch" +#~ msgstr "AutoParchear" + +#~ msgid "Both" +#~ msgstr "Ambos" + +#~ msgid "Checking for Updates" +#~ msgstr "Comprobando actualizaciones" + +#~ msgid "Console Default" +#~ msgstr "Pred. Consola" + +#~ msgid "Customs/Original" +#~ msgstr "Artísticas/Originales" + +#~ msgid "Disc Default" +#~ msgstr "Pred. Disco" + +#~ msgid "DiskFlip" +#~ msgstr "GiraDiscos" + +#~ msgid "Downloading" +#~ msgstr "Descargando" + +#~ msgid "Dutch" +#~ msgstr "Holandés" + +#~ msgid "English" +#~ msgstr "Inglés" + +#~ msgid "French" +#~ msgstr "Francés" + +#~ msgid "GAMEID_Gamename" +#~ msgstr "IDdelJuego_NombreDelJuego" + +#~ msgid "Game ID" +#~ msgstr "ID del Juego" + +#~ msgid "Game Region" +#~ msgstr "Región" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "NombreDelJuego [IDdelJuego]" + +#~ msgid "German" +#~ msgstr "Alemán" + +#~ msgid "Invalid PIN code" +#~ msgstr "Código PIN erróneo" + +#~ msgid "Italian" +#~ msgstr "Italiano" + +#~ msgid "Japanese" +#~ msgstr "Japonés" + +#~ msgid "Korean" +#~ msgstr "Coreano" + +#~ msgid "Left" +#~ msgstr "Izquierda" + +#~ msgid "Like SysMenu" +#~ msgstr "Como Menú Sist." + +#~ msgid "Load From SD/USB" +#~ msgstr "Cargar desde SD/USB" + +#~ msgid "Locked" +#~ msgstr "Bloqueada" + +#~ msgid "Loop Directory" +#~ msgstr "Carpeta de bucle" + +#~ msgid "Loop Music" +#~ msgstr "Bucle musical" + +#~ msgid "Loop Sound" +#~ msgstr "Bucle de sonido" + +#~ msgid "Neither" +#~ msgstr "Ninguno" + +#~ msgid "Next" +#~ msgstr "Siguiente" + +#~ msgid "None" +#~ msgstr "Ninguno" + +#~ msgid "ON" +#~ msgstr "Encendido" + +#~ msgid "Only Customs" +#~ msgstr "Sólo Artísticas" + +#~ msgid "Only Original" +#~ msgstr "Sólo Originales" + +#~ msgid "Only for Install" +#~ msgstr "Sólo al instalar" + +#~ msgid "Original/Customs" +#~ msgstr "Originales/Artísticas" + +#~ msgid "Parental Control disabled" +#~ msgstr "Control Parental desactivado" + +#~ msgid "Play Once" +#~ msgstr "Oir una vez" + +#~ msgid "Prev" +#~ msgstr "Ant." + +#~ msgid "Random Directory Music" +#~ msgstr "Aleatorio de la carpeta musical" + +#~ msgid "Right" +#~ msgstr "Derecha" + +#~ msgid "SChinese" +#~ msgstr "Chino S." + +#~ msgid "Sound+BGM" +#~ msgstr "Sonido+Música Fondo" + +#~ msgid "Sound+Quiet" +#~ msgstr "Sonido+Silencio" + +#~ msgid "Spanish" +#~ msgstr "Español" + +#~ msgid "System Default" +#~ msgstr "Pred. Sistema" + +#~ msgid "TChinese" +#~ msgstr "Chino T." + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "El archivo WAD se ha instalado. Pero no puede ser borrado de la tarjeta SD." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "La instalación del WAD falló con el error %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "No se puede abrir el WAD que acabas de descargar (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Desbloquear Control Parental" + +#~ msgid "Unlocked" +#~ msgstr "Desbloqueada" + +#~ msgid "Update to" +#~ msgstr "Descargando la" + +#~ msgid "Updating" +#~ msgstr "Actualizando" + +#~ msgid "Updating Language Files..." +#~ msgstr "Actualizando archivos de Idiomas..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Actualizando WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Ajuste panorámico" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "No tienes el Control Parental activado. Si quieres usar el Control Parental, actívalo en la Configuración de la Wii." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s No puede arrancar correctamente si el Menú de Sistema no está actualizado." diff --git a/Languages/swedish.lang b/Languages/swedish.lang index 703457fc..3af57706 100644 --- a/Languages/swedish.lang +++ b/Languages/swedish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2010-01-19 17:39+0200\n" "Last-Translator: Katsurou\n" "Language-Team: Katsurou, pirateX\n" @@ -25,54 +25,15 @@ msgstr "har sparats. Texten har inte blivit varifierad. Några av koderna kanske msgid " is not on the server." msgstr "finns inte på servern." -msgid "0 (Everyone)" -msgstr "0 (Alla)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Barn 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 timme" - -msgid "10 min" -msgstr "" - -msgid "2 (Teen 12+)" -msgstr "2 (Tonåringar 12+)" - -msgid "20 min" -msgstr "" - msgid "2D Cover Path" msgstr "2D Omslagsmapp" -msgid "3 (Mature 16+)" -msgstr "3 (Ungdomar 16+)" - -msgid "3 min" -msgstr "" - -msgid "30 min" -msgstr "" - msgid "3D Cover Path" msgstr "3D Omslagsmapp" msgid "3D Covers" msgstr "3D-Omslag" -msgid "4 (Adults Only 18+)" -msgstr "4 (Endast Vuxna 18+)" - -msgid "5 min" -msgstr "" - msgid ">> Deleting tickets..." msgstr ">> Raderar biljetter..." @@ -136,20 +97,14 @@ msgstr "Alla funktioner i USB Loader GX är upplåsta." msgid "Alternate DOL" msgstr "Alternativ DOL" -msgid "An Error occured" -msgstr "Ett fel har uppstått" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Programspråk" msgid "Apr" msgstr "Apr" -msgid "Are you sure you want to enable Parent Control?" -msgstr "Är du säker på att du vill aktivera Föräldrakontroll?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "Utgivare:" msgid "AutoInit Network" msgstr "Autoinitiera Nätverk" -msgid "AutoPatch" -msgstr "Autopatch" - msgid "BCA Codes Path" msgstr "BCA kodssökväg" @@ -199,9 +151,6 @@ msgstr "Boot/Standard" msgid "Boot?" msgstr "Starta?" -msgid "Both" -msgstr "Båda" - msgid "Can't be formatted" msgstr "Kan inte formateras" @@ -226,9 +175,6 @@ msgstr "Ändra spel sökväg" msgid "Cheatfile is blank" msgstr "Fuskfilen är blank" -msgid "Checking for Updates" -msgstr "Letar efter uppdateringar" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "Uppkoppling förlorad..." msgid "Console" msgstr "Konsol" -msgid "Console Default" -msgstr "Konsolestandard" - msgid "Console Locked" msgstr "Konsol låst" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "Kunde inte skapa GCT fil" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Medverkande" msgid "Custom Paths" msgstr "Anpassade sökvägar" -msgid "Customs/Original" -msgstr "Anpassade/Original" - msgid "DOL Path" msgstr "DOL-sökväg" @@ -365,15 +309,9 @@ msgstr "Skivbildsnedladdning" msgid "Disc Artwork Path" msgstr "Skivbildsmapp" -msgid "Disc Default" -msgstr "Skivans standard" - msgid "Disc Images" msgstr "Skivbilder" -msgid "DiskFlip" -msgstr "Vänd Skiva" - msgid "Display" msgstr "Visning" @@ -404,6 +342,9 @@ msgstr "Vill du ladda ner detta tema?" msgid "Do you want to format:" msgstr "Vill du formatera:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Vill du använda en alternativ DOL som är känd att fungera?" @@ -434,26 +375,26 @@ msgstr "Nedladdning klar" msgid "Download request failed." msgstr "Nedladdnings begäran misslyckades." -msgid "Downloading" -msgstr "Laddar ner" - msgid "Downloading Page List:" msgstr "Laddar ner lista:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Laddar ner fil:" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "Laddar ner bild:" -msgid "Dutch" -msgstr "Nederländska" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "FEL" @@ -464,9 +405,6 @@ msgstr "FEL:" msgid "ERROR: Can't set up theme." msgstr "FEL: Kan inte ställa in tema" -msgid "English" -msgstr "Engelska" - msgid "Error" msgstr "Fel" @@ -476,15 +414,24 @@ msgstr "Fel!" msgid "Error 002 fix" msgstr "002 fel fix" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Fel vid läsning av skiva" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Fel vid överförning av data." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Uppackning misslyckades." msgid "Failed to open partition" msgstr "Misslyckades att öppna partition" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Vänd-X" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Formatera" @@ -545,15 +486,9 @@ msgstr "Formaterar, Vänta..." msgid "Free Space" msgstr "Ledigt utrymme" -msgid "French" -msgstr "Franska" - msgid "Full Shutdown" msgstr "Stäng av helt" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "Fusksökväg" @@ -566,9 +501,6 @@ msgstr "GUI inställningar" msgid "GXtheme.cfg not found in any subfolder." msgstr "GXtheme.cfg kunde inte hittas i några undermappar." -msgid "Game ID" -msgstr "Spel-ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Spelinställningar" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Spelregion" - msgid "Game Size" msgstr "Spelstorlek" @@ -599,18 +528,12 @@ msgstr "Spelet är redan installerat:" msgid "Game partition" msgstr "Spel partition" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Spel" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Tyska" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Sätt i ett SD-kort för att använda denna inställning" msgid "Install" msgstr "Installera" -msgid "Install 1:1 Copy" -msgstr "Installera 1:1 Kopia" - msgid "Install Error!" msgstr "Fel vid installering!" @@ -691,21 +611,12 @@ msgstr "Installerar titel... Ok!" msgid "Installing wad" msgstr "Installerar wad" -msgid "Invalid PIN code" -msgstr "Ogiltig PIN-kod" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "Det verkar som om du har information som kan vara till nytta för oss. Vänligen skicka informationen vidare till DEV team." -msgid "Italian" -msgstr "Italienska" - msgid "Jan" msgstr "" -msgid "Japanese" -msgstr "Japanska" - msgid "July" msgstr "Juli" @@ -718,9 +629,6 @@ msgstr "Behåll" msgid "Keyboard" msgstr "Tangentbord" -msgid "Korean" -msgstr "Koreanska" - msgid "Language File" msgstr "Språk fil" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Sökväg till språk ändrad" -msgid "Left" -msgstr "Vänster" - -msgid "Like SysMenu" -msgstr "Som System-menyn" - msgid "Load" msgstr "Ladda" -msgid "Load From SD/USB" -msgstr "Ladda från SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "Ladda fil från: %s?" @@ -752,6 +651,9 @@ msgstr "Ladda fil från: %s?" msgid "Load this DOL as alternate DOL?" msgstr "Ladda denna DOL som alternativ DOL?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Laddar standard språk." @@ -761,18 +663,9 @@ msgstr "Laddar standard musik." msgid "Lock Console" msgstr "Lås konsol" -msgid "Locked" -msgstr "Låst" - -msgid "Loop Directory" +msgid "Lock USB Loader GX" msgstr "" -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" -msgstr "Loopa ljudet" - msgid "Mar" msgstr "" @@ -794,15 +687,12 @@ msgstr "Musik Återuppspelningsläge" msgid "Music Volume" msgstr "Volym" -msgid "Neither" -msgstr "Inget" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Ny skiva upptäckt" -msgid "Next" -msgstr "Nästa" - msgid "No" msgstr "Nej" @@ -839,12 +729,6 @@ msgstr "Inga nya uppdateringar" msgid "No themes found on the site." msgstr "Inga teman hittades på sidan." -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "Vanlig" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "AV" msgid "OK" msgstr "" -msgid "ON" -msgstr "PÅ" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Officiell sida:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Endast anpassade" - -msgid "Only Original" -msgstr "Endast original" - -msgid "Only for Install" -msgstr "Endast för installering" - -msgid "Original/Customs" -msgstr "Original/Anpassade" - msgid "Parental Control" msgstr "Föräldrakontroll" -msgid "Parental Control disabled" -msgstr "Föräldrakontroll avaktiverad" - msgid "Partition" msgstr "" @@ -947,9 +813,6 @@ msgstr "Spelat" msgid "Play Next" msgstr "Spela nästa" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "Spela förgående" @@ -962,9 +825,6 @@ msgstr "Vänligen vänta..." msgid "Power off the Wii" msgstr "Stäng av Wii" -msgid "Prev" -msgstr "Förra" - msgid "Prompts Buttons" msgstr "Dialogknappar" @@ -974,9 +834,6 @@ msgstr "Publicerat av" msgid "Quick Boot" msgstr "Snabbstart" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "Läser WAD data... Ok!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Återvänd till Wii-menyn" -msgid "Right" -msgstr "Höger" - msgid "Rumble" msgstr "Vibration" -msgid "SChinese" -msgstr "SKinesiska" - msgid "SFX Volume" msgstr "SFX Volym" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Välj en DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "" @@ -1085,15 +933,6 @@ msgstr "Ljud" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Ljud+BGM" - -msgid "Sound+Quiet" -msgstr "Ljud+Tyst" - -msgid "Spanish" -msgstr "Spanska" - msgid "Special thanks to:" msgstr "Speciellt tack till:" @@ -1121,24 +960,18 @@ msgstr "Extrahering av tema lyckades." msgid "Successfully installed:" msgstr "Lyckad installation av:" -msgid "System Default" -msgstr "Systemets standard" - -msgid "TChinese" -msgstr "TKinesiska" - msgid "TXT Cheatcodes Path" msgstr "Sökväg till txt koder" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Den angivna katalogen existerar inte. Vill du skapa den?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "Wad filen har blivit installerad. Men kunde inte raderas från SD-kortet." +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "Wad installation misslyckades med fel %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Tema-mapp nedladdade" @@ -1152,6 +985,9 @@ msgstr "Tema-mapp" msgid "Theme Title:" msgstr "Tema titel:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Flytt misslyckades." +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB-enhet ej hittad" msgid "USB Loader GX is protected" msgstr "USB Loader GX är skyddad" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Kunde inte öppna den nedladdade wad filen (%s)." - msgid "Uninstall" msgstr "Avinstallera" @@ -1201,15 +1039,12 @@ msgstr "Avinstallerar wad" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "Lås upp föräldrakontroll" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "Lås upp konsolen för denna inställning." -msgid "Unlocked" -msgstr "Upplåst" - msgid "Unsupported format, try to extract manually." msgstr "Format stöds inte, försök extrahera manuelt." @@ -1234,21 +1069,12 @@ msgstr "Uppdatera alla språk-filer" msgid "Update failed" msgstr "Uppdatering misslyckades" -msgid "Update to" -msgstr "Uppdatera till" - -msgid "Updating" -msgstr "Uppdaterar" - -msgid "Updating Language Files..." -msgstr "Uppdatera språk-filer..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Uppdatera språk-filer:" -msgid "Updating WiiTDB.zip" -msgstr "Uppdaterar WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "Uppladdad ZIP fil installerad till homebrew-mappen" @@ -1280,9 +1106,6 @@ msgstr "Vad vill du uppdatera?" msgid "WiFi Features" msgstr "WiFi funktioner" -msgid "Widescreen Fix" -msgstr "Bredbild 16/9 Fix" - msgid "Wii Menu" msgstr "Wii-meny" @@ -1310,9 +1133,6 @@ msgstr "Ja" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "Du har inte föräldrakontroll aktiverad. Om du vill använda föräldrakontroll, aktivera det i Wii inställningar." - msgid "You need to select or format a partition" msgstr "Du måste välja eller formatera en partition" @@ -1377,6 +1197,186 @@ msgstr "av" msgid "seconds left" msgstr "sekunder kvar" +#~ msgid "Install 1:1 Copy" +#~ msgstr "Installera 1:1 Kopia" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Alla)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Barn 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 timme" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Tonåringar 12+)" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Ungdomar 16+)" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Endast Vuxna 18+)" + +#~ msgid "An Error occured" +#~ msgstr "Ett fel har uppstått" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "Är du säker på att du vill aktivera Föräldrakontroll?" + +#~ msgid "AutoPatch" +#~ msgstr "Autopatch" + +#~ msgid "Both" +#~ msgstr "Båda" + +#~ msgid "Checking for Updates" +#~ msgstr "Letar efter uppdateringar" + +#~ msgid "Console Default" +#~ msgstr "Konsolestandard" + +#~ msgid "Customs/Original" +#~ msgstr "Anpassade/Original" + +#~ msgid "Disc Default" +#~ msgstr "Skivans standard" + +#~ msgid "DiskFlip" +#~ msgstr "Vänd Skiva" + +#~ msgid "Downloading" +#~ msgstr "Laddar ner" + +#~ msgid "Dutch" +#~ msgstr "Nederländska" + +#~ msgid "English" +#~ msgstr "Engelska" + +#~ msgid "French" +#~ msgstr "Franska" + +#~ msgid "Game ID" +#~ msgstr "Spel-ID" + +#~ msgid "Game Region" +#~ msgstr "Spelregion" + +#~ msgid "German" +#~ msgstr "Tyska" + +#~ msgid "Invalid PIN code" +#~ msgstr "Ogiltig PIN-kod" + +#~ msgid "Italian" +#~ msgstr "Italienska" + +#~ msgid "Japanese" +#~ msgstr "Japanska" + +#~ msgid "Korean" +#~ msgstr "Koreanska" + +#~ msgid "Left" +#~ msgstr "Vänster" + +#~ msgid "Like SysMenu" +#~ msgstr "Som System-menyn" + +#~ msgid "Load From SD/USB" +#~ msgstr "Ladda från SD/USB" + +#~ msgid "Locked" +#~ msgstr "Låst" + +#~ msgid "Loop Sound" +#~ msgstr "Loopa ljudet" + +#~ msgid "Neither" +#~ msgstr "Inget" + +#~ msgid "Next" +#~ msgstr "Nästa" + +#~ msgid "Normal" +#~ msgstr "Vanlig" + +#~ msgid "ON" +#~ msgstr "PÅ" + +#~ msgid "Only Customs" +#~ msgstr "Endast anpassade" + +#~ msgid "Only Original" +#~ msgstr "Endast original" + +#~ msgid "Only for Install" +#~ msgstr "Endast för installering" + +#~ msgid "Original/Customs" +#~ msgstr "Original/Anpassade" + +#~ msgid "Parental Control disabled" +#~ msgstr "Föräldrakontroll avaktiverad" + +#~ msgid "Prev" +#~ msgstr "Förra" + +#~ msgid "Right" +#~ msgstr "Höger" + +#~ msgid "SChinese" +#~ msgstr "SKinesiska" + +#~ msgid "Sound+BGM" +#~ msgstr "Ljud+BGM" + +#~ msgid "Sound+Quiet" +#~ msgstr "Ljud+Tyst" + +#~ msgid "Spanish" +#~ msgstr "Spanska" + +#~ msgid "System Default" +#~ msgstr "Systemets standard" + +#~ msgid "TChinese" +#~ msgstr "TKinesiska" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "Wad filen har blivit installerad. Men kunde inte raderas från SD-kortet." + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "Wad installation misslyckades med fel %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Kunde inte öppna den nedladdade wad filen (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "Lås upp föräldrakontroll" + +#~ msgid "Unlocked" +#~ msgstr "Upplåst" + +#~ msgid "Update to" +#~ msgstr "Uppdatera till" + +#~ msgid "Updating" +#~ msgstr "Uppdaterar" + +#~ msgid "Updating Language Files..." +#~ msgstr "Uppdatera språk-filer..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "Uppdaterar WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "Bredbild 16/9 Fix" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "Du har inte föräldrakontroll aktiverad. Om du vill använda föräldrakontroll, aktivera det i Wii inställningar." + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s Kanske inte kan starta korrekt om din system meny inte är den nyaste versionen." diff --git a/Languages/tchinese.lang b/Languages/tchinese.lang index 50079af8..1a7e089c 100644 --- a/Languages/tchinese.lang +++ b/Languages/tchinese.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2010-02-15 21:00+0800\n" "Last-Translator: Jane.H\n" "Language-Team: kyogc, Miller, Mika Li, Jane.H\n" @@ -25,54 +25,15 @@ msgstr "已經被儲存.內容尚未驗證.部分代碼可能無法作用.如果 msgid " is not on the server." msgstr "不在伺服器上" -msgid "0 (Everyone)" -msgstr "0 (全年齡)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (7歲以上)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 小時" - -msgid "10 min" -msgstr "10 分鐘" - -msgid "2 (Teen 12+)" -msgstr "2 (12歲以上)" - -msgid "20 min" -msgstr "20 分鐘" - msgid "2D Cover Path" msgstr "2D封面路徑" -msgid "3 (Mature 16+)" -msgstr "3 (16歲以上)" - -msgid "3 min" -msgstr "3 分鐘" - -msgid "30 min" -msgstr "30 分鐘" - msgid "3D Cover Path" msgstr "3D封面路徑" msgid "3D Covers" msgstr "3D 封面" -msgid "4 (Adults Only 18+)" -msgstr "4 (18歲以上成人)" - -msgid "5 min" -msgstr "5 分鐘" - msgid ">> Deleting tickets..." msgstr ">> 刪除 tickets..." @@ -136,20 +97,14 @@ msgstr "USB Loader GX 功能已解鎖." msgid "Alternate DOL" msgstr "可選擇Alt DOL文件" -msgid "An Error occured" -msgstr "發生一個錯誤" - -msgid "Anti" -msgstr "防止" - msgid "App Language" msgstr "語言設定" msgid "Apr" msgstr "四月" -msgid "Are you sure you want to enable Parent Control?" -msgstr "您確定要啟用家長控制?" +msgid "Are you sure you want to lock USB Loader GX?" +msgstr "" msgid "Are you sure you want to reset?" msgstr "" @@ -166,9 +121,6 @@ msgstr "作者" msgid "AutoInit Network" msgstr "自動檢查網路" -msgid "AutoPatch" -msgstr "自動修改" - msgid "BCA Codes Path" msgstr "BAC 路徑" @@ -199,9 +151,6 @@ msgstr "啟動/標準" msgid "Boot?" msgstr "啟動?" -msgid "Both" -msgstr "全部" - msgid "Can't be formatted" msgstr "無法格式化" @@ -226,9 +175,6 @@ msgstr "變更路徑" msgid "Cheatfile is blank" msgstr "金手指文件是空的" -msgid "Checking for Updates" -msgstr "檢查軟件最新版本" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "遺失連接..." msgid "Console" msgstr "控制台" -msgid "Console Default" -msgstr "主機預設值" - msgid "Console Locked" msgstr "控制台已鎖定" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "無法建立 GCT 文件" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "作者信息" msgid "Custom Paths" msgstr "自定路徑" -msgid "Customs/Original" -msgstr "自製/原始" - msgid "DOL Path" msgstr "DOL 路徑" @@ -365,15 +309,9 @@ msgstr "下載光碟圖像" msgid "Disc Artwork Path" msgstr "光碟圖像路徑" -msgid "Disc Default" -msgstr "光碟預設" - msgid "Disc Images" msgstr "光碟圖像" -msgid "DiskFlip" -msgstr "光碟滑動" - msgid "Display" msgstr "顯示" @@ -404,6 +342,9 @@ msgstr "是否要下載這個佈景主題?" msgid "Do you want to format:" msgstr "是否格式化:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "使用這個已知是正確的 Alt DOL 文件?" @@ -434,26 +375,26 @@ msgstr "下載完成" msgid "Download request failed." msgstr "下載請求失敗" -msgid "Downloading" -msgstr "正在下載" - msgid "Downloading Page List:" msgstr "下載主題預覽圖片" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "檔案下載中" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "下載圖片" -msgid "Dutch" -msgstr "荷蘭文" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "錯誤" @@ -464,9 +405,6 @@ msgstr "錯誤:" msgid "ERROR: Can't set up theme." msgstr "錯誤:無法設定佈景主題" -msgid "English" -msgstr "英文" - msgid "Error" msgstr "錯誤" @@ -476,15 +414,24 @@ msgstr "錯誤 !" msgid "Error 002 fix" msgstr "修正002錯誤" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "讀取光碟錯誤" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "檔案傳輸過程錯誤" +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "提取失敗" msgid "Failed to open partition" msgstr "磁區開啟失敗" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "二月" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "按鍵規則" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "格式化" @@ -545,15 +486,9 @@ msgstr "格式化中, 請稍候..." msgid "Free Space" msgstr "剩餘空間" -msgid "French" -msgstr "法文" - msgid "Full Shutdown" msgstr "關機" -msgid "GAMEID_Gamename" -msgstr "GAMEID_遊戲名稱" - msgid "GCT Cheatcodes Path" msgstr "金手指檔案路徑" @@ -566,9 +501,6 @@ msgstr "介面設定" msgid "GXtheme.cfg not found in any subfolder." msgstr "無法在任何子目錄找到 GXtheme.cfg 檔案" -msgid "Game ID" -msgstr "遊戲 ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "遊戲載入設定" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "遊戲區碼" - msgid "Game Size" msgstr "遊戲容量" @@ -599,18 +528,12 @@ msgstr "已安裝過遊戲:" msgid "Game partition" msgstr "遊戲磁區" -msgid "Gamename [GAMEID]" -msgstr "遊戲名稱 [GAMEID]" - msgid "Games" msgstr "遊戲數量" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "德文" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "插入 SD 卡使用此功能." msgid "Install" msgstr "安裝" -msgid "Install 1:1 Copy" -msgstr "安裝用 1:1 複製" - msgid "Install Error!" msgstr "安裝錯誤!" @@ -691,21 +611,12 @@ msgstr "安裝 title... 完成!" msgid "Installing wad" msgstr "安裝 WAD" -msgid "Invalid PIN code" -msgstr "無效的 PIN 碼" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "請將這些訊息傳送至開發小組以幫助本軟體開發" -msgid "Italian" -msgstr "意大利文" - msgid "Jan" msgstr "一月" -msgid "Japanese" -msgstr "日文" - msgid "July" msgstr "七月" @@ -718,9 +629,6 @@ msgstr "保留" msgid "Keyboard" msgstr "鍵盤" -msgid "Korean" -msgstr "韓文" - msgid "Language File" msgstr "語言檔案" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "語言路徑已變更" -msgid "Left" -msgstr "左" - -msgid "Like SysMenu" -msgstr "同系統選單" - msgid "Load" msgstr "載入" -msgid "Load From SD/USB" -msgstr "從 SD/USB 載入" - #, c-format msgid "Load file from: %s ?" msgstr "檔案載入位置: %s" @@ -752,6 +651,9 @@ msgstr "檔案載入位置: %s" msgid "Load this DOL as alternate DOL?" msgstr "載入這個 DOL 作為替代 DOL?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "正在載入預設語言" @@ -761,17 +663,8 @@ msgstr "正在載入預設音樂" msgid "Lock Console" msgstr "鎖定控制台" -msgid "Locked" -msgstr "已鎖定" - -msgid "Loop Directory" -msgstr "重複路徑" - -msgid "Loop Music" -msgstr "重複音樂" - -msgid "Loop Sound" -msgstr "重複音樂" +msgid "Lock USB Loader GX" +msgstr "" msgid "Mar" msgstr "三月" @@ -794,15 +687,12 @@ msgstr "音樂循環模式" msgid "Music Volume" msgstr "音量" -msgid "Neither" -msgstr "皆不顯示" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "新光碟已檢查" -msgid "Next" -msgstr "往後" - msgid "No" msgstr "否" @@ -839,12 +729,6 @@ msgstr "沒有可用更新" msgid "No themes found on the site." msgstr "在網站上找不到主題" -msgid "None" -msgstr "沒有" - -msgid "Normal" -msgstr "一般" - msgid "Not a WAD file." msgstr "不是 WAD 文件." @@ -884,9 +768,6 @@ msgstr "關閉" msgid "OK" msgstr "確定" -msgid "ON" -msgstr "開啟" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "官方網址:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "只顯示自製" - -msgid "Only Original" -msgstr "只顯示原始" - -msgid "Only for Install" -msgstr "安裝遊戲時" - -msgid "Original/Customs" -msgstr "原始/自製" - msgid "Parental Control" msgstr "親子控制" -msgid "Parental Control disabled" -msgstr "關閉親子控制" - msgid "Partition" msgstr "磁區" @@ -947,9 +813,6 @@ msgstr "執行次數" msgid "Play Next" msgstr "執行下一個" -msgid "Play Once" -msgstr "播放一次" - msgid "Play Previous" msgstr "執行上一個" @@ -962,9 +825,6 @@ msgstr "請稍候..." msgid "Power off the Wii" msgstr "關閉 Wii 主機" -msgid "Prev" -msgstr "往前" - msgid "Prompts Buttons" msgstr "顯示校正" @@ -974,9 +834,6 @@ msgstr "發布者" msgid "Quick Boot" msgstr "快速啟動" -msgid "Random Directory Music" -msgstr "隨機選取音樂" - msgid "Reading WAD data... Ok!" msgstr "讀取 WAD 數據... 完成!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "返回 Wii 主目錄" -msgid "Right" -msgstr "右" - msgid "Rumble" msgstr "震動" -msgid "SChinese" -msgstr "簡體中文" - msgid "SFX Volume" msgstr "音效音量" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "選擇一個 DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "九月" @@ -1085,15 +933,6 @@ msgstr "音效設定" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "音樂+音效" - -msgid "Sound+Quiet" -msgstr "音樂+靜音" - -msgid "Spanish" -msgstr "西班牙文" - msgid "Special thanks to:" msgstr "特別感謝" @@ -1121,24 +960,18 @@ msgstr "成功獲取主題." msgid "Successfully installed:" msgstr "成功安裝:" -msgid "System Default" -msgstr "系統預設值" - -msgid "TChinese" -msgstr "繁體中文" - msgid "TXT Cheatcodes Path" msgstr "TXT 金手指文件路徑" msgid "The entered directory does not exist. Would you like to create it?" msgstr "已進入的目錄不存在。你想要創建一個目錄嗎?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "WAD 已安裝,但文件無法從 SD 卡中刪除。" +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "WAD 安裝失敗,錯誤號 %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "佈景主題下載路徑" @@ -1152,6 +985,9 @@ msgstr "佈景主題路徑" msgid "Theme Title:" msgstr "佈景主題標題" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "傳輸失敗" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "找不到 USB 設備" msgid "USB Loader GX is protected" msgstr "USB Loader GX 被鎖定" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "不能打開剛下載的 WAD 文件 (%s)." - msgid "Uninstall" msgstr "移除" @@ -1201,15 +1039,12 @@ msgstr "移除 WAD" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" -msgstr "解鎖家長控制" +msgid "Unlock USB Loader GX" +msgstr "" msgid "Unlock console to use this option." msgstr "解鎖以進行設定" -msgid "Unlocked" -msgstr "已解鎖" - msgid "Unsupported format, try to extract manually." msgstr "不支援的格式,嘗試手動提取。" @@ -1234,21 +1069,12 @@ msgstr "更新所有語言檔案" msgid "Update failed" msgstr "更新失敗" -msgid "Update to" -msgstr "升級至" - -msgid "Updating" -msgstr "正在更新" - -msgid "Updating Language Files..." -msgstr "正在更新語言檔案..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "正在更新語言檔案:" -msgid "Updating WiiTDB.zip" -msgstr "正在更新 WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "已更新安裝在Homebrew目錄的ZIP檔案" @@ -1280,9 +1106,6 @@ msgstr "更新何者?" msgid "WiFi Features" msgstr "WiFi功能設定" -msgid "Widescreen Fix" -msgstr "寬螢幕校正" - msgid "Wii Menu" msgstr "Wii系統選單" @@ -1310,9 +1133,6 @@ msgstr "是" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "家長控制已鎖定。如果要解除 Wii 被鎖住的功能,您必須要先至控制台解除家長控制。" - msgid "You need to select or format a partition" msgstr "選擇你要格式化的磁區" @@ -1377,6 +1197,225 @@ msgstr "的" msgid "seconds left" msgstr "剩餘秒數" +#~ msgid "Install 1:1 Copy" +#~ msgstr "安裝用 1:1 複製" + +#~ msgid "0 (Everyone)" +#~ msgstr "0 (全年齡)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (7歲以上)" + +#~ msgid "1 hour" +#~ msgstr "1 小時" + +#~ msgid "10 min" +#~ msgstr "10 分鐘" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (12歲以上)" + +#~ msgid "20 min" +#~ msgstr "20 分鐘" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (16歲以上)" + +#~ msgid "3 min" +#~ msgstr "3 分鐘" + +#~ msgid "30 min" +#~ msgstr "30 分鐘" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (18歲以上成人)" + +#~ msgid "5 min" +#~ msgstr "5 分鐘" + +#~ msgid "An Error occured" +#~ msgstr "發生一個錯誤" + +#~ msgid "Anti" +#~ msgstr "防止" + +#~ msgid "Are you sure you want to enable Parent Control?" +#~ msgstr "您確定要啟用家長控制?" + +#~ msgid "AutoPatch" +#~ msgstr "自動修改" + +#~ msgid "Both" +#~ msgstr "全部" + +#~ msgid "Checking for Updates" +#~ msgstr "檢查軟件最新版本" + +#~ msgid "Console Default" +#~ msgstr "主機預設值" + +#~ msgid "Customs/Original" +#~ msgstr "自製/原始" + +#~ msgid "Disc Default" +#~ msgstr "光碟預設" + +#~ msgid "DiskFlip" +#~ msgstr "光碟滑動" + +#~ msgid "Downloading" +#~ msgstr "正在下載" + +#~ msgid "Dutch" +#~ msgstr "荷蘭文" + +#~ msgid "English" +#~ msgstr "英文" + +#~ msgid "French" +#~ msgstr "法文" + +#~ msgid "GAMEID_Gamename" +#~ msgstr "GAMEID_遊戲名稱" + +#~ msgid "Game ID" +#~ msgstr "遊戲 ID" + +#~ msgid "Game Region" +#~ msgstr "遊戲區碼" + +#~ msgid "Gamename [GAMEID]" +#~ msgstr "遊戲名稱 [GAMEID]" + +#~ msgid "German" +#~ msgstr "德文" + +#~ msgid "Invalid PIN code" +#~ msgstr "無效的 PIN 碼" + +#~ msgid "Italian" +#~ msgstr "意大利文" + +#~ msgid "Japanese" +#~ msgstr "日文" + +#~ msgid "Korean" +#~ msgstr "韓文" + +#~ msgid "Left" +#~ msgstr "左" + +#~ msgid "Like SysMenu" +#~ msgstr "同系統選單" + +#~ msgid "Load From SD/USB" +#~ msgstr "從 SD/USB 載入" + +#~ msgid "Locked" +#~ msgstr "已鎖定" + +#~ msgid "Loop Directory" +#~ msgstr "重複路徑" + +#~ msgid "Loop Music" +#~ msgstr "重複音樂" + +#~ msgid "Loop Sound" +#~ msgstr "重複音樂" + +#~ msgid "Neither" +#~ msgstr "皆不顯示" + +#~ msgid "Next" +#~ msgstr "往後" + +#~ msgid "None" +#~ msgstr "沒有" + +#~ msgid "Normal" +#~ msgstr "一般" + +#~ msgid "ON" +#~ msgstr "開啟" + +#~ msgid "Only Customs" +#~ msgstr "只顯示自製" + +#~ msgid "Only Original" +#~ msgstr "只顯示原始" + +#~ msgid "Only for Install" +#~ msgstr "安裝遊戲時" + +#~ msgid "Original/Customs" +#~ msgstr "原始/自製" + +#~ msgid "Parental Control disabled" +#~ msgstr "關閉親子控制" + +#~ msgid "Play Once" +#~ msgstr "播放一次" + +#~ msgid "Prev" +#~ msgstr "往前" + +#~ msgid "Random Directory Music" +#~ msgstr "隨機選取音樂" + +#~ msgid "Right" +#~ msgstr "右" + +#~ msgid "SChinese" +#~ msgstr "簡體中文" + +#~ msgid "Sound+BGM" +#~ msgstr "音樂+音效" + +#~ msgid "Sound+Quiet" +#~ msgstr "音樂+靜音" + +#~ msgid "Spanish" +#~ msgstr "西班牙文" + +#~ msgid "System Default" +#~ msgstr "系統預設值" + +#~ msgid "TChinese" +#~ msgstr "繁體中文" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "WAD 已安裝,但文件無法從 SD 卡中刪除。" + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "WAD 安裝失敗,錯誤號 %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "不能打開剛下載的 WAD 文件 (%s)." + +#~ msgid "Unlock Parental Control" +#~ msgstr "解鎖家長控制" + +#~ msgid "Unlocked" +#~ msgstr "已解鎖" + +#~ msgid "Update to" +#~ msgstr "升級至" + +#~ msgid "Updating" +#~ msgstr "正在更新" + +#~ msgid "Updating Language Files..." +#~ msgstr "正在更新語言檔案..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "正在更新 WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "寬螢幕校正" + +#~ msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." +#~ msgstr "家長控制已鎖定。如果要解除 Wii 被鎖住的功能,您必須要先至控制台解除家長控制。" + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s 可能無法正確啟動,也許您的系統目錄不是最新的。" diff --git a/Languages/thai.lang b/Languages/thai.lang index a2752a8d..e6ed4bea 100644 --- a/Languages/thai.lang +++ b/Languages/thai.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: Nitro_subzero \n" "Language-Team: Nitro_subzero\n" @@ -25,54 +25,15 @@ msgstr " ถูกบันทึกแล้ว ข้อความยัง msgid " is not on the server." msgstr " ไม่อยู่บนแม่ข่าย" -msgid "0 (Everyone)" -msgstr "0 (ทุกคน)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (เด็ก 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 ชม." - -msgid "10 min" -msgstr "10 นาที" - -msgid "2 (Teen 12+)" -msgstr "2 (วัยรุ่น 12+)" - -msgid "20 min" -msgstr "20 นาที" - msgid "2D Cover Path" msgstr "ที่เก็บ ปก 2D" -msgid "3 (Mature 16+)" -msgstr "3 (เต็มวัย 16+)" - -msgid "3 min" -msgstr "3 นาที" - -msgid "30 min" -msgstr "30 นาที" - msgid "3D Cover Path" msgstr "ที่เก็บ ปก 3D" msgid "3D Covers" msgstr "หน้าปก 3D" -msgid "4 (Adults Only 18+)" -msgstr "4 (เฉพาะผู้ใหญ่ 18+)" - -msgid "5 min" -msgstr "5 นาที" - msgid ">> Deleting tickets..." msgstr ">> ลบ Tickets..." @@ -136,19 +97,13 @@ msgstr "ความสามารถทั้งหมดของ USB Loader msgid "Alternate DOL" msgstr "เปลี่ยน DOL " -msgid "An Error occured" -msgstr "พบความผิดพลาด" - -msgid "Anti" -msgstr "ต้าน" - msgid "App Language" msgstr "ภาษาของโปรแกรม" msgid "Apr" msgstr "เมษ." -msgid "Are you sure you want to enable Parent Control?" +msgid "Are you sure you want to lock USB Loader GX?" msgstr "" msgid "Are you sure you want to reset?" @@ -166,9 +121,6 @@ msgstr "ผู้แต่ง:" msgid "AutoInit Network" msgstr "ทำการเชื่อมต่อเครือข่าย" -msgid "AutoPatch" -msgstr "แก้ไขอัตโนมัติ" - msgid "BCA Codes Path" msgstr "" @@ -199,9 +151,6 @@ msgstr "บูต/มาตราฐาน" msgid "Boot?" msgstr "บูต?" -msgid "Both" -msgstr "ทั้งคู่" - msgid "Can't be formatted" msgstr "ไม่สามารถฟอร์แมตได้" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "ไฟล์สูตรโกง ว่างเปล่า" -msgid "Checking for Updates" -msgstr "ตรวจสอบหาอัพเดท" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "คอนโซล" -msgid "Console Default" -msgstr "ค่าตั้งต้นของคอนโซล" - msgid "Console Locked" msgstr "คอนโซลถูกล๊อค" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "ไม่สามารถสร้างไฟล์ GCT" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "เครดิต" msgid "Custom Paths" msgstr "กำหนด ที่เก็บ" -msgid "Customs/Original" -msgstr "กำหนดเอง/ดั้งเดิม" - msgid "DOL Path" msgstr "ที่เก็บ DOL" @@ -365,15 +309,9 @@ msgstr "ดาวน์โหลดภาพแผ่น" msgid "Disc Artwork Path" msgstr "ที่เก็บ ภาพแผ่น" -msgid "Disc Default" -msgstr "ค่าตั้งต้นแผ่น" - msgid "Disc Images" msgstr "ภาพแผ่น" -msgid "DiskFlip" -msgstr "สลับด้านแผ่น" - msgid "Display" msgstr "การแสดงผล" @@ -404,6 +342,9 @@ msgstr "ต้องการดาวน์โหลดธีมนี้ ?" msgid "Do you want to format:" msgstr "ต้องการฟอร์แมต:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "ต้องการจะใช้ alt DOL เฉพาะที่รู้ว่าถูกต้อง?" @@ -434,26 +375,26 @@ msgstr "ดาวน์โหลดเสร็จแล้ว" msgid "Download request failed." msgstr "ดาวน์โหลดไม่ได้" -msgid "Downloading" -msgstr "กำลังดาวน์โหลด" - msgid "Downloading Page List:" msgstr "รายการที่กำลังดาวน์โหลด:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "กำลังดาวน์โหลดไฟล์:" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "ภาพที่กำลังดาวน์โหลด:" -msgid "Dutch" -msgstr "เนเธอร์แลนด์" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "ผิดพลาด" @@ -464,9 +405,6 @@ msgstr "ผิดพลาด:" msgid "ERROR: Can't set up theme." msgstr "" -msgid "English" -msgstr "อังกฤษ" - msgid "Error" msgstr "ผิดพลาด" @@ -476,15 +414,24 @@ msgstr "ผิดพลาด !" msgid "Error 002 fix" msgstr "แก้ไข Error002" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "อ่านแผ่นไม่ได้" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "ผิดพลาดขณะรับส่งข้อมูล" +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "ขยายไฟล์ไม่ได้" msgid "Failed to open partition" msgstr "ไม่สามารถเข้าถึงพาร์ทิชั่นได้" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "กพ." @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "กลับ-X" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "ฟอร์แมต" @@ -545,15 +486,9 @@ msgstr "กำลังฟอร์แมต,รอสักครู่..." msgid "Free Space" msgstr "พื้นที่ว่าง" -msgid "French" -msgstr "ฝรั่งเศส" - msgid "Full Shutdown" msgstr "ปิดอย่างสมบรูณ์" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "ที่เก็บ สูตรโกง" @@ -566,9 +501,6 @@ msgstr "ปรับแต่งหน้าจอ" msgid "GXtheme.cfg not found in any subfolder." msgstr "" -msgid "Game ID" -msgstr "เกมส์ ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "โหลดเกมส์" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "โซนของเกมส์" - msgid "Game Size" msgstr "ขนาดของเกมส์" @@ -599,18 +528,12 @@ msgstr "เกมส์นี้ถูกติดตั้งอยู่แล msgid "Game partition" msgstr "" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "เกมส์" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "เยอรมัน" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "ใส่ SD card เพื่อใช้ตัวเลือกนี msgid "Install" msgstr "ติดตั้ง" -msgid "Install 1:1 Copy" -msgstr "" - msgid "Install Error!" msgstr "ผิดพลาดขณะติดตั้ง!" @@ -691,21 +611,12 @@ msgstr "ติดตั้ง Title... สำเร็จ!" msgid "Installing wad" msgstr "ติดตั้ง WAD" -msgid "Invalid PIN code" -msgstr "" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "ดูเหมือนว่าคุณมีข้อมูลที่จำเป็นต่อการพัฒนาโปรแกรม กรุณาส่งข้อมูลนั้นให้ทีมพัฒนาด้วย." -msgid "Italian" -msgstr "อิตาลี" - msgid "Jan" msgstr "มค." -msgid "Japanese" -msgstr "ญี่ปุ่น" - msgid "July" msgstr "กค." @@ -718,9 +629,6 @@ msgstr "เก็บ" msgid "Keyboard" msgstr "แป้นพิมพ์" -msgid "Korean" -msgstr "เกาหลี" - msgid "Language File" msgstr "ไฟล์ภาษา" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "ที่เก็บไฟล์ภาษาถูกเปลี่ยนแปลง" -msgid "Left" -msgstr "ซ้าย" - -msgid "Like SysMenu" -msgstr "คล้าย SysMenu" - msgid "Load" msgstr "โหลด" -msgid "Load From SD/USB" -msgstr "โหลดจาก SD/USB" - #, c-format msgid "Load file from: %s ?" msgstr "โหลดไฟล์จาก: %s ?" @@ -752,6 +651,9 @@ msgstr "โหลดไฟล์จาก: %s ?" msgid "Load this DOL as alternate DOL?" msgstr "โหลด DOL นี้เป็น alternate DOL?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "โหลดภาษามาตราฐาน." @@ -761,18 +663,9 @@ msgstr "โหลดเพลงมาตราฐาน" msgid "Lock Console" msgstr "ล๊อค Console" -msgid "Locked" -msgstr "ล๊อค" - -msgid "Loop Directory" +msgid "Lock USB Loader GX" msgstr "" -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" -msgstr "เล่นเสียงซ้ำ" - msgid "Mar" msgstr "มีค." @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "ความดังเสียงเพลง" -msgid "Neither" -msgstr "ไม่ทั้งสอง" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "พบแผ่นเกมส์ใหม่" -msgid "Next" -msgstr "ต่อไป" - msgid "No" msgstr "ไม่" @@ -839,12 +729,6 @@ msgstr "ไม่มีไฟล์ Update ตัวใหม่" msgid "No themes found on the site." msgstr "ไม่พบธีมบนเวบไซต์" -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "ปกติ" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "ปิด" msgid "OK" msgstr "ตกลง" -msgid "ON" -msgstr "เปิด" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "เวบไซต์อย่างเป็นทางการ:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "เฉพาะที่ดัดแปลง" - -msgid "Only Original" -msgstr "เฉพาะของแท้" - -msgid "Only for Install" -msgstr "เฉพาะติดตั้งเท่านั้น" - -msgid "Original/Customs" -msgstr "ของแท้/ดัดแปลง" - msgid "Parental Control" msgstr "กำหนดอายุ" -msgid "Parental Control disabled" -msgstr "" - msgid "Partition" msgstr "พาร์ติชั่น" @@ -947,9 +813,6 @@ msgstr "จำนวนที่เล่น" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "รอสักครู่" msgid "Power off the Wii" msgstr "ปิดเครื่อง Wii" -msgid "Prev" -msgstr "ที่ผ่านมา" - msgid "Prompts Buttons" msgstr "ปุ่มเตรียมตัว" @@ -974,9 +834,6 @@ msgstr "เผยแพร่โดย" msgid "Quick Boot" msgstr "บูตแบบเร็ว" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "อ่านข้อมูล WAD... สำเร็จ!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "กลับไปที่เมนู Wii" -msgid "Right" -msgstr "ขวา" - msgid "Rumble" msgstr "สั่น" -msgid "SChinese" -msgstr "จีน" - msgid "SFX Volume" msgstr "ความดังของ SFX" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "เลือก DOL" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "กย." @@ -1085,15 +933,6 @@ msgstr "เสียง" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "เสียง+BGM" - -msgid "Sound+Quiet" -msgstr "เสียง+เงียบ" - -msgid "Spanish" -msgstr "สเปน" - msgid "Special thanks to:" msgstr "ขอขอบคุณอย่างสูง:" @@ -1121,24 +960,18 @@ msgstr "ขยายไฟล์ธีมสำเร็จ." msgid "Successfully installed:" msgstr "ติดตั้งสำเร็จ:" -msgid "System Default" -msgstr "ค่าเริ่มต้นของระบบ" - -msgid "TChinese" -msgstr "จีนโบราณ" - msgid "TXT Cheatcodes Path" msgstr "ที่เก็บ TXTCheatcodes" msgid "The entered directory does not exist. Would you like to create it?" msgstr "ไม่พบไดเรคทอรี่นี้ ต้องการสร้างใหม่รึไม่ ?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "ไฟล์ Wad ถูกติดตั้งแล้ว แต่ไม่สามารถลบจาก SD card ได้" +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "การติดตั้งไฟล์ Wad ล้มเหลวด้วยข้อผิดพลาด %ld" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "ตำแหน่งที่ดาวน์โหลดธีม" @@ -1152,6 +985,9 @@ msgstr "ที่อยู่ Theme" msgid "Theme Title:" msgstr "ชื่อธีม:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "ถ่ายโอนไม่ได้" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "ไม่พบอุปกรณ์ USB" msgid "USB Loader GX is protected" msgstr "USB Loader GX 5 ถูกป้องกัน" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "ไม่สามารถเปิดไฟล์ Wad ที่เพิ่งดาวน์โหลดมาได้ (%s)." - msgid "Uninstall" msgstr "ถอนการติดตั้ง" @@ -1201,15 +1039,12 @@ msgstr "ถอนการติดตั้ง wad" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" +msgid "Unlock USB Loader GX" msgstr "" msgid "Unlock console to use this option." msgstr "ปลดล๊อค Console ก่อน เพื่อใช้ตัวเลือกนี้" -msgid "Unlocked" -msgstr "ปลดล๊อค" - msgid "Unsupported format, try to extract manually." msgstr "ไม่สนับสนุนไฟล์นี้ ลองขยายไฟล์เอง" @@ -1234,21 +1069,12 @@ msgstr "อัพเดทภาษาทั้งหมด" msgid "Update failed" msgstr "อัพเดทล้มเหลว" -msgid "Update to" -msgstr "อัพเดทเป็น" - -msgid "Updating" -msgstr "กำลังอัพเดท" - -msgid "Updating Language Files..." -msgstr "กำลังอัพเดทไฟล์ภาษา..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "กำลังอัพเดทไฟล์ภาษา:" -msgid "Updating WiiTDB.zip" -msgstr "กำลังอัพเดทไฟล์ WiiTDB.zip" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "อัพโหลดไฟล์ zip ไปที่ไดเรคทอรี่ homebrew" @@ -1280,9 +1106,6 @@ msgstr "คุณต้องการอัพเดทอะไร ?" msgid "WiFi Features" msgstr "ความสามารถของ Wi Fi" -msgid "Widescreen Fix" -msgstr "จอกว้าง" - msgid "Wii Menu" msgstr "เมนู Wii" @@ -1310,9 +1133,6 @@ msgstr "ใช่" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "" - msgid "You need to select or format a partition" msgstr "" @@ -1377,6 +1197,186 @@ msgstr "จาก" msgid "seconds left" msgstr "วินาทีที่เหลือ" +#~ msgid "0 (Everyone)" +#~ msgstr "0 (ทุกคน)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (เด็ก 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 ชม." + +#~ msgid "10 min" +#~ msgstr "10 นาที" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (วัยรุ่น 12+)" + +#~ msgid "20 min" +#~ msgstr "20 นาที" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (เต็มวัย 16+)" + +#~ msgid "3 min" +#~ msgstr "3 นาที" + +#~ msgid "30 min" +#~ msgstr "30 นาที" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (เฉพาะผู้ใหญ่ 18+)" + +#~ msgid "5 min" +#~ msgstr "5 นาที" + +#~ msgid "An Error occured" +#~ msgstr "พบความผิดพลาด" + +#~ msgid "Anti" +#~ msgstr "ต้าน" + +#~ msgid "AutoPatch" +#~ msgstr "แก้ไขอัตโนมัติ" + +#~ msgid "Both" +#~ msgstr "ทั้งคู่" + +#~ msgid "Checking for Updates" +#~ msgstr "ตรวจสอบหาอัพเดท" + +#~ msgid "Console Default" +#~ msgstr "ค่าตั้งต้นของคอนโซล" + +#~ msgid "Customs/Original" +#~ msgstr "กำหนดเอง/ดั้งเดิม" + +#~ msgid "Disc Default" +#~ msgstr "ค่าตั้งต้นแผ่น" + +#~ msgid "DiskFlip" +#~ msgstr "สลับด้านแผ่น" + +#~ msgid "Downloading" +#~ msgstr "กำลังดาวน์โหลด" + +#~ msgid "Dutch" +#~ msgstr "เนเธอร์แลนด์" + +#~ msgid "English" +#~ msgstr "อังกฤษ" + +#~ msgid "French" +#~ msgstr "ฝรั่งเศส" + +#~ msgid "Game ID" +#~ msgstr "เกมส์ ID" + +#~ msgid "Game Region" +#~ msgstr "โซนของเกมส์" + +#~ msgid "German" +#~ msgstr "เยอรมัน" + +#~ msgid "Italian" +#~ msgstr "อิตาลี" + +#~ msgid "Japanese" +#~ msgstr "ญี่ปุ่น" + +#~ msgid "Korean" +#~ msgstr "เกาหลี" + +#~ msgid "Left" +#~ msgstr "ซ้าย" + +#~ msgid "Like SysMenu" +#~ msgstr "คล้าย SysMenu" + +#~ msgid "Load From SD/USB" +#~ msgstr "โหลดจาก SD/USB" + +#~ msgid "Locked" +#~ msgstr "ล๊อค" + +#~ msgid "Loop Sound" +#~ msgstr "เล่นเสียงซ้ำ" + +#~ msgid "Neither" +#~ msgstr "ไม่ทั้งสอง" + +#~ msgid "Next" +#~ msgstr "ต่อไป" + +#~ msgid "Normal" +#~ msgstr "ปกติ" + +#~ msgid "ON" +#~ msgstr "เปิด" + +#~ msgid "Only Customs" +#~ msgstr "เฉพาะที่ดัดแปลง" + +#~ msgid "Only Original" +#~ msgstr "เฉพาะของแท้" + +#~ msgid "Only for Install" +#~ msgstr "เฉพาะติดตั้งเท่านั้น" + +#~ msgid "Original/Customs" +#~ msgstr "ของแท้/ดัดแปลง" + +#~ msgid "Prev" +#~ msgstr "ที่ผ่านมา" + +#~ msgid "Right" +#~ msgstr "ขวา" + +#~ msgid "SChinese" +#~ msgstr "จีน" + +#~ msgid "Sound+BGM" +#~ msgstr "เสียง+BGM" + +#~ msgid "Sound+Quiet" +#~ msgstr "เสียง+เงียบ" + +#~ msgid "Spanish" +#~ msgstr "สเปน" + +#~ msgid "System Default" +#~ msgstr "ค่าเริ่มต้นของระบบ" + +#~ msgid "TChinese" +#~ msgstr "จีนโบราณ" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "ไฟล์ Wad ถูกติดตั้งแล้ว แต่ไม่สามารถลบจาก SD card ได้" + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "การติดตั้งไฟล์ Wad ล้มเหลวด้วยข้อผิดพลาด %ld" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "ไม่สามารถเปิดไฟล์ Wad ที่เพิ่งดาวน์โหลดมาได้ (%s)." + +#~ msgid "Unlocked" +#~ msgstr "ปลดล๊อค" + +#~ msgid "Update to" +#~ msgstr "อัพเดทเป็น" + +#~ msgid "Updating" +#~ msgstr "กำลังอัพเดท" + +#~ msgid "Updating Language Files..." +#~ msgstr "กำลังอัพเดทไฟล์ภาษา..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "กำลังอัพเดทไฟล์ WiiTDB.zip" + +#~ msgid "Widescreen Fix" +#~ msgstr "จอกว้าง" + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s : %s อาจทำงานผิดปกติ ถ้าระบบของคุณไม่ทันสมัย" diff --git a/Languages/turkish.lang b/Languages/turkish.lang index fdf94ef1..66faabcd 100644 --- a/Languages/turkish.lang +++ b/Languages/turkish.lang @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-17 18:50+0100\n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" "PO-Revision-Date: 2009-10-01 01:00+0200\n" "Last-Translator: omercigingelini\n" "Language-Team: omercigingelini\n" @@ -25,54 +25,15 @@ msgstr " kaydedildi. Metin doğrulanmadı. Bazı kodlar birlikteyken doğru çal msgid " is not on the server." msgstr " sunucuda mevcut değil" -msgid "0 (Everyone)" -msgstr "0 (Herkes)" - -msgid "0 (Locked and Unlocked Games)" -msgstr "" - -msgid "1 (Child 7+)" -msgstr "1 (Çocuk 7+)" - -msgid "1 (Unlocked Games Only)" -msgstr "" - -msgid "1 hour" -msgstr "1 saat" - -msgid "10 min" -msgstr "10 dakika" - -msgid "2 (Teen 12+)" -msgstr "2 (Genç 12+)" - -msgid "20 min" -msgstr "20 dakika" - msgid "2D Cover Path" msgstr "2D Kapak Yolu" -msgid "3 (Mature 16+)" -msgstr "3 (Yetişkin 16+)" - -msgid "3 min" -msgstr "3 dakika" - -msgid "30 min" -msgstr "30 dakika" - msgid "3D Cover Path" msgstr "3D Kapak Yolu" msgid "3D Covers" msgstr "3B Kapaklar" -msgid "4 (Adults Only 18+)" -msgstr "4 (Sadece Yetişkin 18+)" - -msgid "5 min" -msgstr "5 dakika" - msgid ">> Deleting tickets..." msgstr ">> Biletler siliniyor" @@ -136,19 +97,13 @@ msgstr "USB Loader GX'in tüm özellikleri kilitli." msgid "Alternate DOL" msgstr "Alternatif DOL" -msgid "An Error occured" -msgstr "Bir Hata oluştu" - -msgid "Anti" -msgstr "" - msgid "App Language" msgstr "Program Lisani" msgid "Apr" msgstr "Nis" -msgid "Are you sure you want to enable Parent Control?" +msgid "Are you sure you want to lock USB Loader GX?" msgstr "" msgid "Are you sure you want to reset?" @@ -166,9 +121,6 @@ msgstr "Yazar:" msgid "AutoInit Network" msgstr "Ağı ototanımla" -msgid "AutoPatch" -msgstr "OtoYama" - msgid "BCA Codes Path" msgstr "BCA Kod Yolu" @@ -199,9 +151,6 @@ msgstr "Boot/Standart" msgid "Boot?" msgstr "Başlat?" -msgid "Both" -msgstr "İkisi de" - msgid "Can't be formatted" msgstr "Biçimlendirilemiyor" @@ -226,9 +175,6 @@ msgstr "" msgid "Cheatfile is blank" msgstr "Hile dosyası boş" -msgid "Checking for Updates" -msgstr "Güncellemeler kontrol ediliyor" - msgid "Clear" msgstr "" @@ -260,9 +206,6 @@ msgstr "" msgid "Console" msgstr "Konsol" -msgid "Console Default" -msgstr "Konsol Ayari" - msgid "Console Locked" msgstr "Konsol Kilitli" @@ -284,6 +227,10 @@ msgstr "" msgid "Could not create GCT file" msgstr "GCT dosyası oluşturulamadı" +#, c-format +msgid "Could not create path: %s" +msgstr "" + msgid "Could not find info for this game in the wiitdb.xml." msgstr "" @@ -314,9 +261,6 @@ msgstr "Emekçiler" msgid "Custom Paths" msgstr "Kişisel Yollar" -msgid "Customs/Original" -msgstr "Kişisel/Orjinal" - msgid "DOL Path" msgstr "DOL Yolu" @@ -365,15 +309,9 @@ msgstr "Disk Görseli Indirme" msgid "Disc Artwork Path" msgstr "Disk Görsel Yolu" -msgid "Disc Default" -msgstr "Disk Varsayılanı" - msgid "Disc Images" msgstr "Disk Resimleri" -msgid "DiskFlip" -msgstr "DiskÇevir" - msgid "Display" msgstr "Görüntü" @@ -404,6 +342,9 @@ msgstr "Bu temayı indirmek istiyor musunuz?" msgid "Do you want to format:" msgstr "Formatlamak istiyor musunuz:" +msgid "Do you want to load this theme?" +msgstr "" + msgid "Do you want to use the alternate DOL that is known to be correct?" msgstr "Doğru olduğu bilinen alternatif DOL ü kullanmak ister misiniz?" @@ -434,26 +375,26 @@ msgstr "Indirme tamamlandı" msgid "Download request failed." msgstr "İndirme isteği başarısız" -msgid "Downloading" -msgstr "Indiriliyor" - msgid "Downloading Page List:" msgstr "İndirilen Sayfa Listesi:" +msgid "Downloading covers" +msgstr "" + +msgid "Downloading custom Discarts" +msgstr "" + msgid "Downloading file" msgstr "Indirilen dosya" msgid "Downloading file..." msgstr "" -msgid "Downloading files" -msgstr "" - msgid "Downloading image:" msgstr "İndirilen resim:" -msgid "Dutch" -msgstr "Flaman" +msgid "Downloading original Discarts" +msgstr "" msgid "ERROR" msgstr "HATA" @@ -464,9 +405,6 @@ msgstr "HATA:" msgid "ERROR: Can't set up theme." msgstr "" -msgid "English" -msgstr "Ingilizce" - msgid "Error" msgstr "Hata" @@ -476,15 +414,24 @@ msgstr "Hata !" msgid "Error 002 fix" msgstr "Error 002 düzeltmesi" +msgid "Error opening downloaded file" +msgstr "" + msgid "Error reading Disc" msgstr "Disk Okuma Hatası" +msgid "Error while downloding file" +msgstr "" + msgid "Error while opening the zip." msgstr "" msgid "Error while transfering data." msgstr "Veri iletiminde hata." +msgid "Error while updating USB Loader GX." +msgstr "" + msgid "Error writing the data." msgstr "" @@ -509,6 +456,9 @@ msgstr "Çıkartma başarısız" msgid "Failed to open partition" msgstr "Bölüm açılamadı" +msgid "Failed updating" +msgstr "" + msgid "Feb" msgstr "Şub" @@ -527,15 +477,6 @@ msgstr "" msgid "Flip-X" msgstr "Çevir-X" -msgid "Force NTSC" -msgstr "" - -msgid "Force PAL50" -msgstr "" - -msgid "Force PAL60" -msgstr "" - msgid "Format" msgstr "Biçimlendir" @@ -545,15 +486,9 @@ msgstr "Biçimlendiriliyor, bekleyiniz..." msgid "Free Space" msgstr "Boş Yer" -msgid "French" -msgstr "Fransızca" - msgid "Full Shutdown" msgstr "Tam Kapama" -msgid "GAMEID_Gamename" -msgstr "" - msgid "GCT Cheatcodes Path" msgstr "GCT Hile Yolu" @@ -566,9 +501,6 @@ msgstr "GUI Ayarları" msgid "GXtheme.cfg not found in any subfolder." msgstr "" -msgid "Game ID" -msgstr "Oyun ID" - msgid "Game IOS" msgstr "" @@ -581,9 +513,6 @@ msgstr "Oyun Yükle" msgid "Game Lock" msgstr "" -msgid "Game Region" -msgstr "Oyun Bölgesi" - msgid "Game Size" msgstr "Oyun Boyutu" @@ -599,18 +528,12 @@ msgstr "Oyun zaten kurulu:" msgid "Game partition" msgstr "" -msgid "Gamename [GAMEID]" -msgstr "" - msgid "Games" msgstr "Oyunlar" msgid "GamesLevel" msgstr "" -msgid "German" -msgstr "Almanca" - msgid "Gerne:" msgstr "" @@ -664,9 +587,6 @@ msgstr "Bu seçeneği kullanmak için SD takın." msgid "Install" msgstr "Kur" -msgid "Install 1:1 Copy" -msgstr "" - msgid "Install Error!" msgstr "Kurulum Hatasi!" @@ -691,21 +611,12 @@ msgstr "Başlık kuruluyor.. OK!" msgid "Installing wad" msgstr "Wad kuruluyor" -msgid "Invalid PIN code" -msgstr "" - msgid "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." msgstr "İşimize yarabilecek bilgilere sahip gibi gözüküyorsunuz. Lütfen bu bilgiyi Geliştirme takımına iletin." -msgid "Italian" -msgstr "Italyanca" - msgid "Jan" msgstr "Oca" -msgid "Japanese" -msgstr "Japonca" - msgid "July" msgstr "Tem" @@ -718,9 +629,6 @@ msgstr "Sakla" msgid "Keyboard" msgstr "Klavye" -msgid "Korean" -msgstr "Korece" - msgid "Language File" msgstr "Dil dosyası" @@ -733,18 +641,9 @@ msgstr "" msgid "Languagepath changed." msgstr "Dil dosya yolu değişti." -msgid "Left" -msgstr "Sol" - -msgid "Like SysMenu" -msgstr "Sistem Menüsü Gibi" - msgid "Load" msgstr "Yükle" -msgid "Load From SD/USB" -msgstr "SD/USB den yükle" - #, c-format msgid "Load file from: %s ?" msgstr "Dosya %s 'ten yüklensin mi?" @@ -752,6 +651,9 @@ msgstr "Dosya %s 'ten yüklensin mi?" msgid "Load this DOL as alternate DOL?" msgstr "Bu DOL alternatif DOL olarak mı yüklensin?" +msgid "Loading default theme." +msgstr "" + msgid "Loading standard language." msgstr "Standart dil yükleniyor." @@ -761,18 +663,9 @@ msgstr "Standart müzik yükleniyor." msgid "Lock Console" msgstr "Konsolu Kilitle" -msgid "Locked" -msgstr "Kilitlendi" - -msgid "Loop Directory" +msgid "Lock USB Loader GX" msgstr "" -msgid "Loop Music" -msgstr "" - -msgid "Loop Sound" -msgstr "Döngüdeki Ses" - msgid "Mar" msgstr "" @@ -794,15 +687,12 @@ msgstr "" msgid "Music Volume" msgstr "Ses Seviyesi" -msgid "Neither" -msgstr "Hiçbiri" +msgid "Network is not initiated." +msgstr "" msgid "New Disc Detected" msgstr "Yeni Disk Bulundu" -msgid "Next" -msgstr "Ileri" - msgid "No" msgstr "Hayır" @@ -839,12 +729,6 @@ msgstr "Güncelleme yok" msgid "No themes found on the site." msgstr "Bu sitede tema bulunamadı" -msgid "None" -msgstr "" - -msgid "Normal" -msgstr "" - msgid "Not a WAD file." msgstr "" @@ -884,9 +768,6 @@ msgstr "KAPALI" msgid "OK" msgstr "" -msgid "ON" -msgstr "AÇIK" - msgid "Ocarina" msgstr "" @@ -899,24 +780,9 @@ msgstr "Resmi Site:" msgid "Offset" msgstr "" -msgid "Only Customs" -msgstr "Sadece Kişiseller" - -msgid "Only Original" -msgstr "Sadece Orjinal" - -msgid "Only for Install" -msgstr "Sadece Kurulum için" - -msgid "Original/Customs" -msgstr "Orjinal/Kişisel" - msgid "Parental Control" msgstr "Ebeveyn kontrolü" -msgid "Parental Control disabled" -msgstr "" - msgid "Partition" msgstr "Bölüm" @@ -947,9 +813,6 @@ msgstr "Oynama Sayısı" msgid "Play Next" msgstr "" -msgid "Play Once" -msgstr "" - msgid "Play Previous" msgstr "" @@ -962,9 +825,6 @@ msgstr "Lütfen bekleyin.." msgid "Power off the Wii" msgstr "Wii'yi kapat" -msgid "Prev" -msgstr "Önceki" - msgid "Prompts Buttons" msgstr "Hız ve Butonlar" @@ -974,9 +834,6 @@ msgstr "Yayıncı" msgid "Quick Boot" msgstr "Hızlı Başlatma" -msgid "Random Directory Music" -msgstr "" - msgid "Reading WAD data... Ok!" msgstr "Wad verisi okunuyor..OK!" @@ -1016,15 +873,9 @@ msgstr "" msgid "Return to Wii Menu" msgstr "Wii Menü ye Dön" -msgid "Right" -msgstr "Sağ" - msgid "Rumble" msgstr "Titreşim" -msgid "SChinese" -msgstr "Basitleştirilmis Çince" - msgid "SFX Volume" msgstr "Efekt Seviyesi" @@ -1052,9 +903,6 @@ msgstr "" msgid "Select a DOL" msgstr "Bir DOL seç" -msgid "Select a DOL from Game" -msgstr "" - msgid "Sept" msgstr "Eyl" @@ -1085,15 +933,6 @@ msgstr "Ses" msgid "Sound Settings" msgstr "" -msgid "Sound+BGM" -msgstr "Ses+BGM" - -msgid "Sound+Quiet" -msgstr "Ses+Quiet" - -msgid "Spanish" -msgstr "Ispanyolca" - msgid "Special thanks to:" msgstr "Özel tesekkürler" @@ -1121,24 +960,18 @@ msgstr "Tema başarıyla çıkarıldı." msgid "Successfully installed:" msgstr "Başarıyla kuruldu:" -msgid "System Default" -msgstr "Sistem Varsayılanı" - -msgid "TChinese" -msgstr "Geleneksel Çince" - msgid "TXT Cheatcodes Path" msgstr "TXT Hile Yolu" msgid "The entered directory does not exist. Would you like to create it?" msgstr "Girilen klasör mevcut değil. Oluşturmak ister misin?" -msgid "The wad file was installed. But It could not be deleted from the SD card." -msgstr "Wad dosyası kuruldu. Fakat SD den silinemedi" +msgid "The wad file was installed" +msgstr "" #, c-format -msgid "The wad installation failed with error %ld" -msgstr "Wad kurulumu %ld hatasıyla başarısız oldu" +msgid "The wad installation failed with error %i" +msgstr "" msgid "Theme Download Path" msgstr "Tema İndirme Yolu" @@ -1152,6 +985,9 @@ msgstr "Tema Yolu" msgid "Theme Title:" msgstr "Tema Başlığı:" +msgid "Theme path is changed." +msgstr "" + msgid "This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning." msgstr "" @@ -1176,16 +1012,18 @@ msgstr "" msgid "Transfer failed." msgstr "Transfer başarısız" +msgid "Trying custom Discarts" +msgstr "" + +msgid "Trying original Discarts" +msgstr "" + msgid "USB Device not found" msgstr "USB Aygıtı bulunamadı" msgid "USB Loader GX is protected" msgstr "USB Loader GX koruma altında" -#, c-format -msgid "Unable to open the wad that was just downloaded (%s)." -msgstr "Az önce indirilen wad açılamıyor(%s)" - msgid "Uninstall" msgstr "Kaldır" @@ -1201,15 +1039,12 @@ msgstr "Wad Kaldırılıyor" msgid "Unknown" msgstr "" -msgid "Unlock Parental Control" +msgid "Unlock USB Loader GX" msgstr "" msgid "Unlock console to use this option." msgstr "Bu seçeneği kullanmak için konsol kilidini açın" -msgid "Unlocked" -msgstr "Kilit açıldı" - msgid "Unsupported format, try to extract manually." msgstr "Desteklenmeyen format,elle çıkartmayı deneyin" @@ -1234,21 +1069,12 @@ msgstr "Tüm Dil Dosyalarını Güncelle" msgid "Update failed" msgstr "Güncelleme başarısız" -msgid "Update to" -msgstr "Güncellenecek" - -msgid "Updating" -msgstr "Güncelleniyor" - -msgid "Updating Language Files..." -msgstr "Dil Dosyaları Güncelleniyor..." +msgid "Update successfull" +msgstr "" msgid "Updating Language Files:" msgstr "Güncellenen Dil Dosyaları:" -msgid "Updating WiiTDB.zip" -msgstr "WiiTDB.zip güncelleniyor" - msgid "Uploaded ZIP file installed to homebrew directory." msgstr "ZIp dosyası homebrew klasörüne kuruldu" @@ -1280,9 +1106,6 @@ msgstr "Neyi güncelleme istiyorsun?" msgid "WiFi Features" msgstr "WiFi Özellikleri" -msgid "Widescreen Fix" -msgstr "Genişekran Çözümü" - msgid "Wii Menu" msgstr "Wii Menü" @@ -1310,9 +1133,6 @@ msgstr "Evet" msgid "You are trying to select a FAT32/NTFS/EXT partition with cIOS 249 Rev < 18. This is not supported. Continue on your own risk." msgstr "" -msgid "You don't have Parental Control enabled. If you wish to use Parental Control, enable it in the Wii Settings." -msgstr "" - msgid "You need to select or format a partition" msgstr "Bir bölüm seçmeniz ya da formatlamanız gerekiyor" @@ -1377,6 +1197,180 @@ msgstr "./" msgid "seconds left" msgstr "saniye kaldı" +#~ msgid "0 (Everyone)" +#~ msgstr "0 (Herkes)" + +#~ msgid "1 (Child 7+)" +#~ msgstr "1 (Çocuk 7+)" + +#~ msgid "1 hour" +#~ msgstr "1 saat" + +#~ msgid "10 min" +#~ msgstr "10 dakika" + +#~ msgid "2 (Teen 12+)" +#~ msgstr "2 (Genç 12+)" + +#~ msgid "20 min" +#~ msgstr "20 dakika" + +#~ msgid "3 (Mature 16+)" +#~ msgstr "3 (Yetişkin 16+)" + +#~ msgid "3 min" +#~ msgstr "3 dakika" + +#~ msgid "30 min" +#~ msgstr "30 dakika" + +#~ msgid "4 (Adults Only 18+)" +#~ msgstr "4 (Sadece Yetişkin 18+)" + +#~ msgid "5 min" +#~ msgstr "5 dakika" + +#~ msgid "An Error occured" +#~ msgstr "Bir Hata oluştu" + +#~ msgid "AutoPatch" +#~ msgstr "OtoYama" + +#~ msgid "Both" +#~ msgstr "İkisi de" + +#~ msgid "Checking for Updates" +#~ msgstr "Güncellemeler kontrol ediliyor" + +#~ msgid "Console Default" +#~ msgstr "Konsol Ayari" + +#~ msgid "Customs/Original" +#~ msgstr "Kişisel/Orjinal" + +#~ msgid "Disc Default" +#~ msgstr "Disk Varsayılanı" + +#~ msgid "DiskFlip" +#~ msgstr "DiskÇevir" + +#~ msgid "Downloading" +#~ msgstr "Indiriliyor" + +#~ msgid "Dutch" +#~ msgstr "Flaman" + +#~ msgid "English" +#~ msgstr "Ingilizce" + +#~ msgid "French" +#~ msgstr "Fransızca" + +#~ msgid "Game ID" +#~ msgstr "Oyun ID" + +#~ msgid "Game Region" +#~ msgstr "Oyun Bölgesi" + +#~ msgid "German" +#~ msgstr "Almanca" + +#~ msgid "Italian" +#~ msgstr "Italyanca" + +#~ msgid "Japanese" +#~ msgstr "Japonca" + +#~ msgid "Korean" +#~ msgstr "Korece" + +#~ msgid "Left" +#~ msgstr "Sol" + +#~ msgid "Like SysMenu" +#~ msgstr "Sistem Menüsü Gibi" + +#~ msgid "Load From SD/USB" +#~ msgstr "SD/USB den yükle" + +#~ msgid "Locked" +#~ msgstr "Kilitlendi" + +#~ msgid "Loop Sound" +#~ msgstr "Döngüdeki Ses" + +#~ msgid "Neither" +#~ msgstr "Hiçbiri" + +#~ msgid "Next" +#~ msgstr "Ileri" + +#~ msgid "ON" +#~ msgstr "AÇIK" + +#~ msgid "Only Customs" +#~ msgstr "Sadece Kişiseller" + +#~ msgid "Only Original" +#~ msgstr "Sadece Orjinal" + +#~ msgid "Only for Install" +#~ msgstr "Sadece Kurulum için" + +#~ msgid "Original/Customs" +#~ msgstr "Orjinal/Kişisel" + +#~ msgid "Prev" +#~ msgstr "Önceki" + +#~ msgid "Right" +#~ msgstr "Sağ" + +#~ msgid "SChinese" +#~ msgstr "Basitleştirilmis Çince" + +#~ msgid "Sound+BGM" +#~ msgstr "Ses+BGM" + +#~ msgid "Sound+Quiet" +#~ msgstr "Ses+Quiet" + +#~ msgid "Spanish" +#~ msgstr "Ispanyolca" + +#~ msgid "System Default" +#~ msgstr "Sistem Varsayılanı" + +#~ msgid "TChinese" +#~ msgstr "Geleneksel Çince" + +#~ msgid "The wad file was installed. But It could not be deleted from the SD card." +#~ msgstr "Wad dosyası kuruldu. Fakat SD den silinemedi" + +#~ msgid "The wad installation failed with error %ld" +#~ msgstr "Wad kurulumu %ld hatasıyla başarısız oldu" + +#~ msgid "Unable to open the wad that was just downloaded (%s)." +#~ msgstr "Az önce indirilen wad açılamıyor(%s)" + +#~ msgid "Unlocked" +#~ msgstr "Kilit açıldı" + +#~ msgid "Update to" +#~ msgstr "Güncellenecek" + +#~ msgid "Updating" +#~ msgstr "Güncelleniyor" + +#~ msgid "Updating Language Files..." +#~ msgstr "Dil Dosyaları Güncelleniyor..." + +#~ msgid "Updating WiiTDB.zip" +#~ msgstr "WiiTDB.zip güncelleniyor" + +#~ msgid "Widescreen Fix" +#~ msgstr "Genişekran Çözümü" + #~ msgid "%s : %s May not boot correctly if your System Menu is not up to date." #~ msgstr "%s: Sisteminiz güncel değil %s doğru şekilde başlatılamayabilir" diff --git a/Makefile b/Makefile index f85e4935..0582bbf0 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,6 @@ SOURCES := source \ source/sounds \ source/system \ source/libs/libwbfs \ - source/libs/libfat \ - source/libs/libntfs \ - source/libs/libext2fs \ source/language \ source/mload \ source/mload/modules \ @@ -56,7 +53,7 @@ INCLUDES := source # options for code generation #--------------------------------------------------------------------------------- -CFLAGS = -g -O4 -Wall -Wno-multichar $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H +CFLAGS = -g -O3 -Wall -Wno-multichar $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H CXXFLAGS = -Xassembler -aln=$@.lst $(CFLAGS) LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80B00000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size -include $(PROJECTDIR)/Make.config @@ -65,7 +62,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80B00 # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- LIBS := -lpngu -lpng -lgd -lm -lz -lwiiuse -lbte -lasnd -logc -lfreetype -lvorbisidec \ - -lmad -lmxml -ljpeg -lzip -lcustomext2fs + -lmad -lmxml -ljpeg -lzip -lcustomfat -lcustomntfs -lcustomext2fs #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib @@ -128,7 +125,8 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) -L$(CURDIR)/source/libs/libext2fs/ \ +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) -L$(CURDIR)/source/libs/libfat/ \ + -L$(CURDIR)/source/libs/libntfs/ -L$(CURDIR)/source/libs/libext2fs/ \ -L$(LIBOGC_LIB) export OUTPUT := $(CURDIR)/$(TARGET) @@ -151,6 +149,11 @@ channel: lang: @[ -d build ] || mkdir -p build @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile language + +#--------------------------------------------------------------------------------- +theme: + @[ -d build ] || mkdir -p build + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile language #--------------------------------------------------------------------------------- all: @@ -192,7 +195,7 @@ DEPENDS := $(OFILES:.o=.d) $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) -language: $(wildcard $(PROJECTDIR)/Languages/*.lang) +language: $(wildcard $(PROJECTDIR)/Languages/*.lang) $(wildcard $(PROJECTDIR)/Themes/*.them) #--------------------------------------------------------------------------------- # This rule links in binary data with .ttf, .png, and .mp3 extensions #--------------------------------------------------------------------------------- @@ -254,14 +257,20 @@ language: $(wildcard $(PROJECTDIR)/Languages/*.lang) export PATH := $(PROJECTDIR)/gettext-bin:$(PATH) %.pot: $(CFILES) $(CPPFILES) - @echo Update Language-Files ... - @xgettext -C -cTRANSLATORS --from-code=utf-8 --sort-output --no-wrap --no-location -k -ktr -ktrNOOP -o $@ $^ + @echo Updating Languagefiles ... + @touch $(PROJECTDIR)/Languages/$(TARGET).pot + @xgettext -C -cTRANSLATORS --from-code=utf-8 --sort-output --no-wrap --no-location -ktr -o$(PROJECTDIR)/Languages/$(TARGET).pot -p $@ $^ + @echo Updating Themefiles ... + @touch $(PROJECTDIR)/Themes/$(TARGET).pot + @xgettext -C -cTRANSLATORS --from-code=utf-8 -F --no-wrap --add-location -kthInt -kthColor -kthAlign -o$(PROJECTDIR)/Themes/$(TARGET).pot -p $@ $^ %.lang: $(PROJECTDIR)/Languages/$(TARGET).pot @msgmerge -U -N --no-wrap --no-location --backup=none -q $@ $< @touch $@ - +%.them: $(PROJECTDIR)/Themes/$(TARGET).pot + @msgmerge -U -N --no-wrap --no-location --backup=none -q $@ $< + @touch $@ -include $(DEPENDS) diff --git a/Themes/Default.them b/Themes/Default.them new file mode 100644 index 00000000..fafa6b55 --- /dev/null +++ b/Themes/Default.them @@ -0,0 +1,405 @@ +# USB Loader GX theme source file. +# don't delete/change this line (é). +# ONLY the value before the '-' char needs to be entered in msgstr "" +# not the complete text. +# It is important that the image folder is defined for the images to load. +# The image folder should be in the same folder as the .them file and include the theme images. +msgid "" +msgstr "" +"Project-Id-Version: USB Loader GX\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-12-26 16:16+0100\n" +"PO-Revision-Date: 2009-10-01 01:00+0200\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Image-Folder: Example\n" +"Last-Themer: Example\n" +"Theme-Team: Example\n" + +msgid "r=0 g=0 b=0 a=255 - prompt windows text color" +msgstr "" + +msgid "r=0 g=0 b=0 a=255 - settings text color" +msgstr "" + +msgid "9 - game list browser page size" +msgstr "" + +msgid "r=0 g=0 b=0 a=255 - game browser list text color" +msgstr "" + +msgid "r=0 g=0 b=0 a=255 - game browser list text color over" +msgstr "" + +msgid "r=55 g=190 b=237 a=255 - carousel game name text color" +msgstr "" + +msgid "0 - game grid layout pos x" +msgstr "" + +msgid "20 - game grid layout pos y" +msgstr "" + +msgid "255 - tooltip alpha" +msgstr "" + +msgid "r=55 g=190 b=237 a=255 - hdd info color" +msgstr "" + +msgid "center - hdd info align ver" +msgstr "" + +msgid "top - hdd info align hor" +msgstr "" + +msgid "0 - hdd info pos x" +msgstr "" + +msgid "400 - hdd info pos y" +msgstr "" + +msgid "r=55 g=190 b=237 a=255 - game count color" +msgstr "" + +msgid "center - game count align ver" +msgstr "" + +msgid "top - game count align hor" +msgstr "" + +msgid "0 - game count pos x" +msgstr "" + +msgid "420 - game count pos y" +msgstr "" + +msgid "16 - install btn pos x" +msgstr "" + +msgid "355 - install btn pos y" +msgstr "" + +msgid "371 - settings btn pos y" +msgstr "" + +msgid "64 - settings btn pos x" +msgstr "" + +msgid "371 - home menu btn pos x" +msgstr "" + +msgid "489 - home menu btn pos x" +msgstr "" + +msgid "355 - power off btn pos y" +msgstr "" + +msgid "576 - power off btn pos x" +msgstr "" + +msgid "160 - sd card btn pos x" +msgstr "" + +msgid "395 - sd card btn pos y" +msgstr "" + +msgid "405 - HBC btn pos y" +msgstr "" + +msgid "410 - HBC btn pos x" +msgstr "" + +msgid "26 - cover/download btn pos x" +msgstr "" + +msgid "58 - cover/download btn pos y" +msgstr "" + +msgid "305 - gameID btn pos y" +msgstr "" + +msgid "68 - gameID btn pos x" +msgstr "" + +msgid "r=138 g=138 b=138 a=240 - clock color" +msgstr "" + +msgid "left - clock align ver" +msgstr "" + +msgid "top - clock align hor" +msgstr "" + +msgid "275 - clock pos x" +msgstr "" + +msgid "275 - clock pos y" +msgstr "" + +msgid "260 - list layout favorite btn pos x" +msgstr "" + +msgid "288 - list layout favorite btn pos x widescreen" +msgstr "" + +msgid "13 - list layout favorite btn pos y" +msgstr "" + +msgid "300 - list layout search btn pos x" +msgstr "" + +msgid "320 - list layout search btn pos x widescreen" +msgstr "" + +msgid "13 - list layout search btn pos x" +msgstr "" + +msgid "340 - list layout abc/sort btn pos x" +msgstr "" + +msgid "352 - list layout abc/sort btn pos x widescreen" +msgstr "" + +msgid "13 - list layout abc/sort btn pos y" +msgstr "" + +msgid "380 - list layout list btn pos x" +msgstr "" + +msgid "384 - list layout list btn pos x widescreen" +msgstr "" + +msgid "13 - list layout list btn pos y" +msgstr "" + +msgid "416 - list layout grid btn pos x widescreen" +msgstr "" + +msgid "420 - list layout grid btn pos x" +msgstr "" + +msgid "13 - list layout grid btn pos y" +msgstr "" + +msgid "448 - list layout carousel btn pos x widescreen" +msgstr "" + +msgid "460 - list layout carousel btn pos x" +msgstr "" + +msgid "13 - list layout carousel btn pos y" +msgstr "" + +msgid "480 - list layout lock btn pos x widescreen" +msgstr "" + +msgid "500 - list layout lock btn pos x" +msgstr "" + +msgid "13 - list layout lock btn pos y" +msgstr "" + +msgid "512 - list layout dvd btn pos x widescreen" +msgstr "" + +msgid "540 - list layout dvd btn pos x" +msgstr "" + +msgid "13 - list layout dvd btn pos y" +msgstr "" + +msgid "280 - game list layout height" +msgstr "" + +msgid "396 - game list layout width" +msgstr "" + +msgid "200 - game list layout pos x" +msgstr "" + +msgid "49 - game list layout pos y" +msgstr "" + +msgid "200 - grid layout favorite btn pos x" +msgstr "" + +msgid "224 - grid layout favorite btn pos x widescreen" +msgstr "" + +msgid "13 - grid layout favorite btn pos y" +msgstr "" + +msgid "240 - grid layout search btn pos x" +msgstr "" + +msgid "256 - grid layout search btn pos x widescreen" +msgstr "" + +msgid "13 - grid layout search btn pos x" +msgstr "" + +msgid "280 - grid layout abc/sort btn pos x" +msgstr "" + +msgid "288 - grid layout abc/sort btn pos x widescreen" +msgstr "" + +msgid "13 - grid layout abc/sort btn pos y" +msgstr "" + +msgid "320 - grid layout list btn pos x" +msgstr "" + +msgid "320 - grid layout list btn pos x widescreen" +msgstr "" + +msgid "13 - grid layout list btn pos y" +msgstr "" + +msgid "352 - grid layout grid btn pos x widescreen" +msgstr "" + +msgid "360 - grid layout grid btn pos x" +msgstr "" + +msgid "13 - grid layout grid btn pos y" +msgstr "" + +msgid "384 - grid layout carousel btn pos x widescreen" +msgstr "" + +msgid "400 - grid layout carousel btn pos x" +msgstr "" + +msgid "13 - grid layout carousel btn pos y" +msgstr "" + +msgid "416 - grid layout lock btn pos x widescreen" +msgstr "" + +msgid "440 - grid layout lock btn pos x" +msgstr "" + +msgid "13 - grid layout lock btn pos y" +msgstr "" + +msgid "448 - grid layout dvd btn pos x widescreen" +msgstr "" + +msgid "480 - grid layout dvd btn pos x" +msgstr "" + +msgid "13 - grid layout dvd btn pos y" +msgstr "" + +msgid "400 - game grid layout height" +msgstr "" + +msgid "640 - game grid layout width" +msgstr "" + +msgid "200 - carousel layout favorite btn pos x" +msgstr "" + +msgid "224 - carousel layout favorite btn pos x widescreen" +msgstr "" + +msgid "13 - carousel layout favorite btn pos y" +msgstr "" + +msgid "240 - carousel layout search btn pos x" +msgstr "" + +msgid "256 - carousel layout search btn pos x widescreen" +msgstr "" + +msgid "13 - carousel layout search btn pos x" +msgstr "" + +msgid "280 - carousel layout abc/sort btn pos x" +msgstr "" + +msgid "288 - carousel layout abc/sort btn pos x widescreen" +msgstr "" + +msgid "13 - carousel layout abc/sort btn pos y" +msgstr "" + +msgid "320 - carousel layout list btn pos x" +msgstr "" + +msgid "320 - carousel layout list btn pos x widescreen" +msgstr "" + +msgid "13 - carousel layout list btn pos y" +msgstr "" + +msgid "352 - carousel layout grid btn pos x widescreen" +msgstr "" + +msgid "360 - carousel layout grid btn pos x" +msgstr "" + +msgid "13 - carousel layout grid btn pos y" +msgstr "" + +msgid "384 - carousel layout carousel btn pos x widescreen" +msgstr "" + +msgid "400 - carousel layout carousel btn pos x" +msgstr "" + +msgid "13 - carousel layout carousel btn pos y" +msgstr "" + +msgid "416 - carousel layout lock btn pos x widescreen" +msgstr "" + +msgid "440 - carousel layout lock btn pos x" +msgstr "" + +msgid "13 - carousel layout lock btn pos y" +msgstr "" + +msgid "448 - carousel layout dvd btn pos x widescreen" +msgstr "" + +msgid "480 - carousel layout dvd btn pos x" +msgstr "" + +msgid "13 - carousel layout dvd btn pos y" +msgstr "" + +msgid "400 - game carousel layout height" +msgstr "" + +msgid "640 - game carousel layout width" +msgstr "" + +msgid "-20 - game carousel layout pos y" +msgstr "" + +msgid "0 - game carousel layout pos x" +msgstr "" + +msgid "1 - show hdd info: 1 for on and 0 for off" +msgstr "" + +msgid "1 - show game count: 1 for on and 0 for off" +msgstr "" + +msgid "r=55 g=190 b=237 a=255 - game id text color" +msgstr "" + +msgid "r=55 g=190 b=237 a=255 - region info text color" +msgstr "" + +msgid "30 - region info text pos x" +msgstr "" + +msgid "68 - region info text pos x" +msgstr "" + +msgid "1 - Enable tooltips: 0 for off and 1 for on" +msgstr "" diff --git a/gui.pnproj b/gui.pnproj index 71ff4cc7..55da86f4 100644 --- a/gui.pnproj +++ b/gui.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/source/FileOperations/DirList.cpp b/source/FileOperations/DirList.cpp index c6184613..14cd42bc 100644 --- a/source/FileOperations/DirList.cpp +++ b/source/FileOperations/DirList.cpp @@ -55,9 +55,9 @@ bool DirList::LoadPath(const char * folder, const char *filter, u32 flags) std::string folderpath = folder; if(folderpath[folderpath.size()-1] == '/') - folderpath[folderpath.size()-1] = '\0'; + folderpath.erase(folderpath.size()-1, 1); - const char * notRoot = strrchr(folderpath.c_str(), '/'); + const char * notRoot = strchr(folderpath.c_str(), '/'); if(!notRoot) folderpath += '/'; diff --git a/source/GameBootProcess.cpp b/source/GameBootProcess.cpp index ededcc67..8eb8c207 100644 --- a/source/GameBootProcess.cpp +++ b/source/GameBootProcess.cpp @@ -85,19 +85,25 @@ int BootGame(const char * gameID) gprintf("\tSettings.partition: %d\n", Settings.partition); + struct discHdr gameHeader; gameList.LoadUnfiltered(); - if(!gameList.GetDiscHeader(gameID)) + if(mountMethod == 0 && !gameList.GetDiscHeader(gameID)) { gprintf("Game was not found: %s\n", gameID); return -1; } + else if(mountMethod && !dvdheader) + { + gprintf("Error: Loading empty disc header from DVD\n"); + return -1; + } - struct discHdr gameHeader; - memcpy(&gameHeader, gameList.GetDiscHeader(gameID), sizeof(struct discHdr)); + memcpy(&gameHeader, (mountMethod ? dvdheader : gameList.GetDiscHeader(gameID)), sizeof(struct discHdr)); + delete dvdheader; + dvdheader = NULL; int ret = 0; - struct discHdr * header = (mountMethod ? dvdheader : &gameHeader); u8 videoChoice = Settings.videomode; u8 languageChoice = Settings.language; @@ -111,7 +117,7 @@ int BootGame(const char * gameID) u8 reloadblock = OFF; u8 returnToLoaderGV = 1; - GameCFG * game_cfg = GameSettings.GetGameCFG(header->id); + GameCFG * game_cfg = GameSettings.GetGameCFG(gameHeader.id); if (game_cfg) { @@ -139,10 +145,10 @@ int BootGame(const char * gameID) if (!mountMethod) { gprintf("Loading fragment list..."); - ret = get_frag_list(header->id); + ret = get_frag_list(gameHeader.id); gprintf("%d\n", ret); - ret = Disc_SetUSB(header->id); + ret = Disc_SetUSB(gameHeader.id); if (ret < 0) Sys_BackToLoader(); gprintf("\tUSB set to game\n"); } @@ -158,19 +164,15 @@ int BootGame(const char * gameID) if (ret < 0) Sys_BackToLoader(); - if (dvdheader) delete dvdheader; - gprintf("Loading BCA data..."); - ret = do_bca_code(header->id); + ret = do_bca_code(gameHeader.id); gprintf("%d\n", ret); if (reloadblock == ON && IosLoader::IsHermesIOS()) { enable_ES_ioctlv_vector(); if (load_from_fs == PART_FS_WBFS) - { mload_close(); - } } u32 channel = 0; diff --git a/source/SoundOperations/BufferCircle.hpp b/source/SoundOperations/BufferCircle.hpp index 56ab0898..fcb9d6e4 100644 --- a/source/SoundOperations/BufferCircle.hpp +++ b/source/SoundOperations/BufferCircle.hpp @@ -80,7 +80,7 @@ class BufferCircle u16 Which() { return which; }; protected: //!> Check if the position is a valid position in the vector - bool Valid(int pos) { return !(which < 0 || which >= Size()); }; + bool Valid(int pos) { return !(pos < 0 || pos >= Size()); }; u16 which; u32 BufferBlockSize; diff --git a/source/cheats/cheatmenu.cpp b/source/cheats/cheatmenu.cpp index ce8bed7e..18cbf681 100644 --- a/source/cheats/cheatmenu.cpp +++ b/source/cheats/cheatmenu.cpp @@ -39,14 +39,14 @@ int CheatMenu(const char * gameID) GuiTrigger trigB; trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); - GuiText backBtnTxt(tr( "Back" ), 22, Theme.prompttext); + GuiText backBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage backBtnImg(&btnOutline); GuiButton backBtn(&backBtnImg, &backBtnImg, 2, 3, -140, 400, &trigA, NULL, btnSoundClick2, 1); backBtn.SetLabel(&backBtnTxt); backBtn.SetTrigger(&trigB); - GuiText createBtnTxt(tr( "Create" ), 22, Theme.prompttext); + GuiText createBtnTxt(tr( "Create" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); createBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage createBtnImg(&btnOutline); GuiButton createBtn(&createBtnImg, &createBtnImg, 2, 3, 160, 400, &trigA, NULL, btnSoundClick2, 1); diff --git a/source/libs/libext2fs/bitops.h b/source/libs/libext2fs/bitops.h deleted file mode 100644 index bf6ee82a..00000000 --- a/source/libs/libext2fs/bitops.h +++ /dev/null @@ -1,638 +0,0 @@ -/* - * bitops.h --- Bitmap frobbing code. The byte swapping routines are - * also included here. - * - * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. - * - * %Begin-Header% - * This file may be redistributed under the terms of the GNU Library - * General Public License, version 2. - * %End-Header% - */ -#ifndef _BITOPS_H_ -#define _BITOPS_H_ - -extern int ext2fs_set_bit(unsigned int nr,void * addr); -extern int ext2fs_clear_bit(unsigned int nr, void * addr); -extern int ext2fs_test_bit(unsigned int nr, const void * addr); -extern void ext2fs_fast_set_bit(unsigned int nr,void * addr); -extern void ext2fs_fast_clear_bit(unsigned int nr, void * addr); -extern int ext2fs_set_bit64(__u64 nr,void * addr); -extern int ext2fs_clear_bit64(__u64 nr, void * addr); -extern int ext2fs_test_bit64(__u64 nr, const void * addr); -extern void ext2fs_fast_set_bit64(__u64 nr,void * addr); -extern void ext2fs_fast_clear_bit64(__u64 nr, void * addr); -extern __u16 ext2fs_swab16(__u16 val); -extern __u32 ext2fs_swab32(__u32 val); -extern __u64 ext2fs_swab64(__u64 val); - -#ifdef WORDS_BIGENDIAN -#define ext2fs_cpu_to_le64(x) ext2fs_swab64((x)) -#define ext2fs_le64_to_cpu(x) ext2fs_swab64((x)) -#define ext2fs_cpu_to_le32(x) ext2fs_swab32((x)) -#define ext2fs_le32_to_cpu(x) ext2fs_swab32((x)) -#define ext2fs_cpu_to_le16(x) ext2fs_swab16((x)) -#define ext2fs_le16_to_cpu(x) ext2fs_swab16((x)) -#define ext2fs_cpu_to_be32(x) ((__u32)(x)) -#define ext2fs_be32_to_cpu(x) ((__u32)(x)) -#define ext2fs_cpu_to_be16(x) ((__u16)(x)) -#define ext2fs_be16_to_cpu(x) ((__u16)(x)) -#else -#define ext2fs_cpu_to_le64(x) ((__u64)(x)) -#define ext2fs_le64_to_cpu(x) ((__u64)(x)) -#define ext2fs_cpu_to_le32(x) ((__u32)(x)) -#define ext2fs_le32_to_cpu(x) ((__u32)(x)) -#define ext2fs_cpu_to_le16(x) ((__u16)(x)) -#define ext2fs_le16_to_cpu(x) ((__u16)(x)) -#define ext2fs_cpu_to_be32(x) ext2fs_swab32((x)) -#define ext2fs_be32_to_cpu(x) ext2fs_swab32((x)) -#define ext2fs_cpu_to_be16(x) ext2fs_swab16((x)) -#define ext2fs_be16_to_cpu(x) ext2fs_swab16((x)) -#endif - -/* - * EXT2FS bitmap manipulation routines. - */ - -/* Support for sending warning messages from the inline subroutines */ -extern const char *ext2fs_block_string; -extern const char *ext2fs_inode_string; -extern const char *ext2fs_mark_string; -extern const char *ext2fs_unmark_string; -extern const char *ext2fs_test_string; -extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg, - const char *description); -extern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap, - int code, unsigned long arg); - -extern int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block); -extern int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block); -extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block); - -extern int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode); -extern int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode); - -extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block); -extern void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block); -extern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block); - -extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap); -extern ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap); -extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap); -extern ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap); - -extern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num); -extern void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num); -extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num); -extern int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap, - ino_t inode, int num); -extern void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num); -extern void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num); -extern int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num); -extern void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map); - -/* These routines moved to gen_bitmap.c (actually, some of the above, too) */ -extern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap, - __u32 bitno); -extern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap, - blk_t bitno); -extern int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, - blk_t bitno); -extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num); -extern __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap); -extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap); - -/* 64-bit versions */ - -extern int ext2fs_mark_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block); -extern int ext2fs_unmark_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block); -extern int ext2fs_test_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block); - -extern int ext2fs_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern int ext2fs_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern int ext2fs_test_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); - -extern void ext2fs_fast_mark_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block); -extern void ext2fs_fast_unmark_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block); -extern int ext2fs_fast_test_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block); - -extern void ext2fs_fast_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern void ext2fs_fast_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern int ext2fs_fast_test_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode); -extern blk64_t ext2fs_get_block_bitmap_start2(ext2fs_block_bitmap bitmap); -extern ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap); -extern blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap); -extern ext2_ino_t ext2fs_get_inode_bitmap_end2(ext2fs_inode_bitmap bitmap); - -extern int ext2fs_fast_test_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, - unsigned int num); -extern void ext2fs_fast_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, - unsigned int num); -extern void ext2fs_fast_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, - unsigned int num); -/* These routines moved to gen_bitmap64.c */ -extern void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap); -extern errcode_t ext2fs_compare_generic_bmap(errcode_t neq, - ext2fs_generic_bitmap bm1, - ext2fs_generic_bitmap bm2); -extern void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap); -extern int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap bitmap, - blk64_t bitno); -extern int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap bitmap, - blk64_t bitno); -extern int ext2fs_test_generic_bmap(ext2fs_generic_bitmap bitmap, - blk64_t bitno); -extern int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, unsigned int num); -extern __u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap bitmap); -extern __u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap bitmap); -extern int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, unsigned int num); -extern void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, unsigned int num); -extern void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, unsigned int num); - -/* - * The inline routines themselves... - * - * If NO_INLINE_FUNCS is defined, then we won't try to do inline - * functions at all; they will be included as normal functions in - * inline.c - */ -#ifdef NO_INLINE_FUNCS -#if (defined(__GNUC__) && (defined(__i386__) || defined(__i486__) || \ - defined(__i586__) || defined(__mc68000__))) - /* This prevents bitops.c from trying to include the C */ - /* function version of these functions */ -#define _EXT2_HAVE_ASM_BITOPS_ -#endif -#endif /* NO_INLINE_FUNCS */ - -#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) -#ifdef INCLUDE_INLINE_FUNCS -#define _INLINE_ extern -#else -#ifdef __GNUC__ -#define _INLINE_ extern __inline__ -#else /* For Watcom C */ -#define _INLINE_ extern inline -#endif -#endif - -/* - * Fast bit set/clear functions that doesn't need to return the - * previous bit value. - */ - -_INLINE_ void ext2fs_fast_set_bit(unsigned int nr,void * addr) -{ - unsigned char *ADDR = (unsigned char *) addr; - - ADDR += nr >> 3; - *ADDR |= (1 << (nr & 0x07)); -} - -_INLINE_ void ext2fs_fast_clear_bit(unsigned int nr, void * addr) -{ - unsigned char *ADDR = (unsigned char *) addr; - - ADDR += nr >> 3; - *ADDR &= ~(1 << (nr & 0x07)); -} - - -_INLINE_ void ext2fs_fast_set_bit64(__u64 nr, void * addr) -{ - unsigned char *ADDR = (unsigned char *) addr; - - ADDR += nr >> 3; - *ADDR |= (1 << (nr & 0x07)); -} - -_INLINE_ void ext2fs_fast_clear_bit64(__u64 nr, void * addr) -{ - unsigned char *ADDR = (unsigned char *) addr; - - ADDR += nr >> 3; - *ADDR &= ~(1 << (nr & 0x07)); -} - - -#if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \ - (defined(__i386__) || defined(__i486__) || defined(__i586__))) - -#define _EXT2_HAVE_ASM_BITOPS_ -#define _EXT2_HAVE_ASM_SWAB_ - -/* - * These are done by inline assembly for speed reasons..... - * - * All bitoperations return 0 if the bit was cleared before the - * operation and != 0 if it was not. Bit 0 is the LSB of addr; bit 32 - * is the LSB of (addr+1). - */ - -/* - * Some hacks to defeat gcc over-optimizations.. - */ -struct __dummy_h { unsigned long a[100]; }; -#define EXT2FS_ADDR (*(struct __dummy_h *) addr) -#define EXT2FS_CONST_ADDR (*(const struct __dummy_h *) addr) - -_INLINE_ int ext2fs_set_bit(unsigned int nr, void * addr) -{ - int oldbit; - - addr = (void *) (((unsigned char *) addr) + (nr >> 3)); - __asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0" - :"=r" (oldbit),"+m" (EXT2FS_ADDR) - :"r" (nr & 7)); - return oldbit; -} - -_INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr) -{ - int oldbit; - - addr = (void *) (((unsigned char *) addr) + (nr >> 3)); - __asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0" - :"=r" (oldbit),"+m" (EXT2FS_ADDR) - :"r" (nr & 7)); - return oldbit; -} - -_INLINE_ int ext2fs_test_bit(unsigned int nr, const void * addr) -{ - int oldbit; - - addr = (const void *) (((const unsigned char *) addr) + (nr >> 3)); - __asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0" - :"=r" (oldbit) - :"m" (EXT2FS_CONST_ADDR),"r" (nr & 7)); - return oldbit; -} - -_INLINE_ __u32 ext2fs_swab32(__u32 val) -{ -#ifdef EXT2FS_REQUIRE_486 - __asm__("bswap %0" : "=r" (val) : "0" (val)); -#else - __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ - "rorl $16,%0\n\t" /* swap words */ - "xchgb %b0,%h0" /* swap higher bytes */ - :"=q" (val) - : "0" (val)); -#endif - return val; -} - -_INLINE_ __u16 ext2fs_swab16(__u16 val) -{ - __asm__("xchgb %b0,%h0" /* swap bytes */ \ - : "=q" (val) \ - : "0" (val)); \ - return val; -} - -#undef EXT2FS_ADDR - -#endif /* i386 */ - -#if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \ - (defined(__mc68000__))) - -#define _EXT2_HAVE_ASM_BITOPS_ - -_INLINE_ int ext2fs_set_bit(unsigned int nr,void * addr) -{ - char retval; - - __asm__ __volatile__ ("bfset %2@{%1:#1}; sne %0" - : "=d" (retval) : "d" (nr^7), "a" (addr)); - - return retval; -} - -_INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr) -{ - char retval; - - __asm__ __volatile__ ("bfclr %2@{%1:#1}; sne %0" - : "=d" (retval) : "d" (nr^7), "a" (addr)); - - return retval; -} - -_INLINE_ int ext2fs_test_bit(unsigned int nr, const void * addr) -{ - char retval; - - __asm__ __volatile__ ("bftst %2@{%1:#1}; sne %0" - : "=d" (retval) : "d" (nr^7), "a" (addr)); - - return retval; -} - -#endif /* __mc68000__ */ - - -#if !defined(_EXT2_HAVE_ASM_SWAB_) - -_INLINE_ __u16 ext2fs_swab16(__u16 val) -{ - return (val >> 8) | (val << 8); -} - -_INLINE_ __u32 ext2fs_swab32(__u32 val) -{ - return ((val>>24) | ((val>>8)&0xFF00) | - ((val<<8)&0xFF0000) | (val<<24)); -} - -#endif /* !_EXT2_HAVE_ASM_SWAB */ - -_INLINE_ __u64 ext2fs_swab64(__u64 val) -{ - return (ext2fs_swab32(val >> 32) | - (((__u64)ext2fs_swab32(val & 0xFFFFFFFFUL)) << 32)); -} - -_INLINE_ int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block) -{ - return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, - block); -} - -_INLINE_ int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block) -{ - return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, - block); -} - -_INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block) -{ - return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap, - block); -} - -_INLINE_ int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, - inode); -} - -_INLINE_ int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, - inode); -} - -_INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap, - inode); -} - -_INLINE_ void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block) -{ - ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block); -} - -_INLINE_ void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block) -{ - ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block); -} - -_INLINE_ int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap, - blk_t block) -{ - return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap, - block); -} - -_INLINE_ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode); -} - -_INLINE_ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode); -} - -_INLINE_ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap, - inode); -} - -_INLINE_ blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap) -{ - return ext2fs_get_generic_bitmap_start((ext2fs_generic_bitmap) bitmap); -} - -_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap) -{ - return ext2fs_get_generic_bitmap_start((ext2fs_generic_bitmap) bitmap); -} - -_INLINE_ blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap) -{ - return ext2fs_get_generic_bitmap_end((ext2fs_generic_bitmap) bitmap); -} - -_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap) -{ - return ext2fs_get_generic_bitmap_end((ext2fs_generic_bitmap) bitmap); -} - -_INLINE_ int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num) -{ - return ext2fs_test_block_bitmap_range(bitmap, block, num); -} - -_INLINE_ void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num) -{ - ext2fs_mark_block_bitmap_range(bitmap, block, num); -} - -_INLINE_ void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, - blk_t block, int num) -{ - ext2fs_unmark_block_bitmap_range(bitmap, block, num); -} - -/* 64-bit versions */ - -_INLINE_ int ext2fs_mark_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block) -{ - return ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap, - block); -} - -_INLINE_ int ext2fs_unmark_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block) -{ - return ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, block); -} - -_INLINE_ int ext2fs_test_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block) -{ - return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap, - block); -} - -_INLINE_ int ext2fs_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - return ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap, - inode); -} - -_INLINE_ int ext2fs_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - return ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, - inode); -} - -_INLINE_ int ext2fs_test_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap, - inode); -} - -_INLINE_ void ext2fs_fast_mark_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block) -{ - ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap, block); -} - -_INLINE_ void ext2fs_fast_unmark_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block) -{ - ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, block); -} - -_INLINE_ int ext2fs_fast_test_block_bitmap2(ext2fs_block_bitmap bitmap, - blk64_t block) -{ - return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap, - block); -} - -_INLINE_ void ext2fs_fast_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap, inode); -} - -_INLINE_ void ext2fs_fast_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, inode); -} - -_INLINE_ int ext2fs_fast_test_inode_bitmap2(ext2fs_inode_bitmap bitmap, - ext2_ino_t inode) -{ - return ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap, - inode); -} - -_INLINE_ blk64_t ext2fs_get_block_bitmap_start2(ext2fs_block_bitmap bitmap) -{ - return ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap); -} - -_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap) -{ - return ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap); -} - -_INLINE_ blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap) -{ - return ext2fs_get_generic_bmap_end((ext2fs_generic_bitmap) bitmap); -} - -_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end2(ext2fs_inode_bitmap bitmap) -{ - return ext2fs_get_generic_bmap_end((ext2fs_generic_bitmap) bitmap); -} - -_INLINE_ int ext2fs_fast_test_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, - unsigned int num) -{ - return ext2fs_test_block_bitmap_range2(bitmap, block, num); -} - -_INLINE_ void ext2fs_fast_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, - unsigned int num) -{ - ext2fs_mark_block_bitmap_range2(bitmap, block, num); -} - -_INLINE_ void ext2fs_fast_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap, - blk64_t block, - unsigned int num) -{ - ext2fs_unmark_block_bitmap_range2(bitmap, block, num); -} - -#undef _INLINE_ -#endif - -#endif diff --git a/source/libs/libext2fs/com_err.h b/source/libs/libext2fs/com_err.h deleted file mode 100644 index 0c31a4ec..00000000 --- a/source/libs/libext2fs/com_err.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Header file for common error description library. - * - * Copyright 1988, Student Information Processing Board of the - * Massachusetts Institute of Technology. - * - * For copyright and distribution info, see the documentation supplied - * with this package. - */ - -#if !defined(__COM_ERR_H) && !defined(__COM_ERR_H__) - -#ifdef __GNUC__ -#define COM_ERR_ATTR(x) __attribute__(x) -#else -#define COM_ERR_ATTR(x) -#endif - -#ifndef DEBUG_GEKKO -#define OMIT_COM_ERR -#endif - -#include -#include - -typedef long errcode_t; - -struct error_table { - char const * const * msgs; - long base; - int n_msgs; -}; -struct et_list; - -extern void com_err (const char *, long, const char *, ...) - COM_ERR_ATTR((format(printf, 3, 4))); - -extern void com_err_va (const char *whoami, errcode_t code, const char *fmt, - va_list args) - COM_ERR_ATTR((format(printf, 3, 0))); - -extern char const *error_message (long); -extern void (*com_err_hook) (const char *, long, const char *, va_list); -extern void (*set_com_err_hook (void (*) (const char *, long, - const char *, va_list))) - (const char *, long, const char *, va_list); -extern void (*reset_com_err_hook (void)) (const char *, long, - const char *, va_list); -extern int init_error_table(const char * const *msgs, long base, int count); - -extern errcode_t add_error_table(const struct error_table * et); -extern errcode_t remove_error_table(const struct error_table * et); -extern void add_to_error_table(struct et_list *new_table); - -/* Provided for Heimdall compatibility */ -extern const char *com_right(struct et_list *list, long code); -extern const char *com_right_r(struct et_list *list, long code, char *str, size_t len); -extern void initialize_error_table_r(struct et_list **list, - const char **messages, - int num_errors, - long base); -extern void free_error_table(struct et_list *et); - -/* Provided for compatibility with other com_err libraries */ -extern int et_list_lock(void); -extern int et_list_unlock(void); - -#define __COM_ERR_H -#define __COM_ERR_H__ -#endif /* !defined(__COM_ERR_H) && !defined(__COM_ERR_H__)*/ diff --git a/source/libs/libext2fs/ext2_err.h b/source/libs/libext2fs/ext2_err.h deleted file mode 100644 index 4f127443..00000000 --- a/source/libs/libext2fs/ext2_err.h +++ /dev/null @@ -1,152 +0,0 @@ -// -// Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. -// -// This file may be redistributed under the terms of the GNU Public -// License. -#ifndef EXT2_ERR_H_ -#define EXT2_ERR_H_ - -#define EXT2_ET_OK 0 -#define EXT2_ET_BASE -1 -#define EXT2_ET_MAGIC_EXT2FS_FILSYS -2 -#define EXT2_ET_MAGIC_BADBLOCKS_LIST -3 -#define EXT2_ET_MAGIC_BADBLOCKS_ITERATE -4 -#define EXT2_ET_MAGIC_INODE_SCAN -5 -#define EXT2_ET_MAGIC_IO_CHANNEL -6 -#define EXT2_ET_MAGIC_UNIX_IO_CHANNEL -7 -#define EXT2_ET_MAGIC_IO_MANAGER -8 -#define EXT2_ET_MAGIC_BLOCK_BITMAP -9 -#define EXT2_ET_MAGIC_INODE_BITMAP -10 -#define EXT2_ET_MAGIC_GENERIC_BITMAP -11 -#define EXT2_ET_MAGIC_TEST_IO_CHANNEL -12 -#define EXT2_ET_MAGIC_DBLIST -13 -#define EXT2_ET_MAGIC_ICOUNT -14 -#define EXT2_ET_MAGIC_PQ_IO_CHANNEL -15 -#define EXT2_ET_MAGIC_EXT2_FILE -16 -#define EXT2_ET_MAGIC_E2IMAGE -17 -#define EXT2_ET_MAGIC_INODE_IO_CHANNEL -18 -#define EXT2_ET_MAGIC_EXTENT_HANDLE -19 -#define EXT2_ET_BAD_MAGIC -20 -#define EXT2_ET_REV_TOO_HIGH -21 -#define EXT2_ET_RO_FILSYS -22 -#define EXT2_ET_GDESC_READ -23 -#define EXT2_ET_GDESC_WRITE -24 -#define EXT2_ET_GDESC_BAD_BLOCK_MAP -25 -#define EXT2_ET_GDESC_BAD_INODE_MAP -26 -#define EXT2_ET_GDESC_BAD_INODE_TABLE -27 -#define EXT2_ET_INODE_BITMAP_WRITE -28 -#define EXT2_ET_INODE_BITMAP_READ -29 -#define EXT2_ET_BLOCK_BITMAP_WRITE -30 -#define EXT2_ET_BLOCK_BITMAP_READ -31 -#define EXT2_ET_INODE_TABLE_WRITE -32 -#define EXT2_ET_INODE_TABLE_READ -33 -#define EXT2_ET_NEXT_INODE_READ -34 -#define EXT2_ET_UNEXPECTED_BLOCK_SIZE -35 -#define EXT2_ET_DIR_CORRUPTED -36 -#define EXT2_ET_SHORT_READ -37 -#define EXT2_ET_SHORT_WRITE -38 -#define EXT2_ET_DIR_NO_SPACE -39 -#define EXT2_ET_NO_INODE_BITMAP -40 -#define EXT2_ET_NO_BLOCK_BITMAP -41 -#define EXT2_ET_BAD_INODE_NUM -42 -#define EXT2_ET_BAD_BLOCK_NUM -45 -#define EXT2_ET_EXPAND_DIR_ERR -46 -#define EXT2_ET_TOOSMALL -47 -#define EXT2_ET_BAD_BLOCK_MARK -48 -#define EXT2_ET_BAD_BLOCK_UNMARK -49 -#define EXT2_ET_BAD_BLOCK_TEST -50 -#define EXT2_ET_BAD_INODE_MARK -51 -#define EXT2_ET_BAD_INODE_UNMARK -52 -#define EXT2_ET_BAD_INODE_TEST -53 -#define EXT2_ET_FUDGE_BLOCK_BITMAP_END -54 -#define EXT2_ET_FUDGE_INODE_BITMAP_END -55 -#define EXT2_ET_BAD_IND_BLOCK -56 -#define EXT2_ET_BAD_DIND_BLOCK -57 -#define EXT2_ET_BAD_TIND_BLOCK -58 -#define EXT2_ET_NEQ_BLOCK_BITMAP -59 -#define EXT2_ET_NEQ_INODE_BITMAP -60 -#define EXT2_ET_BAD_DEVICE_NAME -61 -#define EXT2_ET_MISSING_INODE_TABLE -62 -#define EXT2_ET_CORRUPT_SUPERBLOCK -63 -#define EXT2_ET_BAD_GENERIC_MARK -64 -#define EXT2_ET_BAD_GENERIC_UNMARK -65 -#define EXT2_ET_BAD_GENERIC_TEST -66 -#define EXT2_ET_SYMLINK_LOOP -67 -#define EXT2_ET_CALLBACK_NOTHANDLED -68 -#define EXT2_ET_BAD_BLOCK_IN_INODE_TABLE -69 -#define EXT2_ET_UNSUPP_FEATURE -70 -#define EXT2_ET_RO_UNSUPP_FEATURE -71 -#define EXT2_ET_LLSEEK_FAILED -72 -#define EXT2_ET_NO_MEMORY -73 -#define EXT2_ET_INVALID_ARGUMENT -74 -#define EXT2_ET_BLOCK_ALLOC_FAIL -75 -#define EXT2_ET_INODE_ALLOC_FAIL -76 -#define EXT2_ET_NO_DIRECTORY -77 -#define EXT2_ET_TOO_MANY_REFS -78 -#define EXT2_ET_FILE_NOT_FOUND -79 -#define EXT2_ET_FILE_RO -80 -#define EXT2_ET_DB_NOT_FOUND -81 -#define EXT2_ET_DIR_EXISTS -82 -#define EXT2_ET_UNIMPLEMENTED -83 -#define EXT2_ET_CANCEL_REQUESTED -84 -#define EXT2_ET_FILE_TOO_BIG -85 -#define EXT2_ET_JOURNAL_NOT_BLOCK -86 -#define EXT2_ET_NO_JOURNAL_SB -87 -#define EXT2_ET_JOURNAL_TOO_SMALL -88 -#define EXT2_ET_JOURNAL_UNSUPP_VERSION -89 -#define EXT2_ET_LOAD_EXT_JOURNAL -90 -#define EXT2_ET_NO_JOURNAL -91 -#define EXT2_ET_DIRHASH_UNSUPP -92 -#define EXT2_ET_BAD_EA_BLOCK_NUM -93 -#define EXT2_ET_TOO_MANY_INODES -94 -#define EXT2_ET_NOT_IMAGE_FILE -95 -#define EXT2_ET_RES_GDT_BLOCKS -96 -#define EXT2_ET_RESIZE_INODE_CORRUPT -97 -#define EXT2_ET_SET_BMAP_NO_IND -98 -#define EXT2_ET_TDB_SUCCESS -99 -#define EXT2_ET_TDB_ERR_CORRUPT -100 -#define EXT2_ET_TDB_ERR_IO -101 -#define EXT2_ET_TDB_ERR_LOCK -102 -#define EXT2_ET_TDB_ERR_OOM -103 -#define EXT2_ET_TDB_ERR_EXISTS -104 -#define EXT2_ET_TDB_ERR_NOLOCK -105 -#define EXT2_ET_TDB_ERR_EINVAL -106 -#define EXT2_ET_TDB_ERR_NOEXIST -107 -#define EXT2_ET_TDB_ERR_RDONLY -108 -#define EXT2_ET_DBLIST_EMPTY -109 -#define EXT2_ET_RO_BLOCK_ITERATE -110 -#define EXT2_ET_MAGIC_EXTENT_PATH -111 -#define EXT2_ET_MAGIC_RESERVED_10 -112 -#define EXT2_ET_MAGIC_RESERVED_11 -113 -#define EXT2_ET_MAGIC_RESERVED_12 -114 -#define EXT2_ET_MAGIC_RESERVED_13 -115 -#define EXT2_ET_MAGIC_RESERVED_14 -116 -#define EXT2_ET_MAGIC_RESERVED_15 -117 -#define EXT2_ET_MAGIC_RESERVED_16 -118 -#define EXT2_ET_MAGIC_RESERVED_17 -119 -#define EXT2_ET_MAGIC_RESERVED_18 -120 -#define EXT2_ET_MAGIC_RESERVED_19 -121 -#define EXT2_ET_EXTENT_HEADER_BAD -122 -#define EXT2_ET_EXTENT_INDEX_BAD -123 -#define EXT2_ET_EXTENT_LEAF_BAD -124 -#define EXT2_ET_EXTENT_NO_SPACE -125 -#define EXT2_ET_INODE_NOT_EXTENT -126 -#define EXT2_ET_EXTENT_NO_NEXT -127 -#define EXT2_ET_EXTENT_NO_PREV -128 -#define EXT2_ET_EXTENT_NO_UP -129 -#define EXT2_ET_EXTENT_NO_DOWN -130 -#define EXT2_ET_NO_CURRENT_NODE -131 -#define EXT2_ET_OP_NOT_SUPPORTED -132 -#define EXT2_ET_CANT_INSERT_EXTENT -133 -#define EXT2_ET_CANT_SPLIT_EXTENT -134 -#define EXT2_ET_EXTENT_NOT_FOUND -135 -#define EXT2_ET_EXTENT_NOT_SUPPORTED -136 -#define EXT2_ET_EXTENT_INVALID_LENGTH -137 -#define EXT2_ET_IO_CHANNEL_NO_SUPPORT_64 -138 -#define EXT2_NO_MTAB_FILE -139 -#define EXT2_ET_MAGIC_GENERIC_BITMAP64 -140 -#define EXT2_ET_MAGIC_BLOCK_BITMAP64 -141 -#define EXT2_ET_MAGIC_INODE_BITMAP64 -142 -#define EXT2_ET_CANT_USE_LEGACY_BITMAPS -143 - -#endif diff --git a/source/libs/libext2fs/ext2_ext_attr.h b/source/libs/libext2fs/ext2_ext_attr.h deleted file mode 100644 index ed548d12..00000000 --- a/source/libs/libext2fs/ext2_ext_attr.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - File: linux/ext2_ext_attr.h - - On-disk format of extended attributes for the ext2 filesystem. - - (C) 2000 Andreas Gruenbacher, -*/ - -#ifndef _EXT2_EXT_ATTR_H -#define _EXT2_EXT_ATTR_H -/* Magic value in attribute blocks */ -#define EXT2_EXT_ATTR_MAGIC_v1 0xEA010000 -#define EXT2_EXT_ATTR_MAGIC 0xEA020000 - -/* Maximum number of references to one attribute block */ -#define EXT2_EXT_ATTR_REFCOUNT_MAX 1024 - -struct ext2_ext_attr_header { - __u32 h_magic; /* magic number for identification */ - __u32 h_refcount; /* reference count */ - __u32 h_blocks; /* number of disk blocks used */ - __u32 h_hash; /* hash value of all attributes */ - __u32 h_reserved[4]; /* zero right now */ -}; - -struct ext2_ext_attr_entry { - __u8 e_name_len; /* length of name */ - __u8 e_name_index; /* attribute name index */ - __u16 e_value_offs; /* offset in disk block of value */ - __u32 e_value_block; /* disk block attribute is stored on (n/i) */ - __u32 e_value_size; /* size of attribute value */ - __u32 e_hash; /* hash value of name and value */ -#if 0 - char e_name[0]; /* attribute name */ -#endif -}; - -#define EXT2_EXT_ATTR_PAD_BITS 2 -#define EXT2_EXT_ATTR_PAD ((unsigned) 1<e_name_len)) ) -#define EXT2_EXT_ATTR_SIZE(size) \ - (((size) + EXT2_EXT_ATTR_ROUND) & ~EXT2_EXT_ATTR_ROUND) -#define EXT2_EXT_IS_LAST_ENTRY(entry) (*((__u32 *)(entry)) == 0UL) -#define EXT2_EXT_ATTR_NAME(entry) \ - (((char *) (entry)) + sizeof(struct ext2_ext_attr_entry)) -#define EXT2_XATTR_LEN(name_len) \ - (((name_len) + EXT2_EXT_ATTR_ROUND + \ - sizeof(struct ext2_xattr_entry)) & ~EXT2_EXT_ATTR_ROUND) -#define EXT2_XATTR_SIZE(size) \ - (((size) + EXT2_EXT_ATTR_ROUND) & ~EXT2_EXT_ATTR_ROUND) - -#ifdef __KERNEL__ -# ifdef CONFIG_EXT2_FS_EXT_ATTR -extern int ext2_get_ext_attr(struct inode *, const char *, char *, size_t, int); -extern int ext2_set_ext_attr(struct inode *, const char *, char *, size_t, int); -extern void ext2_ext_attr_free_inode(struct inode *inode); -extern void ext2_ext_attr_put_super(struct super_block *sb); -extern int ext2_ext_attr_init(void); -extern void ext2_ext_attr_done(void); -# else -# define ext2_get_ext_attr NULL -# define ext2_set_ext_attr NULL -# endif -#endif /* __KERNEL__ */ -#endif /* _EXT2_EXT_ATTR_H */ diff --git a/source/libs/libext2fs/ext2_frag.c b/source/libs/libext2fs/ext2_frag.c deleted file mode 100644 index e05a4bc7..00000000 --- a/source/libs/libext2fs/ext2_frag.c +++ /dev/null @@ -1,60 +0,0 @@ -#include "ext2_internal.h" -#include "ext2_frag.h" - -typedef struct _PrivData -{ - _ext2_frag_append_t append_fragment; - void * callback_data; -} PrivDataST; - -static int block_iter_callback(ext2_filsys fs, blk64_t *blocknr, e2_blkcnt_t blockcnt, blk64_t ref_block, int ref_offset, void *privateData) -{ - PrivDataST *priv = (PrivDataST *) privateData; - blk64_t block; - block = *blocknr; - - return priv->append_fragment(priv->callback_data, blockcnt*fs->io->block_size/512, block*fs->io->block_size/512, fs->io->block_size/512); -} - -int _EXT2_get_fragments(const char *in_path, _ext2_frag_append_t append_fragment, void *callback_data) -{ - ext2_inode_t *ni = NULL; - ext2_vd *vd; - - vd = ext2GetVolume(in_path); - - if(!vd) - { - errno = EXDEV; - return -1; - } - - // Get the actual path of the entry - const char * path = ext2RealPath(in_path); - if (!path) { - errno = EINVAL; - return -1; - } - - // Find the entry - ni = ext2OpenEntry(vd, path); - if (!ni) { - errno = ENOENT; - return -1; - } - - PrivDataST priv; - priv.callback_data = callback_data; - priv.append_fragment = append_fragment; - - int ret = ext2fs_block_iterate3(vd->fs, ni->ino, BLOCK_FLAG_DATA_ONLY, NULL, block_iter_callback, &priv); - - if(ret == 0) - ret = priv.append_fragment(callback_data, EXT2_I_SIZE(&ni->ni) >> 9, 0, 0); - - ext2UpdateTimes(vd, ni, EXT2_UPDATE_ATIME); - - ext2CloseEntry(vd, ni); - - return ret; -} diff --git a/source/libs/libext2fs/ext2_frag.j b/source/libs/libext2fs/ext2_frag.j deleted file mode 100644 index fe4ca658..00000000 --- a/source/libs/libext2fs/ext2_frag.j +++ /dev/null @@ -1,107 +0,0 @@ -#include "ext2_internal.h" -#include "ext2_frag.h" -#include "mem_allocate.h" - -typedef struct _DataBlocks -{ - u32 block; - u32 blockcnt; -} DataBlocks; - -typedef struct _PrivData -{ - DataBlocks * blocks; - u32 blocksCnt; -} PrivDataST; - -static int block_iter_callback(ext2_filsys fs, blk_t *blocknr, int blockcnt, void *privateData) -{ - PrivDataST *priv = (PrivDataST *) privateData; - - if(!priv->blocks) - priv->blocks = (DataBlocks *) mem_alloc(sizeof(DataBlocks)); - - priv->blocksCnt++; - - DataBlocks * tmp = (DataBlocks *) mem_realloc(priv->blocks, priv->blocksCnt*sizeof(DataBlocks)); - if(!tmp) - { - free(priv->blocks); - priv->blocks = NULL; - return -1; - } - - priv->blocks = tmp; - - priv->blocks[priv->blocksCnt-1].block = *blocknr; - priv->blocks[priv->blocksCnt-1].blockcnt = blockcnt; - return 0; -} - -int _EXT2_get_fragments(const char *in_path, _ext2_frag_append_t append_fragment, void *callback_data) -{ - ext2_inode_t *ni = NULL; - ext2_vd *vd; - - vd = ext2GetVolume(in_path); - - if(!vd) - { - errno = EXDEV; - return -1; - } - - // Get the actual path of the entry - const char * path = ext2RealPath(in_path); - if (!path) { - errno = EINVAL; - return -1; - } - - // Find the entry - ni = ext2OpenEntry(vd, path); - if (!ni) { - errno = ENOENT; - return -1; - } - - PrivDataST priv; - priv.blocks = NULL; - priv.blocksCnt = 0; - - int ret = ext2fs_block_iterate(vd->fs, ni->ino, BLOCK_FLAG_DATA_ONLY, NULL, block_iter_callback, &priv); - if(ret == 0 && priv.blocksCnt > 0) - { - int i = 0; - u32 size = 1; - u32 block_size = vd->fs->io->block_size/512; - int printfs = 30; - - for(i = 0; i < priv.blocksCnt-1; ++i) - { - //size = priv.blocks[i+1].blockcnt-priv.blocks[i].blockcnt; - ret = append_fragment(callback_data, priv.blocks[i].blockcnt*block_size, priv.blocks[i].block*block_size, size*block_size); - if(ret) - break; - if(printfs > 0) - { - printfs--; - } - } - - if(ret == 0) - ret = append_fragment(callback_data, priv.blocks[i].blockcnt*block_size, priv.blocks[i].block*block_size, block_size); - } - - if(ret == 0) - ret = append_fragment(callback_data, EXT2_I_SIZE(&ni->ni) >> 9, 0, 0); - - if(priv.blocks) - mem_free(priv.blocks); - - ext2UpdateTimes(vd, ni, EXT2_UPDATE_ATIME); - - ext2CloseEntry(vd, ni); - - return ret; -} diff --git a/source/libs/libext2fs/ext2_fs.h b/source/libs/libext2fs/ext2_fs.h deleted file mode 100644 index 132663d3..00000000 --- a/source/libs/libext2fs/ext2_fs.h +++ /dev/null @@ -1,798 +0,0 @@ -/* - * linux/include/linux/ext2_fs.h - * - * Copyright (C) 1992, 1993, 1994, 1995 - * Remy Card (card@masi.ibp.fr) - * Laboratoire MASI - Institut Blaise Pascal - * Universite Pierre et Marie Curie (Paris VI) - * - * from - * - * linux/include/linux/minix_fs.h - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -#ifndef _LINUX_EXT2_FS_H -#define _LINUX_EXT2_FS_H - -#include "ext2_types.h" /* Changed from linux/types.h */ - -/* - * The second extended filesystem constants/structures - */ - -/* - * Define EXT2FS_DEBUG to produce debug messages - */ -#undef EXT2FS_DEBUG - -/* - * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files - */ -#define EXT2_PREALLOCATE -#define EXT2_DEFAULT_PREALLOC_BLOCKS 8 - -/* - * The second extended file system version - */ -#define EXT2FS_DATE "95/08/09" -#define EXT2FS_VERSION "0.5b" - -/* - * Special inode numbers - */ -#define EXT2_BAD_INO 1 /* Bad blocks inode */ -#define EXT2_ROOT_INO 2 /* Root inode */ -#define EXT2_ACL_IDX_INO 3 /* ACL inode */ -#define EXT2_ACL_DATA_INO 4 /* ACL inode */ -#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ -#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ -#define EXT2_RESIZE_INO 7 /* Reserved group descriptors inode */ -#define EXT2_JOURNAL_INO 8 /* Journal inode */ -#define EXT2_EXCLUDE_INO 9 /* The "exclude" inode, for snapshots */ - -/* First non-reserved inode for old ext2 filesystems */ -#define EXT2_GOOD_OLD_FIRST_INO 11 - -/* - * The second extended file system magic number - */ -#define EXT2_SUPER_MAGIC 0xEF53 - -#ifdef __KERNEL__ -#define EXT2_SB(sb) (&((sb)->u.ext2_sb)) -#else -/* Assume that user mode programs are passing in an ext2fs superblock, not - * a kernel struct super_block. This will allow us to call the feature-test - * macros from user land. */ -#define EXT2_SB(sb) (sb) -#endif - -/* - * Maximal count of links to a file - */ -#define EXT2_LINK_MAX 65000 - -/* - * Macro-instructions used to manage several block sizes - */ -#define EXT2_MIN_BLOCK_LOG_SIZE 10 /* 1024 */ -#define EXT2_MAX_BLOCK_LOG_SIZE 16 /* 65536 */ -#define EXT2_MIN_BLOCK_SIZE (1 << EXT2_MIN_BLOCK_LOG_SIZE) -#define EXT2_MAX_BLOCK_SIZE (1 << EXT2_MAX_BLOCK_LOG_SIZE) -#ifdef __KERNEL__ -#define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize) -#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) -#define EXT2_ADDR_PER_BLOCK_BITS(s) (EXT2_SB(s)->addr_per_block_bits) -#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->s_inode_size) -#define EXT2_FIRST_INO(s) (EXT2_SB(s)->s_first_ino) -#else -#define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) -#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) -#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ - EXT2_GOOD_OLD_INODE_SIZE : (s)->s_inode_size) -#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ - EXT2_GOOD_OLD_FIRST_INO : (s)->s_first_ino) -#endif -#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(__u32)) - -/* - * Macro-instructions used to manage fragments - */ -#define EXT2_MIN_FRAG_SIZE EXT2_MIN_BLOCK_SIZE -#define EXT2_MAX_FRAG_SIZE EXT2_MAX_BLOCK_SIZE -#define EXT2_MIN_FRAG_LOG_SIZE EXT2_MIN_BLOCK_LOG_SIZE -#ifdef __KERNEL__ -# define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->s_frag_size) -# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->s_frags_per_block) -#else -# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) -# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) -#endif - -/* - * ACL structures - */ -struct ext2_acl_header /* Header of Access Control Lists */ -{ - __u32 aclh_size; - __u32 aclh_file_count; - __u32 aclh_acle_count; - __u32 aclh_first_acle; -}; - -struct ext2_acl_entry /* Access Control List Entry */ -{ - __u32 acle_size; - __u16 acle_perms; /* Access permissions */ - __u16 acle_type; /* Type of entry */ - __u16 acle_tag; /* User or group identity */ - __u16 acle_pad1; - __u32 acle_next; /* Pointer on next entry for the */ - /* same inode or on next free entry */ -}; - -/* - * Structure of a blocks group descriptor - */ -struct ext2_group_desc -{ - __u32 bg_block_bitmap; /* Blocks bitmap block */ - __u32 bg_inode_bitmap; /* Inodes bitmap block */ - __u32 bg_inode_table; /* Inodes table block */ - __u16 bg_free_blocks_count; /* Free blocks count */ - __u16 bg_free_inodes_count; /* Free inodes count */ - __u16 bg_used_dirs_count; /* Directories count */ - __u16 bg_flags; - __u32 bg_reserved[2]; - __u16 bg_itable_unused; /* Unused inodes count */ - __u16 bg_checksum; /* crc16(s_uuid+grouo_num+group_desc)*/ -}; - -/* - * Structure of a blocks group descriptor - */ -struct ext4_group_desc -{ - __u32 bg_block_bitmap; /* Blocks bitmap block */ - __u32 bg_inode_bitmap; /* Inodes bitmap block */ - __u32 bg_inode_table; /* Inodes table block */ - __u16 bg_free_blocks_count; /* Free blocks count */ - __u16 bg_free_inodes_count; /* Free inodes count */ - __u16 bg_used_dirs_count; /* Directories count */ - __u16 bg_flags; /* EXT4_BG_flags (INODE_UNINIT, etc) */ - __u32 bg_reserved[2]; /* Likely block/inode bitmap checksum */ - __u16 bg_itable_unused; /* Unused inodes count */ - __u16 bg_checksum; /* crc16(sb_uuid+group+desc) */ - __u32 bg_block_bitmap_hi; /* Blocks bitmap block MSB */ - __u32 bg_inode_bitmap_hi; /* Inodes bitmap block MSB */ - __u32 bg_inode_table_hi; /* Inodes table block MSB */ - __u16 bg_free_blocks_count_hi;/* Free blocks count MSB */ - __u16 bg_free_inodes_count_hi;/* Free inodes count MSB */ - __u16 bg_used_dirs_count_hi; /* Directories count MSB */ - __u16 bg_itable_unused_hi; /* Unused inodes count MSB */ - __u32 bg_reserved2[3]; -}; - -#define EXT2_BG_INODE_UNINIT 0x0001 /* Inode table/bitmap not initialized */ -#define EXT2_BG_BLOCK_UNINIT 0x0002 /* Block bitmap not initialized */ -#define EXT2_BG_INODE_ZEROED 0x0004 /* On-disk itable initialized to zero */ - -/* - * Data structures used by the directory indexing feature - * - * Note: all of the multibyte integer fields are little endian. - */ - -/* - * Note: dx_root_info is laid out so that if it should somehow get - * overlaid by a dirent the two low bits of the hash version will be - * zero. Therefore, the hash version mod 4 should never be 0. - * Sincerely, the paranoia department. - */ -struct ext2_dx_root_info { - __u32 reserved_zero; - __u8 hash_version; /* 0 now, 1 at release */ - __u8 info_length; /* 8 */ - __u8 indirect_levels; - __u8 unused_flags; -}; - -#define EXT2_HASH_LEGACY 0 -#define EXT2_HASH_HALF_MD4 1 -#define EXT2_HASH_TEA 2 -#define EXT2_HASH_LEGACY_UNSIGNED 3 /* reserved for userspace lib */ -#define EXT2_HASH_HALF_MD4_UNSIGNED 4 /* reserved for userspace lib */ -#define EXT2_HASH_TEA_UNSIGNED 5 /* reserved for userspace lib */ - -#define EXT2_HASH_FLAG_INCOMPAT 0x1 - -struct ext2_dx_entry { - __u32 hash; - __u32 block; -}; - -struct ext2_dx_countlimit { - __u16 limit; - __u16 count; -}; - - -/* - * Macro-instructions used to manage group descriptors - */ -#define EXT2_MIN_DESC_SIZE 32 -#define EXT2_MIN_DESC_SIZE_64BIT 64 -#define EXT2_MAX_DESC_SIZE EXT2_MIN_BLOCK_SIZE -#define EXT2_DESC_SIZE(s) \ - ((EXT2_SB(s)->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) ? \ - (s)->s_desc_size : EXT2_MIN_DESC_SIZE) - -#define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->s_blocks_per_group) -#define EXT2_INODES_PER_GROUP(s) (EXT2_SB(s)->s_inodes_per_group) -#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s)) -/* limits imposed by 16-bit value gd_free_{blocks,inode}_count */ -#define EXT2_MAX_BLOCKS_PER_GROUP(s) ((1 << 16) - 8) -#define EXT2_MAX_INODES_PER_GROUP(s) ((1 << 16) - EXT2_INODES_PER_BLOCK(s)) -#ifdef __KERNEL__ -#define EXT2_DESC_PER_BLOCK(s) (EXT2_SB(s)->s_desc_per_block) -#define EXT2_DESC_PER_BLOCK_BITS(s) (EXT2_SB(s)->s_desc_per_block_bits) -#else -#define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_DESC_SIZE(s)) -#endif - -/* - * Constants relative to the data blocks - */ -#define EXT2_NDIR_BLOCKS 12 -#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS -#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) -#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) -#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) - -/* - * Inode flags - */ -#define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ -#define EXT2_UNRM_FL 0x00000002 /* Undelete */ -#define EXT2_COMPR_FL 0x00000004 /* Compress file */ -#define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ -#define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ -#define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ -#define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ -#define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ -/* Reserved for compression usage... */ -#define EXT2_DIRTY_FL 0x00000100 -#define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ -#define EXT2_NOCOMPR_FL 0x00000400 /* Access raw compressed data */ -#define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ -/* End compression flags --- maybe not all used */ -#define EXT2_BTREE_FL 0x00001000 /* btree format dir */ -#define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ -#define EXT2_IMAGIC_FL 0x00002000 -#define EXT3_JOURNAL_DATA_FL 0x00004000 /* file data should be journaled */ -#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ -#define EXT2_DIRSYNC_FL 0x00010000 /* Synchronous directory modifications */ -#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ -#define EXT4_HUGE_FILE_FL 0x00040000 /* Set to each huge file */ -#define EXT4_EXTENTS_FL 0x00080000 /* Inode uses extents */ -#define EXT4_EA_INODE_FL 0x00200000 /* Inode used for large EA */ -#define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */ -#define EXT4_SNAPFILE_FL 0x01000000 /* Inode is a snapshot */ -#define EXT4_SNAPFILE_DELETED_FL 0x04000000 /* Snapshot is being deleted */ -#define EXT4_SNAPFILE_SHRUNK_FL 0x08000000 /* Snapshot shrink has completed */ -#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ - -#define EXT2_FL_USER_VISIBLE 0x004BDFFF /* User visible flags */ -#define EXT2_FL_USER_MODIFIABLE 0x004B80FF /* User modifiable flags */ - -/* - * ioctl commands - */ - -/* Used for online resize */ -struct ext2_new_group_input { - __u32 group; /* Group number for this data */ - __u32 block_bitmap; /* Absolute block number of block bitmap */ - __u32 inode_bitmap; /* Absolute block number of inode bitmap */ - __u32 inode_table; /* Absolute block number of inode table start */ - __u32 blocks_count; /* Total number of blocks in this group */ - __u16 reserved_blocks; /* Number of reserved blocks in this group */ - __u16 unused; /* Number of reserved GDT blocks in group */ -}; - -struct ext4_new_group_input { - __u32 group; /* Group number for this data */ - __u64 block_bitmap; /* Absolute block number of block bitmap */ - __u64 inode_bitmap; /* Absolute block number of inode bitmap */ - __u64 inode_table; /* Absolute block number of inode table start */ - __u32 blocks_count; /* Total number of blocks in this group */ - __u16 reserved_blocks; /* Number of reserved blocks in this group */ - __u16 unused; -}; - -#ifdef __GNU__ /* Needed for the Hurd */ -#define _IOT_ext2_new_group_input _IOT (_IOTS(__u32), 5, _IOTS(__u16), 2, 0, 0) -#endif - -#define EXT2_IOC_GETFLAGS _IOR('f', 1, long) -#define EXT2_IOC_SETFLAGS _IOW('f', 2, long) -#define EXT2_IOC_GETVERSION _IOR('v', 1, long) -#define EXT2_IOC_SETVERSION _IOW('v', 2, long) -#define EXT2_IOC_GETVERSION_NEW _IOR('f', 3, long) -#define EXT2_IOC_SETVERSION_NEW _IOW('f', 4, long) -#define EXT2_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) -#define EXT2_IOC_GROUP_ADD _IOW('f', 8,struct ext2_new_group_input) -#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input) - -/* - * Structure of an inode on the disk - */ -struct ext2_inode { - __u16 i_mode; /* File mode */ - __u16 i_uid; /* Low 16 bits of Owner Uid */ - __u32 i_size; /* Size in bytes */ - __u32 i_atime; /* Access time */ - __u32 i_ctime; /* Inode change time */ - __u32 i_mtime; /* Modification time */ - __u32 i_dtime; /* Deletion Time */ - __u16 i_gid; /* Low 16 bits of Group Id */ - __u16 i_links_count; /* Links count */ - __u32 i_blocks; /* Blocks count */ - __u32 i_flags; /* File flags */ - union { - struct { - __u32 l_i_version; /* was l_i_reserved1 */ - } linux1; - struct { - __u32 h_i_translator; - } hurd1; - } osd1; /* OS dependent 1 */ - __u32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ - __u32 i_generation; /* File version (for NFS) */ - __u32 i_file_acl; /* File ACL */ - __u32 i_size_high; /* Formerly i_dir_acl, directory ACL */ - __u32 i_faddr; /* Fragment address */ - union { - struct { - __u16 l_i_blocks_hi; - __u16 l_i_file_acl_high; - __u16 l_i_uid_high; /* these 2 fields */ - __u16 l_i_gid_high; /* were reserved2[0] */ - __u32 l_i_reserved2; - } linux2; - struct { - __u8 h_i_frag; /* Fragment number */ - __u8 h_i_fsize; /* Fragment size */ - __u16 h_i_mode_high; - __u16 h_i_uid_high; - __u16 h_i_gid_high; - __u32 h_i_author; - } hurd2; - } osd2; /* OS dependent 2 */ -}; - -/* - * Permanent part of an large inode on the disk - */ -struct ext2_inode_large { - __u16 i_mode; /* File mode */ - __u16 i_uid; /* Low 16 bits of Owner Uid */ - __u32 i_size; /* Size in bytes */ - __u32 i_atime; /* Access time */ - __u32 i_ctime; /* Inode Change time */ - __u32 i_mtime; /* Modification time */ - __u32 i_dtime; /* Deletion Time */ - __u16 i_gid; /* Low 16 bits of Group Id */ - __u16 i_links_count; /* Links count */ - __u32 i_blocks; /* Blocks count */ - __u32 i_flags; /* File flags */ - union { - struct { - __u32 l_i_version; /* was l_i_reserved1 */ - } linux1; - struct { - __u32 h_i_translator; - } hurd1; - } osd1; /* OS dependent 1 */ - __u32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ - __u32 i_generation; /* File version (for NFS) */ - __u32 i_file_acl; /* File ACL */ - __u32 i_size_high; /* Formerly i_dir_acl, directory ACL */ - __u32 i_faddr; /* Fragment address */ - union { - struct { - __u16 l_i_blocks_hi; - __u16 l_i_file_acl_high; - __u16 l_i_uid_high; /* these 2 fields */ - __u16 l_i_gid_high; /* were reserved2[0] */ - __u32 l_i_reserved2; - } linux2; - struct { - __u8 h_i_frag; /* Fragment number */ - __u8 h_i_fsize; /* Fragment size */ - __u16 h_i_mode_high; - __u16 h_i_uid_high; - __u16 h_i_gid_high; - __u32 h_i_author; - } hurd2; - } osd2; /* OS dependent 2 */ - __u16 i_extra_isize; - __u16 i_pad1; - __u32 i_ctime_extra; /* extra Change time (nsec << 2 | epoch) */ - __u32 i_mtime_extra; /* extra Modification time (nsec << 2 | epoch) */ - __u32 i_atime_extra; /* extra Access time (nsec << 2 | epoch) */ - __u32 i_crtime; /* File creation time */ - __u32 i_crtime_extra; /* extra File creation time (nsec << 2 | epoch)*/ - __u32 i_version_hi; /* high 32 bits for 64-bit version */ -}; - -#define i_dir_acl i_size_high - -#if defined(__KERNEL__) || defined(__linux__) -#define i_reserved1 osd1.linux1.l_i_reserved1 -#define i_frag osd2.linux2.l_i_frag -#define i_fsize osd2.linux2.l_i_fsize -#define i_uid_low i_uid -#define i_gid_low i_gid -#define i_uid_high osd2.linux2.l_i_uid_high -#define i_gid_high osd2.linux2.l_i_gid_high -#define i_reserved2 osd2.linux2.l_i_reserved2 -#else -#if defined(__GNU__) - -#define i_translator osd1.hurd1.h_i_translator -#define i_frag osd2.hurd2.h_i_frag; -#define i_fsize osd2.hurd2.h_i_fsize; -#define i_uid_high osd2.hurd2.h_i_uid_high -#define i_gid_high osd2.hurd2.h_i_gid_high -#define i_author osd2.hurd2.h_i_author - -#endif /* __GNU__ */ -#endif /* defined(__KERNEL__) || defined(__linux__) */ - -#define inode_uid(inode) ((inode).i_uid | (inode).osd2.linux2.l_i_uid_high << 16) -#define inode_gid(inode) ((inode).i_gid | (inode).osd2.linux2.l_i_gid_high << 16) -#define ext2fs_set_i_uid_high(inode,x) ((inode).osd2.linux2.l_i_uid_high = (x)) -#define ext2fs_set_i_gid_high(inode,x) ((inode).osd2.linux2.l_i_gid_high = (x)) - -/* - * File system states - */ -#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ -#define EXT2_ERROR_FS 0x0002 /* Errors detected */ -#define EXT3_ORPHAN_FS 0x0004 /* Orphans being recovered */ - -/* - * Misc. filesystem flags - */ -#define EXT2_FLAGS_SIGNED_HASH 0x0001 /* Signed dirhash in use */ -#define EXT2_FLAGS_UNSIGNED_HASH 0x0002 /* Unsigned dirhash in use */ -#define EXT2_FLAGS_TEST_FILESYS 0x0004 /* OK for use on development code */ -#define EXT2_FLAGS_IS_SNAPSHOT 0x0010 /* This is a snapshot image */ -#define EXT2_FLAGS_FIX_SNAPSHOT 0x0020 /* Snapshot inodes corrupted */ -#define EXT2_FLAGS_FIX_EXCLUDE 0x0040 /* Exclude bitmaps corrupted */ - -/* - * Mount flags - */ -#define EXT2_MOUNT_CHECK 0x0001 /* Do mount-time checks */ -#define EXT2_MOUNT_GRPID 0x0004 /* Create files with directory's group */ -#define EXT2_MOUNT_DEBUG 0x0008 /* Some debugging messages */ -#define EXT2_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ -#define EXT2_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ -#define EXT2_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ -#define EXT2_MOUNT_MINIX_DF 0x0080 /* Mimics the Minix statfs */ -#define EXT2_MOUNT_NO_UID32 0x0200 /* Disable 32-bit UIDs */ - -#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt -#define set_opt(o, opt) o |= EXT2_MOUNT_##opt -#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt & \ - EXT2_MOUNT_##opt) -/* - * Maximal mount counts between two filesystem checks - */ -#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ -#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */ - -/* - * Behaviour when detecting errors - */ -#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */ -#define EXT2_ERRORS_RO 2 /* Remount fs read-only */ -#define EXT2_ERRORS_PANIC 3 /* Panic */ -#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE - -#if (__GNUC__ >= 4) -#define ext4_offsetof(TYPE,MEMBER) __builtin_offsetof(TYPE,MEMBER) -#else -#define ext4_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif - -/* - * Structure of the super block - */ -struct ext2_super_block { - __u32 s_inodes_count; /* Inodes count */ - __u32 s_blocks_count; /* Blocks count */ - __u32 s_r_blocks_count; /* Reserved blocks count */ - __u32 s_free_blocks_count; /* Free blocks count */ - __u32 s_free_inodes_count; /* Free inodes count */ - __u32 s_first_data_block; /* First Data Block */ - __u32 s_log_block_size; /* Block size */ - __s32 s_log_frag_size; /* Fragment size */ - __u32 s_blocks_per_group; /* # Blocks per group */ - __u32 s_frags_per_group; /* # Fragments per group */ - __u32 s_inodes_per_group; /* # Inodes per group */ - __u32 s_mtime; /* Mount time */ - __u32 s_wtime; /* Write time */ - __u16 s_mnt_count; /* Mount count */ - __s16 s_max_mnt_count; /* Maximal mount count */ - __u16 s_magic; /* Magic signature */ - __u16 s_state; /* File system state */ - __u16 s_errors; /* Behaviour when detecting errors */ - __u16 s_minor_rev_level; /* minor revision level */ - __u32 s_lastcheck; /* time of last check */ - __u32 s_checkinterval; /* max. time between checks */ - __u32 s_creator_os; /* OS */ - __u32 s_rev_level; /* Revision level */ - __u16 s_def_resuid; /* Default uid for reserved blocks */ - __u16 s_def_resgid; /* Default gid for reserved blocks */ - /* - * These fields are for EXT2_DYNAMIC_REV superblocks only. - * - * Note: the difference between the compatible feature set and - * the incompatible feature set is that if there is a bit set - * in the incompatible feature set that the kernel doesn't - * know about, it should refuse to mount the filesystem. - * - * e2fsck's requirements are more strict; if it doesn't know - * about a feature in either the compatible or incompatible - * feature set, it must abort and not try to meddle with - * things it doesn't understand... - */ - __u32 s_first_ino; /* First non-reserved inode */ - __u16 s_inode_size; /* size of inode structure */ - __u16 s_block_group_nr; /* block group # of this superblock */ - __u32 s_feature_compat; /* compatible feature set */ - __u32 s_feature_incompat; /* incompatible feature set */ - __u32 s_feature_ro_compat; /* readonly-compatible feature set */ - __u8 s_uuid[16]; /* 128-bit uuid for volume */ - char s_volume_name[16]; /* volume name */ - char s_last_mounted[64]; /* directory where last mounted */ - __u32 s_algorithm_usage_bitmap; /* For compression */ - /* - * Performance hints. Directory preallocation should only - * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. - */ - __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ - __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ - __u16 s_reserved_gdt_blocks; /* Per group table for online growth */ - /* - * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. - */ - __u8 s_journal_uuid[16]; /* uuid of journal superblock */ - __u32 s_journal_inum; /* inode number of journal file */ - __u32 s_journal_dev; /* device number of journal file */ - __u32 s_last_orphan; /* start of list of inodes to delete */ - __u32 s_hash_seed[4]; /* HTREE hash seed */ - __u8 s_def_hash_version; /* Default hash version to use */ - __u8 s_jnl_backup_type; /* Default type of journal backup */ - __u16 s_desc_size; /* Group desc. size: INCOMPAT_64BIT */ - __u32 s_default_mount_opts; - __u32 s_first_meta_bg; /* First metablock group */ - __u32 s_mkfs_time; /* When the filesystem was created */ - __u32 s_jnl_blocks[17]; /* Backup of the journal inode */ - __u32 s_blocks_count_hi; /* Blocks count high 32bits */ - __u32 s_r_blocks_count_hi; /* Reserved blocks count high 32 bits*/ - __u32 s_free_blocks_hi; /* Free blocks count */ - __u16 s_min_extra_isize; /* All inodes have at least # bytes */ - __u16 s_want_extra_isize; /* New inodes should reserve # bytes */ - __u32 s_flags; /* Miscellaneous flags */ - __u16 s_raid_stride; /* RAID stride */ - __u16 s_mmp_interval; /* # seconds to wait in MMP checking */ - __u64 s_mmp_block; /* Block for multi-mount protection */ - __u32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/ - __u8 s_log_groups_per_flex; /* FLEX_BG group size */ - __u8 s_reserved_char_pad; - __u16 s_reserved_pad; /* Padding to next 32bits */ - __u64 s_kbytes_written; /* nr of lifetime kilobytes written */ - __u32 s_snapshot_inum; /* Inode number of active snapshot */ - __u32 s_snapshot_id; /* sequential ID of active snapshot */ - __u64 s_snapshot_r_blocks_count; /* reserved blocks for active - snapshot's future use */ - __u32 s_snapshot_list; /* inode number of the head of the on-disk snapshot list */ -#define EXT4_S_ERR_START ext4_offsetof(struct ext2_super_block, s_error_count) - __u32 s_error_count; /* number of fs errors */ - __u32 s_first_error_time; /* first time an error happened */ - __u32 s_first_error_ino; /* inode involved in first error */ - __u64 s_first_error_block; /* block involved of first error */ - __u8 s_first_error_func[32]; /* function where the error happened */ - __u32 s_first_error_line; /* line number where error happened */ - __u32 s_last_error_time; /* most recent time of an error */ - __u32 s_last_error_ino; /* inode involved in last error */ - __u32 s_last_error_line; /* line number where error happened */ - __u64 s_last_error_block; /* block involved of last error */ - __u8 s_last_error_func[32]; /* function where the error happened */ -#define EXT4_S_ERR_END ext4_offsetof(struct ext2_super_block, s_mount_opts) - __u8 s_mount_opts[64]; - __u32 s_reserved[112]; /* Padding to the end of the block */ -}; - -#define EXT4_S_ERR_LEN (EXT4_S_ERR_END - EXT4_S_ERR_START) - -/* - * Codes for operating systems - */ -#define EXT2_OS_LINUX 0 -#define EXT2_OS_HURD 1 -#define EXT2_OBSO_OS_MASIX 2 -#define EXT2_OS_FREEBSD 3 -#define EXT2_OS_LITES 4 - -/* - * Revision levels - */ -#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ -#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ - -#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV -#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV - -#define EXT2_GOOD_OLD_INODE_SIZE 128 - -/* - * Journal inode backup types - */ -#define EXT3_JNL_BACKUP_BLOCKS 1 - -/* - * Feature set definitions - */ - -#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_compat & (mask) ) -#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_ro_compat & (mask) ) -#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_feature_incompat & (mask) ) - -#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 -#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 -#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 -#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 -#define EXT2_FEATURE_COMPAT_RESIZE_INODE 0x0010 -#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 -#define EXT2_FEATURE_COMPAT_LAZY_BG 0x0040 -#define EXT2_FEATURE_COMPAT_EXCLUDE_INODE 0x0080 - -#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 -#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 -/* #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 not used */ -#define EXT4_FEATURE_RO_COMPAT_HUGE_FILE 0x0008 -#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 -#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020 -#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040 -#define EXT4_FEATURE_RO_COMPAT_HAS_SNAPSHOT 0x0080 - -#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 -#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 -#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ -#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */ -#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 -#define EXT3_FEATURE_INCOMPAT_EXTENTS 0x0040 -#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 -#define EXT4_FEATURE_INCOMPAT_MMP 0x0100 -#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 -#define EXT4_FEATURE_INCOMPAT_EA_INODE 0x0400 -#define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 - - -#define EXT2_FEATURE_COMPAT_SUPP 0 -#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE) -#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ - EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ - EXT4_FEATURE_RO_COMPAT_DIR_NLINK| \ - EXT2_FEATURE_RO_COMPAT_BTREE_DIR) - -/* - * Default values for user and/or group using reserved blocks - */ -#define EXT2_DEF_RESUID 0 -#define EXT2_DEF_RESGID 0 - -/* - * Default mount options - */ -#define EXT2_DEFM_DEBUG 0x0001 -#define EXT2_DEFM_BSDGROUPS 0x0002 -#define EXT2_DEFM_XATTR_USER 0x0004 -#define EXT2_DEFM_ACL 0x0008 -#define EXT2_DEFM_UID16 0x0010 -#define EXT3_DEFM_JMODE 0x0060 -#define EXT3_DEFM_JMODE_DATA 0x0020 -#define EXT3_DEFM_JMODE_ORDERED 0x0040 -#define EXT3_DEFM_JMODE_WBACK 0x0060 -#define EXT4_DEFM_NOBARRIER 0x0100 -#define EXT4_DEFM_BLOCK_VALIDITY 0x0200 -#define EXT4_DEFM_DISCARD 0x0400 -#define EXT4_DEFM_NODELALLOC 0x0800 - -/* - * Structure of a directory entry - */ -#define EXT2_NAME_LEN 255 - -struct ext2_dir_entry { - __u32 inode; /* Inode number */ - __u16 rec_len; /* Directory entry length */ - __u16 name_len; /* Name length */ - char name[EXT2_NAME_LEN]; /* File name */ -}; - -/* - * The new version of the directory entry. Since EXT2 structures are - * stored in intel byte order, and the name_len field could never be - * bigger than 255 chars, it's safe to reclaim the extra byte for the - * file_type field. - */ -struct ext2_dir_entry_2 { - __u32 inode; /* Inode number */ - __u16 rec_len; /* Directory entry length */ - __u8 name_len; /* Name length */ - __u8 file_type; - char name[EXT2_NAME_LEN]; /* File name */ -}; - -/* - * Ext2 directory file types. Only the low 3 bits are used. The - * other bits are reserved for now. - */ -#define EXT2_FT_UNKNOWN 0 -#define EXT2_FT_REG_FILE 1 -#define EXT2_FT_DIR 2 -#define EXT2_FT_CHRDEV 3 -#define EXT2_FT_BLKDEV 4 -#define EXT2_FT_FIFO 5 -#define EXT2_FT_SOCK 6 -#define EXT2_FT_SYMLINK 7 - -#define EXT2_FT_MAX 8 - -/* - * EXT2_DIR_PAD defines the directory entries boundaries - * - * NOTE: It must be a multiple of 4 - */ -#define EXT2_DIR_PAD 4 -#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) -#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ - ~EXT2_DIR_ROUND) - -/* - * This structure will be used for multiple mount protection. It will be - * written into the block number saved in the s_mmp_block field in the - * superblock. - */ -#define EXT2_MMP_MAGIC 0x004D4D50 /* ASCII for MMP */ -#define EXT2_MMP_CLEAN 0xFF4D4D50 /* Value of mmp_seq for clean unmount */ -#define EXT2_MMP_FSCK_ON 0xE24D4D50 /* Value of mmp_seq when being fscked */ - -struct mmp_struct { - __u32 mmp_magic; - __u32 mmp_seq; - __u64 mmp_time; - char mmp_nodename[64]; - char mmp_bdevname[32]; - __u16 mmp_interval; - __u16 mmp_pad1; - __u32 mmp_pad2; -}; - -/* - * Interval in number of seconds to update the MMP sequence number. - */ -#define EXT2_MMP_DEF_INTERVAL 5 - -#endif /* _LINUX_EXT2_FS_H */ diff --git a/source/libs/libext2fs/ext2_internal.h b/source/libs/libext2fs/ext2_internal.h deleted file mode 100644 index 24dd4a52..00000000 --- a/source/libs/libext2fs/ext2_internal.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * ext2_internal.h - * - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2010 Dimok - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef EXT2_INTERNAL_H_ -#define EXT2_INTERNAL_H_ - -#include -#include -#include -#include "ext2fs.h" -#include "ext2_fs.h" -#include "mem_allocate.h" - -#ifdef DEBUG_GEKKO -#define ext2_log_trace printf -#else -#define ext2_log_trace(...) -#endif - -typedef struct _ext2_inode_t -{ - struct ext2_inode ni; - ext2_ino_t ino; - bool dirty; -} ext2_inode_t; - -/** - * ext2_vd - EXT2 volume descriptor - */ -typedef struct _ext2_vd -{ - io_channel io; /* EXT device handle */ - ext2_filsys fs; /* EXT volume handle */ - mutex_t lock; /* Volume lock mutex */ - ext2_inode_t *cwd_ni; /* Current directory */ - struct _ext2_dir_state *firstOpenDir; /* The start of a FILO linked list of currently opened directories */ - struct _ext2_file_state *firstOpenFile; /* The start of a FILO linked list of currently opened files */ - u16 openDirCount; /* The total number of directories currently open in this volume */ - u16 openFileCount; /* The total number of files currently open in this volume */ - ext2_ino_t root; /* Root node */ -} ext2_vd; - -typedef enum { - EXT2_UPDATE_ATIME = 0x01, - EXT2_UPDATE_MTIME = 0x02, - EXT2_UPDATE_CTIME = 0x04, - EXT2_UPDATE_AMTIME = EXT2_UPDATE_ATIME | EXT2_UPDATE_MTIME, - EXT2_UPDATE_ACTIME = EXT2_UPDATE_ATIME | EXT2_UPDATE_CTIME, - EXT2_UPDATE_MCTIME = EXT2_UPDATE_MTIME | EXT2_UPDATE_CTIME, - EXT2_UPDATE_AMCTIME = EXT2_UPDATE_ATIME | EXT2_UPDATE_MTIME | EXT2_UPDATE_CTIME, -} ext2_time_update_flags; - -/* Lock volume */ -static inline void ext2Lock (ext2_vd *vd) -{ - LWP_MutexLock(vd->lock); -} - -/* Unlock volume */ -static inline void ext2Unlock (ext2_vd *vd) -{ - LWP_MutexUnlock(vd->lock); -} - -const char *ext2RealPath (const char *path); -int ext2InitVolume (ext2_vd *vd); -void ext2DeinitVolume (ext2_vd *vd); -ext2_vd *ext2GetVolume (const char *path); - -int ext2AddDevice (const char *name, void *deviceData); -void ext2RemoveDevice (const char *path); -const devoptab_t *ext2GetDevice (const char *path); - -ext2_inode_t *ext2OpenEntry (ext2_vd *vd, const char *path); -void ext2CloseEntry (ext2_vd *vd, ext2_inode_t * ni); -int ext2Stat (ext2_vd *vd, ext2_inode_t * ni, struct stat *st); -int ext2Sync (ext2_vd *vd, ext2_inode_t * ni); - -ext2_inode_t *ext2Create (ext2_vd *vd, const char *path, mode_t type, const char *target); -int ext2Link (ext2_vd *vd, const char *old_path, const char *new_path); -int ext2Unlink (ext2_vd *vd, const char *path); - -void ext2UpdateTimes(ext2_vd *vd, ext2_inode_t *ni, ext2_time_update_flags mask); - -#endif diff --git a/source/libs/libext2fs/ext2_io.h b/source/libs/libext2fs/ext2_io.h deleted file mode 100644 index 25aec665..00000000 --- a/source/libs/libext2fs/ext2_io.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * io.h --- the I/O manager abstraction - * - * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. - * - * %Begin-Header% - * This file may be redistributed under the terms of the GNU Library - * General Public License, version 2. - * %End-Header% - */ - -#ifndef _EXT2FS_EXT2_IO_H -#define _EXT2FS_EXT2_IO_H - -#include "ext2fs.h" - -/* - * ext2_loff_t is defined here since unix_io.c needs it. - */ -typedef long long ext2_loff_t; - -/* llseek.c */ -ext2_loff_t ext2fs_llseek (int, ext2_loff_t, int); - -typedef struct struct_io_manager *io_manager; -typedef struct struct_io_channel *io_channel; -typedef struct struct_io_stats *io_stats; - -#define CHANNEL_FLAGS_WRITETHROUGH 0x01 - -struct struct_io_channel { - errcode_t magic; - io_manager manager; - char *name; - int block_size; - errcode_t (*read_error)(io_channel channel, - unsigned long block, - int count, - void *data, - size_t size, - int actual_bytes_read, - errcode_t error); - errcode_t (*write_error)(io_channel channel, - unsigned long block, - int count, - const void *data, - size_t size, - int actual_bytes_written, - errcode_t error); - int refcount; - int flags; - long reserved[14]; - void *private_data; - void *app_data; -}; - -struct struct_io_stats { - int num_fields; - int reserved; - unsigned long long bytes_read; - unsigned long long bytes_written; -}; - -struct struct_io_manager { - errcode_t magic; - const char *name; - errcode_t (*open)(const char *name, int flags, io_channel *channel); - errcode_t (*close)(io_channel channel); - errcode_t (*set_blksize)(io_channel channel, int blksize); - errcode_t (*read_blk)(io_channel channel, unsigned long block, - int count, void *data); - errcode_t (*write_blk)(io_channel channel, unsigned long block, - int count, const void *data); - errcode_t (*flush)(io_channel channel); - errcode_t (*write_byte)(io_channel channel, unsigned long offset, - int count, const void *data); - errcode_t (*set_option)(io_channel channel, const char *option, - const char *arg); - errcode_t (*get_stats)(io_channel channel, io_stats *io_stats); - errcode_t (*read_blk64)(io_channel channel, unsigned long long block, - int count, void *data); - errcode_t (*write_blk64)(io_channel channel, unsigned long long block, - int count, const void *data); - long reserved[16]; -}; - -#define IO_FLAG_RW 0x0001 -#define IO_FLAG_EXCLUSIVE 0x0002 -#define IO_FLAG_DIRECT_IO 0x0004 - -/* - * Convenience functions.... - */ -#define io_channel_close(c) ((c)->manager->close((c))) -#define io_channel_set_blksize(c,s) ((c)->manager->set_blksize((c),s)) -#define io_channel_read_blk(c,b,n,d) ((c)->manager->read_blk((c),b,n,d)) -#define io_channel_write_blk(c,b,n,d) ((c)->manager->write_blk((c),b,n,d)) -#define io_channel_flush(c) ((c)->manager->flush((c))) -#define io_channel_bumpcount(c) ((c)->refcount++) - -/* io_manager.c */ -extern errcode_t io_channel_set_options(io_channel channel, - const char *options); -extern errcode_t io_channel_write_byte(io_channel channel, - unsigned long offset, - int count, const void *data); -extern errcode_t io_channel_read_blk64(io_channel channel, - unsigned long long block, - int count, void *data); -extern errcode_t io_channel_write_blk64(io_channel channel, - unsigned long long block, - int count, const void *data); - -/* unix_io.c */ -extern io_manager unix_io_manager; - -/* undo_io.c */ -extern io_manager undo_io_manager; -extern errcode_t set_undo_io_backing_manager(io_manager manager); -extern errcode_t set_undo_io_backup_file(char *file_name); - -/* test_io.c */ -extern io_manager test_io_manager, test_io_backing_manager; -extern void (*test_io_cb_read_blk) - (unsigned long block, int count, errcode_t err); -extern void (*test_io_cb_write_blk) - (unsigned long block, int count, errcode_t err); -extern void (*test_io_cb_read_blk64) - (unsigned long long block, int count, errcode_t err); -extern void (*test_io_cb_write_blk64) - (unsigned long long block, int count, errcode_t err); -extern void (*test_io_cb_set_blksize) - (int blksize, errcode_t err); - -#endif /* _EXT2FS_EXT2_IO_H */ - diff --git a/source/libs/libext2fs/ext2_types.h b/source/libs/libext2fs/ext2_types.h deleted file mode 100644 index 5f5f7a57..00000000 --- a/source/libs/libext2fs/ext2_types.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * If linux/types.h is already been included, assume it has defined - * everything we need. (cross fingers) Other header files may have - * also defined the types that we need. - */ -#ifndef _EXT2_TYPES_H -#define _EXT2_TYPES_H - -typedef unsigned char __u8; -typedef signed char __s8; -typedef unsigned short __u16; -typedef short __s16; -typedef unsigned int __u32; -typedef int __s32; -typedef unsigned long long __u64; -typedef signed long long __s64; - -#endif /* _EXT2_TYPES_H */ diff --git a/source/libs/libext2fs/ext2fs.h b/source/libs/libext2fs/ext2fs.h deleted file mode 100644 index ce3b88de..00000000 --- a/source/libs/libext2fs/ext2fs.h +++ /dev/null @@ -1,1572 +0,0 @@ -/* - * ext2fs.h --- ext2fs - * - * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. - * - * %Begin-Header% - * This file may be redistributed under the terms of the GNU Library - * General Public License, version 2. - * %End-Header% - */ - -#ifndef _EXT2FS_EXT2FS_H -#define _EXT2FS_EXT2FS_H - -#ifdef __GNUC__ -#define EXT2FS_ATTR(x) __attribute__(x) -#else -#define EXT2FS_ATTR(x) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Non-GNU C compilers won't necessarily understand inline - */ -#if (!defined(__GNUC__) && !defined(__WATCOMC__)) -#define NO_INLINE_FUNCS -#endif - -/* - * Where the master copy of the superblock is located, and how big - * superblocks are supposed to be. We define SUPERBLOCK_SIZE because - * the size of the superblock structure is not necessarily trustworthy - * (some versions have the padding set up so that the superblock is - * 1032 bytes long). - */ -#define SUPERBLOCK_OFFSET 1024 -#define SUPERBLOCK_SIZE 1024 - -/* - * The last ext2fs revision level that this version of the library is - * able to support. - */ -#define EXT2_LIB_CURRENT_REV EXT2_DYNAMIC_REV - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#include -#include -#include -#include - -#include "ext2_types.h" -#include "com_err.h" -#include "ext2_fs.h" -#include "ext3_extents.h" - -typedef __u32 ext2_ino_t; -typedef __u32 blk_t; -typedef __u64 blk64_t; -typedef __u32 dgrp_t; -typedef __u32 ext2_off_t; -typedef __u64 ext2_off64_t; -typedef __s64 e2_blkcnt_t; -typedef __u32 ext2_dirhash_t; - -#include "ext2_io.h" -#include "ext2_err.h" -#include "ext2_ext_attr.h" - -/* - * Portability help for Microsoft Visual C++ - */ -#ifdef _MSC_VER -#define EXT2_QSORT_TYPE int __cdecl -#else -#define EXT2_QSORT_TYPE int -#endif - -typedef struct struct_ext2_filsys *ext2_filsys; - -#define EXT2FS_MARK_ERROR 0 -#define EXT2FS_UNMARK_ERROR 1 -#define EXT2FS_TEST_ERROR 2 - -typedef struct ext2fs_struct_generic_bitmap *ext2fs_generic_bitmap; -typedef struct ext2fs_struct_generic_bitmap *ext2fs_inode_bitmap; -typedef struct ext2fs_struct_generic_bitmap *ext2fs_block_bitmap; - -#define EXT2_FIRST_INODE(s) EXT2_FIRST_INO(s) - - -/* - * Badblocks list definitions - */ - -typedef struct ext2_struct_u32_list *ext2_badblocks_list; -typedef struct ext2_struct_u32_iterate *ext2_badblocks_iterate; - -typedef struct ext2_struct_u32_list *ext2_u32_list; -typedef struct ext2_struct_u32_iterate *ext2_u32_iterate; - -/* old */ -typedef struct ext2_struct_u32_list *badblocks_list; -typedef struct ext2_struct_u32_iterate *badblocks_iterate; - -#define BADBLOCKS_FLAG_DIRTY 1 - -/* - * ext2_dblist structure and abstractions (see dblist.c) - */ -struct ext2_db_entry2 { - ext2_ino_t ino; - blk64_t blk; - e2_blkcnt_t blockcnt; -}; - -/* Ye Olde 32-bit version */ -struct ext2_db_entry { - ext2_ino_t ino; - blk_t blk; - int blockcnt; -}; - -typedef struct ext2_struct_dblist *ext2_dblist; - -#define DBLIST_ABORT 1 - -/* - * ext2_fileio definitions - */ - -#define EXT2_FILE_WRITE 0x0001 -#define EXT2_FILE_CREATE 0x0002 - -#define EXT2_FILE_MASK 0x00FF - -#define EXT2_FILE_BUF_DIRTY 0x4000 -#define EXT2_FILE_BUF_VALID 0x2000 - -typedef struct ext2_file *ext2_file_t; - -#define EXT2_SEEK_SET 0 -#define EXT2_SEEK_CUR 1 -#define EXT2_SEEK_END 2 - -/* - * Flags for the ext2_filsys structure and for ext2fs_open() - */ -#define EXT2_FLAG_RW 0x01 -#define EXT2_FLAG_CHANGED 0x02 -#define EXT2_FLAG_DIRTY 0x04 -#define EXT2_FLAG_VALID 0x08 -#define EXT2_FLAG_IB_DIRTY 0x10 -#define EXT2_FLAG_BB_DIRTY 0x20 -#define EXT2_FLAG_SWAP_BYTES 0x40 -#define EXT2_FLAG_SWAP_BYTES_READ 0x80 -#define EXT2_FLAG_SWAP_BYTES_WRITE 0x100 -#define EXT2_FLAG_MASTER_SB_ONLY 0x200 -#define EXT2_FLAG_FORCE 0x400 -#define EXT2_FLAG_SUPER_ONLY 0x800 -#define EXT2_FLAG_JOURNAL_DEV_OK 0x1000 -#define EXT2_FLAG_IMAGE_FILE 0x2000 -#define EXT2_FLAG_EXCLUSIVE 0x4000 -#define EXT2_FLAG_SOFTSUPP_FEATURES 0x8000 -#define EXT2_FLAG_NOFREE_ON_ERROR 0x10000 -#define EXT2_FLAG_64BITS 0x20000 -#define EXT2_FLAG_PRINT_PROGRESS 0x40000 -#define EXT2_FLAG_DIRECT_IO 0x80000 - -/* - * Special flag in the ext2 inode i_flag field that means that this is - * a new inode. (So that ext2_write_inode() can clear extra fields.) - */ -#define EXT2_NEW_INODE_FL 0x80000000 - -/* - * Flags for mkjournal - * - * EXT2_MKJOURNAL_V1_SUPER Make a (deprecated) V1 journal superblock - */ -#define EXT2_MKJOURNAL_V1_SUPER 0x0000001 - -struct opaque_ext2_group_desc; - -struct struct_ext2_filsys { - errcode_t magic; - io_channel io; - int flags; - char * device_name; - struct ext2_super_block * super; - unsigned int blocksize; - int fragsize; - dgrp_t group_desc_count; - unsigned long desc_blocks; - struct opaque_ext2_group_desc * group_desc; - int inode_blocks_per_group; - ext2fs_inode_bitmap inode_map; - ext2fs_block_bitmap block_map; - /* XXX FIXME-64: not 64-bit safe, but not used? */ - errcode_t (*get_blocks)(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks); - errcode_t (*check_directory)(ext2_filsys fs, ext2_ino_t ino); - errcode_t (*write_bitmaps)(ext2_filsys fs); - errcode_t (*read_inode)(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode); - errcode_t (*write_inode)(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode); - ext2_badblocks_list badblocks; - ext2_dblist dblist; - __u32 stride; /* for mke2fs */ - struct ext2_super_block * orig_super; - struct ext2_image_hdr * image_header; - __u32 umask; - time_t now; - /* - * Reserved for future expansion - */ - __u32 reserved[7]; - - /* - * Reserved for the use of the calling application. - */ - void * priv_data; - - /* - * Inode cache - */ - struct ext2_inode_cache *icache; - io_channel image_io; - - /* - * More callback functions - */ - errcode_t (*get_alloc_block)(ext2_filsys fs, blk64_t goal, - blk64_t *ret); - void (*block_alloc_stats)(ext2_filsys fs, blk64_t blk, int inuse); -}; - -#include "bitops.h" - -/* - * Return flags for the block iterator functions - */ -#define BLOCK_CHANGED 1 -#define BLOCK_ABORT 2 -#define BLOCK_ERROR 4 - -/* - * Block interate flags - * - * BLOCK_FLAG_APPEND, or BLOCK_FLAG_HOLE, indicates that the interator - * function should be called on blocks where the block number is zero. - * This is used by ext2fs_expand_dir() to be able to add a new block - * to an inode. It can also be used for programs that want to be able - * to deal with files that contain "holes". - * - * BLOCK_FLAG_DEPTH_TRAVERSE indicates that the iterator function for - * the indirect, doubly indirect, etc. blocks should be called after - * all of the blocks containined in the indirect blocks are processed. - * This is useful if you are going to be deallocating blocks from an - * inode. - * - * BLOCK_FLAG_DATA_ONLY indicates that the iterator function should be - * called for data blocks only. - * - * BLOCK_FLAG_READ_ONLY is a promise by the caller that it will not - * modify returned block number. - * - * BLOCK_FLAG_NO_LARGE is for internal use only. It informs - * ext2fs_block_iterate2 that large files won't be accepted. - */ -#define BLOCK_FLAG_APPEND 1 -#define BLOCK_FLAG_HOLE 1 -#define BLOCK_FLAG_DEPTH_TRAVERSE 2 -#define BLOCK_FLAG_DATA_ONLY 4 -#define BLOCK_FLAG_READ_ONLY 8 - -#define BLOCK_FLAG_NO_LARGE 0x1000 - -/* - * Magic "block count" return values for the block iterator function. - */ -#define BLOCK_COUNT_IND (-1) -#define BLOCK_COUNT_DIND (-2) -#define BLOCK_COUNT_TIND (-3) -#define BLOCK_COUNT_TRANSLATOR (-4) - -/* - * Flags for ext2fs_move_blocks - */ -#define EXT2_BMOVE_GET_DBLIST 0x0001 -#define EXT2_BMOVE_DEBUG 0x0002 - -/* - * Generic (non-filesystem layout specific) extents structure - */ - -#define EXT2_EXTENT_FLAGS_LEAF 0x0001 -#define EXT2_EXTENT_FLAGS_UNINIT 0x0002 -#define EXT2_EXTENT_FLAGS_SECOND_VISIT 0x0004 - -struct ext2fs_extent { - blk64_t e_pblk; /* first physical block */ - blk64_t e_lblk; /* first logical block extent covers */ - __u32 e_len; /* number of blocks covered by extent */ - __u32 e_flags; /* extent flags */ -}; - -typedef struct ext2_extent_handle *ext2_extent_handle_t; -typedef struct ext2_extent_path *ext2_extent_path_t; - -/* - * Flags used by ext2fs_extent_get() - */ -#define EXT2_EXTENT_CURRENT 0x0000 -#define EXT2_EXTENT_MOVE_MASK 0x000F -#define EXT2_EXTENT_ROOT 0x0001 -#define EXT2_EXTENT_LAST_LEAF 0x0002 -#define EXT2_EXTENT_FIRST_SIB 0x0003 -#define EXT2_EXTENT_LAST_SIB 0x0004 -#define EXT2_EXTENT_NEXT_SIB 0x0005 -#define EXT2_EXTENT_PREV_SIB 0x0006 -#define EXT2_EXTENT_NEXT_LEAF 0x0007 -#define EXT2_EXTENT_PREV_LEAF 0x0008 -#define EXT2_EXTENT_NEXT 0x0009 -#define EXT2_EXTENT_PREV 0x000A -#define EXT2_EXTENT_UP 0x000B -#define EXT2_EXTENT_DOWN 0x000C -#define EXT2_EXTENT_DOWN_AND_LAST 0x000D - -/* - * Flags used by ext2fs_extent_insert() - */ -#define EXT2_EXTENT_INSERT_AFTER 0x0001 /* insert after handle loc'n */ -#define EXT2_EXTENT_INSERT_NOSPLIT 0x0002 /* insert may not cause split */ - -/* - * Flags used by ext2fs_extent_delete() - */ -#define EXT2_EXTENT_DELETE_KEEP_EMPTY 0x001 /* keep node if last extnt gone */ - -/* - * Flags used by ext2fs_extent_set_bmap() - */ -#define EXT2_EXTENT_SET_BMAP_UNINIT 0x0001 - -/* - * Data structure returned by ext2fs_extent_get_info() - */ -struct ext2_extent_info { - int curr_entry; - int curr_level; - int num_entries; - int max_entries; - int max_depth; - int bytes_avail; - blk64_t max_lblk; - blk64_t max_pblk; - __u32 max_len; - __u32 max_uninit_len; -}; - -/* - * Flags for directory block reading and writing functions - */ -#define EXT2_DIRBLOCK_V2_STRUCT 0x0001 - -/* - * Return flags for the directory iterator functions - */ -#define DIRENT_CHANGED 1 -#define DIRENT_ABORT 2 -#define DIRENT_ERROR 3 - -/* - * Directory iterator flags - */ - -#define DIRENT_FLAG_INCLUDE_EMPTY 1 -#define DIRENT_FLAG_INCLUDE_REMOVED 2 - -#define DIRENT_DOT_FILE 1 -#define DIRENT_DOT_DOT_FILE 2 -#define DIRENT_OTHER_FILE 3 -#define DIRENT_DELETED_FILE 4 - -/* - * Inode scan definitions - */ -typedef struct ext2_struct_inode_scan *ext2_inode_scan; - -/* - * ext2fs_scan flags - */ -#define EXT2_SF_CHK_BADBLOCKS 0x0001 -#define EXT2_SF_BAD_INODE_BLK 0x0002 -#define EXT2_SF_BAD_EXTRA_BYTES 0x0004 -#define EXT2_SF_SKIP_MISSING_ITABLE 0x0008 -#define EXT2_SF_DO_LAZY 0x0010 - -/* - * ext2fs_check_if_mounted flags - */ -#define EXT2_MF_MOUNTED 1 -#define EXT2_MF_ISROOT 2 -#define EXT2_MF_READONLY 4 -#define EXT2_MF_SWAP 8 -#define EXT2_MF_BUSY 16 - -/* - * Ext2/linux mode flags. We define them here so that we don't need - * to depend on the OS's sys/stat.h, since we may be compiling on a - * non-Linux system. - */ -#define LINUX_S_IFMT 00170000 -#define LINUX_S_IFSOCK 0140000 -#define LINUX_S_IFLNK 0120000 -#define LINUX_S_IFREG 0100000 -#define LINUX_S_IFBLK 0060000 -#define LINUX_S_IFDIR 0040000 -#define LINUX_S_IFCHR 0020000 -#define LINUX_S_IFIFO 0010000 -#define LINUX_S_ISUID 0004000 -#define LINUX_S_ISGID 0002000 -#define LINUX_S_ISVTX 0001000 - -#define LINUX_S_IRWXU 00700 -#define LINUX_S_IRUSR 00400 -#define LINUX_S_IWUSR 00200 -#define LINUX_S_IXUSR 00100 - -#define LINUX_S_IRWXG 00070 -#define LINUX_S_IRGRP 00040 -#define LINUX_S_IWGRP 00020 -#define LINUX_S_IXGRP 00010 - -#define LINUX_S_IRWXO 00007 -#define LINUX_S_IROTH 00004 -#define LINUX_S_IWOTH 00002 -#define LINUX_S_IXOTH 00001 - -#define LINUX_S_ISLNK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFLNK) -#define LINUX_S_ISREG(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFREG) -#define LINUX_S_ISDIR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFDIR) -#define LINUX_S_ISCHR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFCHR) -#define LINUX_S_ISBLK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFBLK) -#define LINUX_S_ISFIFO(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFIFO) -#define LINUX_S_ISSOCK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFSOCK) - -/* - * ext2 size of an inode - */ -#define EXT2_I_SIZE(i) ((i)->i_size | ((__u64) (i)->i_size_high << 32)) - -/* - * ext2_icount_t abstraction - */ -#define EXT2_ICOUNT_OPT_INCREMENT 0x01 - -typedef struct ext2_icount *ext2_icount_t; - -/* - * Flags for ext2fs_bmap - */ -#define BMAP_ALLOC 0x0001 -#define BMAP_SET 0x0002 - -/* - * Returned flags from ext2fs_bmap - */ -#define BMAP_RET_UNINIT 0x0001 - -/* - * Flags for imager.c functions - */ -#define IMAGER_FLAG_INODEMAP 1 -#define IMAGER_FLAG_SPARSEWRITE 2 - -/* - * For checking structure magic numbers... - */ - -#define EXT2_CHECK_MAGIC(struct, code) \ - if ((struct)->magic != (code)) return (code) - - -/* - * For ext2 compression support - */ -#define EXT2FS_COMPRESSED_BLKADDR ((blk_t) -1) -#define HOLE_BLKADDR(_b) ((_b) == 0 || (_b) == EXT2FS_COMPRESSED_BLKADDR) - -/* - * Features supported by this version of the library - */ -#define EXT2_LIB_FEATURE_COMPAT_SUPP (EXT2_FEATURE_COMPAT_DIR_PREALLOC|\ - EXT2_FEATURE_COMPAT_IMAGIC_INODES|\ - EXT3_FEATURE_COMPAT_HAS_JOURNAL|\ - EXT2_FEATURE_COMPAT_RESIZE_INODE|\ - EXT2_FEATURE_COMPAT_DIR_INDEX|\ - EXT2_FEATURE_COMPAT_EXT_ATTR) - -/* This #ifdef is temporary until compression is fully supported */ -#ifdef ENABLE_COMPRESSION -#ifndef I_KNOW_THAT_COMPRESSION_IS_EXPERIMENTAL -/* If the below warning bugs you, then have - `CPPFLAGS=-DI_KNOW_THAT_COMPRESSION_IS_EXPERIMENTAL' in your - environment at configure time. */ - #warning "Compression support is experimental" -#endif -#define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE|\ - EXT2_FEATURE_INCOMPAT_COMPRESSION|\ - EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\ - EXT2_FEATURE_INCOMPAT_META_BG|\ - EXT3_FEATURE_INCOMPAT_RECOVER|\ - EXT3_FEATURE_INCOMPAT_EXTENTS|\ - EXT4_FEATURE_INCOMPAT_FLEX_BG|\ - EXT4_FEATURE_INCOMPAT_64BIT) -#else -#define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE|\ - EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\ - EXT2_FEATURE_INCOMPAT_META_BG|\ - EXT3_FEATURE_INCOMPAT_RECOVER|\ - EXT3_FEATURE_INCOMPAT_EXTENTS|\ - EXT4_FEATURE_INCOMPAT_FLEX_BG|\ - EXT4_FEATURE_INCOMPAT_64BIT) -#endif -#define EXT2_LIB_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|\ - EXT4_FEATURE_RO_COMPAT_HUGE_FILE|\ - EXT2_FEATURE_RO_COMPAT_LARGE_FILE|\ - EXT4_FEATURE_RO_COMPAT_DIR_NLINK|\ - EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE|\ - EXT4_FEATURE_RO_COMPAT_GDT_CSUM) - -/* - * These features are only allowed if EXT2_FLAG_SOFTSUPP_FEATURES is passed - * to ext2fs_openfs() - */ -#define EXT2_LIB_SOFTSUPP_INCOMPAT (0) -#define EXT2_LIB_SOFTSUPP_RO_COMPAT (0) - -/* - * function prototypes - */ - -/* alloc.c */ -extern errcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir, int mode, - ext2fs_inode_bitmap map, ext2_ino_t *ret); -extern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal, - ext2fs_block_bitmap map, blk_t *ret); -extern errcode_t ext2fs_new_block2(ext2_filsys fs, blk64_t goal, - ext2fs_block_bitmap map, blk64_t *ret); -extern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start, - blk_t finish, int num, - ext2fs_block_bitmap map, - blk_t *ret); -extern errcode_t ext2fs_get_free_blocks2(ext2_filsys fs, blk64_t start, - blk64_t finish, int num, - ext2fs_block_bitmap map, - blk64_t *ret); -extern errcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal, - char *block_buf, blk_t *ret); -extern errcode_t ext2fs_alloc_block2(ext2_filsys fs, blk64_t goal, - char *block_buf, blk64_t *ret); -extern void ext2fs_set_alloc_block_callback(ext2_filsys fs, - errcode_t (*func)(ext2_filsys fs, - blk64_t goal, - blk64_t *ret), - errcode_t (**old)(ext2_filsys fs, - blk64_t goal, - blk64_t *ret)); - -/* alloc_sb.c */ -extern int ext2fs_reserve_super_and_bgd(ext2_filsys fs, - dgrp_t group, - ext2fs_block_bitmap bmap); -extern void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs, - void (*func)(ext2_filsys fs, - blk64_t blk, - int inuse), - void (**old)(ext2_filsys fs, - blk64_t blk, - int inuse)); - -/* alloc_stats.c */ -void ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse); -void ext2fs_inode_alloc_stats2(ext2_filsys fs, ext2_ino_t ino, - int inuse, int isdir); -void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse); -void ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse); - -/* alloc_tables.c */ -extern errcode_t ext2fs_allocate_tables(ext2_filsys fs); -extern errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, - ext2fs_block_bitmap bmap); - -/* badblocks.c */ -extern errcode_t ext2fs_u32_list_create(ext2_u32_list *ret, int size); -extern errcode_t ext2fs_u32_list_add(ext2_u32_list bb, __u32 blk); -extern int ext2fs_u32_list_find(ext2_u32_list bb, __u32 blk); -extern int ext2fs_u32_list_test(ext2_u32_list bb, blk_t blk); -extern errcode_t ext2fs_u32_list_iterate_begin(ext2_u32_list bb, - ext2_u32_iterate *ret); -extern int ext2fs_u32_list_iterate(ext2_u32_iterate iter, blk_t *blk); -extern void ext2fs_u32_list_iterate_end(ext2_u32_iterate iter); -extern errcode_t ext2fs_u32_copy(ext2_u32_list src, ext2_u32_list *dest); -extern int ext2fs_u32_list_equal(ext2_u32_list bb1, ext2_u32_list bb2); - -extern errcode_t ext2fs_badblocks_list_create(ext2_badblocks_list *ret, - int size); -extern errcode_t ext2fs_badblocks_list_add(ext2_badblocks_list bb, - blk_t blk); -extern int ext2fs_badblocks_list_test(ext2_badblocks_list bb, - blk_t blk); -extern int ext2fs_u32_list_del(ext2_u32_list bb, __u32 blk); -extern void ext2fs_badblocks_list_del(ext2_u32_list bb, __u32 blk); -extern errcode_t - ext2fs_badblocks_list_iterate_begin(ext2_badblocks_list bb, - ext2_badblocks_iterate *ret); -extern int ext2fs_badblocks_list_iterate(ext2_badblocks_iterate iter, - blk_t *blk); -extern void ext2fs_badblocks_list_iterate_end(ext2_badblocks_iterate iter); -extern errcode_t ext2fs_badblocks_copy(ext2_badblocks_list src, - ext2_badblocks_list *dest); -extern int ext2fs_badblocks_equal(ext2_badblocks_list bb1, - ext2_badblocks_list bb2); -extern int ext2fs_u32_list_count(ext2_u32_list bb); - -/* bb_compat */ -extern errcode_t badblocks_list_create(badblocks_list *ret, int size); -extern errcode_t badblocks_list_add(badblocks_list bb, blk_t blk); -extern int badblocks_list_test(badblocks_list bb, blk_t blk); -extern errcode_t badblocks_list_iterate_begin(badblocks_list bb, - badblocks_iterate *ret); -extern int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk); -extern void badblocks_list_iterate_end(badblocks_iterate iter); -extern void badblocks_list_free(badblocks_list bb); - -/* bb_inode.c */ -extern errcode_t ext2fs_update_bb_inode(ext2_filsys fs, - ext2_badblocks_list bb_list); - -/* bitmaps.c */ -extern void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap); -extern void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap); -extern errcode_t ext2fs_copy_bitmap(ext2fs_generic_bitmap src, - ext2fs_generic_bitmap *dest); -extern errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs); -extern errcode_t ext2fs_write_block_bitmap (ext2_filsys fs); -extern errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs); -extern errcode_t ext2fs_read_block_bitmap(ext2_filsys fs); -extern errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, - const char *descr, - ext2fs_block_bitmap *ret); -extern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, - const char *descr, - ext2fs_inode_bitmap *ret); -extern errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap, - ext2_ino_t end, ext2_ino_t *oend); -extern errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap, - blk_t end, blk_t *oend); -extern errcode_t ext2fs_fudge_block_bitmap_end2(ext2fs_block_bitmap bitmap, - blk64_t end, blk64_t *oend); -extern void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap); -extern void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap); -extern errcode_t ext2fs_read_bitmaps(ext2_filsys fs); -extern errcode_t ext2fs_write_bitmaps(ext2_filsys fs); -extern errcode_t ext2fs_resize_inode_bitmap(__u32 new_end, __u32 new_real_end, - ext2fs_inode_bitmap bmap); -extern errcode_t ext2fs_resize_inode_bitmap2(__u64 new_end, - __u64 new_real_end, - ext2fs_inode_bitmap bmap); -extern errcode_t ext2fs_resize_block_bitmap(__u32 new_end, __u32 new_real_end, - ext2fs_block_bitmap bmap); -extern errcode_t ext2fs_resize_block_bitmap2(__u64 new_end, - __u64 new_real_end, - ext2fs_block_bitmap bmap); -extern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1, - ext2fs_block_bitmap bm2); -extern errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1, - ext2fs_inode_bitmap bm2); -extern errcode_t ext2fs_set_inode_bitmap_range(ext2fs_inode_bitmap bmap, - ext2_ino_t start, unsigned int num, - void *in); -extern errcode_t ext2fs_set_inode_bitmap_range2(ext2fs_inode_bitmap bmap, - __u64 start, size_t num, - void *in); -extern errcode_t ext2fs_get_inode_bitmap_range(ext2fs_inode_bitmap bmap, - ext2_ino_t start, unsigned int num, - void *out); -extern errcode_t ext2fs_get_inode_bitmap_range2(ext2fs_inode_bitmap bmap, - __u64 start, size_t num, - void *out); -extern errcode_t ext2fs_set_block_bitmap_range(ext2fs_block_bitmap bmap, - blk_t start, unsigned int num, - void *in); -extern errcode_t ext2fs_set_block_bitmap_range2(ext2fs_block_bitmap bmap, - blk64_t start, size_t num, - void *in); -extern errcode_t ext2fs_get_block_bitmap_range(ext2fs_block_bitmap bmap, - blk_t start, unsigned int num, - void *out); -extern errcode_t ext2fs_get_block_bitmap_range2(ext2fs_block_bitmap bmap, - blk64_t start, size_t num, - void *out); - -/* blknum.c */ -extern dgrp_t ext2fs_group_of_blk2(ext2_filsys fs, blk64_t); -extern blk64_t ext2fs_group_first_block2(ext2_filsys fs, dgrp_t group); -extern blk64_t ext2fs_group_last_block2(ext2_filsys fs, dgrp_t group); -extern blk64_t ext2fs_inode_data_blocks2(ext2_filsys fs, - struct ext2_inode *inode); -extern blk64_t ext2fs_inode_i_blocks(ext2_filsys fs, - struct ext2_inode *inode); -extern blk64_t ext2fs_blocks_count(struct ext2_super_block *super); -extern void ext2fs_blocks_count_set(struct ext2_super_block *super, - blk64_t blk); -extern void ext2fs_blocks_count_add(struct ext2_super_block *super, - blk64_t blk); -extern blk64_t ext2fs_r_blocks_count(struct ext2_super_block *super); -extern void ext2fs_r_blocks_count_set(struct ext2_super_block *super, - blk64_t blk); -extern void ext2fs_r_blocks_count_add(struct ext2_super_block *super, - blk64_t blk); -extern blk64_t ext2fs_free_blocks_count(struct ext2_super_block *super); -extern void ext2fs_free_blocks_count_set(struct ext2_super_block *super, - blk64_t blk); -extern void ext2fs_free_blocks_count_add(struct ext2_super_block *super, - blk64_t blk); -/* Block group descriptor accessor functions */ -extern struct ext2_group_desc *ext2fs_group_desc(ext2_filsys fs, - struct opaque_ext2_group_desc *gdp, - dgrp_t group); -extern blk64_t ext2fs_block_bitmap_loc(ext2_filsys fs, dgrp_t group); -extern void ext2fs_block_bitmap_loc_set(ext2_filsys fs, dgrp_t group, - blk64_t blk); -extern blk64_t ext2fs_inode_bitmap_loc(ext2_filsys fs, dgrp_t group); -extern void ext2fs_inode_bitmap_loc_set(ext2_filsys fs, dgrp_t group, - blk64_t blk); -extern blk64_t ext2fs_inode_table_loc(ext2_filsys fs, dgrp_t group); -extern void ext2fs_inode_table_loc_set(ext2_filsys fs, dgrp_t group, - blk64_t blk); -extern __u32 ext2fs_bg_free_blocks_count(ext2_filsys fs, dgrp_t group); -extern void ext2fs_bg_free_blocks_count_set(ext2_filsys fs, dgrp_t group, - __u32 n); -extern __u32 ext2fs_bg_free_inodes_count(ext2_filsys fs, dgrp_t group); -extern void ext2fs_bg_free_inodes_count_set(ext2_filsys fs, dgrp_t group, - __u32 n); -extern __u32 ext2fs_bg_used_dirs_count(ext2_filsys fs, dgrp_t group); -extern void ext2fs_bg_used_dirs_count_set(ext2_filsys fs, dgrp_t group, - __u32 n); -extern __u32 ext2fs_bg_itable_unused(ext2_filsys fs, dgrp_t group); -extern void ext2fs_bg_itable_unused_set(ext2_filsys fs, dgrp_t group, - __u32 n); -extern __u16 ext2fs_bg_flags(ext2_filsys fs, dgrp_t group); -extern void ext2fs_bg_flags_zap(ext2_filsys fs, dgrp_t group); -extern int ext2fs_bg_flags_test(ext2_filsys fs, dgrp_t group, __u16 bg_flag); -extern void ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags); -extern void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flags); -extern __u16 ext2fs_bg_checksum(ext2_filsys fs, dgrp_t group); -extern void ext2fs_bg_checksum_set(ext2_filsys fs, dgrp_t group, __u16 checksum); -extern blk64_t ext2fs_file_acl_block(const struct ext2_inode *inode); -extern void ext2fs_file_acl_block_set(struct ext2_inode *inode, blk64_t blk); - -/* block.c */ -extern errcode_t ext2fs_block_iterate(ext2_filsys fs, - ext2_ino_t ino, - int flags, - char *block_buf, - int (*func)(ext2_filsys fs, - blk_t *blocknr, - int blockcnt, - void *priv_data), - void *priv_data); -errcode_t ext2fs_block_iterate2(ext2_filsys fs, - ext2_ino_t ino, - int flags, - char *block_buf, - int (*func)(ext2_filsys fs, - blk_t *blocknr, - e2_blkcnt_t blockcnt, - blk_t ref_blk, - int ref_offset, - void *priv_data), - void *priv_data); -errcode_t ext2fs_block_iterate3(ext2_filsys fs, - ext2_ino_t ino, - int flags, - char *block_buf, - int (*func)(ext2_filsys fs, - blk64_t *blocknr, - e2_blkcnt_t blockcnt, - blk64_t ref_blk, - int ref_offset, - void *priv_data), - void *priv_data); - -/* bmap.c */ -extern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode, - char *block_buf, int bmap_flags, - blk_t block, blk_t *phys_blk); -extern errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode, - char *block_buf, int bmap_flags, blk64_t block, - int *ret_flags, blk64_t *phys_blk); - -#if 0 -/* bmove.c */ -extern errcode_t ext2fs_move_blocks(ext2_filsys fs, - ext2fs_block_bitmap reserve, - ext2fs_block_bitmap alloc_map, - int flags); -#endif - -/* check_desc.c */ -extern errcode_t ext2fs_check_desc(ext2_filsys fs); - -/* closefs.c */ -extern errcode_t ext2fs_close(ext2_filsys fs); -extern errcode_t ext2fs_flush(ext2_filsys fs); -extern int ext2fs_bg_has_super(ext2_filsys fs, int group_block); -extern errcode_t ext2fs_super_and_bgd_loc2(ext2_filsys fs, - dgrp_t group, - blk64_t *ret_super_blk, - blk64_t *ret_old_desc_blk, - blk64_t *ret_new_desc_blk, - blk_t *ret_used_blks); -extern int ext2fs_super_and_bgd_loc(ext2_filsys fs, - dgrp_t group, - blk_t *ret_super_blk, - blk_t *ret_old_desc_blk, - blk_t *ret_new_desc_blk, - int *ret_meta_bg); -extern void ext2fs_update_dynamic_rev(ext2_filsys fs); - -/* csum.c */ -extern void ext2fs_group_desc_csum_set(ext2_filsys fs, dgrp_t group); -extern int ext2fs_group_desc_csum_verify(ext2_filsys fs, dgrp_t group); -extern errcode_t ext2fs_set_gdt_csum(ext2_filsys fs); - -/* dblist.c */ - -extern errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs); -extern errcode_t ext2fs_init_dblist(ext2_filsys fs, ext2_dblist *ret_dblist); -extern errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ext2_ino_t ino, - blk_t blk, int blockcnt); -extern errcode_t ext2fs_add_dir_block2(ext2_dblist dblist, ext2_ino_t ino, - blk64_t blk, e2_blkcnt_t blockcnt); -extern void ext2fs_dblist_sort(ext2_dblist dblist, - EXT2_QSORT_TYPE (*sortfunc)(const void *, - const void *)); -extern void ext2fs_dblist_sort2(ext2_dblist dblist, - EXT2_QSORT_TYPE (*sortfunc)(const void *, - const void *)); -extern errcode_t ext2fs_dblist_iterate(ext2_dblist dblist, - int (*func)(ext2_filsys fs, struct ext2_db_entry *db_info, - void *priv_data), - void *priv_data); -extern errcode_t ext2fs_dblist_iterate2(ext2_dblist dblist, - int (*func)(ext2_filsys fs, struct ext2_db_entry2 *db_info, - void *priv_data), - void *priv_data); -extern errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ext2_ino_t ino, - blk_t blk, int blockcnt); -extern errcode_t ext2fs_set_dir_block2(ext2_dblist dblist, ext2_ino_t ino, - blk64_t blk, e2_blkcnt_t blockcnt); -extern errcode_t ext2fs_copy_dblist(ext2_dblist src, - ext2_dblist *dest); -extern int ext2fs_dblist_count(ext2_dblist dblist); -extern blk64_t ext2fs_dblist_count2(ext2_dblist dblist); -extern errcode_t ext2fs_dblist_get_last(ext2_dblist dblist, - struct ext2_db_entry **entry); -extern errcode_t ext2fs_dblist_get_last2(ext2_dblist dblist, - struct ext2_db_entry2 **entry); -extern errcode_t ext2fs_dblist_drop_last(ext2_dblist dblist); - -/* dblist_dir.c */ -extern errcode_t - ext2fs_dblist_dir_iterate(ext2_dblist dblist, - int flags, - char *block_buf, - int (*func)(ext2_ino_t dir, - int entry, - struct ext2_dir_entry *dirent, - int offset, - int blocksize, - char *buf, - void *priv_data), - void *priv_data); - -/* dirblock.c */ -extern errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block, - void *buf); -extern errcode_t ext2fs_read_dir_block2(ext2_filsys fs, blk_t block, - void *buf, int flags); -extern errcode_t ext2fs_read_dir_block3(ext2_filsys fs, blk64_t block, - void *buf, int flags); -extern errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block, - void *buf); -extern errcode_t ext2fs_write_dir_block2(ext2_filsys fs, blk_t block, - void *buf, int flags); -extern errcode_t ext2fs_write_dir_block3(ext2_filsys fs, blk64_t block, - void *buf, int flags); - -/* dirhash.c */ -extern errcode_t ext2fs_dirhash(int version, const char *name, int len, - const __u32 *seed, - ext2_dirhash_t *ret_hash, - ext2_dirhash_t *ret_minor_hash); - - -/* dir_iterate.c */ -extern errcode_t ext2fs_get_rec_len(ext2_filsys fs, - struct ext2_dir_entry *dirent, - unsigned int *rec_len); -extern errcode_t ext2fs_set_rec_len(ext2_filsys fs, - unsigned int len, - struct ext2_dir_entry *dirent); -extern errcode_t ext2fs_dir_iterate(ext2_filsys fs, - ext2_ino_t dir, - int flags, - char *block_buf, - int (*func)(struct ext2_dir_entry *dirent, - int offset, - int blocksize, - char *buf, - void *priv_data), - void *priv_data); -extern errcode_t ext2fs_dir_iterate2(ext2_filsys fs, - ext2_ino_t dir, - int flags, - char *block_buf, - int (*func)(ext2_ino_t dir, - int entry, - struct ext2_dir_entry *dirent, - int offset, - int blocksize, - char *buf, - void *priv_data), - void *priv_data); - -/* dupfs.c */ -extern errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest); - -/* expanddir.c */ -extern errcode_t ext2fs_expand_dir(ext2_filsys fs, ext2_ino_t dir); - -/* ext_attr.c */ -extern __u32 ext2fs_ext_attr_hash_entry(struct ext2_ext_attr_entry *entry, - void *data); -extern errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf); -extern errcode_t ext2fs_read_ext_attr2(ext2_filsys fs, blk64_t block, - void *buf); -extern errcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block, - void *buf); -extern errcode_t ext2fs_write_ext_attr2(ext2_filsys fs, blk64_t block, - void *buf); -extern errcode_t ext2fs_adjust_ea_refcount(ext2_filsys fs, blk_t blk, - char *block_buf, - int adjust, __u32 *newcount); -extern errcode_t ext2fs_adjust_ea_refcount2(ext2_filsys fs, blk64_t blk, - char *block_buf, - int adjust, __u32 *newcount); - -/* extent.c */ -extern errcode_t ext2fs_extent_header_verify(void *ptr, int size); -extern errcode_t ext2fs_extent_open(ext2_filsys fs, ext2_ino_t ino, - ext2_extent_handle_t *handle); -extern errcode_t ext2fs_extent_open2(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode, - ext2_extent_handle_t *ret_handle); -extern void ext2fs_extent_free(ext2_extent_handle_t handle); -extern errcode_t ext2fs_extent_get(ext2_extent_handle_t handle, - int flags, struct ext2fs_extent *extent); -extern errcode_t ext2fs_extent_replace(ext2_extent_handle_t handle, int flags, - struct ext2fs_extent *extent); -extern errcode_t ext2fs_extent_insert(ext2_extent_handle_t handle, int flags, - struct ext2fs_extent *extent); -extern errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, - blk64_t logical, blk64_t physical, - int flags); -extern errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags); -extern errcode_t ext2fs_extent_get_info(ext2_extent_handle_t handle, - struct ext2_extent_info *info); -extern errcode_t ext2fs_extent_goto(ext2_extent_handle_t handle, - blk64_t blk); - -/* fileio.c */ -extern errcode_t ext2fs_file_open2(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode, - int flags, ext2_file_t *ret); -extern errcode_t ext2fs_file_open(ext2_filsys fs, ext2_ino_t ino, - int flags, ext2_file_t *ret); -extern ext2_filsys ext2fs_file_get_fs(ext2_file_t file); -struct ext2_inode *ext2fs_file_get_inode(ext2_file_t file); -extern errcode_t ext2fs_file_close(ext2_file_t file); -extern errcode_t ext2fs_file_flush(ext2_file_t file); -extern errcode_t ext2fs_file_read(ext2_file_t file, void *buf, - unsigned int wanted, unsigned int *got); -extern errcode_t ext2fs_file_write(ext2_file_t file, const void *buf, - unsigned int nbytes, unsigned int *written); -extern errcode_t ext2fs_file_llseek(ext2_file_t file, __u64 offset, - int whence, __u64 *ret_pos); -extern errcode_t ext2fs_file_lseek(ext2_file_t file, ext2_off_t offset, - int whence, ext2_off_t *ret_pos); -errcode_t ext2fs_file_get_lsize(ext2_file_t file, __u64 *ret_size); -extern ext2_off_t ext2fs_file_get_size(ext2_file_t file); -extern errcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size); -extern errcode_t ext2fs_file_set_size2(ext2_file_t file, ext2_off64_t size); - -/* finddev.c */ -extern char *ext2fs_find_block_device(dev_t device); - -/* flushb.c */ -extern errcode_t ext2fs_sync_device(int fd, int flushb); - -/* freefs.c */ -extern void ext2fs_free(ext2_filsys fs); -extern void ext2fs_free_dblist(ext2_dblist dblist); -extern void ext2fs_badblocks_list_free(ext2_badblocks_list bb); -extern void ext2fs_u32_list_free(ext2_u32_list bb); - -/* gen_bitmap.c */ -extern void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap); -extern errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs, - __u32 start, __u32 end, - __u32 real_end, - const char *descr, char *init_map, - ext2fs_generic_bitmap *ret); -extern errcode_t ext2fs_allocate_generic_bitmap(__u32 start, - __u32 end, - __u32 real_end, - const char *descr, - ext2fs_generic_bitmap *ret); -extern errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap src, - ext2fs_generic_bitmap *dest); -extern void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap); -extern errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap bitmap, - errcode_t magic, - errcode_t neq, - ext2_ino_t end, - ext2_ino_t *oend); -extern void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap map); -extern errcode_t ext2fs_resize_generic_bitmap(errcode_t magic, - __u32 new_end, - __u32 new_real_end, - ext2fs_generic_bitmap bmap); -extern errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq, - ext2fs_generic_bitmap bm1, - ext2fs_generic_bitmap bm2); -extern errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap bmap, - errcode_t magic, - __u32 start, __u32 num, - void *out); -extern errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap bmap, - errcode_t magic, - __u32 start, __u32 num, - void *in); - -/* gen_bitmap64.c */ -void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap); -errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic, - int type, __u64 start, __u64 end, - __u64 real_end, - const char *descr, - ext2fs_generic_bitmap *ret); -errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src, - ext2fs_generic_bitmap *dest); -void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap); -errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap bitmap, - errcode_t neq, - __u64 end, __u64 *oend); -void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap); -errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap bmap, - __u64 new_end, - __u64 new_real_end); -errcode_t ext2fs_compare_generic_bmap(errcode_t neq, - ext2fs_generic_bitmap bm1, - ext2fs_generic_bitmap bm2); -errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap bmap, - __u64 start, unsigned int num, - void *out); -errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap bmap, - __u64 start, unsigned int num, - void *in); - -/* getsize.c */ -extern errcode_t ext2fs_get_device_size(const char *file, int blocksize, - blk_t *retblocks); -extern errcode_t ext2fs_get_device_size2(const char *file, int blocksize, - blk64_t *retblocks); - -/* getsectsize.c */ -errcode_t ext2fs_get_device_sectsize(const char *file, int *sectsize); -errcode_t ext2fs_get_device_phys_sectsize(const char *file, int *sectsize); - -/* i_block.c */ -errcode_t ext2fs_iblk_add_blocks(ext2_filsys fs, struct ext2_inode *inode, - blk64_t num_blocks); -errcode_t ext2fs_iblk_sub_blocks(ext2_filsys fs, struct ext2_inode *inode, - blk64_t num_blocks); -errcode_t ext2fs_iblk_set(ext2_filsys fs, struct ext2_inode *inode, blk64_t b); - -/* imager.c */ -extern errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags); -extern errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd, int flags); -extern errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, int flags); -extern errcode_t ext2fs_image_super_read(ext2_filsys fs, int fd, int flags); -extern errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags); -extern errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags); - -/* ind_block.c */ -errcode_t ext2fs_read_ind_block(ext2_filsys fs, blk_t blk, void *buf); -errcode_t ext2fs_write_ind_block(ext2_filsys fs, blk_t blk, void *buf); - -/* initialize.c */ -extern errcode_t ext2fs_initialize(const char *name, int flags, - struct ext2_super_block *param, - io_manager manager, ext2_filsys *ret_fs); - -/* icount.c */ -extern void ext2fs_free_icount(ext2_icount_t icount); -extern errcode_t ext2fs_create_icount_tdb(ext2_filsys fs, char *tdb_dir, - int flags, ext2_icount_t *ret); -extern errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags, - unsigned int size, - ext2_icount_t hint, ext2_icount_t *ret); -extern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags, - unsigned int size, - ext2_icount_t *ret); -extern errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino, - __u16 *ret); -extern errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino, - __u16 *ret); -extern errcode_t ext2fs_icount_decrement(ext2_icount_t icount, ext2_ino_t ino, - __u16 *ret); -extern errcode_t ext2fs_icount_store(ext2_icount_t icount, ext2_ino_t ino, - __u16 count); -extern ext2_ino_t ext2fs_get_icount_size(ext2_icount_t icount); -errcode_t ext2fs_icount_validate(ext2_icount_t icount, FILE *); - -/* inode.c */ -extern errcode_t ext2fs_flush_icache(ext2_filsys fs); -extern errcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan, - ext2_ino_t *ino, - struct ext2_inode *inode, - int bufsize); -extern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks, - ext2_inode_scan *ret_scan); -extern void ext2fs_close_inode_scan(ext2_inode_scan scan); -extern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino, - struct ext2_inode *inode); -extern errcode_t ext2fs_inode_scan_goto_blockgroup(ext2_inode_scan scan, - int group); -extern void ext2fs_set_inode_callback - (ext2_inode_scan scan, - errcode_t (*done_group)(ext2_filsys fs, - ext2_inode_scan scan, - dgrp_t group, - void * priv_data), - void *done_group_data); -extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags, - int clear_flags); -extern errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode, - int bufsize); -extern errcode_t ext2fs_read_inode (ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode); -extern errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode, - int bufsize); -extern errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode); -extern errcode_t ext2fs_write_new_inode(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode); -extern errcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks); -extern errcode_t ext2fs_check_directory(ext2_filsys fs, ext2_ino_t ino); - -/* inode_io.c */ -extern io_manager inode_io_manager; -extern errcode_t ext2fs_inode_io_intern(ext2_filsys fs, ext2_ino_t ino, - char **name); -extern errcode_t ext2fs_inode_io_intern2(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode, - char **name); - -/* ismounted.c */ -extern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags); -extern errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags, - char *mtpt, int mtlen); - -/* punch.c */ -extern errcode_t ext2fs_punch(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode, - char *block_buf, blk64_t start, - blk64_t end); - -/* namei.c */ -extern errcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name, - int namelen, char *buf, ext2_ino_t *inode); -extern errcode_t ext2fs_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, - const char *name, ext2_ino_t *inode); -errcode_t ext2fs_namei_follow(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, - const char *name, ext2_ino_t *inode); -extern errcode_t ext2fs_follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, - ext2_ino_t inode, ext2_ino_t *res_inode); - -/* native.c */ -int ext2fs_native_flag(void); - -/* newdir.c */ -extern errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino, - ext2_ino_t parent_ino, char **block); - -/* mkdir.c */ -extern errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum, - const char *name); - -/* mkjournal.c */ -extern errcode_t ext2fs_zero_blocks(ext2_filsys fs, blk_t blk, int num, - blk_t *ret_blk, int *ret_count); -extern errcode_t ext2fs_zero_blocks2(ext2_filsys fs, blk64_t blk, int num, - blk64_t *ret_blk, int *ret_count); -extern errcode_t ext2fs_create_journal_superblock(ext2_filsys fs, - __u32 size, int flags, - char **ret_jsb); -extern errcode_t ext2fs_add_journal_device(ext2_filsys fs, - ext2_filsys journal_dev); -extern errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, - int flags); -extern int ext2fs_default_journal_size(__u64 blocks); - -/* openfs.c */ -extern errcode_t ext2fs_open(const char *name, int flags, int superblock, - unsigned int block_size, io_channel * chan, - ext2_filsys *ret_fs); -extern errcode_t ext2fs_open2(const char *name, const char *io_options, - int flags, int superblock, - unsigned int block_size, io_channel * chan, - ext2_filsys *ret_fs); -extern blk64_t ext2fs_descriptor_block_loc2(ext2_filsys fs, - blk64_t group_block, dgrp_t i); -extern blk_t ext2fs_descriptor_block_loc(ext2_filsys fs, blk_t group_block, - dgrp_t i); -errcode_t ext2fs_get_data_io(ext2_filsys fs, io_channel *old_io); -errcode_t ext2fs_set_data_io(ext2_filsys fs, io_channel new_io); -errcode_t ext2fs_rewrite_to_io(ext2_filsys fs, io_channel new_io); - -/* get_pathname.c */ -extern errcode_t ext2fs_get_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino, - char **name); - -/* link.c */ -errcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name, - ext2_ino_t ino, int flags); -errcode_t ext2fs_unlink(ext2_filsys fs, ext2_ino_t dir, const char *name, - ext2_ino_t ino, int flags); - -/* read_bb.c */ -extern errcode_t ext2fs_read_bb_inode(ext2_filsys fs, - ext2_badblocks_list *bb_list); - -/* read_bb_file.c */ -extern errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f, - ext2_badblocks_list *bb_list, - void *priv_data, - void (*invalid)(ext2_filsys fs, - blk_t blk, - char *badstr, - void *priv_data)); -extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f, - ext2_badblocks_list *bb_list, - void (*invalid)(ext2_filsys fs, - blk_t blk)); - -/* res_gdt.c */ -extern errcode_t ext2fs_create_resize_inode(ext2_filsys fs); - -/* swapfs.c */ -extern void ext2fs_swap_ext_attr(char *to, char *from, int bufsize, - int has_header); -extern void ext2fs_swap_ext_attr_header(struct ext2_ext_attr_header *to_header, - struct ext2_ext_attr_header *from_hdr); -extern void ext2fs_swap_ext_attr_entry(struct ext2_ext_attr_entry *to_entry, - struct ext2_ext_attr_entry *from_entry); -extern void ext2fs_swap_super(struct ext2_super_block * super); -extern void ext2fs_swap_group_desc(struct ext2_group_desc *gdp); -extern void ext2fs_swap_group_desc2(ext2_filsys, struct ext2_group_desc *gdp); -extern void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t, - struct ext2_inode_large *f, int hostorder, - int bufsize); -extern void ext2fs_swap_inode(ext2_filsys fs,struct ext2_inode *t, - struct ext2_inode *f, int hostorder); - -/* valid_blk.c */ -extern int ext2fs_inode_has_valid_blocks(struct ext2_inode *inode); - -/* version.c */ -extern int ext2fs_parse_version_string(const char *ver_string); -extern int ext2fs_get_library_version(const char **ver_string, - const char **date_string); - -/* write_bb_file.c */ -extern errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list, - unsigned int flags, - FILE *f); - - -/* inline functions */ -extern errcode_t ext2fs_get_mem(unsigned long size, void *ptr); -extern errcode_t ext2fs_get_memalign(unsigned long size, - unsigned long align, void *ptr); -extern errcode_t ext2fs_free_mem(void *ptr); -extern errcode_t ext2fs_resize_mem(unsigned long old_size, - unsigned long size, void *ptr); -extern void ext2fs_mark_super_dirty(ext2_filsys fs); -extern void ext2fs_mark_changed(ext2_filsys fs); -extern int ext2fs_test_changed(ext2_filsys fs); -extern void ext2fs_mark_valid(ext2_filsys fs); -extern void ext2fs_unmark_valid(ext2_filsys fs); -extern int ext2fs_test_valid(ext2_filsys fs); -extern void ext2fs_mark_ib_dirty(ext2_filsys fs); -extern void ext2fs_mark_bb_dirty(ext2_filsys fs); -extern int ext2fs_test_ib_dirty(ext2_filsys fs); -extern int ext2fs_test_bb_dirty(ext2_filsys fs); -extern int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk); -extern int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino); -extern blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group); -extern blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group); -extern blk_t ext2fs_inode_data_blocks(ext2_filsys fs, - struct ext2_inode *inode); -extern unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b); -extern __u64 ext2fs_div64_ceil(__u64 a, __u64 b); - -/* - * The actual inlined functions definitions themselves... - * - * If NO_INLINE_FUNCS is defined, then we won't try to do inline - * functions at all! - */ -#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) -#ifdef INCLUDE_INLINE_FUNCS -#define _INLINE_ extern -#else -#ifdef __GNUC__ -#define _INLINE_ extern __inline__ -#else /* For Watcom C */ -#define _INLINE_ extern inline -#endif -#endif - -#ifndef EXT2_CUSTOM_MEMORY_ROUTINES -#include -#include "mem_allocate.h" -/* - * Allocate memory - */ -_INLINE_ errcode_t ext2fs_get_mem(unsigned long size, void *ptr) -{ - void *pp; - - pp = mem_alloc(size); - if (!pp) - return EXT2_ET_NO_MEMORY; - memcpy(ptr, &pp, sizeof (pp)); - return 0; -} - -_INLINE_ errcode_t ext2fs_get_memalign(unsigned long size, - unsigned long align, void *ptr) -{ - void *pp; - - #ifdef HWRVL - pp = mem_align(32, size); - #else - pp = mem_alloc(size); - #endif - if (!pp) - return EXT2_ET_NO_MEMORY; - - memcpy(ptr, &pp, sizeof (pp)); - return 0; -} - -_INLINE_ errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr) -{ - if (count && (-1UL)/countflags |= EXT2_FLAG_DIRTY | EXT2_FLAG_CHANGED; -} - -/* - * Mark a filesystem as changed - */ -_INLINE_ void ext2fs_mark_changed(ext2_filsys fs) -{ - fs->flags |= EXT2_FLAG_CHANGED; -} - -/* - * Check to see if a filesystem has changed - */ -_INLINE_ int ext2fs_test_changed(ext2_filsys fs) -{ - return (fs->flags & EXT2_FLAG_CHANGED); -} - -/* - * Mark a filesystem as valid - */ -_INLINE_ void ext2fs_mark_valid(ext2_filsys fs) -{ - fs->flags |= EXT2_FLAG_VALID; -} - -/* - * Mark a filesystem as NOT valid - */ -_INLINE_ void ext2fs_unmark_valid(ext2_filsys fs) -{ - fs->flags &= ~EXT2_FLAG_VALID; -} - -/* - * Check to see if a filesystem is valid - */ -_INLINE_ int ext2fs_test_valid(ext2_filsys fs) -{ - return (fs->flags & EXT2_FLAG_VALID); -} - -/* - * Mark the inode bitmap as dirty - */ -_INLINE_ void ext2fs_mark_ib_dirty(ext2_filsys fs) -{ - fs->flags |= EXT2_FLAG_IB_DIRTY | EXT2_FLAG_CHANGED; -} - -/* - * Mark the block bitmap as dirty - */ -_INLINE_ void ext2fs_mark_bb_dirty(ext2_filsys fs) -{ - fs->flags |= EXT2_FLAG_BB_DIRTY | EXT2_FLAG_CHANGED; -} - -/* - * Check to see if a filesystem's inode bitmap is dirty - */ -_INLINE_ int ext2fs_test_ib_dirty(ext2_filsys fs) -{ - return (fs->flags & EXT2_FLAG_IB_DIRTY); -} - -/* - * Check to see if a filesystem's block bitmap is dirty - */ -_INLINE_ int ext2fs_test_bb_dirty(ext2_filsys fs) -{ - return (fs->flags & EXT2_FLAG_BB_DIRTY); -} - -/* - * Return the group # of a block - */ -_INLINE_ int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk) -{ - return ext2fs_group_of_blk2(fs, blk); -} -/* - * Return the group # of an inode number - */ -_INLINE_ int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino) -{ - return (ino - 1) / fs->super->s_inodes_per_group; -} - -/* - * Return the first block (inclusive) in a group - */ -_INLINE_ blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group) -{ - return ext2fs_group_first_block2(fs, group); -} - -/* - * Return the last block (inclusive) in a group - */ -_INLINE_ blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group) -{ - return ext2fs_group_last_block2(fs, group); -} - -_INLINE_ blk_t ext2fs_inode_data_blocks(ext2_filsys fs, - struct ext2_inode *inode) -{ - return ext2fs_inode_data_blocks2(fs, inode); -} - -/* - * This is an efficient, overflow safe way of calculating ceil((1.0 * a) / b) - */ -_INLINE_ unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b) -{ - if (!a) - return 0; - return ((a - 1) / b) + 1; -} - -_INLINE_ __u64 ext2fs_div64_ceil(__u64 a, __u64 b) -{ - if (!a) - return 0; - return ((a - 1) / b) + 1; -} - -#undef _INLINE_ -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _EXT2FS_EXT2FS_H */ diff --git a/source/libs/libext2fs/ext3_extents.h b/source/libs/libext2fs/ext3_extents.h deleted file mode 100644 index 88fabc9d..00000000 --- a/source/libs/libext2fs/ext3_extents.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2003,2004 Cluster File Systems, Inc, info@clusterfs.com - * Written by Alex Tomas - * - * %Begin-Header% - * This file may be redistributed under the terms of the GNU Library - * General Public License, version 2. - * %End-Header% - */ - -#ifndef _LINUX_EXT3_EXTENTS -#define _LINUX_EXT3_EXTENTS - -/* - * ext3_inode has i_block array (total 60 bytes) - * first 4 bytes are used to store: - * - tree depth (0 mean there is no tree yet. all extents in the inode) - * - number of alive extents in the inode - */ - -/* - * this is extent on-disk structure - * it's used at the bottom of the tree - */ -struct ext3_extent { - __u32 ee_block; /* first logical block extent covers */ - __u16 ee_len; /* number of blocks covered by extent */ - __u16 ee_start_hi; /* high 16 bits of physical block */ - __u32 ee_start; /* low 32 bigs of physical block */ -}; - -/* - * this is index on-disk structure - * it's used at all the levels, but the bottom - */ -struct ext3_extent_idx { - __u32 ei_block; /* index covers logical blocks from 'block' */ - __u32 ei_leaf; /* pointer to the physical block of the next * - * level. leaf or next index could bet here */ - __u16 ei_leaf_hi; /* high 16 bits of physical block */ - __u16 ei_unused; -}; - -/* - * each block (leaves and indexes), even inode-stored has header - */ -struct ext3_extent_header { - __u16 eh_magic; /* probably will support different formats */ - __u16 eh_entries; /* number of valid entries */ - __u16 eh_max; /* capacity of store in entries */ - __u16 eh_depth; /* has tree real underlaying blocks? */ - __u32 eh_generation; /* generation of the tree */ -}; - -#define EXT3_EXT_MAGIC 0xf30a - -/* - * array of ext3_ext_path contains path to some extent - * creation/lookup routines use it for traversal/splitting/etc - * truncate uses it to simulate recursive walking - */ -struct ext3_ext_path { - __u32 p_block; - __u16 p_depth; - struct ext3_extent *p_ext; - struct ext3_extent_idx *p_idx; - struct ext3_extent_header *p_hdr; - struct buffer_head *p_bh; -}; - -/* - * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an - * initialized extent. This is 2^15 and not (2^16 - 1), since we use the - * MSB of ee_len field in the extent datastructure to signify if this - * particular extent is an initialized extent or an uninitialized (i.e. - * preallocated). - * EXT_UNINIT_MAX_LEN is the maximum number of blocks we can have in an - * uninitialized extent. - * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an - * uninitialized one. In other words, if MSB of ee_len is set, it is an - * uninitialized extent with only one special scenario when ee_len = 0x8000. - * In this case we can not have an uninitialized extent of zero length and - * thus we make it as a special case of initialized extent with 0x8000 length. - * This way we get better extent-to-group alignment for initialized extents. - * Hence, the maximum number of blocks we can have in an *initialized* - * extent is 2^15 (32768) and in an *uninitialized* extent is 2^15-1 (32767). - */ -#define EXT_INIT_MAX_LEN (1UL << 15) -#define EXT_UNINIT_MAX_LEN (EXT_INIT_MAX_LEN - 1) - -#define EXT_FIRST_EXTENT(__hdr__) \ - ((struct ext3_extent *) (((char *) (__hdr__)) + \ - sizeof(struct ext3_extent_header))) -#define EXT_FIRST_INDEX(__hdr__) \ - ((struct ext3_extent_idx *) (((char *) (__hdr__)) + \ - sizeof(struct ext3_extent_header))) -#define EXT_HAS_FREE_INDEX(__path__) \ - ((__path__)->p_hdr->eh_entries < (__path__)->p_hdr->eh_max) -#define EXT_LAST_EXTENT(__hdr__) \ - (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_entries - 1) -#define EXT_LAST_INDEX(__hdr__) \ - (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_entries - 1) -#define EXT_MAX_EXTENT(__hdr__) \ - (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_max - 1) -#define EXT_MAX_INDEX(__hdr__) \ - (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_max - 1) - -#endif /* _LINUX_EXT3_EXTENTS */ - diff --git a/source/libs/libext2fs/libcustomext2fs.a b/source/libs/libext2fs/libcustomext2fs.a index a53a84966c6c09cb6f7875957f50e89aceb76efb..da332bc6aa6070c63dd0e66f80426151191d0915 100644 GIT binary patch literal 458466 zcmeFa4|r8qnJ>Kd$pHdHC!$ zzqQx9&)WO!1GLu8%>BOgWaq4Rz3+P0yViQwzjv**_sqJszV6rbT>SZy5~V(UDF5j^sT7}$<8SQq^|(@n zp0Q%3{)_siL`9DpKhA(Loit%%|vGb?S9JA3CRs>c>>k^`rjh6G|2F z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0)rfX}`~^75WA z-|hE_jRr08FWA`-h~pj+;7<#A#Yg52UJ^poJAKn=bZlb*!C5ylr~~e-=W9fkzJVd2 zZTSw?QMG*%SjWp@bc4za>b}ChVpJF&*X1KvJLc)CQMGpD?)w;PhljNqearnh-`U*MzSQ&ATlFmsX7*Pz*bjCYQ$}wr z8nSb}t?P(MXLnn^hrMSbeZ{V%@g7f@81|m6TgDzp=SPgU3!|y&JyVz6Wy}`Sm(JFj z_C;T*oas7LIksiw;UfJ5_me1-Vm+*55AxX^;9)Np@Gv4Q9<%kEkZwbStPgF#{C9?> z9|~A85Ie}-j!8G#*UiUCV0T>?}zVQu&4`5h^TmEnVKTUf(jHZA%=Sfw* zE0F=O5sChQGEDScE0H+Qbw2I`_D3xMNcDZq!GMW8J_eDfk7ZTgR$%H=zjQ+G;bKYk zZAMNpVB%?f&>rej-^D!6mZ#}Eg}hTPzt~ z;2f@`KOtcj21FUAV^u!=3V7*2D%4%IN9Fmkty@La243~q0mfjj$7jOwIQOvaU>-Bv z_380fkzb3Xr1~_k*MNT;d^+36Jv%9eikS}x?uq^KIbrZV^8w*L`!68mb$zfrt;*jCtn&9b^6id1#^o&NQnG(@l8le-Z#)Xa{PEZL zTC8%x`ZoUtd*}JN1vh{0!uPa5zNctKPt{`Ie3tv?Jih1SOrjBc=$6uJI4ki?8_p)0 za5j-yj=_w5_2%xM*|n~xjI)6L;~kUaBc+y38MFBJrhf77j47`%$%)r57kO{u@Owp` zQ%r2XSj3uliucGbL-)kRe;0AK&?sjMO*mV~VDH?5y>sh8+1QBQpUC+_&;h*<_AmQi zEJ5bevE0+vtaBYf3QOl2VMmXs_mQRecW2!hnApd@}dh z0m0ZLGF)3o`^AUet}m;e`1*GXj0 -#include "memory/mem2.h" - -extern __inline__ void* mem_alloc (size_t size) { - return MEM2_alloc(size); -} - -extern __inline__ void* mem_realloc (void *p, size_t size) { - return MEM2_realloc(p, size); -} - -extern __inline__ void* mem_align (size_t a, size_t size) { - return MEM2_alloc(size); -} - -extern __inline__ void mem_free (void* mem) { - MEM2_free(mem); -} - -#endif /* _MEM_ALLOCATE_H */ diff --git a/source/libs/libfat/bit_ops.h b/source/libs/libfat/bit_ops.h deleted file mode 100644 index 762be0b3..00000000 --- a/source/libs/libfat/bit_ops.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - bit_ops.h - Functions for dealing with conversion of data between types - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _BIT_OPS_H -#define _BIT_OPS_H - -#include - -/*----------------------------------------------------------------- -Functions to deal with little endian values stored in uint8_t arrays ------------------------------------------------------------------*/ -static inline uint16_t u8array_to_u16 (const uint8_t* item, int offset) { - return ( item[offset] | (item[offset + 1] << 8)); -} - -static inline uint32_t u8array_to_u32 (const uint8_t* item, int offset) { - return ( item[offset] | (item[offset + 1] << 8) | (item[offset + 2] << 16) | (item[offset + 3] << 24)); -} - -static inline void u16_to_u8array (uint8_t* item, int offset, uint16_t value) { - item[offset] = (uint8_t) value; - item[offset + 1] = (uint8_t)(value >> 8); -} - -static inline void u32_to_u8array (uint8_t* item, int offset, uint32_t value) { - item[offset] = (uint8_t) value; - item[offset + 1] = (uint8_t)(value >> 8); - item[offset + 2] = (uint8_t)(value >> 16); - item[offset + 3] = (uint8_t)(value >> 24); -} - -#endif // _BIT_OPS_H diff --git a/source/libs/libfat/cache.h b/source/libs/libfat/cache.h deleted file mode 100644 index c6e48d07..00000000 --- a/source/libs/libfat/cache.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - cache.h - The cache is not visible to the user. It should be flushed - when any file is closed or changes are made to the filesystem. - - This cache implements a least-used-page replacement policy. This will - distribute sectors evenly over the pages, so if less than the maximum - pages are used at once, they should all eventually remain in the cache. - This also has the benefit of throwing out old sectors, so as not to keep - too many stale pages around. - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _CACHE_H -#define _CACHE_H - -#include "common.h" -#include "disc.h" - -#define PAGE_SECTORS 64 -#define CACHE_PAGE_SIZE (BYTES_PER_READ * PAGE_SECTORS) - -typedef struct { - sec_t sector; - unsigned int count; - unsigned int last_access; - bool dirty; - uint8_t* cache; -} CACHE_ENTRY; - -typedef struct { - const DISC_INTERFACE* disc; - sec_t endOfPartition; - unsigned int numberOfPages; - unsigned int sectorsPerPage; - CACHE_ENTRY* cacheEntries; -} CACHE; - -/* -Read data from a sector in the cache -If the sector is not in the cache, it will be swapped in -offset is the position to start reading from -size is the amount of data to read -Precondition: offset + size <= BYTES_PER_READ -*/ -bool _FAT_cache_readPartialSector (CACHE* cache, void* buffer, sec_t sector, unsigned int offset, size_t size); - -bool _FAT_cache_readLittleEndianValue (CACHE* cache, uint32_t *value, sec_t sector, unsigned int offset, int num_bytes); - -/* -Write data to a sector in the cache -If the sector is not in the cache, it will be swapped in. -When the sector is swapped out, the data will be written to the disc -offset is the position to start writing to -size is the amount of data to write -Precondition: offset + size <= BYTES_PER_READ -*/ -bool _FAT_cache_writePartialSector (CACHE* cache, const void* buffer, sec_t sector, unsigned int offset, size_t size); - -bool _FAT_cache_writeLittleEndianValue (CACHE* cache, const uint32_t value, sec_t sector, unsigned int offset, int num_bytes); - -/* -Write data to a sector in the cache, zeroing the sector first -If the sector is not in the cache, it will be swapped in. -When the sector is swapped out, the data will be written to the disc -offset is the position to start writing to -size is the amount of data to write -Precondition: offset + size <= BYTES_PER_READ -*/ -bool _FAT_cache_eraseWritePartialSector (CACHE* cache, const void* buffer, sec_t sector, unsigned int offset, size_t size); - -/* -Read several sectors from the cache -*/ -bool _FAT_cache_readSectors (CACHE* cache, sec_t sector, sec_t numSectors, void* buffer); - -/* -Read a full sector from the cache -*/ -static inline bool _FAT_cache_readSector (CACHE* cache, void* buffer, sec_t sector) { - return _FAT_cache_readPartialSector (cache, buffer, sector, 0, BYTES_PER_READ); -} - -/* -Write a full sector to the cache -*/ -static inline bool _FAT_cache_writeSector (CACHE* cache, const void* buffer, sec_t sector) { - return _FAT_cache_writePartialSector (cache, buffer, sector, 0, BYTES_PER_READ); -} - -bool _FAT_cache_writeSectors (CACHE* cache, sec_t sector, sec_t numSectors, const void* buffer); - -/* -Write any dirty sectors back to disc and clear out the contents of the cache -*/ -bool _FAT_cache_flush (CACHE* cache); - -/* -Clear out the contents of the cache without writing any dirty sectors first -*/ -void _FAT_cache_invalidate (CACHE* cache); - -CACHE* _FAT_cache_constructor (unsigned int numberOfPages, unsigned int sectorsPerPage, const DISC_INTERFACE* discInterface, sec_t endOfPartition); - -void _FAT_cache_destructor (CACHE* cache); - -#endif // _CACHE_H - diff --git a/source/libs/libfat/common.h b/source/libs/libfat/common.h deleted file mode 100644 index e0489e72..00000000 --- a/source/libs/libfat/common.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - common.h - Common definitions and included files for the FATlib - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _COMMON_H -#define _COMMON_H - -#define BYTES_PER_READ 512 -#include -#include -#include - -// When compiling for NDS, make sure NDS is defined -#ifndef NDS - #if defined ARM9 || defined ARM7 - #define NDS - #endif -#endif - -// Platform specific includes -#if defined(__gamecube__) || defined (__wii__) - #include - #include - #include -#elif defined(NDS) - #include - #include - #include -#elif defined(GBA) - #include - #include -#endif - -// Platform specific options -#if defined (__wii__) - #define DEFAULT_CACHE_PAGES 4 - #define DEFAULT_SECTORS_PAGE 64 - #define USE_LWP_LOCK - #define USE_RTC_TIME -#elif defined (__gamecube__) - #define DEFAULT_CACHE_PAGES 4 - #define DEFAULT_SECTORS_PAGE 64 - #define USE_LWP_LOCK - #define USE_RTC_TIME -#elif defined (NDS) - #define DEFAULT_CACHE_PAGES 4 - #define DEFAULT_SECTORS_PAGE 8 - #define USE_RTC_TIME -#elif defined (GBA) - #define DEFAULT_CACHE_PAGES 2 - #define DEFAULT_SECTORS_PAGE 8 - #define LIMIT_SECTORS 128 -#endif - -#endif // _COMMON_H diff --git a/source/libs/libfat/directory.c b/source/libs/libfat/directory.c deleted file mode 100644 index c2d93131..00000000 --- a/source/libs/libfat/directory.c +++ /dev/null @@ -1,1120 +0,0 @@ -/* - directory.c - Reading, writing and manipulation of the directory structure on - a FAT partition - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include -#include - -#include "directory.h" -#include "common.h" -#include "partition.h" -#include "file_allocation_table.h" -#include "bit_ops.h" -#include "filetime.h" - -// Directory entry codes -#define DIR_ENTRY_LAST 0x00 -#define DIR_ENTRY_FREE 0xE5 - -#define LAST_LFN_POS (19*13) -#define LAST_LFN_POS_CORRECTION (MAX_LFN_LENGTH-15) - -typedef unsigned short ucs2_t; - -// Long file name directory entry -enum LFN_offset { - LFN_offset_ordinal = 0x00, // Position within LFN - LFN_offset_char0 = 0x01, - LFN_offset_char1 = 0x03, - LFN_offset_char2 = 0x05, - LFN_offset_char3 = 0x07, - LFN_offset_char4 = 0x09, - LFN_offset_flag = 0x0B, // Should be equal to ATTRIB_LFN - LFN_offset_reserved1 = 0x0C, // Always 0x00 - LFN_offset_checkSum = 0x0D, // Checksum of short file name (alias) - LFN_offset_char5 = 0x0E, - LFN_offset_char6 = 0x10, - LFN_offset_char7 = 0x12, - LFN_offset_char8 = 0x14, - LFN_offset_char9 = 0x16, - LFN_offset_char10 = 0x18, - LFN_offset_reserved2 = 0x1A, // Always 0x0000 - LFN_offset_char11 = 0x1C, - LFN_offset_char12 = 0x1E -}; -static const int LFN_offset_table[13]={0x01,0x03,0x05,0x07,0x09,0x0E,0x10,0x12,0x14,0x16,0x18,0x1C,0x1E}; - -#define LFN_END 0x40 -#define LFN_DEL 0x80 - -static const char ILLEGAL_ALIAS_CHARACTERS[] = "\\/:;*?\"<>|&+,=[] "; -static const char ILLEGAL_LFN_CHARACTERS[] = "\\/:*?\"<>|"; - -/* -Returns number of UCS-2 characters needed to encode an LFN -Returns -1 if it is an invalid LFN -*/ -#define ABOVE_UCS_RANGE 0xF0 -static int _FAT_directory_lfnLength (const char* name) { - unsigned int i; - size_t nameLength; - int ucsLength; - const char* tempName = name; - - nameLength = strnlen(name, MAX_FILENAME_LENGTH); - // Make sure the name is short enough to be valid - if ( nameLength >= MAX_FILENAME_LENGTH) { - return -1; - } - // Make sure it doesn't contain any invalid characters - if (strpbrk (name, ILLEGAL_LFN_CHARACTERS) != NULL) { - return -1; - } - // Make sure the name doesn't contain any control codes or codes not representable in UCS-2 - for (i = 0; i < nameLength; i++) { - if (name[i] < 0x20 || name[i] >= ABOVE_UCS_RANGE) { - return -1; - } - } - // Convert to UCS-2 and get the resulting length - ucsLength = mbsrtowcs(NULL, &tempName, MAX_LFN_LENGTH, NULL); - if (ucsLength < 0 || ucsLength >= MAX_LFN_LENGTH) { - return -1; - } - - // Otherwise it is valid - return ucsLength; -} - -/* -Convert a multibyte encoded string into a NUL-terminated UCS-2 string, storing at most len characters -return number of characters stored -*/ -static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, const char* src, size_t len) { - mbstate_t ps = {0}; - wchar_t tempChar; - int bytes; - size_t count = 0; - - while (count < len-1 && src != '\0') { - bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps); - if (bytes > 0) { - *dst = (ucs2_t)tempChar; - src += bytes; - dst++; - count++; - } else if (bytes == 0) { - break; - } else { - return -1; - } - } - *dst = '\0'; - - return count; -} - -/* -Convert a UCS-2 string into a NUL-terminated multibyte string, storing at most len chars -return number of chars stored, or (size_t)-1 on error -*/ -static size_t _FAT_directory_ucs2tombs (char* dst, const ucs2_t* src, size_t len) { - mbstate_t ps = {0}; - size_t count = 0; - int bytes; - char buff[MB_CUR_MAX]; - int i; - - while (count < len - 1 && *src != '\0') { - bytes = wcrtomb (buff, *src, &ps); - if (bytes < 0) { - return -1; - } - if (count + bytes < len && bytes > 0) { - for (i = 0; i < bytes; i++) { - *dst++ = buff[i]; - } - src++; - count += bytes; - } else { - break; - } - } - *dst = L'\0'; - - return count; -} - -/* -Case-independent comparison of two multibyte encoded strings -*/ -static int _FAT_directory_mbsncasecmp (const char* s1, const char* s2, size_t len1) { - wchar_t wc1, wc2; - mbstate_t ps1 = {0}; - mbstate_t ps2 = {0}; - size_t b1 = 0; - size_t b2 = 0; - - if (len1 == 0) { - return 0; - } - - do { - s1 += b1; - s2 += b2; - b1 = mbrtowc(&wc1, s1, MB_CUR_MAX, &ps1); - b2 = mbrtowc(&wc2, s2, MB_CUR_MAX, &ps2); - if ((int)b1 < 0 || (int)b2 < 0) { - break; - } - len1 -= b1; - } while (len1 > 0 && towlower(wc1) == towlower(wc2) && wc1 != 0); - - return towlower(wc1) - towlower(wc2); -} - - -static bool _FAT_directory_entryGetAlias (const u8* entryData, char* destName) { - int i=0; - int j=0; - - destName[0] = '\0'; - if (entryData[0] != DIR_ENTRY_FREE) { - if (entryData[0] == '.') { - destName[0] = '.'; - if (entryData[1] == '.') { - destName[1] = '.'; - destName[2] = '\0'; - } else { - destName[1] = '\0'; - } - } else { - // Copy the filename from the dirEntry to the string - for (i = 0; (i < 8) && (entryData[DIR_ENTRY_name + i] != ' '); i++) { - destName[i] = entryData[DIR_ENTRY_name + i]; - } - // Copy the extension from the dirEntry to the string - if (entryData[DIR_ENTRY_extension] != ' ') { - destName[i++] = '.'; - for ( j = 0; (j < 3) && (entryData[DIR_ENTRY_extension + j] != ' '); j++) { - destName[i++] = entryData[DIR_ENTRY_extension + j]; - } - } - destName[i] = '\0'; - } - } - - return (destName[0] != '\0'); -} - -uint32_t _FAT_directory_entryGetCluster (PARTITION* partition, const uint8_t* entryData) { - if (partition->filesysType == FS_FAT32) { - // Only use high 16 bits of start cluster when we are certain they are correctly defined - return u8array_to_u16(entryData,DIR_ENTRY_cluster) | (u8array_to_u16(entryData, DIR_ENTRY_clusterHigh) << 16); - } else { - return u8array_to_u16(entryData,DIR_ENTRY_cluster); - } -} - -static bool _FAT_directory_incrementDirEntryPosition (PARTITION* partition, DIR_ENTRY_POSITION* entryPosition, bool extendDirectory) { - DIR_ENTRY_POSITION position = *entryPosition; - uint32_t tempCluster; - - // Increment offset, wrapping at the end of a sector - ++ position.offset; - if (position.offset == BYTES_PER_READ / DIR_ENTRY_DATA_SIZE) { - position.offset = 0; - // Increment sector when wrapping - ++ position.sector; - // But wrap at the end of a cluster - if ((position.sector == partition->sectorsPerCluster) && (position.cluster != FAT16_ROOT_DIR_CLUSTER)) { - position.sector = 0; - // Move onto the next cluster, making sure there is another cluster to go to - tempCluster = _FAT_fat_nextCluster(partition, position.cluster); - if (tempCluster == CLUSTER_EOF) { - if (extendDirectory) { - tempCluster = _FAT_fat_linkFreeClusterCleared (partition, position.cluster); - if (!_FAT_fat_isValidCluster(partition, tempCluster)) { - return false; // This will only happen if the disc is full - } - } else { - return false; // Got to the end of the directory, not extending it - } - } - position.cluster = tempCluster; - } else if ((position.cluster == FAT16_ROOT_DIR_CLUSTER) && (position.sector == (partition->dataStart - partition->rootDirStart))) { - return false; // Got to end of root directory, can't extend it - } - } - *entryPosition = position; - return true; -} - -bool _FAT_directory_getNextEntry (PARTITION* partition, DIR_ENTRY* entry) { - DIR_ENTRY_POSITION entryStart; - DIR_ENTRY_POSITION entryEnd; - uint8_t entryData[0x20]; - ucs2_t lfn[MAX_LFN_LENGTH]; - bool notFound, found; - int lfnPos; - uint8_t lfnChkSum, chkSum; - bool lfnExists; - int i; - - lfnChkSum = 0; - - entryStart = entry->dataEnd; - - // Make sure we are using the correct root directory, in case of FAT32 - if (entryStart.cluster == FAT16_ROOT_DIR_CLUSTER) { - entryStart.cluster = partition->rootDirCluster; - } - - entryEnd = entryStart; - - lfnExists = false; - - found = false; - notFound = false; - - while (!found && !notFound) { - if (_FAT_directory_incrementDirEntryPosition (partition, &entryEnd, false) == false) { - notFound = true; - } - - _FAT_cache_readPartialSector (partition->cache, entryData, - _FAT_fat_clusterToSector(partition, entryEnd.cluster) + entryEnd.sector, - entryEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - - if (entryData[DIR_ENTRY_attributes] == ATTRIB_LFN) { - // It's an LFN - if (entryData[LFN_offset_ordinal] & LFN_DEL) { - lfnExists = false; - } else if (entryData[LFN_offset_ordinal] & LFN_END) { - // Last part of LFN, make sure it isn't deleted using previous if(Thanks MoonLight) - entryStart = entryEnd; // This is the start of a directory entry - lfnExists = true; - lfnPos = (entryData[LFN_offset_ordinal] & ~LFN_END) * 13; - if (lfnPos > MAX_LFN_LENGTH - 1) { - lfnPos = MAX_LFN_LENGTH - 1; - } - lfn[lfnPos] = '\0'; // Set end of lfn to null character - lfnChkSum = entryData[LFN_offset_checkSum]; - } - if (lfnChkSum != entryData[LFN_offset_checkSum]) { - lfnExists = false; - } - if (lfnExists) { - lfnPos = ((entryData[LFN_offset_ordinal] & ~LFN_END) - 1) * 13; - if (lfnPos > LAST_LFN_POS) { - // Force it within the buffer. Will corrupt the filename but prevent buffer overflows - lfnPos = LAST_LFN_POS; - } - for (i = 0; i < 13; i++) { - lfn[lfnPos + i] = entryData[LFN_offset_table[i]] | (entryData[LFN_offset_table[i]+1] << 8); - } - } - } else if (entryData[DIR_ENTRY_attributes] & ATTRIB_VOL) { - // This is a volume name, don't bother with it - } else if (entryData[0] == DIR_ENTRY_LAST) { - notFound = true; - } else if ((entryData[0] != DIR_ENTRY_FREE) && (entryData[0] > 0x20) && !(entryData[DIR_ENTRY_attributes] & ATTRIB_VOL)) { - if (lfnExists) { - // Calculate file checksum - chkSum = 0; - for (i=0; i < 11; i++) { - // NOTE: The operation is an unsigned char rotate right - chkSum = ((chkSum & 1) ? 0x80 : 0) + (chkSum >> 1) + entryData[i]; - } - if (chkSum != lfnChkSum) { - lfnExists = false; - entry->filename[0] = '\0'; - } - } - - if (lfnExists) { - if (_FAT_directory_ucs2tombs (entry->filename, lfn, MAX_FILENAME_LENGTH) == (size_t)-1) { - // Failed to convert the file name to UTF-8. Maybe the wrong locale is set? - return false; - } - } else { - entryStart = entryEnd; - _FAT_directory_entryGetAlias (entryData, entry->filename); - } - found = true; - } - } - - // If no file is found, return false - if (notFound) { - return false; - } else { - // Fill in the directory entry struct - entry->dataStart = entryStart; - entry->dataEnd = entryEnd; - memcpy (entry->entryData, entryData, DIR_ENTRY_DATA_SIZE); - return true; - } -} - -bool _FAT_directory_getFirstEntry (PARTITION* partition, DIR_ENTRY* entry, uint32_t dirCluster) { - entry->dataStart.cluster = dirCluster; - entry->dataStart.sector = 0; - entry->dataStart.offset = -1; // Start before the beginning of the directory - - entry->dataEnd = entry->dataStart; - - return _FAT_directory_getNextEntry (partition, entry); -} - -bool _FAT_directory_getRootEntry (PARTITION* partition, DIR_ENTRY* entry) { - entry->dataStart.cluster = 0; - entry->dataStart.sector = 0; - entry->dataStart.offset = 0; - - entry->dataEnd = entry->dataStart; - - memset (entry->filename, '\0', MAX_FILENAME_LENGTH); - entry->filename[0] = '.'; - - memset (entry->entryData, 0, DIR_ENTRY_DATA_SIZE); - memset (entry->entryData, ' ', 11); - entry->entryData[0] = '.'; - - entry->entryData[DIR_ENTRY_attributes] = ATTRIB_DIR; - - u16_to_u8array (entry->entryData, DIR_ENTRY_cluster, partition->rootDirCluster); - u16_to_u8array (entry->entryData, DIR_ENTRY_clusterHigh, partition->rootDirCluster >> 16); - - return true; -} - -bool _FAT_directory_getVolumeLabel (PARTITION* partition, char *label) { - DIR_ENTRY entry; - DIR_ENTRY_POSITION entryEnd; - uint8_t entryData[DIR_ENTRY_DATA_SIZE]; - int i; - bool end; - - _FAT_directory_getRootEntry(partition, &entry); - - entryEnd = entry.dataEnd; - - // Make sure we are using the correct root directory, in case of FAT32 - if (entryEnd.cluster == FAT16_ROOT_DIR_CLUSTER) { - entryEnd.cluster = partition->rootDirCluster; - } - - label[0]='\0'; - label[11]='\0'; - end = false; - //this entry should be among the first 3 entries in the root directory table, if not, then system can have trouble displaying the right volume label - while(!end) { - if(!_FAT_cache_readPartialSector (partition->cache, entryData, - _FAT_fat_clusterToSector(partition, entryEnd.cluster) + entryEnd.sector, - entryEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE)) - { //error reading - return false; - } - - if (entryData[DIR_ENTRY_attributes] == ATTRIB_VOL && entryData[0] != DIR_ENTRY_FREE) { - for (i = 0; i < 11; i++) { - label[i] = entryData[DIR_ENTRY_name + i]; - } - return true; - } else if (entryData[0] == DIR_ENTRY_LAST) { - end = true; - } - - if (_FAT_directory_incrementDirEntryPosition (partition, &entryEnd, false) == false) { - end = true; - } - } - return false; -} - -bool _FAT_directory_entryFromPosition (PARTITION* partition, DIR_ENTRY* entry) { - DIR_ENTRY_POSITION entryStart = entry->dataStart; - DIR_ENTRY_POSITION entryEnd = entry->dataEnd; - bool entryStillValid; - bool finished; - ucs2_t lfn[MAX_LFN_LENGTH]; - int i; - int lfnPos; - uint8_t entryData[DIR_ENTRY_DATA_SIZE]; - - memset (entry->filename, '\0', MAX_FILENAME_LENGTH); - - // Create an empty directory entry to overwrite the old ones with - for ( entryStillValid = true, finished = false; - entryStillValid && !finished; - entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &entryStart, false)) - { - _FAT_cache_readPartialSector (partition->cache, entryData, - _FAT_fat_clusterToSector(partition, entryStart.cluster) + entryStart.sector, - entryStart.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - - if ((entryStart.cluster == entryEnd.cluster) - && (entryStart.sector == entryEnd.sector) - && (entryStart.offset == entryEnd.offset)) { - // Copy the entry data and stop, since this is the last section of the directory entry - memcpy (entry->entryData, entryData, DIR_ENTRY_DATA_SIZE); - finished = true; - } else { - // Copy the long file name data - lfnPos = ((entryData[LFN_offset_ordinal] & ~LFN_END) - 1) * 13; - if (lfnPos > LAST_LFN_POS) { - lfnPos = LAST_LFN_POS_CORRECTION; - } - for (i = 0; i < 13; i++) { - lfn[lfnPos + i] = entryData[LFN_offset_table[i]] | (entryData[LFN_offset_table[i]+1] << 8); - } - } - } - - if (!entryStillValid) { - return false; - } - - if ((entryStart.cluster == entryEnd.cluster) - && (entryStart.sector == entryEnd.sector) - && (entryStart.offset == entryEnd.offset)) { - // Since the entry doesn't have a long file name, extract the short filename - if (!_FAT_directory_entryGetAlias (entry->entryData, entry->filename)) { - return false; - } - } else { - // Encode the long file name into a multibyte string - if (_FAT_directory_ucs2tombs (entry->filename, lfn, MAX_FILENAME_LENGTH) == (size_t)-1) { - return false; - } - } - - return true; -} - - - -bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const char* path, const char* pathEnd) { - size_t dirnameLength; - const char* pathPosition; - const char* nextPathPosition; - uint32_t dirCluster; - bool foundFile; - char alias[MAX_ALIAS_LENGTH]; - bool found, notFound; - - pathPosition = path; - - found = false; - notFound = false; - - if (pathEnd == NULL) { - // Set pathEnd to the end of the path string - pathEnd = strchr (path, '\0'); - } - - if (pathPosition[0] == DIR_SEPARATOR) { - // Start at root directory - dirCluster = partition->rootDirCluster; - // Consume separator(s) - while (pathPosition[0] == DIR_SEPARATOR) { - pathPosition++; - } - // If the path is only specifying a directory in the form of "/" return it - if (pathPosition >= pathEnd) { - _FAT_directory_getRootEntry (partition, entry); - found = true; - } - } else { - // Start in current working directory - dirCluster = partition->cwdCluster; - } - - // If the path is only specifying a directory in the form "." - // and this is the root directory, return it - if ((dirCluster == partition->rootDirCluster) && (strcmp(".", pathPosition) == 0)) { - _FAT_directory_getRootEntry (partition, entry); - found = true; - } - - while (!found && !notFound) { - // Get the name of the next required subdirectory within the path - nextPathPosition = strchr (pathPosition, DIR_SEPARATOR); - if (nextPathPosition != NULL) { - dirnameLength = nextPathPosition - pathPosition; - } else { - dirnameLength = strlen(pathPosition); - } - - if (dirnameLength > MAX_FILENAME_LENGTH) { - // The path is too long to bother with - return false; - } - - // Look for the directory within the path - foundFile = _FAT_directory_getFirstEntry (partition, entry, dirCluster); - - while (foundFile && !found && !notFound) { // It hasn't already found the file - // Check if the filename matches - if ((dirnameLength == strnlen(entry->filename, MAX_FILENAME_LENGTH)) - && (_FAT_directory_mbsncasecmp(pathPosition, entry->filename, dirnameLength) == 0)) { - found = true; - } - - // Check if the alias matches - _FAT_directory_entryGetAlias (entry->entryData, alias); - if ((dirnameLength == strnlen(alias, MAX_ALIAS_LENGTH)) - && (strncasecmp(pathPosition, alias, dirnameLength) == 0)) { - found = true; - } - - if (found && !(entry->entryData[DIR_ENTRY_attributes] & ATTRIB_DIR) && (nextPathPosition != NULL)) { - // Make sure that we aren't trying to follow a file instead of a directory in the path - found = false; - } - - if (!found) { - foundFile = _FAT_directory_getNextEntry (partition, entry); - } - } - - if (!foundFile) { - // Check that the search didn't get to the end of the directory - notFound = true; - found = false; - } else if ((nextPathPosition == NULL) || (nextPathPosition >= pathEnd)) { - // Check that we reached the end of the path - found = true; - } else if (entry->entryData[DIR_ENTRY_attributes] & ATTRIB_DIR) { - dirCluster = _FAT_directory_entryGetCluster (partition, entry->entryData); - pathPosition = nextPathPosition; - // Consume separator(s) - while (pathPosition[0] == DIR_SEPARATOR) { - pathPosition++; - } - // The requested directory was found - if (pathPosition >= pathEnd) { - found = true; - } else { - found = false; - } - } - } - - if (found && !notFound) { - if (partition->filesysType == FS_FAT32 && (entry->entryData[DIR_ENTRY_attributes] & ATTRIB_DIR) && - _FAT_directory_entryGetCluster (partition, entry->entryData) == CLUSTER_ROOT) - { - // On FAT32 it should specify an actual cluster for the root entry, - // not cluster 0 as on FAT16 - _FAT_directory_getRootEntry (partition, entry); - } - return true; - } else { - return false; - } -} - -bool _FAT_directory_removeEntry (PARTITION* partition, DIR_ENTRY* entry) { - DIR_ENTRY_POSITION entryStart = entry->dataStart; - DIR_ENTRY_POSITION entryEnd = entry->dataEnd; - bool entryStillValid; - bool finished; - uint8_t entryData[DIR_ENTRY_DATA_SIZE]; - - // Create an empty directory entry to overwrite the old ones with - for ( entryStillValid = true, finished = false; - entryStillValid && !finished; - entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &entryStart, false)) - { - _FAT_cache_readPartialSector (partition->cache, entryData, _FAT_fat_clusterToSector(partition, entryStart.cluster) + entryStart.sector, entryStart.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - entryData[0] = DIR_ENTRY_FREE; - _FAT_cache_writePartialSector (partition->cache, entryData, _FAT_fat_clusterToSector(partition, entryStart.cluster) + entryStart.sector, entryStart.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - if ((entryStart.cluster == entryEnd.cluster) && (entryStart.sector == entryEnd.sector) && (entryStart.offset == entryEnd.offset)) { - finished = true; - } - } - - if (!entryStillValid) { - return false; - } - - return true; -} - -static bool _FAT_directory_findEntryGap (PARTITION* partition, DIR_ENTRY* entry, uint32_t dirCluster, size_t size) { - DIR_ENTRY_POSITION gapStart; - DIR_ENTRY_POSITION gapEnd; - uint8_t entryData[DIR_ENTRY_DATA_SIZE]; - size_t dirEntryRemain; - bool endOfDirectory, entryStillValid; - - // Scan Dir for free entry - gapEnd.offset = 0; - gapEnd.sector = 0; - gapEnd.cluster = dirCluster; - - gapStart = gapEnd; - - entryStillValid = true; - dirEntryRemain = size; - endOfDirectory = false; - - while (entryStillValid && !endOfDirectory && (dirEntryRemain > 0)) { - _FAT_cache_readPartialSector (partition->cache, entryData, - _FAT_fat_clusterToSector(partition, gapEnd.cluster) + gapEnd.sector, - gapEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - if (entryData[0] == DIR_ENTRY_LAST) { - gapStart = gapEnd; - -- dirEntryRemain; - endOfDirectory = true; - } else if (entryData[0] == DIR_ENTRY_FREE) { - if (dirEntryRemain == size) { - gapStart = gapEnd; - } - -- dirEntryRemain; - } else { - dirEntryRemain = size; - } - - if (!endOfDirectory && (dirEntryRemain > 0)) { - entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &gapEnd, true); - } - } - - // Make sure the scanning didn't fail - if (!entryStillValid) { - return false; - } - - // Save the start entry, since we know it is valid - entry->dataStart = gapStart; - - if (endOfDirectory) { - memset (entryData, DIR_ENTRY_LAST, DIR_ENTRY_DATA_SIZE); - dirEntryRemain += 1; // Increase by one to take account of End Of Directory Marker - while ((dirEntryRemain > 0) && entryStillValid) { - // Get the gapEnd before incrementing it, so the second to last one is saved - entry->dataEnd = gapEnd; - // Increment gapEnd, moving onto the next entry - entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &gapEnd, true); - -- dirEntryRemain; - // Fill the entry with blanks - _FAT_cache_writePartialSector (partition->cache, entryData, - _FAT_fat_clusterToSector(partition, gapEnd.cluster) + gapEnd.sector, - gapEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - } - if (!entryStillValid) { - return false; - } - } else { - entry->dataEnd = gapEnd; - } - - return true; -} - -static bool _FAT_directory_entryExists (PARTITION* partition, const char* name, uint32_t dirCluster) { - DIR_ENTRY tempEntry; - bool foundFile; - char alias[MAX_ALIAS_LENGTH]; - size_t dirnameLength; - - dirnameLength = strnlen(name, MAX_FILENAME_LENGTH); - - if (dirnameLength >= MAX_FILENAME_LENGTH) { - return false; - } - - // Make sure the entry doesn't already exist - foundFile = _FAT_directory_getFirstEntry (partition, &tempEntry, dirCluster); - - while (foundFile) { // It hasn't already found the file - // Check if the filename matches - if ((dirnameLength == strnlen(tempEntry.filename, MAX_FILENAME_LENGTH)) - && (_FAT_directory_mbsncasecmp(name, tempEntry.filename, dirnameLength) == 0)) { - return true; - } - - // Check if the alias matches - _FAT_directory_entryGetAlias (tempEntry.entryData, alias); - if ((strncasecmp(name, alias, MAX_ALIAS_LENGTH) == 0)) { - return true; - } - foundFile = _FAT_directory_getNextEntry (partition, &tempEntry); - } - return false; -} - -/* -Creates an alias for a long file name. If the alias is not an exact match for the -filename, it returns the number of characters in the alias. If the two names match, -it returns 0. If there was an error, it returns -1. -*/ -static int _FAT_directory_createAlias (char* alias, const char* lfn) { - bool lossyConversion = false; // Set when the alias had to be modified to be valid - int lfnPos = 0; - int aliasPos = 0; - wchar_t lfnChar; - int oemChar; - mbstate_t ps = {0}; - int bytesUsed = 0; - const char* lfnExt; - int aliasExtLen; - - // Strip leading periods - while (lfn[lfnPos] == '.') { - lfnPos ++; - lossyConversion = true; - } - - // Primary portion of alias - while (aliasPos < 8 && lfn[lfnPos] != '.' && lfn[lfnPos] != '\0') { - bytesUsed = mbrtowc(&lfnChar, lfn + lfnPos, MAX_FILENAME_LENGTH - lfnPos, &ps); - if (bytesUsed < 0) { - return -1; - } - oemChar = wctob(towupper((wint_t)lfnChar)); - if (wctob((wint_t)lfnChar) != oemChar) { - // Case of letter was changed - lossyConversion = true; - } - if (oemChar == ' ') { - // Skip spaces in filename - lossyConversion = true; - lfnPos += bytesUsed; - continue; - } - if (oemChar == EOF) { - oemChar = '_'; // Replace unconvertable characters with underscores - lossyConversion = true; - } - if (strchr (ILLEGAL_ALIAS_CHARACTERS, oemChar) != NULL) { - // Invalid Alias character - oemChar = '_'; // Replace illegal characters with underscores - lossyConversion = true; - } - - alias[aliasPos] = (char)oemChar; - aliasPos++; - lfnPos += bytesUsed; - } - - if (lfn[lfnPos] != '.' && lfn[lfnPos] != '\0') { - // Name was more than 8 characters long - lossyConversion = true; - } - - // Alias extension - lfnExt = strrchr (lfn, '.'); - if (lfnExt != NULL && lfnExt != strchr (lfn, '.')) { - // More than one period in name - lossyConversion = true; - } - if (lfnExt != NULL && lfnExt[1] != '\0') { - lfnExt++; - alias[aliasPos] = '.'; - aliasPos++; - memset (&ps, 0, sizeof(ps)); - for (aliasExtLen = 0; aliasExtLen < MAX_ALIAS_EXT_LENGTH && *lfnExt != '\0'; aliasExtLen++) { - bytesUsed = mbrtowc(&lfnChar, lfnExt, MAX_FILENAME_LENGTH - lfnPos, &ps); - if (bytesUsed < 0) { - return -1; - } - oemChar = wctob(towupper((wint_t)lfnChar)); - if (wctob((wint_t)lfnChar) != oemChar) { - // Case of letter was changed - lossyConversion = true; - } - if (oemChar == ' ') { - // Skip spaces in alias - lossyConversion = true; - lfnExt += bytesUsed; - continue; - } - if (oemChar == EOF) { - oemChar = '_'; // Replace unconvertable characters with underscores - lossyConversion = true; - } - if (strchr (ILLEGAL_ALIAS_CHARACTERS, oemChar) != NULL) { - // Invalid Alias character - oemChar = '_'; // Replace illegal characters with underscores - lossyConversion = true; - } - - alias[aliasPos] = (char)oemChar; - aliasPos++; - lfnExt += bytesUsed; - } - if (*lfnExt != '\0') { - // Extension was more than 3 characters long - lossyConversion = true; - } - } - - alias[aliasPos] = '\0'; - if (lossyConversion) { - return aliasPos; - } else { - return 0; - } -} - -bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, uint32_t dirCluster) { - size_t entrySize; - uint8_t lfnEntry[DIR_ENTRY_DATA_SIZE]; - int i,j; // Must be signed for use when decrementing in for loop - char *tmpCharPtr; - DIR_ENTRY_POSITION curEntryPos; - bool entryStillValid; - uint8_t aliasCheckSum = 0; - char alias [MAX_ALIAS_LENGTH]; - int aliasLen; - int lfnLen; - - // Make sure the filename is not 0 length - if (strnlen (entry->filename, MAX_FILENAME_LENGTH) < 1) { - return false; - } - - // Make sure the filename is at least a valid LFN - lfnLen = _FAT_directory_lfnLength (entry->filename); - if (lfnLen < 0) { - return false; - } - - // Remove trailing spaces - for (i = strlen (entry->filename) - 1; (i > 0) && (entry->filename[i] == ' '); --i) { - entry->filename[i] = '\0'; - } - // Remove leading spaces - for (i = 0; (i < (int)strlen (entry->filename)) && (entry->filename[i] == ' '); ++i) ; - if (i > 0) { - memmove (entry->filename, entry->filename + i, strlen (entry->filename + i)); - } - - // Remove junk in filename - i = strlen (entry->filename); - memset (entry->filename + i, '\0', MAX_FILENAME_LENGTH - i); - - // Make sure the entry doesn't already exist - if (_FAT_directory_entryExists (partition, entry->filename, dirCluster)) { - return false; - } - - // Clear out alias, so we can generate a new one - memset (entry->entryData, ' ', 11); - - if ( strncmp(entry->filename, ".", MAX_FILENAME_LENGTH) == 0) { - // "." entry - entry->entryData[0] = '.'; - entrySize = 1; - } else if ( strncmp(entry->filename, "..", MAX_FILENAME_LENGTH) == 0) { - // ".." entry - entry->entryData[0] = '.'; - entry->entryData[1] = '.'; - entrySize = 1; - } else { - // Normal file name - aliasLen = _FAT_directory_createAlias (alias, entry->filename); - if (aliasLen < 0) { - return false; - } else if (aliasLen == 0) { - // It's a normal short filename - entrySize = 1; - } else { - // It's a long filename with an alias - entrySize = ((lfnLen + LFN_ENTRY_LENGTH - 1) / LFN_ENTRY_LENGTH) + 1; - - // Generate full alias for all cases except when the alias is simply an upper case version of the LFN - // and there isn't already a file with that name - if (strncasecmp (alias, entry->filename, MAX_ALIAS_LENGTH) != 0 || - _FAT_directory_entryExists (partition, alias, dirCluster)) - { - // expand primary part to 8 characters long by padding the end with underscores - i = MAX_ALIAS_PRI_LENGTH - 1; - // Move extension to last 3 characters - while (alias[i] != '.' && i > 0) i--; - if (i > 0) { - j = MAX_ALIAS_LENGTH - MAX_ALIAS_EXT_LENGTH - 2; // 1 char for '.', one for NUL, 3 for extension - memmove (alias + j, alias + i, strlen(alias) - i); - // Pad primary component - memset (alias + i, '_', j - i); - alias[MAX_ALIAS_LENGTH-1]=0; - } - - // Generate numeric tail - for (i = 1; i <= MAX_NUMERIC_TAIL; i++) { - j = i; - tmpCharPtr = alias + MAX_ALIAS_PRI_LENGTH - 1; - while (j > 0) { - *tmpCharPtr = '0' + (j % 10); // ASCII numeric value - tmpCharPtr--; - j /= 10; - } - *tmpCharPtr = '~'; - if (!_FAT_directory_entryExists (partition, alias, dirCluster)) { - break; - } - } - if (i > MAX_NUMERIC_TAIL) { - // Couldn't get a valid alias - return false; - } - } - } - - // Copy alias or short file name into directory entry data - for (i = 0, j = 0; (j < 8) && (alias[i] != '.') && (alias[i] != '\0'); i++, j++) { - entry->entryData[j] = alias[i]; - } - while (j < 8) { - entry->entryData[j] = ' '; - ++ j; - } - if (alias[i] == '.') { - // Copy extension - ++ i; - while ((alias[i] != '\0') && (j < 11)) { - entry->entryData[j] = alias[i]; - ++ i; - ++ j; - } - } - while (j < 11) { - entry->entryData[j] = ' '; - ++ j; - } - - // Generate alias checksum - for (i=0; i < ALIAS_ENTRY_LENGTH; i++) { - // NOTE: The operation is an unsigned char rotate right - aliasCheckSum = ((aliasCheckSum & 1) ? 0x80 : 0) + (aliasCheckSum >> 1) + entry->entryData[i]; - } - } - - // Find or create space for the entry - if (_FAT_directory_findEntryGap (partition, entry, dirCluster, entrySize) == false) { - return false; - } - - // Write out directory entry - curEntryPos = entry->dataStart; - - { - // lfn is only pushed onto the stack here, reducing overall stack usage - ucs2_t lfn[MAX_LFN_LENGTH] = {0}; - _FAT_directory_mbstoucs2 (lfn, entry->filename, MAX_LFN_LENGTH); - - for (entryStillValid = true, i = entrySize; entryStillValid && i > 0; - entryStillValid = _FAT_directory_incrementDirEntryPosition (partition, &curEntryPos, false), -- i ) - { - if (i > 1) { - // Long filename entry - lfnEntry[LFN_offset_ordinal] = (i - 1) | ((size_t)i == entrySize ? LFN_END : 0); - for (j = 0; j < 13; j++) { - if (lfn [(i - 2) * 13 + j] == '\0') { - if ((j > 1) && (lfn [(i - 2) * 13 + (j-1)] == '\0')) { - u16_to_u8array (lfnEntry, LFN_offset_table[j], 0xffff); // Padding - } else { - u16_to_u8array (lfnEntry, LFN_offset_table[j], 0x0000); // Terminating null character - } - } else { - u16_to_u8array (lfnEntry, LFN_offset_table[j], lfn [(i - 2) * 13 + j]); - } - } - - lfnEntry[LFN_offset_checkSum] = aliasCheckSum; - lfnEntry[LFN_offset_flag] = ATTRIB_LFN; - lfnEntry[LFN_offset_reserved1] = 0; - u16_to_u8array (lfnEntry, LFN_offset_reserved2, 0); - _FAT_cache_writePartialSector (partition->cache, lfnEntry, _FAT_fat_clusterToSector(partition, curEntryPos.cluster) + curEntryPos.sector, curEntryPos.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - } else { - // Alias & file data - _FAT_cache_writePartialSector (partition->cache, entry->entryData, _FAT_fat_clusterToSector(partition, curEntryPos.cluster) + curEntryPos.sector, curEntryPos.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - } - } - } - - return true; -} - -bool _FAT_directory_chdir (PARTITION* partition, const char* path) { - DIR_ENTRY entry; - - if (!_FAT_directory_entryFromPath (partition, &entry, path, NULL)) { - return false; - } - - if (!(entry.entryData[DIR_ENTRY_attributes] & ATTRIB_DIR)) { - return false; - } - - partition->cwdCluster = _FAT_directory_entryGetCluster (partition, entry.entryData); - - return true; -} - -void _FAT_directory_entryStat (PARTITION* partition, DIR_ENTRY* entry, struct stat *st) { - // Fill in the stat struct - // Some of the values are faked for the sake of compatibility - st->st_dev = _FAT_disc_hostType(partition->disc); // The device is the 32bit ioType value - st->st_ino = (ino_t)(_FAT_directory_entryGetCluster(partition, entry->entryData)); // The file serial number is the start cluster - st->st_mode = (_FAT_directory_isDirectory(entry) ? S_IFDIR : S_IFREG) | - (S_IRUSR | S_IRGRP | S_IROTH) | - (_FAT_directory_isWritable (entry) ? (S_IWUSR | S_IWGRP | S_IWOTH) : 0); // Mode bits based on dirEntry ATTRIB byte - st->st_nlink = 1; // Always one hard link on a FAT file - st->st_uid = 1; // Faked for FAT - st->st_gid = 2; // Faked for FAT - st->st_rdev = st->st_dev; - st->st_size = u8array_to_u32 (entry->entryData, DIR_ENTRY_fileSize); // File size - st->st_atime = _FAT_filetime_to_time_t ( - 0, - u8array_to_u16 (entry->entryData, DIR_ENTRY_aDate) - ); - st->st_spare1 = 0; - st->st_mtime = _FAT_filetime_to_time_t ( - u8array_to_u16 (entry->entryData, DIR_ENTRY_mTime), - u8array_to_u16 (entry->entryData, DIR_ENTRY_mDate) - ); - st->st_spare2 = 0; - st->st_ctime = _FAT_filetime_to_time_t ( - u8array_to_u16 (entry->entryData, DIR_ENTRY_cTime), - u8array_to_u16 (entry->entryData, DIR_ENTRY_cDate) - ); - st->st_spare3 = 0; - st->st_blksize = BYTES_PER_READ; // Prefered file I/O block size - st->st_blocks = (st->st_size + BYTES_PER_READ - 1) / BYTES_PER_READ; // File size in blocks - st->st_spare4[0] = 0; - st->st_spare4[1] = 0; -} diff --git a/source/libs/libfat/directory.h b/source/libs/libfat/directory.h deleted file mode 100644 index 93429217..00000000 --- a/source/libs/libfat/directory.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - directory.h - Reading, writing and manipulation of the directory structure on - a FAT partition - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _DIRECTORY_H -#define _DIRECTORY_H - -#include - -#include "common.h" -#include "partition.h" - -#define DIR_ENTRY_DATA_SIZE 0x20 -#define MAX_LFN_LENGTH 256 -#define MAX_FILENAME_LENGTH 768 // 256 UCS-2 characters encoded into UTF-8 can use up to 768 UTF-8 chars -#define MAX_ALIAS_LENGTH 13 -#define LFN_ENTRY_LENGTH 13 -#define ALIAS_ENTRY_LENGTH 11 -#define MAX_ALIAS_EXT_LENGTH 3 -#define MAX_ALIAS_PRI_LENGTH 8 -#define MAX_NUMERIC_TAIL 999999 -#define FAT16_ROOT_DIR_CLUSTER 0 - -#define DIR_SEPARATOR '/' - -// File attributes -#define ATTRIB_ARCH 0x20 // Archive -#define ATTRIB_DIR 0x10 // Directory -#define ATTRIB_LFN 0x0F // Long file name -#define ATTRIB_VOL 0x08 // Volume -#define ATTRIB_SYS 0x04 // System -#define ATTRIB_HID 0x02 // Hidden -#define ATTRIB_RO 0x01 // Read only - -typedef enum {FT_DIRECTORY, FT_FILE} FILE_TYPE; - -typedef struct { - uint32_t cluster; - sec_t sector; - int32_t offset; -} DIR_ENTRY_POSITION; - -typedef struct { - uint8_t entryData[DIR_ENTRY_DATA_SIZE]; - DIR_ENTRY_POSITION dataStart; // Points to the start of the LFN entries of a file, or the alias for no LFN - DIR_ENTRY_POSITION dataEnd; // Always points to the file/directory's alias entry - char filename[MAX_FILENAME_LENGTH]; -} DIR_ENTRY; - -// Directory entry offsets -enum DIR_ENTRY_offset { - DIR_ENTRY_name = 0x00, - DIR_ENTRY_extension = 0x08, - DIR_ENTRY_attributes = 0x0B, - DIR_ENTRY_reserved = 0x0C, - DIR_ENTRY_cTime_ms = 0x0D, - DIR_ENTRY_cTime = 0x0E, - DIR_ENTRY_cDate = 0x10, - DIR_ENTRY_aDate = 0x12, - DIR_ENTRY_clusterHigh = 0x14, - DIR_ENTRY_mTime = 0x16, - DIR_ENTRY_mDate = 0x18, - DIR_ENTRY_cluster = 0x1A, - DIR_ENTRY_fileSize = 0x1C -}; - -/* -Returns true if the file specified by entry is a directory -*/ -static inline bool _FAT_directory_isDirectory (DIR_ENTRY* entry) { - return ((entry->entryData[DIR_ENTRY_attributes] & ATTRIB_DIR) != 0); -} - -static inline bool _FAT_directory_isWritable (DIR_ENTRY* entry) { - return ((entry->entryData[DIR_ENTRY_attributes] & ATTRIB_RO) == 0); -} - -static inline bool _FAT_directory_isDot (DIR_ENTRY* entry) { - return ((entry->filename[0] == '.') && ((entry->filename[1] == '\0') || - ((entry->filename[1] == '.') && entry->filename[2] == '\0'))); -} - -/* -Reads the first directory entry from the directory starting at dirCluster -Places result in entry -entry will be destroyed even if no directory entry is found -Returns true on success, false on failure -*/ -bool _FAT_directory_getFirstEntry (PARTITION* partition, DIR_ENTRY* entry, uint32_t dirCluster); - -/* -Reads the next directory entry after the one already pointed to by entry -Places result in entry -entry will be destroyed even if no directory entry is found -Returns true on success, false on failure -*/ -bool _FAT_directory_getNextEntry (PARTITION* partition, DIR_ENTRY* entry); - -/* -Gets the directory entry corrsponding to the supplied path -entry will be destroyed even if no directory entry is found -pathEnd specifies the end of the path string, for cutting strings short if needed - specify NULL to use the full length of path - pathEnd is only a suggestion, and the path string will be searched up until the next PATH_SEPARATOR - after pathEND. -Returns true on success, false on failure -*/ -bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const char* path, const char* pathEnd); - -/* -Changes the current directory to the one specified by path -Returns true on success, false on failure -*/ -bool _FAT_directory_chdir (PARTITION* partition, const char* path); - -/* -Removes the directory entry specified by entry -Assumes that entry is valid -Returns true on success, false on failure -*/ -bool _FAT_directory_removeEntry (PARTITION* partition, DIR_ENTRY* entry); - -/* -Add a directory entry to the directory specified by dirCluster -The fileData, dataStart and dataEnd elements of the DIR_ENTRY struct are -updated with the new directory entry position and alias. -Returns true on success, false on failure -*/ -bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, uint32_t dirCluster); - -/* -Get the start cluster of a file from it's entry data -*/ -uint32_t _FAT_directory_entryGetCluster (PARTITION* partition, const uint8_t* entryData); - -/* -Fill in the file name and entry data of DIR_ENTRY* entry. -Assumes that the entry's dataStart and dataEnd are correct -Returns true on success, false on failure -*/ -bool _FAT_directory_entryFromPosition (PARTITION* partition, DIR_ENTRY* entry); - -/* -Fill in a stat struct based on a file entry -*/ -void _FAT_directory_entryStat (PARTITION* partition, DIR_ENTRY* entry, struct stat *st); - -/* -Get volume label -*/ -bool _FAT_directory_getVolumeLabel (PARTITION* partition, char *label); - -#endif // _DIRECTORY_H diff --git a/source/libs/libfat/disc.h b/source/libs/libfat/disc.h deleted file mode 100644 index 5c955f90..00000000 --- a/source/libs/libfat/disc.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - disc.h - Interface to the low level disc functions. Used by the higher level - file system code. - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -#ifndef _DISC_H -#define _DISC_H - -#include "common.h" - -/* -A list of all default devices to try at startup, -terminated by a {NULL,NULL} entry. -*/ -typedef struct { - const char* name; - const DISC_INTERFACE* (*getInterface)(void); -} INTERFACE_ID; -extern const INTERFACE_ID _FAT_disc_interfaces[]; - -/* -Check if a disc is inserted -Return true if a disc is inserted and ready, false otherwise -*/ -static inline bool _FAT_disc_isInserted (const DISC_INTERFACE* disc) { - return disc->isInserted(); -} - -/* -Read numSectors sectors from a disc, starting at sector. -numSectors is between 1 and LIMIT_SECTORS if LIMIT_SECTORS is defined, -else it is at least 1 -sector is 0 or greater -buffer is a pointer to the memory to fill -*/ -static inline bool _FAT_disc_readSectors (const DISC_INTERFACE* disc, sec_t sector, sec_t numSectors, void* buffer) { - return disc->readSectors (sector, numSectors, buffer); -} - -/* -Write numSectors sectors to a disc, starting at sector. -numSectors is between 1 and LIMIT_SECTORS if LIMIT_SECTORS is defined, -else it is at least 1 -sector is 0 or greater -buffer is a pointer to the memory to read from -*/ -static inline bool _FAT_disc_writeSectors (const DISC_INTERFACE* disc, sec_t sector, sec_t numSectors, const void* buffer) { - return disc->writeSectors (sector, numSectors, buffer); -} - -/* -Reset the card back to a ready state -*/ -static inline bool _FAT_disc_clearStatus (const DISC_INTERFACE* disc) { - return disc->clearStatus(); -} - -/* -Initialise the disc to a state ready for data reading or writing -*/ -static inline bool _FAT_disc_startup (const DISC_INTERFACE* disc) { - return disc->startup(); -} - -/* -Put the disc in a state ready for power down. -Complete any pending writes and disable the disc if necessary -*/ -static inline bool _FAT_disc_shutdown (const DISC_INTERFACE* disc) { - return disc->shutdown(); -} - -/* -Return a 32 bit value unique to each type of interface -*/ -static inline uint32_t _FAT_disc_hostType (const DISC_INTERFACE* disc) { - return disc->ioType; -} - -/* -Return a 32 bit value that specifies the capabilities of the disc -*/ -static inline uint32_t _FAT_disc_features (const DISC_INTERFACE* disc) { - return disc->features; -} - -#endif // _DISC_H diff --git a/source/libs/libfat/fat.h b/source/libs/libfat/fat.h deleted file mode 100644 index 82c973d3..00000000 --- a/source/libs/libfat/fat.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - fat.h - Simple functionality for startup, mounting and unmounting of FAT-based devices. - - Copyright (c) 2006 - 2009 - Michael "Chishm" Chisholm - Dave "WinterMute" Murphy - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#ifndef _LIBFAT_H -#define _LIBFAT_H - -#ifdef __cplusplus -extern "C" { -#endif - -// When compiling for NDS, make sure NDS is defined -#ifndef NDS - #if defined ARM9 || defined ARM7 - #define NDS - #endif -#endif - -#include - -#if defined(__gamecube__) || defined (__wii__) -# include -#else -# ifdef NDS -# include "nds/disc_io.h" -# else -# include "disc_io.h" -# endif -#endif - -/* -Initialise any inserted block-devices. -Add the fat device driver to the devoptab, making it available for standard file functions. -cacheSize: The number of pages to allocate for each inserted block-device -setAsDefaultDevice: if true, make this the default device driver for file operations -*/ -extern bool fatInit (uint32_t cacheSize, bool setAsDefaultDevice); - -/* -Calls fatInit with setAsDefaultDevice = true and cacheSize optimised for the host system. -*/ -extern bool fatInitDefault (void); - -/* -Mount the device pointed to by interface, and set up a devoptab entry for it as "name:". -You can then access the filesystem using "name:/". -This will mount the active partition or the first valid partition on the disc, -and will use a cache size optimized for the host system. -*/ -extern bool fatMountSimple (const char* name, const DISC_INTERFACE* interface); - -/* -Mount the device pointed to by interface, and set up a devoptab entry for it as "name:". -You can then access the filesystem using "name:/". -If startSector = 0, it will mount the active partition of the first valid partition on -the disc. Otherwise it will try to mount the partition starting at startSector. -cacheSize specifies the number of pages to allocate for the cache. -This will not startup the disc, so you need to call interface->startup(); first. -*/ -extern bool fatMount (const char* name, const DISC_INTERFACE* interface, sec_t startSector, uint32_t cacheSize, uint32_t SectorsPerPage); - -/* -Unmount the partition specified by name. -If there are open files, it will attempt to synchronise them to disc. -*/ -extern void fatUnmount (const char* name); - -/* -Get Volume Label -*/ -extern void fatGetVolumeLabel (const char* name, char *label); - -#ifdef __cplusplus -} -#endif - -#endif // _LIBFAT_H diff --git a/source/libs/libfat/fat_cache.c b/source/libs/libfat/fat_cache.c deleted file mode 100644 index 2b12b70b..00000000 --- a/source/libs/libfat/fat_cache.c +++ /dev/null @@ -1,365 +0,0 @@ -/* - cache.c - The cache is not visible to the user. It should be flushed - when any file is closed or changes are made to the filesystem. - - This cache implements a least-used-page replacement policy. This will - distribute sectors evenly over the pages, so if less than the maximum - pages are used at once, they should all eventually remain in the cache. - This also has the benefit of throwing out old sectors, so as not to keep - too many stale pages around. - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include - -#include "common.h" -#include "cache.h" -#include "disc.h" - -#include "mem_allocate.h" -#include "bit_ops.h" -#include "file_allocation_table.h" - -#define CACHE_FREE UINT_MAX - -CACHE* _FAT_cache_constructor (unsigned int numberOfPages, unsigned int sectorsPerPage, const DISC_INTERFACE* discInterface, sec_t endOfPartition) { - CACHE* cache; - unsigned int i; - CACHE_ENTRY* cacheEntries; - - if (numberOfPages < 2) { - numberOfPages = 2; - } - - if (sectorsPerPage < 8) { - sectorsPerPage = 8; - } - - cache = (CACHE*) _FAT_mem_allocate (sizeof(CACHE)); - if (cache == NULL) { - return NULL; - } - - cache->disc = discInterface; - cache->endOfPartition = endOfPartition; - cache->numberOfPages = numberOfPages; - cache->sectorsPerPage = sectorsPerPage; - - - cacheEntries = (CACHE_ENTRY*) _FAT_mem_allocate ( sizeof(CACHE_ENTRY) * numberOfPages); - if (cacheEntries == NULL) { - _FAT_mem_free (cache); - return NULL; - } - - for (i = 0; i < numberOfPages; i++) { - cacheEntries[i].sector = CACHE_FREE; - cacheEntries[i].count = 0; - cacheEntries[i].last_access = 0; - cacheEntries[i].dirty = false; - cacheEntries[i].cache = (uint8_t*) _FAT_mem_align ( sectorsPerPage * BYTES_PER_READ ); - } - - cache->cacheEntries = cacheEntries; - - return cache; -} - -void _FAT_cache_destructor (CACHE* cache) { - unsigned int i; - // Clear out cache before destroying it - _FAT_cache_flush(cache); - - // Free memory in reverse allocation order - for (i = 0; i < cache->numberOfPages; i++) { - _FAT_mem_free (cache->cacheEntries[i].cache); - } - _FAT_mem_free (cache->cacheEntries); - _FAT_mem_free (cache); -} - - -static u32 accessCounter = 0; - -static u32 accessTime(){ - accessCounter++; - return accessCounter; -} - - -static CACHE_ENTRY* _FAT_cache_getPage(CACHE *cache,sec_t sector) -{ - unsigned int i; - CACHE_ENTRY* cacheEntries = cache->cacheEntries; - unsigned int numberOfPages = cache->numberOfPages; - unsigned int sectorsPerPage = cache->sectorsPerPage; - - bool foundFree = false; - unsigned int oldUsed = 0; - unsigned int oldAccess = UINT_MAX; - - for(i=0;i=cacheEntries[i].sector && sector<(cacheEntries[i].sector + cacheEntries[i].count)) { - cacheEntries[i].last_access = accessTime(); - return &(cacheEntries[i]); - } - - if(foundFree==false && (cacheEntries[i].sector==CACHE_FREE || cacheEntries[i].last_accessdisc,cacheEntries[oldUsed].sector,cacheEntries[oldUsed].count,cacheEntries[oldUsed].cache)) return NULL; - cacheEntries[oldUsed].dirty = false; - } - - sector = (sector/sectorsPerPage)*sectorsPerPage; // align base sector to page size - sec_t next_page = sector + sectorsPerPage; - if(next_page > cache->endOfPartition) next_page = cache->endOfPartition; - - if(!_FAT_disc_readSectors(cache->disc,sector,next_page-sector,cacheEntries[oldUsed].cache)) return NULL; - - cacheEntries[oldUsed].sector = sector; - cacheEntries[oldUsed].count = next_page-sector; - cacheEntries[oldUsed].last_access = accessTime(); - - return &(cacheEntries[oldUsed]); -} - -bool _FAT_cache_readSectors(CACHE *cache,sec_t sector,sec_t numSectors,void *buffer) -{ - sec_t sec; - sec_t secs_to_read; - CACHE_ENTRY *entry; - uint8_t *dest = (uint8_t *)buffer; - - while(numSectors>0) { - entry = _FAT_cache_getPage(cache,sector); - if(entry==NULL) return false; - - sec = sector - entry->sector; - secs_to_read = entry->count - sec; - if(secs_to_read>numSectors) secs_to_read = numSectors; - - memcpy(dest,entry->cache + (sec*BYTES_PER_READ),(secs_to_read*BYTES_PER_READ)); - - dest += (secs_to_read*BYTES_PER_READ); - sector += secs_to_read; - numSectors -= secs_to_read; - } - - return true; -} - -/* -Reads some data from a cache page, determined by the sector number -*/ -bool _FAT_cache_readPartialSector (CACHE* cache, void* buffer, sec_t sector, unsigned int offset, size_t size) -{ - sec_t sec; - CACHE_ENTRY *entry; - - if (offset + size > BYTES_PER_READ) return false; - - entry = _FAT_cache_getPage(cache,sector); - if(entry==NULL) return false; - - sec = sector - entry->sector; - memcpy(buffer,entry->cache + ((sec*BYTES_PER_READ) + offset),size); - - return true; -} - -bool _FAT_cache_readLittleEndianValue (CACHE* cache, uint32_t *value, sec_t sector, unsigned int offset, int num_bytes) { - uint8_t buf[4]; - if (!_FAT_cache_readPartialSector(cache, buf, sector, offset, num_bytes)) return false; - - switch(num_bytes) { - case 1: *value = buf[0]; break; - case 2: *value = u8array_to_u16(buf,0); break; - case 4: *value = u8array_to_u32(buf,0); break; - default: return false; - } - return true; -} - -/* -Writes some data to a cache page, making sure it is loaded into memory first. -*/ -bool _FAT_cache_writePartialSector (CACHE* cache, const void* buffer, sec_t sector, unsigned int offset, size_t size) -{ - sec_t sec; - CACHE_ENTRY *entry; - - if (offset + size > BYTES_PER_READ) return false; - - entry = _FAT_cache_getPage(cache,sector); - if(entry==NULL) return false; - - sec = sector - entry->sector; - memcpy(entry->cache + ((sec*BYTES_PER_READ) + offset),buffer,size); - - entry->dirty = true; - return true; -} - -bool _FAT_cache_writeLittleEndianValue (CACHE* cache, const uint32_t value, sec_t sector, unsigned int offset, int size) { - uint8_t buf[4] = {0, 0, 0, 0}; - - switch(size) { - case 1: buf[0] = value; break; - case 2: u16_to_u8array(buf, 0, value); break; - case 4: u32_to_u8array(buf, 0, value); break; - default: return false; - } - - return _FAT_cache_writePartialSector(cache, buf, sector, offset, size); -} - -/* -Writes some data to a cache page, zeroing out the page first -*/ -bool _FAT_cache_eraseWritePartialSector (CACHE* cache, const void* buffer, sec_t sector, unsigned int offset, size_t size) -{ - sec_t sec; - CACHE_ENTRY *entry; - - if (offset + size > BYTES_PER_READ) return false; - - entry = _FAT_cache_getPage(cache,sector); - if(entry==NULL) return false; - - sec = sector - entry->sector; - memset(entry->cache + (sec*BYTES_PER_READ),0,BYTES_PER_READ); - memcpy(entry->cache + ((sec*BYTES_PER_READ) + offset),buffer,size); - - entry->dirty = true; - return true; -} - -#ifndef GEKKO -static CACHE_ENTRY* _FAT_cache_findPage(CACHE *cache, sec_t sector, sec_t count) { - - unsigned int i; - CACHE_ENTRY* cacheEntries = cache->cacheEntries; - unsigned int numberOfPages = cache->numberOfPages; - CACHE_ENTRY *entry = NULL; - sec_t lowest = UINT_MAX; - - for(i=0;i cacheEntries[i].sector) { - intersect = sector - cacheEntries[i].sector < cacheEntries[i].count; - } else { - intersect = cacheEntries[i].sector - sector < count; - } - - if ( intersect && (cacheEntries[i].sector < lowest)) { - lowest = cacheEntries[i].sector; - entry = &cacheEntries[i]; - } - } - } - - return entry; -} -#endif - -bool _FAT_cache_writeSectors (CACHE* cache, sec_t sector, sec_t numSectors, const void* buffer) -{ - sec_t sec; - sec_t secs_to_write; - CACHE_ENTRY* entry; - const uint8_t *src = (const uint8_t *)buffer; - - while(numSectors>0) - { -#ifdef GEKKO - entry = _FAT_cache_getPage(cache,sector); - if(entry==NULL) return false; -#else - entry = _FAT_cache_findPage(cache,sector,numSectors); - - if(entry==NULL) - return _FAT_disc_writeSectors(cache->disc,sector,numSectors,src); - - if ( entry->sector > sector) { - secs_to_write = entry->sector - sector; - - _FAT_disc_writeSectors(cache->disc,sector,secs_to_write,src); - src += (secs_to_write*BYTES_PER_READ); - sector += secs_to_write; - numSectors -= secs_to_write; - } -#endif - sec = sector - entry->sector; - secs_to_write = entry->count - sec; - if(secs_to_write>numSectors) secs_to_write = numSectors; - - memcpy(entry->cache + (sec*BYTES_PER_READ),src,(secs_to_write*BYTES_PER_READ)); - - src += (secs_to_write*BYTES_PER_READ); - sector += secs_to_write; - numSectors -= secs_to_write; - - entry->dirty = true; - } - return true; -} - -/* -Flushes all dirty pages to disc, clearing the dirty flag. -*/ -bool _FAT_cache_flush (CACHE* cache) { - unsigned int i; - - for (i = 0; i < cache->numberOfPages; i++) { - if (cache->cacheEntries[i].dirty) { - if (!_FAT_disc_writeSectors (cache->disc, cache->cacheEntries[i].sector, cache->cacheEntries[i].count, cache->cacheEntries[i].cache)) { - return false; - } - } - cache->cacheEntries[i].dirty = false; - } - - return true; -} - -void _FAT_cache_invalidate (CACHE* cache) { - unsigned int i; - _FAT_cache_flush(cache); - for (i = 0; i < cache->numberOfPages; i++) { - cache->cacheEntries[i].sector = CACHE_FREE; - cache->cacheEntries[i].last_access = 0; - cache->cacheEntries[i].count = 0; - cache->cacheEntries[i].dirty = false; - } -} diff --git a/source/libs/libfat/fat_disc.c b/source/libs/libfat/fat_disc.c deleted file mode 100644 index 1fac0ed9..00000000 --- a/source/libs/libfat/fat_disc.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - disc.c - Interface to the low level disc functions. Used by the higher level - file system code. - - Copyright (c) 2008 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "disc.h" - -/* -The list of interfaces consists of a series of name/interface pairs. -The interface is returned via a simple function. This allows for -platforms where the interface has to be "assembled" before it can -be used, like DLDI on the NDS. For cases where a simple struct -is available, wrapper functions are used. -The list is terminated by a NULL/NULL entry. -*/ - -/* ====================== Wii ====================== */ -#if defined (__wii__) -#include -#include -#include - -static const DISC_INTERFACE* get_io_wiisd (void) { - return &__io_wiisd; -} -static const DISC_INTERFACE* get_io_usbstorage (void) { - return &__io_usbstorage; -} - -static const DISC_INTERFACE* get_io_gcsda (void) { - return &__io_gcsda; -} -static const DISC_INTERFACE* get_io_gcsdb (void) { - return &__io_gcsdb; -} - -const INTERFACE_ID _FAT_disc_interfaces[] = { - {"sd", get_io_wiisd}, - {"usb", get_io_usbstorage}, - {"carda", get_io_gcsda}, - {"cardb", get_io_gcsdb}, - {NULL, NULL} -}; - -/* ==================== Gamecube ==================== */ -#elif defined (__gamecube__) -#include - -static const DISC_INTERFACE* get_io_gcsda (void) { - return &__io_gcsda; -} -static const DISC_INTERFACE* get_io_gcsdb (void) { - return &__io_gcsdb; -} - -const INTERFACE_ID _FAT_disc_interfaces[] = { - {"carda", get_io_gcsda}, - {"cardb", get_io_gcsdb}, - {NULL, NULL} -}; - -/* ====================== NDS ====================== */ -#elif defined (NDS) -#include - -const INTERFACE_ID _FAT_disc_interfaces[] = { - {"fat", dldiGetInternal}, - {NULL, NULL} -}; - -/* ====================== GBA ====================== */ -#elif defined (GBA) -#include - -const INTERFACE_ID _FAT_disc_interfaces[] = { - {"fat", discGetInterface}, - {NULL, NULL} -}; - -#endif - diff --git a/source/libs/libfat/fatdir.c b/source/libs/libfat/fatdir.c deleted file mode 100644 index 55faa0b9..00000000 --- a/source/libs/libfat/fatdir.c +++ /dev/null @@ -1,610 +0,0 @@ -/* - fatdir.c - - Functions used by the newlib disc stubs to interface with - this library - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include - -#include "fatdir.h" - -#include "cache.h" -#include "file_allocation_table.h" -#include "partition.h" -#include "directory.h" -#include "bit_ops.h" -#include "filetime.h" -#include "lock.h" - - -int _FAT_stat_r (struct _reent *r, const char *path, struct stat *st) { - PARTITION* partition = NULL; - DIR_ENTRY dirEntry; - - // Get the partition this file is on - partition = _FAT_partition_getPartitionFromPath (path); - if (partition == NULL) { - r->_errno = ENODEV; - return -1; - } - - // Move the path pointer to the start of the actual path - if (strchr (path, ':') != NULL) { - path = strchr (path, ':') + 1; - } - if (strchr (path, ':') != NULL) { - r->_errno = EINVAL; - return -1; - } - - _FAT_lock(&partition->lock); - - // Search for the file on the disc - if (!_FAT_directory_entryFromPath (partition, &dirEntry, path, NULL)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOENT; - return -1; - } - - // Fill in the stat struct - _FAT_directory_entryStat (partition, &dirEntry, st); - - _FAT_unlock(&partition->lock); - return 0; -} - -int _FAT_link_r (struct _reent *r, const char *existing, const char *newLink) { - r->_errno = ENOTSUP; - return -1; -} - -int _FAT_unlink_r (struct _reent *r, const char *path) { - PARTITION* partition = NULL; - DIR_ENTRY dirEntry; - DIR_ENTRY dirContents; - uint32_t cluster; - bool nextEntry; - bool errorOccured = false; - - // Get the partition this directory is on - partition = _FAT_partition_getPartitionFromPath (path); - if (partition == NULL) { - r->_errno = ENODEV; - return -1; - } - - // Make sure we aren't trying to write to a read-only disc - if (partition->readOnly) { - r->_errno = EROFS; - return -1; - } - - // Move the path pointer to the start of the actual path - if (strchr (path, ':') != NULL) { - path = strchr (path, ':') + 1; - } - if (strchr (path, ':') != NULL) { - r->_errno = EINVAL; - return -1; - } - - _FAT_lock(&partition->lock); - - // Search for the file on the disc - if (!_FAT_directory_entryFromPath (partition, &dirEntry, path, NULL)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOENT; - return -1; - } - - cluster = _FAT_directory_entryGetCluster (partition, dirEntry.entryData); - - - // If this is a directory, make sure it is empty - if (_FAT_directory_isDirectory (&dirEntry)) { - nextEntry = _FAT_directory_getFirstEntry (partition, &dirContents, cluster); - - while (nextEntry) { - if (!_FAT_directory_isDot (&dirContents)) { - // The directory had something in it that isn't a reference to itself or it's parent - _FAT_unlock(&partition->lock); - r->_errno = EPERM; - return -1; - } - nextEntry = _FAT_directory_getNextEntry (partition, &dirContents); - } - } - - if (_FAT_fat_isValidCluster(partition, cluster)) { - // Remove the cluster chain for this file - if (!_FAT_fat_clearLinks (partition, cluster)) { - r->_errno = EIO; - errorOccured = true; - } - } - - // Remove the directory entry for this file - if (!_FAT_directory_removeEntry (partition, &dirEntry)) { - r->_errno = EIO; - errorOccured = true; - } - - // Flush any sectors in the disc cache - if (!_FAT_cache_flush(partition->cache)) { - r->_errno = EIO; - errorOccured = true; - } - - _FAT_unlock(&partition->lock); - if (errorOccured) { - return -1; - } else { - return 0; - } -} - -int _FAT_chdir_r (struct _reent *r, const char *path) { - PARTITION* partition = NULL; - - // Get the partition this directory is on - partition = _FAT_partition_getPartitionFromPath (path); - if (partition == NULL) { - r->_errno = ENODEV; - return -1; - } - - // Move the path pointer to the start of the actual path - if (strchr (path, ':') != NULL) { - path = strchr (path, ':') + 1; - } - if (strchr (path, ':') != NULL) { - r->_errno = EINVAL; - return -1; - } - - _FAT_lock(&partition->lock); - - // Try changing directory - if (_FAT_directory_chdir (partition, path)) { - // Successful - _FAT_unlock(&partition->lock); - return 0; - } else { - // Failed - _FAT_unlock(&partition->lock); - r->_errno = ENOTDIR; - return -1; - } -} - -int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName) { - PARTITION* partition = NULL; - DIR_ENTRY oldDirEntry; - DIR_ENTRY newDirEntry; - const char *pathEnd; - uint32_t dirCluster; - - // Get the partition this directory is on - partition = _FAT_partition_getPartitionFromPath (oldName); - if (partition == NULL) { - r->_errno = ENODEV; - return -1; - } - - _FAT_lock(&partition->lock); - - // Make sure the same partition is used for the old and new names - if (partition != _FAT_partition_getPartitionFromPath (newName)) { - _FAT_unlock(&partition->lock); - r->_errno = EXDEV; - return -1; - } - - // Make sure we aren't trying to write to a read-only disc - if (partition->readOnly) { - _FAT_unlock(&partition->lock); - r->_errno = EROFS; - return -1; - } - - // Move the path pointer to the start of the actual path - if (strchr (oldName, ':') != NULL) { - oldName = strchr (oldName, ':') + 1; - } - if (strchr (oldName, ':') != NULL) { - _FAT_unlock(&partition->lock); - r->_errno = EINVAL; - return -1; - } - if (strchr (newName, ':') != NULL) { - newName = strchr (newName, ':') + 1; - } - if (strchr (newName, ':') != NULL) { - _FAT_unlock(&partition->lock); - r->_errno = EINVAL; - return -1; - } - - // Search for the file on the disc - if (!_FAT_directory_entryFromPath (partition, &oldDirEntry, oldName, NULL)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOENT; - return -1; - } - - // Make sure there is no existing file / directory with the new name - if (_FAT_directory_entryFromPath (partition, &newDirEntry, newName, NULL)) { - _FAT_unlock(&partition->lock); - r->_errno = EEXIST; - return -1; - } - - // Create the new file entry - // Get the directory it has to go in - pathEnd = strrchr (newName, DIR_SEPARATOR); - if (pathEnd == NULL) { - // No path was specified - dirCluster = partition->cwdCluster; - pathEnd = newName; - } else { - // Path was specified -- get the right dirCluster - // Recycling newDirEntry, since it needs to be recreated anyway - if (!_FAT_directory_entryFromPath (partition, &newDirEntry, newName, pathEnd) || - !_FAT_directory_isDirectory(&newDirEntry)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOTDIR; - return -1; - } - dirCluster = _FAT_directory_entryGetCluster (partition, newDirEntry.entryData); - // Move the pathEnd past the last DIR_SEPARATOR - pathEnd += 1; - } - - // Copy the entry data - memcpy (&newDirEntry, &oldDirEntry, sizeof(DIR_ENTRY)); - - // Set the new name - strncpy (newDirEntry.filename, pathEnd, MAX_FILENAME_LENGTH - 1); - - // Write the new entry - if (!_FAT_directory_addEntry (partition, &newDirEntry, dirCluster)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOSPC; - return -1; - } - - // Remove the old entry - if (!_FAT_directory_removeEntry (partition, &oldDirEntry)) { - _FAT_unlock(&partition->lock); - r->_errno = EIO; - return -1; - } - - // Flush any sectors in the disc cache - if (!_FAT_cache_flush (partition->cache)) { - _FAT_unlock(&partition->lock); - r->_errno = EIO; - return -1; - } - - _FAT_unlock(&partition->lock); - return 0; -} - -int _FAT_mkdir_r (struct _reent *r, const char *path, int mode) { - PARTITION* partition = NULL; - bool fileExists; - DIR_ENTRY dirEntry; - const char* pathEnd; - uint32_t parentCluster, dirCluster; - uint8_t newEntryData[DIR_ENTRY_DATA_SIZE]; - - partition = _FAT_partition_getPartitionFromPath (path); - if (partition == NULL) { - r->_errno = ENODEV; - return -1; - } - - // Move the path pointer to the start of the actual path - if (strchr (path, ':') != NULL) { - path = strchr (path, ':') + 1; - } - if (strchr (path, ':') != NULL) { - r->_errno = EINVAL; - return -1; - } - - _FAT_lock(&partition->lock); - - // Search for the file/directory on the disc - fileExists = _FAT_directory_entryFromPath (partition, &dirEntry, path, NULL); - - // Make sure it doesn't exist - if (fileExists) { - _FAT_unlock(&partition->lock); - r->_errno = EEXIST; - return -1; - } - - if (partition->readOnly) { - // We can't write to a read-only partition - _FAT_unlock(&partition->lock); - r->_errno = EROFS; - return -1; - } - - // Get the directory it has to go in - pathEnd = strrchr (path, DIR_SEPARATOR); - if (pathEnd == NULL) { - // No path was specified - parentCluster = partition->cwdCluster; - pathEnd = path; - } else { - // Path was specified -- get the right parentCluster - // Recycling dirEntry, since it needs to be recreated anyway - if (!_FAT_directory_entryFromPath (partition, &dirEntry, path, pathEnd) || - !_FAT_directory_isDirectory(&dirEntry)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOTDIR; - return -1; - } - parentCluster = _FAT_directory_entryGetCluster (partition, dirEntry.entryData); - // Move the pathEnd past the last DIR_SEPARATOR - pathEnd += 1; - } - // Create the entry data - strncpy (dirEntry.filename, pathEnd, MAX_FILENAME_LENGTH - 1); - memset (dirEntry.entryData, 0, DIR_ENTRY_DATA_SIZE); - - // Set the creation time and date - dirEntry.entryData[DIR_ENTRY_cTime_ms] = 0; - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cTime, _FAT_filetime_getTimeFromRTC()); - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cDate, _FAT_filetime_getDateFromRTC()); - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_mTime, _FAT_filetime_getTimeFromRTC()); - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_mDate, _FAT_filetime_getDateFromRTC()); - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_aDate, _FAT_filetime_getDateFromRTC()); - - // Set the directory attribute - dirEntry.entryData[DIR_ENTRY_attributes] = ATTRIB_DIR; - - // Get a cluster for the new directory - dirCluster = _FAT_fat_linkFreeClusterCleared (partition, CLUSTER_FREE); - if (!_FAT_fat_isValidCluster(partition, dirCluster)) { - // No space left on disc for the cluster - _FAT_unlock(&partition->lock); - r->_errno = ENOSPC; - return -1; - } - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cluster, dirCluster); - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_clusterHigh, dirCluster >> 16); - - // Write the new directory's entry to it's parent - if (!_FAT_directory_addEntry (partition, &dirEntry, parentCluster)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOSPC; - return -1; - } - - // Create the dot entry within the directory - memset (newEntryData, 0, DIR_ENTRY_DATA_SIZE); - memset (newEntryData, ' ', 11); - newEntryData[DIR_ENTRY_name] = '.'; - newEntryData[DIR_ENTRY_attributes] = ATTRIB_DIR; - u16_to_u8array (newEntryData, DIR_ENTRY_cluster, dirCluster); - u16_to_u8array (newEntryData, DIR_ENTRY_clusterHigh, dirCluster >> 16); - - // Write it to the directory, erasing that sector in the process - _FAT_cache_eraseWritePartialSector ( partition->cache, newEntryData, - _FAT_fat_clusterToSector (partition, dirCluster), 0, DIR_ENTRY_DATA_SIZE); - - - // Create the double dot entry within the directory - - // if ParentDir == Rootdir then ".."" always link to Cluster 0 - if(parentCluster == partition->rootDirCluster) - parentCluster = FAT16_ROOT_DIR_CLUSTER; - - newEntryData[DIR_ENTRY_name + 1] = '.'; - u16_to_u8array (newEntryData, DIR_ENTRY_cluster, parentCluster); - u16_to_u8array (newEntryData, DIR_ENTRY_clusterHigh, parentCluster >> 16); - - // Write it to the directory - _FAT_cache_writePartialSector ( partition->cache, newEntryData, - _FAT_fat_clusterToSector (partition, dirCluster), DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - - // Flush any sectors in the disc cache - if (!_FAT_cache_flush(partition->cache)) { - _FAT_unlock(&partition->lock); - r->_errno = EIO; - return -1; - } - - _FAT_unlock(&partition->lock); - return 0; -} - -int _FAT_statvfs_r (struct _reent *r, const char *path, struct statvfs *buf) -{ - PARTITION* partition = NULL; - unsigned int freeClusterCount; - - // Get the partition of the requested path - partition = _FAT_partition_getPartitionFromPath (path); - if (partition == NULL) { - r->_errno = ENODEV; - return -1; - } - - _FAT_lock(&partition->lock); - - freeClusterCount = _FAT_fat_freeClusterCount (partition); - - // FAT clusters = POSIX blocks - buf->f_bsize = partition->bytesPerCluster; // File system block size. - buf->f_frsize = partition->bytesPerCluster; // Fundamental file system block size. - - buf->f_blocks = partition->fat.lastCluster - CLUSTER_FIRST + 1; // Total number of blocks on file system in units of f_frsize. - buf->f_bfree = freeClusterCount; // Total number of free blocks. - buf->f_bavail = freeClusterCount; // Number of free blocks available to non-privileged process. - - // Treat requests for info on inodes as clusters - buf->f_files = partition->fat.lastCluster - CLUSTER_FIRST + 1; // Total number of file serial numbers. - buf->f_ffree = freeClusterCount; // Total number of free file serial numbers. - buf->f_favail = freeClusterCount; // Number of file serial numbers available to non-privileged process. - - // File system ID. 32bit ioType value - buf->f_fsid = _FAT_disc_hostType(partition->disc); - - // Bit mask of f_flag values. - buf->f_flag = ST_NOSUID /* No support for ST_ISUID and ST_ISGID file mode bits */ - | (partition->readOnly ? ST_RDONLY /* Read only file system */ : 0 ) ; - // Maximum filename length. - buf->f_namemax = MAX_FILENAME_LENGTH; - - _FAT_unlock(&partition->lock); - return 0; -} - -DIR_ITER* _FAT_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path) { - DIR_ENTRY dirEntry; - DIR_STATE_STRUCT* state = (DIR_STATE_STRUCT*) (dirState->dirStruct); - bool fileExists; - - state->partition = _FAT_partition_getPartitionFromPath (path); - if (state->partition == NULL) { - r->_errno = ENODEV; - return NULL; - } - - // Move the path pointer to the start of the actual path - if (strchr (path, ':') != NULL) { - path = strchr (path, ':') + 1; - } - if (strchr (path, ':') != NULL) { - r->_errno = EINVAL; - return NULL; - } - - _FAT_lock(&state->partition->lock); - - // Get the start cluster of the directory - fileExists = _FAT_directory_entryFromPath (state->partition, &dirEntry, path, NULL); - - if (!fileExists) { - _FAT_unlock(&state->partition->lock); - r->_errno = ENOENT; - return NULL; - } - - // Make sure it is a directory - if (! _FAT_directory_isDirectory (&dirEntry)) { - _FAT_unlock(&state->partition->lock); - r->_errno = ENOTDIR; - return NULL; - } - - // Save the start cluster for use when resetting the directory data - state->startCluster = _FAT_directory_entryGetCluster (state->partition, dirEntry.entryData); - - // Get the first entry for use with a call to dirnext - state->validEntry = - _FAT_directory_getFirstEntry (state->partition, &(state->currentEntry), state->startCluster); - - // We are now using this entry - state->inUse = true; - _FAT_unlock(&state->partition->lock); - return (DIR_ITER*) state; -} - -int _FAT_dirreset_r (struct _reent *r, DIR_ITER *dirState) { - DIR_STATE_STRUCT* state = (DIR_STATE_STRUCT*) (dirState->dirStruct); - - _FAT_lock(&state->partition->lock); - - // Make sure we are still using this entry - if (!state->inUse) { - _FAT_unlock(&state->partition->lock); - r->_errno = EBADF; - return -1; - } - - // Get the first entry for use with a call to dirnext - state->validEntry = - _FAT_directory_getFirstEntry (state->partition, &(state->currentEntry), state->startCluster); - - _FAT_unlock(&state->partition->lock); - return 0; -} - -int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *filestat) { - DIR_STATE_STRUCT* state = (DIR_STATE_STRUCT*) (dirState->dirStruct); - - _FAT_lock(&state->partition->lock); - - // Make sure we are still using this entry - if (!state->inUse) { - _FAT_unlock(&state->partition->lock); - r->_errno = EBADF; - return -1; - } - - // Make sure there is another file to report on - if (! state->validEntry) { - _FAT_unlock(&state->partition->lock); - r->_errno = ENOENT; - return -1; - } - - // Get the filename - strncpy (filename, state->currentEntry.filename, MAX_FILENAME_LENGTH); - // Get the stats, if requested - if (filestat != NULL) { - _FAT_directory_entryStat (state->partition, &(state->currentEntry), filestat); - } - - // Look for the next entry for use next time - state->validEntry = - _FAT_directory_getNextEntry (state->partition, &(state->currentEntry)); - - _FAT_unlock(&state->partition->lock); - return 0; -} - -int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState) { - DIR_STATE_STRUCT* state = (DIR_STATE_STRUCT*) (dirState->dirStruct); - - // We are no longer using this entry - _FAT_lock(&state->partition->lock); - state->inUse = false; - _FAT_unlock(&state->partition->lock); - - return 0; -} diff --git a/source/libs/libfat/fatdir.h b/source/libs/libfat/fatdir.h deleted file mode 100644 index 426dd30b..00000000 --- a/source/libs/libfat/fatdir.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - fatdir.h - - Functions used by the newlib disc stubs to interface with - this library - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#ifndef _FATDIR_H -#define _FATDIR_H - -#include -#include -#include -#include -#include "common.h" -#include "directory.h" - -typedef struct { - PARTITION* partition; - DIR_ENTRY currentEntry; - uint32_t startCluster; - bool inUse; - bool validEntry; -} DIR_STATE_STRUCT; - -extern int _FAT_stat_r (struct _reent *r, const char *path, struct stat *st); - -extern int _FAT_link_r (struct _reent *r, const char *existing, const char *newLink); - -extern int _FAT_unlink_r (struct _reent *r, const char *name); - -extern int _FAT_chdir_r (struct _reent *r, const char *name); - -extern int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName); - -extern int _FAT_mkdir_r (struct _reent *r, const char *path, int mode); - -extern int _FAT_statvfs_r (struct _reent *r, const char *path, struct statvfs *buf); - -/* -Directory iterator functions -*/ -extern DIR_ITER* _FAT_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path); -extern int _FAT_dirreset_r (struct _reent *r, DIR_ITER *dirState); -extern int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *filestat); -extern int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState); - - -#endif // _FATDIR_H diff --git a/source/libs/libfat/fatfile.c b/source/libs/libfat/fatfile.c deleted file mode 100644 index 3ea6d323..00000000 --- a/source/libs/libfat/fatfile.c +++ /dev/null @@ -1,1184 +0,0 @@ -/* - fatfile.c - - Functions used by the newlib disc stubs to interface with - this library - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - 2009-10-23 oggzee: fixes for cluster aligned file size (write, truncate, seek) -*/ - - -#include "fatfile.h" - -#include -#include -#include -#include -#include - -#include "cache.h" -#include "file_allocation_table.h" -#include "bit_ops.h" -#include "filetime.h" -#include "lock.h" - -int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags, int mode) { - PARTITION* partition = NULL; - bool fileExists; - DIR_ENTRY dirEntry; - const char* pathEnd; - uint32_t dirCluster; - FILE_STRUCT* file = (FILE_STRUCT*) fileStruct; - partition = _FAT_partition_getPartitionFromPath (path); - - if (partition == NULL) { - r->_errno = ENODEV; - return -1; - } - - // Move the path pointer to the start of the actual path - if (strchr (path, ':') != NULL) { - path = strchr (path, ':') + 1; - } - if (strchr (path, ':') != NULL) { - r->_errno = EINVAL; - return -1; - } - - // Determine which mode the file is openned for - if ((flags & 0x03) == O_RDONLY) { - // Open the file for read-only access - file->read = true; - file->write = false; - file->append = false; - } else if ((flags & 0x03) == O_WRONLY) { - // Open file for write only access - file->read = false; - file->write = true; - file->append = false; - } else if ((flags & 0x03) == O_RDWR) { - // Open file for read/write access - file->read = true; - file->write = true; - file->append = false; - } else { - r->_errno = EACCES; - return -1; - } - - // Make sure we aren't trying to write to a read-only disc - if (file->write && partition->readOnly) { - r->_errno = EROFS; - return -1; - } - - // Search for the file on the disc - _FAT_lock(&partition->lock); - fileExists = _FAT_directory_entryFromPath (partition, &dirEntry, path, NULL); - - // The file shouldn't exist if we are trying to create it - if ((flags & O_CREAT) && (flags & O_EXCL) && fileExists) { - _FAT_unlock(&partition->lock); - r->_errno = EEXIST; - return -1; - } - - // It should not be a directory if we're openning a file, - if (fileExists && _FAT_directory_isDirectory(&dirEntry)) { - _FAT_unlock(&partition->lock); - r->_errno = EISDIR; - return -1; - } - - // We haven't modified the file yet - file->modified = false; - - // If the file doesn't exist, create it if we're allowed to - if (!fileExists) { - if (flags & O_CREAT) { - if (partition->readOnly) { - // We can't write to a read-only partition - _FAT_unlock(&partition->lock); - r->_errno = EROFS; - return -1; - } - // Create the file - // Get the directory it has to go in - pathEnd = strrchr (path, DIR_SEPARATOR); - if (pathEnd == NULL) { - // No path was specified - dirCluster = partition->cwdCluster; - pathEnd = path; - } else { - // Path was specified -- get the right dirCluster - // Recycling dirEntry, since it needs to be recreated anyway - if (!_FAT_directory_entryFromPath (partition, &dirEntry, path, pathEnd) || - !_FAT_directory_isDirectory(&dirEntry)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOTDIR; - return -1; - } - dirCluster = _FAT_directory_entryGetCluster (partition, dirEntry.entryData); - // Move the pathEnd past the last DIR_SEPARATOR - pathEnd += 1; - } - // Create the entry data - strncpy (dirEntry.filename, pathEnd, MAX_FILENAME_LENGTH - 1); - memset (dirEntry.entryData, 0, DIR_ENTRY_DATA_SIZE); - - // Set the creation time and date - dirEntry.entryData[DIR_ENTRY_cTime_ms] = 0; - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cTime, _FAT_filetime_getTimeFromRTC()); - u16_to_u8array (dirEntry.entryData, DIR_ENTRY_cDate, _FAT_filetime_getDateFromRTC()); - - if (!_FAT_directory_addEntry (partition, &dirEntry, dirCluster)) { - _FAT_unlock(&partition->lock); - r->_errno = ENOSPC; - return -1; - } - - // File entry is modified - file->modified = true; - } else { - // file doesn't exist, and we aren't creating it - _FAT_unlock(&partition->lock); - r->_errno = ENOENT; - return -1; - } - } - - file->filesize = u8array_to_u32 (dirEntry.entryData, DIR_ENTRY_fileSize); - - /* Allow LARGEFILEs with undefined results - // Make sure that the file size can fit in the available space - if (!(flags & O_LARGEFILE) && (file->filesize >= (1<<31))) { - r->_errno = EFBIG; - return -1; - } - */ - - // Make sure we aren't trying to write to a read-only file - if (file->write && !_FAT_directory_isWritable(&dirEntry)) { - _FAT_unlock(&partition->lock); - r->_errno = EROFS; - return -1; - } - - // Associate this file with a particular partition - file->partition = partition; - - file->startCluster = _FAT_directory_entryGetCluster (partition, dirEntry.entryData); - - // Truncate the file if requested - if ((flags & O_TRUNC) && file->write && (file->startCluster != 0)) { - _FAT_fat_clearLinks (partition, file->startCluster); - file->startCluster = CLUSTER_FREE; - file->filesize = 0; - // File is modified since we just cut it all off - file->modified = true; - } - - // Remember the position of this file's directory entry - file->dirEntryStart = dirEntry.dataStart; // Points to the start of the LFN entries of a file, or the alias for no LFN - file->dirEntryEnd = dirEntry.dataEnd; - - // Reset read/write pointer - file->currentPosition = 0; - file->rwPosition.cluster = file->startCluster; - file->rwPosition.sector = 0; - file->rwPosition.byte = 0; - - if (flags & O_APPEND) { - file->append = true; - - // Set append pointer to the end of the file - file->appendPosition.cluster = _FAT_fat_lastCluster (partition, file->startCluster); - file->appendPosition.sector = (file->filesize % partition->bytesPerCluster) / BYTES_PER_READ; - file->appendPosition.byte = file->filesize % BYTES_PER_READ; - - // Check if the end of the file is on the end of a cluster - if ( (file->filesize > 0) && ((file->filesize % partition->bytesPerCluster)==0) ){ - // Set flag to allocate a new cluster - file->appendPosition.sector = partition->sectorsPerCluster; - file->appendPosition.byte = 0; - } - } else { - file->append = false; - // Use something sane for the append pointer, so the whole file struct contains known values - file->appendPosition = file->rwPosition; - } - - file->inUse = true; - - // Insert this file into the double-linked list of open files - partition->openFileCount += 1; - if (partition->firstOpenFile) { - file->nextOpenFile = partition->firstOpenFile; - partition->firstOpenFile->prevOpenFile = file; - } else { - file->nextOpenFile = NULL; - } - file->prevOpenFile = NULL; - partition->firstOpenFile = file; - - _FAT_unlock(&partition->lock); - - return (int) file; -} - -/* -Synchronizes the file data to disc. -Does no locking of its own -- lock the partition before calling. -Returns 0 on success, an error code on failure. -*/ -int _FAT_syncToDisc (FILE_STRUCT* file) { - uint8_t dirEntryData[DIR_ENTRY_DATA_SIZE]; - - if (!file || !file->inUse) { - return EBADF; - } - - if (file->write && file->modified) { - // Load the old entry - _FAT_cache_readPartialSector (file->partition->cache, dirEntryData, - _FAT_fat_clusterToSector(file->partition, file->dirEntryEnd.cluster) + file->dirEntryEnd.sector, - file->dirEntryEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - - // Write new data to the directory entry - // File size - u32_to_u8array (dirEntryData, DIR_ENTRY_fileSize, file->filesize); - - // Start cluster - u16_to_u8array (dirEntryData, DIR_ENTRY_cluster, file->startCluster); - u16_to_u8array (dirEntryData, DIR_ENTRY_clusterHigh, file->startCluster >> 16); - - // Modification time and date - u16_to_u8array (dirEntryData, DIR_ENTRY_mTime, _FAT_filetime_getTimeFromRTC()); - u16_to_u8array (dirEntryData, DIR_ENTRY_mDate, _FAT_filetime_getDateFromRTC()); - - // Access date - u16_to_u8array (dirEntryData, DIR_ENTRY_aDate, _FAT_filetime_getDateFromRTC()); - - // Set archive attribute - dirEntryData[DIR_ENTRY_attributes] |= ATTRIB_ARCH; - - // Write the new entry - _FAT_cache_writePartialSector (file->partition->cache, dirEntryData, - _FAT_fat_clusterToSector(file->partition, file->dirEntryEnd.cluster) + file->dirEntryEnd.sector, - file->dirEntryEnd.offset * DIR_ENTRY_DATA_SIZE, DIR_ENTRY_DATA_SIZE); - - // Flush any sectors in the disc cache - if (!_FAT_cache_flush(file->partition->cache)) { - return EIO; - } - } - - file->modified = false; - - return 0; -} - - -int _FAT_close_r (struct _reent *r, int fd) { - FILE_STRUCT* file = (FILE_STRUCT*) fd; - int ret = 0; - - if (!file->inUse) { - r->_errno = EBADF; - return -1; - } - - _FAT_lock(&file->partition->lock); - - if (file->write) { - ret = _FAT_syncToDisc (file); - if (ret != 0) { - r->_errno = ret; - ret = -1; - } - } - - file->inUse = false; - - // Remove this file from the double-linked list of open files - file->partition->openFileCount -= 1; - if (file->nextOpenFile) { - file->nextOpenFile->prevOpenFile = file->prevOpenFile; - } - if (file->prevOpenFile) { - file->prevOpenFile->nextOpenFile = file->nextOpenFile; - } else { - file->partition->firstOpenFile = file->nextOpenFile; - } - - _FAT_unlock(&file->partition->lock); - - return ret; -} - -ssize_t _FAT_read_r (struct _reent *r, int fd, char *ptr, size_t len) { - FILE_STRUCT* file = (FILE_STRUCT*) fd; - PARTITION* partition; - CACHE* cache; - FILE_POSITION position; - uint32_t tempNextCluster; - unsigned int tempVar; - size_t remain; - bool flagNoError = true; - - // Short circuit cases where len is 0 (or less) - if (len <= 0) { - return 0; - } - - // Make sure we can actually read from the file - if ((file == NULL) || !file->inUse || !file->read) { - r->_errno = EBADF; - return -1; - } - - partition = file->partition; - _FAT_lock(&partition->lock); - - // Don't try to read if the read pointer is past the end of file - if (file->currentPosition >= file->filesize || file->startCluster == CLUSTER_FREE) { - r->_errno = EOVERFLOW; - _FAT_unlock(&partition->lock); - return 0; - } - - // Don't read past end of file - if (len + file->currentPosition > file->filesize) { - r->_errno = EOVERFLOW; - len = file->filesize - file->currentPosition; - } - - remain = len; - position = file->rwPosition; - cache = file->partition->cache; - - // Align to sector - tempVar = BYTES_PER_READ - position.byte; - if (tempVar > remain) { - tempVar = remain; - } - - if ((tempVar < BYTES_PER_READ) && flagNoError) - { - _FAT_cache_readPartialSector ( cache, ptr, _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, - position.byte, tempVar); - - remain -= tempVar; - ptr += tempVar; - - position.byte += tempVar; - if (position.byte >= BYTES_PER_READ) { - position.byte = 0; - position.sector++; - } - } - - // align to cluster - // tempVar is number of sectors to read - if (remain > (partition->sectorsPerCluster - position.sector) * BYTES_PER_READ) { - tempVar = partition->sectorsPerCluster - position.sector; - } else { - tempVar = remain / BYTES_PER_READ; - } - - if ((tempVar > 0) && flagNoError) { - if (! _FAT_cache_readSectors (cache, _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, - tempVar, ptr)) - { - flagNoError = false; - r->_errno = EIO; - } else { - ptr += tempVar * BYTES_PER_READ; - remain -= tempVar * BYTES_PER_READ; - position.sector += tempVar; - } - } - - // Move onto next cluster - // It should get to here without reading anything if a cluster is due to be allocated - if ((position.sector >= partition->sectorsPerCluster) && flagNoError) { - tempNextCluster = _FAT_fat_nextCluster(partition, position.cluster); - if ((remain == 0) && (tempNextCluster == CLUSTER_EOF)) { - position.sector = partition->sectorsPerCluster; - } else if (!_FAT_fat_isValidCluster(partition, tempNextCluster)) { - r->_errno = EIO; - flagNoError = false; - } else { - position.sector = 0; - position.cluster = tempNextCluster; - } - } - - // Read in whole clusters, contiguous blocks at a time - while ((remain >= partition->bytesPerCluster) && flagNoError) { - uint32_t chunkEnd; - uint32_t nextChunkStart = position.cluster; - size_t chunkSize = 0; - - do { - chunkEnd = nextChunkStart; - nextChunkStart = _FAT_fat_nextCluster (partition, chunkEnd); - chunkSize += partition->bytesPerCluster; - } while ((nextChunkStart == chunkEnd + 1) && -#ifdef LIMIT_SECTORS - (chunkSize + partition->bytesPerCluster <= LIMIT_SECTORS * BYTES_PER_READ) && -#endif - (chunkSize + partition->bytesPerCluster <= remain)); - - if (!_FAT_cache_readSectors (cache, _FAT_fat_clusterToSector (partition, position.cluster), - chunkSize / BYTES_PER_READ, ptr)) - { - flagNoError = false; - r->_errno = EIO; - break; - } - ptr += chunkSize; - remain -= chunkSize; - - // Advance to next cluster - if ((remain == 0) && (nextChunkStart == CLUSTER_EOF)) { - position.sector = partition->sectorsPerCluster; - position.cluster = chunkEnd; - } else if (!_FAT_fat_isValidCluster(partition, nextChunkStart)) { - r->_errno = EIO; - flagNoError = false; - } else { - position.sector = 0; - position.cluster = nextChunkStart; - } - } - - // Read remaining sectors - tempVar = remain / BYTES_PER_READ; // Number of sectors left - if ((tempVar > 0) && flagNoError) { - if (!_FAT_cache_readSectors (cache, _FAT_fat_clusterToSector (partition, position.cluster), - tempVar, ptr)) - { - flagNoError = false; - r->_errno = EIO; - } else { - ptr += tempVar * BYTES_PER_READ; - remain -= tempVar * BYTES_PER_READ; - position.sector += tempVar; - } - } - - // Last remaining sector - // Check if anything is left - if ((remain > 0) && flagNoError) { - _FAT_cache_readPartialSector ( cache, ptr, - _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 0, remain); - position.byte += remain; - remain = 0; - } - - // Length read is the wanted length minus the stuff not read - len = len - remain; - - // Update file information - file->rwPosition = position; - file->currentPosition += len; - - _FAT_unlock(&partition->lock); - return len; -} - -// if current position is on the cluster border and more data has to be written -// then get next cluster or allocate next cluster -// this solves the over-allocation problems when file size is aligned to cluster size -// return true on succes, false on error -static bool _FAT_check_position_for_next_cluster(struct _reent *r, - FILE_POSITION *position, PARTITION* partition, size_t remain, bool *flagNoError) -{ - uint32_t tempNextCluster; - // do nothing if no more data to write - if (remain == 0) return true; - if (flagNoError && *flagNoError == false) return false; - if ((remain < 0) || (position->sector > partition->sectorsPerCluster)) { - // invalid arguments - internal error - r->_errno = EINVAL; - goto err; - } - if (position->sector == partition->sectorsPerCluster) { - // need to advance to next cluster - tempNextCluster = _FAT_fat_nextCluster(partition, position->cluster); - if ((tempNextCluster == CLUSTER_EOF) || (tempNextCluster == CLUSTER_FREE)) { - // Ran out of clusters so get a new one - tempNextCluster = _FAT_fat_linkFreeCluster(partition, position->cluster); - } - if (!_FAT_fat_isValidCluster(partition, tempNextCluster)) { - // Couldn't get a cluster, so abort - r->_errno = ENOSPC; - goto err; - } - position->sector = 0; - position->cluster = tempNextCluster; - } - return true; -err: - if (flagNoError) *flagNoError = false; - return false; -} - -/* -Extend a file so that the size is the same as the rwPosition -*/ -static bool _FAT_file_extend_r (struct _reent *r, FILE_STRUCT* file) { - PARTITION* partition = file->partition; - CACHE* cache = file->partition->cache; - FILE_POSITION position; - uint8_t zeroBuffer [BYTES_PER_READ] = {0}; - uint32_t remain; - uint32_t tempNextCluster; - unsigned int sector; - - position.byte = file->filesize % BYTES_PER_READ; - position.sector = (file->filesize % partition->bytesPerCluster) / BYTES_PER_READ; - // It is assumed that there is always a startCluster - // This will be true when _FAT_file_extend_r is called from _FAT_write_r - position.cluster = _FAT_fat_lastCluster (partition, file->startCluster); - - remain = file->currentPosition - file->filesize; - - if ((remain > 0) && (file->filesize > 0) && (position.sector == 0) && (position.byte == 0)) { - // Get a new cluster on the edge of a cluster boundary - tempNextCluster = _FAT_fat_linkFreeCluster(partition, position.cluster); - if (!_FAT_fat_isValidCluster(partition, tempNextCluster)) { - // Couldn't get a cluster, so abort - r->_errno = ENOSPC; - return false; - } - position.cluster = tempNextCluster; - position.sector = 0; - } - - if (remain + position.byte < BYTES_PER_READ) { - // Only need to clear to the end of the sector - _FAT_cache_writePartialSector (cache, zeroBuffer, - _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, position.byte, remain); - position.byte += remain; - } else { - if (position.byte > 0) { - _FAT_cache_writePartialSector (cache, zeroBuffer, - _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, position.byte, - BYTES_PER_READ - position.byte); - remain -= (BYTES_PER_READ - position.byte); - position.byte = 0; - position.sector ++; - } - - while (remain >= BYTES_PER_READ) { - if (position.sector >= partition->sectorsPerCluster) { - position.sector = 0; - // Ran out of clusters so get a new one - tempNextCluster = _FAT_fat_linkFreeCluster(partition, position.cluster); - if (!_FAT_fat_isValidCluster(partition, tempNextCluster)) { - // Couldn't get a cluster, so abort - r->_errno = ENOSPC; - return false; - } - position.cluster = tempNextCluster; - } - - sector = _FAT_fat_clusterToSector (partition, position.cluster) + position.sector; - _FAT_cache_writeSectors (cache, sector, 1, zeroBuffer); - - remain -= BYTES_PER_READ; - position.sector ++; - } - - if (!_FAT_check_position_for_next_cluster(r, &position, partition, remain, NULL)) { - // error already marked - return false; - } - - if (remain > 0) { - _FAT_cache_writePartialSector (cache, zeroBuffer, - _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 0, remain); - position.byte = remain; - } - } - - file->rwPosition = position; - file->filesize = file->currentPosition; - return true; -} - -ssize_t _FAT_write_r (struct _reent *r, int fd, const char *ptr, size_t len) { - FILE_STRUCT* file = (FILE_STRUCT*) fd; - PARTITION* partition; - CACHE* cache; - FILE_POSITION position; - uint32_t tempNextCluster; - unsigned int tempVar; - size_t remain; - bool flagNoError = true; - bool flagAppending = false; - - // Make sure we can actually write to the file - if ((file == NULL) || !file->inUse || !file->write) { - r->_errno = EBADF; - return -1; - } - - partition = file->partition; - cache = file->partition->cache; - _FAT_lock(&partition->lock); - - // Only write up to the maximum file size, taking into account wrap-around of ints - if (len + file->filesize > FILE_MAX_SIZE || len + file->filesize < file->filesize) { - len = FILE_MAX_SIZE - file->filesize; - } - - // Short circuit cases where len is 0 (or less) - if (len <= 0) { - _FAT_unlock(&partition->lock); - return 0; - } - - remain = len; - - // Get a new cluster for the start of the file if required - if (file->startCluster == CLUSTER_FREE) { - tempNextCluster = _FAT_fat_linkFreeCluster (partition, CLUSTER_FREE); - if (!_FAT_fat_isValidCluster(partition, tempNextCluster)) { - // Couldn't get a cluster, so abort immediately - _FAT_unlock(&partition->lock); - r->_errno = ENOSPC; - return -1; - } - file->startCluster = tempNextCluster; - - // Appending starts at the begining for a 0 byte file - file->appendPosition.cluster = file->startCluster; - file->appendPosition.sector = 0; - file->appendPosition.byte = 0; - - file->rwPosition.cluster = file->startCluster; - file->rwPosition.sector = 0; - file->rwPosition.byte = 0; - } - - if (file->append) { - position = file->appendPosition; - flagAppending = true; - } else { - // If the write pointer is past the end of the file, extend the file to that size - if (file->currentPosition > file->filesize) { - if (!_FAT_file_extend_r (r, file)) { - _FAT_unlock(&partition->lock); - return -1; - } - } - - // Write at current read pointer - position = file->rwPosition; - - // If it is writing past the current end of file, set appending flag - if (len + file->currentPosition > file->filesize) { - flagAppending = true; - } - } - - // Move onto next cluster if needed - _FAT_check_position_for_next_cluster(r, &position, partition, remain, &flagNoError); - - // Align to sector - tempVar = BYTES_PER_READ - position.byte; - if (tempVar > remain) { - tempVar = remain; - } - - if ((tempVar < BYTES_PER_READ) && flagNoError) { - // Write partial sector to disk - _FAT_cache_writePartialSector (cache, ptr, - _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, position.byte, tempVar); - - remain -= tempVar; - ptr += tempVar; - position.byte += tempVar; - - - // Move onto next sector - if (position.byte >= BYTES_PER_READ) { - position.byte = 0; - position.sector ++; - } - } - - // Align to cluster - // tempVar is number of sectors to write - if (remain > (partition->sectorsPerCluster - position.sector) * BYTES_PER_READ) { - tempVar = partition->sectorsPerCluster - position.sector; - } else { - tempVar = remain / BYTES_PER_READ; - } - - if ((tempVar > 0 && tempVar < partition->sectorsPerCluster) && flagNoError) { - if (!_FAT_cache_writeSectors (cache, - _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, tempVar, ptr)) - { - flagNoError = false; - r->_errno = EIO; - } else { - ptr += tempVar * BYTES_PER_READ; - remain -= tempVar * BYTES_PER_READ; - position.sector += tempVar; - } - } - - // Write whole clusters - while ((remain >= partition->bytesPerCluster) && flagNoError) { - // allocate next cluster - _FAT_check_position_for_next_cluster(r, &position, partition, remain, &flagNoError); - if (!flagNoError) break; - // set indexes to the current position - uint32_t chunkEnd = position.cluster; - uint32_t nextChunkStart = position.cluster; - size_t chunkSize = partition->bytesPerCluster; - FILE_POSITION next_position = position; - - // group consecutive clusters - while (flagNoError && -#ifdef LIMIT_SECTORS - (chunkSize + partition->bytesPerCluster <= LIMIT_SECTORS * BYTES_PER_READ) && -#endif - (chunkSize + partition->bytesPerCluster < remain)) - { - // pretend to use up all sectors in next_position - next_position.sector = partition->sectorsPerCluster; - // get or allocate next cluster - _FAT_check_position_for_next_cluster(r, &next_position, partition, - remain - chunkSize, &flagNoError); - if (!flagNoError) break; // exit loop on error - nextChunkStart = next_position.cluster; - if (nextChunkStart != chunkEnd + 1) break; // exit loop if not consecutive - chunkEnd = nextChunkStart; - chunkSize += partition->bytesPerCluster; - } - - if ( !_FAT_cache_writeSectors (cache, - _FAT_fat_clusterToSector(partition, position.cluster), chunkSize / BYTES_PER_READ, ptr)) - { - flagNoError = false; - r->_errno = EIO; - break; - } - ptr += chunkSize; - remain -= chunkSize; - - if ((chunkEnd != nextChunkStart) && _FAT_fat_isValidCluster(partition, nextChunkStart)) { - // new cluster is already allocated (because it was not consecutive) - position.cluster = nextChunkStart; - position.sector = 0; - } else { - // Allocate a new cluster when next writing the file - position.cluster = chunkEnd; - position.sector = partition->sectorsPerCluster; - } - } - - // allocate next cluster if needed - _FAT_check_position_for_next_cluster(r, &position, partition, remain, &flagNoError); - - // Write remaining sectors - tempVar = remain / BYTES_PER_READ; // Number of sectors left - if ((tempVar > 0) && flagNoError) { - if (!_FAT_cache_writeSectors (cache, _FAT_fat_clusterToSector (partition, position.cluster), tempVar, ptr)) - { - flagNoError = false; - r->_errno = EIO; - } else { - ptr += tempVar * BYTES_PER_READ; - remain -= tempVar * BYTES_PER_READ; - position.sector += tempVar; - } - } - - // Last remaining sector - if ((remain > 0) && flagNoError) { - if (flagAppending) { - _FAT_cache_eraseWritePartialSector ( cache, ptr, - _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 0, remain); - } else { - _FAT_cache_writePartialSector ( cache, ptr, - _FAT_fat_clusterToSector (partition, position.cluster) + position.sector, 0, remain); - } - position.byte += remain; - remain = 0; - } - - - // Amount written is the originally requested amount minus stuff remaining - len = len - remain; - - // Update file information - file->modified = true; - if (file->append) { - // Appending doesn't affect the read pointer - file->appendPosition = position; - file->filesize += len; - } else { - // Writing also shifts the read pointer - file->rwPosition = position; - file->currentPosition += len; - if (file->filesize < file->currentPosition) { - file->filesize = file->currentPosition; - } - } - _FAT_unlock(&partition->lock); - - return len; -} - - -off_t _FAT_seek_r (struct _reent *r, int fd, off_t pos, int dir) { - FILE_STRUCT* file = (FILE_STRUCT*) fd; - PARTITION* partition; - uint32_t cluster, nextCluster; - int clusCount; - off_t newPosition; - uint32_t position; - - if ((file == NULL) || (file->inUse == false)) { - // invalid file - r->_errno = EBADF; - return -1; - } - - partition = file->partition; - _FAT_lock(&partition->lock); - - switch (dir) { - case SEEK_SET: - newPosition = pos; - break; - case SEEK_CUR: - newPosition = (off_t)file->currentPosition + pos; - break; - case SEEK_END: - newPosition = (off_t)file->filesize + pos; - break; - default: - _FAT_unlock(&partition->lock); - r->_errno = EINVAL; - return -1; - } - - if ((pos > 0) && (newPosition < 0)) { - _FAT_unlock(&partition->lock); - r->_errno = EOVERFLOW; - return -1; - } - - // newPosition can only be larger than the FILE_MAX_SIZE on platforms where - // off_t is larger than 32 bits. - if (newPosition < 0 || ((sizeof(newPosition) > 4) && newPosition > (off_t)FILE_MAX_SIZE)) { - _FAT_unlock(&partition->lock); - r->_errno = EINVAL; - return -1; - } - - position = (uint32_t)newPosition; - - // Only change the read/write position if it is within the bounds of the current filesize, - // or at the very edge of the file - if (position <= file->filesize && file->startCluster != CLUSTER_FREE) { - // Calculate where the correct cluster is - // how many clusters from start of file - clusCount = position / partition->bytesPerCluster; - cluster = file->startCluster; - if (position >= file->currentPosition) { - // start from current cluster - int currentCount = file->currentPosition / partition->bytesPerCluster; - if (file->rwPosition.sector == partition->sectorsPerCluster) { - currentCount--; - } - clusCount -= currentCount; - cluster = file->rwPosition.cluster; - } - // Calculate the sector and byte of the current position, - // and store them - file->rwPosition.sector = (position % partition->bytesPerCluster) / BYTES_PER_READ; - file->rwPosition.byte = position % BYTES_PER_READ; - - nextCluster = _FAT_fat_nextCluster (partition, cluster); - while ((clusCount > 0) && (nextCluster != CLUSTER_FREE) && (nextCluster != CLUSTER_EOF)) { - clusCount--; - cluster = nextCluster; - nextCluster = _FAT_fat_nextCluster (partition, cluster); - } - - // Check if ran out of clusters and it needs to allocate a new one - if (clusCount > 0) { - if ((clusCount == 1) && (file->filesize == position) && (file->rwPosition.sector == 0)) { - // Set flag to allocate a new cluster - file->rwPosition.sector = partition->sectorsPerCluster; - file->rwPosition.byte = 0; - } else { - _FAT_unlock(&partition->lock); - r->_errno = EINVAL; - return -1; - } - } - - file->rwPosition.cluster = cluster; - } - - // Save position - file->currentPosition = position; - - _FAT_unlock(&partition->lock); - return position; -} - - - -int _FAT_fstat_r (struct _reent *r, int fd, struct stat *st) { - FILE_STRUCT* file = (FILE_STRUCT*) fd; - PARTITION* partition; - DIR_ENTRY fileEntry; - - if ((file == NULL) || (file->inUse == false)) { - // invalid file - r->_errno = EBADF; - return -1; - } - - partition = file->partition; - _FAT_lock(&partition->lock); - - // Get the file's entry data - fileEntry.dataStart = file->dirEntryStart; - fileEntry.dataEnd = file->dirEntryEnd; - - if (!_FAT_directory_entryFromPosition (partition, &fileEntry)) { - _FAT_unlock(&partition->lock); - r->_errno = EIO; - return -1; - } - - // Fill in the stat struct - _FAT_directory_entryStat (partition, &fileEntry, st); - - // Fix stats that have changed since the file was openned - st->st_ino = (ino_t)(file->startCluster); // The file serial number is the start cluster - st->st_size = file->filesize; // File size - - _FAT_unlock(&partition->lock); - return 0; -} - -int _FAT_ftruncate_r (struct _reent *r, int fd, off_t len) { - FILE_STRUCT* file = (FILE_STRUCT*) fd; - PARTITION* partition; - int ret=0; - uint32_t newSize = (uint32_t)len; - - if (len < 0) { - // Trying to truncate to a negative size - r->_errno = EINVAL; - return -1; - } - - if ((sizeof(len) > 4) && len > (off_t)FILE_MAX_SIZE) { - // Trying to extend the file beyond what FAT supports - r->_errno = EFBIG; - return -1; - } - - if (!file || !file->inUse) { - // invalid file - r->_errno = EBADF; - return -1; - } - - if (!file->write) { - // Read-only file - r->_errno = EINVAL; - return -1; - } - - partition = file->partition; - _FAT_lock(&partition->lock); - - if (newSize > file->filesize) { - // Expanding the file - FILE_POSITION savedPosition; - uint32_t savedOffset; - // Get a new cluster for the start of the file if required - if (file->startCluster == CLUSTER_FREE) { - uint32_t tempNextCluster = _FAT_fat_linkFreeCluster (partition, CLUSTER_FREE); - if (!_FAT_fat_isValidCluster(partition, tempNextCluster)) { - // Couldn't get a cluster, so abort immediately - _FAT_unlock(&partition->lock); - r->_errno = ENOSPC; - return -1; - } - file->startCluster = tempNextCluster; - - file->rwPosition.cluster = file->startCluster; - file->rwPosition.sector = 0; - file->rwPosition.byte = 0; - } - // Save the read/write pointer - savedPosition = file->rwPosition; - savedOffset = file->currentPosition; - // Set the position to the new size - file->currentPosition = newSize; - // Extend the file to the new position - if (!_FAT_file_extend_r (r, file)) { - ret = -1; - } - // Set the append position to the new rwPointer - if (file->append) { - file->appendPosition = file->rwPosition; - } - // Restore the old rwPointer; - file->rwPosition = savedPosition; - file->currentPosition = savedOffset; - } else if (newSize < file->filesize){ - // Shrinking the file - if (len == 0) { - // Cutting the file down to nothing, clear all clusters used - _FAT_fat_clearLinks (partition, file->startCluster); - file->startCluster = CLUSTER_FREE; - - file->appendPosition.cluster = CLUSTER_FREE; - file->appendPosition.sector = 0; - file->appendPosition.byte = 0; - } else { - // Trimming the file down to the required size - unsigned int chainLength; - uint32_t lastCluster; - - // Drop the unneeded end of the cluster chain. - // If the end falls on a cluster boundary, drop that cluster too, - // then set a flag to allocate a cluster as needed - chainLength = ((newSize-1) / partition->bytesPerCluster) + 1; - lastCluster = _FAT_fat_trimChain (partition, file->startCluster, chainLength); - - if (file->append) { - file->appendPosition.byte = newSize % BYTES_PER_READ; - // Does the end of the file fall on the edge of a cluster? - if (newSize % partition->bytesPerCluster == 0) { - // Set a flag to allocate a new cluster - file->appendPosition.sector = partition->sectorsPerCluster; - } else { - file->appendPosition.sector = (newSize % partition->bytesPerCluster) / BYTES_PER_READ; - } - file->appendPosition.cluster = lastCluster; - } - } - } else { - // Truncating to same length, so don't do anything - } - - file->filesize = newSize; - file->modified = true; - - _FAT_unlock(&partition->lock); - return ret; -} - -int _FAT_fsync_r (struct _reent *r, int fd) { - FILE_STRUCT* file = (FILE_STRUCT*) fd; - int ret = 0; - - if (!file->inUse) { - r->_errno = EBADF; - return -1; - } - - _FAT_lock(&file->partition->lock); - - ret = _FAT_syncToDisc (file); - if (ret != 0) { - r->_errno = ret; - ret = -1; - } - - _FAT_unlock(&file->partition->lock); - - return ret; -} - - -typedef int (*_frag_append_t)(void *ff, u32 offset, u32 sector, u32 count); - -int _FAT_get_fragments (const char *path, _frag_append_t append_fragment, void *callback_data) -{ - struct _reent r; - FILE_STRUCT file; - PARTITION* partition; - u32 cluster; - u32 sector; - u32 offset; // in sectors - u32 size; // in sectors - int ret = -1; - int fd; - - fd = _FAT_open_r (&r, &file, path, O_RDONLY, 0); - if (fd == -1) return -1; - if (fd != (int)&file) return -1; - - partition = file.partition; - _FAT_lock(&partition->lock); - - size = file.filesize / BYTES_PER_READ; - cluster = file.startCluster; - offset = 0; - - do { - if (!_FAT_fat_isValidCluster(partition, cluster)) { - // invalid cluster - goto out; - } - // add cluster to fileinfo - sector = _FAT_fat_clusterToSector(partition, cluster); - if (append_fragment(callback_data, offset, sector, partition->sectorsPerCluster)) { - // too many fragments - goto out; - } - offset += partition->sectorsPerCluster; - cluster = _FAT_fat_nextCluster (partition, cluster); - } while (offset < size); - - // set size - append_fragment(callback_data, size, 0, 0); - // success - ret = 0; - - out: - _FAT_unlock(&partition->lock); - _FAT_close_r(&r, fd); - return ret; -} diff --git a/source/libs/libfat/fatfile.h b/source/libs/libfat/fatfile.h deleted file mode 100644 index 9fd0a23a..00000000 --- a/source/libs/libfat/fatfile.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - fatfile.h - - Functions used by the newlib disc stubs to interface with - this library - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#ifndef _FATFILE_H -#define _FATFILE_H - -#include -#include - -#include "common.h" -#include "partition.h" -#include "directory.h" - -#define FILE_MAX_SIZE ((uint32_t)0xFFFFFFFF) // 4GiB - 1B - -typedef struct { - u32 cluster; - sec_t sector; - s32 byte; -} FILE_POSITION; - -struct _FILE_STRUCT; - -struct _FILE_STRUCT { - uint32_t filesize; - uint32_t startCluster; - uint32_t currentPosition; - FILE_POSITION rwPosition; - FILE_POSITION appendPosition; - DIR_ENTRY_POSITION dirEntryStart; // Points to the start of the LFN entries of a file, or the alias for no LFN - DIR_ENTRY_POSITION dirEntryEnd; // Always points to the file's alias entry - PARTITION* partition; - struct _FILE_STRUCT* prevOpenFile; // The previous entry in a double-linked list of open files - struct _FILE_STRUCT* nextOpenFile; // The next entry in a double-linked list of open files - bool read; - bool write; - bool append; - bool inUse; - bool modified; -}; - -typedef struct _FILE_STRUCT FILE_STRUCT; - -int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags, int mode); - -int _FAT_close_r (struct _reent *r, int fd); - -ssize_t _FAT_write_r (struct _reent *r,int fd, const char *ptr, size_t len); - -ssize_t _FAT_read_r (struct _reent *r, int fd, char *ptr, size_t len); - -off_t _FAT_seek_r (struct _reent *r, int fd, off_t pos, int dir); - -int _FAT_fstat_r (struct _reent *r, int fd, struct stat *st); - -int _FAT_stat_r (struct _reent *r, const char *path, struct stat *st); - -int _FAT_link_r (struct _reent *r, const char *existing, const char *newLink); - -int _FAT_unlink_r (struct _reent *r, const char *name); - -int _FAT_chdir_r (struct _reent *r, const char *name); - -int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName); - -int _FAT_ftruncate_r (struct _reent *r, int fd, off_t len); - -int _FAT_fsync_r (struct _reent *r, int fd); - -/* -Synchronizes the file data to disc. -Does no locking of its own -- lock the partition before calling. -Returns 0 on success, an error code on failure. -*/ -extern int _FAT_syncToDisc (FILE_STRUCT* file); - -#endif // _FATFILE_H diff --git a/source/libs/libfat/fatfile_frag.h b/source/libs/libfat/fatfile_frag.h new file mode 100644 index 00000000..3af9b32e --- /dev/null +++ b/source/libs/libfat/fatfile_frag.h @@ -0,0 +1,16 @@ +#ifndef FAT_FRAG_H_ +#define FAT_FRAG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int (*_fat_frag_append_t)(void *ff, u32 offset, u32 sector, u32 count); + +int _FAT_get_fragments (const char *path, _fat_frag_append_t append_fragment, void *callback_data); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/source/libs/libfat/file_allocation_table.c b/source/libs/libfat/file_allocation_table.c deleted file mode 100644 index 7edd7cb1..00000000 --- a/source/libs/libfat/file_allocation_table.c +++ /dev/null @@ -1,383 +0,0 @@ -/* - file_allocation_table.c - Reading, writing and manipulation of the FAT structure on - a FAT partition - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#include "file_allocation_table.h" -#include "partition.h" -#include - -/* -Gets the cluster linked from input cluster -*/ -uint32_t _FAT_fat_nextCluster(PARTITION* partition, uint32_t cluster) -{ - uint32_t nextCluster = CLUSTER_FREE; - sec_t sector; - int offset; - - if (cluster == CLUSTER_FREE) { - return CLUSTER_FREE; - } - - switch (partition->filesysType) - { - case FS_UNKNOWN: - return CLUSTER_ERROR; - break; - - case FS_FAT12: - { - u32 nextCluster_h; - sector = partition->fat.fatStart + (((cluster * 3) / 2) / BYTES_PER_READ); - offset = ((cluster * 3) / 2) % BYTES_PER_READ; - - - _FAT_cache_readLittleEndianValue (partition->cache, &nextCluster, sector, offset, sizeof(u8)); - - offset++; - - if (offset >= BYTES_PER_READ) { - offset = 0; - sector++; - } - nextCluster_h = 0; - - _FAT_cache_readLittleEndianValue (partition->cache, &nextCluster_h, sector, offset, sizeof(u8)); - nextCluster |= (nextCluster_h << 8); - - if (cluster & 0x01) { - nextCluster = nextCluster >> 4; - } else { - nextCluster &= 0x0FFF; - } - - if (nextCluster >= 0x0FF7) - { - nextCluster = CLUSTER_EOF; - } - - break; - } - case FS_FAT16: - sector = partition->fat.fatStart + ((cluster << 1) / BYTES_PER_READ); - offset = (cluster % (BYTES_PER_READ >> 1)) << 1; - - _FAT_cache_readLittleEndianValue (partition->cache, &nextCluster, sector, offset, sizeof(u16)); - - if (nextCluster >= 0xFFF7) { - nextCluster = CLUSTER_EOF; - } - break; - - case FS_FAT32: - sector = partition->fat.fatStart + ((cluster << 2) / BYTES_PER_READ); - offset = (cluster % (BYTES_PER_READ >> 2)) << 2; - - _FAT_cache_readLittleEndianValue (partition->cache, &nextCluster, sector, offset, sizeof(u32)); - - if (nextCluster >= 0x0FFFFFF7) { - nextCluster = CLUSTER_EOF; - } - break; - - default: - return CLUSTER_ERROR; - break; - } - - return nextCluster; -} - -/* -writes value into the correct offset within a partition's FAT, based -on the cluster number. -*/ -static bool _FAT_fat_writeFatEntry (PARTITION* partition, uint32_t cluster, uint32_t value) { - sec_t sector; - int offset; - uint32_t oldValue; - - if ((cluster < CLUSTER_FIRST) || (cluster > partition->fat.lastCluster /* This will catch CLUSTER_ERROR */)) - { - return false; - } - - switch (partition->filesysType) - { - case FS_UNKNOWN: - return false; - break; - - case FS_FAT12: - sector = partition->fat.fatStart + (((cluster * 3) / 2) / BYTES_PER_READ); - offset = ((cluster * 3) / 2) % BYTES_PER_READ; - - if (cluster & 0x01) { - - _FAT_cache_readLittleEndianValue (partition->cache, &oldValue, sector, offset, sizeof(u8)); - - value = (value << 4) | (oldValue & 0x0F); - - _FAT_cache_writeLittleEndianValue (partition->cache, value & 0xFF, sector, offset, sizeof(u8)); - - offset++; - if (offset >= BYTES_PER_READ) { - offset = 0; - sector++; - } - - _FAT_cache_writeLittleEndianValue (partition->cache, (value >> 8) & 0xFF, sector, offset, sizeof(u8)); - - } else { - - _FAT_cache_writeLittleEndianValue (partition->cache, value, sector, offset, sizeof(u8)); - - offset++; - if (offset >= BYTES_PER_READ) { - offset = 0; - sector++; - } - - _FAT_cache_readLittleEndianValue (partition->cache, &oldValue, sector, offset, sizeof(u8)); - - value = ((value >> 8) & 0x0F) | (oldValue & 0xF0); - - _FAT_cache_writeLittleEndianValue (partition->cache, value, sector, offset, sizeof(u8)); - } - - break; - - case FS_FAT16: - sector = partition->fat.fatStart + ((cluster << 1) / BYTES_PER_READ); - offset = (cluster % (BYTES_PER_READ >> 1)) << 1; - - _FAT_cache_writeLittleEndianValue (partition->cache, value, sector, offset, sizeof(u16)); - - break; - - case FS_FAT32: - sector = partition->fat.fatStart + ((cluster << 2) / BYTES_PER_READ); - offset = (cluster % (BYTES_PER_READ >> 2)) << 2; - - _FAT_cache_writeLittleEndianValue (partition->cache, value, sector, offset, sizeof(u32)); - - break; - - default: - return false; - break; - } - - return true; -} - -/*----------------------------------------------------------------- -gets the first available free cluster, sets it -to end of file, links the input cluster to it then returns the -cluster number -If an error occurs, return CLUSTER_ERROR ------------------------------------------------------------------*/ -uint32_t _FAT_fat_linkFreeCluster(PARTITION* partition, uint32_t cluster) { - uint32_t firstFree; - uint32_t curLink; - uint32_t lastCluster; - bool loopedAroundFAT = false; - - lastCluster = partition->fat.lastCluster; - - if (cluster > lastCluster) { - return CLUSTER_ERROR; - } - - // Check if the cluster already has a link, and return it if so - curLink = _FAT_fat_nextCluster(partition, cluster); - if ((curLink >= CLUSTER_FIRST) && (curLink <= lastCluster)) { - return curLink; // Return the current link - don't allocate a new one - } - - // Get a free cluster - firstFree = partition->fat.firstFree; - // Start at first valid cluster - if (firstFree < CLUSTER_FIRST) { - firstFree = CLUSTER_FIRST; - } - - // Search until a free cluster is found - while (_FAT_fat_nextCluster(partition, firstFree) != CLUSTER_FREE) { - firstFree++; - if (firstFree > lastCluster) { - if (loopedAroundFAT) { - // If couldn't get a free cluster then return an error - partition->fat.firstFree = firstFree; - return CLUSTER_ERROR; - } else { - // Try looping back to the beginning of the FAT - // This was suggested by loopy - firstFree = CLUSTER_FIRST; - loopedAroundFAT = true; - } - } - } - partition->fat.firstFree = firstFree; - - if ((cluster >= CLUSTER_FIRST) && (cluster <= lastCluster)) - { - // Update the linked from FAT entry - _FAT_fat_writeFatEntry (partition, cluster, firstFree); - } - // Create the linked to FAT entry - _FAT_fat_writeFatEntry (partition, firstFree, CLUSTER_EOF); - - return firstFree; -} - -/*----------------------------------------------------------------- -gets the first available free cluster, sets it -to end of file, links the input cluster to it, clears the new -cluster to 0 valued bytes, then returns the cluster number -If an error occurs, return CLUSTER_ERROR ------------------------------------------------------------------*/ -uint32_t _FAT_fat_linkFreeClusterCleared (PARTITION* partition, uint32_t cluster) { - uint32_t newCluster; - uint32_t i; - uint8_t emptySector[BYTES_PER_READ]; - - // Link the cluster - newCluster = _FAT_fat_linkFreeCluster(partition, cluster); - - if (newCluster == CLUSTER_FREE || newCluster == CLUSTER_ERROR) { - return CLUSTER_ERROR; - } - - // Clear all the sectors within the cluster - memset (emptySector, 0, BYTES_PER_READ); - for (i = 0; i < partition->sectorsPerCluster; i++) { - _FAT_cache_writeSectors (partition->cache, - _FAT_fat_clusterToSector (partition, newCluster) + i, - 1, emptySector); - } - - return newCluster; -} - - -/*----------------------------------------------------------------- -_FAT_fat_clearLinks -frees any cluster used by a file ------------------------------------------------------------------*/ -bool _FAT_fat_clearLinks (PARTITION* partition, uint32_t cluster) { - uint32_t nextCluster; - - if ((cluster < CLUSTER_FIRST) || (cluster > partition->fat.lastCluster /* This will catch CLUSTER_ERROR */)) - return false; - - // If this clears up more space in the FAT before the current free pointer, move it backwards - if (cluster < partition->fat.firstFree) { - partition->fat.firstFree = cluster; - } - - while ((cluster != CLUSTER_EOF) && (cluster != CLUSTER_FREE) && (cluster != CLUSTER_ERROR)) { - // Store next cluster before erasing the link - nextCluster = _FAT_fat_nextCluster (partition, cluster); - - // Erase the link - _FAT_fat_writeFatEntry (partition, cluster, CLUSTER_FREE); - - // Move onto next cluster - cluster = nextCluster; - } - - return true; -} - -/*----------------------------------------------------------------- -_FAT_fat_trimChain -Drop all clusters past the chainLength. -If chainLength is 0, all clusters are dropped. -If chainLength is 1, the first cluster is kept and the rest are -dropped, and so on. -Return the last cluster left in the chain. ------------------------------------------------------------------*/ -uint32_t _FAT_fat_trimChain (PARTITION* partition, uint32_t startCluster, unsigned int chainLength) { - uint32_t nextCluster; - - if (chainLength == 0) { - // Drop the entire chain - _FAT_fat_clearLinks (partition, startCluster); - return CLUSTER_FREE; - } else { - // Find the last cluster in the chain, and the one after it - chainLength--; - nextCluster = _FAT_fat_nextCluster (partition, startCluster); - while ((chainLength > 0) && (nextCluster != CLUSTER_FREE) && (nextCluster != CLUSTER_EOF)) { - chainLength--; - startCluster = nextCluster; - nextCluster = _FAT_fat_nextCluster (partition, startCluster); - } - - // Drop all clusters after the last in the chain - if (nextCluster != CLUSTER_FREE && nextCluster != CLUSTER_EOF) { - _FAT_fat_clearLinks (partition, nextCluster); - } - - // Mark the last cluster in the chain as the end of the file - _FAT_fat_writeFatEntry (partition, startCluster, CLUSTER_EOF); - - return startCluster; - } -} - -/*----------------------------------------------------------------- -_FAT_fat_lastCluster -Trace the cluster links until the last one is found ------------------------------------------------------------------*/ -uint32_t _FAT_fat_lastCluster (PARTITION* partition, uint32_t cluster) { - while ((_FAT_fat_nextCluster(partition, cluster) != CLUSTER_FREE) && (_FAT_fat_nextCluster(partition, cluster) != CLUSTER_EOF)) { - cluster = _FAT_fat_nextCluster(partition, cluster); - } - return cluster; -} - -/*----------------------------------------------------------------- -_FAT_fat_freeClusterCount -Return the number of free clusters available ------------------------------------------------------------------*/ -unsigned int _FAT_fat_freeClusterCount (PARTITION* partition) { - unsigned int count = 0; - uint32_t curCluster; - - for (curCluster = CLUSTER_FIRST; curCluster <= partition->fat.lastCluster; curCluster++) { - if (_FAT_fat_nextCluster(partition, curCluster) == CLUSTER_FREE) { - count++; - } - } - - return count; -} - diff --git a/source/libs/libfat/file_allocation_table.h b/source/libs/libfat/file_allocation_table.h deleted file mode 100644 index 560c616d..00000000 --- a/source/libs/libfat/file_allocation_table.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - file_allocation_table.h - Reading, writing and manipulation of the FAT structure on - a FAT partition - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _FAT_H -#define _FAT_H - -#include "common.h" -#include "partition.h" - -#define CLUSTER_EOF_16 0xFFFF -#define CLUSTER_EOF 0x0FFFFFFF -#define CLUSTER_FREE 0x00000000 -#define CLUSTER_ROOT 0x00000000 -#define CLUSTER_FIRST 0x00000002 -#define CLUSTER_ERROR 0xFFFFFFFF - -#define CLUSTERS_PER_FAT12 4085 -#define CLUSTERS_PER_FAT16 65525 - - -uint32_t _FAT_fat_nextCluster(PARTITION* partition, uint32_t cluster); - -uint32_t _FAT_fat_linkFreeCluster(PARTITION* partition, uint32_t cluster); -uint32_t _FAT_fat_linkFreeClusterCleared (PARTITION* partition, uint32_t cluster); - -bool _FAT_fat_clearLinks (PARTITION* partition, uint32_t cluster); - -uint32_t _FAT_fat_trimChain (PARTITION* partition, uint32_t startCluster, unsigned int chainLength); - -uint32_t _FAT_fat_lastCluster (PARTITION* partition, uint32_t cluster); - -unsigned int _FAT_fat_freeClusterCount (PARTITION* partition); - -static inline sec_t _FAT_fat_clusterToSector (PARTITION* partition, uint32_t cluster) { - return (cluster >= CLUSTER_FIRST) ? - ((cluster - CLUSTER_FIRST) * (sec_t)partition->sectorsPerCluster) + partition->dataStart : - partition->rootDirStart; -} - -static inline bool _FAT_fat_isValidCluster (PARTITION* partition, uint32_t cluster) { - return (cluster >= CLUSTER_FIRST) && (cluster <= partition->fat.lastCluster /* This will catch CLUSTER_ERROR */); -} - -#endif // _FAT_H diff --git a/source/libs/libfat/filetime.c b/source/libs/libfat/filetime.c deleted file mode 100644 index d297bf64..00000000 --- a/source/libs/libfat/filetime.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - filetime.c - Conversion of file time and date values to various other types - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#include -#include "filetime.h" -#include "common.h" - -#define MAX_HOUR 23 -#define MAX_MINUTE 59 -#define MAX_SECOND 59 - -#define MAX_MONTH 11 -#define MIN_MONTH 0 -#define MAX_DAY 31 -#define MIN_DAY 1 - -uint16_t _FAT_filetime_getTimeFromRTC (void) { -#ifdef USE_RTC_TIME - struct tm timeParts; - time_t epochTime; - - if (time(&epochTime) == (time_t)-1) { - return 0; - } - localtime_r(&epochTime, &timeParts); - - // Check that the values are all in range. - // If they are not, return 0 (no timestamp) - if ((timeParts.tm_hour < 0) || (timeParts.tm_hour > MAX_HOUR)) return 0; - if ((timeParts.tm_min < 0) || (timeParts.tm_min > MAX_MINUTE)) return 0; - if ((timeParts.tm_sec < 0) || (timeParts.tm_sec > MAX_SECOND)) return 0; - - return ( - ((timeParts.tm_hour & 0x1F) << 11) | - ((timeParts.tm_min & 0x3F) << 5) | - ((timeParts.tm_sec >> 1) & 0x1F) - ); -#else - return 0; -#endif -} - - -uint16_t _FAT_filetime_getDateFromRTC (void) { -#ifdef USE_RTC_TIME - struct tm timeParts; - time_t epochTime; - - if (time(&epochTime) == (time_t)-1) { - return 0; - } - localtime_r(&epochTime, &timeParts); - - if ((timeParts.tm_mon < MIN_MONTH) || (timeParts.tm_mon > MAX_MONTH)) return 0; - if ((timeParts.tm_mday < MIN_DAY) || (timeParts.tm_mday > MAX_DAY)) return 0; - - return ( - (((timeParts.tm_year - 80) & 0x7F) <<9) | // Adjust for MS-FAT base year (1980 vs 1900 for tm_year) - (((timeParts.tm_mon + 1) & 0xF) << 5) | - (timeParts.tm_mday & 0x1F) - ); -#else - return 0; -#endif -} - -time_t _FAT_filetime_to_time_t (uint16_t t, uint16_t d) { - struct tm timeParts; - - timeParts.tm_hour = t >> 11; - timeParts.tm_min = (t >> 5) & 0x3F; - timeParts.tm_sec = (t & 0x1F) << 1; - - timeParts.tm_mday = d & 0x1F; - timeParts.tm_mon = ((d >> 5) & 0x0F) - 1; - timeParts.tm_year = (d >> 9) + 80; - - timeParts.tm_isdst = 0; - - return mktime(&timeParts); -} diff --git a/source/libs/libfat/filetime.h b/source/libs/libfat/filetime.h deleted file mode 100644 index 3bfd8ed8..00000000 --- a/source/libs/libfat/filetime.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - filetime.h - Conversion of file time and date values to various other types - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _FILETIME_H -#define _FILETIME_H - -#include "common.h" -#include - -uint16_t _FAT_filetime_getTimeFromRTC (void); -uint16_t _FAT_filetime_getDateFromRTC (void); - -time_t _FAT_filetime_to_time_t (uint16_t t, uint16_t d); - - -#endif // _FILETIME_H diff --git a/source/libs/libfat/libcustomfat.a b/source/libs/libfat/libcustomfat.a new file mode 100644 index 0000000000000000000000000000000000000000..fd5ac19bf2d45e80a6f972509442552ed78f9f92 GIT binary patch literal 76192 zcmd444R~C|b@)B^?n;(y0RlFl*s{F>L1e7T!l=pW19=w=$hJZhkUt7;EFp>5LD;G- z$P)HbtF{vO$zPUSD%-M=!Q^p@-@N9deJC-GP27~Uys6vx&+7!2$PG!I#!cOXCI*c5 z{hhh@?q10fkpA=ZdGGVw-I;Udo|!pw=FFLybLW=SwQg=(Uq5q^f8urH;_91j`u*z9 z+*sxJS89~|*YCga(^a3go@kk=l)6Q!8F?T7_ID}uaqou@DivG*@$bFGN`2J*PnAmj zzZa&z|Ghvd=YEIq6t{6jubSdscYCOLU0ZA0`i^z?cRsXby>bD*ym>=+$K4%m-J3RV zxd`6Wy19EpYo~>FV>frSwtpyc3W^<@Teozqmh7f|vTf7GE!~?RlEO^Rt#LzlcW1|K z8{0RuZd}#c`A~;D!G?_ww{~u5Z|$A{ZSR;})|_}`UB|}m&5zvC(S0lY z>h7>hlSO~Aqx-H+o4Rk4R8~QfEsLfpuB3ZJnF8bhzRhsfR1NxnoO5CcXu>J$(Nb2Q5)2 ztjp>|9(;g;I}w7Lx;i#G(T6s=3$VFkW9x&N?6*9!v8{R2(hXbMtn%OQ&f$K+I#ec< z`hJ9RV;kb-VBPsiUvS`CIyy2{*MjCCVBWg>H@ANALE6J+)BV&!yb`+HxeA&ekm#CvWTQXx-ch&s}td1Gi_%*p(Fu6A`z{vmNbOeD~%J58k@Ib%QN{ z_iyOz=-vSTx;L$}{_Ug=oO&&VFCt)fHQ#zMvYCe+BsI8Wq6`69x$!|=M}nVq0?RgT z=vDyae`&}4tq*nTsK(#D;lZv>yPJ23d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ad2Um!4>ML8>(bxQVWx!*g}@YA^tu;HguX@vz36DGghqrpCH1mPqvB52zr aFCrEnA{HMgFDv`fk#vBQ -#include -#include -#include - -#include "common.h" -#include "partition.h" -#include "fatfile.h" -#include "fatdir.h" -#include "lock.h" -#include "mem_allocate.h" -#include "disc.h" - -static const devoptab_t dotab_fat = { - "fat", - sizeof (FILE_STRUCT), - _FAT_open_r, - _FAT_close_r, - _FAT_write_r, - _FAT_read_r, - _FAT_seek_r, - _FAT_fstat_r, - _FAT_stat_r, - _FAT_link_r, - _FAT_unlink_r, - _FAT_chdir_r, - _FAT_rename_r, - _FAT_mkdir_r, - sizeof (DIR_STATE_STRUCT), - _FAT_diropen_r, - _FAT_dirreset_r, - _FAT_dirnext_r, - _FAT_dirclose_r, - _FAT_statvfs_r, - _FAT_ftruncate_r, - _FAT_fsync_r, - NULL, /* Device data */ - NULL, - NULL -}; - -bool fatMount (const char* name, const DISC_INTERFACE* interface, sec_t startSector, uint32_t cacheSize, uint32_t SectorsPerPage) { - PARTITION* partition; - devoptab_t* devops; - char* nameCopy; - - if(!name || strlen(name) > 8 || !interface) - return false; - - if(!interface->startup()) - return false; - - if(!interface->isInserted()) - return false; - - char devname[10]; - sprintf(devname, "%s:", name); - if(FindDevice(devname) >= 0) - return true; - - devops = _FAT_mem_allocate (sizeof(devoptab_t) + strlen(name) + 1); - if (!devops) { - return false; - } - // Use the space allocated at the end of the devoptab struct for storing the name - nameCopy = (char*)(devops+1); - - // Initialize the file system - partition = _FAT_partition_constructor (interface, cacheSize, SectorsPerPage, startSector); - if (!partition) { - _FAT_mem_free (devops); - return false; - } - - // Add an entry for this device to the devoptab table - memcpy (devops, &dotab_fat, sizeof(dotab_fat)); - strcpy (nameCopy, name); - devops->name = nameCopy; - devops->deviceData = partition; - - AddDevice (devops); - - return true; -} - -bool fatMountSimple (const char* name, const DISC_INTERFACE* interface) { - return fatMount (name, interface, 0, DEFAULT_CACHE_PAGES, DEFAULT_SECTORS_PAGE); -} - -void fatUnmount (const char* name) { - devoptab_t *devops; - PARTITION* partition; - - if(!name) - return; - - devops = (devoptab_t*)GetDeviceOpTab (name); - if (!devops) { - return; - } - - // Perform a quick check to make sure we're dealing with a libfat controlled device - if (devops->open_r != dotab_fat.open_r) { - return; - } - - if (RemoveDevice (name) == -1) { - return; - } - - partition = (PARTITION*)devops->deviceData; - _FAT_partition_destructor (partition); - _FAT_mem_free (devops); -} - -bool fatInit (uint32_t cacheSize, bool setAsDefaultDevice) { - int i; - int defaultDevice = -1; - const DISC_INTERFACE *disc; - - for (i = 0; - _FAT_disc_interfaces[i].name != NULL && _FAT_disc_interfaces[i].getInterface != NULL; - i++) - { - disc = _FAT_disc_interfaces[i].getInterface(); - if (fatMount (_FAT_disc_interfaces[i].name, disc, 0, cacheSize, DEFAULT_SECTORS_PAGE)) { - // The first device to successfully mount is set as the default - if (defaultDevice < 0) { - defaultDevice = i; - } - } - } - - if (defaultDevice < 0) { - // None of our devices mounted - return false; - } - - if (setAsDefaultDevice) { - char filePath[MAXPATHLEN * 2]; - strcpy (filePath, _FAT_disc_interfaces[defaultDevice].name); - strcat (filePath, ":/"); -#ifdef ARGV_MAGIC - if ( __system_argv->argvMagic == ARGV_MAGIC && __system_argv->argc >= 1 && strrchr( __system_argv->argv[0], '/' )!=NULL ) { - // Check the app's path against each of our mounted devices, to see - // if we can support it. If so, change to that path. - for (i = 0; - _FAT_disc_interfaces[i].name != NULL && _FAT_disc_interfaces[i].getInterface != NULL; - i++) - { - if ( !strncasecmp( __system_argv->argv[0], _FAT_disc_interfaces[i].name, - strlen(_FAT_disc_interfaces[i].name))) - { - char *lastSlash; - strcpy(filePath, __system_argv->argv[0]); - lastSlash = strrchr( filePath, '/' ); - - if ( NULL != lastSlash) { - if ( *(lastSlash - 1) == ':') lastSlash++; - *lastSlash = 0; - } - } - } - } -#endif - chdir (filePath); - } - - return true; -} - -bool fatInitDefault (void) { - return fatInit (DEFAULT_CACHE_PAGES, true); -} - -void fatGetVolumeLabel (const char* name, char *label) { - devoptab_t *devops; - PARTITION* partition; - char *buf; - int namelen,i; - - if(!name || !label) - return; - - namelen = strlen(name); - buf=(char*)_FAT_mem_allocate(sizeof(char)*namelen+2); - strcpy(buf,name); - - if (name[namelen-1] == '/') { - buf[namelen-1]='\0'; - namelen--; - } - - if (name[namelen-1] != ':') { - buf[namelen]=':'; - buf[namelen+1]='\0'; - } - - devops = (devoptab_t*)GetDeviceOpTab(buf); - - for(i=0;buf[i]!='\0' && buf[i]!=':';i++); - if (!devops || strncasecmp(buf,devops->name,i)) { - _FAT_mem_free(buf); - return; - } - - _FAT_mem_free(buf); - - // Perform a quick check to make sure we're dealing with a libfat controlled device - if (devops->open_r != dotab_fat.open_r) { - return; - } - - partition = (PARTITION*)devops->deviceData; - - if(!_FAT_directory_getVolumeLabel(partition, label)) { - strncpy(label,partition->label,11); - label[11]='\0'; - } - if(!strncmp(label, "NO NAME", 7)) label[0]='\0'; -} diff --git a/source/libs/libfat/libfatversion.h b/source/libs/libfat/libfatversion.h deleted file mode 100644 index 40c50463..00000000 --- a/source/libs/libfat/libfatversion.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __LIBFATVERSION_H__ -#define __LIBFATVERSION_H__ - -#define _LIBFAT_MAJOR_ 1 -#define _LIBFAT_MINOR_ 0 -#define _LIBFAT_PATCH_ 7 - -#define _LIBFAT_STRING "libFAT Release 1.0.7" - -#endif // __LIBFATVERSION_H__ diff --git a/source/libs/libfat/lock.h b/source/libs/libfat/lock.h deleted file mode 100644 index c52f3130..00000000 --- a/source/libs/libfat/lock.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - lock.h - - Copyright (c) 2008 Sven Peter - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef _LOCK_H -#define _LOCK_H - -#include "common.h" - -static inline void _FAT_lock_init(mutex_t *mutex) -{ - LWP_MutexInit(mutex, false); -} - -static inline void _FAT_lock_deinit(mutex_t *mutex) -{ - LWP_MutexDestroy(*mutex); -} - -static inline void _FAT_lock(mutex_t *mutex) -{ - LWP_MutexLock(*mutex); -} - -static inline void _FAT_unlock(mutex_t *mutex) -{ - LWP_MutexUnlock(*mutex); -} - - -#endif // _LOCK_H - diff --git a/source/libs/libfat/mem_allocate.h b/source/libs/libfat/mem_allocate.h deleted file mode 100644 index adfad5a4..00000000 --- a/source/libs/libfat/mem_allocate.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - mem_allocate.h - Memory allocation and destruction calls - Replace these calls with custom allocators if - malloc is unavailable - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _MEM_ALLOCATE_H -#define _MEM_ALLOCATE_H - -#include -#include "memory/mem2.h" - -static inline void* _FAT_mem_allocate (size_t size) { - return MEM2_alloc(size); -} - -static inline void* _FAT_mem_align (size_t size) { - return MEM2_alloc(size); -} - -static inline void _FAT_mem_free (void* mem) { - MEM2_free(mem); -} - -#endif // _MEM_ALLOCATE_H diff --git a/source/libs/libfat/partition.c b/source/libs/libfat/partition.c deleted file mode 100644 index dc1a29c9..00000000 --- a/source/libs/libfat/partition.c +++ /dev/null @@ -1,318 +0,0 @@ -/* - partition.c - Functions for mounting and dismounting partitions - on various block devices. - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "partition.h" -#include "bit_ops.h" -#include "file_allocation_table.h" -#include "directory.h" -#include "mem_allocate.h" -#include "fatfile.h" - -#include -#include -#include - -sec_t _FAT_startSector; - -/* -This device name, as known by devkitPro toolchains -*/ -const char* DEVICE_NAME = "fat"; - -/* -Data offsets -*/ - -// BIOS Parameter Block offsets -enum BPB { - BPB_jmpBoot = 0x00, - BPB_OEMName = 0x03, - // BIOS Parameter Block - BPB_bytesPerSector = 0x0B, - BPB_sectorsPerCluster = 0x0D, - BPB_reservedSectors = 0x0E, - BPB_numFATs = 0x10, - BPB_rootEntries = 0x11, - BPB_numSectorsSmall = 0x13, - BPB_mediaDesc = 0x15, - BPB_sectorsPerFAT = 0x16, - BPB_sectorsPerTrk = 0x18, - BPB_numHeads = 0x1A, - BPB_numHiddenSectors = 0x1C, - BPB_numSectors = 0x20, - // Ext BIOS Parameter Block for FAT16 - BPB_FAT16_driveNumber = 0x24, - BPB_FAT16_reserved1 = 0x25, - BPB_FAT16_extBootSig = 0x26, - BPB_FAT16_volumeID = 0x27, - BPB_FAT16_volumeLabel = 0x2B, - BPB_FAT16_fileSysType = 0x36, - // Bootcode - BPB_FAT16_bootCode = 0x3E, - // FAT32 extended block - BPB_FAT32_sectorsPerFAT32 = 0x24, - BPB_FAT32_extFlags = 0x28, - BPB_FAT32_fsVer = 0x2A, - BPB_FAT32_rootClus = 0x2C, - BPB_FAT32_fsInfo = 0x30, - BPB_FAT32_bkBootSec = 0x32, - // Ext BIOS Parameter Block for FAT32 - BPB_FAT32_driveNumber = 0x40, - BPB_FAT32_reserved1 = 0x41, - BPB_FAT32_extBootSig = 0x42, - BPB_FAT32_volumeID = 0x43, - BPB_FAT32_volumeLabel = 0x47, - BPB_FAT32_fileSysType = 0x52, - // Bootcode - BPB_FAT32_bootCode = 0x5A, - BPB_bootSig_55 = 0x1FE, - BPB_bootSig_AA = 0x1FF -}; - -static const char FAT_SIG[3] = {'F', 'A', 'T'}; - - -sec_t FindFirstValidPartition(const DISC_INTERFACE* disc) -{ - uint8_t part_table[16*4]; - uint8_t *ptr; - int i; - - uint8_t sectorBuffer[BYTES_PER_READ] = {0}; - - // Read first sector of disc - if (!_FAT_disc_readSectors (disc, 0, 1, sectorBuffer)) { - return 0; - } - - memcpy(part_table,sectorBuffer+0x1BE,16*4); - ptr = part_table; - - for(i=0;i<4;i++,ptr+=16) { - sec_t part_lba = u8array_to_u32(ptr, 0x8); - - if (!memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG)) || - !memcmp(sectorBuffer + BPB_FAT32_fileSysType, FAT_SIG, sizeof(FAT_SIG))) { - return part_lba; - } - - if(ptr[4]==0) continue; - - if(ptr[4]==0x0F) { - sec_t part_lba2=part_lba; - sec_t next_lba2=0; - int n; - - for(n=0;n<8;n++) // max 8 logic partitions - { - if(!_FAT_disc_readSectors (disc, part_lba+next_lba2, 1, sectorBuffer)) return 0; - - part_lba2 = part_lba + next_lba2 + u8array_to_u32(sectorBuffer, 0x1C6) ; - next_lba2 = u8array_to_u32(sectorBuffer, 0x1D6); - - if(!_FAT_disc_readSectors (disc, part_lba2, 1, sectorBuffer)) return 0; - - if (!memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG)) || - !memcmp(sectorBuffer + BPB_FAT32_fileSysType, FAT_SIG, sizeof(FAT_SIG))) - { - return part_lba2; - } - - if(next_lba2==0) break; - } - } else { - if(!_FAT_disc_readSectors (disc, part_lba, 1, sectorBuffer)) return 0; - if (!memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG)) || - !memcmp(sectorBuffer + BPB_FAT32_fileSysType, FAT_SIG, sizeof(FAT_SIG))) { - return part_lba; - } - } - } - return 0; -} - -PARTITION* _FAT_partition_constructor (const DISC_INTERFACE* disc, uint32_t cacheSize, uint32_t sectorsPerPage, sec_t startSector) { - PARTITION* partition; - uint8_t sectorBuffer[BYTES_PER_READ] = {0}; - - // Read first sector of disc - if (!_FAT_disc_readSectors (disc, startSector, 1, sectorBuffer)) { - return NULL; - } - - // Make sure it is a valid MBR or boot sector - if ( (sectorBuffer[BPB_bootSig_55] != 0x55) || (sectorBuffer[BPB_bootSig_AA] != 0xAA)) { - return NULL; - } - - if (startSector != 0) { - // We're told where to start the partition, so just accept it - } else if (!memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG))) { - // Check if there is a FAT string, which indicates this is a boot sector - startSector = 0; - } else if (!memcmp(sectorBuffer + BPB_FAT32_fileSysType, FAT_SIG, sizeof(FAT_SIG))) { - // Check for FAT32 - startSector = 0; - } else { - startSector = FindFirstValidPartition(disc); - if (!_FAT_disc_readSectors (disc, startSector, 1, sectorBuffer)) { - return NULL; - } - } - - // Now verify that this is indeed a FAT partition - if (memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG)) && - memcmp(sectorBuffer + BPB_FAT32_fileSysType, FAT_SIG, sizeof(FAT_SIG))) - { - return NULL; - } - - // check again for the last two cases to make sure that we really have a FAT filesystem here - // and won't corrupt any data - if(memcmp(sectorBuffer + BPB_FAT16_fileSysType, "FAT", 3) != 0 && memcmp(sectorBuffer + BPB_FAT32_fileSysType, "FAT32", 5) != 0) - { - return NULL; - } - - partition = (PARTITION*) _FAT_mem_allocate (sizeof(PARTITION)); - if (partition == NULL) { - return NULL; - } - - // Init the partition lock - _FAT_lock_init(&partition->lock); - - _FAT_startSector = startSector; - - if (!memcmp(sectorBuffer + BPB_FAT16_fileSysType, FAT_SIG, sizeof(FAT_SIG))) - strncpy(partition->label, (char*)(sectorBuffer + BPB_FAT16_volumeLabel), 11); - else - strncpy(partition->label, (char*)(sectorBuffer + BPB_FAT32_volumeLabel), 11); - partition->label[11] = '\0'; - - // Set partition's disc interface - partition->disc = disc; - - // Store required information about the file system - partition->fat.sectorsPerFat = u8array_to_u16(sectorBuffer, BPB_sectorsPerFAT); - if (partition->fat.sectorsPerFat == 0) { - partition->fat.sectorsPerFat = u8array_to_u32( sectorBuffer, BPB_FAT32_sectorsPerFAT32); - } - - partition->numberOfSectors = u8array_to_u16( sectorBuffer, BPB_numSectorsSmall); - if (partition->numberOfSectors == 0) { - partition->numberOfSectors = u8array_to_u32( sectorBuffer, BPB_numSectors); - } - - partition->bytesPerSector = BYTES_PER_READ; // Sector size is redefined to be 512 bytes - partition->sectorsPerCluster = sectorBuffer[BPB_sectorsPerCluster] * u8array_to_u16(sectorBuffer, BPB_bytesPerSector) / BYTES_PER_READ; - partition->bytesPerCluster = partition->bytesPerSector * partition->sectorsPerCluster; - partition->fat.fatStart = startSector + u8array_to_u16(sectorBuffer, BPB_reservedSectors); - - partition->rootDirStart = partition->fat.fatStart + (sectorBuffer[BPB_numFATs] * partition->fat.sectorsPerFat); - partition->dataStart = partition->rootDirStart + - (( u8array_to_u16(sectorBuffer, BPB_rootEntries) * DIR_ENTRY_DATA_SIZE) / partition->bytesPerSector); - - partition->totalSize = ((uint64_t)partition->numberOfSectors - (partition->dataStart - startSector)) * (uint64_t)partition->bytesPerSector; - - // Store info about FAT - uint32_t clusterCount = (partition->numberOfSectors - (uint32_t)(partition->dataStart - startSector)) / partition->sectorsPerCluster; - partition->fat.lastCluster = clusterCount + CLUSTER_FIRST - 1; - partition->fat.firstFree = CLUSTER_FIRST; - - if (clusterCount < CLUSTERS_PER_FAT12) { - partition->filesysType = FS_FAT12; // FAT12 volume - } else if (clusterCount < CLUSTERS_PER_FAT16) { - partition->filesysType = FS_FAT16; // FAT16 volume - } else { - partition->filesysType = FS_FAT32; // FAT32 volume - } - - if (partition->filesysType != FS_FAT32) { - partition->rootDirCluster = FAT16_ROOT_DIR_CLUSTER; - } else { - // Set up for the FAT32 way - partition->rootDirCluster = u8array_to_u32(sectorBuffer, BPB_FAT32_rootClus); - // Check if FAT mirroring is enabled - if (!(sectorBuffer[BPB_FAT32_extFlags] & 0x80)) { - // Use the active FAT - partition->fat.fatStart = partition->fat.fatStart + ( partition->fat.sectorsPerFat * (sectorBuffer[BPB_FAT32_extFlags] & 0x0F)); - } - } - - // Create a cache to use - partition->cache = _FAT_cache_constructor (cacheSize, sectorsPerPage, partition->disc, startSector+partition->numberOfSectors); - - // Set current directory to the root - partition->cwdCluster = partition->rootDirCluster; - - // Check if this disc is writable, and set the readOnly property appropriately - partition->readOnly = !(_FAT_disc_features(disc) & FEATURE_MEDIUM_CANWRITE); - - // There are currently no open files on this partition - partition->openFileCount = 0; - partition->firstOpenFile = NULL; - - return partition; -} - -void _FAT_partition_destructor (PARTITION* partition) { - FILE_STRUCT* nextFile; - - _FAT_lock(&partition->lock); - - // Synchronize open files - nextFile = partition->firstOpenFile; - while (nextFile) { - _FAT_syncToDisc (nextFile); - nextFile = nextFile->nextOpenFile; - } - - // Free memory used by the cache, writing it to disc at the same time - _FAT_cache_destructor (partition->cache); - - // Unlock the partition and destroy the lock - _FAT_unlock(&partition->lock); - _FAT_lock_deinit(&partition->lock); - - // Free memory used by the partition - _FAT_mem_free (partition); -} - -PARTITION* _FAT_partition_getPartitionFromPath (const char* path) { - const devoptab_t *devops; - - devops = GetDeviceOpTab (path); - - if (!devops) { - return NULL; - } - - return (PARTITION*)devops->deviceData; -} diff --git a/source/libs/libfat/partition.h b/source/libs/libfat/partition.h deleted file mode 100644 index 52e6648d..00000000 --- a/source/libs/libfat/partition.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - partition.h - Functions for mounting and dismounting partitions - on various block devices. - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _PARTITION_H -#define _PARTITION_H - -#include "common.h" -#include "cache.h" -#include "lock.h" - -// Device name -extern const char* DEVICE_NAME; - -// Filesystem type -typedef enum {FS_UNKNOWN, FS_FAT12, FS_FAT16, FS_FAT32} FS_TYPE; - -typedef struct { - sec_t fatStart; - uint32_t sectorsPerFat; - uint32_t lastCluster; - uint32_t firstFree; -} FAT; - -typedef struct { - const DISC_INTERFACE* disc; - CACHE* cache; - // Info about the partition - FS_TYPE filesysType; - uint64_t totalSize; - sec_t rootDirStart; - uint32_t rootDirCluster; - uint32_t numberOfSectors; - sec_t dataStart; - uint32_t bytesPerSector; - uint32_t sectorsPerCluster; - uint32_t bytesPerCluster; - FAT fat; - // Values that may change after construction - uint32_t cwdCluster; // Current working directory cluster - int openFileCount; - struct _FILE_STRUCT* firstOpenFile; // The start of a linked list of files - mutex_t lock; // A lock for partition operations - bool readOnly; // If this is set, then do not try writing to the disc - char label[12]; // Volume label -} PARTITION; - -/* -Mount the supplied device and return a pointer to the struct necessary to use it -*/ -PARTITION* _FAT_partition_constructor (const DISC_INTERFACE* disc, uint32_t cacheSize, uint32_t SectorsPerPage, sec_t startSector); - -/* -Dismount the device and free all structures used. -Will also attempt to synchronise all open files to disc. -*/ -void _FAT_partition_destructor (PARTITION* partition); - -/* -Return the partition specified in a path, as taken from the devoptab. -*/ -PARTITION* _FAT_partition_getPartitionFromPath (const char* path); - -#endif // _PARTITION_H diff --git a/source/libs/libntfs/acls.c b/source/libs/libntfs/acls.c deleted file mode 100644 index 76cc6ce5..00000000 --- a/source/libs/libntfs/acls.c +++ /dev/null @@ -1,4293 +0,0 @@ -/** - * acls.c - General function to process NTFS ACLs - * - * This module is part of ntfs-3g library, but may also be - * integrated in tools running over Linux or Windows - * - * Copyright (c) 2007-2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H - /* - * integration into ntfs-3g - */ -#include "config.h" - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_SYSLOG_H -#include -#endif -#include -#include -#include - -#include "types.h" -#include "layout.h" -#include "security.h" -#include "acls.h" -#include "misc.h" -#else - - /* - * integration into secaudit, check whether Win32, - * may have to be adapted to compiler or something else - */ - -#ifndef WIN32 -#if defined(__WIN32) | defined(__WIN32__) | defined(WNSC) -#define WIN32 1 -#endif -#endif - -#include -#include -#include -#include -#include -#include -#include - - /* - * integration into secaudit/Win32 - */ -#ifdef WIN32 -#include -#include -#define __LITTLE_ENDIAN 1234 -#define __BYTE_ORDER __LITTLE_ENDIAN -#else - /* - * integration into secaudit/STSC - */ -#ifdef STSC -#include -#undef __BYTE_ORDER -#define __BYTE_ORDER __BIG_ENDIAN -#else - /* - * integration into secaudit/Linux - */ -#include -#include -#include -#include -#endif /* STSC */ -#endif /* WIN32 */ -#include "secaudit.h" -#endif /* HAVE_CONFIG_H */ - -/* - * A few useful constants - */ - -/* - * null SID (S-1-0-0) - */ - -static const char nullsidbytes[] = { - 1, /* revision */ - 1, /* auth count */ - 0, 0, 0, 0, 0, 0, /* base */ - 0, 0, 0, 0 /* 1st level */ - }; - -static const SID *nullsid = (const SID*)nullsidbytes; - -/* - * SID for world (S-1-1-0) - */ - -static const char worldsidbytes[] = { - 1, /* revision */ - 1, /* auth count */ - 0, 0, 0, 0, 0, 1, /* base */ - 0, 0, 0, 0 /* 1st level */ -} ; - -const SID *worldsid = (const SID*)worldsidbytes; - -/* - * SID for administrator - */ - -static const char adminsidbytes[] = { - 1, /* revision */ - 2, /* auth count */ - 0, 0, 0, 0, 0, 5, /* base */ - 32, 0, 0, 0, /* 1st level */ - 32, 2, 0, 0 /* 2nd level */ -}; - -const SID *adminsid = (const SID*)adminsidbytes; - -/* - * SID for system - */ - -static const char systemsidbytes[] = { - 1, /* revision */ - 1, /* auth count */ - 0, 0, 0, 0, 0, 5, /* base */ - 18, 0, 0, 0 /* 1st level */ - }; - -static const SID *systemsid = (const SID*)systemsidbytes; - -/* - * SID for generic creator-owner - * S-1-3-0 - */ - -static const char ownersidbytes[] = { - 1, /* revision */ - 1, /* auth count */ - 0, 0, 0, 0, 0, 3, /* base */ - 0, 0, 0, 0 /* 1st level */ -} ; - -static const SID *ownersid = (const SID*)ownersidbytes; - -/* - * SID for generic creator-group - * S-1-3-1 - */ - -static const char groupsidbytes[] = { - 1, /* revision */ - 1, /* auth count */ - 0, 0, 0, 0, 0, 3, /* base */ - 1, 0, 0, 0 /* 1st level */ -} ; - -static const SID *groupsid = (const SID*)groupsidbytes; - -/* - * Determine the size of a SID - */ - -int ntfs_sid_size(const SID * sid) -{ - return (sid->sub_authority_count * 4 + 8); -} - -/* - * Test whether two SID are equal - */ - -BOOL ntfs_same_sid(const SID *first, const SID *second) -{ - int size; - - size = ntfs_sid_size(first); - return ((ntfs_sid_size(second) == size) - && !memcmp(first, second, size)); -} - -/* - * Test whether a SID means "world user" - * Local users group also recognized as world - */ - -static int is_world_sid(const SID * usid) -{ - return ( - /* check whether S-1-1-0 : world */ - ((usid->sub_authority_count == 1) - && (usid->identifier_authority.high_part == const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(1)) - && (usid->sub_authority[0] == const_cpu_to_le32(0))) - - /* check whether S-1-5-32-545 : local user */ - || ((usid->sub_authority_count == 2) - && (usid->identifier_authority.high_part == const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(5)) - && (usid->sub_authority[0] == const_cpu_to_le32(32)) - && (usid->sub_authority[1] == const_cpu_to_le32(545))) - ); -} - -/* - * Test whether a SID means "some user (or group)" - * Currently we only check for S-1-5-21... but we should - * probably test for other configurations - */ - -BOOL ntfs_is_user_sid(const SID *usid) -{ - return ((usid->sub_authority_count == 5) - && (usid->identifier_authority.high_part == const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(5)) - && (usid->sub_authority[0] == const_cpu_to_le32(21))); -} - -/* - * Determine the size of a security attribute - * whatever the order of fields - */ - -unsigned int ntfs_attr_size(const char *attr) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const ACL *pdacl; - const ACL *psacl; - const SID *psid; - unsigned int offdacl; - unsigned int offsacl; - unsigned int offowner; - unsigned int offgroup; - unsigned int endsid; - unsigned int endacl; - unsigned int attrsz; - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)attr; - /* - * First check group, which is the last field in all descriptors - * we build, and in most descriptors built by Windows - */ - attrsz = sizeof(SECURITY_DESCRIPTOR_RELATIVE); - offgroup = le32_to_cpu(phead->group); - if (offgroup >= attrsz) { - /* find end of GSID */ - psid = (const SID*)&attr[offgroup]; - endsid = offgroup + ntfs_sid_size(psid); - if (endsid > attrsz) attrsz = endsid; - } - offowner = le32_to_cpu(phead->owner); - if (offowner >= attrsz) { - /* find end of USID */ - psid = (const SID*)&attr[offowner]; - endsid = offowner + ntfs_sid_size(psid); - attrsz = endsid; - } - offsacl = le32_to_cpu(phead->sacl); - if (offsacl >= attrsz) { - /* find end of SACL */ - psacl = (const ACL*)&attr[offsacl]; - endacl = offsacl + le16_to_cpu(psacl->size); - if (endacl > attrsz) - attrsz = endacl; - } - - - /* find end of DACL */ - offdacl = le32_to_cpu(phead->dacl); - if (offdacl >= attrsz) { - pdacl = (const ACL*)&attr[offdacl]; - endacl = offdacl + le16_to_cpu(pdacl->size); - if (endacl > attrsz) - attrsz = endacl; - } - return (attrsz); -} - -/* - * Do sanity checks on a SID read from storage - * (just check revision and number of authorities) - */ - -BOOL ntfs_valid_sid(const SID *sid) -{ - return ((sid->revision == SID_REVISION) - && (sid->sub_authority_count >= 1) - && (sid->sub_authority_count <= 8)); -} - -/* - * Check whether a SID is acceptable for an implicit - * mapping pattern. - * It should have been already checked it is a valid user SID. - * - * The last authority reference has to be >= 1000 (Windows usage) - * and <= 0x7fffffff, so that 30 bits from a uid and 30 more bits - * from a gid an be inserted with no overflow. - */ - -BOOL ntfs_valid_pattern(const SID *sid) -{ - int cnt; - u32 auth; - le32 leauth; - - cnt = sid->sub_authority_count; - leauth = sid->sub_authority[cnt-1]; - auth = le32_to_cpu(leauth); - return ((auth >= 1000) && (auth <= 0x7fffffff)); -} - -/* - * Compute the uid or gid associated to a SID - * through an implicit mapping - * - * Returns 0 (root) if it does not match pattern - */ - -static u32 findimplicit(const SID *xsid, const SID *pattern, int parity) -{ - BIGSID defsid; - SID *psid; - u32 xid; /* uid or gid */ - int cnt; - u32 carry; - le32 leauth; - u32 uauth; - u32 xlast; - u32 rlast; - - memcpy(&defsid,pattern,ntfs_sid_size(pattern)); - psid = (SID*)&defsid; - cnt = psid->sub_authority_count; - xid = 0; - if (xsid->sub_authority_count == cnt) { - psid->sub_authority[cnt-1] = xsid->sub_authority[cnt-1]; - leauth = xsid->sub_authority[cnt-1]; - xlast = le32_to_cpu(leauth); - leauth = pattern->sub_authority[cnt-1]; - rlast = le32_to_cpu(leauth); - - if ((xlast > rlast) && !((xlast ^ rlast ^ parity) & 1)) { - /* direct check for basic situation */ - if (ntfs_same_sid(psid,xsid)) - xid = ((xlast - rlast) >> 1) & 0x3fffffff; - else { - /* - * check whether part of mapping had to be - * recorded in a higher level authority - */ - carry = 1; - do { - leauth = psid->sub_authority[cnt-2]; - uauth = le32_to_cpu(leauth) + 1; - psid->sub_authority[cnt-2] - = cpu_to_le32(uauth); - } while (!ntfs_same_sid(psid,xsid) - && (++carry < 4)); - if (carry < 4) - xid = (((xlast - rlast) >> 1) - & 0x3fffffff) | (carry << 30); - } - } - } - return (xid); -} - -/* - * Find usid mapped to a Linux user - * Returns NULL if not found - */ - -const SID *ntfs_find_usid(const struct MAPPING* usermapping, - uid_t uid, SID *defusid) -{ - const struct MAPPING *p; - const SID *sid; - le32 leauth; - u32 uauth; - int cnt; - - if (!uid) - sid = adminsid; - else { - p = usermapping; - while (p && p->xid && ((uid_t)p->xid != uid)) - p = p->next; - if (p && !p->xid) { - /* - * default pattern has been reached : - * build an implicit SID according to pattern - * (the pattern format was checked while reading - * the mapping file) - */ - memcpy(defusid, p->sid, ntfs_sid_size(p->sid)); - cnt = defusid->sub_authority_count; - leauth = defusid->sub_authority[cnt-1]; - uauth = le32_to_cpu(leauth) + 2*(uid & 0x3fffffff); - defusid->sub_authority[cnt-1] = cpu_to_le32(uauth); - if (uid & 0xc0000000) { - leauth = defusid->sub_authority[cnt-2]; - uauth = le32_to_cpu(leauth) + ((uid >> 30) & 3); - defusid->sub_authority[cnt-2] = cpu_to_le32(uauth); - } - sid = defusid; - } else - sid = (p ? p->sid : (const SID*)NULL); - } - return (sid); -} - -/* - * Find Linux group mapped to a gsid - * Returns 0 (root) if not found - */ - -const SID *ntfs_find_gsid(const struct MAPPING* groupmapping, - gid_t gid, SID *defgsid) -{ - const struct MAPPING *p; - const SID *sid; - le32 leauth; - u32 uauth; - int cnt; - - if (!gid) - sid = adminsid; - else { - p = groupmapping; - while (p && p->xid && ((gid_t)p->xid != gid)) - p = p->next; - if (p && !p->xid) { - /* - * default pattern has been reached : - * build an implicit SID according to pattern - * (the pattern format was checked while reading - * the mapping file) - */ - memcpy(defgsid, p->sid, ntfs_sid_size(p->sid)); - cnt = defgsid->sub_authority_count; - leauth = defgsid->sub_authority[cnt-1]; - uauth = le32_to_cpu(leauth) + 2*(gid & 0x3fffffff) + 1; - defgsid->sub_authority[cnt-1] = cpu_to_le32(uauth); - if (gid & 0xc0000000) { - leauth = defgsid->sub_authority[cnt-2]; - uauth = le32_to_cpu(leauth) + ((gid >> 30) & 3); - defgsid->sub_authority[cnt-2] = cpu_to_le32(uauth); - } - sid = defgsid; - } else - sid = (p ? p->sid : (const SID*)NULL); - } - return (sid); -} - -/* - * Find Linux owner mapped to a usid - * Returns 0 (root) if not found - */ - -uid_t ntfs_find_user(const struct MAPPING* usermapping, const SID *usid) -{ - uid_t uid; - const struct MAPPING *p; - - p = usermapping; - while (p && p->xid && !ntfs_same_sid(usid, p->sid)) - p = p->next; - if (p && !p->xid) - /* - * No explicit mapping found, try implicit mapping - */ - uid = findimplicit(usid,p->sid,0); - else - uid = (p ? p->xid : 0); - return (uid); -} - -/* - * Find Linux group mapped to a gsid - * Returns 0 (root) if not found - */ - -gid_t ntfs_find_group(const struct MAPPING* groupmapping, const SID * gsid) -{ - gid_t gid; - const struct MAPPING *p; - int gsidsz; - - gsidsz = ntfs_sid_size(gsid); - p = groupmapping; - while (p && p->xid && !ntfs_same_sid(gsid, p->sid)) - p = p->next; - if (p && !p->xid) - /* - * No explicit mapping found, try implicit mapping - */ - gid = findimplicit(gsid,p->sid,1); - else - gid = (p ? p->xid : 0); - return (gid); -} - -/* - * Check the validity of the ACEs in a DACL or SACL - */ - -static BOOL valid_acl(const ACL *pacl, unsigned int end) -{ - const ACCESS_ALLOWED_ACE *pace; - unsigned int offace; - unsigned int acecnt; - unsigned int acesz; - unsigned int nace; - BOOL ok; - - ok = TRUE; - acecnt = le16_to_cpu(pacl->ace_count); - offace = sizeof(ACL); - for (nace = 0; (nace < acecnt) && ok; nace++) { - /* be sure the beginning is within range */ - if ((offace + sizeof(ACCESS_ALLOWED_ACE)) > end) - ok = FALSE; - else { - pace = (const ACCESS_ALLOWED_ACE*) - &((const char*)pacl)[offace]; - acesz = le16_to_cpu(pace->size); - if (((offace + acesz) > end) - || !ntfs_valid_sid(&pace->sid) - || ((ntfs_sid_size(&pace->sid) + 8) != (int)acesz)) - ok = FALSE; - offace += acesz; - } - } - return (ok); -} - -/* - * Do sanity checks on security descriptors read from storage - * basically, we make sure that every field holds within - * allocated storage - * Should not be called with a NULL argument - * returns TRUE if considered safe - * if not, error should be logged by caller - */ - -BOOL ntfs_valid_descr(const char *securattr, unsigned int attrsz) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const ACL *pdacl; - const ACL *psacl; - unsigned int offdacl; - unsigned int offsacl; - unsigned int offowner; - unsigned int offgroup; - BOOL ok; - - ok = TRUE; - - /* - * first check overall size if within allocation range - * and a DACL is present - * and owner and group SID are valid - */ - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - offdacl = le32_to_cpu(phead->dacl); - offsacl = le32_to_cpu(phead->sacl); - offowner = le32_to_cpu(phead->owner); - offgroup = le32_to_cpu(phead->group); - pdacl = (const ACL*)&securattr[offdacl]; - psacl = (const ACL*)&securattr[offsacl]; - - /* - * size check occurs before the above pointers are used - * - * "DR Watson" standard directory on WinXP has an - * old revision and no DACL though SE_DACL_PRESENT is set - */ - if ((attrsz >= sizeof(SECURITY_DESCRIPTOR_RELATIVE)) - && (phead->revision == SECURITY_DESCRIPTOR_REVISION) - && (offowner >= sizeof(SECURITY_DESCRIPTOR_RELATIVE)) - && ((offowner + 2) < attrsz) - && (offgroup >= sizeof(SECURITY_DESCRIPTOR_RELATIVE)) - && ((offgroup + 2) < attrsz) - && (!offdacl - || ((offdacl >= sizeof(SECURITY_DESCRIPTOR_RELATIVE)) - && (offdacl+sizeof(ACL) < attrsz))) - && (!offsacl - || ((offsacl >= sizeof(SECURITY_DESCRIPTOR_RELATIVE)) - && (offsacl+sizeof(ACL) < attrsz))) - && !(phead->owner & const_cpu_to_le32(3)) - && !(phead->group & const_cpu_to_le32(3)) - && !(phead->dacl & const_cpu_to_le32(3)) - && !(phead->sacl & const_cpu_to_le32(3)) - && (ntfs_attr_size(securattr) <= attrsz) - && ntfs_valid_sid((const SID*)&securattr[offowner]) - && ntfs_valid_sid((const SID*)&securattr[offgroup]) - /* - * if there is an ACL, as indicated by offdacl, - * require SE_DACL_PRESENT - * but "Dr Watson" has SE_DACL_PRESENT though no DACL - */ - && (!offdacl - || ((phead->control & SE_DACL_PRESENT) - && ((pdacl->revision == ACL_REVISION) - || (pdacl->revision == ACL_REVISION_DS)))) - /* same for SACL */ - && (!offsacl - || ((phead->control & SE_SACL_PRESENT) - && ((psacl->revision == ACL_REVISION) - || (psacl->revision == ACL_REVISION_DS))))) { - /* - * Check the DACL and SACL if present - */ - if ((offdacl && !valid_acl(pdacl,attrsz - offdacl)) - || (offsacl && !valid_acl(psacl,attrsz - offsacl))) - ok = FALSE; - } else - ok = FALSE; - return (ok); -} - -/* - * Copy the inheritable parts of an ACL - * - * Returns the size of the new ACL - * or zero if nothing is inheritable - */ - -int ntfs_inherit_acl(const ACL *oldacl, ACL *newacl, - const SID *usid, const SID *gsid, BOOL fordir) -{ - unsigned int src; - unsigned int dst; - int oldcnt; - int newcnt; - unsigned int selection; - int nace; - int acesz; - int usidsz; - int gsidsz; - const ACCESS_ALLOWED_ACE *poldace; - ACCESS_ALLOWED_ACE *pnewace; - - usidsz = ntfs_sid_size(usid); - gsidsz = ntfs_sid_size(gsid); - - /* ACL header */ - - newacl->revision = ACL_REVISION; - newacl->alignment1 = 0; - newacl->alignment2 = const_cpu_to_le16(0); - src = dst = sizeof(ACL); - - selection = (fordir ? CONTAINER_INHERIT_ACE : OBJECT_INHERIT_ACE); - newcnt = 0; - oldcnt = le16_to_cpu(oldacl->ace_count); - for (nace = 0; nace < oldcnt; nace++) { - poldace = (const ACCESS_ALLOWED_ACE*)((const char*)oldacl + src); - acesz = le16_to_cpu(poldace->size); - /* inheritance for access */ - if (poldace->flags & selection) { - pnewace = (ACCESS_ALLOWED_ACE*) - ((char*)newacl + dst); - memcpy(pnewace,poldace,acesz); - /* - * Replace generic creator-owner and - * creator-group by owner and group - */ - if (ntfs_same_sid(&pnewace->sid, ownersid)) { - memcpy(&pnewace->sid, usid, usidsz); - acesz = usidsz + 8; - pnewace->size = cpu_to_le16(acesz); - } - if (ntfs_same_sid(&pnewace->sid, groupsid)) { - memcpy(&pnewace->sid, gsid, gsidsz); - acesz = gsidsz + 8; - pnewace->size = cpu_to_le16(acesz); - } - if (pnewace->mask & GENERIC_ALL) { - pnewace->mask &= ~GENERIC_ALL; - if (fordir) - pnewace->mask |= OWNER_RIGHTS - | DIR_READ - | DIR_WRITE - | DIR_EXEC; - else - /* - * The last flag is not defined for a file, - * however Windows sets it, so do the same - */ - pnewace->mask |= OWNER_RIGHTS - | FILE_READ - | FILE_WRITE - | FILE_EXEC - | cpu_to_le32(0x40); - } - /* remove inheritance flags */ - pnewace->flags &= ~(OBJECT_INHERIT_ACE - | CONTAINER_INHERIT_ACE - | INHERIT_ONLY_ACE); - dst += acesz; - newcnt++; - } - /* inheritance for further inheritance */ - if (fordir - && (poldace->flags - & (CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE))) { - pnewace = (ACCESS_ALLOWED_ACE*) - ((char*)newacl + dst); - memcpy(pnewace,poldace,acesz); - /* - * Replace generic creator-owner and - * creator-group by owner and group - */ - if (ntfs_same_sid(&pnewace->sid, ownersid)) { - memcpy(&pnewace->sid, usid, usidsz); - acesz = usidsz + 8; - } - if (ntfs_same_sid(&pnewace->sid, groupsid)) { - memcpy(&pnewace->sid, gsid, gsidsz); - acesz = gsidsz + 8; - } - dst += acesz; - newcnt++; - } - src += acesz; - } - /* - * Adjust header if something was inherited - */ - if (dst > sizeof(ACL)) { - newacl->ace_count = cpu_to_le16(newcnt); - newacl->size = cpu_to_le16(dst); - } else - dst = 0; - return (dst); -} - -#if POSIXACLS - -/* - * Do sanity checks on a Posix descriptor - * Should not be called with a NULL argument - * returns TRUE if considered safe - * if not, error should be logged by caller - */ - -BOOL ntfs_valid_posix(const struct POSIX_SECURITY *pxdesc) -{ - const struct POSIX_ACL *pacl; - int i; - BOOL ok; - u16 tag; - u32 id; - int perms; - struct { - u16 previous; - u32 previousid; - u16 tagsset; - mode_t mode; - int owners; - int groups; - int others; - } checks[2], *pchk; - - for (i=0; i<2; i++) { - checks[i].mode = 0; - checks[i].tagsset = 0; - checks[i].owners = 0; - checks[i].groups = 0; - checks[i].others = 0; - checks[i].previous = 0; - checks[i].previousid = 0; - } - ok = TRUE; - pacl = &pxdesc->acl; - /* - * header (strict for now) - */ - if ((pacl->version != POSIX_VERSION) - || (pacl->flags != 0) - || (pacl->filler != 0)) - ok = FALSE; - /* - * Reject multiple owner, group or other - * but do not require them to be present - * Also check the ACEs are in correct order - * which implies there is no duplicates - */ - for (i=0; iacccnt + pxdesc->defcnt; i++) { - if (i >= pxdesc->firstdef) - pchk = &checks[1]; - else - pchk = &checks[0]; - perms = pacl->ace[i].perms; - tag = pacl->ace[i].tag; - pchk->tagsset |= tag; - id = pacl->ace[i].id; - if (perms & ~7) ok = FALSE; - if ((tag < pchk->previous) - || ((tag == pchk->previous) - && (id <= pchk->previousid))) - ok = FALSE; - pchk->previous = tag; - pchk->previousid = id; - switch (tag) { - case POSIX_ACL_USER_OBJ : - if (pchk->owners++) - ok = FALSE; - if (id != (u32)-1) - ok = FALSE; - pchk->mode |= perms << 6; - break; - case POSIX_ACL_GROUP_OBJ : - if (pchk->groups++) - ok = FALSE; - if (id != (u32)-1) - ok = FALSE; - pchk->mode = (pchk->mode & 07707) | (perms << 3); - break; - case POSIX_ACL_OTHER : - if (pchk->others++) - ok = FALSE; - if (id != (u32)-1) - ok = FALSE; - pchk->mode |= perms; - break; - case POSIX_ACL_USER : - case POSIX_ACL_GROUP : - if (id == (u32)-1) - ok = FALSE; - break; - case POSIX_ACL_MASK : - if (id != (u32)-1) - ok = FALSE; - pchk->mode = (pchk->mode & 07707) | (perms << 3); - break; - default : - ok = FALSE; - break; - } - } - if ((pxdesc->acccnt > 0) - && ((checks[0].owners != 1) || (checks[0].groups != 1) - || (checks[0].others != 1))) - ok = FALSE; - /* do not check owner, group or other are present in */ - /* the default ACL, Windows does not necessarily set them */ - /* descriptor */ - if (pxdesc->defcnt && (pxdesc->acccnt > pxdesc->firstdef)) - ok = FALSE; - if ((pxdesc->acccnt < 0) || (pxdesc->defcnt < 0)) - ok = FALSE; - /* check mode, unless null or no tag set */ - if (pxdesc->mode - && checks[0].tagsset - && (checks[0].mode != (pxdesc->mode & 0777))) - ok = FALSE; - /* check tagsset */ - if (pxdesc->tagsset != checks[0].tagsset) - ok = FALSE; - return (ok); -} - -/* - * Set standard header data into a Posix ACL - * The mode argument should provide the 3 upper bits of target mode - */ - -static mode_t posix_header(struct POSIX_SECURITY *pxdesc, mode_t basemode) -{ - mode_t mode; - u16 tagsset; - struct POSIX_ACE *pace; - int i; - - mode = basemode & 07000; - tagsset = 0; - for (i=0; iacccnt; i++) { - pace = &pxdesc->acl.ace[i]; - tagsset |= pace->tag; - switch(pace->tag) { - case POSIX_ACL_USER_OBJ : - mode |= (pace->perms & 7) << 6; - break; - case POSIX_ACL_GROUP_OBJ : - case POSIX_ACL_MASK : - mode = (mode & 07707) | ((pace->perms & 7) << 3); - break; - case POSIX_ACL_OTHER : - mode |= pace->perms & 7; - break; - default : - break; - } - } - pxdesc->tagsset = tagsset; - pxdesc->mode = mode; - pxdesc->acl.version = POSIX_VERSION; - pxdesc->acl.flags = 0; - pxdesc->acl.filler = 0; - return (mode); -} - -/* - * Sort ACEs in a Posix ACL - * This is useful for always getting reusable converted ACLs, - * it also helps in merging ACEs. - * Repeated tag+id are allowed and not merged here. - * - * Tags should be in ascending sequence and for a repeatable tag - * ids should be in ascending sequence. - */ - -void ntfs_sort_posix(struct POSIX_SECURITY *pxdesc) -{ - struct POSIX_ACL *pacl; - struct POSIX_ACE ace; - int i; - int offs; - BOOL done; - u16 tag; - u16 previous; - u32 id; - u32 previousid; - - - /* - * Check sequencing of tag+id in access ACE's - */ - pacl = &pxdesc->acl; - do { - done = TRUE; - previous = pacl->ace[0].tag; - previousid = pacl->ace[0].id; - for (i=1; iacccnt; i++) { - tag = pacl->ace[i].tag; - id = pacl->ace[i].id; - - if ((tag < previous) - || ((tag == previous) && (id < previousid))) { - done = FALSE; - memcpy(&ace,&pacl->ace[i-1],sizeof(struct POSIX_ACE)); - memcpy(&pacl->ace[i-1],&pacl->ace[i],sizeof(struct POSIX_ACE)); - memcpy(&pacl->ace[i],&ace,sizeof(struct POSIX_ACE)); - } else { - previous = tag; - previousid = id; - } - } - } while (!done); - /* - * Same for default ACEs - */ - do { - done = TRUE; - if ((pxdesc->defcnt) > 1) { - offs = pxdesc->firstdef; - previous = pacl->ace[offs].tag; - previousid = pacl->ace[offs].id; - for (i=offs+1; idefcnt; i++) { - tag = pacl->ace[i].tag; - id = pacl->ace[i].id; - - if ((tag < previous) - || ((tag == previous) && (id < previousid))) { - done = FALSE; - memcpy(&ace,&pacl->ace[i-1],sizeof(struct POSIX_ACE)); - memcpy(&pacl->ace[i-1],&pacl->ace[i],sizeof(struct POSIX_ACE)); - memcpy(&pacl->ace[i],&ace,sizeof(struct POSIX_ACE)); - } else { - previous = tag; - previousid = id; - } - } - } - } while (!done); -} - -/* - * Merge a new mode into a Posix descriptor - * The Posix descriptor is not reallocated, its size is unchanged - * - * returns 0 if ok - */ - -int ntfs_merge_mode_posix(struct POSIX_SECURITY *pxdesc, mode_t mode) -{ - int i; - BOOL maskfound; - struct POSIX_ACE *pace; - int todo; - - maskfound = FALSE; - todo = POSIX_ACL_USER_OBJ | POSIX_ACL_GROUP_OBJ | POSIX_ACL_OTHER; - for (i=pxdesc->acccnt-1; i>=0; i--) { - pace = &pxdesc->acl.ace[i]; - switch(pace->tag) { - case POSIX_ACL_USER_OBJ : - pace->perms = (mode >> 6) & 7; - todo &= ~POSIX_ACL_USER_OBJ; - break; - case POSIX_ACL_GROUP_OBJ : - if (!maskfound) - pace->perms = (mode >> 3) & 7; - todo &= ~POSIX_ACL_GROUP_OBJ; - break; - case POSIX_ACL_MASK : - pace->perms = (mode >> 3) & 7; - maskfound = TRUE; - break; - case POSIX_ACL_OTHER : - pace->perms = mode & 7; - todo &= ~POSIX_ACL_OTHER; - break; - default : - break; - } - } - pxdesc->mode = mode; - return (todo ? -1 : 0); -} - -/* - * Replace an access or default Posix ACL - * The resulting ACL is checked for validity - * - * Returns a new ACL or NULL if there is a problem - */ - -struct POSIX_SECURITY *ntfs_replace_acl(const struct POSIX_SECURITY *oldpxdesc, - const struct POSIX_ACL *newacl, int count, BOOL deflt) -{ - struct POSIX_SECURITY *newpxdesc; - size_t newsize; - int offset; - int oldoffset; - int i; - - if (deflt) - newsize = sizeof(struct POSIX_SECURITY) - + (oldpxdesc->acccnt + count)*sizeof(struct POSIX_ACE); - else - newsize = sizeof(struct POSIX_SECURITY) - + (oldpxdesc->defcnt + count)*sizeof(struct POSIX_ACE); - newpxdesc = (struct POSIX_SECURITY*)malloc(newsize); - if (newpxdesc) { - if (deflt) { - offset = oldpxdesc->acccnt; - newpxdesc->acccnt = oldpxdesc->acccnt; - newpxdesc->defcnt = count; - newpxdesc->firstdef = offset; - /* copy access ACEs */ - for (i=0; iacccnt; i++) - newpxdesc->acl.ace[i] = oldpxdesc->acl.ace[i]; - /* copy default ACEs */ - for (i=0; iacl.ace[i + offset] = newacl->ace[i]; - } else { - offset = count; - newpxdesc->acccnt = count; - newpxdesc->defcnt = oldpxdesc->defcnt; - newpxdesc->firstdef = count; - /* copy access ACEs */ - for (i=0; iacl.ace[i] = newacl->ace[i]; - /* copy default ACEs */ - oldoffset = oldpxdesc->firstdef; - for (i=0; idefcnt; i++) - newpxdesc->acl.ace[i + offset] = oldpxdesc->acl.ace[i + oldoffset]; - } - /* assume special flags unchanged */ - posix_header(newpxdesc, oldpxdesc->mode); - if (!ntfs_valid_posix(newpxdesc)) { - /* do not log, this is an application error */ - free(newpxdesc); - newpxdesc = (struct POSIX_SECURITY*)NULL; - errno = EINVAL; - } - } else - errno = ENOMEM; - return (newpxdesc); -} - -/* - * Build an inherited Posix descriptor from parent - * descriptor (if any) restricted to creation mode - * - * Returns the inherited descriptor or NULL if there is a problem - */ - -struct POSIX_SECURITY *ntfs_build_inherited_posix( - const struct POSIX_SECURITY *pxdesc, mode_t mode, - mode_t mask, BOOL isdir) -{ - struct POSIX_SECURITY *pydesc; - struct POSIX_ACE *pyace; - int count; - int defcnt; - int size; - int i; - s16 tagsset; - - if (pxdesc && pxdesc->defcnt) { - if (isdir) - count = 2*pxdesc->defcnt + 3; - else - count = pxdesc->defcnt + 3; - } else - count = 3; - pydesc = (struct POSIX_SECURITY*)malloc( - sizeof(struct POSIX_SECURITY) + count*sizeof(struct POSIX_ACE)); - if (pydesc) { - /* - * Copy inherited tags and adapt perms - * Use requested mode, ignoring umask - * (not possible with older versions of fuse) - */ - tagsset = 0; - defcnt = (pxdesc ? pxdesc->defcnt : 0); - for (i=defcnt-1; i>=0; i--) { - pyace = &pydesc->acl.ace[i]; - *pyace = pxdesc->acl.ace[pxdesc->firstdef + i]; - switch (pyace->tag) { - case POSIX_ACL_USER_OBJ : - pyace->perms &= (mode >> 6) & 7; - break; - case POSIX_ACL_GROUP_OBJ : - if (!(tagsset & POSIX_ACL_MASK)) - pyace->perms &= (mode >> 3) & 7; - break; - case POSIX_ACL_OTHER : - pyace->perms &= mode & 7; - break; - case POSIX_ACL_MASK : - pyace->perms &= (mode >> 3) & 7; - break; - default : - break; - } - tagsset |= pyace->tag; - } - pydesc->acccnt = defcnt; - /* - * If some standard tags were missing, append them from mode - * and sort the list - * Here we have to use the umask'ed mode - */ - if (~tagsset & (POSIX_ACL_USER_OBJ - | POSIX_ACL_GROUP_OBJ | POSIX_ACL_OTHER)) { - i = defcnt; - /* owner was missing */ - if (!(tagsset & POSIX_ACL_USER_OBJ)) { - pyace = &pydesc->acl.ace[i]; - pyace->tag = POSIX_ACL_USER_OBJ; - pyace->id = -1; - pyace->perms = ((mode & ~mask) >> 6) & 7; - tagsset |= POSIX_ACL_USER_OBJ; - i++; - } - /* owning group was missing */ - if (!(tagsset & POSIX_ACL_GROUP_OBJ)) { - pyace = &pydesc->acl.ace[i]; - pyace->tag = POSIX_ACL_GROUP_OBJ; - pyace->id = -1; - pyace->perms = ((mode & ~mask) >> 3) & 7; - tagsset |= POSIX_ACL_GROUP_OBJ; - i++; - } - /* other was missing */ - if (!(tagsset & POSIX_ACL_OTHER)) { - pyace = &pydesc->acl.ace[i]; - pyace->tag = POSIX_ACL_OTHER; - pyace->id = -1; - pyace->perms = mode & ~mask & 7; - tagsset |= POSIX_ACL_OTHER; - i++; - } - pydesc->acccnt = i; - pydesc->firstdef = i; - pydesc->defcnt = 0; - ntfs_sort_posix(pydesc); - } - - /* - * append as a default ACL if a directory - */ - pydesc->firstdef = pydesc->acccnt; - if (defcnt && isdir) { - size = sizeof(struct POSIX_ACE)*defcnt; - memcpy(&pydesc->acl.ace[pydesc->firstdef], - &pxdesc->acl.ace[pxdesc->firstdef],size); - pydesc->defcnt = defcnt; - } else { - pydesc->defcnt = 0; - } - /* assume special bits are not inherited */ - posix_header(pydesc, mode & 07000); - if (!ntfs_valid_posix(pydesc)) { - ntfs_log_error("Error building an inherited Posix desc\n"); - errno = EIO; - free(pydesc); - pydesc = (struct POSIX_SECURITY*)NULL; - } - } else - errno = ENOMEM; - return (pydesc); -} - -static int merge_lists_posix(struct POSIX_ACE *targetace, - const struct POSIX_ACE *firstace, - const struct POSIX_ACE *secondace, - int firstcnt, int secondcnt) -{ - int k; - - k = 0; - /* - * No list is exhausted : - * if same tag+id in both list : - * ignore ACE from second list - * else take the one with smaller tag+id - */ - while ((firstcnt > 0) && (secondcnt > 0)) - if ((firstace->tag == secondace->tag) - && (firstace->id == secondace->id)) { - secondace++; - secondcnt--; - } else - if ((firstace->tag < secondace->tag) - || ((firstace->tag == secondace->tag) - && (firstace->id < secondace->id))) { - targetace->tag = firstace->tag; - targetace->id = firstace->id; - targetace->perms = firstace->perms; - firstace++; - targetace++; - firstcnt--; - k++; - } else { - targetace->tag = secondace->tag; - targetace->id = secondace->id; - targetace->perms = secondace->perms; - secondace++; - targetace++; - secondcnt--; - k++; - } - /* - * One list is exhausted, copy the other one - */ - while (firstcnt > 0) { - targetace->tag = firstace->tag; - targetace->id = firstace->id; - targetace->perms = firstace->perms; - firstace++; - targetace++; - firstcnt--; - k++; - } - while (secondcnt > 0) { - targetace->tag = secondace->tag; - targetace->id = secondace->id; - targetace->perms = secondace->perms; - secondace++; - targetace++; - secondcnt--; - k++; - } - return (k); -} - -/* - * Merge two Posix ACLs - * The input ACLs have to be adequately sorted - * - * Returns the merged ACL, which is allocated and has to be freed by caller, - * or NULL if failed - */ - -struct POSIX_SECURITY *ntfs_merge_descr_posix(const struct POSIX_SECURITY *first, - const struct POSIX_SECURITY *second) -{ - struct POSIX_SECURITY *pxdesc; - struct POSIX_ACE *targetace; - const struct POSIX_ACE *firstace; - const struct POSIX_ACE *secondace; - size_t size; - int k; - - size = sizeof(struct POSIX_SECURITY) - + (first->acccnt + first->defcnt - + second->acccnt + second->defcnt)*sizeof(struct POSIX_ACE); - pxdesc = (struct POSIX_SECURITY*)malloc(size); - if (pxdesc) { - /* - * merge access ACEs - */ - firstace = first->acl.ace; - secondace = second->acl.ace; - targetace = pxdesc->acl.ace; - k = merge_lists_posix(targetace,firstace,secondace, - first->acccnt,second->acccnt); - pxdesc->acccnt = k; - /* - * merge default ACEs - */ - pxdesc->firstdef = k; - firstace = &first->acl.ace[first->firstdef]; - secondace = &second->acl.ace[second->firstdef]; - targetace = &pxdesc->acl.ace[k]; - k = merge_lists_posix(targetace,firstace,secondace, - first->defcnt,second->defcnt); - pxdesc->defcnt = k; - /* - * build header - */ - pxdesc->acl.version = POSIX_VERSION; - pxdesc->acl.flags = 0; - pxdesc->acl.filler = 0; - pxdesc->mode = 0; - pxdesc->tagsset = 0; - } else - errno = ENOMEM; - return (pxdesc); -} - -struct BUILD_CONTEXT { - BOOL isdir; - BOOL adminowns; - BOOL groupowns; - u16 selfuserperms; - u16 selfgrpperms; - u16 grpperms; - u16 othperms; - u16 mask; - u16 designates; - u16 withmask; - u16 rootspecial; -} ; - - - -static BOOL build_user_denials(ACL *pacl, - const SID *usid, struct MAPPING* const mapping[], - ACE_FLAGS flags, const struct POSIX_ACE *pxace, - struct BUILD_CONTEXT *pset) -{ - BIGSID defsid; - ACCESS_ALLOWED_ACE *pdace; - const SID *sid; - int sidsz; - int pos; - int acecnt; - le32 grants; - le32 denials; - u16 perms; - u16 mixperms; - u16 tag; - BOOL rejected; - BOOL rootuser; - BOOL avoidmask; - - rejected = FALSE; - tag = pxace->tag; - perms = pxace->perms; - rootuser = FALSE; - pos = le16_to_cpu(pacl->size); - acecnt = le16_to_cpu(pacl->ace_count); - avoidmask = (pset->mask == (POSIX_PERM_R | POSIX_PERM_W | POSIX_PERM_X)) - && ((pset->designates && pset->withmask) - || (!pset->designates && !pset->withmask)); - if (tag == POSIX_ACL_USER_OBJ) { - sid = usid; - sidsz = ntfs_sid_size(sid); - grants = OWNER_RIGHTS; - } else { - if (pxace->id) { - sid = NTFS_FIND_USID(mapping[MAPUSERS], - pxace->id, (SID*)&defsid); - grants = WORLD_RIGHTS; - } else { - sid = adminsid; - rootuser = TRUE; - grants = WORLD_RIGHTS & ~ROOT_OWNER_UNMARK; - } - if (sid) { - sidsz = ntfs_sid_size(sid); - /* - * Insert denial of complement of mask for - * each designated user (except root) - * WRITE_OWNER is inserted so that - * the mask can be identified - */ - if (!avoidmask && !rootuser) { - denials = WRITE_OWNER; - pdace = (ACCESS_DENIED_ACE*)&((char*)pacl)[pos]; - if (pset->isdir) { - if (!(pset->mask & POSIX_PERM_X)) - denials |= DIR_EXEC; - if (!(pset->mask & POSIX_PERM_W)) - denials |= DIR_WRITE; - if (!(pset->mask & POSIX_PERM_R)) - denials |= DIR_READ; - } else { - if (!(pset->mask & POSIX_PERM_X)) - denials |= FILE_EXEC; - if (!(pset->mask & POSIX_PERM_W)) - denials |= FILE_WRITE; - if (!(pset->mask & POSIX_PERM_R)) - denials |= FILE_READ; - } - if (rootuser) - grants &= ~ROOT_OWNER_UNMARK; - pdace->type = ACCESS_DENIED_ACE_TYPE; - pdace->flags = flags; - pdace->size = cpu_to_le16(sidsz + 8); - pdace->mask = denials; - memcpy((char*)&pdace->sid, sid, sidsz); - pos += sidsz + 8; - acecnt++; - } - } else - rejected = TRUE; - } - if (!rejected) { - if (pset->isdir) { - if (perms & POSIX_PERM_X) - grants |= DIR_EXEC; - if (perms & POSIX_PERM_W) - grants |= DIR_WRITE; - if (perms & POSIX_PERM_R) - grants |= DIR_READ; - } else { - if (perms & POSIX_PERM_X) - grants |= FILE_EXEC; - if (perms & POSIX_PERM_W) - grants |= FILE_WRITE; - if (perms & POSIX_PERM_R) - grants |= FILE_READ; - } - - /* a possible ACE to deny owner what he/she would */ - /* induely get from administrator, group or world */ - /* unless owner is administrator or group */ - - denials = const_cpu_to_le32(0); - pdace = (ACCESS_DENIED_ACE*)&((char*)pacl)[pos]; - if (!pset->adminowns && !rootuser) { - if (!pset->groupowns) { - mixperms = pset->grpperms | pset->othperms; - if (tag == POSIX_ACL_USER_OBJ) - mixperms |= pset->selfuserperms; - if (pset->isdir) { - if (mixperms & POSIX_PERM_X) - denials |= DIR_EXEC; - if (mixperms & POSIX_PERM_W) - denials |= DIR_WRITE; - if (mixperms & POSIX_PERM_R) - denials |= DIR_READ; - } else { - if (mixperms & POSIX_PERM_X) - denials |= FILE_EXEC; - if (mixperms & POSIX_PERM_W) - denials |= FILE_WRITE; - if (mixperms & POSIX_PERM_R) - denials |= FILE_READ; - } - } else { - mixperms = ~pset->grpperms & pset->othperms; - if (tag == POSIX_ACL_USER_OBJ) - mixperms |= pset->selfuserperms; - if (pset->isdir) { - if (mixperms & POSIX_PERM_X) - denials |= DIR_EXEC; - if (mixperms & POSIX_PERM_W) - denials |= DIR_WRITE; - if (mixperms & POSIX_PERM_R) - denials |= DIR_READ; - } else { - if (mixperms & POSIX_PERM_X) - denials |= FILE_EXEC; - if (mixperms & POSIX_PERM_W) - denials |= FILE_WRITE; - if (mixperms & POSIX_PERM_R) - denials |= FILE_READ; - } - } - denials &= ~grants; - if (denials) { - pdace->type = ACCESS_DENIED_ACE_TYPE; - pdace->flags = flags; - pdace->size = cpu_to_le16(sidsz + 8); - pdace->mask = denials; - memcpy((char*)&pdace->sid, sid, sidsz); - pos += sidsz + 8; - acecnt++; - } - } - } - pacl->size = cpu_to_le16(pos); - pacl->ace_count = cpu_to_le16(acecnt); - return (!rejected); -} - -static BOOL build_user_grants(ACL *pacl, - const SID *usid, struct MAPPING* const mapping[], - ACE_FLAGS flags, const struct POSIX_ACE *pxace, - struct BUILD_CONTEXT *pset) -{ - BIGSID defsid; - ACCESS_ALLOWED_ACE *pgace; - const SID *sid; - int sidsz; - int pos; - int acecnt; - le32 grants; - u16 perms; - u16 tag; - BOOL rejected; - BOOL rootuser; - - rejected = FALSE; - tag = pxace->tag; - perms = pxace->perms; - rootuser = FALSE; - pos = le16_to_cpu(pacl->size); - acecnt = le16_to_cpu(pacl->ace_count); - if (tag == POSIX_ACL_USER_OBJ) { - sid = usid; - sidsz = ntfs_sid_size(sid); - grants = OWNER_RIGHTS; - } else { - if (pxace->id) { - sid = NTFS_FIND_USID(mapping[MAPUSERS], - pxace->id, (SID*)&defsid); - if (sid) - sidsz = ntfs_sid_size(sid); - else - rejected = TRUE; - grants = WORLD_RIGHTS; - } else { - sid = adminsid; - sidsz = ntfs_sid_size(sid); - rootuser = TRUE; - grants = WORLD_RIGHTS & ~ROOT_OWNER_UNMARK; - } - } - if (!rejected) { - if (pset->isdir) { - if (perms & POSIX_PERM_X) - grants |= DIR_EXEC; - if (perms & POSIX_PERM_W) - grants |= DIR_WRITE; - if (perms & POSIX_PERM_R) - grants |= DIR_READ; - } else { - if (perms & POSIX_PERM_X) - grants |= FILE_EXEC; - if (perms & POSIX_PERM_W) - grants |= FILE_WRITE; - if (perms & POSIX_PERM_R) - grants |= FILE_READ; - } - if (rootuser) - grants &= ~ROOT_OWNER_UNMARK; - pgace = (ACCESS_DENIED_ACE*)&((char*)pacl)[pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->size = cpu_to_le16(sidsz + 8); - pgace->flags = flags; - pgace->mask = grants; - memcpy((char*)&pgace->sid, sid, sidsz); - pos += sidsz + 8; - acecnt = le16_to_cpu(pacl->ace_count) + 1; - pacl->ace_count = cpu_to_le16(acecnt); - pacl->size = cpu_to_le16(pos); - } - return (!rejected); -} - - - /* a grant ACE for group */ - /* unless group-obj has the same rights as world */ - /* but present if group is owner or owner is administrator */ - /* this ACE will be inserted after denials for group */ - -static BOOL build_group_denials_grant(ACL *pacl, - const SID *gsid, struct MAPPING* const mapping[], - ACE_FLAGS flags, const struct POSIX_ACE *pxace, - struct BUILD_CONTEXT *pset) -{ - BIGSID defsid; - ACCESS_ALLOWED_ACE *pdace; - ACCESS_ALLOWED_ACE *pgace; - const SID *sid; - int sidsz; - int pos; - int acecnt; - le32 grants; - le32 denials; - u16 perms; - u16 mixperms; - u16 tag; - BOOL avoidmask; - BOOL rootgroup; - BOOL rejected; - - rejected = FALSE; - tag = pxace->tag; - perms = pxace->perms; - pos = le16_to_cpu(pacl->size); - acecnt = le16_to_cpu(pacl->ace_count); - rootgroup = FALSE; - avoidmask = (pset->mask == (POSIX_PERM_R | POSIX_PERM_W | POSIX_PERM_X)) - && ((pset->designates && pset->withmask) - || (!pset->designates && !pset->withmask)); - if (tag == POSIX_ACL_GROUP_OBJ) - sid = gsid; - else - if (pxace->id) - sid = NTFS_FIND_GSID(mapping[MAPGROUPS], - pxace->id, (SID*)&defsid); - else { - sid = adminsid; - rootgroup = TRUE; - } - if (sid) { - sidsz = ntfs_sid_size(sid); - /* - * Insert denial of complement of mask for - * each group - * WRITE_OWNER is inserted so that - * the mask can be identified - * Note : this mask may lead on Windows to - * deny rights to administrators belonging - * to some user group - */ - if ((!avoidmask && !rootgroup) - || (pset->rootspecial - && (tag == POSIX_ACL_GROUP_OBJ))) { - denials = WRITE_OWNER; - pdace = (ACCESS_DENIED_ACE*)&((char*)pacl)[pos]; - if (pset->isdir) { - if (!(pset->mask & POSIX_PERM_X)) - denials |= DIR_EXEC; - if (!(pset->mask & POSIX_PERM_W)) - denials |= DIR_WRITE; - if (!(pset->mask & POSIX_PERM_R)) - denials |= DIR_READ; - } else { - if (!(pset->mask & POSIX_PERM_X)) - denials |= FILE_EXEC; - if (!(pset->mask & POSIX_PERM_W)) - denials |= FILE_WRITE; - if (!(pset->mask & POSIX_PERM_R)) - denials |= FILE_READ; - } - pdace->type = ACCESS_DENIED_ACE_TYPE; - pdace->flags = flags; - pdace->size = cpu_to_le16(sidsz + 8); - pdace->mask = denials; - memcpy((char*)&pdace->sid, sid, sidsz); - pos += sidsz + 8; - acecnt++; - } - } else - rejected = TRUE; - if (!rejected - && (pset->adminowns - || pset->groupowns - || avoidmask - || rootgroup - || (perms != pset->othperms))) { - grants = WORLD_RIGHTS; - if (rootgroup) - grants &= ~ROOT_GROUP_UNMARK; - if (pset->isdir) { - if (perms & POSIX_PERM_X) - grants |= DIR_EXEC; - if (perms & POSIX_PERM_W) - grants |= DIR_WRITE; - if (perms & POSIX_PERM_R) - grants |= DIR_READ; - } else { - if (perms & POSIX_PERM_X) - grants |= FILE_EXEC; - if (perms & POSIX_PERM_W) - grants |= FILE_WRITE; - if (perms & POSIX_PERM_R) - grants |= FILE_READ; - } - - /* a possible ACE to deny group what it would get from world */ - /* or administrator, unless owner is administrator or group */ - - denials = const_cpu_to_le32(0); - pdace = (ACCESS_DENIED_ACE*)&((char*)pacl)[pos]; - if (!pset->adminowns - && !pset->groupowns - && !rootgroup) { - mixperms = pset->othperms; - if (tag == POSIX_ACL_GROUP_OBJ) - mixperms |= pset->selfgrpperms; - if (pset->isdir) { - if (mixperms & POSIX_PERM_X) - denials |= DIR_EXEC; - if (mixperms & POSIX_PERM_W) - denials |= DIR_WRITE; - if (mixperms & POSIX_PERM_R) - denials |= DIR_READ; - } else { - if (mixperms & POSIX_PERM_X) - denials |= FILE_EXEC; - if (mixperms & POSIX_PERM_W) - denials |= FILE_WRITE; - if (mixperms & POSIX_PERM_R) - denials |= FILE_READ; - } - denials &= ~(grants | OWNER_RIGHTS); - if (denials) { - pdace->type = ACCESS_DENIED_ACE_TYPE; - pdace->flags = flags; - pdace->size = cpu_to_le16(sidsz + 8); - pdace->mask = denials; - memcpy((char*)&pdace->sid, sid, sidsz); - pos += sidsz + 8; - acecnt++; - } - } - - /* now insert grants to group if more than world */ - if (pset->adminowns - || pset->groupowns - || (avoidmask && (pset->designates || pset->withmask)) - || (perms & ~pset->othperms) - || (pset->rootspecial - && (tag == POSIX_ACL_GROUP_OBJ)) - || (tag == POSIX_ACL_GROUP)) { - if (rootgroup) - grants &= ~ROOT_GROUP_UNMARK; - pgace = (ACCESS_DENIED_ACE*)&((char*)pacl)[pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->flags = flags; - pgace->size = cpu_to_le16(sidsz + 8); - pgace->mask = grants; - memcpy((char*)&pgace->sid, sid, sidsz); - pos += sidsz + 8; - acecnt++; - } - } - pacl->size = cpu_to_le16(pos); - pacl->ace_count = cpu_to_le16(acecnt); - return (!rejected); -} - - -/* - * Build an ACL composed of several ACE's - * returns size of ACL or zero if failed - * - * Three schemes are defined : - * - * 1) if root is neither owner nor group up to 7 ACE's are set up : - * - denials to owner (preventing grants to world or group to apply) - * + mask denials to designated user (unless mask allows all) - * + denials to designated user - * - grants to owner (always present - first grant) - * + grants to designated user - * + mask denial to group (unless mask allows all) - * - denials to group (preventing grants to world to apply) - * - grants to group (unless group has no more than world rights) - * + mask denials to designated group (unless mask allows all) - * + grants to designated group - * + denials to designated group - * - grants to world (unless none) - * - full privileges to administrator, always present - * - full privileges to system, always present - * - * The same scheme is applied for Posix ACLs, with the mask represented - * as denials prepended to grants for designated users and groups - * - * This is inspired by an Internet Draft from Marius Aamodt Eriksen - * for mapping NFSv4 ACLs to Posix ACLs (draft-ietf-nfsv4-acl-mapping-00.txt) - * More recent versions of the draft (draft-ietf-nfsv4-acl-mapping-05.txt) - * are not followed, as they ignore the Posix mask and lead to - * loss of compatibility with Linux implementations on other fs. - * - * Note that denials to group are located after grants to owner. - * This only occurs in the unfrequent situation where world - * has more rights than group and cannot be avoided if owner and other - * have some common right which is denied to group (eg for mode 745 - * executing has to be denied to group, but not to owner or world). - * This rare situation is processed by Windows correctly, but - * Windows utilities may want to change the order, with a - * consequence of applying the group denials to the Windows owner. - * The interpretation on Linux is not affected by the order change. - * - * 2) if root is either owner or group, two problems arise : - * - granting full rights to administrator (as needed to transpose - * to Windows rights bypassing granting to root) would imply - * Linux permissions to always be seen as rwx, no matter the chmod - * - there is no different SID to separate an administrator owner - * from an administrator group. Hence Linux permissions for owner - * would always be similar to permissions to group. - * - * as a work-around, up to 5 ACE's are set up if owner or group : - * - grants to owner, always present at first position - * - grants to group, always present - * - grants to world, unless none - * - full privileges to administrator, always present - * - full privileges to system, always present - * - * On Windows, these ACE's are processed normally, though they - * are redundant (owner, group and administrator are the same, - * as a consequence any denials would damage administrator rights) - * but on Linux, privileges to administrator are ignored (they - * are not needed as root has always full privileges), and - * neither grants to group are applied to owner, nor grants to - * world are applied to owner or group. - * - * 3) finally a similar situation arises when group is owner (they - * have the same SID), but is not root. - * In this situation up to 6 ACE's are set up : - * - * - denials to owner (preventing grants to world to apply) - * - grants to owner (always present) - * - grants to group (unless groups has same rights as world) - * - grants to world (unless none) - * - full privileges to administrator, always present - * - full privileges to system, always present - * - * On Windows, these ACE's are processed normally, though they - * are redundant (as owner and group are the same), but this has - * no impact on administrator rights - * - * Special flags (S_ISVTX, S_ISGID, S_ISUID) : - * an extra null ACE is inserted to hold these flags, using - * the same conventions as cygwin. - * - */ - -static int buildacls_posix(struct MAPPING* const mapping[], - char *secattr, int offs, const struct POSIX_SECURITY *pxdesc, - int isdir, const SID *usid, const SID *gsid) -{ - struct BUILD_CONTEXT aceset[2], *pset; - BOOL adminowns; - BOOL groupowns; - ACL *pacl; - ACCESS_ALLOWED_ACE *pgace; - ACCESS_ALLOWED_ACE *pdace; - const struct POSIX_ACE *pxace; - BOOL ok; - mode_t mode; - u16 tag; - u16 perms; - ACE_FLAGS flags; - int pos; - int i; - int k; - BIGSID defsid; - const SID *sid; - int acecnt; - int usidsz; - int gsidsz; - int wsidsz; - int asidsz; - int ssidsz; - int nsidsz; - le32 grants; - - usidsz = ntfs_sid_size(usid); - gsidsz = ntfs_sid_size(gsid); - wsidsz = ntfs_sid_size(worldsid); - asidsz = ntfs_sid_size(adminsid); - ssidsz = ntfs_sid_size(systemsid); - mode = pxdesc->mode; - /* adminowns and groupowns are used for both lists */ - adminowns = ntfs_same_sid(usid, adminsid) - || ntfs_same_sid(gsid, adminsid); - groupowns = !adminowns && ntfs_same_sid(usid, gsid); - - ok = TRUE; - - /* ACL header */ - pacl = (ACL*)&secattr[offs]; - pacl->revision = ACL_REVISION; - pacl->alignment1 = 0; - pacl->size = cpu_to_le16(sizeof(ACL) + usidsz + 8); - pacl->ace_count = const_cpu_to_le16(0); - pacl->alignment2 = const_cpu_to_le16(0); - - /* - * Determine what is allowed to some group or world - * to prevent designated users or other groups to get - * rights from groups or world - * Do the same if owner and group appear as designated - * user or group - * Also get global mask - */ - for (k=0; k<2; k++) { - pset = &aceset[k]; - pset->selfuserperms = 0; - pset->selfgrpperms = 0; - pset->grpperms = 0; - pset->othperms = 0; - pset->mask = (POSIX_PERM_R | POSIX_PERM_W | POSIX_PERM_X); - pset->designates = 0; - pset->withmask = 0; - pset->rootspecial = 0; - pset->adminowns = adminowns; - pset->groupowns = groupowns; - pset->isdir = isdir; - } - - for (i=pxdesc->acccnt+pxdesc->defcnt-1; i>=0; i--) { - if (i >= pxdesc->acccnt) { - pset = &aceset[1]; - pxace = &pxdesc->acl.ace[i + pxdesc->firstdef - pxdesc->acccnt]; - } else { - pset = &aceset[0]; - pxace = &pxdesc->acl.ace[i]; - } - switch (pxace->tag) { - case POSIX_ACL_USER : - pset->designates++; - if (pxace->id) { - sid = NTFS_FIND_USID(mapping[MAPUSERS], - pxace->id, (SID*)&defsid); - if (sid && ntfs_same_sid(sid,usid)) - pset->selfuserperms |= pxace->perms; - } else - /* root as designated user is processed apart */ - pset->rootspecial = TRUE; - break; - case POSIX_ACL_GROUP : - pset->designates++; - if (pxace->id) { - sid = NTFS_FIND_GSID(mapping[MAPUSERS], - pxace->id, (SID*)&defsid); - if (sid && ntfs_same_sid(sid,gsid)) - pset->selfgrpperms |= pxace->perms; - } else - /* root as designated group is processed apart */ - pset->rootspecial = TRUE; - /* fall through */ - case POSIX_ACL_GROUP_OBJ : - pset->grpperms |= pxace->perms; - break; - case POSIX_ACL_OTHER : - pset->othperms = pxace->perms; - break; - case POSIX_ACL_MASK : - pset->withmask++; - pset->mask = pxace->perms; - default : - break; - } - } - -if (pxdesc->defcnt && (pxdesc->firstdef != pxdesc->acccnt)) { -ntfs_log_error("** error : access and default not consecutive\n"); -return (0); -} - /* - * First insert all denials for owner and each - * designated user (with mask if needed) - */ - - pacl->ace_count = const_cpu_to_le16(0); - pacl->size = const_cpu_to_le16(sizeof(ACL)); - for (i=0; (i<(pxdesc->acccnt + pxdesc->defcnt)) && ok; i++) { - if (i >= pxdesc->acccnt) { - flags = INHERIT_ONLY_ACE - | OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE; - pset = &aceset[1]; - pxace = &pxdesc->acl.ace[i + pxdesc->firstdef - pxdesc->acccnt]; - } else { - if (pxdesc->defcnt) - flags = NO_PROPAGATE_INHERIT_ACE; - else - flags = (isdir ? DIR_INHERITANCE - : FILE_INHERITANCE); - pset = &aceset[0]; - pxace = &pxdesc->acl.ace[i]; - } - tag = pxace->tag; - perms = pxace->perms; - switch (tag) { - - /* insert denial ACEs for each owner or allowed user */ - - case POSIX_ACL_USER : - case POSIX_ACL_USER_OBJ : - - ok = build_user_denials(pacl, - usid, mapping, flags, pxace, pset); - break; - default : - break; - } - } - - /* - * for directories, insert a world execution denial - * inherited to plain files. - * This is to prevent Windows from granting execution - * of files through inheritance from parent directory - */ - - if (isdir && ok) { - pos = le16_to_cpu(pacl->size); - pdace = (ACCESS_DENIED_ACE*) &secattr[offs + pos]; - pdace->type = ACCESS_DENIED_ACE_TYPE; - pdace->flags = INHERIT_ONLY_ACE | OBJECT_INHERIT_ACE; - pdace->size = cpu_to_le16(wsidsz + 8); - pdace->mask = FILE_EXEC; - memcpy((char*)&pdace->sid, worldsid, wsidsz); - pos += wsidsz + 8; - acecnt = le16_to_cpu(pacl->ace_count) + 1; - pacl->ace_count = cpu_to_le16(acecnt); - pacl->size = cpu_to_le16(pos); - } - - /* - * now insert (if needed) - * - grants to owner and designated users - * - mask and denials for all groups - * - grants to other - */ - - for (i=0; (i<(pxdesc->acccnt + pxdesc->defcnt)) && ok; i++) { - if (i >= pxdesc->acccnt) { - flags = INHERIT_ONLY_ACE - | OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE; - pset = &aceset[1]; - pxace = &pxdesc->acl.ace[i + pxdesc->firstdef - pxdesc->acccnt]; - } else { - if (pxdesc->defcnt) - flags = NO_PROPAGATE_INHERIT_ACE; - else - flags = (isdir ? DIR_INHERITANCE - : FILE_INHERITANCE); - pset = &aceset[0]; - pxace = &pxdesc->acl.ace[i]; - } - tag = pxace->tag; - perms = pxace->perms; - switch (tag) { - - /* ACE for each owner or allowed user */ - - case POSIX_ACL_USER : - case POSIX_ACL_USER_OBJ : - ok = build_user_grants(pacl,usid, - mapping,flags,pxace,pset); - break; - - case POSIX_ACL_GROUP : - case POSIX_ACL_GROUP_OBJ : - - /* denials and grants for groups */ - - ok = build_group_denials_grant(pacl,gsid, - mapping,flags,pxace,pset); - break; - - case POSIX_ACL_OTHER : - - /* grants for other users */ - - pos = le16_to_cpu(pacl->size); - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - grants = WORLD_RIGHTS; - if (isdir) { - if (perms & POSIX_PERM_X) - grants |= DIR_EXEC; - if (perms & POSIX_PERM_W) - grants |= DIR_WRITE; - if (perms & POSIX_PERM_R) - grants |= DIR_READ; - } else { - if (perms & POSIX_PERM_X) - grants |= FILE_EXEC; - if (perms & POSIX_PERM_W) - grants |= FILE_WRITE; - if (perms & POSIX_PERM_R) - grants |= FILE_READ; - } - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->flags = flags; - pgace->size = cpu_to_le16(wsidsz + 8); - pgace->mask = grants; - memcpy((char*)&pgace->sid, worldsid, wsidsz); - pos += wsidsz + 8; - acecnt = le16_to_cpu(pacl->ace_count) + 1; - pacl->ace_count = cpu_to_le16(acecnt); - pacl->size = cpu_to_le16(pos); - break; - } - } - - if (!ok) { - errno = EINVAL; - pos = 0; - } else { - /* an ACE for administrators */ - /* always full access */ - - pos = le16_to_cpu(pacl->size); - acecnt = le16_to_cpu(pacl->ace_count); - if (isdir) - flags = OBJECT_INHERIT_ACE - | CONTAINER_INHERIT_ACE; - else - flags = NO_PROPAGATE_INHERIT_ACE; - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->flags = flags; - pgace->size = cpu_to_le16(asidsz + 8); - grants = OWNER_RIGHTS | FILE_READ | FILE_WRITE | FILE_EXEC; - pgace->mask = grants; - memcpy((char*)&pgace->sid, adminsid, asidsz); - pos += asidsz + 8; - acecnt++; - - /* an ACE for system (needed ?) */ - /* always full access */ - - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->flags = flags; - pgace->size = cpu_to_le16(ssidsz + 8); - grants = OWNER_RIGHTS | FILE_READ | FILE_WRITE | FILE_EXEC; - pgace->mask = grants; - memcpy((char*)&pgace->sid, systemsid, ssidsz); - pos += ssidsz + 8; - acecnt++; - - /* a null ACE to hold special flags */ - /* using the same representation as cygwin */ - - if (mode & (S_ISVTX | S_ISGID | S_ISUID)) { - nsidsz = ntfs_sid_size(nullsid); - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->flags = NO_PROPAGATE_INHERIT_ACE; - pgace->size = cpu_to_le16(nsidsz + 8); - grants = const_cpu_to_le32(0); - if (mode & S_ISUID) - grants |= FILE_APPEND_DATA; - if (mode & S_ISGID) - grants |= FILE_WRITE_DATA; - if (mode & S_ISVTX) - grants |= FILE_READ_DATA; - pgace->mask = grants; - memcpy((char*)&pgace->sid, nullsid, nsidsz); - pos += nsidsz + 8; - acecnt++; - } - - /* fix ACL header */ - pacl->size = cpu_to_le16(pos); - pacl->ace_count = cpu_to_le16(acecnt); - } - return (ok ? pos : 0); -} - -#endif /* POSIXACLS */ - -static int buildacls(char *secattr, int offs, mode_t mode, int isdir, - const SID * usid, const SID * gsid) -{ - ACL *pacl; - ACCESS_ALLOWED_ACE *pgace; - ACCESS_ALLOWED_ACE *pdace; - BOOL adminowns; - BOOL groupowns; - ACE_FLAGS gflags; - int pos; - int acecnt; - int usidsz; - int gsidsz; - int wsidsz; - int asidsz; - int ssidsz; - int nsidsz; - le32 grants; - le32 denials; - - usidsz = ntfs_sid_size(usid); - gsidsz = ntfs_sid_size(gsid); - wsidsz = ntfs_sid_size(worldsid); - asidsz = ntfs_sid_size(adminsid); - ssidsz = ntfs_sid_size(systemsid); - adminowns = ntfs_same_sid(usid, adminsid) - || ntfs_same_sid(gsid, adminsid); - groupowns = !adminowns && ntfs_same_sid(usid, gsid); - - /* ACL header */ - pacl = (ACL*)&secattr[offs]; - pacl->revision = ACL_REVISION; - pacl->alignment1 = 0; - pacl->size = cpu_to_le16(sizeof(ACL) + usidsz + 8); - pacl->ace_count = const_cpu_to_le16(1); - pacl->alignment2 = const_cpu_to_le16(0); - pos = sizeof(ACL); - acecnt = 0; - - /* compute a grant ACE for owner */ - /* this ACE will be inserted after denial for owner */ - - grants = OWNER_RIGHTS; - if (isdir) { - gflags = DIR_INHERITANCE; - if (mode & S_IXUSR) - grants |= DIR_EXEC; - if (mode & S_IWUSR) - grants |= DIR_WRITE; - if (mode & S_IRUSR) - grants |= DIR_READ; - } else { - gflags = FILE_INHERITANCE; - if (mode & S_IXUSR) - grants |= FILE_EXEC; - if (mode & S_IWUSR) - grants |= FILE_WRITE; - if (mode & S_IRUSR) - grants |= FILE_READ; - } - - /* a possible ACE to deny owner what he/she would */ - /* induely get from administrator, group or world */ - /* unless owner is administrator or group */ - - denials = const_cpu_to_le32(0); - pdace = (ACCESS_DENIED_ACE*) &secattr[offs + pos]; - if (!adminowns) { - if (!groupowns) { - if (isdir) { - pdace->flags = DIR_INHERITANCE; - if (mode & (S_IXGRP | S_IXOTH)) - denials |= DIR_EXEC; - if (mode & (S_IWGRP | S_IWOTH)) - denials |= DIR_WRITE; - if (mode & (S_IRGRP | S_IROTH)) - denials |= DIR_READ; - } else { - pdace->flags = FILE_INHERITANCE; - if (mode & (S_IXGRP | S_IXOTH)) - denials |= FILE_EXEC; - if (mode & (S_IWGRP | S_IWOTH)) - denials |= FILE_WRITE; - if (mode & (S_IRGRP | S_IROTH)) - denials |= FILE_READ; - } - } else { - if (isdir) { - pdace->flags = DIR_INHERITANCE; - if ((mode & S_IXOTH) && !(mode & S_IXGRP)) - denials |= DIR_EXEC; - if ((mode & S_IWOTH) && !(mode & S_IWGRP)) - denials |= DIR_WRITE; - if ((mode & S_IROTH) && !(mode & S_IRGRP)) - denials |= DIR_READ; - } else { - pdace->flags = FILE_INHERITANCE; - if ((mode & S_IXOTH) && !(mode & S_IXGRP)) - denials |= FILE_EXEC; - if ((mode & S_IWOTH) && !(mode & S_IWGRP)) - denials |= FILE_WRITE; - if ((mode & S_IROTH) && !(mode & S_IRGRP)) - denials |= FILE_READ; - } - } - denials &= ~grants; - if (denials) { - pdace->type = ACCESS_DENIED_ACE_TYPE; - pdace->size = cpu_to_le16(usidsz + 8); - pdace->mask = denials; - memcpy((char*)&pdace->sid, usid, usidsz); - pos += usidsz + 8; - acecnt++; - } - } - /* - * for directories, a world execution denial - * inherited to plain files - */ - - if (isdir) { - pdace = (ACCESS_DENIED_ACE*) &secattr[offs + pos]; - pdace->type = ACCESS_DENIED_ACE_TYPE; - pdace->flags = INHERIT_ONLY_ACE | OBJECT_INHERIT_ACE; - pdace->size = cpu_to_le16(wsidsz + 8); - pdace->mask = FILE_EXEC; - memcpy((char*)&pdace->sid, worldsid, wsidsz); - pos += wsidsz + 8; - acecnt++; - } - - - /* now insert grants to owner */ - pgace = (ACCESS_ALLOWED_ACE*) &secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->size = cpu_to_le16(usidsz + 8); - pgace->flags = gflags; - pgace->mask = grants; - memcpy((char*)&pgace->sid, usid, usidsz); - pos += usidsz + 8; - acecnt++; - - /* a grant ACE for group */ - /* unless group has the same rights as world */ - /* but present if group is owner or owner is administrator */ - /* this ACE will be inserted after denials for group */ - - if (adminowns - || groupowns - || (((mode >> 3) ^ mode) & 7)) { - grants = WORLD_RIGHTS; - if (isdir) { - gflags = DIR_INHERITANCE; - if (mode & S_IXGRP) - grants |= DIR_EXEC; - if (mode & S_IWGRP) - grants |= DIR_WRITE; - if (mode & S_IRGRP) - grants |= DIR_READ; - } else { - gflags = FILE_INHERITANCE; - if (mode & S_IXGRP) - grants |= FILE_EXEC; - if (mode & S_IWGRP) - grants |= FILE_WRITE; - if (mode & S_IRGRP) - grants |= FILE_READ; - } - - /* a possible ACE to deny group what it would get from world */ - /* or administrator, unless owner is administrator or group */ - - denials = const_cpu_to_le32(0); - pdace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - if (!adminowns && !groupowns) { - if (isdir) { - pdace->flags = DIR_INHERITANCE; - if (mode & S_IXOTH) - denials |= DIR_EXEC; - if (mode & S_IWOTH) - denials |= DIR_WRITE; - if (mode & S_IROTH) - denials |= DIR_READ; - } else { - pdace->flags = FILE_INHERITANCE; - if (mode & S_IXOTH) - denials |= FILE_EXEC; - if (mode & S_IWOTH) - denials |= FILE_WRITE; - if (mode & S_IROTH) - denials |= FILE_READ; - } - denials &= ~(grants | OWNER_RIGHTS); - if (denials) { - pdace->type = ACCESS_DENIED_ACE_TYPE; - pdace->size = cpu_to_le16(gsidsz + 8); - pdace->mask = denials; - memcpy((char*)&pdace->sid, gsid, gsidsz); - pos += gsidsz + 8; - acecnt++; - } - } - - if (adminowns - || groupowns - || ((mode >> 3) & ~mode & 7)) { - /* now insert grants to group */ - /* if more rights than other */ - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->flags = gflags; - pgace->size = cpu_to_le16(gsidsz + 8); - pgace->mask = grants; - memcpy((char*)&pgace->sid, gsid, gsidsz); - pos += gsidsz + 8; - acecnt++; - } - } - - /* an ACE for world users */ - - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - grants = WORLD_RIGHTS; - if (isdir) { - pgace->flags = DIR_INHERITANCE; - if (mode & S_IXOTH) - grants |= DIR_EXEC; - if (mode & S_IWOTH) - grants |= DIR_WRITE; - if (mode & S_IROTH) - grants |= DIR_READ; - } else { - pgace->flags = FILE_INHERITANCE; - if (mode & S_IXOTH) - grants |= FILE_EXEC; - if (mode & S_IWOTH) - grants |= FILE_WRITE; - if (mode & S_IROTH) - grants |= FILE_READ; - } - pgace->size = cpu_to_le16(wsidsz + 8); - pgace->mask = grants; - memcpy((char*)&pgace->sid, worldsid, wsidsz); - pos += wsidsz + 8; - acecnt++; - - /* an ACE for administrators */ - /* always full access */ - - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - if (isdir) - pgace->flags = DIR_INHERITANCE; - else - pgace->flags = FILE_INHERITANCE; - pgace->size = cpu_to_le16(asidsz + 8); - grants = OWNER_RIGHTS | FILE_READ | FILE_WRITE | FILE_EXEC; - pgace->mask = grants; - memcpy((char*)&pgace->sid, adminsid, asidsz); - pos += asidsz + 8; - acecnt++; - - /* an ACE for system (needed ?) */ - /* always full access */ - - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - if (isdir) - pgace->flags = DIR_INHERITANCE; - else - pgace->flags = FILE_INHERITANCE; - pgace->size = cpu_to_le16(ssidsz + 8); - grants = OWNER_RIGHTS | FILE_READ | FILE_WRITE | FILE_EXEC; - pgace->mask = grants; - memcpy((char*)&pgace->sid, systemsid, ssidsz); - pos += ssidsz + 8; - acecnt++; - - /* a null ACE to hold special flags */ - /* using the same representation as cygwin */ - - if (mode & (S_ISVTX | S_ISGID | S_ISUID)) { - nsidsz = ntfs_sid_size(nullsid); - pgace = (ACCESS_ALLOWED_ACE*)&secattr[offs + pos]; - pgace->type = ACCESS_ALLOWED_ACE_TYPE; - pgace->flags = NO_PROPAGATE_INHERIT_ACE; - pgace->size = cpu_to_le16(nsidsz + 8); - grants = const_cpu_to_le32(0); - if (mode & S_ISUID) - grants |= FILE_APPEND_DATA; - if (mode & S_ISGID) - grants |= FILE_WRITE_DATA; - if (mode & S_ISVTX) - grants |= FILE_READ_DATA; - pgace->mask = grants; - memcpy((char*)&pgace->sid, nullsid, nsidsz); - pos += nsidsz + 8; - acecnt++; - } - - /* fix ACL header */ - pacl->size = cpu_to_le16(pos); - pacl->ace_count = cpu_to_le16(acecnt); - return (pos); -} - -#if POSIXACLS - -/* - * Build a full security descriptor from a Posix ACL - * returns descriptor in allocated memory, must free() after use - */ - -char *ntfs_build_descr_posix(struct MAPPING* const mapping[], - struct POSIX_SECURITY *pxdesc, - int isdir, const SID *usid, const SID *gsid) -{ - int newattrsz; - SECURITY_DESCRIPTOR_RELATIVE *pnhead; - char *newattr; - int aclsz; - int usidsz; - int gsidsz; - int wsidsz; - int asidsz; - int ssidsz; - int k; - - usidsz = ntfs_sid_size(usid); - gsidsz = ntfs_sid_size(gsid); - wsidsz = ntfs_sid_size(worldsid); - asidsz = ntfs_sid_size(adminsid); - ssidsz = ntfs_sid_size(systemsid); - - /* allocate enough space for the new security attribute */ - newattrsz = sizeof(SECURITY_DESCRIPTOR_RELATIVE) /* header */ - + usidsz + gsidsz /* usid and gsid */ - + sizeof(ACL) /* acl header */ - + 2*(8 + usidsz) /* two possible ACE for user */ - + 3*(8 + gsidsz) /* three possible ACE for group and mask */ - + 8 + wsidsz /* one ACE for world */ - + 8 + asidsz /* one ACE for admin */ - + 8 + ssidsz; /* one ACE for system */ - if (isdir) /* a world denial for directories */ - newattrsz += 8 + wsidsz; - if (pxdesc->mode & 07000) /* a NULL ACE for special modes */ - newattrsz += 8 + ntfs_sid_size(nullsid); - /* account for non-owning users and groups */ - for (k=0; kacccnt; k++) { - if ((pxdesc->acl.ace[k].tag == POSIX_ACL_USER) - || (pxdesc->acl.ace[k].tag == POSIX_ACL_GROUP)) - newattrsz += 3*40; /* fixme : maximum size */ - } - /* account for default ACE's */ - newattrsz += 2*40*pxdesc->defcnt; /* fixme : maximum size */ - newattr = (char*)ntfs_malloc(newattrsz); - if (newattr) { - /* build the main header part */ - pnhead = (SECURITY_DESCRIPTOR_RELATIVE*)newattr; - pnhead->revision = SECURITY_DESCRIPTOR_REVISION; - pnhead->alignment = 0; - /* - * The flag SE_DACL_PROTECTED prevents the ACL - * to be changed in an inheritance after creation - */ - pnhead->control = SE_DACL_PRESENT | SE_DACL_PROTECTED - | SE_SELF_RELATIVE; - /* - * Windows prefers ACL first, do the same to - * get the same hash value and avoid duplication - */ - /* build permissions */ - aclsz = buildacls_posix(mapping,newattr, - sizeof(SECURITY_DESCRIPTOR_RELATIVE), - pxdesc, isdir, usid, gsid); - if (aclsz && ((int)(sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz + usidsz + gsidsz) <= newattrsz)) { - /* append usid and gsid */ - memcpy(&newattr[sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz], usid, usidsz); - memcpy(&newattr[sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz + usidsz], gsid, gsidsz); - /* positions of ACL, USID and GSID into header */ - pnhead->owner = - cpu_to_le32(sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz); - pnhead->group = - cpu_to_le32(sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz + usidsz); - pnhead->sacl = const_cpu_to_le32(0); - pnhead->dacl = - const_cpu_to_le32(sizeof(SECURITY_DESCRIPTOR_RELATIVE)); - } else { - /* ACL failure (errno set) or overflow */ - free(newattr); - newattr = (char*)NULL; - if (aclsz) { - /* hope error was detected before overflowing */ - ntfs_log_error("Security descriptor is longer than expected\n"); - errno = EIO; - } - } - } else - errno = ENOMEM; - return (newattr); -} - -#endif /* POSIXACLS */ - -/* - * Build a full security descriptor - * returns descriptor in allocated memory, must free() after use - */ - -char *ntfs_build_descr(mode_t mode, - int isdir, const SID * usid, const SID * gsid) -{ - int newattrsz; - SECURITY_DESCRIPTOR_RELATIVE *pnhead; - char *newattr; - int aclsz; - int usidsz; - int gsidsz; - int wsidsz; - int asidsz; - int ssidsz; - - usidsz = ntfs_sid_size(usid); - gsidsz = ntfs_sid_size(gsid); - wsidsz = ntfs_sid_size(worldsid); - asidsz = ntfs_sid_size(adminsid); - ssidsz = ntfs_sid_size(systemsid); - - /* allocate enough space for the new security attribute */ - newattrsz = sizeof(SECURITY_DESCRIPTOR_RELATIVE) /* header */ - + usidsz + gsidsz /* usid and gsid */ - + sizeof(ACL) /* acl header */ - + 2*(8 + usidsz) /* two possible ACE for user */ - + 2*(8 + gsidsz) /* two possible ACE for group */ - + 8 + wsidsz /* one ACE for world */ - + 8 + asidsz /* one ACE for admin */ - + 8 + ssidsz; /* one ACE for system */ - if (isdir) /* a world denial for directories */ - newattrsz += 8 + wsidsz; - if (mode & 07000) /* a NULL ACE for special modes */ - newattrsz += 8 + ntfs_sid_size(nullsid); - newattr = (char*)ntfs_malloc(newattrsz); - if (newattr) { - /* build the main header part */ - pnhead = (SECURITY_DESCRIPTOR_RELATIVE*) newattr; - pnhead->revision = SECURITY_DESCRIPTOR_REVISION; - pnhead->alignment = 0; - /* - * The flag SE_DACL_PROTECTED prevents the ACL - * to be changed in an inheritance after creation - */ - pnhead->control = SE_DACL_PRESENT | SE_DACL_PROTECTED - | SE_SELF_RELATIVE; - /* - * Windows prefers ACL first, do the same to - * get the same hash value and avoid duplication - */ - /* build permissions */ - aclsz = buildacls(newattr, - sizeof(SECURITY_DESCRIPTOR_RELATIVE), - mode, isdir, usid, gsid); - if (((int)sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz + usidsz + gsidsz) <= newattrsz) { - /* append usid and gsid */ - memcpy(&newattr[sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz], usid, usidsz); - memcpy(&newattr[sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz + usidsz], gsid, gsidsz); - /* positions of ACL, USID and GSID into header */ - pnhead->owner = - cpu_to_le32(sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz); - pnhead->group = - cpu_to_le32(sizeof(SECURITY_DESCRIPTOR_RELATIVE) - + aclsz + usidsz); - pnhead->sacl = const_cpu_to_le32(0); - pnhead->dacl = - const_cpu_to_le32(sizeof(SECURITY_DESCRIPTOR_RELATIVE)); - } else { - /* hope error was detected before overflowing */ - free(newattr); - newattr = (char*)NULL; - ntfs_log_error("Security descriptor is longer than expected\n"); - errno = EIO; - } - } else - errno = ENOMEM; - return (newattr); -} - -/* - * Create a mode_t permission set - * from owner, group and world grants as represented in ACEs - */ - -static int merge_permissions(BOOL isdir, - le32 owner, le32 group, le32 world, le32 special) - -{ - int perm; - - perm = 0; - /* build owner permission */ - if (owner) { - if (isdir) { - /* exec if any of list, traverse */ - if (owner & DIR_GEXEC) - perm |= S_IXUSR; - /* write if any of addfile, adddir, delchild */ - if (owner & DIR_GWRITE) - perm |= S_IWUSR; - /* read if any of list */ - if (owner & DIR_GREAD) - perm |= S_IRUSR; - } else { - /* exec if execute or generic execute */ - if (owner & FILE_GEXEC) - perm |= S_IXUSR; - /* write if any of writedata or generic write */ - if (owner & FILE_GWRITE) - perm |= S_IWUSR; - /* read if any of readdata or generic read */ - if (owner & FILE_GREAD) - perm |= S_IRUSR; - } - } - /* build group permission */ - if (group) { - if (isdir) { - /* exec if any of list, traverse */ - if (group & DIR_GEXEC) - perm |= S_IXGRP; - /* write if any of addfile, adddir, delchild */ - if (group & DIR_GWRITE) - perm |= S_IWGRP; - /* read if any of list */ - if (group & DIR_GREAD) - perm |= S_IRGRP; - } else { - /* exec if execute */ - if (group & FILE_GEXEC) - perm |= S_IXGRP; - /* write if any of writedata, appenddata */ - if (group & FILE_GWRITE) - perm |= S_IWGRP; - /* read if any of readdata */ - if (group & FILE_GREAD) - perm |= S_IRGRP; - } - } - /* build world permission */ - if (world) { - if (isdir) { - /* exec if any of list, traverse */ - if (world & DIR_GEXEC) - perm |= S_IXOTH; - /* write if any of addfile, adddir, delchild */ - if (world & DIR_GWRITE) - perm |= S_IWOTH; - /* read if any of list */ - if (world & DIR_GREAD) - perm |= S_IROTH; - } else { - /* exec if execute */ - if (world & FILE_GEXEC) - perm |= S_IXOTH; - /* write if any of writedata, appenddata */ - if (world & FILE_GWRITE) - perm |= S_IWOTH; - /* read if any of readdata */ - if (world & FILE_GREAD) - perm |= S_IROTH; - } - } - /* build special permission flags */ - if (special) { - if (special & FILE_APPEND_DATA) - perm |= S_ISUID; - if (special & FILE_WRITE_DATA) - perm |= S_ISGID; - if (special & FILE_READ_DATA) - perm |= S_ISVTX; - } - return (perm); -} - -#if POSIXACLS - -/* - * Normalize a Posix ACL either from a sorted raw set of - * access ACEs or default ACEs - * (standard case : different owner, group and administrator) - */ - -static int norm_std_permissions_posix(struct POSIX_SECURITY *posix_desc, - BOOL groupowns, int start, int count, int target) -{ - int j,k; - s32 id; - u16 tag; - u16 tagsset; - struct POSIX_ACE *pxace; - mode_t grantgrps; - mode_t grantwrld; - mode_t denywrld; - mode_t allow; - mode_t deny; - mode_t perms; - mode_t mode; - - mode = 0; - tagsset = 0; - /* - * Determine what is granted to some group or world - * Also get denials to world which are meant to prevent - * execution flags to be inherited by plain files - */ - pxace = posix_desc->acl.ace; - grantgrps = 0; - grantwrld = 0; - denywrld = 0; - for (j=start; j<(start + count); j++) { - if (pxace[j].perms & POSIX_PERM_DENIAL) { - /* deny world exec unless for default */ - if ((pxace[j].tag == POSIX_ACL_OTHER) - && !start) - denywrld = pxace[j].perms; - } else { - switch (pxace[j].tag) { - case POSIX_ACL_GROUP_OBJ : - grantgrps |= pxace[j].perms; - break; - case POSIX_ACL_GROUP : - if (pxace[j].id) - grantgrps |= pxace[j].perms; - break; - case POSIX_ACL_OTHER : - grantwrld = pxace[j].perms; - break; - default : - break; - } - } - } - /* - * Collect groups of ACEs related to the same id - * and determine what is granted and what is denied. - * It is important the ACEs have been sorted - */ - j = start; - k = target; - while (j < (start + count)) { - tag = pxace[j].tag; - id = pxace[j].id; - if (pxace[j].perms & POSIX_PERM_DENIAL) { - deny = pxace[j].perms | denywrld; - allow = 0; - } else { - deny = denywrld; - allow = pxace[j].perms; - } - j++; - while ((j < (start + count)) - && (pxace[j].tag == tag) - && (pxace[j].id == id)) { - if (pxace[j].perms & POSIX_PERM_DENIAL) - deny |= pxace[j].perms; - else - allow |= pxace[j].perms; - j++; - } - /* - * Build the permissions equivalent to grants and denials - */ - if (groupowns) { - if (tag == POSIX_ACL_MASK) - perms = ~deny; - else - perms = allow & ~deny; - } else - switch (tag) { - case POSIX_ACL_USER_OBJ : - perms = (allow | grantgrps | grantwrld) & ~deny; - break; - case POSIX_ACL_USER : - if (id) - perms = (allow | grantgrps | grantwrld) - & ~deny; - else - perms = allow; - break; - case POSIX_ACL_GROUP_OBJ : - perms = (allow | grantwrld) & ~deny; - break; - case POSIX_ACL_GROUP : - if (id) - perms = (allow | grantwrld) & ~deny; - else - perms = allow; - break; - case POSIX_ACL_MASK : - perms = ~deny; - break; - default : - perms = allow & ~deny; - break; - } - /* - * Store into a Posix ACE - */ - if (tag != POSIX_ACL_SPECIAL) { - pxace[k].tag = tag; - pxace[k].id = id; - pxace[k].perms = perms - & (POSIX_PERM_R | POSIX_PERM_W | POSIX_PERM_X); - tagsset |= tag; - k++; - } - switch (tag) { - case POSIX_ACL_USER_OBJ : - mode |= ((perms & 7) << 6); - break; - case POSIX_ACL_GROUP_OBJ : - case POSIX_ACL_MASK : - mode = (mode & 07707) | ((perms & 7) << 3); - break; - case POSIX_ACL_OTHER : - mode |= perms & 7; - break; - case POSIX_ACL_SPECIAL : - mode |= (perms & (S_ISVTX | S_ISUID | S_ISGID)); - break; - default : - break; - } - } - if (!start) { /* not satisfactory */ - posix_desc->mode = mode; - posix_desc->tagsset = tagsset; - } - return (k - target); -} - -#endif /* POSIXACLS */ - -/* - * Interpret an ACL and extract meaningful grants - * (standard case : different owner, group and administrator) - */ - -static int build_std_permissions(const char *securattr, - const SID *usid, const SID *gsid, BOOL isdir) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const ACL *pacl; - const ACCESS_ALLOWED_ACE *pace; - int offdacl; - int offace; - int acecnt; - int nace; - BOOL noown; - le32 special; - le32 allowown, allowgrp, allowall; - le32 denyown, denygrp, denyall; - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - offdacl = le32_to_cpu(phead->dacl); - pacl = (const ACL*)&securattr[offdacl]; - special = const_cpu_to_le32(0); - allowown = allowgrp = allowall = const_cpu_to_le32(0); - denyown = denygrp = denyall = const_cpu_to_le32(0); - noown = TRUE; - if (offdacl) { - acecnt = le16_to_cpu(pacl->ace_count); - offace = offdacl + sizeof(ACL); - } else { - acecnt = 0; - offace = 0; - } - for (nace = 0; nace < acecnt; nace++) { - pace = (const ACCESS_ALLOWED_ACE*)&securattr[offace]; - if (!(pace->flags & INHERIT_ONLY_ACE)) { - if (ntfs_same_sid(usid, &pace->sid) - || ntfs_same_sid(ownersid, &pace->sid)) { - noown = FALSE; - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) - allowown |= pace->mask; - else if (pace->type == ACCESS_DENIED_ACE_TYPE) - denyown |= pace->mask; - } else - if (ntfs_same_sid(gsid, &pace->sid) - && !(pace->mask & WRITE_OWNER)) { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) - allowgrp |= pace->mask; - else if (pace->type == ACCESS_DENIED_ACE_TYPE) - denygrp |= pace->mask; - } else - if (is_world_sid((const SID*)&pace->sid)) { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) - allowall |= pace->mask; - else - if (pace->type == ACCESS_DENIED_ACE_TYPE) - denyall |= pace->mask; - } else - if ((ntfs_same_sid((const SID*)&pace->sid,nullsid)) - && (pace->type == ACCESS_ALLOWED_ACE_TYPE)) - special |= pace->mask; - } - offace += le16_to_cpu(pace->size); - } - /* - * No indication about owner's rights : grant basic rights - * This happens for files created by Windows in directories - * created by Linux and owned by root, because Windows - * merges the admin ACEs - */ - if (noown) - allowown = (FILE_READ_DATA | FILE_WRITE_DATA | FILE_EXECUTE); - /* - * Add to owner rights granted to group or world - * unless denied personaly, and add to group rights - * granted to world unless denied specifically - */ - allowown |= (allowgrp | allowall); - allowgrp |= allowall; - return (merge_permissions(isdir, - allowown & ~(denyown | denyall), - allowgrp & ~(denygrp | denyall), - allowall & ~denyall, - special)); -} - -/* - * Interpret an ACL and extract meaningful grants - * (special case : owner and group are the same, - * and not administrator) - */ - -static int build_owngrp_permissions(const char *securattr, - const SID *usid, BOOL isdir) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const ACL *pacl; - const ACCESS_ALLOWED_ACE *pace; - int offdacl; - int offace; - int acecnt; - int nace; - le32 special; - BOOL grppresent; - le32 allowown, allowgrp, allowall; - le32 denyown, denygrp, denyall; - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - offdacl = le32_to_cpu(phead->dacl); - pacl = (const ACL*)&securattr[offdacl]; - special = const_cpu_to_le32(0); - allowown = allowgrp = allowall = const_cpu_to_le32(0); - denyown = denygrp = denyall = const_cpu_to_le32(0); - grppresent = FALSE; - if (offdacl) { - acecnt = le16_to_cpu(pacl->ace_count); - offace = offdacl + sizeof(ACL); - } else - acecnt = 0; - for (nace = 0; nace < acecnt; nace++) { - pace = (const ACCESS_ALLOWED_ACE*)&securattr[offace]; - if (!(pace->flags & INHERIT_ONLY_ACE)) { - if ((ntfs_same_sid(usid, &pace->sid) - || ntfs_same_sid(ownersid, &pace->sid)) - && (pace->mask & WRITE_OWNER)) { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) - allowown |= pace->mask; - } else - if (ntfs_same_sid(usid, &pace->sid) - && (!(pace->mask & WRITE_OWNER))) { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) { - allowgrp |= pace->mask; - grppresent = TRUE; - } - } else - if (is_world_sid((const SID*)&pace->sid)) { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) - allowall |= pace->mask; - else - if (pace->type == ACCESS_DENIED_ACE_TYPE) - denyall |= pace->mask; - } else - if ((ntfs_same_sid((const SID*)&pace->sid,nullsid)) - && (pace->type == ACCESS_ALLOWED_ACE_TYPE)) - special |= pace->mask; - } - offace += le16_to_cpu(pace->size); - } - if (!grppresent) - allowgrp = allowall; - return (merge_permissions(isdir, - allowown & ~(denyown | denyall), - allowgrp & ~(denygrp | denyall), - allowall & ~denyall, - special)); -} - -#if POSIXACLS - -/* - * Normalize a Posix ACL either from a sorted raw set of - * access ACEs or default ACEs - * (special case : owner or/and group is administrator) - */ - -static int norm_ownadmin_permissions_posix(struct POSIX_SECURITY *posix_desc, - int start, int count, int target) -{ - int j,k; - s32 id; - u16 tag; - u16 tagsset; - struct POSIX_ACE *pxace; - int acccnt; - mode_t denywrld; - mode_t allow; - mode_t deny; - mode_t perms; - mode_t mode; - - mode = 0; - pxace = posix_desc->acl.ace; - acccnt = posix_desc->acccnt; - tagsset = 0; - denywrld = 0; - /* - * Get denials to world which are meant to prevent - * execution flags to be inherited by plain files - */ - for (j=start; j<(start + count); j++) { - if (pxace[j].perms & POSIX_PERM_DENIAL) { - /* deny world exec not for default */ - if ((pxace[j].tag == POSIX_ACL_OTHER) - && !start) - denywrld = pxace[j].perms; - } - } - /* - * Collect groups of ACEs related to the same id - * and determine what is granted (denials are ignored) - * It is important the ACEs have been sorted - */ - j = start; - k = target; - deny = 0; - while (j < (start + count)) { - allow = 0; - tag = pxace[j].tag; - id = pxace[j].id; - if (tag == POSIX_ACL_MASK) { - deny = pxace[j].perms; - j++; - while ((j < (start + count)) - && (pxace[j].tag == POSIX_ACL_MASK)) - j++; - } else { - if (!(pxace[j].perms & POSIX_PERM_DENIAL)) - allow = pxace[j].perms; - j++; - while ((j < (start + count)) - && (pxace[j].tag == tag) - && (pxace[j].id == id)) { - if (!(pxace[j].perms & POSIX_PERM_DENIAL)) - allow |= pxace[j].perms; - j++; - } - } - - /* - * Store the grants into a Posix ACE - */ - if (tag == POSIX_ACL_MASK) - perms = ~deny; - else - perms = allow & ~denywrld; - if (tag != POSIX_ACL_SPECIAL) { - pxace[k].tag = tag; - pxace[k].id = id; - pxace[k].perms = perms - & (POSIX_PERM_R | POSIX_PERM_W | POSIX_PERM_X); - tagsset |= tag; - k++; - } - switch (tag) { - case POSIX_ACL_USER_OBJ : - mode |= ((perms & 7) << 6); - break; - case POSIX_ACL_GROUP_OBJ : - case POSIX_ACL_MASK : - mode = (mode & 07707) | ((perms & 7) << 3); - break; - case POSIX_ACL_OTHER : - mode |= perms & 7; - break; - case POSIX_ACL_SPECIAL : - mode |= perms & (S_ISVTX | S_ISUID | S_ISGID); - break; - default : - break; - } - } - if (!start) { /* not satisfactory */ - posix_desc->mode = mode; - posix_desc->tagsset = tagsset; - } - return (k - target); -} - -#endif /* POSIXACLS */ - -/* - * Interpret an ACL and extract meaningful grants - * (special case : owner or/and group is administrator) - */ - - -static int build_ownadmin_permissions(const char *securattr, - const SID *usid, const SID *gsid, BOOL isdir) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const ACL *pacl; - const ACCESS_ALLOWED_ACE *pace; - int offdacl; - int offace; - int acecnt; - int nace; - BOOL firstapply; - int isforeign; - le32 special; - le32 allowown, allowgrp, allowall; - le32 denyown, denygrp, denyall; - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - offdacl = le32_to_cpu(phead->dacl); - pacl = (const ACL*)&securattr[offdacl]; - special = const_cpu_to_le32(0); - allowown = allowgrp = allowall = const_cpu_to_le32(0); - denyown = denygrp = denyall = const_cpu_to_le32(0); - if (offdacl) { - acecnt = le16_to_cpu(pacl->ace_count); - offace = offdacl + sizeof(ACL); - } else { - acecnt = 0; - offace = 0; - } - firstapply = TRUE; - isforeign = 3; - for (nace = 0; nace < acecnt; nace++) { - pace = (const ACCESS_ALLOWED_ACE*)&securattr[offace]; - if (!(pace->flags & INHERIT_ONLY_ACE) - && !(~pace->mask & (ROOT_OWNER_UNMARK | ROOT_GROUP_UNMARK))) { - if ((ntfs_same_sid(usid, &pace->sid) - || ntfs_same_sid(ownersid, &pace->sid)) - && (((pace->mask & WRITE_OWNER) && firstapply))) { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) { - allowown |= pace->mask; - isforeign &= ~1; - } else - if (pace->type == ACCESS_DENIED_ACE_TYPE) - denyown |= pace->mask; - } else - if (ntfs_same_sid(gsid, &pace->sid) - && (!(pace->mask & WRITE_OWNER))) { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) { - allowgrp |= pace->mask; - isforeign &= ~2; - } else - if (pace->type == ACCESS_DENIED_ACE_TYPE) - denygrp |= pace->mask; - } else if (is_world_sid((const SID*)&pace->sid)) { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) - allowall |= pace->mask; - else - if (pace->type == ACCESS_DENIED_ACE_TYPE) - denyall |= pace->mask; - } - firstapply = FALSE; - } else - if (!(pace->flags & INHERIT_ONLY_ACE)) - if ((ntfs_same_sid((const SID*)&pace->sid,nullsid)) - && (pace->type == ACCESS_ALLOWED_ACE_TYPE)) - special |= pace->mask; - offace += le16_to_cpu(pace->size); - } - if (isforeign) { - allowown |= (allowgrp | allowall); - allowgrp |= allowall; - } - return (merge_permissions(isdir, - allowown & ~(denyown | denyall), - allowgrp & ~(denygrp | denyall), - allowall & ~denyall, - special)); -} - -#if OWNERFROMACL - -/* - * Define the owner of a file as the first user allowed - * to change the owner, instead of the user defined as owner. - * - * This produces better approximations for files written by a - * Windows user in an inheritable directory owned by another user, - * as the access rights are inheritable but the ownership is not. - * - * An important case is the directories "Documents and Settings/user" - * which the users must have access to, though Windows considers them - * as owned by administrator. - */ - -const SID *ntfs_acl_owner(const char *securattr) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const SID *usid; - const ACL *pacl; - const ACCESS_ALLOWED_ACE *pace; - int offdacl; - int offace; - int acecnt; - int nace; - BOOL found; - - found = FALSE; - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - offdacl = le32_to_cpu(phead->dacl); - if (offdacl) { - pacl = (const ACL*)&securattr[offdacl]; - acecnt = le16_to_cpu(pacl->ace_count); - offace = offdacl + sizeof(ACL); - nace = 0; - do { - pace = (const ACCESS_ALLOWED_ACE*)&securattr[offace]; - if ((pace->mask & WRITE_OWNER) - && (pace->type == ACCESS_ALLOWED_ACE_TYPE) - && ntfs_is_user_sid(&pace->sid)) - found = TRUE; - offace += le16_to_cpu(pace->size); - } while (!found && (++nace < acecnt)); - } - if (found) - usid = &pace->sid; - else - usid = (const SID*)&securattr[le32_to_cpu(phead->owner)]; - return (usid); -} - -#else - -/* - * Special case for files owned by administrator with full - * access granted to a mapped user : consider this user as the tenant - * of the file. - * - * This situation cannot be represented with Linux concepts and can - * only be found for files or directories created by Windows. - * Typical situation : directory "Documents and Settings/user" which - * is on the path to user's files and must be given access to user - * only. - * - * Check file is owned by administrator and no user has rights before - * calling. - * Returns the uid of tenant or zero if none - */ - - -static uid_t find_tenant(struct MAPPING *const mapping[], - const char *securattr) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const ACL *pacl; - const ACCESS_ALLOWED_ACE *pace; - int offdacl; - int offace; - int acecnt; - int nace; - uid_t tid; - uid_t xid; - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - offdacl = le32_to_cpu(phead->dacl); - pacl = (const ACL*)&securattr[offdacl]; - tid = 0; - if (offdacl) { - acecnt = le16_to_cpu(pacl->ace_count); - offace = offdacl + sizeof(ACL); - } else - acecnt = 0; - for (nace = 0; nace < acecnt; nace++) { - pace = (const ACCESS_ALLOWED_ACE*)&securattr[offace]; - if ((pace->type == ACCESS_ALLOWED_ACE_TYPE) - && (pace->mask & DIR_WRITE)) { - xid = NTFS_FIND_USER(mapping[MAPUSERS], &pace->sid); - if (xid) tid = xid; - } - offace += le16_to_cpu(pace->size); - } - return (tid); -} - -#endif /* OWNERFROMACL */ - -#if POSIXACLS - -/* - * Build Posix permissions from an ACL - * returns a pointer to the requested permissions - * or a null pointer (with errno set) if there is a problem - * - * If the NTFS ACL was created according to our rules, the retrieved - * Posix ACL should be the exact ACL which was set. However if - * the NTFS ACL was built by a different tool, the result could - * be a a poor approximation of what was expected - */ - -struct POSIX_SECURITY *ntfs_build_permissions_posix( - struct MAPPING *const mapping[], - const char *securattr, - const SID *usid, const SID *gsid, BOOL isdir) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - struct POSIX_SECURITY *pxdesc; - const ACL *pacl; - const ACCESS_ALLOWED_ACE *pace; - struct POSIX_ACE *pxace; - struct { - uid_t prevuid; - gid_t prevgid; - int groupmasks; - s16 tagsset; - BOOL gotowner; - BOOL gotownermask; - BOOL gotgroup; - mode_t permswrld; - } ctx[2], *pctx; - int offdacl; - int offace; - int alloccnt; - int acecnt; - uid_t uid; - gid_t gid; - int i,j; - int k,l; - BOOL ignore; - BOOL adminowns; - BOOL groupowns; - BOOL firstinh; - BOOL genericinh; - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - offdacl = le32_to_cpu(phead->dacl); - if (offdacl) { - pacl = (const ACL*)&securattr[offdacl]; - acecnt = le16_to_cpu(pacl->ace_count); - offace = offdacl + sizeof(ACL); - } else { - acecnt = 0; - offace = 0; - } - adminowns = FALSE; - groupowns = ntfs_same_sid(gsid,usid); - firstinh = FALSE; - genericinh = FALSE; - /* - * Build a raw posix security descriptor - * by just translating permissions and ids - * Add 2 to the count of ACE to be able to insert - * a group ACE later in access and default ACLs - * and add 2 more to be able to insert ACEs for owner - * and 2 more for other - */ - alloccnt = acecnt + 6; - pxdesc = (struct POSIX_SECURITY*)malloc( - sizeof(struct POSIX_SECURITY) - + alloccnt*sizeof(struct POSIX_ACE)); - k = 0; - l = alloccnt; - for (i=0; i<2; i++) { - pctx = &ctx[i]; - pctx->permswrld = 0; - pctx->prevuid = -1; - pctx->prevgid = -1; - pctx->groupmasks = 0; - pctx->tagsset = 0; - pctx->gotowner = FALSE; - pctx->gotgroup = FALSE; - pctx->gotownermask = FALSE; - } - for (j=0; jflags & INHERIT_ONLY_ACE) { - pxace = &pxdesc->acl.ace[l - 1]; - pctx = &ctx[1]; - } else { - pxace = &pxdesc->acl.ace[k]; - pctx = &ctx[0]; - } - ignore = FALSE; - /* - * grants for root as a designated user or group - */ - if ((~pace->mask & (ROOT_OWNER_UNMARK | ROOT_GROUP_UNMARK)) - && (pace->type == ACCESS_ALLOWED_ACE_TYPE) - && ntfs_same_sid(&pace->sid, adminsid)) { - pxace->tag = (pace->mask & ROOT_OWNER_UNMARK ? POSIX_ACL_GROUP : POSIX_ACL_USER); - pxace->id = 0; - if ((pace->mask & (GENERIC_ALL | WRITE_OWNER)) - && (pace->flags & INHERIT_ONLY_ACE)) - ignore = genericinh = TRUE; - } else - if (ntfs_same_sid(usid, &pace->sid)) { - pxace->id = -1; - /* - * Owner has no write-owner right : - * a group was defined same as owner - * or admin was owner or group : - * denials are meant to owner - * and grants are meant to group - */ - if (!(pace->mask & (WRITE_OWNER | GENERIC_ALL)) - && (pace->type == ACCESS_ALLOWED_ACE_TYPE)) { - if (ntfs_same_sid(gsid,usid)) { - pxace->tag = POSIX_ACL_GROUP_OBJ; - pxace->id = -1; - } else { - if (ntfs_same_sid(&pace->sid,usid)) - groupowns = TRUE; - gid = NTFS_FIND_GROUP(mapping[MAPGROUPS],&pace->sid); - if (gid) { - pxace->tag = POSIX_ACL_GROUP; - pxace->id = gid; - pctx->prevgid = gid; - } else { - uid = NTFS_FIND_USER(mapping[MAPUSERS],&pace->sid); - if (uid) { - pxace->tag = POSIX_ACL_USER; - pxace->id = uid; - } else - ignore = TRUE; - } - } - } else { - /* - * when group owns, late denials for owner - * mean group mask - */ - if ((pace->type == ACCESS_DENIED_ACE_TYPE) - && (pace->mask & WRITE_OWNER)) { - pxace->tag = POSIX_ACL_MASK; - pctx->gotownermask = TRUE; - if (pctx->gotowner) - pctx->groupmasks++; - } else { - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) - pctx->gotowner = TRUE; - if (pctx->gotownermask && !pctx->gotowner) { - uid = NTFS_FIND_USER(mapping[MAPUSERS],&pace->sid); - pxace->id = uid; - pxace->tag = POSIX_ACL_USER; - } else - pxace->tag = POSIX_ACL_USER_OBJ; - /* system ignored, and admin */ - /* ignored at first position */ - if (pace->flags & INHERIT_ONLY_ACE) { - if ((firstinh && ntfs_same_sid(&pace->sid,adminsid)) - || ntfs_same_sid(&pace->sid,systemsid)) - ignore = TRUE; - if (!firstinh) { - firstinh = TRUE; - } - } else { - if ((adminowns && ntfs_same_sid(&pace->sid,adminsid)) - || ntfs_same_sid(&pace->sid,systemsid)) - ignore = TRUE; - if (ntfs_same_sid(usid,adminsid)) - adminowns = TRUE; - } - } - } - } else if (ntfs_same_sid(gsid, &pace->sid)) { - if ((pace->type == ACCESS_DENIED_ACE_TYPE) - && (pace->mask & WRITE_OWNER)) { - pxace->tag = POSIX_ACL_MASK; - pxace->id = -1; - if (pctx->gotowner) - pctx->groupmasks++; - } else { - if (pctx->gotgroup || (pctx->groupmasks > 1)) { - gid = NTFS_FIND_GROUP(mapping[MAPGROUPS],&pace->sid); - if (gid) { - pxace->id = gid; - pxace->tag = POSIX_ACL_GROUP; - pctx->prevgid = gid; - } else - ignore = TRUE; - } else { - pxace->id = -1; - pxace->tag = POSIX_ACL_GROUP_OBJ; - if (pace->type == ACCESS_ALLOWED_ACE_TYPE) - pctx->gotgroup = TRUE; - } - - if (ntfs_same_sid(gsid,adminsid) - || ntfs_same_sid(gsid,systemsid)) { - if (pace->mask & (WRITE_OWNER | GENERIC_ALL)) - ignore = TRUE; - if (ntfs_same_sid(gsid,adminsid)) - adminowns = TRUE; - else - genericinh = ignore; - } - } - } else if (is_world_sid((const SID*)&pace->sid)) { - pxace->id = -1; - pxace->tag = POSIX_ACL_OTHER; - if ((pace->type == ACCESS_DENIED_ACE_TYPE) - && (pace->flags & INHERIT_ONLY_ACE)) - ignore = TRUE; - } else if (ntfs_same_sid((const SID*)&pace->sid,nullsid)) { - pxace->id = -1; - pxace->tag = POSIX_ACL_SPECIAL; - } else { - uid = NTFS_FIND_USER(mapping[MAPUSERS],&pace->sid); - if (uid) { - if ((pace->type == ACCESS_DENIED_ACE_TYPE) - && (pace->mask & WRITE_OWNER) - && (pctx->prevuid != uid)) { - pxace->id = -1; - pxace->tag = POSIX_ACL_MASK; - } else { - pxace->id = uid; - pxace->tag = POSIX_ACL_USER; - } - pctx->prevuid = uid; - } else { - gid = NTFS_FIND_GROUP(mapping[MAPGROUPS],&pace->sid); - if (gid) { - if ((pace->type == ACCESS_DENIED_ACE_TYPE) - && (pace->mask & WRITE_OWNER) - && (pctx->prevgid != gid)) { - pxace->tag = POSIX_ACL_MASK; - pctx->groupmasks++; - } else { - pxace->tag = POSIX_ACL_GROUP; - } - pxace->id = gid; - pctx->prevgid = gid; - } else { - /* - * do not grant rights to unknown - * people and do not define root as a - * designated user or group - */ - ignore = TRUE; - } - } - } - if (!ignore) { - pxace->perms = 0; - /* specific decoding for vtx/uid/gid */ - if (pxace->tag == POSIX_ACL_SPECIAL) { - if (pace->mask & FILE_APPEND_DATA) - pxace->perms |= S_ISUID; - if (pace->mask & FILE_WRITE_DATA) - pxace->perms |= S_ISGID; - if (pace->mask & FILE_READ_DATA) - pxace->perms |= S_ISVTX; - } else - if (isdir) { - if (pace->mask & DIR_GEXEC) - pxace->perms |= POSIX_PERM_X; - if (pace->mask & DIR_GWRITE) - pxace->perms |= POSIX_PERM_W; - if (pace->mask & DIR_GREAD) - pxace->perms |= POSIX_PERM_R; - if ((pace->mask & GENERIC_ALL) - && (pace->flags & INHERIT_ONLY_ACE)) - pxace->perms |= POSIX_PERM_X - | POSIX_PERM_W - | POSIX_PERM_R; - } else { - if (pace->mask & FILE_GEXEC) - pxace->perms |= POSIX_PERM_X; - if (pace->mask & FILE_GWRITE) - pxace->perms |= POSIX_PERM_W; - if (pace->mask & FILE_GREAD) - pxace->perms |= POSIX_PERM_R; - } - - if (pace->type != ACCESS_ALLOWED_ACE_TYPE) - pxace->perms |= POSIX_PERM_DENIAL; - else - if (pxace->tag == POSIX_ACL_OTHER) - pctx->permswrld = pxace->perms; - pctx->tagsset |= pxace->tag; - if (pace->flags & INHERIT_ONLY_ACE) { - l--; - } else { - k++; - } - } - offace += le16_to_cpu(pace->size); - } - /* - * Create world perms if none (both lists) - */ - for (i=0; i<2; i++) - if ((genericinh || !i) - && !(ctx[i].tagsset & POSIX_ACL_OTHER)) { - if (i) - pxace = &pxdesc->acl.ace[--l]; - else - pxace = &pxdesc->acl.ace[k++]; - pxace->tag = POSIX_ACL_OTHER; - pxace->id = -1; - pxace->perms = 0; - ctx[i].tagsset |= POSIX_ACL_OTHER; - ctx[i].permswrld = 0; - } - /* - * Set basic owner perms if none (both lists) - * This happens for files created by Windows in directories - * created by Linux and owned by root, because Windows - * merges the admin ACEs - */ - for (i=0; i<2; i++) - if (!(ctx[i].tagsset & POSIX_ACL_USER_OBJ) - && (ctx[i].tagsset & POSIX_ACL_OTHER)) { - if (i) - pxace = &pxdesc->acl.ace[--l]; - else - pxace = &pxdesc->acl.ace[k++]; - pxace->tag = POSIX_ACL_USER_OBJ; - pxace->id = -1; - pxace->perms = POSIX_PERM_R | POSIX_PERM_W | POSIX_PERM_X; - ctx[i].tagsset |= POSIX_ACL_USER_OBJ; - } - /* - * Duplicate world perms as group_obj perms if none - */ - for (i=0; i<2; i++) - if ((ctx[i].tagsset & POSIX_ACL_OTHER) - && !(ctx[i].tagsset & POSIX_ACL_GROUP_OBJ)) { - if (i) - pxace = &pxdesc->acl.ace[--l]; - else - pxace = &pxdesc->acl.ace[k++]; - pxace->tag = POSIX_ACL_GROUP_OBJ; - pxace->id = -1; - pxace->perms = ctx[i].permswrld; - ctx[i].tagsset |= POSIX_ACL_GROUP_OBJ; - } - /* - * Also duplicate world perms as group perms if they - * were converted to mask and not followed by a group entry - */ - if (ctx[0].groupmasks) { - for (j=k-2; j>=0; j--) { - if ((pxdesc->acl.ace[j].tag == POSIX_ACL_MASK) - && (pxdesc->acl.ace[j].id != -1) - && ((pxdesc->acl.ace[j+1].tag != POSIX_ACL_GROUP) - || (pxdesc->acl.ace[j+1].id - != pxdesc->acl.ace[j].id))) { - pxace = &pxdesc->acl.ace[k]; - pxace->tag = POSIX_ACL_GROUP; - pxace->id = pxdesc->acl.ace[j].id; - pxace->perms = ctx[0].permswrld; - ctx[0].tagsset |= POSIX_ACL_GROUP; - k++; - } - if (pxdesc->acl.ace[j].tag == POSIX_ACL_MASK) - pxdesc->acl.ace[j].id = -1; - } - } - if (ctx[1].groupmasks) { - for (j=l; j<(alloccnt-1); j++) { - if ((pxdesc->acl.ace[j].tag == POSIX_ACL_MASK) - && (pxdesc->acl.ace[j].id != -1) - && ((pxdesc->acl.ace[j+1].tag != POSIX_ACL_GROUP) - || (pxdesc->acl.ace[j+1].id - != pxdesc->acl.ace[j].id))) { - pxace = &pxdesc->acl.ace[l - 1]; - pxace->tag = POSIX_ACL_GROUP; - pxace->id = pxdesc->acl.ace[j].id; - pxace->perms = ctx[1].permswrld; - ctx[1].tagsset |= POSIX_ACL_GROUP; - l--; - } - if (pxdesc->acl.ace[j].tag == POSIX_ACL_MASK) - pxdesc->acl.ace[j].id = -1; - } - } - - /* - * Insert default mask if none present and - * there are designated users or groups - * (the space for it has not beed used) - */ - for (i=0; i<2; i++) - if ((ctx[i].tagsset & (POSIX_ACL_USER | POSIX_ACL_GROUP)) - && !(ctx[i].tagsset & POSIX_ACL_MASK)) { - if (i) - pxace = &pxdesc->acl.ace[--l]; - else - pxace = &pxdesc->acl.ace[k++]; - pxace->tag = POSIX_ACL_MASK; - pxace->id = -1; - pxace->perms = POSIX_PERM_DENIAL; - ctx[i].tagsset |= POSIX_ACL_MASK; - } - - if (k > l) { - ntfs_log_error("Posix descriptor is longer than expected\n"); - errno = EIO; - free(pxdesc); - pxdesc = (struct POSIX_SECURITY*)NULL; - } else { - pxdesc->acccnt = k; - pxdesc->defcnt = alloccnt - l; - pxdesc->firstdef = l; - pxdesc->tagsset = ctx[0].tagsset; - pxdesc->acl.version = POSIX_VERSION; - pxdesc->acl.flags = 0; - pxdesc->acl.filler = 0; - ntfs_sort_posix(pxdesc); - if (adminowns) { - k = norm_ownadmin_permissions_posix(pxdesc, - 0, pxdesc->acccnt, 0); - pxdesc->acccnt = k; - l = norm_ownadmin_permissions_posix(pxdesc, - pxdesc->firstdef, pxdesc->defcnt, k); - pxdesc->firstdef = k; - pxdesc->defcnt = l; - } else { - k = norm_std_permissions_posix(pxdesc,groupowns, - 0, pxdesc->acccnt, 0); - pxdesc->acccnt = k; - l = norm_std_permissions_posix(pxdesc,groupowns, - pxdesc->firstdef, pxdesc->defcnt, k); - pxdesc->firstdef = k; - pxdesc->defcnt = l; - } - } - if (pxdesc && !ntfs_valid_posix(pxdesc)) { - ntfs_log_error("Invalid Posix descriptor built\n"); - errno = EIO; - free(pxdesc); - pxdesc = (struct POSIX_SECURITY*)NULL; - } - return (pxdesc); -} - -#endif /* POSIXACLS */ - -/* - * Build unix-style (mode_t) permissions from an ACL - * returns the requested permissions - * or a negative result (with errno set) if there is a problem - */ - -int ntfs_build_permissions(const char *securattr, - const SID *usid, const SID *gsid, BOOL isdir) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - int perm; - BOOL adminowns; - BOOL groupowns; - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - adminowns = ntfs_same_sid(usid,adminsid) - || ntfs_same_sid(gsid,adminsid); - groupowns = !adminowns && ntfs_same_sid(gsid,usid); - if (adminowns) - perm = build_ownadmin_permissions(securattr, usid, gsid, isdir); - else - if (groupowns) - perm = build_owngrp_permissions(securattr, usid, isdir); - else - perm = build_std_permissions(securattr, usid, gsid, isdir); - return (perm); -} - -/* - * The following must be in some library... - */ - -static unsigned long atoul(const char *p) -{ /* must be somewhere ! */ - unsigned long v; - - v = 0; - while ((*p >= '0') && (*p <= '9')) - v = v * 10 + (*p++) - '0'; - return (v); -} - -/* - * Build an internal representation of a SID - * Returns a copy in allocated memory if it succeeds - * The SID is checked to be a valid user one. - */ - -static SID *encodesid(const char *sidstr) -{ - SID *sid; - int cnt; - BIGSID bigsid; - SID *bsid; - u32 auth; - const char *p; - - sid = (SID*) NULL; - if (!strncmp(sidstr, "S-1-", 4)) { - bsid = (SID*)&bigsid; - bsid->revision = SID_REVISION; - p = &sidstr[4]; - auth = atoul(p); - bsid->identifier_authority.high_part = const_cpu_to_be16(0); - bsid->identifier_authority.low_part = cpu_to_be32(auth); - cnt = 0; - p = strchr(p, '-'); - while (p && (cnt < 8)) { - p++; - auth = atoul(p); - bsid->sub_authority[cnt] = cpu_to_le32(auth); - p = strchr(p, '-'); - cnt++; - } - bsid->sub_authority_count = cnt; - if ((cnt > 0) && ntfs_valid_sid(bsid) && ntfs_is_user_sid(bsid)) { - sid = (SID*) ntfs_malloc(4 * cnt + 8); - if (sid) - memcpy(sid, bsid, 4 * cnt + 8); - } - } - return (sid); -} - -/* - * Early logging before the logs are redirected - * - * (not quite satisfactory : this appears before the ntfs-g banner, - * and with a different pid) - */ - -static void log_early_error(const char *format, ...) - __attribute__((format(printf, 1, 2))); - -static void log_early_error(const char *format, ...) -{ - va_list args; - - va_start(args, format); -#ifdef HAVE_SYSLOG_H - openlog("ntfs-3g", LOG_PID, LOG_USER); - ntfs_log_handler_syslog(NULL, NULL, 0, - NTFS_LOG_LEVEL_ERROR, NULL, - format, args); -#else - vfprintf(stderr,format,args); -#endif - va_end(args); -} - - -/* - * Get a single mapping item from buffer - * - * Always reads a full line, truncating long lines - * Refills buffer when exhausted - * Returns pointer to item, or NULL when there is no more - */ - -static struct MAPLIST *getmappingitem(FILEREADER reader, void *fileid, - off_t *poffs, char *buf, int *psrc, s64 *psize) -{ - int src; - int dst; - char *p; - char *q; - char *pu; - char *pg; - int gotend; - struct MAPLIST *item; - - src = *psrc; - dst = 0; - /* allocate and get a full line */ - item = (struct MAPLIST*)ntfs_malloc(sizeof(struct MAPLIST)); - if (item) { - do { - gotend = 0; - while ((src < *psize) - && (buf[src] != '\n')) { - if (dst < LINESZ) - item->maptext[dst++] = buf[src]; - src++; - } - if (src >= *psize) { - *poffs += *psize; - *psize = reader(fileid, buf, (size_t)BUFSZ, *poffs); - src = 0; - } else { - gotend = 1; - src++; - item->maptext[dst] = '\0'; - dst = 0; - } - } while (*psize && ((item->maptext[0] == '#') || !gotend)); - if (gotend) { - pu = pg = (char*)NULL; - /* decompose into uid, gid and sid */ - p = item->maptext; - item->uidstr = item->maptext; - item->gidstr = strchr(item->uidstr, ':'); - if (item->gidstr) { - pu = item->gidstr++; - item->sidstr = strchr(item->gidstr, ':'); - if (item->sidstr) { - pg = item->sidstr++; - q = strchr(item->sidstr, ':'); - if (q) *q = 0; - } - } - if (pu && pg) - *pu = *pg = '\0'; - else { - log_early_error("Bad mapping item \"%s\"\n", - item->maptext); - free(item); - item = (struct MAPLIST*)NULL; - } - } else { - free(item); /* free unused item */ - item = (struct MAPLIST*)NULL; - } - } - *psrc = src; - return (item); -} - -/* - * Read user mapping file and split into their attribute. - * Parameters are kept as text in a chained list until logins - * are converted to uid. - * Returns the head of list, if any - * - * If an absolute path is provided, the mapping file is assumed - * to be located in another mounted file system, and plain read() - * are used to get its contents. - * If a relative path is provided, the mapping file is assumed - * to be located on the current file system, and internal IO - * have to be used since we are still mounting and we have not - * entered the fuse loop yet. - */ - -struct MAPLIST *ntfs_read_mapping(FILEREADER reader, void *fileid) -{ - char buf[BUFSZ]; - struct MAPLIST *item; - struct MAPLIST *firstitem; - struct MAPLIST *lastitem; - int src; - off_t offs; - s64 size; - - firstitem = (struct MAPLIST*)NULL; - lastitem = (struct MAPLIST*)NULL; - offs = 0; - size = reader(fileid, buf, (size_t)BUFSZ, (off_t)0); - if (size > 0) { - src = 0; - do { - item = getmappingitem(reader, fileid, &offs, - buf, &src, &size); - if (item) { - item->next = (struct MAPLIST*)NULL; - if (lastitem) - lastitem->next = item; - else - firstitem = item; - lastitem = item; - } - } while (item); - } - return (firstitem); -} - -/* - * Free memory used to store the user mapping - * The only purpose is to facilitate the detection of memory leaks - */ - -void ntfs_free_mapping(struct MAPPING *mapping[]) -{ - struct MAPPING *user; - struct MAPPING *group; - - /* free user mappings */ - while (mapping[MAPUSERS]) { - user = mapping[MAPUSERS]; - /* do not free SIDs used for group mappings */ - group = mapping[MAPGROUPS]; - while (group && (group->sid != user->sid)) - group = group->next; - if (!group) - free(user->sid); - /* free group list if any */ - if (user->grcnt) - free(user->groups); - /* unchain item and free */ - mapping[MAPUSERS] = user->next; - free(user); - } - /* free group mappings */ - while (mapping[MAPGROUPS]) { - group = mapping[MAPGROUPS]; - free(group->sid); - /* unchain item and free */ - mapping[MAPGROUPS] = group->next; - free(group); - } -} - - -/* - * Build the user mapping list - * user identification may be given in symbolic or numeric format - * - * ! Note ! : does getpwnam() read /etc/passwd or some other file ? - * if so there is a possible recursion into fuse if this - * file is on NTFS, and fuse is not recursion safe. - */ - -struct MAPPING *ntfs_do_user_mapping(struct MAPLIST *firstitem) -{ - struct MAPLIST *item; - struct MAPPING *firstmapping; - struct MAPPING *lastmapping; - struct MAPPING *mapping; - struct passwd *pwd; - SID *sid; - int uid; - - firstmapping = (struct MAPPING*)NULL; - lastmapping = (struct MAPPING*)NULL; - for (item = firstitem; item; item = item->next) { - if ((item->uidstr[0] >= '0') && (item->uidstr[0] <= '9')) - uid = atoi(item->uidstr); - else { - uid = 0; - if (item->uidstr[0]) { - pwd = getpwnam(item->uidstr); - if (pwd) - uid = pwd->pw_uid; - else - log_early_error("Invalid user \"%s\"\n", - item->uidstr); - } - } - /* - * Records with no uid and no gid are inserted - * to define the implicit mapping pattern - */ - if (uid - || (!item->uidstr[0] && !item->gidstr[0])) { - sid = encodesid(item->sidstr); - if (sid && !item->uidstr[0] && !item->gidstr[0] - && !ntfs_valid_pattern(sid)) { - ntfs_log_error("Bad implicit SID pattern %s\n", - item->sidstr); - sid = (SID*)NULL; - } - if (sid) { - mapping = - (struct MAPPING*) - ntfs_malloc(sizeof(struct MAPPING)); - if (mapping) { - mapping->sid = sid; - mapping->xid = uid; - mapping->grcnt = 0; - mapping->next = (struct MAPPING*)NULL; - if (lastmapping) - lastmapping->next = mapping; - else - firstmapping = mapping; - lastmapping = mapping; - } - } - } - } - return (firstmapping); -} - -/* - * Build the group mapping list - * group identification may be given in symbolic or numeric format - * - * gid not associated to a uid are processed first in order - * to favour real groups - * - * ! Note ! : does getgrnam() read /etc/group or some other file ? - * if so there is a possible recursion into fuse if this - * file is on NTFS, and fuse is not recursion safe. - */ - -struct MAPPING *ntfs_do_group_mapping(struct MAPLIST *firstitem) -{ - struct MAPLIST *item; - struct MAPPING *firstmapping; - struct MAPPING *lastmapping; - struct MAPPING *mapping; - struct group *grp; - BOOL secondstep; - BOOL ok; - int step; - SID *sid; - int gid; - - firstmapping = (struct MAPPING*)NULL; - lastmapping = (struct MAPPING*)NULL; - for (step=1; step<=2; step++) { - for (item = firstitem; item; item = item->next) { - secondstep = (item->uidstr[0] != '\0') - || !item->gidstr[0]; - ok = (step == 1 ? !secondstep : secondstep); - if ((item->gidstr[0] >= '0') - && (item->gidstr[0] <= '9')) - gid = atoi(item->gidstr); - else { - gid = 0; - if (item->gidstr[0]) { - grp = getgrnam(item->gidstr); - if (grp) - gid = grp->gr_gid; - else - log_early_error("Invalid group \"%s\"\n", - item->gidstr); - } - } - /* - * Records with no uid and no gid are inserted in the - * second step to define the implicit mapping pattern - */ - if (ok - && (gid - || (!item->uidstr[0] && !item->gidstr[0]))) { - sid = encodesid(item->sidstr); - if (sid && !item->uidstr[0] && !item->gidstr[0] - && !ntfs_valid_pattern(sid)) { - /* error already logged */ - sid = (SID*)NULL; - } - if (sid) { - mapping = (struct MAPPING*) - ntfs_malloc(sizeof(struct MAPPING)); - if (mapping) { - mapping->sid = sid; - mapping->xid = gid; - mapping->grcnt = 0; - mapping->next = (struct MAPPING*)NULL; - if (lastmapping) - lastmapping->next = mapping; - else - firstmapping = mapping; - lastmapping = mapping; - } - } - } - } - } - return (firstmapping); -} diff --git a/source/libs/libntfs/acls.h b/source/libs/libntfs/acls.h deleted file mode 100644 index 8a83d32d..00000000 --- a/source/libs/libntfs/acls.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - * - * Copyright (c) 2007-2008 Jean-Pierre Andre - * - */ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef ACLS_H -#define ACLS_H - -/* - * JPA configuration modes for security.c / acls.c - * should be moved to some config file - */ - -#define BUFSZ 1024 /* buffer size to read mapping file */ -#define MAPPINGFILE ".NTFS-3G/UserMapping" /* default mapping file */ -#define LINESZ 120 /* maximum useful size of a mapping line */ -#define CACHE_PERMISSIONS_BITS 6 /* log2 of unitary allocation of permissions */ -#define CACHE_PERMISSIONS_SIZE 262144 /* max cacheable permissions */ - -/* - * JPA The following must be in some library... - * but did not found out where - */ - -#define endian_rev16(x) (((x >> 8) & 255) | ((x & 255) << 8)) -#define endian_rev32(x) (((x >> 24) & 255) | ((x >> 8) & 0xff00) \ - | ((x & 0xff00) << 8) | ((x & 255) << 24)) - -#define cpu_to_be16(x) endian_rev16(cpu_to_le16(x)) -#define cpu_to_be32(x) endian_rev32(cpu_to_le32(x)) - -/* - * Macro definitions needed to share code with secaudit - */ - -#define NTFS_FIND_USID(map,uid,buf) ntfs_find_usid(map,uid,buf) -#define NTFS_FIND_GSID(map,gid,buf) ntfs_find_gsid(map,gid,buf) -#define NTFS_FIND_USER(map,usid) ntfs_find_user(map,usid) -#define NTFS_FIND_GROUP(map,gsid) ntfs_find_group(map,gsid) - - -/* - * Matching of ntfs permissions to Linux permissions - * these constants are adapted to endianness - * when setting, set them all - * when checking, check one is present - */ - - /* flags which are set to mean exec, write or read */ - -#define FILE_READ (FILE_READ_DATA) -#define FILE_WRITE (FILE_WRITE_DATA | FILE_APPEND_DATA \ - | READ_CONTROL | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA) -#define FILE_EXEC (FILE_EXECUTE) -#define DIR_READ FILE_LIST_DIRECTORY -#define DIR_WRITE (FILE_ADD_FILE | FILE_ADD_SUBDIRECTORY | FILE_DELETE_CHILD \ - | READ_CONTROL | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA) -#define DIR_EXEC (FILE_TRAVERSE) - - /* flags tested for meaning exec, write or read */ - /* tests for write allow for interpretation of a sticky bit */ - -#define FILE_GREAD (FILE_READ_DATA | GENERIC_READ) -#define FILE_GWRITE (FILE_WRITE_DATA | FILE_APPEND_DATA | GENERIC_WRITE) -#define FILE_GEXEC (FILE_EXECUTE | GENERIC_EXECUTE) -#define DIR_GREAD (FILE_LIST_DIRECTORY | GENERIC_READ) -#define DIR_GWRITE (FILE_ADD_FILE | FILE_ADD_SUBDIRECTORY | GENERIC_WRITE) -#define DIR_GEXEC (FILE_TRAVERSE | GENERIC_EXECUTE) - - /* standard owner (and administrator) rights */ - -#define OWNER_RIGHTS (DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER \ - | SYNCHRONIZE \ - | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES \ - | FILE_READ_EA | FILE_WRITE_EA) - - /* standard world rights */ - -#define WORLD_RIGHTS (READ_CONTROL | FILE_READ_ATTRIBUTES | FILE_READ_EA \ - | SYNCHRONIZE) - - /* inheritance flags for files and directories */ - -#define FILE_INHERITANCE NO_PROPAGATE_INHERIT_ACE -#define DIR_INHERITANCE (OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE) - -/* - * To identify NTFS ACL meaning Posix ACL granted to root - * we use rights always granted to anybody, so they have no impact - * either on Windows or on Linux. - */ - -#define ROOT_OWNER_UNMARK SYNCHRONIZE /* ACL granted to root as owner */ -#define ROOT_GROUP_UNMARK FILE_READ_EA /* ACL granted to root as group */ - -/* - * A type large enough to hold any SID - */ - -typedef char BIGSID[40]; - -/* - * Struct to hold the input mapping file - * (private to this module) - */ - -struct MAPLIST { - struct MAPLIST *next; - char *uidstr; /* uid text from the same record */ - char *gidstr; /* gid text from the same record */ - char *sidstr; /* sid text from the same record */ - char maptext[LINESZ + 1]; -}; - -typedef int (*FILEREADER)(void *fileid, char *buf, size_t size, off_t pos); - -/* - * Constants defined in acls.c - */ - -extern const SID *adminsid; -extern const SID *worldsid; - -/* - * Functions defined in acls.c - */ - -BOOL ntfs_valid_descr(const char *securattr, unsigned int attrsz); -BOOL ntfs_valid_pattern(const SID *sid); -BOOL ntfs_valid_sid(const SID *sid); -BOOL ntfs_same_sid(const SID *first, const SID *second); - -BOOL ntfs_is_user_sid(const SID *usid); - - -int ntfs_sid_size(const SID * sid); -unsigned int ntfs_attr_size(const char *attr); - -const SID *ntfs_find_usid(const struct MAPPING *usermapping, - uid_t uid, SID *pdefsid); -const SID *ntfs_find_gsid(const struct MAPPING *groupmapping, - gid_t gid, SID *pdefsid); -uid_t ntfs_find_user(const struct MAPPING *usermapping, const SID *usid); -gid_t ntfs_find_group(const struct MAPPING *groupmapping, const SID * gsid); -const SID *ntfs_acl_owner(const char *secattr); - -#if POSIXACLS - -BOOL ntfs_valid_posix(const struct POSIX_SECURITY *pxdesc); -void ntfs_sort_posix(struct POSIX_SECURITY *pxdesc); -int ntfs_merge_mode_posix(struct POSIX_SECURITY *pxdesc, mode_t mode); -struct POSIX_SECURITY *ntfs_build_inherited_posix( - const struct POSIX_SECURITY *pxdesc, mode_t mode, - mode_t umask, BOOL isdir); -struct POSIX_SECURITY *ntfs_replace_acl(const struct POSIX_SECURITY *oldpxdesc, - const struct POSIX_ACL *newacl, int count, BOOL deflt); -struct POSIX_SECURITY *ntfs_build_permissions_posix( - struct MAPPING* const mapping[], - const char *securattr, - const SID *usid, const SID *gsid, BOOL isdir); -struct POSIX_SECURITY *ntfs_merge_descr_posix(const struct POSIX_SECURITY *first, - const struct POSIX_SECURITY *second); -char *ntfs_build_descr_posix(struct MAPPING* const mapping[], - struct POSIX_SECURITY *pxdesc, - int isdir, const SID *usid, const SID *gsid); - -#endif /* POSIXACLS */ - -int ntfs_inherit_acl(const ACL *oldacl, ACL *newacl, - const SID *usid, const SID *gsid, BOOL fordir); -int ntfs_build_permissions(const char *securattr, - const SID *usid, const SID *gsid, BOOL isdir); -char *ntfs_build_descr(mode_t mode, - int isdir, const SID * usid, const SID * gsid); -struct MAPLIST *ntfs_read_mapping(FILEREADER reader, void *fileid); -struct MAPPING *ntfs_do_user_mapping(struct MAPLIST *firstitem); -struct MAPPING *ntfs_do_group_mapping(struct MAPLIST *firstitem); -void ntfs_free_mapping(struct MAPPING *mapping[]); - -#endif /* ACLS_H */ - diff --git a/source/libs/libntfs/attrib.c b/source/libs/libntfs/attrib.c deleted file mode 100644 index 123c9a91..00000000 --- a/source/libs/libntfs/attrib.c +++ /dev/null @@ -1,6401 +0,0 @@ -/** - * attrib.c - Attribute handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2010 Anton Altaparmakov - * Copyright (c) 2002-2005 Richard Russon - * Copyright (c) 2002-2008 Szabolcs Szakacsits - * Copyright (c) 2004-2007 Yura Pakhuchiy - * Copyright (c) 2007-2010 Jean-Pierre Andre - * Copyright (c) 2010 Erik Larsson - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif - -#include "param.h" -#include "compat.h" -#include "attrib.h" -#include "attrlist.h" -#include "device.h" -#include "mft.h" -#include "debug.h" -#include "mst.h" -#include "volume.h" -#include "types.h" -#include "layout.h" -#include "inode.h" -#include "runlist.h" -#include "lcnalloc.h" -#include "dir.h" -#include "compress.h" -#include "bitmap.h" -#include "logging.h" -#include "misc.h" -#include "efs.h" - -ntfschar AT_UNNAMED[] = { const_cpu_to_le16('\0') }; -ntfschar STREAM_SDS[] = { const_cpu_to_le16('$'), - const_cpu_to_le16('S'), - const_cpu_to_le16('D'), - const_cpu_to_le16('S'), - const_cpu_to_le16('\0') }; - -ntfschar TXF_DATA[] = { const_cpu_to_le16('$'), - const_cpu_to_le16('T'), - const_cpu_to_le16('X'), - const_cpu_to_le16('F'), - const_cpu_to_le16('_'), - const_cpu_to_le16('D'), - const_cpu_to_le16('A'), - const_cpu_to_le16('T'), - const_cpu_to_le16('A'), - const_cpu_to_le16('\0') }; - -static int NAttrFlag(ntfs_attr *na, FILE_ATTR_FLAGS flag) -{ - if (na->type == AT_DATA && na->name == AT_UNNAMED) - return (na->ni->flags & flag); - return 0; -} - -static void NAttrSetFlag(ntfs_attr *na, FILE_ATTR_FLAGS flag) -{ - if (na->type == AT_DATA && na->name == AT_UNNAMED) - na->ni->flags |= flag; - else - ntfs_log_trace("Denied setting flag %d for not unnamed data " - "attribute\n", flag); -} - -static void NAttrClearFlag(ntfs_attr *na, FILE_ATTR_FLAGS flag) -{ - if (na->type == AT_DATA && na->name == AT_UNNAMED) - na->ni->flags &= ~flag; -} - -#define GenNAttrIno(func_name, flag) \ -int NAttr##func_name(ntfs_attr *na) { return NAttrFlag (na, flag); } \ -void NAttrSet##func_name(ntfs_attr *na) { NAttrSetFlag (na, flag); } \ -void NAttrClear##func_name(ntfs_attr *na){ NAttrClearFlag(na, flag); } - -GenNAttrIno(Compressed, FILE_ATTR_COMPRESSED) -GenNAttrIno(Encrypted, FILE_ATTR_ENCRYPTED) -GenNAttrIno(Sparse, FILE_ATTR_SPARSE_FILE) - -/** - * ntfs_get_attribute_value_length - Find the length of an attribute - * @a: - * - * Description... - * - * Returns: - */ -s64 ntfs_get_attribute_value_length(const ATTR_RECORD *a) -{ - if (!a) { - errno = EINVAL; - return 0; - } - errno = 0; - if (a->non_resident) - return sle64_to_cpu(a->data_size); - - return (s64)le32_to_cpu(a->value_length); -} - -/** - * ntfs_get_attribute_value - Get a copy of an attribute - * @vol: - * @a: - * @b: - * - * Description... - * - * Returns: - */ -s64 ntfs_get_attribute_value(const ntfs_volume *vol, - const ATTR_RECORD *a, u8 *b) -{ - runlist *rl; - s64 total, r; - int i; - - /* Sanity checks. */ - if (!vol || !a || !b) { - errno = EINVAL; - return 0; - } - /* Complex attribute? */ - /* - * Ignore the flags in case they are not zero for an attribute list - * attribute. Windows does not complain about invalid flags and chkdsk - * does not detect or fix them so we need to cope with it, too. - */ - if (a->type != AT_ATTRIBUTE_LIST && a->flags) { - ntfs_log_error("Non-zero (%04x) attribute flags. Cannot handle " - "this yet.\n", le16_to_cpu(a->flags)); - errno = EOPNOTSUPP; - return 0; - } - if (!a->non_resident) { - /* Attribute is resident. */ - - /* Sanity check. */ - if (le32_to_cpu(a->value_length) + le16_to_cpu(a->value_offset) - > le32_to_cpu(a->length)) { - return 0; - } - - memcpy(b, (const char*)a + le16_to_cpu(a->value_offset), - le32_to_cpu(a->value_length)); - errno = 0; - return (s64)le32_to_cpu(a->value_length); - } - - /* Attribute is not resident. */ - - /* If no data, return 0. */ - if (!(a->data_size)) { - errno = 0; - return 0; - } - /* - * FIXME: What about attribute lists?!? (AIA) - */ - /* Decompress the mapping pairs array into a runlist. */ - rl = ntfs_mapping_pairs_decompress(vol, a, NULL); - if (!rl) { - errno = EINVAL; - return 0; - } - /* - * FIXED: We were overflowing here in a nasty fashion when we - * reach the last cluster in the runlist as the buffer will - * only be big enough to hold data_size bytes while we are - * reading in allocated_size bytes which is usually larger - * than data_size, since the actual data is unlikely to have a - * size equal to a multiple of the cluster size! - * FIXED2: We were also overflowing here in the same fashion - * when the data_size was more than one run smaller than the - * allocated size which happens with Windows XP sometimes. - */ - /* Now load all clusters in the runlist into b. */ - for (i = 0, total = 0; rl[i].length; i++) { - if (total + (rl[i].length << vol->cluster_size_bits) >= - sle64_to_cpu(a->data_size)) { - unsigned char *intbuf = NULL; - /* - * We have reached the last run so we were going to - * overflow when executing the ntfs_pread() which is - * BAAAAAAAD! - * Temporary fix: - * Allocate a new buffer with size: - * rl[i].length << vol->cluster_size_bits, do the - * read into our buffer, then memcpy the correct - * amount of data into the caller supplied buffer, - * free our buffer, and continue. - * We have reached the end of data size so we were - * going to overflow in the same fashion. - * Temporary fix: same as above. - */ - intbuf = ntfs_malloc(rl[i].length << vol->cluster_size_bits); - if (!intbuf) { - free(rl); - return 0; - } - /* - * FIXME: If compressed file: Only read if lcn != -1. - * Otherwise, we are dealing with a sparse run and we - * just memset the user buffer to 0 for the length of - * the run, which should be 16 (= compression unit - * size). - * FIXME: Really only when file is compressed, or can - * we have sparse runs in uncompressed files as well? - * - Yes we can, in sparse files! But not necessarily - * size of 16, just run length. - */ - r = ntfs_pread(vol->dev, rl[i].lcn << - vol->cluster_size_bits, rl[i].length << - vol->cluster_size_bits, intbuf); - if (r != rl[i].length << vol->cluster_size_bits) { -#define ESTR "Error reading attribute value" - if (r == -1) - ntfs_log_perror(ESTR); - else if (r < rl[i].length << - vol->cluster_size_bits) { - ntfs_log_debug(ESTR ": Ran out of input data.\n"); - errno = EIO; - } else { - ntfs_log_debug(ESTR ": unknown error\n"); - errno = EIO; - } -#undef ESTR - free(rl); - free(intbuf); - return 0; - } - memcpy(b + total, intbuf, sle64_to_cpu(a->data_size) - - total); - free(intbuf); - total = sle64_to_cpu(a->data_size); - break; - } - /* - * FIXME: If compressed file: Only read if lcn != -1. - * Otherwise, we are dealing with a sparse run and we just - * memset the user buffer to 0 for the length of the run, which - * should be 16 (= compression unit size). - * FIXME: Really only when file is compressed, or can - * we have sparse runs in uncompressed files as well? - * - Yes we can, in sparse files! But not necessarily size of - * 16, just run length. - */ - r = ntfs_pread(vol->dev, rl[i].lcn << vol->cluster_size_bits, - rl[i].length << vol->cluster_size_bits, - b + total); - if (r != rl[i].length << vol->cluster_size_bits) { -#define ESTR "Error reading attribute value" - if (r == -1) - ntfs_log_perror(ESTR); - else if (r < rl[i].length << vol->cluster_size_bits) { - ntfs_log_debug(ESTR ": Ran out of input data.\n"); - errno = EIO; - } else { - ntfs_log_debug(ESTR ": unknown error\n"); - errno = EIO; - } -#undef ESTR - free(rl); - return 0; - } - total += r; - } - free(rl); - return total; -} - -/* Already cleaned up code below, but still look for FIXME:... */ - -/** - * __ntfs_attr_init - primary initialization of an ntfs attribute structure - * @na: ntfs attribute to initialize - * @ni: ntfs inode with which to initialize the ntfs attribute - * @type: attribute type - * @name: attribute name in little endian Unicode or NULL - * @name_len: length of attribute @name in Unicode characters (if @name given) - * - * Initialize the ntfs attribute @na with @ni, @type, @name, and @name_len. - */ -static void __ntfs_attr_init(ntfs_attr *na, ntfs_inode *ni, - const ATTR_TYPES type, ntfschar *name, const u32 name_len) -{ - na->rl = NULL; - na->ni = ni; - na->type = type; - na->name = name; - if (name) - na->name_len = name_len; - else - na->name_len = 0; -} - -/** - * ntfs_attr_init - initialize an ntfs_attr with data sizes and status - * @na: - * @non_resident: - * @compressed: - * @encrypted: - * @sparse: - * @allocated_size: - * @data_size: - * @initialized_size: - * @compressed_size: - * @compression_unit: - * - * Final initialization for an ntfs attribute. - */ -void ntfs_attr_init(ntfs_attr *na, const BOOL non_resident, - const ATTR_FLAGS data_flags, - const BOOL encrypted, const BOOL sparse, - const s64 allocated_size, const s64 data_size, - const s64 initialized_size, const s64 compressed_size, - const u8 compression_unit) -{ - if (!NAttrInitialized(na)) { - na->data_flags = data_flags; - if (non_resident) - NAttrSetNonResident(na); - if (data_flags & ATTR_COMPRESSION_MASK) - NAttrSetCompressed(na); - if (encrypted) - NAttrSetEncrypted(na); - if (sparse) - NAttrSetSparse(na); - na->allocated_size = allocated_size; - na->data_size = data_size; - na->initialized_size = initialized_size; - if ((data_flags & ATTR_COMPRESSION_MASK) || sparse) { - ntfs_volume *vol = na->ni->vol; - - na->compressed_size = compressed_size; - na->compression_block_clusters = 1 << compression_unit; - na->compression_block_size = 1 << (compression_unit + - vol->cluster_size_bits); - na->compression_block_size_bits = ffs( - na->compression_block_size) - 1; - } - NAttrSetInitialized(na); - } -} - -/** - * ntfs_attr_open - open an ntfs attribute for access - * @ni: open ntfs inode in which the ntfs attribute resides - * @type: attribute type - * @name: attribute name in little endian Unicode or AT_UNNAMED or NULL - * @name_len: length of attribute @name in Unicode characters (if @name given) - * - * Allocate a new ntfs attribute structure, initialize it with @ni, @type, - * @name, and @name_len, then return it. Return NULL on error with - * errno set to the error code. - * - * If @name is AT_UNNAMED look specifically for an unnamed attribute. If you - * do not care whether the attribute is named or not set @name to NULL. In - * both those cases @name_len is not used at all. - */ -ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type, - ntfschar *name, u32 name_len) -{ - ntfs_attr_search_ctx *ctx; - ntfs_attr *na = NULL; - ntfschar *newname = NULL; - ATTR_RECORD *a; - BOOL cs; - - ntfs_log_enter("Entering for inode %lld, attr 0x%x.\n", - (unsigned long long)ni->mft_no, type); - - if (!ni || !ni->vol || !ni->mrec) { - errno = EINVAL; - goto out; - } - na = ntfs_calloc(sizeof(ntfs_attr)); - if (!na) - goto out; - if (name && name != AT_UNNAMED && name != NTFS_INDEX_I30) { - name = ntfs_ucsndup(name, name_len); - if (!name) - goto err_out; - newname = name; - } - - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - goto err_out; - - if (ntfs_attr_lookup(type, name, name_len, 0, 0, NULL, 0, ctx)) - goto put_err_out; - - a = ctx->attr; - - if (!name) { - if (a->name_length) { - name = ntfs_ucsndup((ntfschar*)((u8*)a + le16_to_cpu( - a->name_offset)), a->name_length); - if (!name) - goto put_err_out; - newname = name; - name_len = a->name_length; - } else { - name = AT_UNNAMED; - name_len = 0; - } - } - - __ntfs_attr_init(na, ni, type, name, name_len); - - /* - * Wipe the flags in case they are not zero for an attribute list - * attribute. Windows does not complain about invalid flags and chkdsk - * does not detect or fix them so we need to cope with it, too. - */ - if (type == AT_ATTRIBUTE_LIST) - a->flags = 0; - - if ((type == AT_DATA) && !a->initialized_size) { - /* - * Define/redefine the compression state if stream is - * empty, based on the compression mark on parent - * directory (for unnamed data streams) or on current - * inode (for named data streams). The compression mark - * may change any time, the compression state can only - * change when stream is wiped out. - * - * Also prevent compression on NTFS version < 3.0 - * or cluster size > 4K or compression is disabled - */ - a->flags &= ~ATTR_COMPRESSION_MASK; - if ((ni->flags & FILE_ATTR_COMPRESSED) - && (ni->vol->major_ver >= 3) - && NVolCompression(ni->vol) - && (ni->vol->cluster_size <= MAX_COMPRESSION_CLUSTER_SIZE)) - a->flags |= ATTR_IS_COMPRESSED; - } - - cs = a->flags & (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE); - - if (na->type == AT_DATA && na->name == AT_UNNAMED && - ((!(a->flags & ATTR_IS_SPARSE) != !NAttrSparse(na)) || - (!(a->flags & ATTR_IS_ENCRYPTED) != !NAttrEncrypted(na)))) { - errno = EIO; - ntfs_log_perror("Inode %lld has corrupt attribute flags " - "(0x%x <> 0x%x)",(unsigned long long)ni->mft_no, - a->flags, na->ni->flags); - goto put_err_out; - } - - if (a->non_resident) { - if ((a->flags & ATTR_COMPRESSION_MASK) - && !a->compression_unit) { - errno = EIO; - ntfs_log_perror("Compressed inode %lld attr 0x%x has " - "no compression unit", - (unsigned long long)ni->mft_no, type); - goto put_err_out; - } - ntfs_attr_init(na, TRUE, a->flags, - a->flags & ATTR_IS_ENCRYPTED, - a->flags & ATTR_IS_SPARSE, - sle64_to_cpu(a->allocated_size), - sle64_to_cpu(a->data_size), - sle64_to_cpu(a->initialized_size), - cs ? sle64_to_cpu(a->compressed_size) : 0, - cs ? a->compression_unit : 0); - } else { - s64 l = le32_to_cpu(a->value_length); - ntfs_attr_init(na, FALSE, a->flags, - a->flags & ATTR_IS_ENCRYPTED, - a->flags & ATTR_IS_SPARSE, (l + 7) & ~7, l, l, - cs ? (l + 7) & ~7 : 0, 0); - } - ntfs_attr_put_search_ctx(ctx); -out: - ntfs_log_leave("\n"); - return na; - -put_err_out: - ntfs_attr_put_search_ctx(ctx); -err_out: - free(newname); - free(na); - na = NULL; - goto out; -} - -/** - * ntfs_attr_close - free an ntfs attribute structure - * @na: ntfs attribute structure to free - * - * Release all memory associated with the ntfs attribute @na and then release - * @na itself. - */ -void ntfs_attr_close(ntfs_attr *na) -{ - if (!na) - return; - if (NAttrNonResident(na) && na->rl) - free(na->rl); - /* Don't release if using an internal constant. */ - if (na->name != AT_UNNAMED && na->name != NTFS_INDEX_I30 - && na->name != STREAM_SDS) - free(na->name); - free(na); -} - -/** - * ntfs_attr_map_runlist - map (a part of) a runlist of an ntfs attribute - * @na: ntfs attribute for which to map (part of) a runlist - * @vcn: map runlist part containing this vcn - * - * Map the part of a runlist containing the @vcn of the ntfs attribute @na. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attr_map_runlist(ntfs_attr *na, VCN vcn) -{ - LCN lcn; - ntfs_attr_search_ctx *ctx; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, vcn 0x%llx.\n", - (unsigned long long)na->ni->mft_no, na->type, (long long)vcn); - - lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn); - if (lcn >= 0 || lcn == LCN_HOLE || lcn == LCN_ENOENT) - return 0; - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - - /* Find the attribute in the mft record. */ - if (!ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, - vcn, NULL, 0, ctx)) { - runlist_element *rl; - - /* Decode the runlist. */ - rl = ntfs_mapping_pairs_decompress(na->ni->vol, ctx->attr, - na->rl); - if (rl) { - na->rl = rl; - ntfs_attr_put_search_ctx(ctx); - return 0; - } - } - - ntfs_attr_put_search_ctx(ctx); - return -1; -} - -/** - * ntfs_attr_map_whole_runlist - map the whole runlist of an ntfs attribute - * @na: ntfs attribute for which to map the runlist - * - * Map the whole runlist of the ntfs attribute @na. For an attribute made up - * of only one attribute extent this is the same as calling - * ntfs_attr_map_runlist(na, 0) but for an attribute with multiple extents this - * will map the runlist fragments from each of the extents thus giving access - * to the entirety of the disk allocation of an attribute. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attr_map_whole_runlist(ntfs_attr *na) -{ - VCN next_vcn, last_vcn, highest_vcn; - ntfs_attr_search_ctx *ctx; - ntfs_volume *vol = na->ni->vol; - ATTR_RECORD *a; - int ret = -1; - - ntfs_log_enter("Entering for inode %llu, attr 0x%x.\n", - (unsigned long long)na->ni->mft_no, na->type); - - /* avoid multiple full runlist mappings */ - if (NAttrFullyMapped(na)) { - ret = 0; - goto out; - } - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - goto out; - - /* Map all attribute extents one by one. */ - next_vcn = last_vcn = highest_vcn = 0; - a = NULL; - while (1) { - runlist_element *rl; - - int not_mapped = 0; - if (ntfs_rl_vcn_to_lcn(na->rl, next_vcn) == LCN_RL_NOT_MAPPED) - not_mapped = 1; - - if (ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, next_vcn, NULL, 0, ctx)) - break; - - a = ctx->attr; - - if (not_mapped) { - /* Decode the runlist. */ - rl = ntfs_mapping_pairs_decompress(na->ni->vol, - a, na->rl); - if (!rl) - goto err_out; - na->rl = rl; - } - - /* Are we in the first extent? */ - if (!next_vcn) { - if (a->lowest_vcn) { - errno = EIO; - ntfs_log_perror("First extent of inode %llu " - "attribute has non-zero lowest_vcn", - (unsigned long long)na->ni->mft_no); - goto err_out; - } - /* Get the last vcn in the attribute. */ - last_vcn = sle64_to_cpu(a->allocated_size) >> - vol->cluster_size_bits; - } - - /* Get the lowest vcn for the next extent. */ - highest_vcn = sle64_to_cpu(a->highest_vcn); - next_vcn = highest_vcn + 1; - - /* Only one extent or error, which we catch below. */ - if (next_vcn <= 0) { - errno = ENOENT; - break; - } - - /* Avoid endless loops due to corruption. */ - if (next_vcn < sle64_to_cpu(a->lowest_vcn)) { - errno = EIO; - ntfs_log_perror("Inode %llu has corrupt attribute list", - (unsigned long long)na->ni->mft_no); - goto err_out; - } - } - if (!a) { - ntfs_log_perror("Couldn't find attribute for runlist mapping"); - goto err_out; - } - if (highest_vcn && highest_vcn != last_vcn - 1) { - errno = EIO; - ntfs_log_perror("Failed to load full runlist: inode: %llu " - "highest_vcn: 0x%llx last_vcn: 0x%llx", - (unsigned long long)na->ni->mft_no, - (long long)highest_vcn, (long long)last_vcn); - goto err_out; - } - if (errno == ENOENT) { - NAttrSetFullyMapped(na); - ret = 0; - } -err_out: - ntfs_attr_put_search_ctx(ctx); -out: - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_attr_vcn_to_lcn - convert a vcn into a lcn given an ntfs attribute - * @na: ntfs attribute whose runlist to use for conversion - * @vcn: vcn to convert - * - * Convert the virtual cluster number @vcn of an attribute into a logical - * cluster number (lcn) of a device using the runlist @na->rl to map vcns to - * their corresponding lcns. - * - * If the @vcn is not mapped yet, attempt to map the attribute extent - * containing the @vcn and retry the vcn to lcn conversion. - * - * Since lcns must be >= 0, we use negative return values with special meaning: - * - * Return value Meaning / Description - * ========================================== - * -1 = LCN_HOLE Hole / not allocated on disk. - * -3 = LCN_ENOENT There is no such vcn in the attribute. - * -4 = LCN_EINVAL Input parameter error. - * -5 = LCN_EIO Corrupt fs, disk i/o error, or not enough memory. - */ -LCN ntfs_attr_vcn_to_lcn(ntfs_attr *na, const VCN vcn) -{ - LCN lcn; - BOOL is_retry = FALSE; - - if (!na || !NAttrNonResident(na) || vcn < 0) - return (LCN)LCN_EINVAL; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long - long)na->ni->mft_no, na->type); -retry: - /* Convert vcn to lcn. If that fails map the runlist and retry once. */ - lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn); - if (lcn >= 0) - return lcn; - if (!is_retry && !ntfs_attr_map_runlist(na, vcn)) { - is_retry = TRUE; - goto retry; - } - /* - * If the attempt to map the runlist failed, or we are getting - * LCN_RL_NOT_MAPPED despite having mapped the attribute extent - * successfully, something is really badly wrong... - */ - if (!is_retry || lcn == (LCN)LCN_RL_NOT_MAPPED) - return (LCN)LCN_EIO; - /* lcn contains the appropriate error code. */ - return lcn; -} - -/** - * ntfs_attr_find_vcn - find a vcn in the runlist of an ntfs attribute - * @na: ntfs attribute whose runlist to search - * @vcn: vcn to find - * - * Find the virtual cluster number @vcn in the runlist of the ntfs attribute - * @na and return the the address of the runlist element containing the @vcn. - * - * Note you need to distinguish between the lcn of the returned runlist - * element being >= 0 and LCN_HOLE. In the later case you have to return zeroes - * on read and allocate clusters on write. You need to update the runlist, the - * attribute itself as well as write the modified mft record to disk. - * - * If there is an error return NULL with errno set to the error code. The - * following error codes are defined: - * EINVAL Input parameter error. - * ENOENT There is no such vcn in the runlist. - * ENOMEM Not enough memory. - * EIO I/O error or corrupt metadata. - */ -runlist_element *ntfs_attr_find_vcn(ntfs_attr *na, const VCN vcn) -{ - runlist_element *rl; - BOOL is_retry = FALSE; - - if (!na || !NAttrNonResident(na) || vcn < 0) { - errno = EINVAL; - return NULL; - } - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, vcn %llx\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)vcn); -retry: - rl = na->rl; - if (!rl) - goto map_rl; - if (vcn < rl[0].vcn) - goto map_rl; - while (rl->length) { - if (vcn < rl[1].vcn) { - if (rl->lcn >= (LCN)LCN_HOLE) - return rl; - break; - } - rl++; - } - switch (rl->lcn) { - case (LCN)LCN_RL_NOT_MAPPED: - goto map_rl; - case (LCN)LCN_ENOENT: - errno = ENOENT; - break; - case (LCN)LCN_EINVAL: - errno = EINVAL; - break; - default: - errno = EIO; - break; - } - return NULL; -map_rl: - /* The @vcn is in an unmapped region, map the runlist and retry. */ - if (!is_retry && !ntfs_attr_map_runlist(na, vcn)) { - is_retry = TRUE; - goto retry; - } - /* - * If we already retried or the mapping attempt failed something has - * gone badly wrong. EINVAL and ENOENT coming from a failed mapping - * attempt are equivalent to errors for us as they should not happen - * in our code paths. - */ - if (is_retry || errno == EINVAL || errno == ENOENT) - errno = EIO; - return NULL; -} - -/** - * ntfs_attr_pread_i - see description at ntfs_attr_pread() - */ -static s64 ntfs_attr_pread_i(ntfs_attr *na, const s64 pos, s64 count, void *b) -{ - s64 br, to_read, ofs, total, total2, max_read, max_init; - ntfs_volume *vol; - runlist_element *rl; - u16 efs_padding_length; - - /* Sanity checking arguments is done in ntfs_attr_pread(). */ - - if ((na->data_flags & ATTR_COMPRESSION_MASK) && NAttrNonResident(na)) { - if ((na->data_flags & ATTR_COMPRESSION_MASK) - == ATTR_IS_COMPRESSED) - return ntfs_compressed_attr_pread(na, pos, count, b); - else { - /* compression mode not supported */ - errno = EOPNOTSUPP; - return -1; - } - } - /* - * Encrypted non-resident attributes are not supported. We return - * access denied, which is what Windows NT4 does, too. - * However, allow if mounted with efs_raw option - */ - vol = na->ni->vol; - if (!vol->efs_raw && NAttrEncrypted(na) && NAttrNonResident(na)) { - errno = EACCES; - return -1; - } - - if (!count) - return 0; - /* - * Truncate reads beyond end of attribute, - * but round to next 512 byte boundary for encrypted - * attributes with efs_raw mount option - */ - max_read = na->data_size; - max_init = na->initialized_size; - if (na->ni->vol->efs_raw - && (na->data_flags & ATTR_IS_ENCRYPTED) - && NAttrNonResident(na)) { - if (na->data_size != na->initialized_size) { - ntfs_log_error("uninitialized encrypted file not supported\n"); - errno = EINVAL; - return -1; - } - max_init = max_read = ((na->data_size + 511) & ~511) + 2; - } - if (pos + count > max_read) { - if (pos >= max_read) - return 0; - count = max_read - pos; - } - /* If it is a resident attribute, get the value from the mft record. */ - if (!NAttrNonResident(na)) { - ntfs_attr_search_ctx *ctx; - char *val; - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, - 0, NULL, 0, ctx)) { -res_err_out: - ntfs_attr_put_search_ctx(ctx); - return -1; - } - val = (char*)ctx->attr + le16_to_cpu(ctx->attr->value_offset); - if (val < (char*)ctx->attr || val + - le32_to_cpu(ctx->attr->value_length) > - (char*)ctx->mrec + vol->mft_record_size) { - errno = EIO; - ntfs_log_perror("%s: Sanity check failed", __FUNCTION__); - goto res_err_out; - } - memcpy(b, val + pos, count); - ntfs_attr_put_search_ctx(ctx); - return count; - } - total = total2 = 0; - /* Zero out reads beyond initialized size. */ - if (pos + count > max_init) { - if (pos >= max_init) { - memset(b, 0, count); - return count; - } - total2 = pos + count - max_init; - count -= total2; - memset((u8*)b + count, 0, total2); - } - /* - * for encrypted non-resident attributes with efs_raw set - * the last two bytes aren't read from disk but contain - * the number of padding bytes so original size can be - * restored - */ - if (na->ni->vol->efs_raw && - (na->data_flags & ATTR_IS_ENCRYPTED) && - ((pos + count) > max_init-2)) { - efs_padding_length = 511 - ((na->data_size - 1) & 511); - if (pos+count == max_init) { - if (count == 1) { - *((u8*)b+count-1) = (u8)(efs_padding_length >> 8); - count--; - total2++; - } else { - *(u16*)((u8*)b+count-2) = cpu_to_le16(efs_padding_length); - count -= 2; - total2 +=2; - } - } else { - *((u8*)b+count-1) = (u8)(efs_padding_length & 0xff); - count--; - total2++; - } - } - - /* Find the runlist element containing the vcn. */ - rl = ntfs_attr_find_vcn(na, pos >> vol->cluster_size_bits); - if (!rl) { - /* - * If the vcn is not present it is an out of bounds read. - * However, we already truncated the read to the data_size, - * so getting this here is an error. - */ - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN #1", __FUNCTION__); - } - return -1; - } - /* - * Gather the requested data into the linear destination buffer. Note, - * a partial final vcn is taken care of by the @count capping of read - * length. - */ - ofs = pos - (rl->vcn << vol->cluster_size_bits); - for (; count; rl++, ofs = 0) { - if (rl->lcn == LCN_RL_NOT_MAPPED) { - rl = ntfs_attr_find_vcn(na, rl->vcn); - if (!rl) { - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN #2", - __FUNCTION__); - } - goto rl_err_out; - } - /* Needed for case when runs merged. */ - ofs = pos + total - (rl->vcn << vol->cluster_size_bits); - } - if (!rl->length) { - errno = EIO; - ntfs_log_perror("%s: Zero run length", __FUNCTION__); - goto rl_err_out; - } - if (rl->lcn < (LCN)0) { - if (rl->lcn != (LCN)LCN_HOLE) { - ntfs_log_perror("%s: Bad run (%lld)", - __FUNCTION__, - (long long)rl->lcn); - goto rl_err_out; - } - /* It is a hole, just zero the matching @b range. */ - to_read = min(count, (rl->length << - vol->cluster_size_bits) - ofs); - memset(b, 0, to_read); - /* Update progress counters. */ - total += to_read; - count -= to_read; - b = (u8*)b + to_read; - continue; - } - /* It is a real lcn, read it into @dst. */ - to_read = min(count, (rl->length << vol->cluster_size_bits) - - ofs); -retry: - ntfs_log_trace("Reading %lld bytes from vcn %lld, lcn %lld, ofs" - " %lld.\n", (long long)to_read, (long long)rl->vcn, - (long long )rl->lcn, (long long)ofs); - br = ntfs_pread(vol->dev, (rl->lcn << vol->cluster_size_bits) + - ofs, to_read, b); - /* If everything ok, update progress counters and continue. */ - if (br > 0) { - total += br; - count -= br; - b = (u8*)b + br; - } - if (br == to_read) - continue; - /* If the syscall was interrupted, try again. */ - if (br == (s64)-1 && errno == EINTR) - goto retry; - if (total) - return total; - if (!br) - errno = EIO; - ntfs_log_perror("%s: ntfs_pread failed", __FUNCTION__); - return -1; - } - /* Finally, return the number of bytes read. */ - return total + total2; -rl_err_out: - if (total) - return total; - errno = EIO; - return -1; -} - -/** - * ntfs_attr_pread - read from an attribute specified by an ntfs_attr structure - * @na: ntfs attribute to read from - * @pos: byte position in the attribute to begin reading from - * @count: number of bytes to read - * @b: output data buffer - * - * This function will read @count bytes starting at offset @pos from the ntfs - * attribute @na into the data buffer @b. - * - * On success, return the number of successfully read bytes. If this number is - * lower than @count this means that the read reached end of file or that an - * error was encountered during the read so that the read is partial. 0 means - * end of file or nothing was read (also return 0 when @count is 0). - * - * On error and nothing has been read, return -1 with errno set appropriately - * to the return code of ntfs_pread(), or to EINVAL in case of invalid - * arguments. - */ -s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b) -{ - s64 ret; - - if (!na || !na->ni || !na->ni->vol || !b || pos < 0 || count < 0) { - errno = EINVAL; - ntfs_log_perror("%s: na=%p b=%p pos=%lld count=%lld", - __FUNCTION__, na, b, (long long)pos, - (long long)count); - return -1; - } - - ntfs_log_enter("Entering for inode %lld attr 0x%x pos %lld count " - "%lld\n", (unsigned long long)na->ni->mft_no, - na->type, (long long)pos, (long long)count); - - ret = ntfs_attr_pread_i(na, pos, count, b); - - ntfs_log_leave("\n"); - return ret; -} - -static int ntfs_attr_fill_zero(ntfs_attr *na, s64 pos, s64 count) -{ - char *buf; - s64 written, size, end = pos + count; - s64 ofsi; - const runlist_element *rli; - ntfs_volume *vol; - int ret = -1; - - ntfs_log_trace("pos %lld, count %lld\n", (long long)pos, - (long long)count); - - if (!na || pos < 0 || count < 0) { - errno = EINVAL; - goto err_out; - } - - buf = ntfs_calloc(NTFS_BUF_SIZE); - if (!buf) - goto err_out; - - rli = na->rl; - ofsi = 0; - vol = na->ni->vol; - while (pos < end) { - while (rli->length && (ofsi + (rli->length << - vol->cluster_size_bits) <= pos)) { - ofsi += (rli->length << vol->cluster_size_bits); - rli++; - } - size = min(end - pos, NTFS_BUF_SIZE); - written = ntfs_rl_pwrite(vol, rli, ofsi, pos, size, buf); - if (written <= 0) { - ntfs_log_perror("Failed to zero space"); - goto err_free; - } - pos += written; - } - - ret = 0; -err_free: - free(buf); -err_out: - return ret; -} - -static int ntfs_attr_fill_hole(ntfs_attr *na, s64 count, s64 *ofs, - runlist_element **rl, VCN *update_from) -{ - s64 to_write; - s64 need; - ntfs_volume *vol = na->ni->vol; - int eo, ret = -1; - runlist *rlc; - LCN lcn_seek_from = -1; - VCN cur_vcn, from_vcn; - - to_write = min(count, ((*rl)->length << vol->cluster_size_bits) - *ofs); - - cur_vcn = (*rl)->vcn; - from_vcn = (*rl)->vcn + (*ofs >> vol->cluster_size_bits); - - ntfs_log_trace("count: %lld, cur_vcn: %lld, from: %lld, to: %lld, ofs: " - "%lld\n", (long long)count, (long long)cur_vcn, - (long long)from_vcn, (long long)to_write, (long long)*ofs); - - /* Map whole runlist to be able update mapping pairs later. */ - if (ntfs_attr_map_whole_runlist(na)) - goto err_out; - - /* Restore @*rl, it probably get lost during runlist mapping. */ - *rl = ntfs_attr_find_vcn(na, cur_vcn); - if (!*rl) { - ntfs_log_error("Failed to find run after mapping runlist. " - "Please report to %s.\n", NTFS_DEV_LIST); - errno = EIO; - goto err_out; - } - - /* Search backwards to find the best lcn to start seek from. */ - rlc = *rl; - while (rlc->vcn) { - rlc--; - if (rlc->lcn >= 0) { - /* - * avoid fragmenting a compressed file - * Windows does not do that, and that may - * not be desirable for files which can - * be updated - */ - if (na->data_flags & ATTR_COMPRESSION_MASK) - lcn_seek_from = rlc->lcn + rlc->length; - else - lcn_seek_from = rlc->lcn + (from_vcn - rlc->vcn); - break; - } - } - if (lcn_seek_from == -1) { - /* Backwards search failed, search forwards. */ - rlc = *rl; - while (rlc->length) { - rlc++; - if (rlc->lcn >= 0) { - lcn_seek_from = rlc->lcn - (rlc->vcn - from_vcn); - if (lcn_seek_from < -1) - lcn_seek_from = -1; - break; - } - } - } - - need = ((*ofs + to_write - 1) >> vol->cluster_size_bits) - + 1 + (*rl)->vcn - from_vcn; - if ((na->data_flags & ATTR_COMPRESSION_MASK) - && (need < na->compression_block_clusters)) { - /* - * for a compressed file, be sure to allocate the full - * compression block, as we may need space to decompress - * existing compressed data. - * So allocate the space common to compression block - * and existing hole. - */ - VCN alloc_vcn; - - if ((from_vcn & -na->compression_block_clusters) <= (*rl)->vcn) - alloc_vcn = (*rl)->vcn; - else - alloc_vcn = from_vcn & -na->compression_block_clusters; - need = (alloc_vcn | (na->compression_block_clusters - 1)) - + 1 - alloc_vcn; - if (need > (*rl)->length) { - ntfs_log_error("Cannot allocate %lld clusters" - " within a hole of %lld\n", - (long long)need, - (long long)(*rl)->length); - errno = EIO; - goto err_out; - } - rlc = ntfs_cluster_alloc(vol, alloc_vcn, need, - lcn_seek_from, DATA_ZONE); - } else - rlc = ntfs_cluster_alloc(vol, from_vcn, need, - lcn_seek_from, DATA_ZONE); - if (!rlc) - goto err_out; - if (na->data_flags & (ATTR_COMPRESSION_MASK | ATTR_IS_SPARSE)) - na->compressed_size += need << vol->cluster_size_bits; - - *rl = ntfs_runlists_merge(na->rl, rlc); - /* - * For a compressed attribute, we must be sure there are two - * available entries, so reserve them before it gets too late. - */ - if (*rl && (na->data_flags & ATTR_COMPRESSION_MASK)) { - runlist_element *oldrl = na->rl; - na->rl = *rl; - *rl = ntfs_rl_extend(na,*rl,2); - if (!*rl) na->rl = oldrl; /* restore to original if failed */ - } - if (!*rl) { - eo = errno; - ntfs_log_perror("Failed to merge runlists"); - if (ntfs_cluster_free_from_rl(vol, rlc)) { - ntfs_log_perror("Failed to free hot clusters. " - "Please run chkdsk /f"); - } - errno = eo; - goto err_out; - } - na->unused_runs = 2; - na->rl = *rl; - if ((*update_from == -1) || (from_vcn < *update_from)) - *update_from = from_vcn; - *rl = ntfs_attr_find_vcn(na, cur_vcn); - if (!*rl) { - /* - * It's definitely a BUG, if we failed to find @cur_vcn, because - * we missed it during instantiating of the hole. - */ - ntfs_log_error("Failed to find run after hole instantiation. " - "Please report to %s.\n", NTFS_DEV_LIST); - errno = EIO; - goto err_out; - } - /* If leaved part of the hole go to the next run. */ - if ((*rl)->lcn < 0) - (*rl)++; - /* Now LCN shoudn't be less than 0. */ - if ((*rl)->lcn < 0) { - ntfs_log_error("BUG! LCN is lesser than 0. " - "Please report to the %s.\n", NTFS_DEV_LIST); - errno = EIO; - goto err_out; - } - if (*ofs) { - /* Clear non-sparse region from @cur_vcn to @*ofs. */ - if (ntfs_attr_fill_zero(na, cur_vcn << vol->cluster_size_bits, - *ofs)) - goto err_out; - } - if ((*rl)->vcn < cur_vcn) { - /* - * Clusters that replaced hole are merged with - * previous run, so we need to update offset. - */ - *ofs += (cur_vcn - (*rl)->vcn) << vol->cluster_size_bits; - } - if ((*rl)->vcn > cur_vcn) { - /* - * We left part of the hole, so we need to update offset - */ - *ofs -= ((*rl)->vcn - cur_vcn) << vol->cluster_size_bits; - } - - ret = 0; -err_out: - return ret; -} - -static int stuff_hole(ntfs_attr *na, const s64 pos); - -/* - * Split an existing hole for overwriting with data - * The hole may have to be split into two or three parts, so - * that the overwritten part fits within a single compression block - * - * No cluster allocation is needed, this will be done later in - * standard hole filling, hence no need to reserve runs for - * future needs. - * - * Returns the number of clusters with existing compressed data - * in the compression block to be written to - * (or the full block, if it was a full hole) - * -1 if there were an error - */ - -static int split_compressed_hole(ntfs_attr *na, runlist_element **prl, - s64 pos, s64 count, VCN *update_from) -{ - int compressed_part; - int cluster_size_bits = na->ni->vol->cluster_size_bits; - runlist_element *rl = *prl; - - compressed_part - = na->compression_block_clusters; - /* reserve entries in runlist if we have to split */ - if (rl->length > na->compression_block_clusters) { - *prl = ntfs_rl_extend(na,*prl,2); - if (!*prl) { - compressed_part = -1; - } else { - rl = *prl; - na->unused_runs = 2; - } - } - if (*prl && (rl->length > na->compression_block_clusters)) { - /* - * Locate the update part relative to beginning of - * current run - */ - int beginwrite = (pos >> cluster_size_bits) - rl->vcn; - s32 endblock = (((pos + count - 1) >> cluster_size_bits) - | (na->compression_block_clusters - 1)) + 1 - rl->vcn; - - compressed_part = na->compression_block_clusters - - (rl->length & (na->compression_block_clusters - 1)); - if ((beginwrite + compressed_part) >= na->compression_block_clusters) - compressed_part = na->compression_block_clusters; - /* - * if the run ends beyond end of needed block - * we have to split the run - */ - if (endblock < rl[0].length) { - runlist_element *xrl; - int n; - - /* - * we have to split into three parts if the run - * does not end within the first compression block. - * This means the hole begins before the - * compression block. - */ - if (endblock > na->compression_block_clusters) { - if (na->unused_runs < 2) { -ntfs_log_error("No free run, case 1\n"); - } - na->unused_runs -= 2; - xrl = rl; - n = 0; - while (xrl->length) { - xrl++; - n++; - } - do { - xrl[2] = *xrl; - xrl--; - } while (xrl != rl); - rl[1].length = na->compression_block_clusters; - rl[2].length = rl[0].length - endblock; - rl[0].length = endblock - - na->compression_block_clusters; - rl[1].lcn = LCN_HOLE; - rl[2].lcn = LCN_HOLE; - rl[1].vcn = rl[0].vcn + rl[0].length; - rl[2].vcn = rl[1].vcn - + na->compression_block_clusters; - rl = ++(*prl); - } else { - /* - * split into two parts and use the - * first one - */ - if (!na->unused_runs) { -ntfs_log_error("No free run, case 2\n"); - } - na->unused_runs--; - xrl = rl; - n = 0; - while (xrl->length) { - xrl++; - n++; - } - do { - xrl[1] = *xrl; - xrl--; - } while (xrl != rl); - if (beginwrite < endblock) { - /* we will write into the first part of hole */ - rl[1].length = rl[0].length - endblock; - rl[0].length = endblock; - rl[1].vcn = rl[0].vcn + rl[0].length; - rl[1].lcn = LCN_HOLE; - } else { - /* we will write into the second part of hole */ -// impossible ? - rl[1].length = rl[0].length - endblock; - rl[0].length = endblock; - rl[1].vcn = rl[0].vcn + rl[0].length; - rl[1].lcn = LCN_HOLE; - rl = ++(*prl); - } - } - } else { - if (rl[1].length) { - runlist_element *xrl; - int n; - - /* - * split into two parts and use the - * last one - */ - if (!na->unused_runs) { -ntfs_log_error("No free run, case 4\n"); - } - na->unused_runs--; - xrl = rl; - n = 0; - while (xrl->length) { - xrl++; - n++; - } - do { - xrl[1] = *xrl; - xrl--; - } while (xrl != rl); - } else { - rl[2].lcn = rl[1].lcn; - rl[2].vcn = rl[1].vcn; - rl[2].length = rl[1].length; - } - rl[1].vcn -= na->compression_block_clusters; - rl[1].lcn = LCN_HOLE; - rl[1].length = na->compression_block_clusters; - rl[0].length -= na->compression_block_clusters; - if (pos >= (rl[1].vcn << cluster_size_bits)) { - rl = ++(*prl); - } - } - if ((*update_from == -1) || ((*prl)->vcn < *update_from)) - *update_from = (*prl)->vcn; - } - return (compressed_part); -} - -/* - * Borrow space from adjacent hole for appending data - * The hole may have to be split so that the end of hole is not - * affected by cluster allocation and overwriting - * Cluster allocation is needed for the overwritten compression block - * - * Must always leave two unused entries in the runlist - * - * Returns the number of clusters with existing compressed data - * in the compression block to be written to - * -1 if there were an error - */ - -static int borrow_from_hole(ntfs_attr *na, runlist_element **prl, - s64 pos, s64 count, VCN *update_from, BOOL wasnonresident) -{ - int compressed_part = 0; - int cluster_size_bits = na->ni->vol->cluster_size_bits; - runlist_element *rl = *prl; - s32 endblock; - long long allocated; - runlist_element *zrl; - int irl; - BOOL undecided; - BOOL nothole; - - /* check whether the compression block is fully allocated */ - endblock = (((pos + count - 1) >> cluster_size_bits) | (na->compression_block_clusters - 1)) + 1 - rl->vcn; - allocated = 0; - zrl = rl; - irl = 0; - while (zrl->length && (zrl->lcn >= 0) && (allocated < endblock)) { - allocated += zrl->length; - zrl++; - irl++; - } - - undecided = (allocated < endblock) && (zrl->lcn == LCN_RL_NOT_MAPPED); - nothole = (allocated >= endblock) || (zrl->lcn != LCN_HOLE); - - if (undecided || nothole) { - runlist_element *orl = na->rl; - s64 olcn = (*prl)->lcn; - /* - * Map the full runlist (needed to compute the - * compressed size), unless the runlist has not - * yet been created (data just made non-resident) - */ - irl = *prl - na->rl; - if (!NAttrBeingNonResident(na) - && ntfs_attr_map_whole_runlist(na)) { - rl = (runlist_element*)NULL; - } else { - /* - * Mapping the runlist may cause its relocation, - * and relocation may be at the same place with - * relocated contents. - * Have to find the current run again when this - * happens. - */ - if ((na->rl != orl) || ((*prl)->lcn != olcn)) { - zrl = &na->rl[irl]; - while (zrl->length && (zrl->lcn != olcn)) - zrl++; - *prl = zrl; - } - if (!(*prl)->length) { - ntfs_log_error("Mapped run not found," - " inode %lld lcn 0x%llx\n", - (long long)na->ni->mft_no, - (long long)olcn); - rl = (runlist_element*)NULL; - } else { - rl = ntfs_rl_extend(na,*prl,2); - na->unused_runs = 2; - } - } - *prl = rl; - if (rl && undecided) { - allocated = 0; - zrl = rl; - irl = 0; - while (zrl->length && (zrl->lcn >= 0) - && (allocated < endblock)) { - allocated += zrl->length; - zrl++; - irl++; - } - } - } - /* - * compression block not fully allocated and followed - * by a hole : we must allocate in the hole. - */ - if (rl && (allocated < endblock) && (zrl->lcn == LCN_HOLE)) { - s64 xofs; - - /* - * split the hole if not fully needed - */ - if ((allocated + zrl->length) > endblock) { - runlist_element *xrl; - - *prl = ntfs_rl_extend(na,*prl,1); - if (*prl) { - /* beware : rl was reallocated */ - rl = *prl; - zrl = &rl[irl]; - na->unused_runs = 0; - xrl = zrl; - while (xrl->length) xrl++; - do { - xrl[1] = *xrl; - } while (xrl-- != zrl); - zrl->length = endblock - allocated; - zrl[1].length -= zrl->length; - zrl[1].vcn = zrl->vcn + zrl->length; - } - } - if (*prl) { - if (wasnonresident) - compressed_part = na->compression_block_clusters - - zrl->length; - xofs = 0; - if (ntfs_attr_fill_hole(na, - zrl->length << cluster_size_bits, - &xofs, &zrl, update_from)) - compressed_part = -1; - else { - /* go back to initial cluster, now reallocated */ - while (zrl->vcn > (pos >> cluster_size_bits)) - zrl--; - *prl = zrl; - } - } - } - if (!*prl) { - ntfs_log_error("No elements to borrow from a hole\n"); - compressed_part = -1; - } else - if ((*update_from == -1) || ((*prl)->vcn < *update_from)) - *update_from = (*prl)->vcn; - return (compressed_part); -} - -/** - * ntfs_attr_pwrite - positioned write to an ntfs attribute - * @na: ntfs attribute to write to - * @pos: position in the attribute to write to - * @count: number of bytes to write - * @b: data buffer to write to disk - * - * This function will write @count bytes from data buffer @b to ntfs attribute - * @na at position @pos. - * - * On success, return the number of successfully written bytes. If this number - * is lower than @count this means that an error was encountered during the - * write so that the write is partial. 0 means nothing was written (also return - * 0 when @count is 0). - * - * On error and nothing has been written, return -1 with errno set - * appropriately to the return code of ntfs_pwrite(), or to EINVAL in case of - * invalid arguments. - */ -s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, const void *b) -{ - s64 written, to_write, ofs, old_initialized_size, old_data_size; - s64 total = 0; - VCN update_from = -1; - ntfs_volume *vol; - s64 fullcount; - ntfs_attr_search_ctx *ctx = NULL; - runlist_element *rl; - s64 hole_end; - int eo; - int compressed_part; - struct { - unsigned int undo_initialized_size : 1; - unsigned int undo_data_size : 1; - } need_to = { 0, 0 }; - BOOL wasnonresident = FALSE; - BOOL compressed; - BOOL updatemap; - - ntfs_log_enter("Entering for inode %lld, attr 0x%x, pos 0x%llx, count " - "0x%llx.\n", (long long)na->ni->mft_no, na->type, - (long long)pos, (long long)count); - - if (!na || !na->ni || !na->ni->vol || !b || pos < 0 || count < 0) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - goto errno_set; - } - vol = na->ni->vol; - compressed = (na->data_flags & ATTR_COMPRESSION_MASK) - != const_cpu_to_le16(0); - na->unused_runs = 0; /* prepare overflow checks */ - /* - * Encrypted attributes are only supported in raw mode. We return - * access denied, which is what Windows NT4 does, too. - * Moreover a file cannot be both encrypted and compressed. - */ - if ((na->data_flags & ATTR_IS_ENCRYPTED) - && (compressed || !vol->efs_raw)) { - errno = EACCES; - goto errno_set; - } - /* - * Fill the gap, when writing beyond the end of a compressed - * file. This will make recursive calls - */ - if (compressed - && (na->type == AT_DATA) - && (pos > na->initialized_size) - && stuff_hole(na,pos)) - goto errno_set; - /* If this is a compressed attribute it needs special treatment. */ - wasnonresident = NAttrNonResident(na) != 0; - /* - * Compression is restricted to data streams and - * only ATTR_IS_COMPRESSED compression mode is supported. - */ - if (compressed - && ((na->type != AT_DATA) - || ((na->data_flags & ATTR_COMPRESSION_MASK) - != ATTR_IS_COMPRESSED))) { - errno = EOPNOTSUPP; - goto errno_set; - } - - if (!count) - goto out; - /* for a compressed file, get prepared to reserve a full block */ - fullcount = count; - /* If the write reaches beyond the end, extend the attribute. */ - old_data_size = na->data_size; - if (pos + count > na->data_size) { - if (ntfs_attr_truncate(na, pos + count)) { - ntfs_log_perror("Failed to enlarge attribute"); - goto errno_set; - } - /* resizing may change the compression mode */ - compressed = (na->data_flags & ATTR_COMPRESSION_MASK) - != const_cpu_to_le16(0); - need_to.undo_data_size = 1; - } - /* - * For compressed data, a single full block was allocated - * to deal with compression, possibly in a previous call. - * We are not able to process several blocks because - * some clusters are freed after compression and - * new allocations have to be done before proceeding, - * so truncate the requested count if needed (big buffers). - */ - if (compressed) { - fullcount = (pos | (na->compression_block_size - 1)) + 1 - pos; - if (count > fullcount) - count = fullcount; - } - old_initialized_size = na->initialized_size; - /* If it is a resident attribute, write the data to the mft record. */ - if (!NAttrNonResident(na)) { - char *val; - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - goto err_out; - if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, - 0, NULL, 0, ctx)) { - ntfs_log_perror("%s: lookup failed", __FUNCTION__); - goto err_out; - } - val = (char*)ctx->attr + le16_to_cpu(ctx->attr->value_offset); - if (val < (char*)ctx->attr || val + - le32_to_cpu(ctx->attr->value_length) > - (char*)ctx->mrec + vol->mft_record_size) { - errno = EIO; - ntfs_log_perror("%s: Sanity check failed", __FUNCTION__); - goto err_out; - } - memcpy(val + pos, b, count); - if (ntfs_mft_record_write(vol, ctx->ntfs_ino->mft_no, - ctx->mrec)) { - /* - * NOTE: We are in a bad state at this moment. We have - * dirtied the mft record but we failed to commit it to - * disk. Since we have read the mft record ok before, - * it is unlikely to fail writing it, so is ok to just - * return error here... (AIA) - */ - ntfs_log_perror("%s: failed to write mft record", __FUNCTION__); - goto err_out; - } - ntfs_attr_put_search_ctx(ctx); - total = count; - goto out; - } - - /* Handle writes beyond initialized_size. */ - - if (pos + count > na->initialized_size) { - if (ntfs_attr_map_whole_runlist(na)) - goto err_out; - /* - * For a compressed attribute, we must be sure there is an - * available entry, and, when reopening a compressed file, - * we may need to split a hole. So reserve the entries - * before it gets too late. - */ - if (compressed) { - na->rl = ntfs_rl_extend(na,na->rl,2); - if (!na->rl) - goto err_out; - na->unused_runs = 2; - } - /* Set initialized_size to @pos + @count. */ - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - goto err_out; - if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, - 0, NULL, 0, ctx)) - goto err_out; - - /* If write starts beyond initialized_size, zero the gap. */ - if (pos > na->initialized_size) - if (ntfs_attr_fill_zero(na, na->initialized_size, - pos - na->initialized_size)) - goto err_out; - - ctx->attr->initialized_size = cpu_to_sle64(pos + count); - /* fix data_size for compressed files */ - if (compressed) { - na->data_size = pos + count; - ctx->attr->data_size = ctx->attr->initialized_size; - } - if (ntfs_mft_record_write(vol, ctx->ntfs_ino->mft_no, - ctx->mrec)) { - /* - * Undo the change in the in-memory copy and send it - * back for writing. - */ - ctx->attr->initialized_size = - cpu_to_sle64(old_initialized_size); - ntfs_mft_record_write(vol, ctx->ntfs_ino->mft_no, - ctx->mrec); - goto err_out; - } - na->initialized_size = pos + count; -#if CACHE_NIDATA_SIZE - if (na->ni->mrec->flags & MFT_RECORD_IS_DIRECTORY - ? na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30 - : na->type == AT_DATA && na->name == AT_UNNAMED) { - na->ni->data_size = na->data_size; - if ((compressed || NAttrSparse(na)) - && NAttrNonResident(na)) - na->ni->allocated_size = na->compressed_size; - else - na->ni->allocated_size = na->allocated_size; - set_nino_flag(na->ni,KnownSize); - } -#endif - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - /* - * NOTE: At this point the initialized_size in the mft record - * has been updated BUT there is random data on disk thus if - * we decide to abort, we MUST change the initialized_size - * again. - */ - need_to.undo_initialized_size = 1; - } - /* Find the runlist element containing the vcn. */ - rl = ntfs_attr_find_vcn(na, pos >> vol->cluster_size_bits); - if (!rl) { - /* - * If the vcn is not present it is an out of bounds write. - * However, we already extended the size of the attribute, - * so getting this here must be an error of some kind. - */ - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN #3", __FUNCTION__); - } - goto err_out; - } - /* - * Determine if there is compressed data in the current - * compression block (when appending to an existing file). - * If so, decompression will be needed, and the full block - * must be allocated to be identified as uncompressed. - * This comes in two variants, depending on whether - * compression has saved at least one cluster. - * The compressed size can never be over full size by - * more than 485 (maximum for 15 compression blocks - * compressed to 4098 and the last 3640 bytes compressed - * to 3640 + 3640/8 = 4095, with 15*2 + 4095 - 3640 = 485) - * This is less than the smallest cluster, so the hole is - * is never beyond the cluster next to the position of - * the first uncompressed byte to write. - */ - compressed_part = 0; - if (compressed) { - if ((rl->lcn == (LCN)LCN_HOLE) - && wasnonresident) { - if (rl->length < na->compression_block_clusters) - /* - * the needed block is in a hole smaller - * than the compression block : we can use - * it fully - */ - compressed_part - = na->compression_block_clusters - - rl->length; - else { - /* - * the needed block is in a hole bigger - * than the compression block : we must - * split the hole and use it partially - */ - compressed_part = split_compressed_hole(na, - &rl, pos, count, &update_from); - } - } else { - if (rl->lcn >= 0) { - /* - * the needed block contains data, make - * sure the full compression block is - * allocated. Borrow from hole if needed - */ - compressed_part = borrow_from_hole(na, - &rl, pos, count, &update_from, - wasnonresident); - } - } - - if (compressed_part < 0) - goto err_out; - - /* just making non-resident, so not yet compressed */ - if (NAttrBeingNonResident(na) - && (compressed_part < na->compression_block_clusters)) - compressed_part = 0; - } - ofs = pos - (rl->vcn << vol->cluster_size_bits); - /* - * Scatter the data from the linear data buffer to the volume. Note, a - * partial final vcn is taken care of by the @count capping of write - * length. - */ - for (hole_end = 0; count; rl++, ofs = 0) { - if (rl->lcn == LCN_RL_NOT_MAPPED) { - rl = ntfs_attr_find_vcn(na, rl->vcn); - if (!rl) { - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN" - " #4", __FUNCTION__); - } - goto rl_err_out; - } - /* Needed for case when runs merged. */ - ofs = pos + total - (rl->vcn << vol->cluster_size_bits); - } - if (!rl->length) { - errno = EIO; - ntfs_log_perror("%s: Zero run length", __FUNCTION__); - goto rl_err_out; - } - if (rl->lcn < (LCN)0) { - hole_end = rl->vcn + rl->length; - - if (rl->lcn != (LCN)LCN_HOLE) { - errno = EIO; - ntfs_log_perror("%s: Unexpected LCN (%lld)", - __FUNCTION__, - (long long)rl->lcn); - goto rl_err_out; - } - if (ntfs_attr_fill_hole(na, fullcount, &ofs, &rl, - &update_from)) - goto err_out; - } - if (compressed) { - while (rl->length - && (ofs >= (rl->length << vol->cluster_size_bits))) { - ofs -= rl->length << vol->cluster_size_bits; - rl++; - } - } - - /* It is a real lcn, write it to the volume. */ - to_write = min(count, (rl->length << vol->cluster_size_bits) - ofs); -retry: - ntfs_log_trace("Writing %lld bytes to vcn %lld, lcn %lld, ofs " - "%lld.\n", (long long)to_write, (long long)rl->vcn, - (long long)rl->lcn, (long long)ofs); - if (!NVolReadOnly(vol)) { - - s64 wpos = (rl->lcn << vol->cluster_size_bits) + ofs; - s64 wend = (rl->vcn << vol->cluster_size_bits) + ofs + to_write; - u32 bsize = vol->cluster_size; - /* Byte size needed to zero fill a cluster */ - s64 rounding = ((wend + bsize - 1) & ~(s64)(bsize - 1)) - wend; - /** - * Zero fill to cluster boundary if we're writing at the - * end of the attribute or into an ex-sparse cluster. - * This will cause the kernel not to seek and read disk - * blocks during write(2) to fill the end of the buffer - * which increases write speed by 2-10 fold typically. - * - * This is done even for compressed files, because - * data is generally first written uncompressed. - */ - if (rounding && ((wend == na->initialized_size) || - (wend < (hole_end << vol->cluster_size_bits)))){ - - char *cb; - - rounding += to_write; - - cb = ntfs_malloc(rounding); - if (!cb) - goto err_out; - - memcpy(cb, b, to_write); - memset(cb + to_write, 0, rounding - to_write); - - if (compressed) { - written = ntfs_compressed_pwrite(na, - rl, wpos, ofs, to_write, - rounding, cb, compressed_part, - &update_from); - } else { - written = ntfs_pwrite(vol->dev, wpos, - rounding, cb); - if (written == rounding) - written = to_write; - } - - free(cb); - } else { - if (compressed) { - written = ntfs_compressed_pwrite(na, - rl, wpos, ofs, to_write, - to_write, b, compressed_part, - &update_from); - } else - written = ntfs_pwrite(vol->dev, wpos, - to_write, b); - } - } else - written = to_write; - /* If everything ok, update progress counters and continue. */ - if (written > 0) { - total += written; - count -= written; - fullcount -= written; - b = (const u8*)b + written; - } - if (written != to_write) { - /* Partial write cannot be dealt with, stop there */ - /* If the syscall was interrupted, try again. */ - if (written == (s64)-1 && errno == EINTR) - goto retry; - if (!written) - errno = EIO; - goto rl_err_out; - } - compressed_part = 0; - } -done: - if (ctx) - ntfs_attr_put_search_ctx(ctx); - /* - * Update mapping pairs if needed. - * For a compressed file, we try to make a partial update - * of the mapping list. This makes a difference only if - * inode extents were needed. - */ - updatemap = (compressed - ? NAttrFullyMapped(na) != 0 : update_from != -1); - if (updatemap) - if (ntfs_attr_update_mapping_pairs(na, - (update_from < 0 ? 0 : update_from))) { - /* - * FIXME: trying to recover by goto rl_err_out; - * could cause driver hang by infinite looping. - */ - total = -1; - goto out; - } -out: - ntfs_log_leave("\n"); - return total; -rl_err_out: - eo = errno; - if (total) { - if (need_to.undo_initialized_size) { - if (pos + total > na->initialized_size) - goto done; - /* - * TODO: Need to try to change initialized_size. If it - * succeeds goto done, otherwise goto err_out. (AIA) - */ - goto err_out; - } - goto done; - } - errno = eo; -err_out: - eo = errno; - if (need_to.undo_initialized_size) { - int err; - - err = 0; - if (!ctx) { - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - err = 1; - } else - ntfs_attr_reinit_search_ctx(ctx); - if (!err) { - err = ntfs_attr_lookup(na->type, na->name, - na->name_len, 0, 0, NULL, 0, ctx); - if (!err) { - na->initialized_size = old_initialized_size; - ctx->attr->initialized_size = cpu_to_sle64( - old_initialized_size); - err = ntfs_mft_record_write(vol, - ctx->ntfs_ino->mft_no, - ctx->mrec); - } - } - if (err) { - /* - * FIXME: At this stage could try to recover by filling - * old_initialized_size -> new_initialized_size with - * data or at least zeroes. (AIA) - */ - ntfs_log_error("Eeek! Failed to recover from error. " - "Leaving metadata in inconsistent " - "state! Run chkdsk!\n"); - } - } - if (ctx) - ntfs_attr_put_search_ctx(ctx); - /* Update mapping pairs if needed. */ - updatemap = (compressed - ? NAttrFullyMapped(na) != 0 : update_from != -1); - if (updatemap) - ntfs_attr_update_mapping_pairs(na, 0); - /* Restore original data_size if needed. */ - if (need_to.undo_data_size && ntfs_attr_truncate(na, old_data_size)) - ntfs_log_perror("Failed to restore data_size"); - errno = eo; -errno_set: - total = -1; - goto out; -} - -int ntfs_attr_pclose(ntfs_attr *na) -{ - s64 ofs; - int failed; - BOOL ok = TRUE; - VCN update_from = -1; - ntfs_volume *vol; - ntfs_attr_search_ctx *ctx = NULL; - runlist_element *rl; - int eo; - s64 hole; - int compressed_part; - BOOL compressed; - - ntfs_log_enter("Entering for inode 0x%llx, attr 0x%x.\n", - na->ni->mft_no, na->type); - - if (!na || !na->ni || !na->ni->vol) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - goto errno_set; - } - vol = na->ni->vol; - na->unused_runs = 0; - compressed = (na->data_flags & ATTR_COMPRESSION_MASK) - != const_cpu_to_le16(0); - /* - * Encrypted non-resident attributes are not supported. We return - * access denied, which is what Windows NT4 does, too. - */ - if (NAttrEncrypted(na) && NAttrNonResident(na)) { - errno = EACCES; - goto errno_set; - } - /* If this is not a compressed attribute get out */ - /* same if it is resident */ - if (!compressed || !NAttrNonResident(na)) - goto out; - - /* safety check : no recursion on close */ - if (NAttrComprClosing(na)) { - errno = EIO; - ntfs_log_error("Bad ntfs_attr_pclose" - " recursion on inode %lld\n", - (long long)na->ni->mft_no); - goto out; - } - NAttrSetComprClosing(na); - /* - * For a compressed attribute, we must be sure there are two - * available entries, so reserve them before it gets too late. - */ - if (ntfs_attr_map_whole_runlist(na)) - goto err_out; - na->rl = ntfs_rl_extend(na,na->rl,2); - if (!na->rl) - goto err_out; - na->unused_runs = 2; - /* Find the runlist element containing the terminal vcn. */ - rl = ntfs_attr_find_vcn(na, (na->initialized_size - 1) >> vol->cluster_size_bits); - if (!rl) { - /* - * If the vcn is not present it is an out of bounds write. - * However, we have already written the last byte uncompressed, - * so getting this here must be an error of some kind. - */ - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN #5", __FUNCTION__); - } - goto err_out; - } - /* - * Scatter the data from the linear data buffer to the volume. Note, a - * partial final vcn is taken care of by the @count capping of write - * length. - */ - compressed_part = 0; - if (rl->lcn >= 0) { - runlist_element *xrl; - - xrl = rl; - do { - xrl++; - } while (xrl->lcn >= 0); - compressed_part = (-xrl->length) - & (na->compression_block_clusters - 1); - } else - if (rl->lcn == (LCN)LCN_HOLE) { - if (rl->length < na->compression_block_clusters) - compressed_part - = na->compression_block_clusters - - rl->length; - else - compressed_part - = na->compression_block_clusters; - } - /* done, if the last block set was compressed */ - if (compressed_part) - goto out; - - ofs = na->initialized_size - (rl->vcn << vol->cluster_size_bits); - - if (rl->lcn == LCN_RL_NOT_MAPPED) { - rl = ntfs_attr_find_vcn(na, rl->vcn); - if (!rl) { - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN" - " #6", __FUNCTION__); - } - goto rl_err_out; - } - /* Needed for case when runs merged. */ - ofs = na->initialized_size - (rl->vcn << vol->cluster_size_bits); - } - if (!rl->length) { - errno = EIO; - ntfs_log_perror("%s: Zero run length", __FUNCTION__); - goto rl_err_out; - } - if (rl->lcn < (LCN)0) { - hole = rl->vcn + rl->length; - if (rl->lcn != (LCN)LCN_HOLE) { - errno = EIO; - ntfs_log_perror("%s: Unexpected LCN (%lld)", - __FUNCTION__, - (long long)rl->lcn); - goto rl_err_out; - } - - if (ntfs_attr_fill_hole(na, (s64)0, &ofs, &rl, &update_from)) - goto err_out; - } - while (rl->length - && (ofs >= (rl->length << vol->cluster_size_bits))) { - ofs -= rl->length << vol->cluster_size_bits; - rl++; - } - -retry: - failed = 0; - if (update_from < 0) update_from = 0; - if (!NVolReadOnly(vol)) { - failed = ntfs_compressed_close(na, rl, ofs, &update_from); -#if CACHE_NIDATA_SIZE - if (na->ni->mrec->flags & MFT_RECORD_IS_DIRECTORY - ? na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30 - : na->type == AT_DATA && na->name == AT_UNNAMED) { - na->ni->data_size = na->data_size; - na->ni->allocated_size = na->compressed_size; - set_nino_flag(na->ni,KnownSize); - } -#endif - } - if (failed) { - /* If the syscall was interrupted, try again. */ - if (errno == EINTR) - goto retry; - else - goto rl_err_out; - } - if (ctx) - ntfs_attr_put_search_ctx(ctx); - /* Update mapping pairs if needed. */ - if (NAttrFullyMapped(na)) - if (ntfs_attr_update_mapping_pairs(na, update_from)) { - /* - * FIXME: trying to recover by goto rl_err_out; - * could cause driver hang by infinite looping. - */ - ok = FALSE; - goto out; - } -out: - ntfs_log_leave("\n"); - return (!ok); -rl_err_out: - /* - * need not restore old sizes, only compressed_size - * can have changed. It has been set according to - * the current runlist while updating the mapping pairs, - * and must be kept consistent with the runlists. - */ -err_out: - eo = errno; - if (ctx) - ntfs_attr_put_search_ctx(ctx); - /* Update mapping pairs if needed. */ - if (NAttrFullyMapped(na)) - ntfs_attr_update_mapping_pairs(na, 0); - errno = eo; -errno_set: - ok = FALSE; - goto out; -} - -/** - * ntfs_attr_mst_pread - multi sector transfer protected ntfs attribute read - * @na: multi sector transfer protected ntfs attribute to read from - * @pos: byte position in the attribute to begin reading from - * @bk_cnt: number of mst protected blocks to read - * @bk_size: size of each mst protected block in bytes - * @dst: output data buffer - * - * This function will read @bk_cnt blocks of size @bk_size bytes each starting - * at offset @pos from the ntfs attribute @na into the data buffer @b. - * - * On success, the multi sector transfer fixups are applied and the number of - * read blocks is returned. If this number is lower than @bk_cnt this means - * that the read has either reached end of attribute or that an error was - * encountered during the read so that the read is partial. 0 means end of - * attribute or nothing to read (also return 0 when @bk_cnt or @bk_size are 0). - * - * On error and nothing has been read, return -1 with errno set appropriately - * to the return code of ntfs_attr_pread() or to EINVAL in case of invalid - * arguments. - * - * NOTE: If an incomplete multi sector transfer is detected the magic is - * changed to BAAD but no error is returned, i.e. it is possible that any of - * the returned blocks have multi sector transfer errors. This should be - * detected by the caller by checking each block with is_baad_recordp(&block). - * The reasoning is that we want to fixup as many blocks as possible and we - * want to return even bad ones to the caller so, e.g. in case of ntfsck, the - * errors can be repaired. - */ -s64 ntfs_attr_mst_pread(ntfs_attr *na, const s64 pos, const s64 bk_cnt, - const u32 bk_size, void *dst) -{ - s64 br; - u8 *end; - - ntfs_log_trace("Entering for inode 0x%llx, attr type 0x%x, pos 0x%llx.\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)pos); - if (bk_cnt < 0 || bk_size % NTFS_BLOCK_SIZE) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return -1; - } - br = ntfs_attr_pread(na, pos, bk_cnt * bk_size, dst); - if (br <= 0) - return br; - br /= bk_size; - for (end = (u8*)dst + br * bk_size; (u8*)dst < end; dst = (u8*)dst + - bk_size) - ntfs_mst_post_read_fixup((NTFS_RECORD*)dst, bk_size); - /* Finally, return the number of blocks read. */ - return br; -} - -/** - * ntfs_attr_mst_pwrite - multi sector transfer protected ntfs attribute write - * @na: multi sector transfer protected ntfs attribute to write to - * @pos: position in the attribute to write to - * @bk_cnt: number of mst protected blocks to write - * @bk_size: size of each mst protected block in bytes - * @src: data buffer to write to disk - * - * This function will write @bk_cnt blocks of size @bk_size bytes each from - * data buffer @b to multi sector transfer (mst) protected ntfs attribute @na - * at position @pos. - * - * On success, return the number of successfully written blocks. If this number - * is lower than @bk_cnt this means that an error was encountered during the - * write so that the write is partial. 0 means nothing was written (also - * return 0 when @bk_cnt or @bk_size are 0). - * - * On error and nothing has been written, return -1 with errno set - * appropriately to the return code of ntfs_attr_pwrite(), or to EINVAL in case - * of invalid arguments. - * - * NOTE: We mst protect the data, write it, then mst deprotect it using a quick - * deprotect algorithm (no checking). This saves us from making a copy before - * the write and at the same time causes the usn to be incremented in the - * buffer. This conceptually fits in better with the idea that cached data is - * always deprotected and protection is performed when the data is actually - * going to hit the disk and the cache is immediately deprotected again - * simulating an mst read on the written data. This way cache coherency is - * achieved. - */ -s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const s64 pos, s64 bk_cnt, - const u32 bk_size, void *src) -{ - s64 written, i; - - ntfs_log_trace("Entering for inode 0x%llx, attr type 0x%x, pos 0x%llx.\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)pos); - if (bk_cnt < 0 || bk_size % NTFS_BLOCK_SIZE) { - errno = EINVAL; - return -1; - } - if (!bk_cnt) - return 0; - /* Prepare data for writing. */ - for (i = 0; i < bk_cnt; ++i) { - int err; - - err = ntfs_mst_pre_write_fixup((NTFS_RECORD*) - ((u8*)src + i * bk_size), bk_size); - if (err < 0) { - /* Abort write at this position. */ - ntfs_log_perror("%s #1", __FUNCTION__); - if (!i) - return err; - bk_cnt = i; - break; - } - } - /* Write the prepared data. */ - written = ntfs_attr_pwrite(na, pos, bk_cnt * bk_size, src); - if (written <= 0) { - ntfs_log_perror("%s: written=%lld", __FUNCTION__, - (long long)written); - } - /* Quickly deprotect the data again. */ - for (i = 0; i < bk_cnt; ++i) - ntfs_mst_post_write_fixup((NTFS_RECORD*)((u8*)src + i * - bk_size)); - if (written <= 0) - return written; - /* Finally, return the number of complete blocks written. */ - return written / bk_size; -} - -/** - * ntfs_attr_find - find (next) attribute in mft record - * @type: attribute type to find - * @name: attribute name to find (optional, i.e. NULL means don't care) - * @name_len: attribute name length (only needed if @name present) - * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present) - * @val: attribute value to find (optional, resident attributes only) - * @val_len: attribute value length - * @ctx: search context with mft record and attribute to search from - * - * You shouldn't need to call this function directly. Use lookup_attr() instead. - * - * ntfs_attr_find() takes a search context @ctx as parameter and searches the - * mft record specified by @ctx->mrec, beginning at @ctx->attr, for an - * attribute of @type, optionally @name and @val. If found, ntfs_attr_find() - * returns 0 and @ctx->attr will point to the found attribute. - * - * If not found, ntfs_attr_find() returns -1, with errno set to ENOENT and - * @ctx->attr will point to the attribute before which the attribute being - * searched for would need to be inserted if such an action were to be desired. - * - * On actual error, ntfs_attr_find() returns -1 with errno set to the error - * code but not to ENOENT. In this case @ctx->attr is undefined and in - * particular do not rely on it not changing. - * - * If @ctx->is_first is TRUE, the search begins with @ctx->attr itself. If it - * is FALSE, the search begins after @ctx->attr. - * - * If @type is AT_UNUSED, return the first found attribute, i.e. one can - * enumerate all attributes by setting @type to AT_UNUSED and then calling - * ntfs_attr_find() repeatedly until it returns -1 with errno set to ENOENT to - * indicate that there are no more entries. During the enumeration, each - * successful call of ntfs_attr_find() will return the next attribute in the - * mft record @ctx->mrec. - * - * If @type is AT_END, seek to the end and return -1 with errno set to ENOENT. - * AT_END is not a valid attribute, its length is zero for example, thus it is - * safer to return error instead of success in this case. This also allows us - * to interoperate cleanly with ntfs_external_attr_find(). - * - * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present - * but not AT_UNNAMED search for a named attribute matching @name. Otherwise, - * match both named and unnamed attributes. - * - * If @ic is IGNORE_CASE, the @name comparison is not case sensitive and - * @ctx->ntfs_ino must be set to the ntfs inode to which the mft record - * @ctx->mrec belongs. This is so we can get at the ntfs volume and hence at - * the upcase table. If @ic is CASE_SENSITIVE, the comparison is case - * sensitive. When @name is present, @name_len is the @name length in Unicode - * characters. - * - * If @name is not present (NULL), we assume that the unnamed attribute is - * being searched for. - * - * Finally, the resident attribute value @val is looked for, if present. - * If @val is not present (NULL), @val_len is ignored. - * - * ntfs_attr_find() only searches the specified mft record and it ignores the - * presence of an attribute list attribute (unless it is the one being searched - * for, obviously). If you need to take attribute lists into consideration, use - * ntfs_attr_lookup() instead (see below). This also means that you cannot use - * ntfs_attr_find() to search for extent records of non-resident attributes, as - * extents with lowest_vcn != 0 are usually described by the attribute list - * attribute only. - Note that it is possible that the first extent is only in - * the attribute list while the last extent is in the base mft record, so don't - * rely on being able to find the first extent in the base mft record. - * - * Warning: Never use @val when looking for attribute types which can be - * non-resident as this most likely will result in a crash! - */ -static int ntfs_attr_find(const ATTR_TYPES type, const ntfschar *name, - const u32 name_len, const IGNORE_CASE_BOOL ic, - const u8 *val, const u32 val_len, ntfs_attr_search_ctx *ctx) -{ - ATTR_RECORD *a; - ntfs_volume *vol; - ntfschar *upcase; - u32 upcase_len; - - ntfs_log_trace("attribute type 0x%x.\n", type); - - if (ctx->ntfs_ino) { - vol = ctx->ntfs_ino->vol; - upcase = vol->upcase; - upcase_len = vol->upcase_len; - } else { - if (name && name != AT_UNNAMED) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return -1; - } - vol = NULL; - upcase = NULL; - upcase_len = 0; - } - /* - * Iterate over attributes in mft record starting at @ctx->attr, or the - * attribute following that, if @ctx->is_first is TRUE. - */ - if (ctx->is_first) { - a = ctx->attr; - ctx->is_first = FALSE; - } else - a = (ATTR_RECORD*)((char*)ctx->attr + - le32_to_cpu(ctx->attr->length)); - for (;; a = (ATTR_RECORD*)((char*)a + le32_to_cpu(a->length))) { - if (p2n(a) < p2n(ctx->mrec) || (char*)a > (char*)ctx->mrec + - le32_to_cpu(ctx->mrec->bytes_allocated)) - break; - ctx->attr = a; - if (((type != AT_UNUSED) && (le32_to_cpu(a->type) > - le32_to_cpu(type))) || - (a->type == AT_END)) { - errno = ENOENT; - return -1; - } - if (!a->length) - break; - /* If this is an enumeration return this attribute. */ - if (type == AT_UNUSED) - return 0; - if (a->type != type) - continue; - /* - * If @name is AT_UNNAMED we want an unnamed attribute. - * If @name is present, compare the two names. - * Otherwise, match any attribute. - */ - if (name == AT_UNNAMED) { - /* The search failed if the found attribute is named. */ - if (a->name_length) { - errno = ENOENT; - return -1; - } - } else { - register int rc; - if (name && ((rc = ntfs_names_full_collate(name, - name_len, (ntfschar*)((char*)a + - le16_to_cpu(a->name_offset)), - a->name_length, ic, - upcase, upcase_len)))) { - /* - * If @name collates before a->name, - * there is no matching attribute. - */ - if (rc < 0) { - errno = ENOENT; - return -1; - } - /* If the strings are not equal, continue search. */ - continue; - } - } - /* - * The names match or @name not present and attribute is - * unnamed. If no @val specified, we have found the attribute - * and are done. - */ - if (!val) - return 0; - /* @val is present; compare values. */ - else { - register int rc; - - rc = memcmp(val, (char*)a +le16_to_cpu(a->value_offset), - min(val_len, - le32_to_cpu(a->value_length))); - /* - * If @val collates before the current attribute's - * value, there is no matching attribute. - */ - if (!rc) { - register u32 avl; - avl = le32_to_cpu(a->value_length); - if (val_len == avl) - return 0; - if (val_len < avl) { - errno = ENOENT; - return -1; - } - } else if (rc < 0) { - errno = ENOENT; - return -1; - } - } - } - errno = EIO; - ntfs_log_perror("%s: Corrupt inode (%lld)", __FUNCTION__, - ctx->ntfs_ino ? (long long)ctx->ntfs_ino->mft_no : -1); - return -1; -} - -void ntfs_attr_name_free(char **name) -{ - if (*name) { - free(*name); - *name = NULL; - } -} - -char *ntfs_attr_name_get(const ntfschar *uname, const int uname_len) -{ - char *name = NULL; - int name_len; - - name_len = ntfs_ucstombs(uname, uname_len, &name, 0); - if (name_len < 0) { - ntfs_log_perror("ntfs_ucstombs"); - return NULL; - - } else if (name_len > 0) - return name; - - ntfs_attr_name_free(&name); - return NULL; -} - -/** - * ntfs_external_attr_find - find an attribute in the attribute list of an inode - * @type: attribute type to find - * @name: attribute name to find (optional, i.e. NULL means don't care) - * @name_len: attribute name length (only needed if @name present) - * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present) - * @lowest_vcn: lowest vcn to find (optional, non-resident attributes only) - * @val: attribute value to find (optional, resident attributes only) - * @val_len: attribute value length - * @ctx: search context with mft record and attribute to search from - * - * You shouldn't need to call this function directly. Use ntfs_attr_lookup() - * instead. - * - * Find an attribute by searching the attribute list for the corresponding - * attribute list entry. Having found the entry, map the mft record for read - * if the attribute is in a different mft record/inode, find the attribute in - * there and return it. - * - * If @type is AT_UNUSED, return the first found attribute, i.e. one can - * enumerate all attributes by setting @type to AT_UNUSED and then calling - * ntfs_external_attr_find() repeatedly until it returns -1 with errno set to - * ENOENT to indicate that there are no more entries. During the enumeration, - * each successful call of ntfs_external_attr_find() will return the next - * attribute described by the attribute list of the base mft record described - * by the search context @ctx. - * - * If @type is AT_END, seek to the end of the base mft record ignoring the - * attribute list completely and return -1 with errno set to ENOENT. AT_END is - * not a valid attribute, its length is zero for example, thus it is safer to - * return error instead of success in this case. - * - * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present - * but not AT_UNNAMED search for a named attribute matching @name. Otherwise, - * match both named and unnamed attributes. - * - * On first search @ctx->ntfs_ino must be the inode of the base mft record and - * @ctx must have been obtained from a call to ntfs_attr_get_search_ctx(). - * On subsequent calls, @ctx->ntfs_ino can be any extent inode, too - * (@ctx->base_ntfs_ino is then the base inode). - * - * After finishing with the attribute/mft record you need to call - * ntfs_attr_put_search_ctx() to cleanup the search context (unmapping any - * mapped extent inodes, etc). - * - * Return 0 if the search was successful and -1 if not, with errno set to the - * error code. - * - * On success, @ctx->attr is the found attribute, it is in mft record - * @ctx->mrec, and @ctx->al_entry is the attribute list entry for this - * attribute with @ctx->base_* being the base mft record to which @ctx->attr - * belongs. - * - * On error ENOENT, i.e. attribute not found, @ctx->attr is set to the - * attribute which collates just after the attribute being searched for in the - * base ntfs inode, i.e. if one wants to add the attribute to the mft record - * this is the correct place to insert it into, and if there is not enough - * space, the attribute should be placed in an extent mft record. - * @ctx->al_entry points to the position within @ctx->base_ntfs_ino->attr_list - * at which the new attribute's attribute list entry should be inserted. The - * other @ctx fields, base_ntfs_ino, base_mrec, and base_attr are set to NULL. - * The only exception to this is when @type is AT_END, in which case - * @ctx->al_entry is set to NULL also (see above). - * - * The following error codes are defined: - * ENOENT Attribute not found, not an error as such. - * EINVAL Invalid arguments. - * EIO I/O error or corrupt data structures found. - * ENOMEM Not enough memory to allocate necessary buffers. - */ -static int ntfs_external_attr_find(ATTR_TYPES type, const ntfschar *name, - const u32 name_len, const IGNORE_CASE_BOOL ic, - const VCN lowest_vcn, const u8 *val, const u32 val_len, - ntfs_attr_search_ctx *ctx) -{ - ntfs_inode *base_ni, *ni; - ntfs_volume *vol; - ATTR_LIST_ENTRY *al_entry, *next_al_entry; - u8 *al_start, *al_end; - ATTR_RECORD *a; - ntfschar *al_name; - u32 al_name_len; - BOOL is_first_search = FALSE; - - ni = ctx->ntfs_ino; - base_ni = ctx->base_ntfs_ino; - ntfs_log_trace("Entering for inode %lld, attribute type 0x%x.\n", - (unsigned long long)ni->mft_no, type); - if (!base_ni) { - /* First call happens with the base mft record. */ - base_ni = ctx->base_ntfs_ino = ctx->ntfs_ino; - ctx->base_mrec = ctx->mrec; - } - if (ni == base_ni) - ctx->base_attr = ctx->attr; - if (type == AT_END) - goto not_found; - vol = base_ni->vol; - al_start = base_ni->attr_list; - al_end = al_start + base_ni->attr_list_size; - if (!ctx->al_entry) { - ctx->al_entry = (ATTR_LIST_ENTRY*)al_start; - is_first_search = TRUE; - } - /* - * Iterate over entries in attribute list starting at @ctx->al_entry, - * or the entry following that, if @ctx->is_first is TRUE. - */ - if (ctx->is_first) { - al_entry = ctx->al_entry; - ctx->is_first = FALSE; - /* - * If an enumeration and the first attribute is higher than - * the attribute list itself, need to return the attribute list - * attribute. - */ - if ((type == AT_UNUSED) && is_first_search && - le32_to_cpu(al_entry->type) > - le32_to_cpu(AT_ATTRIBUTE_LIST)) - goto find_attr_list_attr; - } else { - al_entry = (ATTR_LIST_ENTRY*)((char*)ctx->al_entry + - le16_to_cpu(ctx->al_entry->length)); - /* - * If this is an enumeration and the attribute list attribute - * is the next one in the enumeration sequence, just return the - * attribute list attribute from the base mft record as it is - * not listed in the attribute list itself. - */ - if ((type == AT_UNUSED) && le32_to_cpu(ctx->al_entry->type) < - le32_to_cpu(AT_ATTRIBUTE_LIST) && - le32_to_cpu(al_entry->type) > - le32_to_cpu(AT_ATTRIBUTE_LIST)) { - int rc; -find_attr_list_attr: - - /* Check for bogus calls. */ - if (name || name_len || val || val_len || lowest_vcn) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return -1; - } - - /* We want the base record. */ - ctx->ntfs_ino = base_ni; - ctx->mrec = ctx->base_mrec; - ctx->is_first = TRUE; - /* Sanity checks are performed elsewhere. */ - ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + - le16_to_cpu(ctx->mrec->attrs_offset)); - - /* Find the attribute list attribute. */ - rc = ntfs_attr_find(AT_ATTRIBUTE_LIST, NULL, 0, - IGNORE_CASE, NULL, 0, ctx); - - /* - * Setup the search context so the correct - * attribute is returned next time round. - */ - ctx->al_entry = al_entry; - ctx->is_first = TRUE; - - /* Got it. Done. */ - if (!rc) - return 0; - - /* Error! If other than not found return it. */ - if (errno != ENOENT) - return rc; - - /* Not found?!? Absurd! */ - errno = EIO; - ntfs_log_error("Attribute list wasn't found"); - return -1; - } - } - for (;; al_entry = next_al_entry) { - /* Out of bounds check. */ - if ((u8*)al_entry < base_ni->attr_list || - (u8*)al_entry > al_end) - break; /* Inode is corrupt. */ - ctx->al_entry = al_entry; - /* Catch the end of the attribute list. */ - if ((u8*)al_entry == al_end) - goto not_found; - if (!al_entry->length) - break; - if ((u8*)al_entry + 6 > al_end || (u8*)al_entry + - le16_to_cpu(al_entry->length) > al_end) - break; - next_al_entry = (ATTR_LIST_ENTRY*)((u8*)al_entry + - le16_to_cpu(al_entry->length)); - if (type != AT_UNUSED) { - if (le32_to_cpu(al_entry->type) > le32_to_cpu(type)) - goto not_found; - if (type != al_entry->type) - continue; - } - al_name_len = al_entry->name_length; - al_name = (ntfschar*)((u8*)al_entry + al_entry->name_offset); - /* - * If !@type we want the attribute represented by this - * attribute list entry. - */ - if (type == AT_UNUSED) - goto is_enumeration; - /* - * If @name is AT_UNNAMED we want an unnamed attribute. - * If @name is present, compare the two names. - * Otherwise, match any attribute. - */ - if (name == AT_UNNAMED) { - if (al_name_len) - goto not_found; - } else { - int rc; - - if (name && ((rc = ntfs_names_full_collate(name, - name_len, al_name, al_name_len, ic, - vol->upcase, vol->upcase_len)))) { - - /* - * If @name collates before al_name, - * there is no matching attribute. - */ - if (rc < 0) - goto not_found; - /* If the strings are not equal, continue search. */ - continue; - } - } - /* - * The names match or @name not present and attribute is - * unnamed. Now check @lowest_vcn. Continue search if the - * next attribute list entry still fits @lowest_vcn. Otherwise - * we have reached the right one or the search has failed. - */ - if (lowest_vcn && (u8*)next_al_entry >= al_start && - (u8*)next_al_entry + 6 < al_end && - (u8*)next_al_entry + le16_to_cpu( - next_al_entry->length) <= al_end && - sle64_to_cpu(next_al_entry->lowest_vcn) <= - lowest_vcn && - next_al_entry->type == al_entry->type && - next_al_entry->name_length == al_name_len && - ntfs_names_are_equal((ntfschar*)((char*) - next_al_entry + - next_al_entry->name_offset), - next_al_entry->name_length, - al_name, al_name_len, CASE_SENSITIVE, - vol->upcase, vol->upcase_len)) - continue; -is_enumeration: - if (MREF_LE(al_entry->mft_reference) == ni->mft_no) { - if (MSEQNO_LE(al_entry->mft_reference) != - le16_to_cpu( - ni->mrec->sequence_number)) { - ntfs_log_error("Found stale mft reference in " - "attribute list!\n"); - break; - } - } else { /* Mft references do not match. */ - /* Do we want the base record back? */ - if (MREF_LE(al_entry->mft_reference) == - base_ni->mft_no) { - ni = ctx->ntfs_ino = base_ni; - ctx->mrec = ctx->base_mrec; - } else { - /* We want an extent record. */ - ni = ntfs_extent_inode_open(base_ni, - al_entry->mft_reference); - if (!ni) - break; - ctx->ntfs_ino = ni; - ctx->mrec = ni->mrec; - } - } - a = ctx->attr = (ATTR_RECORD*)((char*)ctx->mrec + - le16_to_cpu(ctx->mrec->attrs_offset)); - /* - * ctx->ntfs_ino, ctx->mrec, and ctx->attr now point to the - * mft record containing the attribute represented by the - * current al_entry. - * - * We could call into ntfs_attr_find() to find the right - * attribute in this mft record but this would be less - * efficient and not quite accurate as ntfs_attr_find() ignores - * the attribute instance numbers for example which become - * important when one plays with attribute lists. Also, because - * a proper match has been found in the attribute list entry - * above, the comparison can now be optimized. So it is worth - * re-implementing a simplified ntfs_attr_find() here. - * - * Use a manual loop so we can still use break and continue - * with the same meanings as above. - */ -do_next_attr_loop: - if ((char*)a < (char*)ctx->mrec || (char*)a > (char*)ctx->mrec + - le32_to_cpu(ctx->mrec->bytes_allocated)) - break; - if (a->type == AT_END) - continue; - if (!a->length) - break; - if (al_entry->instance != a->instance) - goto do_next_attr; - /* - * If the type and/or the name are/is mismatched between the - * attribute list entry and the attribute record, there is - * corruption so we break and return error EIO. - */ - if (al_entry->type != a->type) - break; - if (!ntfs_names_are_equal((ntfschar*)((char*)a + - le16_to_cpu(a->name_offset)), - a->name_length, al_name, - al_name_len, CASE_SENSITIVE, - vol->upcase, vol->upcase_len)) - break; - ctx->attr = a; - /* - * If no @val specified or @val specified and it matches, we - * have found it! Also, if !@type, it is an enumeration, so we - * want the current attribute. - */ - if ((type == AT_UNUSED) || !val || (!a->non_resident && - le32_to_cpu(a->value_length) == val_len && - !memcmp((char*)a + le16_to_cpu(a->value_offset), - val, val_len))) { - return 0; - } -do_next_attr: - /* Proceed to the next attribute in the current mft record. */ - a = (ATTR_RECORD*)((char*)a + le32_to_cpu(a->length)); - goto do_next_attr_loop; - } - if (ni != base_ni) { - ctx->ntfs_ino = base_ni; - ctx->mrec = ctx->base_mrec; - ctx->attr = ctx->base_attr; - } - errno = EIO; - ntfs_log_perror("Inode is corrupt (%lld)", (long long)base_ni->mft_no); - return -1; -not_found: - /* - * If we were looking for AT_END or we were enumerating and reached the - * end, we reset the search context @ctx and use ntfs_attr_find() to - * seek to the end of the base mft record. - */ - if (type == AT_UNUSED || type == AT_END) { - ntfs_attr_reinit_search_ctx(ctx); - return ntfs_attr_find(AT_END, name, name_len, ic, val, val_len, - ctx); - } - /* - * The attribute wasn't found. Before we return, we want to ensure - * @ctx->mrec and @ctx->attr indicate the position at which the - * attribute should be inserted in the base mft record. Since we also - * want to preserve @ctx->al_entry we cannot reinitialize the search - * context using ntfs_attr_reinit_search_ctx() as this would set - * @ctx->al_entry to NULL. Thus we do the necessary bits manually (see - * ntfs_attr_init_search_ctx() below). Note, we _only_ preserve - * @ctx->al_entry as the remaining fields (base_*) are identical to - * their non base_ counterparts and we cannot set @ctx->base_attr - * correctly yet as we do not know what @ctx->attr will be set to by - * the call to ntfs_attr_find() below. - */ - ctx->mrec = ctx->base_mrec; - ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + - le16_to_cpu(ctx->mrec->attrs_offset)); - ctx->is_first = TRUE; - ctx->ntfs_ino = ctx->base_ntfs_ino; - ctx->base_ntfs_ino = NULL; - ctx->base_mrec = NULL; - ctx->base_attr = NULL; - /* - * In case there are multiple matches in the base mft record, need to - * keep enumerating until we get an attribute not found response (or - * another error), otherwise we would keep returning the same attribute - * over and over again and all programs using us for enumeration would - * lock up in a tight loop. - */ - { - int ret; - - do { - ret = ntfs_attr_find(type, name, name_len, ic, val, - val_len, ctx); - } while (!ret); - return ret; - } -} - -/** - * ntfs_attr_lookup - find an attribute in an ntfs inode - * @type: attribute type to find - * @name: attribute name to find (optional, i.e. NULL means don't care) - * @name_len: attribute name length (only needed if @name present) - * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present) - * @lowest_vcn: lowest vcn to find (optional, non-resident attributes only) - * @val: attribute value to find (optional, resident attributes only) - * @val_len: attribute value length - * @ctx: search context with mft record and attribute to search from - * - * Find an attribute in an ntfs inode. On first search @ctx->ntfs_ino must - * be the base mft record and @ctx must have been obtained from a call to - * ntfs_attr_get_search_ctx(). - * - * This function transparently handles attribute lists and @ctx is used to - * continue searches where they were left off at. - * - * If @type is AT_UNUSED, return the first found attribute, i.e. one can - * enumerate all attributes by setting @type to AT_UNUSED and then calling - * ntfs_attr_lookup() repeatedly until it returns -1 with errno set to ENOENT - * to indicate that there are no more entries. During the enumeration, each - * successful call of ntfs_attr_lookup() will return the next attribute, with - * the current attribute being described by the search context @ctx. - * - * If @type is AT_END, seek to the end of the base mft record ignoring the - * attribute list completely and return -1 with errno set to ENOENT. AT_END is - * not a valid attribute, its length is zero for example, thus it is safer to - * return error instead of success in this case. It should never be needed to - * do this, but we implement the functionality because it allows for simpler - * code inside ntfs_external_attr_find(). - * - * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present - * but not AT_UNNAMED search for a named attribute matching @name. Otherwise, - * match both named and unnamed attributes. - * - * After finishing with the attribute/mft record you need to call - * ntfs_attr_put_search_ctx() to cleanup the search context (unmapping any - * mapped extent inodes, etc). - * - * Return 0 if the search was successful and -1 if not, with errno set to the - * error code. - * - * On success, @ctx->attr is the found attribute, it is in mft record - * @ctx->mrec, and @ctx->al_entry is the attribute list entry for this - * attribute with @ctx->base_* being the base mft record to which @ctx->attr - * belongs. If no attribute list attribute is present @ctx->al_entry and - * @ctx->base_* are NULL. - * - * On error ENOENT, i.e. attribute not found, @ctx->attr is set to the - * attribute which collates just after the attribute being searched for in the - * base ntfs inode, i.e. if one wants to add the attribute to the mft record - * this is the correct place to insert it into, and if there is not enough - * space, the attribute should be placed in an extent mft record. - * @ctx->al_entry points to the position within @ctx->base_ntfs_ino->attr_list - * at which the new attribute's attribute list entry should be inserted. The - * other @ctx fields, base_ntfs_ino, base_mrec, and base_attr are set to NULL. - * The only exception to this is when @type is AT_END, in which case - * @ctx->al_entry is set to NULL also (see above). - * - * - * The following error codes are defined: - * ENOENT Attribute not found, not an error as such. - * EINVAL Invalid arguments. - * EIO I/O error or corrupt data structures found. - * ENOMEM Not enough memory to allocate necessary buffers. - */ -int ntfs_attr_lookup(const ATTR_TYPES type, const ntfschar *name, - const u32 name_len, const IGNORE_CASE_BOOL ic, - const VCN lowest_vcn, const u8 *val, const u32 val_len, - ntfs_attr_search_ctx *ctx) -{ - ntfs_volume *vol; - ntfs_inode *base_ni; - int ret = -1; - - ntfs_log_enter("Entering for attribute type 0x%x\n", type); - - if (!ctx || !ctx->mrec || !ctx->attr || (name && name != AT_UNNAMED && - (!ctx->ntfs_ino || !(vol = ctx->ntfs_ino->vol) || - !vol->upcase || !vol->upcase_len))) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - goto out; - } - - if (ctx->base_ntfs_ino) - base_ni = ctx->base_ntfs_ino; - else - base_ni = ctx->ntfs_ino; - if (!base_ni || !NInoAttrList(base_ni) || type == AT_ATTRIBUTE_LIST) - ret = ntfs_attr_find(type, name, name_len, ic, val, val_len, ctx); - else - ret = ntfs_external_attr_find(type, name, name_len, ic, - lowest_vcn, val, val_len, ctx); -out: - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_attr_position - find given or next attribute type in an ntfs inode - * @type: attribute type to start lookup - * @ctx: search context with mft record and attribute to search from - * - * Find an attribute type in an ntfs inode or the next attribute which is not - * the AT_END attribute. Please see more details at ntfs_attr_lookup. - * - * Return 0 if the search was successful and -1 if not, with errno set to the - * error code. - * - * The following error codes are defined: - * EINVAL Invalid arguments. - * EIO I/O error or corrupt data structures found. - * ENOMEM Not enough memory to allocate necessary buffers. - * ENOSPC No attribute was found after 'type', only AT_END. - */ -int ntfs_attr_position(const ATTR_TYPES type, ntfs_attr_search_ctx *ctx) -{ - if (ntfs_attr_lookup(type, NULL, 0, CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (errno != ENOENT) - return -1; - if (ctx->attr->type == AT_END) { - errno = ENOSPC; - return -1; - } - } - return 0; -} - -/** - * ntfs_attr_init_search_ctx - initialize an attribute search context - * @ctx: attribute search context to initialize - * @ni: ntfs inode with which to initialize the search context - * @mrec: mft record with which to initialize the search context - * - * Initialize the attribute search context @ctx with @ni and @mrec. - */ -static void ntfs_attr_init_search_ctx(ntfs_attr_search_ctx *ctx, - ntfs_inode *ni, MFT_RECORD *mrec) -{ - if (!mrec) - mrec = ni->mrec; - ctx->mrec = mrec; - /* Sanity checks are performed elsewhere. */ - ctx->attr = (ATTR_RECORD*)((u8*)mrec + le16_to_cpu(mrec->attrs_offset)); - ctx->is_first = TRUE; - ctx->ntfs_ino = ni; - ctx->al_entry = NULL; - ctx->base_ntfs_ino = NULL; - ctx->base_mrec = NULL; - ctx->base_attr = NULL; -} - -/** - * ntfs_attr_reinit_search_ctx - reinitialize an attribute search context - * @ctx: attribute search context to reinitialize - * - * Reinitialize the attribute search context @ctx. - * - * This is used when a search for a new attribute is being started to reset - * the search context to the beginning. - */ -void ntfs_attr_reinit_search_ctx(ntfs_attr_search_ctx *ctx) -{ - if (!ctx->base_ntfs_ino) { - /* No attribute list. */ - ctx->is_first = TRUE; - /* Sanity checks are performed elsewhere. */ - ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + - le16_to_cpu(ctx->mrec->attrs_offset)); - /* - * This needs resetting due to ntfs_external_attr_find() which - * can leave it set despite having zeroed ctx->base_ntfs_ino. - */ - ctx->al_entry = NULL; - return; - } /* Attribute list. */ - ntfs_attr_init_search_ctx(ctx, ctx->base_ntfs_ino, ctx->base_mrec); - return; -} - -/** - * ntfs_attr_get_search_ctx - allocate/initialize a new attribute search context - * @ni: ntfs inode with which to initialize the search context - * @mrec: mft record with which to initialize the search context - * - * Allocate a new attribute search context, initialize it with @ni and @mrec, - * and return it. Return NULL on error with errno set. - * - * @mrec can be NULL, in which case the mft record is taken from @ni. - * - * Note: For low level utilities which know what they are doing we allow @ni to - * be NULL and @mrec to be set. Do NOT do this unless you understand the - * implications!!! For example it is no longer safe to call ntfs_attr_lookup(). - */ -ntfs_attr_search_ctx *ntfs_attr_get_search_ctx(ntfs_inode *ni, MFT_RECORD *mrec) -{ - ntfs_attr_search_ctx *ctx; - - if (!ni && !mrec) { - errno = EINVAL; - ntfs_log_perror("NULL arguments"); - return NULL; - } - ctx = ntfs_malloc(sizeof(ntfs_attr_search_ctx)); - if (ctx) - ntfs_attr_init_search_ctx(ctx, ni, mrec); - return ctx; -} - -/** - * ntfs_attr_put_search_ctx - release an attribute search context - * @ctx: attribute search context to free - * - * Release the attribute search context @ctx. - */ -void ntfs_attr_put_search_ctx(ntfs_attr_search_ctx *ctx) -{ - // NOTE: save errno if it could change and function stays void! - free(ctx); -} - -/** - * ntfs_attr_find_in_attrdef - find an attribute in the $AttrDef system file - * @vol: ntfs volume to which the attribute belongs - * @type: attribute type which to find - * - * Search for the attribute definition record corresponding to the attribute - * @type in the $AttrDef system file. - * - * Return the attribute type definition record if found and NULL if not found - * or an error occurred. On error the error code is stored in errno. The - * following error codes are defined: - * ENOENT - The attribute @type is not specified in $AttrDef. - * EINVAL - Invalid parameters (e.g. @vol is not valid). - */ -ATTR_DEF *ntfs_attr_find_in_attrdef(const ntfs_volume *vol, - const ATTR_TYPES type) -{ - ATTR_DEF *ad; - - if (!vol || !vol->attrdef || !type) { - errno = EINVAL; - ntfs_log_perror("%s: type=%d", __FUNCTION__, type); - return NULL; - } - for (ad = vol->attrdef; (u8*)ad - (u8*)vol->attrdef < - vol->attrdef_len && ad->type; ++ad) { - /* We haven't found it yet, carry on searching. */ - if (le32_to_cpu(ad->type) < le32_to_cpu(type)) - continue; - /* We found the attribute; return it. */ - if (ad->type == type) - return ad; - /* We have gone too far already. No point in continuing. */ - break; - } - errno = ENOENT; - ntfs_log_perror("%s: type=%d", __FUNCTION__, type); - return NULL; -} - -/** - * ntfs_attr_size_bounds_check - check a size of an attribute type for validity - * @vol: ntfs volume to which the attribute belongs - * @type: attribute type which to check - * @size: size which to check - * - * Check whether the @size in bytes is valid for an attribute of @type on the - * ntfs volume @vol. This information is obtained from $AttrDef system file. - * - * Return 0 if valid and -1 if not valid or an error occurred. On error the - * error code is stored in errno. The following error codes are defined: - * ERANGE - @size is not valid for the attribute @type. - * ENOENT - The attribute @type is not specified in $AttrDef. - * EINVAL - Invalid parameters (e.g. @size is < 0 or @vol is not valid). - */ -int ntfs_attr_size_bounds_check(const ntfs_volume *vol, const ATTR_TYPES type, - const s64 size) -{ - ATTR_DEF *ad; - s64 min_size, max_size; - - if (size < 0) { - errno = EINVAL; - ntfs_log_perror("%s: size=%lld", __FUNCTION__, - (long long)size); - return -1; - } - - /* - * $ATTRIBUTE_LIST shouldn't be greater than 0x40000, otherwise - * Windows would crash. This is not listed in the AttrDef. - */ - if (type == AT_ATTRIBUTE_LIST && size > 0x40000) { - errno = ERANGE; - ntfs_log_perror("Too large attrlist (%lld)", (long long)size); - return -1; - } - - ad = ntfs_attr_find_in_attrdef(vol, type); - if (!ad) - return -1; - - min_size = sle64_to_cpu(ad->min_size); - max_size = sle64_to_cpu(ad->max_size); - - if ((min_size && (size < min_size)) || - ((max_size > 0) && (size > max_size))) { - errno = ERANGE; - ntfs_log_perror("Attr type %d size check failed (min,size,max=" - "%lld,%lld,%lld)", type, (long long)min_size, - (long long)size, (long long)max_size); - return -1; - } - return 0; -} - -/** - * ntfs_attr_can_be_non_resident - check if an attribute can be non-resident - * @vol: ntfs volume to which the attribute belongs - * @type: attribute type to check - * @name: attribute name to check - * @name_len: attribute name length - * - * Check whether the attribute of @type and @name with name length @name_len on - * the ntfs volume @vol is allowed to be non-resident. This information is - * obtained from $AttrDef system file and is augmented by rules imposed by - * Microsoft (e.g. see http://support.microsoft.com/kb/974729/). - * - * Return 0 if the attribute is allowed to be non-resident and -1 if not or an - * error occurred. On error the error code is stored in errno. The following - * error codes are defined: - * EPERM - The attribute is not allowed to be non-resident. - * ENOENT - The attribute @type is not specified in $AttrDef. - * EINVAL - Invalid parameters (e.g. @vol is not valid). - */ -static int ntfs_attr_can_be_non_resident(const ntfs_volume *vol, const ATTR_TYPES type, - const ntfschar *name, int name_len) -{ - ATTR_DEF *ad; - BOOL allowed; - - /* - * Microsoft has decreed that $LOGGED_UTILITY_STREAM attributes with a - * name of $TXF_DATA must be resident despite the entry for - * $LOGGED_UTILITY_STREAM in $AttrDef allowing them to be non-resident. - * Failure to obey this on the root directory mft record of a volume - * causes Windows Vista and later to see the volume as a RAW volume and - * thus cannot mount it at all. - */ - if ((type == AT_LOGGED_UTILITY_STREAM) - && name - && ntfs_names_are_equal(TXF_DATA, 9, name, name_len, - CASE_SENSITIVE, vol->upcase, vol->upcase_len)) - allowed = FALSE; - else { - /* Find the attribute definition record in $AttrDef. */ - ad = ntfs_attr_find_in_attrdef(vol, type); - if (!ad) - return -1; - /* Check the flags and return the result. */ - allowed = !(ad->flags & ATTR_DEF_RESIDENT); - } - if (!allowed) { - errno = EPERM; - ntfs_log_trace("Attribute can't be non-resident\n"); - return -1; - } - return 0; -} - -/** - * ntfs_attr_can_be_resident - check if an attribute can be resident - * @vol: ntfs volume to which the attribute belongs - * @type: attribute type which to check - * - * Check whether the attribute of @type on the ntfs volume @vol is allowed to - * be resident. This information is derived from our ntfs knowledge and may - * not be completely accurate, especially when user defined attributes are - * present. Basically we allow everything to be resident except for index - * allocation and extended attribute attributes. - * - * Return 0 if the attribute is allowed to be resident and -1 if not or an - * error occurred. On error the error code is stored in errno. The following - * error codes are defined: - * EPERM - The attribute is not allowed to be resident. - * EINVAL - Invalid parameters (e.g. @vol is not valid). - * - * Warning: In the system file $MFT the attribute $Bitmap must be non-resident - * otherwise windows will not boot (blue screen of death)! We cannot - * check for this here as we don't know which inode's $Bitmap is being - * asked about so the caller needs to special case this. - */ -int ntfs_attr_can_be_resident(const ntfs_volume *vol, const ATTR_TYPES type) -{ - if (!vol || !vol->attrdef || !type) { - errno = EINVAL; - return -1; - } - if (type != AT_INDEX_ALLOCATION) - return 0; - - ntfs_log_trace("Attribute can't be resident\n"); - errno = EPERM; - return -1; -} - -/** - * ntfs_make_room_for_attr - make room for an attribute inside an mft record - * @m: mft record - * @pos: position at which to make space - * @size: byte size to make available at this position - * - * @pos points to the attribute in front of which we want to make space. - * - * Return 0 on success or -1 on error. On error the error code is stored in - * errno. Possible error codes are: - * ENOSPC - There is not enough space available to complete operation. The - * caller has to make space before calling this. - * EINVAL - Input parameters were faulty. - */ -int ntfs_make_room_for_attr(MFT_RECORD *m, u8 *pos, u32 size) -{ - u32 biu; - - ntfs_log_trace("Entering for pos 0x%d, size %u.\n", - (int)(pos - (u8*)m), (unsigned) size); - - /* Make size 8-byte alignment. */ - size = (size + 7) & ~7; - - /* Rigorous consistency checks. */ - if (!m || !pos || pos < (u8*)m) { - errno = EINVAL; - ntfs_log_perror("%s: pos=%p m=%p", __FUNCTION__, pos, m); - return -1; - } - /* The -8 is for the attribute terminator. */ - if (pos - (u8*)m > (int)le32_to_cpu(m->bytes_in_use) - 8) { - errno = EINVAL; - return -1; - } - /* Nothing to do. */ - if (!size) - return 0; - - biu = le32_to_cpu(m->bytes_in_use); - /* Do we have enough space? */ - if (biu + size > le32_to_cpu(m->bytes_allocated) || - pos + size > (u8*)m + le32_to_cpu(m->bytes_allocated)) { - errno = ENOSPC; - ntfs_log_trace("No enough space in the MFT record\n"); - return -1; - } - /* Move everything after pos to pos + size. */ - memmove(pos + size, pos, biu - (pos - (u8*)m)); - /* Update mft record. */ - m->bytes_in_use = cpu_to_le32(biu + size); - return 0; -} - -/** - * ntfs_resident_attr_record_add - add resident attribute to inode - * @ni: opened ntfs inode to which MFT record add attribute - * @type: type of the new attribute - * @name: name of the new attribute - * @name_len: name length of the new attribute - * @val: value of the new attribute - * @size: size of new attribute (length of @val, if @val != NULL) - * @flags: flags of the new attribute - * - * Return offset to attribute from the beginning of the mft record on success - * and -1 on error. On error the error code is stored in errno. - * Possible error codes are: - * EINVAL - Invalid arguments passed to function. - * EEXIST - Attribute of such type and with same name already exists. - * EIO - I/O error occurred or damaged filesystem. - */ -int ntfs_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, u8 *val, u32 size, - ATTR_FLAGS data_flags) -{ - ntfs_attr_search_ctx *ctx; - u32 length; - ATTR_RECORD *a; - MFT_RECORD *m; - int err, offset; - ntfs_inode *base_ni; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, flags 0x%x.\n", - (long long) ni->mft_no, (unsigned) type, (unsigned) data_flags); - - if (!ni || (!name && name_len)) { - errno = EINVAL; - return -1; - } - - if (ntfs_attr_can_be_resident(ni->vol, type)) { - if (errno == EPERM) - ntfs_log_trace("Attribute can't be resident.\n"); - else - ntfs_log_trace("ntfs_attr_can_be_resident failed.\n"); - return -1; - } - - /* Locate place where record should be. */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return -1; - /* - * Use ntfs_attr_find instead of ntfs_attr_lookup to find place for - * attribute in @ni->mrec, not any extent inode in case if @ni is base - * file record. - */ - if (!ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, val, size, - ctx)) { - err = EEXIST; - ntfs_log_trace("Attribute already present.\n"); - goto put_err_out; - } - if (errno != ENOENT) { - err = EIO; - goto put_err_out; - } - a = ctx->attr; - m = ctx->mrec; - - /* Make room for attribute. */ - length = offsetof(ATTR_RECORD, resident_end) + - ((name_len * sizeof(ntfschar) + 7) & ~7) + - ((size + 7) & ~7); - if (ntfs_make_room_for_attr(ctx->mrec, (u8*) ctx->attr, length)) { - err = errno; - ntfs_log_trace("Failed to make room for attribute.\n"); - goto put_err_out; - } - - /* Setup record fields. */ - offset = ((u8*)a - (u8*)m); - a->type = type; - a->length = cpu_to_le32(length); - a->non_resident = 0; - a->name_length = name_len; - a->name_offset = (name_len - ? cpu_to_le16(offsetof(ATTR_RECORD, resident_end)) - : const_cpu_to_le16(0)); - a->flags = data_flags; - a->instance = m->next_attr_instance; - a->value_length = cpu_to_le32(size); - a->value_offset = cpu_to_le16(length - ((size + 7) & ~7)); - if (val) - memcpy((u8*)a + le16_to_cpu(a->value_offset), val, size); - else - memset((u8*)a + le16_to_cpu(a->value_offset), 0, size); - if (type == AT_FILE_NAME) - a->resident_flags = RESIDENT_ATTR_IS_INDEXED; - else - a->resident_flags = 0; - if (name_len) - memcpy((u8*)a + le16_to_cpu(a->name_offset), - name, sizeof(ntfschar) * name_len); - m->next_attr_instance = - cpu_to_le16((le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); - if (ni->nr_extents == -1) - base_ni = ni->base_ni; - else - base_ni = ni; - if (type != AT_ATTRIBUTE_LIST && NInoAttrList(base_ni)) { - if (ntfs_attrlist_entry_add(ni, a)) { - err = errno; - ntfs_attr_record_resize(m, a, 0); - ntfs_log_trace("Failed add attribute entry to " - "ATTRIBUTE_LIST.\n"); - goto put_err_out; - } - } - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY - ? type == AT_INDEX_ROOT && name == NTFS_INDEX_I30 - : type == AT_DATA && name == AT_UNNAMED) { - ni->data_size = size; - ni->allocated_size = (size + 7) & ~7; - set_nino_flag(ni,KnownSize); - } - ntfs_inode_mark_dirty(ni); - ntfs_attr_put_search_ctx(ctx); - return offset; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - -/** - * ntfs_non_resident_attr_record_add - add extent of non-resident attribute - * @ni: opened ntfs inode to which MFT record add attribute - * @type: type of the new attribute extent - * @name: name of the new attribute extent - * @name_len: name length of the new attribute extent - * @lowest_vcn: lowest vcn of the new attribute extent - * @dataruns_size: dataruns size of the new attribute extent - * @flags: flags of the new attribute extent - * - * Return offset to attribute from the beginning of the mft record on success - * and -1 on error. On error the error code is stored in errno. - * Possible error codes are: - * EINVAL - Invalid arguments passed to function. - * EEXIST - Attribute of such type, with same lowest vcn and with same - * name already exists. - * EIO - I/O error occurred or damaged filesystem. - */ -int ntfs_non_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, VCN lowest_vcn, int dataruns_size, - ATTR_FLAGS flags) -{ - ntfs_attr_search_ctx *ctx; - u32 length; - ATTR_RECORD *a; - MFT_RECORD *m; - ntfs_inode *base_ni; - int err, offset; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, lowest_vcn %lld, " - "dataruns_size %d, flags 0x%x.\n", - (long long) ni->mft_no, (unsigned) type, - (long long) lowest_vcn, dataruns_size, (unsigned) flags); - - if (!ni || dataruns_size <= 0 || (!name && name_len)) { - errno = EINVAL; - return -1; - } - - if (ntfs_attr_can_be_non_resident(ni->vol, type, name, name_len)) { - if (errno == EPERM) - ntfs_log_perror("Attribute can't be non resident"); - else - ntfs_log_perror("ntfs_attr_can_be_non_resident failed"); - return -1; - } - - /* Locate place where record should be. */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return -1; - /* - * Use ntfs_attr_find instead of ntfs_attr_lookup to find place for - * attribute in @ni->mrec, not any extent inode in case if @ni is base - * file record. - */ - if (!ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, NULL, 0, - ctx)) { - err = EEXIST; - ntfs_log_perror("Attribute 0x%x already present", type); - goto put_err_out; - } - if (errno != ENOENT) { - ntfs_log_perror("ntfs_attr_find failed"); - err = EIO; - goto put_err_out; - } - a = ctx->attr; - m = ctx->mrec; - - /* Make room for attribute. */ - dataruns_size = (dataruns_size + 7) & ~7; - length = offsetof(ATTR_RECORD, compressed_size) + ((sizeof(ntfschar) * - name_len + 7) & ~7) + dataruns_size + - ((flags & (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE)) ? - sizeof(a->compressed_size) : 0); - if (ntfs_make_room_for_attr(ctx->mrec, (u8*) ctx->attr, length)) { - err = errno; - ntfs_log_perror("Failed to make room for attribute"); - goto put_err_out; - } - - /* Setup record fields. */ - a->type = type; - a->length = cpu_to_le32(length); - a->non_resident = 1; - a->name_length = name_len; - a->name_offset = cpu_to_le16(offsetof(ATTR_RECORD, compressed_size) + - ((flags & (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE)) ? - sizeof(a->compressed_size) : 0)); - a->flags = flags; - a->instance = m->next_attr_instance; - a->lowest_vcn = cpu_to_sle64(lowest_vcn); - a->mapping_pairs_offset = cpu_to_le16(length - dataruns_size); - a->compression_unit = (flags & ATTR_IS_COMPRESSED) - ? STANDARD_COMPRESSION_UNIT : 0; - /* If @lowest_vcn == 0, than setup empty attribute. */ - if (!lowest_vcn) { - a->highest_vcn = cpu_to_sle64(-1); - a->allocated_size = 0; - a->data_size = 0; - a->initialized_size = 0; - /* Set empty mapping pairs. */ - *((u8*)a + le16_to_cpu(a->mapping_pairs_offset)) = 0; - } - if (name_len) - memcpy((u8*)a + le16_to_cpu(a->name_offset), - name, sizeof(ntfschar) * name_len); - m->next_attr_instance = - cpu_to_le16((le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); - if (ni->nr_extents == -1) - base_ni = ni->base_ni; - else - base_ni = ni; - if (type != AT_ATTRIBUTE_LIST && NInoAttrList(base_ni)) { - if (ntfs_attrlist_entry_add(ni, a)) { - err = errno; - ntfs_log_perror("Failed add attr entry to attrlist"); - ntfs_attr_record_resize(m, a, 0); - goto put_err_out; - } - } - ntfs_inode_mark_dirty(ni); - /* - * Locate offset from start of the MFT record where new attribute is - * placed. We need relookup it, because record maybe moved during - * update of attribute list. - */ - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE, - lowest_vcn, NULL, 0, ctx)) { - ntfs_log_perror("%s: attribute lookup failed", __FUNCTION__); - ntfs_attr_put_search_ctx(ctx); - return -1; - - } - offset = (u8*)ctx->attr - (u8*)ctx->mrec; - ntfs_attr_put_search_ctx(ctx); - return offset; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - -/** - * ntfs_attr_record_rm - remove attribute extent - * @ctx: search context describing the attribute which should be removed - * - * If this function succeed, user should reinit search context if he/she wants - * use it anymore. - * - * Return 0 on success and -1 on error. On error the error code is stored in - * errno. Possible error codes are: - * EINVAL - Invalid arguments passed to function. - * EIO - I/O error occurred or damaged filesystem. - */ -int ntfs_attr_record_rm(ntfs_attr_search_ctx *ctx) -{ - ntfs_inode *base_ni, *ni; - ATTR_TYPES type; - - if (!ctx || !ctx->ntfs_ino || !ctx->mrec || !ctx->attr) { - errno = EINVAL; - return -1; - } - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", - (long long) ctx->ntfs_ino->mft_no, - (unsigned) le32_to_cpu(ctx->attr->type)); - type = ctx->attr->type; - ni = ctx->ntfs_ino; - if (ctx->base_ntfs_ino) - base_ni = ctx->base_ntfs_ino; - else - base_ni = ctx->ntfs_ino; - - /* Remove attribute itself. */ - if (ntfs_attr_record_resize(ctx->mrec, ctx->attr, 0)) { - ntfs_log_trace("Couldn't remove attribute record. Bug or damaged MFT " - "record.\n"); - if (NInoAttrList(base_ni) && type != AT_ATTRIBUTE_LIST) - if (ntfs_attrlist_entry_add(ni, ctx->attr)) - ntfs_log_trace("Rollback failed. Leaving inconstant " - "metadata.\n"); - errno = EIO; - return -1; - } - ntfs_inode_mark_dirty(ni); - - /* - * Remove record from $ATTRIBUTE_LIST if present and we don't want - * delete $ATTRIBUTE_LIST itself. - */ - if (NInoAttrList(base_ni) && type != AT_ATTRIBUTE_LIST) { - if (ntfs_attrlist_entry_rm(ctx)) { - ntfs_log_trace("Couldn't delete record from " - "$ATTRIBUTE_LIST.\n"); - return -1; - } - } - - /* Post $ATTRIBUTE_LIST delete setup. */ - if (type == AT_ATTRIBUTE_LIST) { - if (NInoAttrList(base_ni) && base_ni->attr_list) - free(base_ni->attr_list); - base_ni->attr_list = NULL; - NInoClearAttrList(base_ni); - NInoAttrListClearDirty(base_ni); - } - - /* Free MFT record, if it doesn't contain attributes. */ - if (le32_to_cpu(ctx->mrec->bytes_in_use) - - le16_to_cpu(ctx->mrec->attrs_offset) == 8) { - if (ntfs_mft_record_free(ni->vol, ni)) { - // FIXME: We need rollback here. - ntfs_log_trace("Couldn't free MFT record.\n"); - errno = EIO; - return -1; - } - /* Remove done if we freed base inode. */ - if (ni == base_ni) - return 0; - } - - if (type == AT_ATTRIBUTE_LIST || !NInoAttrList(base_ni)) - return 0; - - /* Remove attribute list if we don't need it any more. */ - if (!ntfs_attrlist_need(base_ni)) { - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(AT_ATTRIBUTE_LIST, NULL, 0, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - /* - * FIXME: Should we succeed here? Definitely something - * goes wrong because NInoAttrList(base_ni) returned - * that we have got attribute list. - */ - ntfs_log_trace("Couldn't find attribute list. Succeed " - "anyway.\n"); - return 0; - } - /* Deallocate clusters. */ - if (ctx->attr->non_resident) { - runlist *al_rl; - - al_rl = ntfs_mapping_pairs_decompress(base_ni->vol, - ctx->attr, NULL); - if (!al_rl) { - ntfs_log_trace("Couldn't decompress attribute list " - "runlist. Succeed anyway.\n"); - return 0; - } - if (ntfs_cluster_free_from_rl(base_ni->vol, al_rl)) { - ntfs_log_trace("Leaking clusters! Run chkdsk. " - "Couldn't free clusters from " - "attribute list runlist.\n"); - } - free(al_rl); - } - /* Remove attribute record itself. */ - if (ntfs_attr_record_rm(ctx)) { - /* - * FIXME: Should we succeed here? BTW, chkdsk doesn't - * complain if it find MFT record with attribute list, - * but without extents. - */ - ntfs_log_trace("Couldn't remove attribute list. Succeed " - "anyway.\n"); - return 0; - } - } - return 0; -} - -/** - * ntfs_attr_add - add attribute to inode - * @ni: opened ntfs inode to which add attribute - * @type: type of the new attribute - * @name: name in unicode of the new attribute - * @name_len: name length in unicode characters of the new attribute - * @val: value of new attribute - * @size: size of the new attribute / length of @val (if specified) - * - * @val should always be specified for always resident attributes (eg. FILE_NAME - * attribute), for attributes that can become non-resident @val can be NULL - * (eg. DATA attribute). @size can be specified even if @val is NULL, in this - * case data size will be equal to @size and initialized size will be equal - * to 0. - * - * If inode haven't got enough space to add attribute, add attribute to one of - * it extents, if no extents present or no one of them have enough space, than - * allocate new extent and add attribute to it. - * - * If on one of this steps attribute list is needed but not present, than it is - * added transparently to caller. So, this function should not be called with - * @type == AT_ATTRIBUTE_LIST, if you really need to add attribute list call - * ntfs_inode_add_attrlist instead. - * - * On success return 0. On error return -1 with errno set to the error code. - */ -int ntfs_attr_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, u8 *val, s64 size) -{ - u32 attr_rec_size; - int err, i, offset; - BOOL is_resident; - BOOL can_be_non_resident = FALSE; - ntfs_inode *attr_ni; - ntfs_attr *na; - ATTR_FLAGS data_flags; - - if (!ni || size < 0 || type == AT_ATTRIBUTE_LIST) { - errno = EINVAL; - ntfs_log_perror("%s: ni=%p size=%lld", __FUNCTION__, ni, - (long long)size); - return -1; - } - - ntfs_log_trace("Entering for inode %lld, attr %x, size %lld.\n", - (long long)ni->mft_no, type, (long long)size); - - if (ni->nr_extents == -1) - ni = ni->base_ni; - - /* Check the attribute type and the size. */ - if (ntfs_attr_size_bounds_check(ni->vol, type, size)) { - if (errno == ENOENT) - errno = EIO; - return -1; - } - - /* Sanity checks for always resident attributes. */ - if (ntfs_attr_can_be_non_resident(ni->vol, type, name, name_len)) { - if (errno != EPERM) { - err = errno; - ntfs_log_perror("ntfs_attr_can_be_non_resident failed"); - goto err_out; - } - /* @val is mandatory. */ - if (!val) { - errno = EINVAL; - ntfs_log_perror("val is mandatory for always resident " - "attributes"); - return -1; - } - if (size > ni->vol->mft_record_size) { - errno = ERANGE; - ntfs_log_perror("Attribute is too big"); - return -1; - } - } else - can_be_non_resident = TRUE; - - /* - * Determine resident or not will be new attribute. We add 8 to size in - * non resident case for mapping pairs. - */ - if (!ntfs_attr_can_be_resident(ni->vol, type)) { - is_resident = TRUE; - } else { - if (errno != EPERM) { - err = errno; - ntfs_log_perror("ntfs_attr_can_be_resident failed"); - goto err_out; - } - is_resident = FALSE; - } - /* Calculate attribute record size. */ - if (is_resident) - attr_rec_size = offsetof(ATTR_RECORD, resident_end) + - ((name_len * sizeof(ntfschar) + 7) & ~7) + - ((size + 7) & ~7); - else - attr_rec_size = offsetof(ATTR_RECORD, non_resident_end) + - ((name_len * sizeof(ntfschar) + 7) & ~7) + 8; - - /* - * If we have enough free space for the new attribute in the base MFT - * record, then add attribute to it. - */ - if (le32_to_cpu(ni->mrec->bytes_allocated) - - le32_to_cpu(ni->mrec->bytes_in_use) >= attr_rec_size) { - attr_ni = ni; - goto add_attr_record; - } - - /* Try to add to extent inodes. */ - if (ntfs_inode_attach_all_extents(ni)) { - err = errno; - ntfs_log_perror("Failed to attach all extents to inode"); - goto err_out; - } - for (i = 0; i < ni->nr_extents; i++) { - attr_ni = ni->extent_nis[i]; - if (le32_to_cpu(attr_ni->mrec->bytes_allocated) - - le32_to_cpu(attr_ni->mrec->bytes_in_use) >= - attr_rec_size) - goto add_attr_record; - } - - /* There is no extent that contain enough space for new attribute. */ - if (!NInoAttrList(ni)) { - /* Add attribute list not present, add it and retry. */ - if (ntfs_inode_add_attrlist(ni)) { - err = errno; - ntfs_log_perror("Failed to add attribute list"); - goto err_out; - } - return ntfs_attr_add(ni, type, name, name_len, val, size); - } - /* Allocate new extent. */ - attr_ni = ntfs_mft_record_alloc(ni->vol, ni); - if (!attr_ni) { - err = errno; - ntfs_log_perror("Failed to allocate extent record"); - goto err_out; - } - -add_attr_record: - if ((ni->flags & FILE_ATTR_COMPRESSED) - && (ni->vol->major_ver >= 3) - && NVolCompression(ni->vol) - && (ni->vol->cluster_size <= MAX_COMPRESSION_CLUSTER_SIZE) - && ((type == AT_DATA) - || ((type == AT_INDEX_ROOT) && (name == NTFS_INDEX_I30)))) - data_flags = ATTR_IS_COMPRESSED; - else - data_flags = const_cpu_to_le16(0); - if (is_resident) { - /* Add resident attribute. */ - offset = ntfs_resident_attr_record_add(attr_ni, type, name, - name_len, val, size, data_flags); - if (offset < 0) { - if (errno == ENOSPC && can_be_non_resident) - goto add_non_resident; - err = errno; - ntfs_log_perror("Failed to add resident attribute"); - goto free_err_out; - } - return 0; - } - -add_non_resident: - /* Add non resident attribute. */ - offset = ntfs_non_resident_attr_record_add(attr_ni, type, name, - name_len, 0, 8, data_flags); - if (offset < 0) { - err = errno; - ntfs_log_perror("Failed to add non resident attribute"); - goto free_err_out; - } - - /* If @size == 0, we are done. */ - if (!size) - return 0; - - /* Open new attribute and resize it. */ - na = ntfs_attr_open(ni, type, name, name_len); - if (!na) { - err = errno; - ntfs_log_perror("Failed to open just added attribute"); - goto rm_attr_err_out; - } - /* Resize and set attribute value. */ - if (ntfs_attr_truncate(na, size) || - (val && (ntfs_attr_pwrite(na, 0, size, val) != size))) { - err = errno; - ntfs_log_perror("Failed to initialize just added attribute"); - if (ntfs_attr_rm(na)) - ntfs_log_perror("Failed to remove just added attribute"); - ntfs_attr_close(na); - goto err_out; - } - ntfs_attr_close(na); - return 0; - -rm_attr_err_out: - /* Remove just added attribute. */ - if (ntfs_attr_record_resize(attr_ni->mrec, - (ATTR_RECORD*)((u8*)attr_ni->mrec + offset), 0)) - ntfs_log_perror("Failed to remove just added attribute #2"); -free_err_out: - /* Free MFT record, if it doesn't contain attributes. */ - if (le32_to_cpu(attr_ni->mrec->bytes_in_use) - - le16_to_cpu(attr_ni->mrec->attrs_offset) == 8) - if (ntfs_mft_record_free(attr_ni->vol, attr_ni)) - ntfs_log_perror("Failed to free MFT record"); -err_out: - errno = err; - return -1; -} - -/* - * Change an attribute flag - */ - -int ntfs_attr_set_flags(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, ATTR_FLAGS flags, ATTR_FLAGS mask) -{ - ntfs_attr_search_ctx *ctx; - int res; - - res = -1; - /* Search for designated attribute */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (ctx) { - if (!ntfs_attr_lookup(type, name, name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - /* do the requested change (all small endian le16) */ - ctx->attr->flags = (ctx->attr->flags & ~mask) - | (flags & mask); - NInoSetDirty(ni); - res = 0; - } - ntfs_attr_put_search_ctx(ctx); - } - return (res); -} - - -/** - * ntfs_attr_rm - remove attribute from ntfs inode - * @na: opened ntfs attribute to delete - * - * Remove attribute and all it's extents from ntfs inode. If attribute was non - * resident also free all clusters allocated by attribute. - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -int ntfs_attr_rm(ntfs_attr *na) -{ - ntfs_attr_search_ctx *ctx; - int ret = 0; - - if (!na) { - ntfs_log_trace("Invalid arguments passed.\n"); - errno = EINVAL; - return -1; - } - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", - (long long) na->ni->mft_no, na->type); - - /* Free cluster allocation. */ - if (NAttrNonResident(na)) { - if (ntfs_attr_map_whole_runlist(na)) - return -1; - if (ntfs_cluster_free(na->ni->vol, na, 0, -1) < 0) { - ntfs_log_trace("Failed to free cluster allocation. Leaving " - "inconstant metadata.\n"); - ret = -1; - } - } - - /* Search for attribute extents and remove them all. */ - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - while (!ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (ntfs_attr_record_rm(ctx)) { - ntfs_log_trace("Failed to remove attribute extent. Leaving " - "inconstant metadata.\n"); - ret = -1; - } - ntfs_attr_reinit_search_ctx(ctx); - } - ntfs_attr_put_search_ctx(ctx); - if (errno != ENOENT) { - ntfs_log_trace("Attribute lookup failed. Probably leaving inconstant " - "metadata.\n"); - ret = -1; - } - - return ret; -} - -/** - * ntfs_attr_record_resize - resize an attribute record - * @m: mft record containing attribute record - * @a: attribute record to resize - * @new_size: new size in bytes to which to resize the attribute record @a - * - * Resize the attribute record @a, i.e. the resident part of the attribute, in - * the mft record @m to @new_size bytes. - * - * Return 0 on success and -1 on error with errno set to the error code. - * The following error codes are defined: - * ENOSPC - Not enough space in the mft record @m to perform the resize. - * Note that on error no modifications have been performed whatsoever. - * - * Warning: If you make a record smaller without having copied all the data you - * are interested in the data may be overwritten! - */ -int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size) -{ - u32 old_size, alloc_size, attr_size; - - old_size = le32_to_cpu(m->bytes_in_use); - alloc_size = le32_to_cpu(m->bytes_allocated); - attr_size = le32_to_cpu(a->length); - - ntfs_log_trace("Sizes: old=%u alloc=%u attr=%u new=%u\n", - (unsigned)old_size, (unsigned)alloc_size, - (unsigned)attr_size, (unsigned)new_size); - - /* Align to 8 bytes, just in case the caller hasn't. */ - new_size = (new_size + 7) & ~7; - - /* If the actual attribute length has changed, move things around. */ - if (new_size != attr_size) { - - u32 new_muse = old_size - attr_size + new_size; - - /* Not enough space in this mft record. */ - if (new_muse > alloc_size) { - errno = ENOSPC; - ntfs_log_trace("Not enough space in the MFT record " - "(%u > %u)\n", new_muse, alloc_size); - return -1; - } - - if (a->type == AT_INDEX_ROOT && new_size > attr_size && - new_muse + 120 > alloc_size && old_size + 120 <= alloc_size) { - errno = ENOSPC; - ntfs_log_trace("Too big INDEX_ROOT (%u > %u)\n", - new_muse, alloc_size); - return STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT; - } - - /* Move attributes following @a to their new location. */ - memmove((u8 *)a + new_size, (u8 *)a + attr_size, - old_size - ((u8 *)a - (u8 *)m) - attr_size); - - /* Adjust @m to reflect the change in used space. */ - m->bytes_in_use = cpu_to_le32(new_muse); - - /* Adjust @a to reflect the new size. */ - if (new_size >= offsetof(ATTR_REC, length) + sizeof(a->length)) - a->length = cpu_to_le32(new_size); - } - return 0; -} - -/** - * ntfs_resident_attr_value_resize - resize the value of a resident attribute - * @m: mft record containing attribute record - * @a: attribute record whose value to resize - * @new_size: new size in bytes to which to resize the attribute value of @a - * - * Resize the value of the attribute @a in the mft record @m to @new_size bytes. - * If the value is made bigger, the newly "allocated" space is cleared. - * - * Return 0 on success and -1 on error with errno set to the error code. - * The following error codes are defined: - * ENOSPC - Not enough space in the mft record @m to perform the resize. - * Note that on error no modifications have been performed whatsoever. - */ -int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a, - const u32 new_size) -{ - int ret; - - ntfs_log_trace("Entering for new size %u.\n", (unsigned)new_size); - - /* Resize the resident part of the attribute record. */ - if ((ret = ntfs_attr_record_resize(m, a, (le16_to_cpu(a->value_offset) + - new_size + 7) & ~7)) < 0) - return ret; - /* - * If we made the attribute value bigger, clear the area between the - * old size and @new_size. - */ - if (new_size > le32_to_cpu(a->value_length)) - memset((u8*)a + le16_to_cpu(a->value_offset) + - le32_to_cpu(a->value_length), 0, new_size - - le32_to_cpu(a->value_length)); - /* Finally update the length of the attribute value. */ - a->value_length = cpu_to_le32(new_size); - return 0; -} - -/** - * ntfs_attr_record_move_to - move attribute record to target inode - * @ctx: attribute search context describing the attribute record - * @ni: opened ntfs inode to which move attribute record - * - * If this function succeed, user should reinit search context if he/she wants - * use it anymore. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attr_record_move_to(ntfs_attr_search_ctx *ctx, ntfs_inode *ni) -{ - ntfs_attr_search_ctx *nctx; - ATTR_RECORD *a; - int err; - - if (!ctx || !ctx->attr || !ctx->ntfs_ino || !ni) { - ntfs_log_trace("Invalid arguments passed.\n"); - errno = EINVAL; - return -1; - } - - ntfs_log_trace("Entering for ctx->attr->type 0x%x, ctx->ntfs_ino->mft_no " - "0x%llx, ni->mft_no 0x%llx.\n", - (unsigned) le32_to_cpu(ctx->attr->type), - (long long) ctx->ntfs_ino->mft_no, - (long long) ni->mft_no); - - if (ctx->ntfs_ino == ni) - return 0; - - if (!ctx->al_entry) { - ntfs_log_trace("Inode should contain attribute list to use this " - "function.\n"); - errno = EINVAL; - return -1; - } - - /* Find place in MFT record where attribute will be moved. */ - a = ctx->attr; - nctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!nctx) - return -1; - - /* - * Use ntfs_attr_find instead of ntfs_attr_lookup to find place for - * attribute in @ni->mrec, not any extent inode in case if @ni is base - * file record. - */ - if (!ntfs_attr_find(a->type, (ntfschar*)((u8*)a + le16_to_cpu( - a->name_offset)), a->name_length, CASE_SENSITIVE, NULL, - 0, nctx)) { - ntfs_log_trace("Attribute of such type, with same name already " - "present in this MFT record.\n"); - err = EEXIST; - goto put_err_out; - } - if (errno != ENOENT) { - err = errno; - ntfs_log_debug("Attribute lookup failed.\n"); - goto put_err_out; - } - - /* Make space and move attribute. */ - if (ntfs_make_room_for_attr(ni->mrec, (u8*) nctx->attr, - le32_to_cpu(a->length))) { - err = errno; - ntfs_log_trace("Couldn't make space for attribute.\n"); - goto put_err_out; - } - memcpy(nctx->attr, a, le32_to_cpu(a->length)); - nctx->attr->instance = nctx->mrec->next_attr_instance; - nctx->mrec->next_attr_instance = cpu_to_le16( - (le16_to_cpu(nctx->mrec->next_attr_instance) + 1) & 0xffff); - ntfs_attr_record_resize(ctx->mrec, a, 0); - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_inode_mark_dirty(ni); - - /* Update attribute list. */ - ctx->al_entry->mft_reference = - MK_LE_MREF(ni->mft_no, le16_to_cpu(ni->mrec->sequence_number)); - ctx->al_entry->instance = nctx->attr->instance; - ntfs_attrlist_mark_dirty(ni); - - ntfs_attr_put_search_ctx(nctx); - return 0; -put_err_out: - ntfs_attr_put_search_ctx(nctx); - errno = err; - return -1; -} - -/** - * ntfs_attr_record_move_away - move away attribute record from it's mft record - * @ctx: attribute search context describing the attribute record - * @extra: minimum amount of free space in the new holder of record - * - * New attribute record holder must have free @extra bytes after moving - * attribute record to it. - * - * If this function succeed, user should reinit search context if he/she wants - * use it anymore. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attr_record_move_away(ntfs_attr_search_ctx *ctx, int extra) -{ - ntfs_inode *base_ni, *ni; - MFT_RECORD *m; - int i; - - if (!ctx || !ctx->attr || !ctx->ntfs_ino || extra < 0) { - errno = EINVAL; - ntfs_log_perror("%s: ctx=%p ctx->attr=%p extra=%d", __FUNCTION__, - ctx, ctx ? ctx->attr : NULL, extra); - return -1; - } - - ntfs_log_trace("Entering for attr 0x%x, inode %llu\n", - (unsigned) le32_to_cpu(ctx->attr->type), - (unsigned long long)ctx->ntfs_ino->mft_no); - - if (ctx->ntfs_ino->nr_extents == -1) - base_ni = ctx->base_ntfs_ino; - else - base_ni = ctx->ntfs_ino; - - if (!NInoAttrList(base_ni)) { - errno = EINVAL; - ntfs_log_perror("Inode %llu has no attrlist", - (unsigned long long)base_ni->mft_no); - return -1; - } - - if (ntfs_inode_attach_all_extents(ctx->ntfs_ino)) { - ntfs_log_perror("Couldn't attach extents, inode=%llu", - (unsigned long long)base_ni->mft_no); - return -1; - } - - /* Walk through all extents and try to move attribute to them. */ - for (i = 0; i < base_ni->nr_extents; i++) { - ni = base_ni->extent_nis[i]; - m = ni->mrec; - - if (ctx->ntfs_ino->mft_no == ni->mft_no) - continue; - - if (le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use) < - le32_to_cpu(ctx->attr->length) + extra) - continue; - - /* - * ntfs_attr_record_move_to can fail if extent with other lowest - * VCN already present in inode we trying move record to. So, - * do not return error. - */ - if (!ntfs_attr_record_move_to(ctx, ni)) - return 0; - } - - /* - * Failed to move attribute to one of the current extents, so allocate - * new extent and move attribute to it. - */ - ni = ntfs_mft_record_alloc(base_ni->vol, base_ni); - if (!ni) { - ntfs_log_perror("Couldn't allocate MFT record"); - return -1; - } - if (ntfs_attr_record_move_to(ctx, ni)) { - ntfs_log_perror("Couldn't move attribute to MFT record"); - return -1; - } - return 0; -} - -/** - * ntfs_attr_make_non_resident - convert a resident to a non-resident attribute - * @na: open ntfs attribute to make non-resident - * @ctx: ntfs search context describing the attribute - * - * Convert a resident ntfs attribute to a non-resident one. - * - * Return 0 on success and -1 on error with errno set to the error code. The - * following error codes are defined: - * EPERM - The attribute is not allowed to be non-resident. - * TODO: others... - * - * NOTE to self: No changes in the attribute list are required to move from - * a resident to a non-resident attribute. - * - * Warning: We do not set the inode dirty and we do not write out anything! - * We expect the caller to do this as this is a fairly low level - * function and it is likely there will be further changes made. - */ -int ntfs_attr_make_non_resident(ntfs_attr *na, - ntfs_attr_search_ctx *ctx) -{ - s64 new_allocated_size, bw; - ntfs_volume *vol = na->ni->vol; - ATTR_REC *a = ctx->attr; - runlist *rl; - int mp_size, mp_ofs, name_ofs, arec_size, err; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long - long)na->ni->mft_no, na->type); - - /* Some preliminary sanity checking. */ - if (NAttrNonResident(na)) { - ntfs_log_trace("Eeek! Trying to make non-resident attribute " - "non-resident. Aborting...\n"); - errno = EINVAL; - return -1; - } - - /* Check that the attribute is allowed to be non-resident. */ - if (ntfs_attr_can_be_non_resident(vol, na->type, na->name, na->name_len)) - return -1; - - new_allocated_size = (le32_to_cpu(a->value_length) + vol->cluster_size - - 1) & ~(vol->cluster_size - 1); - - if (new_allocated_size > 0) { - if ((a->flags & ATTR_COMPRESSION_MASK) - == ATTR_IS_COMPRESSED) { - /* must allocate full compression blocks */ - new_allocated_size = ((new_allocated_size - 1) - | ((1L << (STANDARD_COMPRESSION_UNIT - + vol->cluster_size_bits)) - 1)) + 1; - } - /* Start by allocating clusters to hold the attribute value. */ - rl = ntfs_cluster_alloc(vol, 0, new_allocated_size >> - vol->cluster_size_bits, -1, DATA_ZONE); - if (!rl) - return -1; - } else - rl = NULL; - /* - * Setup the in-memory attribute structure to be non-resident so that - * we can use ntfs_attr_pwrite(). - */ - NAttrSetNonResident(na); - NAttrSetBeingNonResident(na); - na->rl = rl; - na->allocated_size = new_allocated_size; - na->data_size = na->initialized_size = le32_to_cpu(a->value_length); - /* - * FIXME: For now just clear all of these as we don't support them when - * writing. - */ - NAttrClearSparse(na); - NAttrClearEncrypted(na); - if ((a->flags & ATTR_COMPRESSION_MASK) == ATTR_IS_COMPRESSED) { - /* set compression writing parameters */ - na->compression_block_size - = 1 << (STANDARD_COMPRESSION_UNIT + vol->cluster_size_bits); - na->compression_block_clusters = 1 << STANDARD_COMPRESSION_UNIT; - } - - if (rl) { - /* Now copy the attribute value to the allocated cluster(s). */ - bw = ntfs_attr_pwrite(na, 0, le32_to_cpu(a->value_length), - (u8*)a + le16_to_cpu(a->value_offset)); - if (bw != le32_to_cpu(a->value_length)) { - err = errno; - ntfs_log_debug("Eeek! Failed to write out attribute value " - "(bw = %lli, errno = %i). " - "Aborting...\n", (long long)bw, err); - if (bw >= 0) - err = EIO; - goto cluster_free_err_out; - } - } - /* Determine the size of the mapping pairs array. */ - mp_size = ntfs_get_size_for_mapping_pairs(vol, rl, 0, INT_MAX); - if (mp_size < 0) { - err = errno; - ntfs_log_debug("Eeek! Failed to get size for mapping pairs array. " - "Aborting...\n"); - goto cluster_free_err_out; - } - /* Calculate new offsets for the name and the mapping pairs array. */ - if (na->ni->flags & FILE_ATTR_COMPRESSED) - name_ofs = (sizeof(ATTR_REC) + 7) & ~7; - else - name_ofs = (sizeof(ATTR_REC) - sizeof(a->compressed_size) + 7) & ~7; - mp_ofs = (name_ofs + a->name_length * sizeof(ntfschar) + 7) & ~7; - /* - * Determine the size of the resident part of the non-resident - * attribute record. (Not compressed thus no compressed_size element - * present.) - */ - arec_size = (mp_ofs + mp_size + 7) & ~7; - - /* Resize the resident part of the attribute record. */ - if (ntfs_attr_record_resize(ctx->mrec, a, arec_size) < 0) { - err = errno; - goto cluster_free_err_out; - } - - /* - * Convert the resident part of the attribute record to describe a - * non-resident attribute. - */ - a->non_resident = 1; - - /* Move the attribute name if it exists and update the offset. */ - if (a->name_length) - memmove((u8*)a + name_ofs, (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - a->name_offset = cpu_to_le16(name_ofs); - - /* Setup the fields specific to non-resident attributes. */ - a->lowest_vcn = cpu_to_sle64(0); - a->highest_vcn = cpu_to_sle64((new_allocated_size - 1) >> - vol->cluster_size_bits); - - a->mapping_pairs_offset = cpu_to_le16(mp_ofs); - - /* - * Update the flags to match the in-memory ones. - * However cannot change the compression state if we had - * a fuse_file_info open with a mark for release. - * The decisions about compression can only be made when - * creating/recreating the stream, not when making non resident. - */ - a->flags &= ~(ATTR_IS_SPARSE | ATTR_IS_ENCRYPTED); - if ((a->flags & ATTR_COMPRESSION_MASK) == ATTR_IS_COMPRESSED) { - /* support only ATTR_IS_COMPRESSED compression mode */ - a->compression_unit = STANDARD_COMPRESSION_UNIT; - a->compressed_size = const_cpu_to_le64(0); - } else { - a->compression_unit = 0; - a->flags &= ~ATTR_COMPRESSION_MASK; - na->data_flags = a->flags; - } - - memset(&a->reserved1, 0, sizeof(a->reserved1)); - - a->allocated_size = cpu_to_sle64(new_allocated_size); - a->data_size = a->initialized_size = cpu_to_sle64(na->data_size); - - /* Generate the mapping pairs array in the attribute record. */ - if (ntfs_mapping_pairs_build(vol, (u8*)a + mp_ofs, arec_size - mp_ofs, - rl, 0, NULL) < 0) { - // FIXME: Eeek! We need rollback! (AIA) - ntfs_log_trace("Eeek! Failed to build mapping pairs. Leaving " - "corrupt attribute record on disk. In memory " - "runlist is still intact! Error code is %i. " - "FIXME: Need to rollback instead!\n", errno); - return -1; - } - - /* Done! */ - return 0; - -cluster_free_err_out: - if (rl && ntfs_cluster_free(vol, na, 0, -1) < 0) - ntfs_log_trace("Eeek! Failed to release allocated clusters in error " - "code path. Leaving inconsistent metadata...\n"); - NAttrClearNonResident(na); - na->allocated_size = na->data_size; - na->rl = NULL; - free(rl); - errno = err; - return -1; -} - - -static int ntfs_resident_attr_resize(ntfs_attr *na, const s64 newsize); - -/** - * ntfs_resident_attr_resize - resize a resident, open ntfs attribute - * @na: resident ntfs attribute to resize - * @newsize: new size (in bytes) to which to resize the attribute - * - * Change the size of a resident, open ntfs attribute @na to @newsize bytes. - * Can also be used to force an attribute non-resident. In this case, the - * size cannot be changed. - * - * On success return 0 - * On error return values are: - * STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT - * STATUS_ERROR - otherwise - * The following error codes are defined: - * ENOMEM - Not enough memory to complete operation. - * ERANGE - @newsize is not valid for the attribute type of @na. - * ENOSPC - There is no enough space in base mft to resize $ATTRIBUTE_LIST. - */ -static int ntfs_resident_attr_resize_i(ntfs_attr *na, const s64 newsize, - BOOL force_non_resident) -{ - ntfs_attr_search_ctx *ctx; - ntfs_volume *vol; - ntfs_inode *ni; - int err, ret = STATUS_ERROR; - - ntfs_log_trace("Inode 0x%llx attr 0x%x new size %lld\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)newsize); - - /* Get the attribute record that needs modification. */ - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, 0, NULL, 0, - ctx)) { - err = errno; - ntfs_log_perror("ntfs_attr_lookup failed"); - goto put_err_out; - } - vol = na->ni->vol; - /* - * Check the attribute type and the corresponding minimum and maximum - * sizes against @newsize and fail if @newsize is out of bounds. - */ - if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) { - err = errno; - if (err == ENOENT) - err = EIO; - ntfs_log_perror("%s: bounds check failed", __FUNCTION__); - goto put_err_out; - } - /* - * If @newsize is bigger than the mft record we need to make the - * attribute non-resident if the attribute type supports it. If it is - * smaller we can go ahead and attempt the resize. - */ - if ((newsize < vol->mft_record_size) && !force_non_resident) { - /* Perform the resize of the attribute record. */ - if (!(ret = ntfs_resident_attr_value_resize(ctx->mrec, ctx->attr, - newsize))) { - /* Update attribute size everywhere. */ - na->data_size = na->initialized_size = newsize; - na->allocated_size = (newsize + 7) & ~7; - if ((na->data_flags & ATTR_COMPRESSION_MASK) - || NAttrSparse(na)) - na->compressed_size = na->allocated_size; - if (na->ni->mrec->flags & MFT_RECORD_IS_DIRECTORY - ? na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30 - : na->type == AT_DATA && na->name == AT_UNNAMED) { - na->ni->data_size = na->data_size; - if (((na->data_flags & ATTR_COMPRESSION_MASK) - || NAttrSparse(na)) - && NAttrNonResident(na)) - na->ni->allocated_size - = na->compressed_size; - else - na->ni->allocated_size - = na->allocated_size; - set_nino_flag(na->ni,KnownSize); - if (na->type == AT_DATA) - NInoFileNameSetDirty(na->ni); - } - goto resize_done; - } - /* Prefer AT_INDEX_ALLOCATION instead of AT_ATTRIBUTE_LIST */ - if (ret == STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT) { - err = errno; - goto put_err_out; - } - } - /* There is not enough space in the mft record to perform the resize. */ - - /* Make the attribute non-resident if possible. */ - if (!ntfs_attr_make_non_resident(na, ctx)) { - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - /* - * do not truncate when forcing non-resident, this - * could cause the attribute to be made resident again, - * so size changes are not allowed. - */ - if (force_non_resident) { - ret = 0; - if (newsize != na->data_size) { - ntfs_log_error("Cannot change size when" - " forcing non-resident\n"); - errno = EIO; - ret = STATUS_ERROR; - } - return (ret); - } - /* Resize non-resident attribute */ - return ntfs_attr_truncate(na, newsize); - } else if (errno != ENOSPC && errno != EPERM) { - err = errno; - ntfs_log_perror("Failed to make attribute non-resident"); - goto put_err_out; - } - - /* Try to make other attributes non-resident and retry each time. */ - ntfs_attr_init_search_ctx(ctx, NULL, na->ni->mrec); - while (!ntfs_attr_lookup(AT_UNUSED, NULL, 0, 0, 0, NULL, 0, ctx)) { - ntfs_attr *tna; - ATTR_RECORD *a; - - a = ctx->attr; - if (a->non_resident) - continue; - - /* - * Check out whether convert is reasonable. Assume that mapping - * pairs will take 8 bytes. - */ - if (le32_to_cpu(a->length) <= offsetof(ATTR_RECORD, - compressed_size) + ((a->name_length * - sizeof(ntfschar) + 7) & ~7) + 8) - continue; - - tna = ntfs_attr_open(na->ni, a->type, (ntfschar*)((u8*)a + - le16_to_cpu(a->name_offset)), a->name_length); - if (!tna) { - err = errno; - ntfs_log_perror("Couldn't open attribute"); - goto put_err_out; - } - if (ntfs_attr_make_non_resident(tna, ctx)) { - ntfs_attr_close(tna); - continue; - } - if (((tna->data_flags & ATTR_COMPRESSION_MASK) - == ATTR_IS_COMPRESSED) - && ntfs_attr_pclose(tna)) { - err = errno; - ntfs_attr_close(tna); - goto put_err_out; - } - ntfs_inode_mark_dirty(tna->ni); - ntfs_attr_close(tna); - ntfs_attr_put_search_ctx(ctx); - return ntfs_resident_attr_resize_i(na, newsize, force_non_resident); - } - /* Check whether error occurred. */ - if (errno != ENOENT) { - err = errno; - ntfs_log_perror("%s: Attribute lookup failed 1", __FUNCTION__); - goto put_err_out; - } - - /* - * The standard information and attribute list attributes can't be - * moved out from the base MFT record, so try to move out others. - */ - if (na->type==AT_STANDARD_INFORMATION || na->type==AT_ATTRIBUTE_LIST) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_free_space(na->ni, offsetof(ATTR_RECORD, - non_resident_end) + 8)) { - ntfs_log_perror("Could not free space in MFT record"); - return -1; - } - return ntfs_resident_attr_resize_i(na, newsize, force_non_resident); - } - - /* - * Move the attribute to a new mft record, creating an attribute list - * attribute or modifying it if it is already present. - */ - - /* Point search context back to attribute which we need resize. */ - ntfs_attr_init_search_ctx(ctx, na->ni, NULL); - if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - ntfs_log_perror("%s: Attribute lookup failed 2", __FUNCTION__); - err = errno; - goto put_err_out; - } - - /* - * Check whether attribute is already single in this MFT record. - * 8 added for the attribute terminator. - */ - if (le32_to_cpu(ctx->mrec->bytes_in_use) == - le16_to_cpu(ctx->mrec->attrs_offset) + - le32_to_cpu(ctx->attr->length) + 8) { - err = ENOSPC; - ntfs_log_trace("MFT record is filled with one attribute\n"); - ret = STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT; - goto put_err_out; - } - - /* Add attribute list if not present. */ - if (na->ni->nr_extents == -1) - ni = na->ni->base_ni; - else - ni = na->ni; - if (!NInoAttrList(ni)) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_add_attrlist(ni)) - return -1; - return ntfs_resident_attr_resize_i(na, newsize, force_non_resident); - } - /* Allocate new mft record. */ - ni = ntfs_mft_record_alloc(vol, ni); - if (!ni) { - err = errno; - ntfs_log_perror("Couldn't allocate new MFT record"); - goto put_err_out; - } - /* Move attribute to it. */ - if (ntfs_attr_record_move_to(ctx, ni)) { - err = errno; - ntfs_log_perror("Couldn't move attribute to new MFT record"); - goto put_err_out; - } - /* Update ntfs attribute. */ - if (na->ni->nr_extents == -1) - na->ni = ni; - - ntfs_attr_put_search_ctx(ctx); - /* Try to perform resize once again. */ - return ntfs_resident_attr_resize_i(na, newsize, force_non_resident); - -resize_done: - /* - * Set the inode (and its base inode if it exists) dirty so it is - * written out later. - */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - return 0; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return ret; -} - -static int ntfs_resident_attr_resize(ntfs_attr *na, const s64 newsize) -{ - int ret; - - ntfs_log_enter("Entering\n"); - ret = ntfs_resident_attr_resize_i(na, newsize, FALSE); - ntfs_log_leave("\n"); - return ret; -} - -/* - * Force an attribute to be made non-resident without - * changing its size. - * - * This is particularly needed when the attribute has no data, - * as the non-resident variant requires more space in the MFT - * record, and may imply expelling some other attribute. - * - * As a consequence the existing ntfs_attr_search_ctx's have to - * be closed or reinitialized. - * - * returns 0 if successful, - * < 0 if failed, with errno telling why - */ - -int ntfs_attr_force_non_resident(ntfs_attr *na) -{ - int res; - - res = ntfs_resident_attr_resize_i(na, na->data_size, TRUE); - if (!res && !NAttrNonResident(na)) { - res = -1; - errno = EIO; - ntfs_log_error("Failed to force non-resident\n"); - } - return (res); -} - -/** - * ntfs_attr_make_resident - convert a non-resident to a resident attribute - * @na: open ntfs attribute to make resident - * @ctx: ntfs search context describing the attribute - * - * Convert a non-resident ntfs attribute to a resident one. - * - * Return 0 on success and -1 on error with errno set to the error code. The - * following error codes are defined: - * EINVAL - Invalid arguments passed. - * EPERM - The attribute is not allowed to be resident. - * EIO - I/O error, damaged inode or bug. - * ENOSPC - There is no enough space to perform conversion. - * EOPNOTSUPP - Requested conversion is not supported yet. - * - * Warning: We do not set the inode dirty and we do not write out anything! - * We expect the caller to do this as this is a fairly low level - * function and it is likely there will be further changes made. - */ -static int ntfs_attr_make_resident(ntfs_attr *na, ntfs_attr_search_ctx *ctx) -{ - ntfs_volume *vol = na->ni->vol; - ATTR_REC *a = ctx->attr; - int name_ofs, val_ofs, err = EIO; - s64 arec_size, bytes_read; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long - long)na->ni->mft_no, na->type); - - /* Should be called for the first extent of the attribute. */ - if (sle64_to_cpu(a->lowest_vcn)) { - ntfs_log_trace("Eeek! Should be called for the first extent of the " - "attribute. Aborting...\n"); - errno = EINVAL; - return -1; - } - - /* Some preliminary sanity checking. */ - if (!NAttrNonResident(na)) { - ntfs_log_trace("Eeek! Trying to make resident attribute resident. " - "Aborting...\n"); - errno = EINVAL; - return -1; - } - - /* Make sure this is not $MFT/$BITMAP or Windows will not boot! */ - if (na->type == AT_BITMAP && na->ni->mft_no == FILE_MFT) { - errno = EPERM; - return -1; - } - - /* Check that the attribute is allowed to be resident. */ - if (ntfs_attr_can_be_resident(vol, na->type)) - return -1; - - if (na->data_flags & ATTR_IS_ENCRYPTED) { - ntfs_log_trace("Making encrypted streams resident is not " - "implemented yet.\n"); - errno = EOPNOTSUPP; - return -1; - } - - /* Work out offsets into and size of the resident attribute. */ - name_ofs = 24; /* = sizeof(resident_ATTR_REC); */ - val_ofs = (name_ofs + a->name_length * sizeof(ntfschar) + 7) & ~7; - arec_size = (val_ofs + na->data_size + 7) & ~7; - - /* Sanity check the size before we start modifying the attribute. */ - if (le32_to_cpu(ctx->mrec->bytes_in_use) - le32_to_cpu(a->length) + - arec_size > le32_to_cpu(ctx->mrec->bytes_allocated)) { - errno = ENOSPC; - ntfs_log_trace("Not enough space to make attribute resident\n"); - return -1; - } - - /* Read and cache the whole runlist if not already done. */ - if (ntfs_attr_map_whole_runlist(na)) - return -1; - - /* Move the attribute name if it exists and update the offset. */ - if (a->name_length) { - memmove((u8*)a + name_ofs, (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - } - a->name_offset = cpu_to_le16(name_ofs); - - /* Resize the resident part of the attribute record. */ - if (ntfs_attr_record_resize(ctx->mrec, a, arec_size) < 0) { - /* - * Bug, because ntfs_attr_record_resize should not fail (we - * already checked that attribute fits MFT record). - */ - ntfs_log_error("BUG! Failed to resize attribute record. " - "Please report to the %s. Aborting...\n", - NTFS_DEV_LIST); - errno = EIO; - return -1; - } - - /* Convert the attribute record to describe a resident attribute. */ - a->non_resident = 0; - a->flags = 0; - a->value_length = cpu_to_le32(na->data_size); - a->value_offset = cpu_to_le16(val_ofs); - /* - * If a data stream was wiped out, adjust the compression mode - * to current state of compression flag - */ - if (!na->data_size - && (na->type == AT_DATA) - && (na->ni->vol->major_ver >= 3) - && NVolCompression(na->ni->vol) - && (na->ni->vol->cluster_size <= MAX_COMPRESSION_CLUSTER_SIZE) - && (na->ni->flags & FILE_ATTR_COMPRESSED)) { - a->flags |= ATTR_IS_COMPRESSED; - na->data_flags = a->flags; - } - /* - * File names cannot be non-resident so we would never see this here - * but at least it serves as a reminder that there may be attributes - * for which we do need to set this flag. (AIA) - */ - if (a->type == AT_FILE_NAME) - a->resident_flags = RESIDENT_ATTR_IS_INDEXED; - else - a->resident_flags = 0; - a->reservedR = 0; - - /* Sanity fixup... Shouldn't really happen. (AIA) */ - if (na->initialized_size > na->data_size) - na->initialized_size = na->data_size; - - /* Copy data from run list to resident attribute value. */ - bytes_read = ntfs_rl_pread(vol, na->rl, 0, na->initialized_size, - (u8*)a + val_ofs); - if (bytes_read != na->initialized_size) { - if (bytes_read < 0) - err = errno; - ntfs_log_trace("Eeek! Failed to read attribute data. Leaving " - "inconstant metadata. Run chkdsk. " - "Aborting...\n"); - errno = err; - return -1; - } - - /* Clear memory in gap between initialized_size and data_size. */ - if (na->initialized_size < na->data_size) - memset((u8*)a + val_ofs + na->initialized_size, 0, - na->data_size - na->initialized_size); - - /* - * Deallocate clusters from the runlist. - * - * NOTE: We can use ntfs_cluster_free() because we have already mapped - * the whole run list and thus it doesn't matter that the attribute - * record is in a transiently corrupted state at this moment in time. - */ - if (ntfs_cluster_free(vol, na, 0, -1) < 0) { - err = errno; - ntfs_log_perror("Eeek! Failed to release allocated clusters"); - ntfs_log_trace("Ignoring error and leaving behind wasted " - "clusters.\n"); - } - - /* Throw away the now unused runlist. */ - free(na->rl); - na->rl = NULL; - - /* Update in-memory struct ntfs_attr. */ - NAttrClearNonResident(na); - NAttrClearSparse(na); - NAttrClearEncrypted(na); - na->initialized_size = na->data_size; - na->allocated_size = na->compressed_size = (na->data_size + 7) & ~7; - na->compression_block_size = 0; - na->compression_block_size_bits = na->compression_block_clusters = 0; - return 0; -} - -/* - * If we are in the first extent, then set/clean sparse bit, - * update allocated and compressed size. - */ -static int ntfs_attr_update_meta(ATTR_RECORD *a, ntfs_attr *na, MFT_RECORD *m, - ntfs_attr_search_ctx *ctx) -{ - int sparse, ret = 0; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x\n", - (unsigned long long)na->ni->mft_no, na->type); - - if (a->lowest_vcn) - goto out; - - a->allocated_size = cpu_to_sle64(na->allocated_size); - - /* Update sparse bit. */ - sparse = ntfs_rl_sparse(na->rl); - if (sparse == -1) { - errno = EIO; - goto error; - } - - /* Attribute become sparse. */ - if (sparse && !(a->flags & (ATTR_IS_SPARSE | ATTR_IS_COMPRESSED))) { - /* - * Move attribute to another mft record, if attribute is too - * small to add compressed_size field to it and we have no - * free space in the current mft record. - */ - if ((le32_to_cpu(a->length) - - le16_to_cpu(a->mapping_pairs_offset) == 8) - && !(le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use))) { - - if (!NInoAttrList(na->ni)) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_add_attrlist(na->ni)) - goto leave; - goto retry; - } - if (ntfs_attr_record_move_away(ctx, 8)) { - ntfs_log_perror("Failed to move attribute"); - goto error; - } - ntfs_attr_put_search_ctx(ctx); - goto retry; - } - if (!(le32_to_cpu(a->length) - le16_to_cpu( - a->mapping_pairs_offset))) { - errno = EIO; - ntfs_log_perror("Mapping pairs space is 0"); - goto error; - } - - NAttrSetSparse(na); - a->flags |= ATTR_IS_SPARSE; - a->compression_unit = STANDARD_COMPRESSION_UNIT; /* Windows - set it so, even if attribute is not actually compressed. */ - - memmove((u8*)a + le16_to_cpu(a->name_offset) + 8, - (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - - a->name_offset = cpu_to_le16(le16_to_cpu(a->name_offset) + 8); - - a->mapping_pairs_offset = - cpu_to_le16(le16_to_cpu(a->mapping_pairs_offset) + 8); - } - - /* Attribute no longer sparse. */ - if (!sparse && (a->flags & ATTR_IS_SPARSE) && - !(a->flags & ATTR_IS_COMPRESSED)) { - - NAttrClearSparse(na); - a->flags &= ~ATTR_IS_SPARSE; - a->compression_unit = 0; - - memmove((u8*)a + le16_to_cpu(a->name_offset) - 8, - (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - - if (le16_to_cpu(a->name_offset) >= 8) - a->name_offset = cpu_to_le16(le16_to_cpu(a->name_offset) - 8); - - a->mapping_pairs_offset = - cpu_to_le16(le16_to_cpu(a->mapping_pairs_offset) - 8); - } - - /* Update compressed size if required. */ - if (sparse || (na->data_flags & ATTR_COMPRESSION_MASK)) { - s64 new_compr_size; - - new_compr_size = ntfs_rl_get_compressed_size(na->ni->vol, na->rl); - if (new_compr_size == -1) - goto error; - - na->compressed_size = new_compr_size; - a->compressed_size = cpu_to_sle64(new_compr_size); - } - /* - * Set FILE_NAME dirty flag, to update sparse bit and - * allocated size in the index. - */ - if (na->type == AT_DATA && na->name == AT_UNNAMED) { - if (sparse || (na->data_flags & ATTR_COMPRESSION_MASK)) - na->ni->allocated_size = na->compressed_size; - else - na->ni->allocated_size = na->allocated_size; - NInoFileNameSetDirty(na->ni); - } -out: - return ret; -leave: ret = -1; goto out; /* return -1 */ -retry: ret = -2; goto out; -error: ret = -3; goto out; -} - -#define NTFS_VCN_DELETE_MARK -2 -/** - * ntfs_attr_update_mapping_pairs_i - see ntfs_attr_update_mapping_pairs - */ -static int ntfs_attr_update_mapping_pairs_i(ntfs_attr *na, VCN from_vcn) -{ - ntfs_attr_search_ctx *ctx; - ntfs_inode *ni, *base_ni; - MFT_RECORD *m; - ATTR_RECORD *a; - VCN stop_vcn; - const runlist_element *stop_rl; - int err, mp_size, cur_max_mp_size, exp_max_mp_size, ret = -1; - BOOL finished_build; - BOOL first_updated = FALSE; - -retry: - if (!na || !na->rl) { - errno = EINVAL; - ntfs_log_perror("%s: na=%p", __FUNCTION__, na); - return -1; - } - - ntfs_log_trace("Entering for inode %llu, attr 0x%x\n", - (unsigned long long)na->ni->mft_no, na->type); - - if (!NAttrNonResident(na)) { - errno = EINVAL; - ntfs_log_perror("%s: resident attribute", __FUNCTION__); - return -1; - } - - if (na->ni->nr_extents == -1) - base_ni = na->ni->base_ni; - else - base_ni = na->ni; - - ctx = ntfs_attr_get_search_ctx(base_ni, NULL); - if (!ctx) - return -1; - - /* Fill attribute records with new mapping pairs. */ - stop_vcn = 0; - stop_rl = na->rl; - finished_build = FALSE; - while (!ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, from_vcn, NULL, 0, ctx)) { - a = ctx->attr; - m = ctx->mrec; - if (!a->lowest_vcn) - first_updated = TRUE; - /* - * If runlist is updating not from the beginning, then set - * @stop_vcn properly, i.e. to the lowest vcn of record that - * contain @from_vcn. Also we do not need @from_vcn anymore, - * set it to 0 to make ntfs_attr_lookup enumerate attributes. - */ - if (from_vcn) { - LCN first_lcn; - - stop_vcn = sle64_to_cpu(a->lowest_vcn); - from_vcn = 0; - /* - * Check whether the first run we need to update is - * the last run in runlist, if so, then deallocate - * all attrubute extents starting this one. - */ - first_lcn = ntfs_rl_vcn_to_lcn(na->rl, stop_vcn); - if (first_lcn == LCN_EINVAL) { - errno = EIO; - ntfs_log_perror("Bad runlist"); - goto put_err_out; - } - if (first_lcn == LCN_ENOENT || - first_lcn == LCN_RL_NOT_MAPPED) - finished_build = TRUE; - } - - /* - * Check whether we finished mapping pairs build, if so mark - * extent as need to delete (by setting highest vcn to - * NTFS_VCN_DELETE_MARK (-2), we shall check it later and - * delete extent) and continue search. - */ - if (finished_build) { - ntfs_log_trace("Mark attr 0x%x for delete in inode " - "%lld.\n", (unsigned)le32_to_cpu(a->type), - (long long)ctx->ntfs_ino->mft_no); - a->highest_vcn = cpu_to_sle64(NTFS_VCN_DELETE_MARK); - ntfs_inode_mark_dirty(ctx->ntfs_ino); - continue; - } - - switch (ntfs_attr_update_meta(a, na, m, ctx)) { - case -1: return -1; - case -2: goto retry; - case -3: goto put_err_out; - } - - /* - * Determine maximum possible length of mapping pairs, - * if we shall *not* expand space for mapping pairs. - */ - cur_max_mp_size = le32_to_cpu(a->length) - - le16_to_cpu(a->mapping_pairs_offset); - /* - * Determine maximum possible length of mapping pairs in the - * current mft record, if we shall expand space for mapping - * pairs. - */ - exp_max_mp_size = le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use) + cur_max_mp_size; - /* Get the size for the rest of mapping pairs array. */ - mp_size = ntfs_get_size_for_mapping_pairs(na->ni->vol, stop_rl, - stop_vcn, exp_max_mp_size); - if (mp_size <= 0) { - ntfs_log_perror("%s: get MP size failed", __FUNCTION__); - goto put_err_out; - } - /* Test mapping pairs for fitting in the current mft record. */ - if (mp_size > exp_max_mp_size) { - /* - * Mapping pairs of $ATTRIBUTE_LIST attribute must fit - * in the base mft record. Try to move out other - * attributes and try again. - */ - if (na->type == AT_ATTRIBUTE_LIST) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_free_space(na->ni, mp_size - - cur_max_mp_size)) { - ntfs_log_perror("Attribute list is too " - "big. Defragment the " - "volume\n"); - return -1; - } - goto retry; - } - - /* Add attribute list if it isn't present, and retry. */ - if (!NInoAttrList(base_ni)) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_add_attrlist(base_ni)) { - ntfs_log_perror("Can not add attrlist"); - return -1; - } - goto retry; - } - - /* - * Set mapping pairs size to maximum possible for this - * mft record. We shall write the rest of mapping pairs - * to another MFT records. - */ - mp_size = exp_max_mp_size; - } - - /* Change space for mapping pairs if we need it. */ - if (((mp_size + 7) & ~7) != cur_max_mp_size) { - if (ntfs_attr_record_resize(m, a, - le16_to_cpu(a->mapping_pairs_offset) + - mp_size)) { - errno = EIO; - ntfs_log_perror("Failed to resize attribute"); - goto put_err_out; - } - } - - /* Update lowest vcn. */ - a->lowest_vcn = cpu_to_sle64(stop_vcn); - ntfs_inode_mark_dirty(ctx->ntfs_ino); - if ((ctx->ntfs_ino->nr_extents == -1 || - NInoAttrList(ctx->ntfs_ino)) && - ctx->attr->type != AT_ATTRIBUTE_LIST) { - ctx->al_entry->lowest_vcn = cpu_to_sle64(stop_vcn); - ntfs_attrlist_mark_dirty(ctx->ntfs_ino); - } - - /* - * Generate the new mapping pairs array directly into the - * correct destination, i.e. the attribute record itself. - */ - if (!ntfs_mapping_pairs_build(na->ni->vol, (u8*)a + le16_to_cpu( - a->mapping_pairs_offset), mp_size, na->rl, - stop_vcn, &stop_rl)) - finished_build = TRUE; - if (stop_rl) - stop_vcn = stop_rl->vcn; - else - stop_vcn = 0; - if (!finished_build && errno != ENOSPC) { - ntfs_log_perror("Failed to build mapping pairs"); - goto put_err_out; - } - a->highest_vcn = cpu_to_sle64(stop_vcn - 1); - } - /* Check whether error occurred. */ - if (errno != ENOENT) { - ntfs_log_perror("%s: Attribute lookup failed", __FUNCTION__); - goto put_err_out; - } - /* - * If the base extent was skipped in the above process, - * we still may have to update the sizes. - */ - if (!first_updated) { - le16 spcomp; - - ntfs_attr_reinit_search_ctx(ctx); - if (!ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - a = ctx->attr; - a->allocated_size = cpu_to_sle64(na->allocated_size); - spcomp = na->data_flags - & (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE); - if (spcomp) - a->compressed_size = cpu_to_sle64(na->compressed_size); - if ((na->type == AT_DATA) && (na->name == AT_UNNAMED)) { - na->ni->allocated_size - = (spcomp - ? na->compressed_size - : na->allocated_size); - NInoFileNameSetDirty(na->ni); - } - } else { - ntfs_log_error("Failed to update sizes in base extent\n"); - goto put_err_out; - } - } - - /* Deallocate not used attribute extents and return with success. */ - if (finished_build) { - ntfs_attr_reinit_search_ctx(ctx); - ntfs_log_trace("Deallocate marked extents.\n"); - while (!ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (sle64_to_cpu(ctx->attr->highest_vcn) != - NTFS_VCN_DELETE_MARK) - continue; - /* Remove unused attribute record. */ - if (ntfs_attr_record_rm(ctx)) { - ntfs_log_perror("Could not remove unused attr"); - goto put_err_out; - } - ntfs_attr_reinit_search_ctx(ctx); - } - if (errno != ENOENT) { - ntfs_log_perror("%s: Attr lookup failed", __FUNCTION__); - goto put_err_out; - } - ntfs_log_trace("Deallocate done.\n"); - ntfs_attr_put_search_ctx(ctx); - goto ok; - } - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - - /* Allocate new MFT records for the rest of mapping pairs. */ - while (1) { - /* Calculate size of rest mapping pairs. */ - mp_size = ntfs_get_size_for_mapping_pairs(na->ni->vol, - na->rl, stop_vcn, INT_MAX); - if (mp_size <= 0) { - ntfs_log_perror("%s: get mp size failed", __FUNCTION__); - goto put_err_out; - } - /* Allocate new mft record. */ - ni = ntfs_mft_record_alloc(na->ni->vol, base_ni); - if (!ni) { - ntfs_log_perror("Could not allocate new MFT record"); - goto put_err_out; - } - m = ni->mrec; - /* - * If mapping size exceed available space, set them to - * possible maximum. - */ - cur_max_mp_size = le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use) - - (offsetof(ATTR_RECORD, compressed_size) + - (((na->data_flags & ATTR_COMPRESSION_MASK) - || NAttrSparse(na)) ? - sizeof(a->compressed_size) : 0)) - - ((sizeof(ntfschar) * na->name_len + 7) & ~7); - if (mp_size > cur_max_mp_size) - mp_size = cur_max_mp_size; - /* Add attribute extent to new record. */ - err = ntfs_non_resident_attr_record_add(ni, na->type, - na->name, na->name_len, stop_vcn, mp_size, - na->data_flags); - if (err == -1) { - err = errno; - ntfs_log_perror("Could not add attribute extent"); - if (ntfs_mft_record_free(na->ni->vol, ni)) - ntfs_log_perror("Could not free MFT record"); - errno = err; - goto put_err_out; - } - a = (ATTR_RECORD*)((u8*)m + err); - - err = ntfs_mapping_pairs_build(na->ni->vol, (u8*)a + - le16_to_cpu(a->mapping_pairs_offset), mp_size, na->rl, - stop_vcn, &stop_rl); - if (stop_rl) - stop_vcn = stop_rl->vcn; - else - stop_vcn = 0; - if (err < 0 && errno != ENOSPC) { - err = errno; - ntfs_log_perror("Failed to build MP"); - if (ntfs_mft_record_free(na->ni->vol, ni)) - ntfs_log_perror("Couldn't free MFT record"); - errno = err; - goto put_err_out; - } - a->highest_vcn = cpu_to_sle64(stop_vcn - 1); - ntfs_inode_mark_dirty(ni); - /* All mapping pairs has been written. */ - if (!err) - break; - } -ok: - ret = 0; -out: - return ret; -put_err_out: - if (ctx) - ntfs_attr_put_search_ctx(ctx); - goto out; -} -#undef NTFS_VCN_DELETE_MARK - -/** - * ntfs_attr_update_mapping_pairs - update mapping pairs for ntfs attribute - * @na: non-resident ntfs open attribute for which we need update - * @from_vcn: update runlist starting this VCN - * - * Build mapping pairs from @na->rl and write them to the disk. Also, this - * function updates sparse bit, allocated and compressed size (allocates/frees - * space for this field if required). - * - * @na->allocated_size should be set to correct value for the new runlist before - * call to this function. Vice-versa @na->compressed_size will be calculated and - * set to correct value during this function. - * - * FIXME: This function does not update sparse bit and compressed size correctly - * if called with @from_vcn != 0. - * - * FIXME: Rewrite without using NTFS_VCN_DELETE_MARK define. - * - * On success return 0 and on error return -1 with errno set to the error code. - * The following error codes are defined: - * EINVAL - Invalid arguments passed. - * ENOMEM - Not enough memory to complete operation. - * ENOSPC - There is no enough space in base mft to resize $ATTRIBUTE_LIST - * or there is no free MFT records left to allocate. - */ -int ntfs_attr_update_mapping_pairs(ntfs_attr *na, VCN from_vcn) -{ - int ret; - - ntfs_log_enter("Entering\n"); - ret = ntfs_attr_update_mapping_pairs_i(na, from_vcn); - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_non_resident_attr_shrink - shrink a non-resident, open ntfs attribute - * @na: non-resident ntfs attribute to shrink - * @newsize: new size (in bytes) to which to shrink the attribute - * - * Reduce the size of a non-resident, open ntfs attribute @na to @newsize bytes. - * - * On success return 0 and on error return -1 with errno set to the error code. - * The following error codes are defined: - * ENOMEM - Not enough memory to complete operation. - * ERANGE - @newsize is not valid for the attribute type of @na. - */ -static int ntfs_non_resident_attr_shrink(ntfs_attr *na, const s64 newsize) -{ - ntfs_volume *vol; - ntfs_attr_search_ctx *ctx; - VCN first_free_vcn; - s64 nr_freed_clusters; - int err; - - ntfs_log_trace("Inode 0x%llx attr 0x%x new size %lld\n", (unsigned long long) - na->ni->mft_no, na->type, (long long)newsize); - - vol = na->ni->vol; - - /* - * Check the attribute type and the corresponding minimum size - * against @newsize and fail if @newsize is too small. - */ - if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) { - if (errno == ERANGE) { - ntfs_log_trace("Eeek! Size bounds check failed. " - "Aborting...\n"); - } else if (errno == ENOENT) - errno = EIO; - return -1; - } - - /* The first cluster outside the new allocation. */ - if (na->data_flags & ATTR_COMPRESSION_MASK) - /* - * For compressed files we must keep full compressions blocks, - * but currently we do not decompress/recompress the last - * block to truncate the data, so we may leave more allocated - * clusters than really needed. - */ - first_free_vcn = (((newsize - 1) - | (na->compression_block_size - 1)) + 1) - >> vol->cluster_size_bits; - else - first_free_vcn = (newsize + vol->cluster_size - 1) >> - vol->cluster_size_bits; - /* - * Compare the new allocation with the old one and only deallocate - * clusters if there is a change. - */ - if ((na->allocated_size >> vol->cluster_size_bits) != first_free_vcn) { - if (ntfs_attr_map_whole_runlist(na)) { - ntfs_log_trace("Eeek! ntfs_attr_map_whole_runlist " - "failed.\n"); - return -1; - } - /* Deallocate all clusters starting with the first free one. */ - nr_freed_clusters = ntfs_cluster_free(vol, na, first_free_vcn, - -1); - if (nr_freed_clusters < 0) { - ntfs_log_trace("Eeek! Freeing of clusters failed. " - "Aborting...\n"); - return -1; - } - - /* Truncate the runlist itself. */ - if (ntfs_rl_truncate(&na->rl, first_free_vcn)) { - /* - * Failed to truncate the runlist, so just throw it - * away, it will be mapped afresh on next use. - */ - free(na->rl); - na->rl = NULL; - ntfs_log_trace("Eeek! Run list truncation failed.\n"); - return -1; - } - - /* Prepare to mapping pairs update. */ - na->allocated_size = first_free_vcn << vol->cluster_size_bits; - /* Write mapping pairs for new runlist. */ - if (ntfs_attr_update_mapping_pairs(na, 0 /*first_free_vcn*/)) { - ntfs_log_trace("Eeek! Mapping pairs update failed. " - "Leaving inconstant metadata. " - "Run chkdsk.\n"); - return -1; - } - } - - /* Get the first attribute record. */ - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - - if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - err = errno; - if (err == ENOENT) - err = EIO; - ntfs_log_trace("Eeek! Lookup of first attribute extent failed. " - "Leaving inconstant metadata.\n"); - goto put_err_out; - } - - /* Update data and initialized size. */ - na->data_size = newsize; - ctx->attr->data_size = cpu_to_sle64(newsize); - if (newsize < na->initialized_size) { - na->initialized_size = newsize; - ctx->attr->initialized_size = cpu_to_sle64(newsize); - } - /* Update data size in the index. */ - if (na->ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - if (na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30) { - na->ni->data_size = na->data_size; - na->ni->allocated_size = na->allocated_size; - set_nino_flag(na->ni,KnownSize); - } - } else { - if (na->type == AT_DATA && na->name == AT_UNNAMED) { - na->ni->data_size = na->data_size; - NInoFileNameSetDirty(na->ni); - } - } - - /* If the attribute now has zero size, make it resident. */ - if (!newsize) { - if (ntfs_attr_make_resident(na, ctx)) { - /* If couldn't make resident, just continue. */ - if (errno != EPERM) - ntfs_log_error("Failed to make attribute " - "resident. Leaving as is...\n"); - } - } - - /* Set the inode dirty so it is written out later. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - /* Done! */ - ntfs_attr_put_search_ctx(ctx); - return 0; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - -/** - * ntfs_non_resident_attr_expand - expand a non-resident, open ntfs attribute - * @na: non-resident ntfs attribute to expand - * @newsize: new size (in bytes) to which to expand the attribute - * - * Expand the size of a non-resident, open ntfs attribute @na to @newsize bytes, - * by allocating new clusters. - * - * On success return 0 and on error return -1 with errno set to the error code. - * The following error codes are defined: - * ENOMEM - Not enough memory to complete operation. - * ERANGE - @newsize is not valid for the attribute type of @na. - * ENOSPC - There is no enough space in base mft to resize $ATTRIBUTE_LIST. - */ -static int ntfs_non_resident_attr_expand_i(ntfs_attr *na, const s64 newsize) -{ - LCN lcn_seek_from; - VCN first_free_vcn; - ntfs_volume *vol; - ntfs_attr_search_ctx *ctx; - runlist *rl, *rln; - s64 org_alloc_size; - int err; - - ntfs_log_trace("Inode %lld, attr 0x%x, new size %lld old size %lld\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)newsize, (long long)na->data_size); - - vol = na->ni->vol; - - /* - * Check the attribute type and the corresponding maximum size - * against @newsize and fail if @newsize is too big. - */ - if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) { - if (errno == ENOENT) - errno = EIO; - ntfs_log_perror("%s: bounds check failed", __FUNCTION__); - return -1; - } - - /* Save for future use. */ - org_alloc_size = na->allocated_size; - /* The first cluster outside the new allocation. */ - first_free_vcn = (newsize + vol->cluster_size - 1) >> - vol->cluster_size_bits; - /* - * Compare the new allocation with the old one and only allocate - * clusters if there is a change. - */ - if ((na->allocated_size >> vol->cluster_size_bits) < first_free_vcn) { - if (ntfs_attr_map_whole_runlist(na)) { - ntfs_log_perror("ntfs_attr_map_whole_runlist failed"); - return -1; - } - - /* - * If we extend $DATA attribute on NTFS 3+ volume, we can add - * sparse runs instead of real allocation of clusters. - */ - if (na->type == AT_DATA && vol->major_ver >= 3) { - rl = ntfs_malloc(0x1000); - if (!rl) - return -1; - - rl[0].vcn = (na->allocated_size >> - vol->cluster_size_bits); - rl[0].lcn = LCN_HOLE; - rl[0].length = first_free_vcn - - (na->allocated_size >> vol->cluster_size_bits); - rl[1].vcn = first_free_vcn; - rl[1].lcn = LCN_ENOENT; - rl[1].length = 0; - } else { - /* - * Determine first after last LCN of attribute. - * We will start seek clusters from this LCN to avoid - * fragmentation. If there are no valid LCNs in the - * attribute let the cluster allocator choose the - * starting LCN. - */ - lcn_seek_from = -1; - if (na->rl->length) { - /* Seek to the last run list element. */ - for (rl = na->rl; (rl + 1)->length; rl++) - ; - /* - * If the last LCN is a hole or similar seek - * back to last valid LCN. - */ - while (rl->lcn < 0 && rl != na->rl) - rl--; - /* - * Only set lcn_seek_from it the LCN is valid. - */ - if (rl->lcn >= 0) - lcn_seek_from = rl->lcn + rl->length; - } - - rl = ntfs_cluster_alloc(vol, na->allocated_size >> - vol->cluster_size_bits, first_free_vcn - - (na->allocated_size >> - vol->cluster_size_bits), lcn_seek_from, - DATA_ZONE); - if (!rl) { - ntfs_log_perror("Cluster allocation failed " - "(%lld)", - (long long)first_free_vcn - - ((long long)na->allocated_size >> - vol->cluster_size_bits)); - return -1; - } - } - - /* Append new clusters to attribute runlist. */ - rln = ntfs_runlists_merge(na->rl, rl); - if (!rln) { - /* Failed, free just allocated clusters. */ - err = errno; - ntfs_log_perror("Run list merge failed"); - ntfs_cluster_free_from_rl(vol, rl); - free(rl); - errno = err; - return -1; - } - na->rl = rln; - - /* Prepare to mapping pairs update. */ - na->allocated_size = first_free_vcn << vol->cluster_size_bits; - /* Write mapping pairs for new runlist. */ - if (ntfs_attr_update_mapping_pairs(na, 0 /*na->allocated_size >> - vol->cluster_size_bits*/)) { - err = errno; - ntfs_log_perror("Mapping pairs update failed"); - goto rollback; - } - } - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) { - err = errno; - if (na->allocated_size == org_alloc_size) { - errno = err; - return -1; - } else - goto rollback; - } - - if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - err = errno; - ntfs_log_perror("Lookup of first attribute extent failed"); - if (err == ENOENT) - err = EIO; - if (na->allocated_size != org_alloc_size) { - ntfs_attr_put_search_ctx(ctx); - goto rollback; - } else - goto put_err_out; - } - - /* Update data size. */ - na->data_size = newsize; - ctx->attr->data_size = cpu_to_sle64(newsize); - /* Update data size in the index. */ - if (na->ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - if (na->type == AT_INDEX_ROOT && na->name == NTFS_INDEX_I30) { - na->ni->data_size = na->data_size; - na->ni->allocated_size = na->allocated_size; - set_nino_flag(na->ni,KnownSize); - } - } else { - if (na->type == AT_DATA && na->name == AT_UNNAMED) { - na->ni->data_size = na->data_size; - NInoFileNameSetDirty(na->ni); - } - } - /* Set the inode dirty so it is written out later. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - /* Done! */ - ntfs_attr_put_search_ctx(ctx); - return 0; -rollback: - /* Free allocated clusters. */ - if (ntfs_cluster_free(vol, na, org_alloc_size >> - vol->cluster_size_bits, -1) < 0) { - err = EIO; - ntfs_log_perror("Leaking clusters"); - } - /* Now, truncate the runlist itself. */ - if (ntfs_rl_truncate(&na->rl, org_alloc_size >> - vol->cluster_size_bits)) { - /* - * Failed to truncate the runlist, so just throw it away, it - * will be mapped afresh on next use. - */ - free(na->rl); - na->rl = NULL; - ntfs_log_perror("Couldn't truncate runlist. Rollback failed"); - } else { - /* Prepare to mapping pairs update. */ - na->allocated_size = org_alloc_size; - /* Restore mapping pairs. */ - if (ntfs_attr_update_mapping_pairs(na, 0 /*na->allocated_size >> - vol->cluster_size_bits*/)) { - ntfs_log_perror("Failed to restore old mapping pairs"); - } - } - errno = err; - return -1; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - - -static int ntfs_non_resident_attr_expand(ntfs_attr *na, const s64 newsize) -{ - int ret; - - ntfs_log_enter("Entering\n"); - ret = ntfs_non_resident_attr_expand_i(na, newsize); - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_attr_truncate - resize an ntfs attribute - * @na: open ntfs attribute to resize - * @newsize: new size (in bytes) to which to resize the attribute - * - * Change the size of an open ntfs attribute @na to @newsize bytes. If the - * attribute is made bigger and the attribute is resident the newly - * "allocated" space is cleared and if the attribute is non-resident the - * newly allocated space is marked as not initialised and no real allocation - * on disk is performed. - * - * On success return 0. - * On error return values are: - * STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT - * STATUS_ERROR - otherwise - * The following error codes are defined: - * EINVAL - Invalid arguments were passed to the function. - * EOPNOTSUPP - The desired resize is not implemented yet. - * EACCES - Encrypted attribute. - */ -int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize) -{ - int ret = STATUS_ERROR; - s64 fullsize; - BOOL compressed; - - if (!na || newsize < 0 || - (na->ni->mft_no == FILE_MFT && na->type == AT_DATA)) { - ntfs_log_trace("Invalid arguments passed.\n"); - errno = EINVAL; - return STATUS_ERROR; - } - - ntfs_log_enter("Entering for inode %lld, attr 0x%x, size %lld\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)newsize); - - if (na->data_size == newsize) { - ntfs_log_trace("Size is already ok\n"); - ret = STATUS_OK; - goto out; - } - /* - * Encrypted attributes are not supported. We return access denied, - * which is what Windows NT4 does, too. - */ - if (na->data_flags & ATTR_IS_ENCRYPTED) { - errno = EACCES; - ntfs_log_trace("Cannot truncate encrypted attribute\n"); - goto out; - } - /* - * TODO: Implement making handling of compressed attributes. - * Currently we can only expand the attribute or delete it, - * and only for ATTR_IS_COMPRESSED. This is however possible - * for resident attributes when there is no open fuse context - * (important case : $INDEX_ROOT:$I30) - */ - compressed = (na->data_flags & ATTR_COMPRESSION_MASK) - != const_cpu_to_le16(0); - if (compressed - && NAttrNonResident(na) - && ((na->data_flags & ATTR_COMPRESSION_MASK) != ATTR_IS_COMPRESSED)) { - errno = EOPNOTSUPP; - ntfs_log_perror("Failed to truncate compressed attribute"); - goto out; - } - if (NAttrNonResident(na)) { - /* - * For compressed data, the last block must be fully - * allocated, and we do not know the size of compression - * block until the attribute has been made non-resident. - * Moreover we can only process a single compression - * block at a time (from where we are about to write), - * so we silently do not allocate more. - * - * Note : do not request upsizing of compressed files - * unless being able to face the consequences ! - */ - if (compressed && newsize && (newsize > na->data_size)) - fullsize = (na->initialized_size - | (na->compression_block_size - 1)) + 1; - else - fullsize = newsize; - if (fullsize > na->data_size) - ret = ntfs_non_resident_attr_expand(na, fullsize); - else - ret = ntfs_non_resident_attr_shrink(na, fullsize); - } else - ret = ntfs_resident_attr_resize(na, newsize); -out: - ntfs_log_leave("Return status %d\n", ret); - return ret; -} - -/* - * Stuff a hole in a compressed file - * - * An unallocated hole must be aligned on compression block size. - * If needed current block and target block are stuffed with zeroes. - * - * Returns 0 if succeeded, - * -1 if it failed (as explained in errno) - */ - -static int stuff_hole(ntfs_attr *na, const s64 pos) -{ - s64 size; - s64 begin_size; - s64 end_size; - char *buf; - int ret; - - ret = 0; - /* - * If the attribute is resident, the compression block size - * is not defined yet and we can make no decision. - * So we first try resizing to the target and if the - * attribute is still resident, we're done - */ - if (!NAttrNonResident(na)) { - ret = ntfs_resident_attr_resize(na, pos); - if (!ret && !NAttrNonResident(na)) - na->initialized_size = na->data_size = pos; - } - if (!ret && NAttrNonResident(na)) { - /* does the hole span over several compression block ? */ - if ((pos ^ na->initialized_size) - & ~(na->compression_block_size - 1)) { - begin_size = ((na->initialized_size - 1) - | (na->compression_block_size - 1)) - + 1 - na->initialized_size; - end_size = pos & (na->compression_block_size - 1); - size = (begin_size > end_size ? begin_size : end_size); - } else { - /* short stuffing in a single compression block */ - begin_size = size = pos - na->initialized_size; - end_size = 0; - } - if (size) - buf = (char*)ntfs_malloc(size); - else - buf = (char*)NULL; - if (buf || !size) { - memset(buf,0,size); - /* stuff into current block */ - if (begin_size - && (ntfs_attr_pwrite(na, - na->initialized_size, begin_size, buf) - != begin_size)) - ret = -1; - /* create an unstuffed hole */ - if (!ret - && ((na->initialized_size + end_size) < pos) - && ntfs_non_resident_attr_expand(na, - pos - end_size)) - ret = -1; - else - na->initialized_size - = na->data_size = pos - end_size; - /* stuff into the target block */ - if (!ret && end_size - && (ntfs_attr_pwrite(na, - na->initialized_size, end_size, buf) - != end_size)) - ret = -1; - if (buf) - free(buf); - } else - ret = -1; - } - /* make absolutely sure we have reached the target */ - if (!ret && (na->initialized_size != pos)) { - ntfs_log_error("Failed to stuff a compressed file" - "target %lld reached %lld\n", - (long long)pos, (long long)na->initialized_size); - errno = EIO; - ret = -1; - } - return (ret); -} - -/** - * ntfs_attr_readall - read the entire data from an ntfs attribute - * @ni: open ntfs inode in which the ntfs attribute resides - * @type: attribute type - * @name: attribute name in little endian Unicode or AT_UNNAMED or NULL - * @name_len: length of attribute @name in Unicode characters (if @name given) - * @data_size: if non-NULL then store here the data size - * - * This function will read the entire content of an ntfs attribute. - * If @name is AT_UNNAMED then look specifically for an unnamed attribute. - * If @name is NULL then the attribute could be either named or not. - * In both those cases @name_len is not used at all. - * - * On success a buffer is allocated with the content of the attribute - * and which needs to be freed when it's not needed anymore. If the - * @data_size parameter is non-NULL then the data size is set there. - * - * On error NULL is returned with errno set to the error code. - */ -void *ntfs_attr_readall(ntfs_inode *ni, const ATTR_TYPES type, - ntfschar *name, u32 name_len, s64 *data_size) -{ - ntfs_attr *na; - void *data, *ret = NULL; - s64 size; - - ntfs_log_enter("Entering\n"); - - na = ntfs_attr_open(ni, type, name, name_len); - if (!na) { - ntfs_log_perror("ntfs_attr_open failed"); - goto err_exit; - } - data = ntfs_malloc(na->data_size); - if (!data) - goto out; - - size = ntfs_attr_pread(na, 0, na->data_size, data); - if (size != na->data_size) { - ntfs_log_perror("ntfs_attr_pread failed"); - free(data); - goto out; - } - ret = data; - if (data_size) - *data_size = size; -out: - ntfs_attr_close(na); -err_exit: - ntfs_log_leave("\n"); - return ret; -} - - - -int ntfs_attr_exist(ntfs_inode *ni, const ATTR_TYPES type, ntfschar *name, - u32 name_len) -{ - ntfs_attr_search_ctx *ctx; - int ret; - - ntfs_log_trace("Entering\n"); - - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return 0; - - ret = ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE, 0, NULL, 0, - ctx); - - ntfs_attr_put_search_ctx(ctx); - - return !ret; -} - -int ntfs_attr_remove(ntfs_inode *ni, const ATTR_TYPES type, ntfschar *name, - u32 name_len) -{ - ntfs_attr *na; - int ret; - - ntfs_log_trace("Entering\n"); - - if (!ni) { - ntfs_log_error("%s: NULL inode pointer", __FUNCTION__); - errno = EINVAL; - return -1; - } - - na = ntfs_attr_open(ni, type, name, name_len); - if (!na) { - /* do not log removal of non-existent stream */ - if (type != AT_DATA) { - ntfs_log_perror("Failed to open attribute 0x%02x of inode " - "0x%llx", type, (unsigned long long)ni->mft_no); - } - return -1; - } - - ret = ntfs_attr_rm(na); - if (ret) - ntfs_log_perror("Failed to remove attribute 0x%02x of inode " - "0x%llx", type, (unsigned long long)ni->mft_no); - ntfs_attr_close(na); - - return ret; -} - -/* Below macros are 32-bit ready. */ -#define BCX(x) ((x) - (((x) >> 1) & 0x77777777) - \ - (((x) >> 2) & 0x33333333) - \ - (((x) >> 3) & 0x11111111)) -#define BITCOUNT(x) (((BCX(x) + (BCX(x) >> 4)) & 0x0F0F0F0F) % 255) - -static u8 *ntfs_init_lut256(void) -{ - int i; - u8 *lut; - - lut = ntfs_malloc(256); - if (lut) - for(i = 0; i < 256; i++) - *(lut + i) = 8 - BITCOUNT(i); - return lut; -} - -s64 ntfs_attr_get_free_bits(ntfs_attr *na) -{ - u8 *buf, *lut; - s64 br = 0; - s64 total = 0; - s64 nr_free = 0; - - lut = ntfs_init_lut256(); - if (!lut) - return -1; - - buf = ntfs_malloc(65536); - if (!buf) - goto out; - - while (1) { - u32 *p; - br = ntfs_attr_pread(na, total, 65536, buf); - if (br <= 0) - break; - total += br; - p = (u32 *)buf + br / 4 - 1; - for (; (u8 *)p >= buf; p--) { - nr_free += lut[ *p & 255] + - lut[(*p >> 8) & 255] + - lut[(*p >> 16) & 255] + - lut[(*p >> 24) ]; - } - switch (br % 4) { - case 3: nr_free += lut[*(buf + br - 3)]; - case 2: nr_free += lut[*(buf + br - 2)]; - case 1: nr_free += lut[*(buf + br - 1)]; - } - } - free(buf); -out: - free(lut); - if (!total || br < 0) - return -1; - return nr_free; -} diff --git a/source/libs/libntfs/attrib.h b/source/libs/libntfs/attrib.h deleted file mode 100644 index 43ab7f53..00000000 --- a/source/libs/libntfs/attrib.h +++ /dev/null @@ -1,375 +0,0 @@ -/* - * attrib.h - Exports for attribute handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * Copyright (c) 2004-2005 Yura Pakhuchiy - * Copyright (c) 2006-2007 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_ATTRIB_H -#define _NTFS_ATTRIB_H - -/* Forward declarations */ -typedef struct _ntfs_attr ntfs_attr; -typedef struct _ntfs_attr_search_ctx ntfs_attr_search_ctx; - -#include "types.h" -#include "inode.h" -#include "unistr.h" -#include "runlist.h" -#include "volume.h" -#include "debug.h" -#include "logging.h" - -extern ntfschar AT_UNNAMED[]; -extern ntfschar STREAM_SDS[]; - -/* The little endian Unicode string $TXF_DATA as a global constant. */ -extern ntfschar TXF_DATA[10]; - -/** - * enum ntfs_lcn_special_values - special return values for ntfs_*_vcn_to_lcn() - * - * Special return values for ntfs_rl_vcn_to_lcn() and ntfs_attr_vcn_to_lcn(). - * - * TODO: Describe them. - */ -typedef enum { - LCN_HOLE = -1, /* Keep this as highest value or die! */ - LCN_RL_NOT_MAPPED = -2, - LCN_ENOENT = -3, - LCN_EINVAL = -4, - LCN_EIO = -5, -} ntfs_lcn_special_values; - -/** - * struct ntfs_attr_search_ctx - search context used in attribute search functions - * @mrec: buffer containing mft record to search - * @attr: attribute record in @mrec where to begin/continue search - * @is_first: if true lookup_attr() begins search with @attr, else after @attr - * - * Structure must be initialized to zero before the first call to one of the - * attribute search functions. Initialize @mrec to point to the mft record to - * search, and @attr to point to the first attribute within @mrec (not necessary - * if calling the _first() functions), and set @is_first to TRUE (not necessary - * if calling the _first() functions). - * - * If @is_first is TRUE, the search begins with @attr. If @is_first is FALSE, - * the search begins after @attr. This is so that, after the first call to one - * of the search attribute functions, we can call the function again, without - * any modification of the search context, to automagically get the next - * matching attribute. - */ -struct _ntfs_attr_search_ctx { - MFT_RECORD *mrec; - ATTR_RECORD *attr; - BOOL is_first; - ntfs_inode *ntfs_ino; - ATTR_LIST_ENTRY *al_entry; - ntfs_inode *base_ntfs_ino; - MFT_RECORD *base_mrec; - ATTR_RECORD *base_attr; -}; - -extern void ntfs_attr_reinit_search_ctx(ntfs_attr_search_ctx *ctx); -extern ntfs_attr_search_ctx *ntfs_attr_get_search_ctx(ntfs_inode *ni, - MFT_RECORD *mrec); -extern void ntfs_attr_put_search_ctx(ntfs_attr_search_ctx *ctx); - -extern int ntfs_attr_lookup(const ATTR_TYPES type, const ntfschar *name, - const u32 name_len, const IGNORE_CASE_BOOL ic, - const VCN lowest_vcn, const u8 *val, const u32 val_len, - ntfs_attr_search_ctx *ctx); - -extern int ntfs_attr_position(const ATTR_TYPES type, ntfs_attr_search_ctx *ctx); - -extern ATTR_DEF *ntfs_attr_find_in_attrdef(const ntfs_volume *vol, - const ATTR_TYPES type); - -/** - * ntfs_attrs_walk - syntactic sugar for walking all attributes in an inode - * @ctx: initialised attribute search context - * - * Syntactic sugar for walking attributes in an inode. - * - * Return 0 on success and -1 on error with errno set to the error code from - * ntfs_attr_lookup(). - * - * Example: When you want to enumerate all attributes in an open ntfs inode - * @ni, you can simply do: - * - * int err; - * ntfs_attr_search_ctx *ctx = ntfs_attr_get_search_ctx(ni, NULL); - * if (!ctx) - * // Error code is in errno. Handle this case. - * while (!(err = ntfs_attrs_walk(ctx))) { - * ATTR_RECORD *attr = ctx->attr; - * // attr now contains the next attribute. Do whatever you want - * // with it and then just continue with the while loop. - * } - * if (err && errno != ENOENT) - * // Ooops. An error occurred! You should handle this case. - * // Now finished with all attributes in the inode. - */ -static __inline__ int ntfs_attrs_walk(ntfs_attr_search_ctx *ctx) -{ - return ntfs_attr_lookup(AT_UNUSED, NULL, 0, CASE_SENSITIVE, 0, - NULL, 0, ctx); -} - -/** - * struct ntfs_attr - ntfs in memory non-resident attribute structure - * @rl: if not NULL, the decompressed runlist - * @ni: base ntfs inode to which this attribute belongs - * @type: attribute type - * @name: Unicode name of the attribute - * @name_len: length of @name in Unicode characters - * @state: NTFS attribute specific flags describing this attribute - * @allocated_size: copy from the attribute record - * @data_size: copy from the attribute record - * @initialized_size: copy from the attribute record - * @compressed_size: copy from the attribute record - * @compression_block_size: size of a compression block (cb) - * @compression_block_size_bits: log2 of the size of a cb - * @compression_block_clusters: number of clusters per cb - * - * This structure exists purely to provide a mechanism of caching the runlist - * of an attribute. If you want to operate on a particular attribute extent, - * you should not be using this structure at all. If you want to work with a - * resident attribute, you should not be using this structure at all. As a - * fail-safe check make sure to test NAttrNonResident() and if it is false, you - * know you shouldn't be using this structure. - * - * If you want to work on a resident attribute or on a specific attribute - * extent, you should use ntfs_lookup_attr() to retrieve the attribute (extent) - * record, edit that, and then write back the mft record (or set the - * corresponding ntfs inode dirty for delayed write back). - * - * @rl is the decompressed runlist of the attribute described by this - * structure. Obviously this only makes sense if the attribute is not resident, - * i.e. NAttrNonResident() is true. If the runlist hasn't been decompressed yet - * @rl is NULL, so be prepared to cope with @rl == NULL. - * - * @ni is the base ntfs inode of the attribute described by this structure. - * - * @type is the attribute type (see layout.h for the definition of ATTR_TYPES), - * @name and @name_len are the little endian Unicode name and the name length - * in Unicode characters of the attribute, respectively. - * - * @state contains NTFS attribute specific flags describing this attribute - * structure. See ntfs_attr_state_bits above. - */ -struct _ntfs_attr { - runlist_element *rl; - ntfs_inode *ni; - ATTR_TYPES type; - ATTR_FLAGS data_flags; - ntfschar *name; - u32 name_len; - unsigned long state; - s64 allocated_size; - s64 data_size; - s64 initialized_size; - s64 compressed_size; - u32 compression_block_size; - u8 compression_block_size_bits; - u8 compression_block_clusters; - s8 unused_runs; /* pre-reserved entries available */ -}; - -/** - * enum ntfs_attr_state_bits - bits for the state field in the ntfs_attr - * structure - */ -typedef enum { - NA_Initialized, /* 1: structure is initialized. */ - NA_NonResident, /* 1: Attribute is not resident. */ - NA_BeingNonResident, /* 1: Attribute is being made not resident. */ - NA_FullyMapped, /* 1: Attribute has been fully mapped */ - NA_ComprClosing, /* 1: Compressed attribute is being closed */ -} ntfs_attr_state_bits; - -#define test_nattr_flag(na, flag) test_bit(NA_##flag, (na)->state) -#define set_nattr_flag(na, flag) set_bit(NA_##flag, (na)->state) -#define clear_nattr_flag(na, flag) clear_bit(NA_##flag, (na)->state) - -#define NAttrInitialized(na) test_nattr_flag(na, Initialized) -#define NAttrSetInitialized(na) set_nattr_flag(na, Initialized) -#define NAttrClearInitialized(na) clear_nattr_flag(na, Initialized) - -#define NAttrNonResident(na) test_nattr_flag(na, NonResident) -#define NAttrSetNonResident(na) set_nattr_flag(na, NonResident) -#define NAttrClearNonResident(na) clear_nattr_flag(na, NonResident) - -#define NAttrBeingNonResident(na) test_nattr_flag(na, BeingNonResident) -#define NAttrSetBeingNonResident(na) set_nattr_flag(na, BeingNonResident) -#define NAttrClearBeingNonResident(na) clear_nattr_flag(na, BeingNonResident) - -#define NAttrFullyMapped(na) test_nattr_flag(na, FullyMapped) -#define NAttrSetFullyMapped(na) set_nattr_flag(na, FullyMapped) -#define NAttrClearFullyMapped(na) clear_nattr_flag(na, FullyMapped) - -#define NAttrComprClosing(na) test_nattr_flag(na, ComprClosing) -#define NAttrSetComprClosing(na) set_nattr_flag(na, ComprClosing) -#define NAttrClearComprClosing(na) clear_nattr_flag(na, ComprClosing) - -#define GenNAttrIno(func_name, flag) \ -extern int NAttr##func_name(ntfs_attr *na); \ -extern void NAttrSet##func_name(ntfs_attr *na); \ -extern void NAttrClear##func_name(ntfs_attr *na); - -GenNAttrIno(Compressed, FILE_ATTR_COMPRESSED) -GenNAttrIno(Encrypted, FILE_ATTR_ENCRYPTED) -GenNAttrIno(Sparse, FILE_ATTR_SPARSE_FILE) -#undef GenNAttrIno - -/** - * union attr_val - Union of all known attribute values - * - * For convenience. Used in the attr structure. - */ -typedef union { - u8 _default; /* Unnamed u8 to serve as default when just using - a_val without specifying any of the below. */ - STANDARD_INFORMATION std_inf; - ATTR_LIST_ENTRY al_entry; - FILE_NAME_ATTR filename; - OBJECT_ID_ATTR obj_id; - SECURITY_DESCRIPTOR_ATTR sec_desc; - VOLUME_NAME vol_name; - VOLUME_INFORMATION vol_inf; - DATA_ATTR data; - INDEX_ROOT index_root; - INDEX_BLOCK index_blk; - BITMAP_ATTR bmp; - REPARSE_POINT reparse; - EA_INFORMATION ea_inf; - EA_ATTR ea; - PROPERTY_SET property_set; - LOGGED_UTILITY_STREAM logged_util_stream; - EFS_ATTR_HEADER efs; -} attr_val; - -extern void ntfs_attr_init(ntfs_attr *na, const BOOL non_resident, - const ATTR_FLAGS data_flags, const BOOL encrypted, - const BOOL sparse, - const s64 allocated_size, const s64 data_size, - const s64 initialized_size, const s64 compressed_size, - const u8 compression_unit); - - /* warning : in the following "name" has to be freeable */ - /* or one of constants AT_UNNAMED, NTFS_INDEX_I30 or STREAM_SDS */ -extern ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type, - ntfschar *name, u32 name_len); -extern void ntfs_attr_close(ntfs_attr *na); - -extern s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, - void *b); -extern s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, - const void *b); -extern int ntfs_attr_pclose(ntfs_attr *na); - -extern void *ntfs_attr_readall(ntfs_inode *ni, const ATTR_TYPES type, - ntfschar *name, u32 name_len, s64 *data_size); - -extern s64 ntfs_attr_mst_pread(ntfs_attr *na, const s64 pos, - const s64 bk_cnt, const u32 bk_size, void *dst); -extern s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const s64 pos, - s64 bk_cnt, const u32 bk_size, void *src); - -extern int ntfs_attr_map_runlist(ntfs_attr *na, VCN vcn); -extern int ntfs_attr_map_whole_runlist(ntfs_attr *na); - -extern LCN ntfs_attr_vcn_to_lcn(ntfs_attr *na, const VCN vcn); -extern runlist_element *ntfs_attr_find_vcn(ntfs_attr *na, const VCN vcn); - -extern int ntfs_attr_size_bounds_check(const ntfs_volume *vol, - const ATTR_TYPES type, const s64 size); -extern int ntfs_attr_can_be_resident(const ntfs_volume *vol, - const ATTR_TYPES type); -int ntfs_attr_make_non_resident(ntfs_attr *na, - ntfs_attr_search_ctx *ctx); -int ntfs_attr_force_non_resident(ntfs_attr *na); -extern int ntfs_make_room_for_attr(MFT_RECORD *m, u8 *pos, u32 size); - -extern int ntfs_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, u8 *val, u32 size, - ATTR_FLAGS flags); -extern int ntfs_non_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, VCN lowest_vcn, int dataruns_size, - ATTR_FLAGS flags); -extern int ntfs_attr_record_rm(ntfs_attr_search_ctx *ctx); - -extern int ntfs_attr_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, u8 *val, s64 size); -extern int ntfs_attr_set_flags(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, ATTR_FLAGS flags, ATTR_FLAGS mask); -extern int ntfs_attr_rm(ntfs_attr *na); - -extern int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size); - -extern int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a, - const u32 new_size); - -extern int ntfs_attr_record_move_to(ntfs_attr_search_ctx *ctx, ntfs_inode *ni); -extern int ntfs_attr_record_move_away(ntfs_attr_search_ctx *ctx, int extra); - -extern int ntfs_attr_update_mapping_pairs(ntfs_attr *na, VCN from_vcn); - -extern int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize); - -/** - * get_attribute_value_length - return the length of the value of an attribute - * @a: pointer to a buffer containing the attribute record - * - * Return the byte size of the attribute value of the attribute @a (as it - * would be after eventual decompression and filling in of holes if sparse). - * If we return 0, check errno. If errno is 0 the actual length was 0, - * otherwise errno describes the error. - * - * FIXME: Describe possible errnos. - */ -extern s64 ntfs_get_attribute_value_length(const ATTR_RECORD *a); - -/** - * get_attribute_value - return the attribute value of an attribute - * @vol: volume on which the attribute is present - * @a: attribute to get the value of - * @b: destination buffer for the attribute value - * - * Make a copy of the attribute value of the attribute @a into the destination - * buffer @b. Note, that the size of @b has to be at least equal to the value - * returned by get_attribute_value_length(@a). - * - * Return number of bytes copied. If this is zero check errno. If errno is 0 - * then nothing was read due to a zero-length attribute value, otherwise - * errno describes the error. - */ -extern s64 ntfs_get_attribute_value(const ntfs_volume *vol, - const ATTR_RECORD *a, u8 *b); - -extern void ntfs_attr_name_free(char **name); -extern char *ntfs_attr_name_get(const ntfschar *uname, const int uname_len); -extern int ntfs_attr_exist(ntfs_inode *ni, const ATTR_TYPES type, - ntfschar *name, u32 name_len); -extern int ntfs_attr_remove(ntfs_inode *ni, const ATTR_TYPES type, - ntfschar *name, u32 name_len); -extern s64 ntfs_attr_get_free_bits(ntfs_attr *na); - -#endif /* defined _NTFS_ATTRIB_H */ - diff --git a/source/libs/libntfs/attrib_frag.c b/source/libs/libntfs/attrib_frag.c deleted file mode 100644 index 5c3c4a1d..00000000 --- a/source/libs/libntfs/attrib_frag.c +++ /dev/null @@ -1,5914 +0,0 @@ -/** - * attrib.c - Attribute handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2005 Anton Altaparmakov - * Copyright (c) 2002-2005 Richard Russon - * Copyright (c) 2002-2008 Szabolcs Szakacsits - * Copyright (c) 2004-2007 Yura Pakhuchiy - * Copyright (c) 2007-2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "compat.h" -#include "attrib.h" -#include "attrlist.h" -#include "device.h" -#include "mft.h" -#include "debug.h" -#include "mst.h" -#include "volume.h" -#include "types.h" -#include "layout.h" -#include "inode.h" -#include "runlist.h" -#include "lcnalloc.h" -#include "dir.h" -#include "compress.h" -#include "bitmap.h" -#include "logging.h" -#include "misc.h" -#include "efs.h" -#include "ntfs.h" - -#if 0 - -#define STANDARD_COMPRESSION_UNIT 4 - -ntfschar AT_UNNAMED[] = { const_cpu_to_le16('\0') }; -ntfschar STREAM_SDS[] = { const_cpu_to_le16('$'), - const_cpu_to_le16('S'), - const_cpu_to_le16('D'), - const_cpu_to_le16('S'), - const_cpu_to_le16('\0') }; - -static int NAttrFlag(ntfs_attr *na, FILE_ATTR_FLAGS flag) -{ - if (na->type == AT_DATA && na->name == AT_UNNAMED) - return (na->ni->flags & flag); - return 0; -} - -static void NAttrSetFlag(ntfs_attr *na, FILE_ATTR_FLAGS flag) -{ - if (na->type == AT_DATA && na->name == AT_UNNAMED) - na->ni->flags |= flag; - else - ntfs_log_trace("Denied setting flag %d for not unnamed data " - "attribute\n", flag); -} - -static void NAttrClearFlag(ntfs_attr *na, FILE_ATTR_FLAGS flag) -{ - if (na->type == AT_DATA && na->name == AT_UNNAMED) - na->ni->flags &= ~flag; -} - -#define GenNAttrIno(func_name, flag) \ -int NAttr##func_name(ntfs_attr *na) { return NAttrFlag (na, flag); } \ -void NAttrSet##func_name(ntfs_attr *na) { NAttrSetFlag (na, flag); } \ -void NAttrClear##func_name(ntfs_attr *na){ NAttrClearFlag(na, flag); } - -GenNAttrIno(Compressed, FILE_ATTR_COMPRESSED) -GenNAttrIno(Encrypted, FILE_ATTR_ENCRYPTED) -GenNAttrIno(Sparse, FILE_ATTR_SPARSE_FILE) - -/** - * ntfs_get_attribute_value_length - Find the length of an attribute - * @a: - * - * Description... - * - * Returns: - */ -s64 ntfs_get_attribute_value_length(const ATTR_RECORD *a) -{ - if (!a) { - errno = EINVAL; - return 0; - } - errno = 0; - if (a->non_resident) - return sle64_to_cpu(a->data_size); - - return (s64)le32_to_cpu(a->value_length); -} - -/** - * ntfs_get_attribute_value - Get a copy of an attribute - * @vol: - * @a: - * @b: - * - * Description... - * - * Returns: - */ -s64 ntfs_get_attribute_value(const ntfs_volume *vol, - const ATTR_RECORD *a, u8 *b) -{ - runlist *rl; - s64 total, r; - int i; - - /* Sanity checks. */ - if (!vol || !a || !b) { - errno = EINVAL; - return 0; - } - /* Complex attribute? */ - /* - * Ignore the flags in case they are not zero for an attribute list - * attribute. Windows does not complain about invalid flags and chkdsk - * does not detect or fix them so we need to cope with it, too. - */ - if (a->type != AT_ATTRIBUTE_LIST && a->flags) { - ntfs_log_error("Non-zero (%04x) attribute flags. Cannot handle " - "this yet.\n", le16_to_cpu(a->flags)); - errno = EOPNOTSUPP; - return 0; - } - if (!a->non_resident) { - /* Attribute is resident. */ - - /* Sanity check. */ - if (le32_to_cpu(a->value_length) + le16_to_cpu(a->value_offset) - > le32_to_cpu(a->length)) { - return 0; - } - - memcpy(b, (const char*)a + le16_to_cpu(a->value_offset), - le32_to_cpu(a->value_length)); - errno = 0; - return (s64)le32_to_cpu(a->value_length); - } - - /* Attribute is not resident. */ - - /* If no data, return 0. */ - if (!(a->data_size)) { - errno = 0; - return 0; - } - /* - * FIXME: What about attribute lists?!? (AIA) - */ - /* Decompress the mapping pairs array into a runlist. */ - rl = ntfs_mapping_pairs_decompress(vol, a, NULL); - if (!rl) { - errno = EINVAL; - return 0; - } - /* - * FIXED: We were overflowing here in a nasty fashion when we - * reach the last cluster in the runlist as the buffer will - * only be big enough to hold data_size bytes while we are - * reading in allocated_size bytes which is usually larger - * than data_size, since the actual data is unlikely to have a - * size equal to a multiple of the cluster size! - * FIXED2: We were also overflowing here in the same fashion - * when the data_size was more than one run smaller than the - * allocated size which happens with Windows XP sometimes. - */ - /* Now load all clusters in the runlist into b. */ - for (i = 0, total = 0; rl[i].length; i++) { - if (total + (rl[i].length << vol->cluster_size_bits) >= - sle64_to_cpu(a->data_size)) { - unsigned char *intbuf = NULL; - /* - * We have reached the last run so we were going to - * overflow when executing the ntfs_pread() which is - * BAAAAAAAD! - * Temporary fix: - * Allocate a new buffer with size: - * rl[i].length << vol->cluster_size_bits, do the - * read into our buffer, then memcpy the correct - * amount of data into the caller supplied buffer, - * free our buffer, and continue. - * We have reached the end of data size so we were - * going to overflow in the same fashion. - * Temporary fix: same as above. - */ - intbuf = ntfs_malloc(rl[i].length << vol->cluster_size_bits); - if (!intbuf) { - free(rl); - return 0; - } - /* - * FIXME: If compressed file: Only read if lcn != -1. - * Otherwise, we are dealing with a sparse run and we - * just memset the user buffer to 0 for the length of - * the run, which should be 16 (= compression unit - * size). - * FIXME: Really only when file is compressed, or can - * we have sparse runs in uncompressed files as well? - * - Yes we can, in sparse files! But not necessarily - * size of 16, just run length. - */ - r = ntfs_pread(vol->dev, rl[i].lcn << - vol->cluster_size_bits, rl[i].length << - vol->cluster_size_bits, intbuf); - if (r != rl[i].length << vol->cluster_size_bits) { -#define ESTR "Error reading attribute value" - if (r == -1) - ntfs_log_perror(ESTR); - else if (r < rl[i].length << - vol->cluster_size_bits) { - ntfs_log_debug(ESTR ": Ran out of input data.\n"); - errno = EIO; - } else { - ntfs_log_debug(ESTR ": unknown error\n"); - errno = EIO; - } -#undef ESTR - free(rl); - free(intbuf); - return 0; - } - memcpy(b + total, intbuf, sle64_to_cpu(a->data_size) - - total); - free(intbuf); - total = sle64_to_cpu(a->data_size); - break; - } - /* - * FIXME: If compressed file: Only read if lcn != -1. - * Otherwise, we are dealing with a sparse run and we just - * memset the user buffer to 0 for the length of the run, which - * should be 16 (= compression unit size). - * FIXME: Really only when file is compressed, or can - * we have sparse runs in uncompressed files as well? - * - Yes we can, in sparse files! But not necessarily size of - * 16, just run length. - */ - r = ntfs_pread(vol->dev, rl[i].lcn << vol->cluster_size_bits, - rl[i].length << vol->cluster_size_bits, - b + total); - if (r != rl[i].length << vol->cluster_size_bits) { -#define ESTR "Error reading attribute value" - if (r == -1) - ntfs_log_perror(ESTR); - else if (r < rl[i].length << vol->cluster_size_bits) { - ntfs_log_debug(ESTR ": Ran out of input data.\n"); - errno = EIO; - } else { - ntfs_log_debug(ESTR ": unknown error\n"); - errno = EIO; - } -#undef ESTR - free(rl); - return 0; - } - total += r; - } - free(rl); - return total; -} - -/* Already cleaned up code below, but still look for FIXME:... */ - -/** - * __ntfs_attr_init - primary initialization of an ntfs attribute structure - * @na: ntfs attribute to initialize - * @ni: ntfs inode with which to initialize the ntfs attribute - * @type: attribute type - * @name: attribute name in little endian Unicode or NULL - * @name_len: length of attribute @name in Unicode characters (if @name given) - * - * Initialize the ntfs attribute @na with @ni, @type, @name, and @name_len. - */ -static void __ntfs_attr_init(ntfs_attr *na, ntfs_inode *ni, - const ATTR_TYPES type, ntfschar *name, const u32 name_len) -{ - na->rl = NULL; - na->ni = ni; - na->type = type; - na->name = name; - if (name) - na->name_len = name_len; - else - na->name_len = 0; -} - -/** - * ntfs_attr_init - initialize an ntfs_attr with data sizes and status - * @na: - * @non_resident: - * @compressed: - * @encrypted: - * @sparse: - * @allocated_size: - * @data_size: - * @initialized_size: - * @compressed_size: - * @compression_unit: - * - * Final initialization for an ntfs attribute. - */ -void ntfs_attr_init(ntfs_attr *na, const BOOL non_resident, - const ATTR_FLAGS data_flags, - const BOOL encrypted, const BOOL sparse, - const s64 allocated_size, const s64 data_size, - const s64 initialized_size, const s64 compressed_size, - const u8 compression_unit) -{ - if (!NAttrInitialized(na)) { - na->data_flags = data_flags; - if (non_resident) - NAttrSetNonResident(na); - if (data_flags & ATTR_COMPRESSION_MASK) - NAttrSetCompressed(na); - if (encrypted) - NAttrSetEncrypted(na); - if (sparse) - NAttrSetSparse(na); - na->allocated_size = allocated_size; - na->data_size = data_size; - na->initialized_size = initialized_size; - if ((data_flags & ATTR_COMPRESSION_MASK) || sparse) { - ntfs_volume *vol = na->ni->vol; - - na->compressed_size = compressed_size; - na->compression_block_clusters = 1 << compression_unit; - na->compression_block_size = 1 << (compression_unit + - vol->cluster_size_bits); - na->compression_block_size_bits = ffs( - na->compression_block_size) - 1; - } - NAttrSetInitialized(na); - } -} - -/** - * ntfs_attr_open - open an ntfs attribute for access - * @ni: open ntfs inode in which the ntfs attribute resides - * @type: attribute type - * @name: attribute name in little endian Unicode or AT_UNNAMED or NULL - * @name_len: length of attribute @name in Unicode characters (if @name given) - * - * Allocate a new ntfs attribute structure, initialize it with @ni, @type, - * @name, and @name_len, then return it. Return NULL on error with - * errno set to the error code. - * - * If @name is AT_UNNAMED look specifically for an unnamed attribute. If you - * do not care whether the attribute is named or not set @name to NULL. In - * both those cases @name_len is not used at all. - */ -ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type, - ntfschar *name, u32 name_len) -{ - ntfs_attr_search_ctx *ctx; - ntfs_attr *na = NULL; - ntfschar *newname = NULL; - ATTR_RECORD *a; - BOOL cs; - - ntfs_log_enter("Entering for inode %lld, attr 0x%x.\n", - (unsigned long long)ni->mft_no, type); - - if (!ni || !ni->vol || !ni->mrec) { - errno = EINVAL; - goto out; - } - na = ntfs_calloc(sizeof(ntfs_attr)); - if (!na) - goto out; - if (name && name != AT_UNNAMED && name != NTFS_INDEX_I30) { - name = ntfs_ucsndup(name, name_len); - if (!name) - goto err_out; - newname = name; - } - - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - goto err_out; - - if (ntfs_attr_lookup(type, name, name_len, 0, 0, NULL, 0, ctx)) - goto put_err_out; - - a = ctx->attr; - - if (!name) { - if (a->name_length) { - name = ntfs_ucsndup((ntfschar*)((u8*)a + le16_to_cpu( - a->name_offset)), a->name_length); - if (!name) - goto put_err_out; - newname = name; - name_len = a->name_length; - } else { - name = AT_UNNAMED; - name_len = 0; - } - } - - __ntfs_attr_init(na, ni, type, name, name_len); - - /* - * Wipe the flags in case they are not zero for an attribute list - * attribute. Windows does not complain about invalid flags and chkdsk - * does not detect or fix them so we need to cope with it, too. - */ - if (type == AT_ATTRIBUTE_LIST) - a->flags = 0; - - if ((type == AT_DATA) && !a->initialized_size) { - /* - * Define/redefine the compression state if stream is - * empty, based on the compression mark on parent - * directory (for unnamed data streams) or on current - * inode (for named data streams). The compression mark - * may change any time, the compression state can only - * change when stream is wiped out. - */ - a->flags &= ~ATTR_COMPRESSION_MASK; - if (na->ni->flags & FILE_ATTR_COMPRESSED) - a->flags |= ATTR_IS_COMPRESSED; - } - - cs = a->flags & (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE); - - if (na->type == AT_DATA && na->name == AT_UNNAMED && - ((!(a->flags & ATTR_IS_SPARSE) != !NAttrSparse(na)) || - (!(a->flags & ATTR_IS_ENCRYPTED) != !NAttrEncrypted(na)))) { - errno = EIO; - ntfs_log_perror("Inode %lld has corrupt attribute flags " - "(0x%x <> 0x%x)",(unsigned long long)ni->mft_no, - a->flags, na->ni->flags); - goto put_err_out; - } - - if (a->non_resident) { - if ((a->flags & ATTR_COMPRESSION_MASK) - && !a->compression_unit) { - errno = EIO; - ntfs_log_perror("Compressed inode %lld attr 0x%x has " - "no compression unit", - (unsigned long long)ni->mft_no, type); - goto put_err_out; - } - ntfs_attr_init(na, TRUE, a->flags, - a->flags & ATTR_IS_ENCRYPTED, - a->flags & ATTR_IS_SPARSE, - sle64_to_cpu(a->allocated_size), - sle64_to_cpu(a->data_size), - sle64_to_cpu(a->initialized_size), - cs ? sle64_to_cpu(a->compressed_size) : 0, - cs ? a->compression_unit : 0); - } else { - s64 l = le32_to_cpu(a->value_length); - ntfs_attr_init(na, FALSE, a->flags, - a->flags & ATTR_IS_ENCRYPTED, - a->flags & ATTR_IS_SPARSE, (l + 7) & ~7, l, l, - cs ? (l + 7) & ~7 : 0, 0); - } - ntfs_attr_put_search_ctx(ctx); -out: - ntfs_log_leave("\n"); - return na; - -put_err_out: - ntfs_attr_put_search_ctx(ctx); -err_out: - free(newname); - free(na); - na = NULL; - goto out; -} - -/** - * ntfs_attr_close - free an ntfs attribute structure - * @na: ntfs attribute structure to free - * - * Release all memory associated with the ntfs attribute @na and then release - * @na itself. - */ -void ntfs_attr_close(ntfs_attr *na) -{ - if (!na) - return; - if (NAttrNonResident(na) && na->rl) - free(na->rl); - /* Don't release if using an internal constant. */ - if (na->name != AT_UNNAMED && na->name != NTFS_INDEX_I30 - && na->name != STREAM_SDS) - free(na->name); - free(na); -} - -/** - * ntfs_attr_map_runlist - map (a part of) a runlist of an ntfs attribute - * @na: ntfs attribute for which to map (part of) a runlist - * @vcn: map runlist part containing this vcn - * - * Map the part of a runlist containing the @vcn of the ntfs attribute @na. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attr_map_runlist(ntfs_attr *na, VCN vcn) -{ - LCN lcn; - ntfs_attr_search_ctx *ctx; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, vcn 0x%llx.\n", - (unsigned long long)na->ni->mft_no, na->type, (long long)vcn); - - lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn); - if (lcn >= 0 || lcn == LCN_HOLE || lcn == LCN_ENOENT) - return 0; - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - - /* Find the attribute in the mft record. */ - if (!ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, - vcn, NULL, 0, ctx)) { - runlist_element *rl; - - /* Decode the runlist. */ - rl = ntfs_mapping_pairs_decompress(na->ni->vol, ctx->attr, - na->rl); - if (rl) { - na->rl = rl; - ntfs_attr_put_search_ctx(ctx); - return 0; - } - } - - ntfs_attr_put_search_ctx(ctx); - return -1; -} - -/** - * ntfs_attr_map_whole_runlist - map the whole runlist of an ntfs attribute - * @na: ntfs attribute for which to map the runlist - * - * Map the whole runlist of the ntfs attribute @na. For an attribute made up - * of only one attribute extent this is the same as calling - * ntfs_attr_map_runlist(na, 0) but for an attribute with multiple extents this - * will map the runlist fragments from each of the extents thus giving access - * to the entirety of the disk allocation of an attribute. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attr_map_whole_runlist(ntfs_attr *na) -{ - VCN next_vcn, last_vcn, highest_vcn; - ntfs_attr_search_ctx *ctx; - ntfs_volume *vol = na->ni->vol; - ATTR_RECORD *a; - int ret = -1; - - ntfs_log_enter("Entering for inode %llu, attr 0x%x.\n", - (unsigned long long)na->ni->mft_no, na->type); - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - goto out; - - /* Map all attribute extents one by one. */ - next_vcn = last_vcn = highest_vcn = 0; - a = NULL; - while (1) { - runlist_element *rl; - - int not_mapped = 0; - if (ntfs_rl_vcn_to_lcn(na->rl, next_vcn) == LCN_RL_NOT_MAPPED) - not_mapped = 1; - - if (ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, next_vcn, NULL, 0, ctx)) - break; - - a = ctx->attr; - - if (not_mapped) { - /* Decode the runlist. */ - rl = ntfs_mapping_pairs_decompress(na->ni->vol, - a, na->rl); - if (!rl) - goto err_out; - na->rl = rl; - } - - /* Are we in the first extent? */ - if (!next_vcn) { - if (a->lowest_vcn) { - errno = EIO; - ntfs_log_perror("First extent of inode %llu " - "attribute has non-zero lowest_vcn", - (unsigned long long)na->ni->mft_no); - goto err_out; - } - /* Get the last vcn in the attribute. */ - last_vcn = sle64_to_cpu(a->allocated_size) >> - vol->cluster_size_bits; - } - - /* Get the lowest vcn for the next extent. */ - highest_vcn = sle64_to_cpu(a->highest_vcn); - next_vcn = highest_vcn + 1; - - /* Only one extent or error, which we catch below. */ - if (next_vcn <= 0) { - errno = ENOENT; - break; - } - - /* Avoid endless loops due to corruption. */ - if (next_vcn < sle64_to_cpu(a->lowest_vcn)) { - errno = EIO; - ntfs_log_perror("Inode %llu has corrupt attribute list", - (unsigned long long)na->ni->mft_no); - goto err_out; - } - } - if (!a) { - ntfs_log_perror("Couldn't find attribute for runlist mapping"); - goto err_out; - } - if (highest_vcn && highest_vcn != last_vcn - 1) { - errno = EIO; - ntfs_log_perror("Failed to load full runlist: inode: %llu " - "highest_vcn: 0x%llx last_vcn: 0x%llx", - (unsigned long long)na->ni->mft_no, - (long long)highest_vcn, (long long)last_vcn); - goto err_out; - } - if (errno == ENOENT) - ret = 0; -err_out: - ntfs_attr_put_search_ctx(ctx); -out: - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_attr_vcn_to_lcn - convert a vcn into a lcn given an ntfs attribute - * @na: ntfs attribute whose runlist to use for conversion - * @vcn: vcn to convert - * - * Convert the virtual cluster number @vcn of an attribute into a logical - * cluster number (lcn) of a device using the runlist @na->rl to map vcns to - * their corresponding lcns. - * - * If the @vcn is not mapped yet, attempt to map the attribute extent - * containing the @vcn and retry the vcn to lcn conversion. - * - * Since lcns must be >= 0, we use negative return values with special meaning: - * - * Return value Meaning / Description - * ========================================== - * -1 = LCN_HOLE Hole / not allocated on disk. - * -3 = LCN_ENOENT There is no such vcn in the attribute. - * -4 = LCN_EINVAL Input parameter error. - * -5 = LCN_EIO Corrupt fs, disk i/o error, or not enough memory. - */ -LCN ntfs_attr_vcn_to_lcn(ntfs_attr *na, const VCN vcn) -{ - LCN lcn; - BOOL is_retry = FALSE; - - if (!na || !NAttrNonResident(na) || vcn < 0) - return (LCN)LCN_EINVAL; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long - long)na->ni->mft_no, na->type); -retry: - /* Convert vcn to lcn. If that fails map the runlist and retry once. */ - lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn); - if (lcn >= 0) - return lcn; - if (!is_retry && !ntfs_attr_map_runlist(na, vcn)) { - is_retry = TRUE; - goto retry; - } - /* - * If the attempt to map the runlist failed, or we are getting - * LCN_RL_NOT_MAPPED despite having mapped the attribute extent - * successfully, something is really badly wrong... - */ - if (!is_retry || lcn == (LCN)LCN_RL_NOT_MAPPED) - return (LCN)LCN_EIO; - /* lcn contains the appropriate error code. */ - return lcn; -} - -/** - * ntfs_attr_find_vcn - find a vcn in the runlist of an ntfs attribute - * @na: ntfs attribute whose runlist to search - * @vcn: vcn to find - * - * Find the virtual cluster number @vcn in the runlist of the ntfs attribute - * @na and return the the address of the runlist element containing the @vcn. - * - * Note you need to distinguish between the lcn of the returned runlist - * element being >= 0 and LCN_HOLE. In the later case you have to return zeroes - * on read and allocate clusters on write. You need to update the runlist, the - * attribute itself as well as write the modified mft record to disk. - * - * If there is an error return NULL with errno set to the error code. The - * following error codes are defined: - * EINVAL Input parameter error. - * ENOENT There is no such vcn in the runlist. - * ENOMEM Not enough memory. - * EIO I/O error or corrupt metadata. - */ -runlist_element *ntfs_attr_find_vcn(ntfs_attr *na, const VCN vcn) -{ - runlist_element *rl; - BOOL is_retry = FALSE; - - if (!na || !NAttrNonResident(na) || vcn < 0) { - errno = EINVAL; - return NULL; - } - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, vcn %llx\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)vcn); -retry: - rl = na->rl; - if (!rl) - goto map_rl; - if (vcn < rl[0].vcn) - goto map_rl; - while (rl->length) { - if (vcn < rl[1].vcn) { - if (rl->lcn >= (LCN)LCN_HOLE) - return rl; - break; - } - rl++; - } - switch (rl->lcn) { - case (LCN)LCN_RL_NOT_MAPPED: - goto map_rl; - case (LCN)LCN_ENOENT: - errno = ENOENT; - break; - case (LCN)LCN_EINVAL: - errno = EINVAL; - break; - default: - errno = EIO; - break; - } - return NULL; -map_rl: - /* The @vcn is in an unmapped region, map the runlist and retry. */ - if (!is_retry && !ntfs_attr_map_runlist(na, vcn)) { - is_retry = TRUE; - goto retry; - } - /* - * If we already retried or the mapping attempt failed something has - * gone badly wrong. EINVAL and ENOENT coming from a failed mapping - * attempt are equivalent to errors for us as they should not happen - * in our code paths. - */ - if (is_retry || errno == EINVAL || errno == ENOENT) - errno = EIO; - return NULL; -} - - -#endif - -/** - * ntfs_attr_pread_i - see description at ntfs_attr_pread() - */ -static s64 ntfs_attr_getfragments_i(ntfs_attr *na, const s64 pos, s64 count, u64 offset, - _ntfs_frag_append_t append_fragment, void *callback_data) -{ - u64 b = offset; - s64 br, to_read, ofs, total, total2, max_read, max_init; - ntfs_volume *vol; - runlist_element *rl; - //u16 efs_padding_length; - - /* Sanity checking arguments is done in ntfs_attr_pread(). */ - - if ((na->data_flags & ATTR_COMPRESSION_MASK) && NAttrNonResident(na)) - { - //return -1; // no compressed files - return -31; - /* - if ((na->data_flags & ATTR_COMPRESSION_MASK) - == ATTR_IS_COMPRESSED) - return ntfs_compressed_attr_pread(na, pos, count, b); - else { - // compression mode not supported - errno = EOPNOTSUPP; - return -1; - } - */ - } - /* - * Encrypted non-resident attributes are not supported. We return - * access denied, which is what Windows NT4 does, too. - * However, allow if mounted with efs_raw option - */ - vol = na->ni->vol; - if (!vol->efs_raw && NAttrEncrypted(na) && NAttrNonResident(na)) { - errno = EACCES; - //return -1; - return -32; - } - - if (!count) - return 0; - /* - * Truncate reads beyond end of attribute, - * but round to next 512 byte boundary for encrypted - * attributes with efs_raw mount option - */ - max_read = na->data_size; - max_init = na->initialized_size; - if (na->ni->vol->efs_raw - && (na->data_flags & ATTR_IS_ENCRYPTED) - && NAttrNonResident(na)) { - if (na->data_size != na->initialized_size) { - ntfs_log_error("uninitialized encrypted file not supported\n"); - errno = EINVAL; - //return -1; - return -33; - } - max_init = max_read = ((na->data_size + 511) & ~511) + 2; - } - if (pos + count > max_read) { - if (pos >= max_read) - return 0; - count = max_read - pos; - } - /* If it is a resident attribute, get the value from the mft record. */ - if (!NAttrNonResident(na)) - { - return -34; // No resident files - /* - ntfs_attr_search_ctx *ctx; - char *val; - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, - 0, NULL, 0, ctx)) { -res_err_out: - ntfs_attr_put_search_ctx(ctx); - return -1; - } - val = (char*)ctx->attr + le16_to_cpu(ctx->attr->value_offset); - if (val < (char*)ctx->attr || val + - le32_to_cpu(ctx->attr->value_length) > - (char*)ctx->mrec + vol->mft_record_size) { - errno = EIO; - ntfs_log_perror("%s: Sanity check failed", __FUNCTION__); - goto res_err_out; - } - memcpy(b, val + pos, count); - ntfs_attr_put_search_ctx(ctx); - return count; - */ - } - total = total2 = 0; - /* Zero out reads beyond initialized size. */ - if (pos + count > max_init) { - if (pos >= max_init) { - //memset(b, 0, count); - return count; - } - total2 = pos + count - max_init; - count -= total2; - //memset((u8*)b + count, 0, total2); - } - /* - * for encrypted non-resident attributes with efs_raw set - * the last two bytes aren't read from disk but contain - * the number of padding bytes so original size can be - * restored - */ - if (na->ni->vol->efs_raw && - (na->data_flags & ATTR_IS_ENCRYPTED) && - ((pos + count) > max_init-2)) - { - return -35; //No encrypted files - /* - efs_padding_length = 511 - ((na->data_size - 1) & 511); - if (pos+count == max_init) { - if (count == 1) { - *((u8*)b+count-1) = (u8)(efs_padding_length >> 8); - count--; - total2++; - } else { - *(u16*)((u8*)b+count-2) = cpu_to_le16(efs_padding_length); - count -= 2; - total2 +=2; - } - } else { - *((u8*)b+count-1) = (u8)(efs_padding_length & 0xff); - count--; - total2++; - } - */ - } - - /* Find the runlist element containing the vcn. */ - rl = ntfs_attr_find_vcn(na, pos >> vol->cluster_size_bits); - if (!rl) { - /* - * If the vcn is not present it is an out of bounds read. - * However, we already truncated the read to the data_size, - * so getting this here is an error. - */ - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN #1", __FUNCTION__); - } - //return -1; - return -36; - } - /* - * Gather the requested data into the linear destination buffer. Note, - * a partial final vcn is taken care of by the @count capping of read - * length. - */ - ofs = pos - (rl->vcn << vol->cluster_size_bits); - for (; count; rl++, ofs = 0) { - if (rl->lcn == LCN_RL_NOT_MAPPED) { - rl = ntfs_attr_find_vcn(na, rl->vcn); - if (!rl) { - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN #2", - __FUNCTION__); - } - goto rl_err_out; - } - /* Needed for case when runs merged. */ - ofs = pos + total - (rl->vcn << vol->cluster_size_bits); - } - if (!rl->length) { - errno = EIO; - ntfs_log_perror("%s: Zero run length", __FUNCTION__); - goto rl_err_out; - } - if (rl->lcn < (LCN)0) { - if (rl->lcn != (LCN)LCN_HOLE) { - ntfs_log_perror("%s: Bad run (%lld)", - __FUNCTION__, - (long long)rl->lcn); - goto rl_err_out; - } - /* It is a hole, just zero the matching @b range. */ - to_read = min(count, (rl->length << - vol->cluster_size_bits) - ofs); - //memset(b, 0, to_read); - /* Update progress counters. */ - total += to_read; - count -= to_read; - b = b + to_read; - continue; - } - /* It is a real lcn, read it into @dst. */ - to_read = min(count, (rl->length << vol->cluster_size_bits) - - ofs); -retry: - ntfs_log_trace("Reading %lld bytes from vcn %lld, lcn %lld, ofs" - " %lld.\n", (long long)to_read, (long long)rl->vcn, - (long long )rl->lcn, (long long)ofs); - /* - br = ntfs_pread(vol->dev, (rl->lcn << vol->cluster_size_bits) + - ofs, to_read, b); - */ - br = to_read; - // convert to sectors unit - u32 off_sec = b >> 9; - u32 sector = ((rl->lcn << vol->cluster_size_bits) + ofs) >> 9; - u32 count_sec = to_read >> 9; - int ret; - ret = append_fragment(callback_data, off_sec, sector, count_sec); - if (ret) { - if (ret < 0) return ret; - return -50; - } - /* If everything ok, update progress counters and continue. */ - if (br > 0) { - total += br; - count -= br; - b = b + br; - } - if (br == to_read) - continue; - /* If the syscall was interrupted, try again. */ - if (br == (s64)-1 && errno == EINTR) - goto retry; - if (total) - return total; - if (!br) - errno = EIO; - ntfs_log_perror("%s: ntfs_pread failed", __FUNCTION__); - //return -1; - return -38; - } - /* Finally, return the number of bytes read. */ - return total + total2; -rl_err_out: - if (total) - return total; - errno = EIO; - //return -1; - return -39; -} - - -/** - * ntfs_attr_pread - read from an attribute specified by an ntfs_attr structure - * @na: ntfs attribute to read from - * @pos: byte position in the attribute to begin reading from - * @count: number of bytes to read - * @b: output data buffer - * - * This function will read @count bytes starting at offset @pos from the ntfs - * attribute @na into the data buffer @b. - * - * On success, return the number of successfully read bytes. If this number is - * lower than @count this means that the read reached end of file or that an - * error was encountered during the read so that the read is partial. 0 means - * end of file or nothing was read (also return 0 when @count is 0). - * - * On error and nothing has been read, return -1 with errno set appropriately - * to the return code of ntfs_pread(), or to EINVAL in case of invalid - * arguments. - */ -s64 ntfs_attr_getfragments(ntfs_attr *na, const s64 pos, s64 count, u64 offset, - _ntfs_frag_append_t append_fragment, void *callback_data) -{ - s64 ret; - - if (!na || !na->ni || !na->ni->vol || !callback_data || pos < 0 || count < 0) { - errno = EINVAL; - ntfs_log_perror("%s: na=%p b=%p pos=%lld count=%lld", - __FUNCTION__, na, callback_data, (long long)pos, - (long long)count); - //return -1; - return -21; - } - - /* - ntfs_log_enter("Entering for inode %lld attr 0x%x pos %lld count " - "%lld\n", (unsigned long long)na->ni->mft_no, - na->type, (long long)pos, (long long)count); - */ - - ret = ntfs_attr_getfragments_i(na, pos, count, offset, - append_fragment, callback_data); - - //ntfs_log_leave("\n"); - return ret; -} - -#if 0 - -static int ntfs_attr_fill_zero(ntfs_attr *na, s64 pos, s64 count) -{ - char *buf; - s64 written, size, end = pos + count; - s64 ofsi; - const runlist_element *rli; - ntfs_volume *vol; - int ret = -1; - - ntfs_log_trace("pos %lld, count %lld\n", (long long)pos, - (long long)count); - - if (!na || pos < 0 || count < 0) { - errno = EINVAL; - goto err_out; - } - - buf = ntfs_calloc(NTFS_BUF_SIZE); - if (!buf) - goto err_out; - - rli = na->rl; - ofsi = 0; - vol = na->ni->vol; - while (pos < end) { - while (rli->length && (ofsi + (rli->length << - vol->cluster_size_bits) <= pos)) { - ofsi += (rli->length << vol->cluster_size_bits); - rli++; - } - size = min(end - pos, NTFS_BUF_SIZE); - written = ntfs_rl_pwrite(vol, rli, ofsi, pos, size, buf); - if (written <= 0) { - ntfs_log_perror("Failed to zero space"); - goto err_free; - } - pos += written; - } - - ret = 0; -err_free: - free(buf); -err_out: - return ret; -} - -static int ntfs_attr_fill_hole(ntfs_attr *na, s64 count, s64 *ofs, - runlist_element **rl, VCN *update_from) -{ - s64 to_write; - s64 need; - ntfs_volume *vol = na->ni->vol; - int eo, ret = -1; - runlist *rlc; - LCN lcn_seek_from = -1; - VCN cur_vcn, from_vcn; - - to_write = min(count, ((*rl)->length << vol->cluster_size_bits) - *ofs); - - cur_vcn = (*rl)->vcn; - from_vcn = (*rl)->vcn + (*ofs >> vol->cluster_size_bits); - - ntfs_log_trace("count: %lld, cur_vcn: %lld, from: %lld, to: %lld, ofs: " - "%lld\n", (long long)count, (long long)cur_vcn, - (long long)from_vcn, (long long)to_write, (long long)*ofs); - - /* Map whole runlist to be able update mapping pairs later. */ - if (ntfs_attr_map_whole_runlist(na)) - goto err_out; - - /* Restore @*rl, it probably get lost during runlist mapping. */ - *rl = ntfs_attr_find_vcn(na, cur_vcn); - if (!*rl) { - ntfs_log_error("Failed to find run after mapping runlist. " - "Please report to %s.\n", NTFS_DEV_LIST); - errno = EIO; - goto err_out; - } - - /* Search backwards to find the best lcn to start seek from. */ - rlc = *rl; - while (rlc->vcn) { - rlc--; - if (rlc->lcn >= 0) { - /* - * avoid fragmenting a compressed file - * Windows does not do that, and that may - * not be desirable for files which can - * be updated - */ - if (na->data_flags & ATTR_COMPRESSION_MASK) - lcn_seek_from = rlc->lcn + rlc->length; - else - lcn_seek_from = rlc->lcn + (from_vcn - rlc->vcn); - break; - } - } - if (lcn_seek_from == -1) { - /* Backwards search failed, search forwards. */ - rlc = *rl; - while (rlc->length) { - rlc++; - if (rlc->lcn >= 0) { - lcn_seek_from = rlc->lcn - (rlc->vcn - from_vcn); - if (lcn_seek_from < -1) - lcn_seek_from = -1; - break; - } - } - } - - need = ((*ofs + to_write - 1) >> vol->cluster_size_bits) - + 1 + (*rl)->vcn - from_vcn; - if ((na->data_flags & ATTR_COMPRESSION_MASK) - && (need < na->compression_block_clusters)) { - /* - * for a compressed file, be sure to allocate the full hole. - * We may need space to decompress existing compressed data. - */ - rlc = ntfs_cluster_alloc(vol, (*rl)->vcn, (*rl)->length, - lcn_seek_from, DATA_ZONE); - } else - rlc = ntfs_cluster_alloc(vol, from_vcn, need, - lcn_seek_from, DATA_ZONE); - if (!rlc) - goto err_out; - - *rl = ntfs_runlists_merge(na->rl, rlc); - /* - * For a compressed attribute, we must be sure there is an - * available entry, so reserve it before it gets too late. - */ - if (*rl && (na->data_flags & ATTR_COMPRESSION_MASK)) - *rl = ntfs_rl_extend(*rl,1); - if (!*rl) { - eo = errno; - ntfs_log_perror("Failed to merge runlists"); - if (ntfs_cluster_free_from_rl(vol, rlc)) { - ntfs_log_perror("Failed to free hot clusters. " - "Please run chkdsk /f"); - } - errno = eo; - goto err_out; - } - na->rl = *rl; - if (*update_from == -1) - *update_from = from_vcn; - *rl = ntfs_attr_find_vcn(na, cur_vcn); - if (!*rl) { - /* - * It's definitely a BUG, if we failed to find @cur_vcn, because - * we missed it during instantiating of the hole. - */ - ntfs_log_error("Failed to find run after hole instantiation. " - "Please report to %s.\n", NTFS_DEV_LIST); - errno = EIO; - goto err_out; - } - /* If leaved part of the hole go to the next run. */ - if ((*rl)->lcn < 0) - (*rl)++; - /* Now LCN shoudn't be less than 0. */ - if ((*rl)->lcn < 0) { - ntfs_log_error("BUG! LCN is lesser than 0. " - "Please report to the %s.\n", NTFS_DEV_LIST); - errno = EIO; - goto err_out; - } - if (*ofs) { - /* Clear non-sparse region from @cur_vcn to @*ofs. */ - if (ntfs_attr_fill_zero(na, cur_vcn << vol->cluster_size_bits, - *ofs)) - goto err_out; - } - if ((*rl)->vcn < cur_vcn) { - /* - * Clusters that replaced hole are merged with - * previous run, so we need to update offset. - */ - *ofs += (cur_vcn - (*rl)->vcn) << vol->cluster_size_bits; - } - if ((*rl)->vcn > cur_vcn) { - /* - * We left part of the hole, so we need to update offset - */ - *ofs -= ((*rl)->vcn - cur_vcn) << vol->cluster_size_bits; - } - - ret = 0; -err_out: - return ret; -} - -static int stuff_hole(ntfs_attr *na, const s64 pos); - -/** - * ntfs_attr_pwrite - positioned write to an ntfs attribute - * @na: ntfs attribute to write to - * @pos: position in the attribute to write to - * @count: number of bytes to write - * @b: data buffer to write to disk - * - * This function will write @count bytes from data buffer @b to ntfs attribute - * @na at position @pos. - * - * On success, return the number of successfully written bytes. If this number - * is lower than @count this means that an error was encountered during the - * write so that the write is partial. 0 means nothing was written (also return - * 0 when @count is 0). - * - * On error and nothing has been written, return -1 with errno set - * appropriately to the return code of ntfs_pwrite(), or to EINVAL in case of - * invalid arguments. - */ -s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, const void *b) -{ - s64 written, to_write, ofs, old_initialized_size, old_data_size; - s64 total = 0; - VCN update_from = -1; - ntfs_volume *vol; - s64 fullcount; - ntfs_attr_search_ctx *ctx = NULL; - runlist_element *rl; - s64 hole_end; - int eo; - int compressed_part; - struct { - unsigned int undo_initialized_size : 1; - unsigned int undo_data_size : 1; - } need_to = { 0, 0 }; - BOOL makingnonresident = FALSE; - BOOL wasnonresident = FALSE; - BOOL compressed; - - ntfs_log_enter("Entering for inode %lld, attr 0x%x, pos 0x%llx, count " - "0x%llx.\n", (long long)na->ni->mft_no, na->type, - (long long)pos, (long long)count); - - if (!na || !na->ni || !na->ni->vol || !b || pos < 0 || count < 0) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - goto errno_set; - } - vol = na->ni->vol; - compressed = (na->data_flags & ATTR_COMPRESSION_MASK) - != const_cpu_to_le16(0); - /* - * Encrypted attributes are only supported in raw mode. We return - * access denied, which is what Windows NT4 does, too. - * Moreover a file cannot be both encrypted and compressed. - */ - if ((na->data_flags & ATTR_IS_ENCRYPTED) - && (compressed || !vol->efs_raw)) { - errno = EACCES; - goto errno_set; - } - /* - * Fill the gap, when writing beyond the end of a compressed - * file. This will make recursive calls - */ - if (compressed - && (na->type == AT_DATA) - && (pos > na->initialized_size) - && stuff_hole(na,pos)) - goto errno_set; - /* If this is a compressed attribute it needs special treatment. */ - wasnonresident = NAttrNonResident(na) != 0; - makingnonresident = wasnonresident /* yes : already changed */ - && !pos && (count == na->initialized_size); - /* - * Writing to compressed files is currently restricted - * to appending data. However we have to accept - * recursive write calls to make the attribute non resident. - * These are writing at position 0 up to initialized_size. - * Compression is also restricted to data streams. - * Only ATTR_IS_COMPRESSED compression mode is supported. - */ - if (compressed - && ((na->type != AT_DATA) - || ((na->data_flags & ATTR_COMPRESSION_MASK) - != ATTR_IS_COMPRESSED) - || ((pos != na->initialized_size) - && (pos || (count != na->initialized_size))))) { - // TODO: Implement writing compressed attributes! (AIA) - errno = EOPNOTSUPP; - goto errno_set; - } - - if (!count) - goto out; - /* for a compressed file, get prepared to reserve a full block */ - fullcount = count; - /* If the write reaches beyond the end, extend the attribute. */ - old_data_size = na->data_size; - if (pos + count > na->data_size) { - if (ntfs_attr_truncate(na, pos + count)) { - ntfs_log_perror("Failed to enlarge attribute"); - goto errno_set; - } - /* resizing may change the compression mode */ - compressed = (na->data_flags & ATTR_COMPRESSION_MASK) - != const_cpu_to_le16(0); - need_to.undo_data_size = 1; - } - /* - * For compressed data, a single full block was allocated - * to deal with compression, possibly in a previous call. - * We are not able to process several blocks because - * some clusters are freed after compression and - * new allocations have to be done before proceeding, - * so truncate the requested count if needed (big buffers). - */ - if (compressed) { - fullcount = na->data_size - pos; - if (count > fullcount) - count = fullcount; - } - old_initialized_size = na->initialized_size; - /* If it is a resident attribute, write the data to the mft record. */ - if (!NAttrNonResident(na)) { - char *val; - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - goto err_out; - if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, - 0, NULL, 0, ctx)) { - ntfs_log_perror("%s: lookup failed", __FUNCTION__); - goto err_out; - } - val = (char*)ctx->attr + le16_to_cpu(ctx->attr->value_offset); - if (val < (char*)ctx->attr || val + - le32_to_cpu(ctx->attr->value_length) > - (char*)ctx->mrec + vol->mft_record_size) { - errno = EIO; - ntfs_log_perror("%s: Sanity check failed", __FUNCTION__); - goto err_out; - } - memcpy(val + pos, b, count); - if (ntfs_mft_record_write(vol, ctx->ntfs_ino->mft_no, - ctx->mrec)) { - /* - * NOTE: We are in a bad state at this moment. We have - * dirtied the mft record but we failed to commit it to - * disk. Since we have read the mft record ok before, - * it is unlikely to fail writing it, so is ok to just - * return error here... (AIA) - */ - ntfs_log_perror("%s: failed to write mft record", __FUNCTION__); - goto err_out; - } - ntfs_attr_put_search_ctx(ctx); - total = count; - goto out; - } - - /* Handle writes beyond initialized_size. */ - if (pos + count > na->initialized_size) { - if (ntfs_attr_map_whole_runlist(na)) - goto err_out; - /* - * For a compressed attribute, we must be sure there is an - * available entry, and, when reopening a compressed file, - * we may need to split a hole. So reserve the entries - * before it gets too late. - */ - if (compressed) { - na->rl = ntfs_rl_extend(na->rl,2); - if (!na->rl) - goto err_out; - } - /* Set initialized_size to @pos + @count. */ - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - goto err_out; - if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, - 0, NULL, 0, ctx)) - goto err_out; - - /* If write starts beyond initialized_size, zero the gap. */ - if (pos > na->initialized_size) - if (ntfs_attr_fill_zero(na, na->initialized_size, - pos - na->initialized_size)) - goto err_out; - - ctx->attr->initialized_size = cpu_to_sle64(pos + count); - /* fix data_size for compressed files */ - if (compressed) - ctx->attr->data_size = ctx->attr->initialized_size; - if (ntfs_mft_record_write(vol, ctx->ntfs_ino->mft_no, - ctx->mrec)) { - /* - * Undo the change in the in-memory copy and send it - * back for writing. - */ - ctx->attr->initialized_size = - cpu_to_sle64(old_initialized_size); - ntfs_mft_record_write(vol, ctx->ntfs_ino->mft_no, - ctx->mrec); - goto err_out; - } - na->initialized_size = pos + count; - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - /* - * NOTE: At this point the initialized_size in the mft record - * has been updated BUT there is random data on disk thus if - * we decide to abort, we MUST change the initialized_size - * again. - */ - need_to.undo_initialized_size = 1; - } - /* Find the runlist element containing the vcn. */ - rl = ntfs_attr_find_vcn(na, pos >> vol->cluster_size_bits); - if (!rl) { - /* - * If the vcn is not present it is an out of bounds write. - * However, we already extended the size of the attribute, - * so getting this here must be an error of some kind. - */ - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN #3", __FUNCTION__); - } - goto err_out; - } - ofs = pos - (rl->vcn << vol->cluster_size_bits); - /* - * Determine if there is compressed data in the current - * compression block (when appending to an existing file). - * If so, decompression will be needed, and the full block - * must be allocated to be identified as uncompressed. - * This comes in two variants, depending on whether - * compression has saved at least one cluster. - * The compressed size can never be over full size by - * more than 485 (maximum for 15 compression blocks - * compressed to 4098 and the last 3640 bytes compressed - * to 3640 + 3640/8 = 4095, with 15*2 + 4095 - 3640 = 485) - * This is less than the smallest cluster, so the hole is - * is never beyond the cluster next to the position of - * the first uncompressed byte to write. - */ - compressed_part = 0; - if (compressed) { - if ((rl->lcn == (LCN)LCN_HOLE) - && wasnonresident) { - if (rl->length < na->compression_block_clusters) - compressed_part - = na->compression_block_clusters - - rl->length; - else { - compressed_part - = na->compression_block_clusters; - if (rl->length > na->compression_block_clusters) { - rl[2].lcn = rl[1].lcn; - rl[2].vcn = rl[1].vcn; - rl[2].length = rl[1].length; - rl[1].vcn -= compressed_part; - rl[1].lcn = LCN_HOLE; - rl[1].length = compressed_part; - rl[0].length -= compressed_part; - ofs -= rl->length << vol->cluster_size_bits; - rl++; - } - } - /* normal hole filling will do later */ - } else - if ((rl->lcn >= 0) && (rl[1].lcn == (LCN)LCN_HOLE)) { - s64 xofs; - - if (wasnonresident) - compressed_part = na->compression_block_clusters - - rl[1].length; - rl++; - xofs = 0; - if (ntfs_attr_fill_hole(na, - rl->length << vol->cluster_size_bits, - &xofs, &rl, &update_from)) - goto err_out; - /* the fist allocated cluster was not merged */ - if (!xofs) - rl--; - } - } - /* - * Scatter the data from the linear data buffer to the volume. Note, a - * partial final vcn is taken care of by the @count capping of write - * length. - */ - for (hole_end = 0; count; rl++, ofs = 0, hole_end = 0) { - if (rl->lcn == LCN_RL_NOT_MAPPED) { - rl = ntfs_attr_find_vcn(na, rl->vcn); - if (!rl) { - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN" - " #4", __FUNCTION__); - } - goto rl_err_out; - } - /* Needed for case when runs merged. */ - ofs = pos + total - (rl->vcn << vol->cluster_size_bits); - } - if (!rl->length) { - errno = EIO; - ntfs_log_perror("%s: Zero run length", __FUNCTION__); - goto rl_err_out; - } - if (rl->lcn < (LCN)0) { - hole_end = rl->vcn + rl->length; - - if (rl->lcn != (LCN)LCN_HOLE) { - errno = EIO; - ntfs_log_perror("%s: Unexpected LCN (%lld)", - __FUNCTION__, - (long long)rl->lcn); - goto rl_err_out; - } - if (ntfs_attr_fill_hole(na, fullcount, &ofs, &rl, - &update_from)) - goto err_out; - } - if (compressed) { - while (rl->length - && (ofs >= (rl->length << vol->cluster_size_bits))) { - ofs -= rl->length << vol->cluster_size_bits; - rl++; - } - } - - /* It is a real lcn, write it to the volume. */ - to_write = min(count, (rl->length << vol->cluster_size_bits) - ofs); -retry: - ntfs_log_trace("Writing %lld bytes to vcn %lld, lcn %lld, ofs " - "%lld.\n", (long long)to_write, (long long)rl->vcn, - (long long)rl->lcn, (long long)ofs); - if (!NVolReadOnly(vol)) { - - s64 wpos = (rl->lcn << vol->cluster_size_bits) + ofs; - s64 wend = (rl->vcn << vol->cluster_size_bits) + ofs + to_write; - u32 bsize = vol->cluster_size; - /* Byte size needed to zero fill a cluster */ - s64 rounding = ((wend + bsize - 1) & ~(s64)(bsize - 1)) - wend; - /** - * Zero fill to cluster boundary if we're writing at the - * end of the attribute or into an ex-sparse cluster. - * This will cause the kernel not to seek and read disk - * blocks during write(2) to fill the end of the buffer - * which increases write speed by 2-10 fold typically. - * - * This is done even for compressed files, because - * data is generally first written uncompressed. - */ - if (rounding && ((wend == na->initialized_size) || - (wend < (hole_end << vol->cluster_size_bits)))){ - - char *cb; - - rounding += to_write; - - cb = ntfs_malloc(rounding); - if (!cb) - goto err_out; - - memcpy(cb, b, to_write); - memset(cb + to_write, 0, rounding - to_write); - - if (compressed) { - written = ntfs_compressed_pwrite(na, - rl, wpos, ofs, to_write, - rounding, b, compressed_part); - } else { - written = ntfs_pwrite(vol->dev, wpos, - rounding, cb); - if (written == rounding) - written = to_write; - } - - free(cb); - } else { - if (compressed) { - written = ntfs_compressed_pwrite(na, - rl, wpos, ofs, to_write, - to_write, b, compressed_part); - } else - written = ntfs_pwrite(vol->dev, wpos, - to_write, b); - } - } else - written = to_write; - /* If everything ok, update progress counters and continue. */ - if (written > 0) { - total += written; - count -= written; - fullcount -= written; - b = (const u8*)b + written; - } - if (written != to_write) { - /* Partial write cannot be dealt with, stop there */ - /* If the syscall was interrupted, try again. */ - if (written == (s64)-1 && errno == EINTR) - goto retry; - if (!written) - errno = EIO; - goto rl_err_out; - } - compressed_part = 0; - } -done: - if (ctx) - ntfs_attr_put_search_ctx(ctx); - /* Update mapping pairs if needed. */ - if ((update_from != -1) - || (compressed && !makingnonresident)) - if (ntfs_attr_update_mapping_pairs(na, 0 /*update_from*/)) { - /* - * FIXME: trying to recover by goto rl_err_out; - * could cause driver hang by infinite looping. - */ - total = -1; - goto out; - } -out: - ntfs_log_leave("\n"); - return total; -rl_err_out: - eo = errno; - if (total) { - if (need_to.undo_initialized_size) { - if (pos + total > na->initialized_size) - goto done; - /* - * TODO: Need to try to change initialized_size. If it - * succeeds goto done, otherwise goto err_out. (AIA) - */ - goto err_out; - } - goto done; - } - errno = eo; -err_out: - eo = errno; - if (need_to.undo_initialized_size) { - int err; - - err = 0; - if (!ctx) { - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - err = 1; - } else - ntfs_attr_reinit_search_ctx(ctx); - if (!err) { - err = ntfs_attr_lookup(na->type, na->name, - na->name_len, 0, 0, NULL, 0, ctx); - if (!err) { - na->initialized_size = old_initialized_size; - ctx->attr->initialized_size = cpu_to_sle64( - old_initialized_size); - err = ntfs_mft_record_write(vol, - ctx->ntfs_ino->mft_no, - ctx->mrec); - } - } - if (err) { - /* - * FIXME: At this stage could try to recover by filling - * old_initialized_size -> new_initialized_size with - * data or at least zeroes. (AIA) - */ - ntfs_log_error("Eeek! Failed to recover from error. " - "Leaving metadata in inconsistent " - "state! Run chkdsk!\n"); - } - } - if (ctx) - ntfs_attr_put_search_ctx(ctx); - /* Update mapping pairs if needed. */ - if (update_from != -1) - ntfs_attr_update_mapping_pairs(na, 0 /*update_from*/); - /* Restore original data_size if needed. */ - if (need_to.undo_data_size && ntfs_attr_truncate(na, old_data_size)) - ntfs_log_perror("Failed to restore data_size"); - errno = eo; -errno_set: - total = -1; - goto out; -} - -int ntfs_attr_pclose(ntfs_attr *na) -{ - s64 written, ofs; - BOOL ok = TRUE; - VCN update_from = -1; - ntfs_volume *vol; - ntfs_attr_search_ctx *ctx = NULL; - runlist_element *rl; - int eo; - s64 hole; - int compressed_part; - BOOL compressed; - - ntfs_log_enter("Entering for inode 0x%llx, attr 0x%x.\n", - na->ni->mft_no, na->type); - - if (!na || !na->ni || !na->ni->vol) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - goto errno_set; - } - vol = na->ni->vol; - compressed = (na->data_flags & ATTR_COMPRESSION_MASK) - != const_cpu_to_le16(0); - /* - * Encrypted non-resident attributes are not supported. We return - * access denied, which is what Windows NT4 does, too. - */ - if (NAttrEncrypted(na) && NAttrNonResident(na)) { - errno = EACCES; - goto errno_set; - } - /* If this is not a compressed attribute get out */ - /* same if it is resident */ - if (!compressed || !NAttrNonResident(na)) - goto out; - - /* - * For a compressed attribute, we must be sure there is an - * available entry, so reserve it before it gets too late. - */ - if (ntfs_attr_map_whole_runlist(na)) - goto err_out; - na->rl = ntfs_rl_extend(na->rl,1); - if (!na->rl) - goto err_out; - /* Find the runlist element containing the terminal vcn. */ - rl = ntfs_attr_find_vcn(na, (na->initialized_size - 1) >> vol->cluster_size_bits); - if (!rl) { - /* - * If the vcn is not present it is an out of bounds write. - * However, we have already written the last byte uncompressed, - * so getting this here must be an error of some kind. - */ - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN #5", __FUNCTION__); - } - goto err_out; - } - /* - * Scatter the data from the linear data buffer to the volume. Note, a - * partial final vcn is taken care of by the @count capping of write - * length. - */ - compressed_part = 0; - if ((rl->lcn >= 0) && (rl[1].lcn == (LCN)LCN_HOLE)) - compressed_part - = na->compression_block_clusters - rl[1].length; - else - if (rl->lcn == (LCN)LCN_HOLE) { - if (rl->length < na->compression_block_clusters) - compressed_part - = na->compression_block_clusters - - rl->length; - else - compressed_part - = na->compression_block_clusters; - } - /* done, if the last block set was compressed */ - if (compressed_part) - goto out; - - ofs = na->initialized_size - (rl->vcn << vol->cluster_size_bits); - - if (rl->lcn == LCN_RL_NOT_MAPPED) { - rl = ntfs_attr_find_vcn(na, rl->vcn); - if (!rl) { - if (errno == ENOENT) { - errno = EIO; - ntfs_log_perror("%s: Failed to find VCN" - " #6", __FUNCTION__); - } - goto rl_err_out; - } - /* Needed for case when runs merged. */ - ofs = na->initialized_size - (rl->vcn << vol->cluster_size_bits); - } - if (!rl->length) { - errno = EIO; - ntfs_log_perror("%s: Zero run length", __FUNCTION__); - goto rl_err_out; - } - if (rl->lcn < (LCN)0) { - hole = rl->vcn + rl->length; - if (rl->lcn != (LCN)LCN_HOLE) { - errno = EIO; - ntfs_log_perror("%s: Unexpected LCN (%lld)", - __FUNCTION__, - (long long)rl->lcn); - goto rl_err_out; - } - - if (ntfs_attr_fill_hole(na, (s64)0, &ofs, &rl, &update_from)) - goto err_out; - } - while (rl->length - && (ofs >= (rl->length << vol->cluster_size_bits))) { - ofs -= rl->length << vol->cluster_size_bits; - rl++; - } - -retry: - if (!NVolReadOnly(vol)) { - - written = ntfs_compressed_close(na, rl, ofs); - /* If everything ok, update progress counters and continue. */ - if (!written) - goto done; - } - /* If the syscall was interrupted, try again. */ - if (written == (s64)-1 && errno == EINTR) - goto retry; - if (!written) - errno = EIO; - goto rl_err_out; - -done: - if (ctx) - ntfs_attr_put_search_ctx(ctx); - /* Update mapping pairs if needed. */ - if (ntfs_attr_update_mapping_pairs(na, 0 /*update_from*/)) { - /* - * FIXME: trying to recover by goto rl_err_out; - * could cause driver hang by infinite looping. - */ - ok = FALSE; - goto out; - } -out: - ntfs_log_leave("\n"); - return (!ok); -rl_err_out: - /* - * need not restore old sizes, only compressed_size - * can have changed. It has been set according to - * the current runlist while updating the mapping pairs, - * and must be kept consistent with the runlists. - */ -err_out: - eo = errno; - if (ctx) - ntfs_attr_put_search_ctx(ctx); - /* Update mapping pairs if needed. */ - ntfs_attr_update_mapping_pairs(na, 0 /*update_from*/); - errno = eo; -errno_set: - ok = FALSE; - goto out; -} - -/** - * ntfs_attr_mst_pread - multi sector transfer protected ntfs attribute read - * @na: multi sector transfer protected ntfs attribute to read from - * @pos: byte position in the attribute to begin reading from - * @bk_cnt: number of mst protected blocks to read - * @bk_size: size of each mst protected block in bytes - * @dst: output data buffer - * - * This function will read @bk_cnt blocks of size @bk_size bytes each starting - * at offset @pos from the ntfs attribute @na into the data buffer @b. - * - * On success, the multi sector transfer fixups are applied and the number of - * read blocks is returned. If this number is lower than @bk_cnt this means - * that the read has either reached end of attribute or that an error was - * encountered during the read so that the read is partial. 0 means end of - * attribute or nothing to read (also return 0 when @bk_cnt or @bk_size are 0). - * - * On error and nothing has been read, return -1 with errno set appropriately - * to the return code of ntfs_attr_pread() or to EINVAL in case of invalid - * arguments. - * - * NOTE: If an incomplete multi sector transfer is detected the magic is - * changed to BAAD but no error is returned, i.e. it is possible that any of - * the returned blocks have multi sector transfer errors. This should be - * detected by the caller by checking each block with is_baad_recordp(&block). - * The reasoning is that we want to fixup as many blocks as possible and we - * want to return even bad ones to the caller so, e.g. in case of ntfsck, the - * errors can be repaired. - */ -s64 ntfs_attr_mst_pread(ntfs_attr *na, const s64 pos, const s64 bk_cnt, - const u32 bk_size, void *dst) -{ - s64 br; - u8 *end; - - ntfs_log_trace("Entering for inode 0x%llx, attr type 0x%x, pos 0x%llx.\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)pos); - if (bk_cnt < 0 || bk_size % NTFS_BLOCK_SIZE) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return -1; - } - br = ntfs_attr_pread(na, pos, bk_cnt * bk_size, dst); - if (br <= 0) - return br; - br /= bk_size; - for (end = (u8*)dst + br * bk_size; (u8*)dst < end; dst = (u8*)dst + - bk_size) - ntfs_mst_post_read_fixup((NTFS_RECORD*)dst, bk_size); - /* Finally, return the number of blocks read. */ - return br; -} - -/** - * ntfs_attr_mst_pwrite - multi sector transfer protected ntfs attribute write - * @na: multi sector transfer protected ntfs attribute to write to - * @pos: position in the attribute to write to - * @bk_cnt: number of mst protected blocks to write - * @bk_size: size of each mst protected block in bytes - * @src: data buffer to write to disk - * - * This function will write @bk_cnt blocks of size @bk_size bytes each from - * data buffer @b to multi sector transfer (mst) protected ntfs attribute @na - * at position @pos. - * - * On success, return the number of successfully written blocks. If this number - * is lower than @bk_cnt this means that an error was encountered during the - * write so that the write is partial. 0 means nothing was written (also - * return 0 when @bk_cnt or @bk_size are 0). - * - * On error and nothing has been written, return -1 with errno set - * appropriately to the return code of ntfs_attr_pwrite(), or to EINVAL in case - * of invalid arguments. - * - * NOTE: We mst protect the data, write it, then mst deprotect it using a quick - * deprotect algorithm (no checking). This saves us from making a copy before - * the write and at the same time causes the usn to be incremented in the - * buffer. This conceptually fits in better with the idea that cached data is - * always deprotected and protection is performed when the data is actually - * going to hit the disk and the cache is immediately deprotected again - * simulating an mst read on the written data. This way cache coherency is - * achieved. - */ -s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const s64 pos, s64 bk_cnt, - const u32 bk_size, void *src) -{ - s64 written, i; - - ntfs_log_trace("Entering for inode 0x%llx, attr type 0x%x, pos 0x%llx.\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)pos); - if (bk_cnt < 0 || bk_size % NTFS_BLOCK_SIZE) { - errno = EINVAL; - return -1; - } - if (!bk_cnt) - return 0; - /* Prepare data for writing. */ - for (i = 0; i < bk_cnt; ++i) { - int err; - - err = ntfs_mst_pre_write_fixup((NTFS_RECORD*) - ((u8*)src + i * bk_size), bk_size); - if (err < 0) { - /* Abort write at this position. */ - ntfs_log_perror("%s #1", __FUNCTION__); - if (!i) - return err; - bk_cnt = i; - break; - } - } - /* Write the prepared data. */ - written = ntfs_attr_pwrite(na, pos, bk_cnt * bk_size, src); - if (written <= 0) { - ntfs_log_perror("%s: written=%lld", __FUNCTION__, - (long long)written); - } - /* Quickly deprotect the data again. */ - for (i = 0; i < bk_cnt; ++i) - ntfs_mst_post_write_fixup((NTFS_RECORD*)((u8*)src + i * - bk_size)); - if (written <= 0) - return written; - /* Finally, return the number of complete blocks written. */ - return written / bk_size; -} - -/** - * ntfs_attr_find - find (next) attribute in mft record - * @type: attribute type to find - * @name: attribute name to find (optional, i.e. NULL means don't care) - * @name_len: attribute name length (only needed if @name present) - * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present) - * @val: attribute value to find (optional, resident attributes only) - * @val_len: attribute value length - * @ctx: search context with mft record and attribute to search from - * - * You shouldn't need to call this function directly. Use lookup_attr() instead. - * - * ntfs_attr_find() takes a search context @ctx as parameter and searches the - * mft record specified by @ctx->mrec, beginning at @ctx->attr, for an - * attribute of @type, optionally @name and @val. If found, ntfs_attr_find() - * returns 0 and @ctx->attr will point to the found attribute. - * - * If not found, ntfs_attr_find() returns -1, with errno set to ENOENT and - * @ctx->attr will point to the attribute before which the attribute being - * searched for would need to be inserted if such an action were to be desired. - * - * On actual error, ntfs_attr_find() returns -1 with errno set to the error - * code but not to ENOENT. In this case @ctx->attr is undefined and in - * particular do not rely on it not changing. - * - * If @ctx->is_first is TRUE, the search begins with @ctx->attr itself. If it - * is FALSE, the search begins after @ctx->attr. - * - * If @type is AT_UNUSED, return the first found attribute, i.e. one can - * enumerate all attributes by setting @type to AT_UNUSED and then calling - * ntfs_attr_find() repeatedly until it returns -1 with errno set to ENOENT to - * indicate that there are no more entries. During the enumeration, each - * successful call of ntfs_attr_find() will return the next attribute in the - * mft record @ctx->mrec. - * - * If @type is AT_END, seek to the end and return -1 with errno set to ENOENT. - * AT_END is not a valid attribute, its length is zero for example, thus it is - * safer to return error instead of success in this case. This also allows us - * to interoperate cleanly with ntfs_external_attr_find(). - * - * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present - * but not AT_UNNAMED search for a named attribute matching @name. Otherwise, - * match both named and unnamed attributes. - * - * If @ic is IGNORE_CASE, the @name comparison is not case sensitive and - * @ctx->ntfs_ino must be set to the ntfs inode to which the mft record - * @ctx->mrec belongs. This is so we can get at the ntfs volume and hence at - * the upcase table. If @ic is CASE_SENSITIVE, the comparison is case - * sensitive. When @name is present, @name_len is the @name length in Unicode - * characters. - * - * If @name is not present (NULL), we assume that the unnamed attribute is - * being searched for. - * - * Finally, the resident attribute value @val is looked for, if present. - * If @val is not present (NULL), @val_len is ignored. - * - * ntfs_attr_find() only searches the specified mft record and it ignores the - * presence of an attribute list attribute (unless it is the one being searched - * for, obviously). If you need to take attribute lists into consideration, use - * ntfs_attr_lookup() instead (see below). This also means that you cannot use - * ntfs_attr_find() to search for extent records of non-resident attributes, as - * extents with lowest_vcn != 0 are usually described by the attribute list - * attribute only. - Note that it is possible that the first extent is only in - * the attribute list while the last extent is in the base mft record, so don't - * rely on being able to find the first extent in the base mft record. - * - * Warning: Never use @val when looking for attribute types which can be - * non-resident as this most likely will result in a crash! - */ -static int ntfs_attr_find(const ATTR_TYPES type, const ntfschar *name, - const u32 name_len, const IGNORE_CASE_BOOL ic, - const u8 *val, const u32 val_len, ntfs_attr_search_ctx *ctx) -{ - ATTR_RECORD *a; - ntfs_volume *vol; - ntfschar *upcase; - u32 upcase_len; - - ntfs_log_trace("attribute type 0x%x.\n", type); - - if (ctx->ntfs_ino) { - vol = ctx->ntfs_ino->vol; - upcase = vol->upcase; - upcase_len = vol->upcase_len; - } else { - if (name && name != AT_UNNAMED) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return -1; - } - vol = NULL; - upcase = NULL; - upcase_len = 0; - } - /* - * Iterate over attributes in mft record starting at @ctx->attr, or the - * attribute following that, if @ctx->is_first is TRUE. - */ - if (ctx->is_first) { - a = ctx->attr; - ctx->is_first = FALSE; - } else - a = (ATTR_RECORD*)((char*)ctx->attr + - le32_to_cpu(ctx->attr->length)); - for (;; a = (ATTR_RECORD*)((char*)a + le32_to_cpu(a->length))) { - if (p2n(a) < p2n(ctx->mrec) || (char*)a > (char*)ctx->mrec + - le32_to_cpu(ctx->mrec->bytes_allocated)) - break; - ctx->attr = a; - if (((type != AT_UNUSED) && (le32_to_cpu(a->type) > - le32_to_cpu(type))) || - (a->type == AT_END)) { - errno = ENOENT; - return -1; - } - if (!a->length) - break; - /* If this is an enumeration return this attribute. */ - if (type == AT_UNUSED) - return 0; - if (a->type != type) - continue; - /* - * If @name is AT_UNNAMED we want an unnamed attribute. - * If @name is present, compare the two names. - * Otherwise, match any attribute. - */ - if (name == AT_UNNAMED) { - /* The search failed if the found attribute is named. */ - if (a->name_length) { - errno = ENOENT; - return -1; - } - } else if (name && !ntfs_names_are_equal(name, name_len, - (ntfschar*)((char*)a + le16_to_cpu(a->name_offset)), - a->name_length, ic, upcase, upcase_len)) { - register int rc; - - rc = ntfs_names_collate(name, name_len, - (ntfschar*)((char*)a + - le16_to_cpu(a->name_offset)), - a->name_length, 1, IGNORE_CASE, - upcase, upcase_len); - /* - * If @name collates before a->name, there is no - * matching attribute. - */ - if (rc == -1) { - errno = ENOENT; - return -1; - } - /* If the strings are not equal, continue search. */ - if (rc) - continue; - rc = ntfs_names_collate(name, name_len, - (ntfschar*)((char*)a + - le16_to_cpu(a->name_offset)), - a->name_length, 1, CASE_SENSITIVE, - upcase, upcase_len); - if (rc == -1) { - errno = ENOENT; - return -1; - } - if (rc) - continue; - } - /* - * The names match or @name not present and attribute is - * unnamed. If no @val specified, we have found the attribute - * and are done. - */ - if (!val) - return 0; - /* @val is present; compare values. */ - else { - register int rc; - - rc = memcmp(val, (char*)a +le16_to_cpu(a->value_offset), - min(val_len, - le32_to_cpu(a->value_length))); - /* - * If @val collates before the current attribute's - * value, there is no matching attribute. - */ - if (!rc) { - register u32 avl; - avl = le32_to_cpu(a->value_length); - if (val_len == avl) - return 0; - if (val_len < avl) { - errno = ENOENT; - return -1; - } - } else if (rc < 0) { - errno = ENOENT; - return -1; - } - } - } - errno = EIO; - ntfs_log_perror("%s: Corrupt inode (%lld)", __FUNCTION__, - ctx->ntfs_ino ? (long long)ctx->ntfs_ino->mft_no : -1); - return -1; -} - -void ntfs_attr_name_free(char **name) -{ - if (*name) { - free(*name); - *name = NULL; - } -} - -char *ntfs_attr_name_get(const ntfschar *uname, const int uname_len) -{ - char *name = NULL; - int name_len; - - name_len = ntfs_ucstombs(uname, uname_len, &name, 0); - if (name_len < 0) { - ntfs_log_perror("ntfs_ucstombs"); - return NULL; - - } else if (name_len > 0) - return name; - - ntfs_attr_name_free(&name); - return NULL; -} - -/** - * ntfs_external_attr_find - find an attribute in the attribute list of an inode - * @type: attribute type to find - * @name: attribute name to find (optional, i.e. NULL means don't care) - * @name_len: attribute name length (only needed if @name present) - * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present) - * @lowest_vcn: lowest vcn to find (optional, non-resident attributes only) - * @val: attribute value to find (optional, resident attributes only) - * @val_len: attribute value length - * @ctx: search context with mft record and attribute to search from - * - * You shouldn't need to call this function directly. Use ntfs_attr_lookup() - * instead. - * - * Find an attribute by searching the attribute list for the corresponding - * attribute list entry. Having found the entry, map the mft record for read - * if the attribute is in a different mft record/inode, find the attribute in - * there and return it. - * - * If @type is AT_UNUSED, return the first found attribute, i.e. one can - * enumerate all attributes by setting @type to AT_UNUSED and then calling - * ntfs_external_attr_find() repeatedly until it returns -1 with errno set to - * ENOENT to indicate that there are no more entries. During the enumeration, - * each successful call of ntfs_external_attr_find() will return the next - * attribute described by the attribute list of the base mft record described - * by the search context @ctx. - * - * If @type is AT_END, seek to the end of the base mft record ignoring the - * attribute list completely and return -1 with errno set to ENOENT. AT_END is - * not a valid attribute, its length is zero for example, thus it is safer to - * return error instead of success in this case. - * - * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present - * but not AT_UNNAMED search for a named attribute matching @name. Otherwise, - * match both named and unnamed attributes. - * - * On first search @ctx->ntfs_ino must be the inode of the base mft record and - * @ctx must have been obtained from a call to ntfs_attr_get_search_ctx(). - * On subsequent calls, @ctx->ntfs_ino can be any extent inode, too - * (@ctx->base_ntfs_ino is then the base inode). - * - * After finishing with the attribute/mft record you need to call - * ntfs_attr_put_search_ctx() to cleanup the search context (unmapping any - * mapped extent inodes, etc). - * - * Return 0 if the search was successful and -1 if not, with errno set to the - * error code. - * - * On success, @ctx->attr is the found attribute, it is in mft record - * @ctx->mrec, and @ctx->al_entry is the attribute list entry for this - * attribute with @ctx->base_* being the base mft record to which @ctx->attr - * belongs. - * - * On error ENOENT, i.e. attribute not found, @ctx->attr is set to the - * attribute which collates just after the attribute being searched for in the - * base ntfs inode, i.e. if one wants to add the attribute to the mft record - * this is the correct place to insert it into, and if there is not enough - * space, the attribute should be placed in an extent mft record. - * @ctx->al_entry points to the position within @ctx->base_ntfs_ino->attr_list - * at which the new attribute's attribute list entry should be inserted. The - * other @ctx fields, base_ntfs_ino, base_mrec, and base_attr are set to NULL. - * The only exception to this is when @type is AT_END, in which case - * @ctx->al_entry is set to NULL also (see above). - * - * The following error codes are defined: - * ENOENT Attribute not found, not an error as such. - * EINVAL Invalid arguments. - * EIO I/O error or corrupt data structures found. - * ENOMEM Not enough memory to allocate necessary buffers. - */ -static int ntfs_external_attr_find(ATTR_TYPES type, const ntfschar *name, - const u32 name_len, const IGNORE_CASE_BOOL ic, - const VCN lowest_vcn, const u8 *val, const u32 val_len, - ntfs_attr_search_ctx *ctx) -{ - ntfs_inode *base_ni, *ni; - ntfs_volume *vol; - ATTR_LIST_ENTRY *al_entry, *next_al_entry; - u8 *al_start, *al_end; - ATTR_RECORD *a; - ntfschar *al_name; - u32 al_name_len; - BOOL is_first_search = FALSE; - - ni = ctx->ntfs_ino; - base_ni = ctx->base_ntfs_ino; - ntfs_log_trace("Entering for inode %lld, attribute type 0x%x.\n", - (unsigned long long)ni->mft_no, type); - if (!base_ni) { - /* First call happens with the base mft record. */ - base_ni = ctx->base_ntfs_ino = ctx->ntfs_ino; - ctx->base_mrec = ctx->mrec; - } - if (ni == base_ni) - ctx->base_attr = ctx->attr; - if (type == AT_END) - goto not_found; - vol = base_ni->vol; - al_start = base_ni->attr_list; - al_end = al_start + base_ni->attr_list_size; - if (!ctx->al_entry) { - ctx->al_entry = (ATTR_LIST_ENTRY*)al_start; - is_first_search = TRUE; - } - /* - * Iterate over entries in attribute list starting at @ctx->al_entry, - * or the entry following that, if @ctx->is_first is TRUE. - */ - if (ctx->is_first) { - al_entry = ctx->al_entry; - ctx->is_first = FALSE; - /* - * If an enumeration and the first attribute is higher than - * the attribute list itself, need to return the attribute list - * attribute. - */ - if ((type == AT_UNUSED) && is_first_search && - le32_to_cpu(al_entry->type) > - le32_to_cpu(AT_ATTRIBUTE_LIST)) - goto find_attr_list_attr; - } else { - al_entry = (ATTR_LIST_ENTRY*)((char*)ctx->al_entry + - le16_to_cpu(ctx->al_entry->length)); - /* - * If this is an enumeration and the attribute list attribute - * is the next one in the enumeration sequence, just return the - * attribute list attribute from the base mft record as it is - * not listed in the attribute list itself. - */ - if ((type == AT_UNUSED) && le32_to_cpu(ctx->al_entry->type) < - le32_to_cpu(AT_ATTRIBUTE_LIST) && - le32_to_cpu(al_entry->type) > - le32_to_cpu(AT_ATTRIBUTE_LIST)) { - int rc; -find_attr_list_attr: - - /* Check for bogus calls. */ - if (name || name_len || val || val_len || lowest_vcn) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return -1; - } - - /* We want the base record. */ - ctx->ntfs_ino = base_ni; - ctx->mrec = ctx->base_mrec; - ctx->is_first = TRUE; - /* Sanity checks are performed elsewhere. */ - ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + - le16_to_cpu(ctx->mrec->attrs_offset)); - - /* Find the attribute list attribute. */ - rc = ntfs_attr_find(AT_ATTRIBUTE_LIST, NULL, 0, - IGNORE_CASE, NULL, 0, ctx); - - /* - * Setup the search context so the correct - * attribute is returned next time round. - */ - ctx->al_entry = al_entry; - ctx->is_first = TRUE; - - /* Got it. Done. */ - if (!rc) - return 0; - - /* Error! If other than not found return it. */ - if (errno != ENOENT) - return rc; - - /* Not found?!? Absurd! */ - errno = EIO; - ntfs_log_error("Attribute list wasn't found"); - return -1; - } - } - for (;; al_entry = next_al_entry) { - /* Out of bounds check. */ - if ((u8*)al_entry < base_ni->attr_list || - (u8*)al_entry > al_end) - break; /* Inode is corrupt. */ - ctx->al_entry = al_entry; - /* Catch the end of the attribute list. */ - if ((u8*)al_entry == al_end) - goto not_found; - if (!al_entry->length) - break; - if ((u8*)al_entry + 6 > al_end || (u8*)al_entry + - le16_to_cpu(al_entry->length) > al_end) - break; - next_al_entry = (ATTR_LIST_ENTRY*)((u8*)al_entry + - le16_to_cpu(al_entry->length)); - if (type != AT_UNUSED) { - if (le32_to_cpu(al_entry->type) > le32_to_cpu(type)) - goto not_found; - if (type != al_entry->type) - continue; - } - al_name_len = al_entry->name_length; - al_name = (ntfschar*)((u8*)al_entry + al_entry->name_offset); - /* - * If !@type we want the attribute represented by this - * attribute list entry. - */ - if (type == AT_UNUSED) - goto is_enumeration; - /* - * If @name is AT_UNNAMED we want an unnamed attribute. - * If @name is present, compare the two names. - * Otherwise, match any attribute. - */ - if (name == AT_UNNAMED) { - if (al_name_len) - goto not_found; - } else if (name && !ntfs_names_are_equal(al_name, al_name_len, - name, name_len, ic, vol->upcase, - vol->upcase_len)) { - register int rc; - - rc = ntfs_names_collate(name, name_len, al_name, - al_name_len, 1, IGNORE_CASE, - vol->upcase, vol->upcase_len); - /* - * If @name collates before al_name, there is no - * matching attribute. - */ - if (rc == -1) - goto not_found; - /* If the strings are not equal, continue search. */ - if (rc) - continue; - /* - * FIXME: Reverse engineering showed 0, IGNORE_CASE but - * that is inconsistent with ntfs_attr_find(). The - * subsequent rc checks were also different. Perhaps I - * made a mistake in one of the two. Need to recheck - * which is correct or at least see what is going - * on... (AIA) - */ - rc = ntfs_names_collate(name, name_len, al_name, - al_name_len, 1, CASE_SENSITIVE, - vol->upcase, vol->upcase_len); - if (rc == -1) - goto not_found; - if (rc) - continue; - } - /* - * The names match or @name not present and attribute is - * unnamed. Now check @lowest_vcn. Continue search if the - * next attribute list entry still fits @lowest_vcn. Otherwise - * we have reached the right one or the search has failed. - */ - if (lowest_vcn && (u8*)next_al_entry >= al_start && - (u8*)next_al_entry + 6 < al_end && - (u8*)next_al_entry + le16_to_cpu( - next_al_entry->length) <= al_end && - sle64_to_cpu(next_al_entry->lowest_vcn) <= - lowest_vcn && - next_al_entry->type == al_entry->type && - next_al_entry->name_length == al_name_len && - ntfs_names_are_equal((ntfschar*)((char*) - next_al_entry + - next_al_entry->name_offset), - next_al_entry->name_length, - al_name, al_name_len, CASE_SENSITIVE, - vol->upcase, vol->upcase_len)) - continue; -is_enumeration: - if (MREF_LE(al_entry->mft_reference) == ni->mft_no) { - if (MSEQNO_LE(al_entry->mft_reference) != - le16_to_cpu( - ni->mrec->sequence_number)) { - ntfs_log_error("Found stale mft reference in " - "attribute list!\n"); - break; - } - } else { /* Mft references do not match. */ - /* Do we want the base record back? */ - if (MREF_LE(al_entry->mft_reference) == - base_ni->mft_no) { - ni = ctx->ntfs_ino = base_ni; - ctx->mrec = ctx->base_mrec; - } else { - /* We want an extent record. */ - ni = ntfs_extent_inode_open(base_ni, - al_entry->mft_reference); - if (!ni) - break; - ctx->ntfs_ino = ni; - ctx->mrec = ni->mrec; - } - } - a = ctx->attr = (ATTR_RECORD*)((char*)ctx->mrec + - le16_to_cpu(ctx->mrec->attrs_offset)); - /* - * ctx->ntfs_ino, ctx->mrec, and ctx->attr now point to the - * mft record containing the attribute represented by the - * current al_entry. - * - * We could call into ntfs_attr_find() to find the right - * attribute in this mft record but this would be less - * efficient and not quite accurate as ntfs_attr_find() ignores - * the attribute instance numbers for example which become - * important when one plays with attribute lists. Also, because - * a proper match has been found in the attribute list entry - * above, the comparison can now be optimized. So it is worth - * re-implementing a simplified ntfs_attr_find() here. - * - * Use a manual loop so we can still use break and continue - * with the same meanings as above. - */ -do_next_attr_loop: - if ((char*)a < (char*)ctx->mrec || (char*)a > (char*)ctx->mrec + - le32_to_cpu(ctx->mrec->bytes_allocated)) - break; - if (a->type == AT_END) - continue; - if (!a->length) - break; - if (al_entry->instance != a->instance) - goto do_next_attr; - /* - * If the type and/or the name are/is mismatched between the - * attribute list entry and the attribute record, there is - * corruption so we break and return error EIO. - */ - if (al_entry->type != a->type) - break; - if (!ntfs_names_are_equal((ntfschar*)((char*)a + - le16_to_cpu(a->name_offset)), - a->name_length, al_name, - al_name_len, CASE_SENSITIVE, - vol->upcase, vol->upcase_len)) - break; - ctx->attr = a; - /* - * If no @val specified or @val specified and it matches, we - * have found it! Also, if !@type, it is an enumeration, so we - * want the current attribute. - */ - if ((type == AT_UNUSED) || !val || (!a->non_resident && - le32_to_cpu(a->value_length) == val_len && - !memcmp((char*)a + le16_to_cpu(a->value_offset), - val, val_len))) { - return 0; - } -do_next_attr: - /* Proceed to the next attribute in the current mft record. */ - a = (ATTR_RECORD*)((char*)a + le32_to_cpu(a->length)); - goto do_next_attr_loop; - } - if (ni != base_ni) { - ctx->ntfs_ino = base_ni; - ctx->mrec = ctx->base_mrec; - ctx->attr = ctx->base_attr; - } - errno = EIO; - ntfs_log_perror("Inode is corrupt (%lld)", (long long)base_ni->mft_no); - return -1; -not_found: - /* - * If we were looking for AT_END or we were enumerating and reached the - * end, we reset the search context @ctx and use ntfs_attr_find() to - * seek to the end of the base mft record. - */ - if (type == AT_UNUSED || type == AT_END) { - ntfs_attr_reinit_search_ctx(ctx); - return ntfs_attr_find(AT_END, name, name_len, ic, val, val_len, - ctx); - } - /* - * The attribute wasn't found. Before we return, we want to ensure - * @ctx->mrec and @ctx->attr indicate the position at which the - * attribute should be inserted in the base mft record. Since we also - * want to preserve @ctx->al_entry we cannot reinitialize the search - * context using ntfs_attr_reinit_search_ctx() as this would set - * @ctx->al_entry to NULL. Thus we do the necessary bits manually (see - * ntfs_attr_init_search_ctx() below). Note, we _only_ preserve - * @ctx->al_entry as the remaining fields (base_*) are identical to - * their non base_ counterparts and we cannot set @ctx->base_attr - * correctly yet as we do not know what @ctx->attr will be set to by - * the call to ntfs_attr_find() below. - */ - ctx->mrec = ctx->base_mrec; - ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + - le16_to_cpu(ctx->mrec->attrs_offset)); - ctx->is_first = TRUE; - ctx->ntfs_ino = ctx->base_ntfs_ino; - ctx->base_ntfs_ino = NULL; - ctx->base_mrec = NULL; - ctx->base_attr = NULL; - /* - * In case there are multiple matches in the base mft record, need to - * keep enumerating until we get an attribute not found response (or - * another error), otherwise we would keep returning the same attribute - * over and over again and all programs using us for enumeration would - * lock up in a tight loop. - */ - { - int ret; - - do { - ret = ntfs_attr_find(type, name, name_len, ic, val, - val_len, ctx); - } while (!ret); - return ret; - } -} - -/** - * ntfs_attr_lookup - find an attribute in an ntfs inode - * @type: attribute type to find - * @name: attribute name to find (optional, i.e. NULL means don't care) - * @name_len: attribute name length (only needed if @name present) - * @ic: IGNORE_CASE or CASE_SENSITIVE (ignored if @name not present) - * @lowest_vcn: lowest vcn to find (optional, non-resident attributes only) - * @val: attribute value to find (optional, resident attributes only) - * @val_len: attribute value length - * @ctx: search context with mft record and attribute to search from - * - * Find an attribute in an ntfs inode. On first search @ctx->ntfs_ino must - * be the base mft record and @ctx must have been obtained from a call to - * ntfs_attr_get_search_ctx(). - * - * This function transparently handles attribute lists and @ctx is used to - * continue searches where they were left off at. - * - * If @type is AT_UNUSED, return the first found attribute, i.e. one can - * enumerate all attributes by setting @type to AT_UNUSED and then calling - * ntfs_attr_lookup() repeatedly until it returns -1 with errno set to ENOENT - * to indicate that there are no more entries. During the enumeration, each - * successful call of ntfs_attr_lookup() will return the next attribute, with - * the current attribute being described by the search context @ctx. - * - * If @type is AT_END, seek to the end of the base mft record ignoring the - * attribute list completely and return -1 with errno set to ENOENT. AT_END is - * not a valid attribute, its length is zero for example, thus it is safer to - * return error instead of success in this case. It should never be needed to - * do this, but we implement the functionality because it allows for simpler - * code inside ntfs_external_attr_find(). - * - * If @name is AT_UNNAMED search for an unnamed attribute. If @name is present - * but not AT_UNNAMED search for a named attribute matching @name. Otherwise, - * match both named and unnamed attributes. - * - * After finishing with the attribute/mft record you need to call - * ntfs_attr_put_search_ctx() to cleanup the search context (unmapping any - * mapped extent inodes, etc). - * - * Return 0 if the search was successful and -1 if not, with errno set to the - * error code. - * - * On success, @ctx->attr is the found attribute, it is in mft record - * @ctx->mrec, and @ctx->al_entry is the attribute list entry for this - * attribute with @ctx->base_* being the base mft record to which @ctx->attr - * belongs. If no attribute list attribute is present @ctx->al_entry and - * @ctx->base_* are NULL. - * - * On error ENOENT, i.e. attribute not found, @ctx->attr is set to the - * attribute which collates just after the attribute being searched for in the - * base ntfs inode, i.e. if one wants to add the attribute to the mft record - * this is the correct place to insert it into, and if there is not enough - * space, the attribute should be placed in an extent mft record. - * @ctx->al_entry points to the position within @ctx->base_ntfs_ino->attr_list - * at which the new attribute's attribute list entry should be inserted. The - * other @ctx fields, base_ntfs_ino, base_mrec, and base_attr are set to NULL. - * The only exception to this is when @type is AT_END, in which case - * @ctx->al_entry is set to NULL also (see above). - * - * - * The following error codes are defined: - * ENOENT Attribute not found, not an error as such. - * EINVAL Invalid arguments. - * EIO I/O error or corrupt data structures found. - * ENOMEM Not enough memory to allocate necessary buffers. - */ -int ntfs_attr_lookup(const ATTR_TYPES type, const ntfschar *name, - const u32 name_len, const IGNORE_CASE_BOOL ic, - const VCN lowest_vcn, const u8 *val, const u32 val_len, - ntfs_attr_search_ctx *ctx) -{ - ntfs_volume *vol; - ntfs_inode *base_ni; - int ret = -1; - - ntfs_log_enter("Entering for attribute type 0x%x\n", type); - - if (!ctx || !ctx->mrec || !ctx->attr || (name && name != AT_UNNAMED && - (!ctx->ntfs_ino || !(vol = ctx->ntfs_ino->vol) || - !vol->upcase || !vol->upcase_len))) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - goto out; - } - - if (ctx->base_ntfs_ino) - base_ni = ctx->base_ntfs_ino; - else - base_ni = ctx->ntfs_ino; - if (!base_ni || !NInoAttrList(base_ni) || type == AT_ATTRIBUTE_LIST) - ret = ntfs_attr_find(type, name, name_len, ic, val, val_len, ctx); - else - ret = ntfs_external_attr_find(type, name, name_len, ic, - lowest_vcn, val, val_len, ctx); -out: - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_attr_position - find given or next attribute type in an ntfs inode - * @type: attribute type to start lookup - * @ctx: search context with mft record and attribute to search from - * - * Find an attribute type in an ntfs inode or the next attribute which is not - * the AT_END attribute. Please see more details at ntfs_attr_lookup. - * - * Return 0 if the search was successful and -1 if not, with errno set to the - * error code. - * - * The following error codes are defined: - * EINVAL Invalid arguments. - * EIO I/O error or corrupt data structures found. - * ENOMEM Not enough memory to allocate necessary buffers. - * ENOSPC No attribute was found after 'type', only AT_END. - */ -int ntfs_attr_position(const ATTR_TYPES type, ntfs_attr_search_ctx *ctx) -{ - if (ntfs_attr_lookup(type, NULL, 0, CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (errno != ENOENT) - return -1; - if (ctx->attr->type == AT_END) { - errno = ENOSPC; - return -1; - } - } - return 0; -} - -/** - * ntfs_attr_init_search_ctx - initialize an attribute search context - * @ctx: attribute search context to initialize - * @ni: ntfs inode with which to initialize the search context - * @mrec: mft record with which to initialize the search context - * - * Initialize the attribute search context @ctx with @ni and @mrec. - */ -static void ntfs_attr_init_search_ctx(ntfs_attr_search_ctx *ctx, - ntfs_inode *ni, MFT_RECORD *mrec) -{ - if (!mrec) - mrec = ni->mrec; - ctx->mrec = mrec; - /* Sanity checks are performed elsewhere. */ - ctx->attr = (ATTR_RECORD*)((u8*)mrec + le16_to_cpu(mrec->attrs_offset)); - ctx->is_first = TRUE; - ctx->ntfs_ino = ni; - ctx->al_entry = NULL; - ctx->base_ntfs_ino = NULL; - ctx->base_mrec = NULL; - ctx->base_attr = NULL; -} - -/** - * ntfs_attr_reinit_search_ctx - reinitialize an attribute search context - * @ctx: attribute search context to reinitialize - * - * Reinitialize the attribute search context @ctx. - * - * This is used when a search for a new attribute is being started to reset - * the search context to the beginning. - */ -void ntfs_attr_reinit_search_ctx(ntfs_attr_search_ctx *ctx) -{ - if (!ctx->base_ntfs_ino) { - /* No attribute list. */ - ctx->is_first = TRUE; - /* Sanity checks are performed elsewhere. */ - ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + - le16_to_cpu(ctx->mrec->attrs_offset)); - /* - * This needs resetting due to ntfs_external_attr_find() which - * can leave it set despite having zeroed ctx->base_ntfs_ino. - */ - ctx->al_entry = NULL; - return; - } /* Attribute list. */ - ntfs_attr_init_search_ctx(ctx, ctx->base_ntfs_ino, ctx->base_mrec); - return; -} - -/** - * ntfs_attr_get_search_ctx - allocate/initialize a new attribute search context - * @ni: ntfs inode with which to initialize the search context - * @mrec: mft record with which to initialize the search context - * - * Allocate a new attribute search context, initialize it with @ni and @mrec, - * and return it. Return NULL on error with errno set. - * - * @mrec can be NULL, in which case the mft record is taken from @ni. - * - * Note: For low level utilities which know what they are doing we allow @ni to - * be NULL and @mrec to be set. Do NOT do this unless you understand the - * implications!!! For example it is no longer safe to call ntfs_attr_lookup(). - */ -ntfs_attr_search_ctx *ntfs_attr_get_search_ctx(ntfs_inode *ni, MFT_RECORD *mrec) -{ - ntfs_attr_search_ctx *ctx; - - if (!ni && !mrec) { - errno = EINVAL; - ntfs_log_perror("NULL arguments"); - return NULL; - } - ctx = ntfs_malloc(sizeof(ntfs_attr_search_ctx)); - if (ctx) - ntfs_attr_init_search_ctx(ctx, ni, mrec); - return ctx; -} - -/** - * ntfs_attr_put_search_ctx - release an attribute search context - * @ctx: attribute search context to free - * - * Release the attribute search context @ctx. - */ -void ntfs_attr_put_search_ctx(ntfs_attr_search_ctx *ctx) -{ - // NOTE: save errno if it could change and function stays void! - free(ctx); -} - -/** - * ntfs_attr_find_in_attrdef - find an attribute in the $AttrDef system file - * @vol: ntfs volume to which the attribute belongs - * @type: attribute type which to find - * - * Search for the attribute definition record corresponding to the attribute - * @type in the $AttrDef system file. - * - * Return the attribute type definition record if found and NULL if not found - * or an error occurred. On error the error code is stored in errno. The - * following error codes are defined: - * ENOENT - The attribute @type is not specified in $AttrDef. - * EINVAL - Invalid parameters (e.g. @vol is not valid). - */ -ATTR_DEF *ntfs_attr_find_in_attrdef(const ntfs_volume *vol, - const ATTR_TYPES type) -{ - ATTR_DEF *ad; - - if (!vol || !vol->attrdef || !type) { - errno = EINVAL; - ntfs_log_perror("%s: type=%d", __FUNCTION__, type); - return NULL; - } - for (ad = vol->attrdef; (u8*)ad - (u8*)vol->attrdef < - vol->attrdef_len && ad->type; ++ad) { - /* We haven't found it yet, carry on searching. */ - if (le32_to_cpu(ad->type) < le32_to_cpu(type)) - continue; - /* We found the attribute; return it. */ - if (ad->type == type) - return ad; - /* We have gone too far already. No point in continuing. */ - break; - } - errno = ENOENT; - ntfs_log_perror("%s: type=%d", __FUNCTION__, type); - return NULL; -} - -/** - * ntfs_attr_size_bounds_check - check a size of an attribute type for validity - * @vol: ntfs volume to which the attribute belongs - * @type: attribute type which to check - * @size: size which to check - * - * Check whether the @size in bytes is valid for an attribute of @type on the - * ntfs volume @vol. This information is obtained from $AttrDef system file. - * - * Return 0 if valid and -1 if not valid or an error occurred. On error the - * error code is stored in errno. The following error codes are defined: - * ERANGE - @size is not valid for the attribute @type. - * ENOENT - The attribute @type is not specified in $AttrDef. - * EINVAL - Invalid parameters (e.g. @size is < 0 or @vol is not valid). - */ -int ntfs_attr_size_bounds_check(const ntfs_volume *vol, const ATTR_TYPES type, - const s64 size) -{ - ATTR_DEF *ad; - s64 min_size, max_size; - - if (size < 0) { - errno = EINVAL; - ntfs_log_perror("%s: size=%lld", __FUNCTION__, - (long long)size); - return -1; - } - - /* - * $ATTRIBUTE_LIST shouldn't be greater than 0x40000, otherwise - * Windows would crash. This is not listed in the AttrDef. - */ - if (type == AT_ATTRIBUTE_LIST && size > 0x40000) { - errno = ERANGE; - ntfs_log_perror("Too large attrlist (%lld)", (long long)size); - return -1; - } - - ad = ntfs_attr_find_in_attrdef(vol, type); - if (!ad) - return -1; - - min_size = sle64_to_cpu(ad->min_size); - max_size = sle64_to_cpu(ad->max_size); - - if ((min_size && (size < min_size)) || - ((max_size > 0) && (size > max_size))) { - errno = ERANGE; - ntfs_log_perror("Attr type %d size check failed (min,size,max=" - "%lld,%lld,%lld)", type, (long long)min_size, - (long long)size, (long long)max_size); - return -1; - } - return 0; -} - -/** - * ntfs_attr_can_be_non_resident - check if an attribute can be non-resident - * @vol: ntfs volume to which the attribute belongs - * @type: attribute type which to check - * - * Check whether the attribute of @type on the ntfs volume @vol is allowed to - * be non-resident. This information is obtained from $AttrDef system file. - * - * Return 0 if the attribute is allowed to be non-resident and -1 if not or an - * error occurred. On error the error code is stored in errno. The following - * error codes are defined: - * EPERM - The attribute is not allowed to be non-resident. - * ENOENT - The attribute @type is not specified in $AttrDef. - * EINVAL - Invalid parameters (e.g. @vol is not valid). - */ -int ntfs_attr_can_be_non_resident(const ntfs_volume *vol, const ATTR_TYPES type) -{ - ATTR_DEF *ad; - - /* Find the attribute definition record in $AttrDef. */ - ad = ntfs_attr_find_in_attrdef(vol, type); - if (!ad) - return -1; - /* Check the flags and return the result. */ - if (ad->flags & ATTR_DEF_RESIDENT) { - errno = EPERM; - ntfs_log_trace("Attribute can't be non-resident\n"); - return -1; - } - return 0; -} - -/** - * ntfs_attr_can_be_resident - check if an attribute can be resident - * @vol: ntfs volume to which the attribute belongs - * @type: attribute type which to check - * - * Check whether the attribute of @type on the ntfs volume @vol is allowed to - * be resident. This information is derived from our ntfs knowledge and may - * not be completely accurate, especially when user defined attributes are - * present. Basically we allow everything to be resident except for index - * allocation and extended attribute attributes. - * - * Return 0 if the attribute is allowed to be resident and -1 if not or an - * error occurred. On error the error code is stored in errno. The following - * error codes are defined: - * EPERM - The attribute is not allowed to be resident. - * EINVAL - Invalid parameters (e.g. @vol is not valid). - * - * Warning: In the system file $MFT the attribute $Bitmap must be non-resident - * otherwise windows will not boot (blue screen of death)! We cannot - * check for this here as we don't know which inode's $Bitmap is being - * asked about so the caller needs to special case this. - */ -int ntfs_attr_can_be_resident(const ntfs_volume *vol, const ATTR_TYPES type) -{ - if (!vol || !vol->attrdef || !type) { - errno = EINVAL; - return -1; - } - if (type != AT_INDEX_ALLOCATION) - return 0; - - ntfs_log_trace("Attribute can't be resident\n"); - errno = EPERM; - return -1; -} - -/** - * ntfs_make_room_for_attr - make room for an attribute inside an mft record - * @m: mft record - * @pos: position at which to make space - * @size: byte size to make available at this position - * - * @pos points to the attribute in front of which we want to make space. - * - * Return 0 on success or -1 on error. On error the error code is stored in - * errno. Possible error codes are: - * ENOSPC - There is not enough space available to complete operation. The - * caller has to make space before calling this. - * EINVAL - Input parameters were faulty. - */ -int ntfs_make_room_for_attr(MFT_RECORD *m, u8 *pos, u32 size) -{ - u32 biu; - - ntfs_log_trace("Entering for pos 0x%d, size %u.\n", - (int)(pos - (u8*)m), (unsigned) size); - - /* Make size 8-byte alignment. */ - size = (size + 7) & ~7; - - /* Rigorous consistency checks. */ - if (!m || !pos || pos < (u8*)m) { - errno = EINVAL; - ntfs_log_perror("%s: pos=%p m=%p", __FUNCTION__, pos, m); - return -1; - } - /* The -8 is for the attribute terminator. */ - if (pos - (u8*)m > (int)le32_to_cpu(m->bytes_in_use) - 8) { - errno = EINVAL; - return -1; - } - /* Nothing to do. */ - if (!size) - return 0; - - biu = le32_to_cpu(m->bytes_in_use); - /* Do we have enough space? */ - if (biu + size > le32_to_cpu(m->bytes_allocated) || - pos + size > (u8*)m + le32_to_cpu(m->bytes_allocated)) { - errno = ENOSPC; - ntfs_log_trace("No enough space in the MFT record\n"); - return -1; - } - /* Move everything after pos to pos + size. */ - memmove(pos + size, pos, biu - (pos - (u8*)m)); - /* Update mft record. */ - m->bytes_in_use = cpu_to_le32(biu + size); - return 0; -} - -/** - * ntfs_resident_attr_record_add - add resident attribute to inode - * @ni: opened ntfs inode to which MFT record add attribute - * @type: type of the new attribute - * @name: name of the new attribute - * @name_len: name length of the new attribute - * @val: value of the new attribute - * @size: size of new attribute (length of @val, if @val != NULL) - * @flags: flags of the new attribute - * - * Return offset to attribute from the beginning of the mft record on success - * and -1 on error. On error the error code is stored in errno. - * Possible error codes are: - * EINVAL - Invalid arguments passed to function. - * EEXIST - Attribute of such type and with same name already exists. - * EIO - I/O error occurred or damaged filesystem. - */ -int ntfs_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, u8 *val, u32 size, - ATTR_FLAGS data_flags) -{ - ntfs_attr_search_ctx *ctx; - u32 length; - ATTR_RECORD *a; - MFT_RECORD *m; - int err, offset; - ntfs_inode *base_ni; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, flags 0x%x.\n", - (long long) ni->mft_no, (unsigned) type, (unsigned) data_flags); - - if (!ni || (!name && name_len)) { - errno = EINVAL; - return -1; - } - - if (ntfs_attr_can_be_resident(ni->vol, type)) { - if (errno == EPERM) - ntfs_log_trace("Attribute can't be resident.\n"); - else - ntfs_log_trace("ntfs_attr_can_be_resident failed.\n"); - return -1; - } - - /* Locate place where record should be. */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return -1; - /* - * Use ntfs_attr_find instead of ntfs_attr_lookup to find place for - * attribute in @ni->mrec, not any extent inode in case if @ni is base - * file record. - */ - if (!ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, val, size, - ctx)) { - err = EEXIST; - ntfs_log_trace("Attribute already present.\n"); - goto put_err_out; - } - if (errno != ENOENT) { - err = EIO; - goto put_err_out; - } - a = ctx->attr; - m = ctx->mrec; - - /* Make room for attribute. */ - length = offsetof(ATTR_RECORD, resident_end) + - ((name_len * sizeof(ntfschar) + 7) & ~7) + - ((size + 7) & ~7); - if (ntfs_make_room_for_attr(ctx->mrec, (u8*) ctx->attr, length)) { - err = errno; - ntfs_log_trace("Failed to make room for attribute.\n"); - goto put_err_out; - } - - /* Setup record fields. */ - offset = ((u8*)a - (u8*)m); - a->type = type; - a->length = cpu_to_le32(length); - a->non_resident = 0; - a->name_length = name_len; - a->name_offset = (name_len - ? cpu_to_le16(offsetof(ATTR_RECORD, resident_end)) - : const_cpu_to_le16(0)); - a->flags = data_flags; - a->instance = m->next_attr_instance; - a->value_length = cpu_to_le32(size); - a->value_offset = cpu_to_le16(length - ((size + 7) & ~7)); - if (val) - memcpy((u8*)a + le16_to_cpu(a->value_offset), val, size); - else - memset((u8*)a + le16_to_cpu(a->value_offset), 0, size); - if (type == AT_FILE_NAME) - a->resident_flags = RESIDENT_ATTR_IS_INDEXED; - else - a->resident_flags = 0; - if (name_len) - memcpy((u8*)a + le16_to_cpu(a->name_offset), - name, sizeof(ntfschar) * name_len); - m->next_attr_instance = - cpu_to_le16((le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); - if (ni->nr_extents == -1) - base_ni = ni->base_ni; - else - base_ni = ni; - if (type != AT_ATTRIBUTE_LIST && NInoAttrList(base_ni)) { - if (ntfs_attrlist_entry_add(ni, a)) { - err = errno; - ntfs_attr_record_resize(m, a, 0); - ntfs_log_trace("Failed add attribute entry to " - "ATTRIBUTE_LIST.\n"); - goto put_err_out; - } - } - if (type == AT_DATA && name == AT_UNNAMED) { - ni->data_size = size; - ni->allocated_size = (size + 7) & ~7; - } - ntfs_inode_mark_dirty(ni); - ntfs_attr_put_search_ctx(ctx); - return offset; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - -/** - * ntfs_non_resident_attr_record_add - add extent of non-resident attribute - * @ni: opened ntfs inode to which MFT record add attribute - * @type: type of the new attribute extent - * @name: name of the new attribute extent - * @name_len: name length of the new attribute extent - * @lowest_vcn: lowest vcn of the new attribute extent - * @dataruns_size: dataruns size of the new attribute extent - * @flags: flags of the new attribute extent - * - * Return offset to attribute from the beginning of the mft record on success - * and -1 on error. On error the error code is stored in errno. - * Possible error codes are: - * EINVAL - Invalid arguments passed to function. - * EEXIST - Attribute of such type, with same lowest vcn and with same - * name already exists. - * EIO - I/O error occurred or damaged filesystem. - */ -int ntfs_non_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, VCN lowest_vcn, int dataruns_size, - ATTR_FLAGS flags) -{ - ntfs_attr_search_ctx *ctx; - u32 length; - ATTR_RECORD *a; - MFT_RECORD *m; - ntfs_inode *base_ni; - int err, offset; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, lowest_vcn %lld, " - "dataruns_size %d, flags 0x%x.\n", - (long long) ni->mft_no, (unsigned) type, - (long long) lowest_vcn, dataruns_size, (unsigned) flags); - - if (!ni || dataruns_size <= 0 || (!name && name_len)) { - errno = EINVAL; - return -1; - } - - if (ntfs_attr_can_be_non_resident(ni->vol, type)) { - if (errno == EPERM) - ntfs_log_perror("Attribute can't be non resident"); - else - ntfs_log_perror("ntfs_attr_can_be_non_resident failed"); - return -1; - } - - /* Locate place where record should be. */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return -1; - /* - * Use ntfs_attr_find instead of ntfs_attr_lookup to find place for - * attribute in @ni->mrec, not any extent inode in case if @ni is base - * file record. - */ - if (!ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, NULL, 0, - ctx)) { - err = EEXIST; - ntfs_log_perror("Attribute 0x%x already present", type); - goto put_err_out; - } - if (errno != ENOENT) { - ntfs_log_perror("ntfs_attr_find failed"); - err = EIO; - goto put_err_out; - } - a = ctx->attr; - m = ctx->mrec; - - /* Make room for attribute. */ - dataruns_size = (dataruns_size + 7) & ~7; - length = offsetof(ATTR_RECORD, compressed_size) + ((sizeof(ntfschar) * - name_len + 7) & ~7) + dataruns_size + - ((flags & (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE)) ? - sizeof(a->compressed_size) : 0); - if (ntfs_make_room_for_attr(ctx->mrec, (u8*) ctx->attr, length)) { - err = errno; - ntfs_log_perror("Failed to make room for attribute"); - goto put_err_out; - } - - /* Setup record fields. */ - a->type = type; - a->length = cpu_to_le32(length); - a->non_resident = 1; - a->name_length = name_len; - a->name_offset = cpu_to_le16(offsetof(ATTR_RECORD, compressed_size) + - ((flags & (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE)) ? - sizeof(a->compressed_size) : 0)); - a->flags = flags; - a->instance = m->next_attr_instance; - a->lowest_vcn = cpu_to_sle64(lowest_vcn); - a->mapping_pairs_offset = cpu_to_le16(length - dataruns_size); - a->compression_unit = (flags & ATTR_IS_COMPRESSED) - ? STANDARD_COMPRESSION_UNIT : 0; - /* If @lowest_vcn == 0, than setup empty attribute. */ - if (!lowest_vcn) { - a->highest_vcn = cpu_to_sle64(-1); - a->allocated_size = 0; - a->data_size = 0; - a->initialized_size = 0; - /* Set empty mapping pairs. */ - *((u8*)a + le16_to_cpu(a->mapping_pairs_offset)) = 0; - } - if (name_len) - memcpy((u8*)a + le16_to_cpu(a->name_offset), - name, sizeof(ntfschar) * name_len); - m->next_attr_instance = - cpu_to_le16((le16_to_cpu(m->next_attr_instance) + 1) & 0xffff); - if (ni->nr_extents == -1) - base_ni = ni->base_ni; - else - base_ni = ni; - if (type != AT_ATTRIBUTE_LIST && NInoAttrList(base_ni)) { - if (ntfs_attrlist_entry_add(ni, a)) { - err = errno; - ntfs_log_perror("Failed add attr entry to attrlist"); - ntfs_attr_record_resize(m, a, 0); - goto put_err_out; - } - } - ntfs_inode_mark_dirty(ni); - /* - * Locate offset from start of the MFT record where new attribute is - * placed. We need relookup it, because record maybe moved during - * update of attribute list. - */ - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE, - lowest_vcn, NULL, 0, ctx)) { - ntfs_log_perror("%s: attribute lookup failed", __FUNCTION__); - ntfs_attr_put_search_ctx(ctx); - return -1; - - } - offset = (u8*)ctx->attr - (u8*)ctx->mrec; - ntfs_attr_put_search_ctx(ctx); - return offset; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - -/** - * ntfs_attr_record_rm - remove attribute extent - * @ctx: search context describing the attribute which should be removed - * - * If this function succeed, user should reinit search context if he/she wants - * use it anymore. - * - * Return 0 on success and -1 on error. On error the error code is stored in - * errno. Possible error codes are: - * EINVAL - Invalid arguments passed to function. - * EIO - I/O error occurred or damaged filesystem. - */ -int ntfs_attr_record_rm(ntfs_attr_search_ctx *ctx) -{ - ntfs_inode *base_ni, *ni; - ATTR_TYPES type; - int err; - - if (!ctx || !ctx->ntfs_ino || !ctx->mrec || !ctx->attr) { - errno = EINVAL; - return -1; - } - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", - (long long) ctx->ntfs_ino->mft_no, - (unsigned) le32_to_cpu(ctx->attr->type)); - type = ctx->attr->type; - ni = ctx->ntfs_ino; - if (ctx->base_ntfs_ino) - base_ni = ctx->base_ntfs_ino; - else - base_ni = ctx->ntfs_ino; - - /* Remove attribute itself. */ - if (ntfs_attr_record_resize(ctx->mrec, ctx->attr, 0)) { - ntfs_log_trace("Couldn't remove attribute record. Bug or damaged MFT " - "record.\n"); - if (NInoAttrList(base_ni) && type != AT_ATTRIBUTE_LIST) - if (ntfs_attrlist_entry_add(ni, ctx->attr)) - ntfs_log_trace("Rollback failed. Leaving inconstant " - "metadata.\n"); - err = EIO; - return -1; - } - ntfs_inode_mark_dirty(ni); - - /* - * Remove record from $ATTRIBUTE_LIST if present and we don't want - * delete $ATTRIBUTE_LIST itself. - */ - if (NInoAttrList(base_ni) && type != AT_ATTRIBUTE_LIST) { - if (ntfs_attrlist_entry_rm(ctx)) { - ntfs_log_trace("Couldn't delete record from " - "$ATTRIBUTE_LIST.\n"); - return -1; - } - } - - /* Post $ATTRIBUTE_LIST delete setup. */ - if (type == AT_ATTRIBUTE_LIST) { - if (NInoAttrList(base_ni) && base_ni->attr_list) - free(base_ni->attr_list); - base_ni->attr_list = NULL; - NInoClearAttrList(base_ni); - NInoAttrListClearDirty(base_ni); - } - - /* Free MFT record, if it doesn't contain attributes. */ - if (le32_to_cpu(ctx->mrec->bytes_in_use) - - le16_to_cpu(ctx->mrec->attrs_offset) == 8) { - if (ntfs_mft_record_free(ni->vol, ni)) { - // FIXME: We need rollback here. - ntfs_log_trace("Couldn't free MFT record.\n"); - errno = EIO; - return -1; - } - /* Remove done if we freed base inode. */ - if (ni == base_ni) - return 0; - } - - if (type == AT_ATTRIBUTE_LIST || !NInoAttrList(base_ni)) - return 0; - - /* Remove attribute list if we don't need it any more. */ - if (!ntfs_attrlist_need(base_ni)) { - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(AT_ATTRIBUTE_LIST, NULL, 0, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - /* - * FIXME: Should we succeed here? Definitely something - * goes wrong because NInoAttrList(base_ni) returned - * that we have got attribute list. - */ - ntfs_log_trace("Couldn't find attribute list. Succeed " - "anyway.\n"); - return 0; - } - /* Deallocate clusters. */ - if (ctx->attr->non_resident) { - runlist *al_rl; - - al_rl = ntfs_mapping_pairs_decompress(base_ni->vol, - ctx->attr, NULL); - if (!al_rl) { - ntfs_log_trace("Couldn't decompress attribute list " - "runlist. Succeed anyway.\n"); - return 0; - } - if (ntfs_cluster_free_from_rl(base_ni->vol, al_rl)) { - ntfs_log_trace("Leaking clusters! Run chkdsk. " - "Couldn't free clusters from " - "attribute list runlist.\n"); - } - free(al_rl); - } - /* Remove attribute record itself. */ - if (ntfs_attr_record_rm(ctx)) { - /* - * FIXME: Should we succeed here? BTW, chkdsk doesn't - * complain if it find MFT record with attribute list, - * but without extents. - */ - ntfs_log_trace("Couldn't remove attribute list. Succeed " - "anyway.\n"); - return 0; - } - } - return 0; -} - -/** - * ntfs_attr_add - add attribute to inode - * @ni: opened ntfs inode to which add attribute - * @type: type of the new attribute - * @name: name in unicode of the new attribute - * @name_len: name length in unicode characters of the new attribute - * @val: value of new attribute - * @size: size of the new attribute / length of @val (if specified) - * - * @val should always be specified for always resident attributes (eg. FILE_NAME - * attribute), for attributes that can become non-resident @val can be NULL - * (eg. DATA attribute). @size can be specified even if @val is NULL, in this - * case data size will be equal to @size and initialized size will be equal - * to 0. - * - * If inode haven't got enough space to add attribute, add attribute to one of - * it extents, if no extents present or no one of them have enough space, than - * allocate new extent and add attribute to it. - * - * If on one of this steps attribute list is needed but not present, than it is - * added transparently to caller. So, this function should not be called with - * @type == AT_ATTRIBUTE_LIST, if you really need to add attribute list call - * ntfs_inode_add_attrlist instead. - * - * On success return 0. On error return -1 with errno set to the error code. - */ -int ntfs_attr_add(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, u8 *val, s64 size) -{ - u32 attr_rec_size; - int err, i, offset; - BOOL is_resident; - BOOL can_be_non_resident = FALSE; - ntfs_inode *attr_ni; - ntfs_attr *na; - ATTR_FLAGS data_flags; - - if (!ni || size < 0 || type == AT_ATTRIBUTE_LIST) { - errno = EINVAL; - ntfs_log_perror("%s: ni=%p size=%lld", __FUNCTION__, ni, - (long long)size); - return -1; - } - - ntfs_log_trace("Entering for inode %lld, attr %x, size %lld.\n", - (long long)ni->mft_no, type, (long long)size); - - if (ni->nr_extents == -1) - ni = ni->base_ni; - - /* Check the attribute type and the size. */ - if (ntfs_attr_size_bounds_check(ni->vol, type, size)) { - if (errno == ENOENT) - errno = EIO; - return -1; - } - - /* Sanity checks for always resident attributes. */ - if (ntfs_attr_can_be_non_resident(ni->vol, type)) { - if (errno != EPERM) { - err = errno; - ntfs_log_perror("ntfs_attr_can_be_non_resident failed"); - goto err_out; - } - /* @val is mandatory. */ - if (!val) { - errno = EINVAL; - ntfs_log_perror("val is mandatory for always resident " - "attributes"); - return -1; - } - if (size > ni->vol->mft_record_size) { - errno = ERANGE; - ntfs_log_perror("Attribute is too big"); - return -1; - } - } else - can_be_non_resident = TRUE; - - /* - * Determine resident or not will be new attribute. We add 8 to size in - * non resident case for mapping pairs. - */ - if (!ntfs_attr_can_be_resident(ni->vol, type)) { - is_resident = TRUE; - } else { - if (errno != EPERM) { - err = errno; - ntfs_log_perror("ntfs_attr_can_be_resident failed"); - goto err_out; - } - is_resident = FALSE; - } - /* Calculate attribute record size. */ - if (is_resident) - attr_rec_size = offsetof(ATTR_RECORD, resident_end) + - ((name_len * sizeof(ntfschar) + 7) & ~7) + - ((size + 7) & ~7); - else - attr_rec_size = offsetof(ATTR_RECORD, non_resident_end) + - ((name_len * sizeof(ntfschar) + 7) & ~7) + 8; - - /* - * If we have enough free space for the new attribute in the base MFT - * record, then add attribute to it. - */ - if (le32_to_cpu(ni->mrec->bytes_allocated) - - le32_to_cpu(ni->mrec->bytes_in_use) >= attr_rec_size) { - attr_ni = ni; - goto add_attr_record; - } - - /* Try to add to extent inodes. */ - if (ntfs_inode_attach_all_extents(ni)) { - err = errno; - ntfs_log_perror("Failed to attach all extents to inode"); - goto err_out; - } - for (i = 0; i < ni->nr_extents; i++) { - attr_ni = ni->extent_nis[i]; - if (le32_to_cpu(attr_ni->mrec->bytes_allocated) - - le32_to_cpu(attr_ni->mrec->bytes_in_use) >= - attr_rec_size) - goto add_attr_record; - } - - /* There is no extent that contain enough space for new attribute. */ - if (!NInoAttrList(ni)) { - /* Add attribute list not present, add it and retry. */ - if (ntfs_inode_add_attrlist(ni)) { - err = errno; - ntfs_log_perror("Failed to add attribute list"); - goto err_out; - } - return ntfs_attr_add(ni, type, name, name_len, val, size); - } - /* Allocate new extent. */ - attr_ni = ntfs_mft_record_alloc(ni->vol, ni); - if (!attr_ni) { - err = errno; - ntfs_log_perror("Failed to allocate extent record"); - goto err_out; - } - -add_attr_record: - if ((ni->flags & FILE_ATTR_COMPRESSED) - && ((type == AT_DATA) - || ((type == AT_INDEX_ROOT) && (name == NTFS_INDEX_I30)))) - data_flags = ATTR_IS_COMPRESSED; - else - data_flags = const_cpu_to_le16(0); - if (is_resident) { - /* Add resident attribute. */ - offset = ntfs_resident_attr_record_add(attr_ni, type, name, - name_len, val, size, data_flags); - if (offset < 0) { - if (errno == ENOSPC && can_be_non_resident) - goto add_non_resident; - err = errno; - ntfs_log_perror("Failed to add resident attribute"); - goto free_err_out; - } - return 0; - } - -add_non_resident: - /* Add non resident attribute. */ - offset = ntfs_non_resident_attr_record_add(attr_ni, type, name, - name_len, 0, 8, data_flags); - if (offset < 0) { - err = errno; - ntfs_log_perror("Failed to add non resident attribute"); - goto free_err_out; - } - - /* If @size == 0, we are done. */ - if (!size) - return 0; - - /* Open new attribute and resize it. */ - na = ntfs_attr_open(ni, type, name, name_len); - if (!na) { - err = errno; - ntfs_log_perror("Failed to open just added attribute"); - goto rm_attr_err_out; - } - /* Resize and set attribute value. */ - if (ntfs_attr_truncate(na, size) || - (val && (ntfs_attr_pwrite(na, 0, size, val) != size))) { - err = errno; - ntfs_log_perror("Failed to initialize just added attribute"); - if (ntfs_attr_rm(na)) - ntfs_log_perror("Failed to remove just added attribute"); - ntfs_attr_close(na); - goto err_out; - } - ntfs_attr_close(na); - return 0; - -rm_attr_err_out: - /* Remove just added attribute. */ - if (ntfs_attr_record_resize(attr_ni->mrec, - (ATTR_RECORD*)((u8*)attr_ni->mrec + offset), 0)) - ntfs_log_perror("Failed to remove just added attribute #2"); -free_err_out: - /* Free MFT record, if it doesn't contain attributes. */ - if (le32_to_cpu(attr_ni->mrec->bytes_in_use) - - le16_to_cpu(attr_ni->mrec->attrs_offset) == 8) - if (ntfs_mft_record_free(attr_ni->vol, attr_ni)) - ntfs_log_perror("Failed to free MFT record"); -err_out: - errno = err; - return -1; -} - -/* - * Change an attribute flag - */ - -int ntfs_attr_set_flags(ntfs_inode *ni, ATTR_TYPES type, - ntfschar *name, u8 name_len, ATTR_FLAGS flags, ATTR_FLAGS mask) -{ - ntfs_attr_search_ctx *ctx; - int res; - - res = -1; - /* Search for designated attribute */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (ctx) { - if (!ntfs_attr_lookup(type, name, name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - /* do the requested change (all small endian le16) */ - ctx->attr->flags = (ctx->attr->flags & ~mask) - | (flags & mask); - NInoSetDirty(ni); - res = 0; - } - ntfs_attr_put_search_ctx(ctx); - } - return (res); -} - - -/** - * ntfs_attr_rm - remove attribute from ntfs inode - * @na: opened ntfs attribute to delete - * - * Remove attribute and all it's extents from ntfs inode. If attribute was non - * resident also free all clusters allocated by attribute. - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -int ntfs_attr_rm(ntfs_attr *na) -{ - ntfs_attr_search_ctx *ctx; - int ret = 0; - - if (!na) { - ntfs_log_trace("Invalid arguments passed.\n"); - errno = EINVAL; - return -1; - } - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", - (long long) na->ni->mft_no, na->type); - - /* Free cluster allocation. */ - if (NAttrNonResident(na)) { - if (ntfs_attr_map_whole_runlist(na)) - return -1; - if (ntfs_cluster_free(na->ni->vol, na, 0, -1) < 0) { - ntfs_log_trace("Failed to free cluster allocation. Leaving " - "inconstant metadata.\n"); - ret = -1; - } - } - - /* Search for attribute extents and remove them all. */ - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - while (!ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (ntfs_attr_record_rm(ctx)) { - ntfs_log_trace("Failed to remove attribute extent. Leaving " - "inconstant metadata.\n"); - ret = -1; - } - ntfs_attr_reinit_search_ctx(ctx); - } - ntfs_attr_put_search_ctx(ctx); - if (errno != ENOENT) { - ntfs_log_trace("Attribute lookup failed. Probably leaving inconstant " - "metadata.\n"); - ret = -1; - } - - return ret; -} - -/** - * ntfs_attr_record_resize - resize an attribute record - * @m: mft record containing attribute record - * @a: attribute record to resize - * @new_size: new size in bytes to which to resize the attribute record @a - * - * Resize the attribute record @a, i.e. the resident part of the attribute, in - * the mft record @m to @new_size bytes. - * - * Return 0 on success and -1 on error with errno set to the error code. - * The following error codes are defined: - * ENOSPC - Not enough space in the mft record @m to perform the resize. - * Note that on error no modifications have been performed whatsoever. - * - * Warning: If you make a record smaller without having copied all the data you - * are interested in the data may be overwritten! - */ -int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size) -{ - u32 old_size, alloc_size, attr_size; - - old_size = le32_to_cpu(m->bytes_in_use); - alloc_size = le32_to_cpu(m->bytes_allocated); - attr_size = le32_to_cpu(a->length); - - ntfs_log_trace("Sizes: old=%u alloc=%u attr=%u new=%u\n", - (unsigned)old_size, (unsigned)alloc_size, - (unsigned)attr_size, (unsigned)new_size); - - /* Align to 8 bytes, just in case the caller hasn't. */ - new_size = (new_size + 7) & ~7; - - /* If the actual attribute length has changed, move things around. */ - if (new_size != attr_size) { - - u32 new_muse = old_size - attr_size + new_size; - - /* Not enough space in this mft record. */ - if (new_muse > alloc_size) { - errno = ENOSPC; - ntfs_log_trace("Not enough space in the MFT record " - "(%u > %u)\n", new_muse, alloc_size); - return -1; - } - - if (a->type == AT_INDEX_ROOT && new_size > attr_size && - new_muse + 120 > alloc_size && old_size + 120 <= alloc_size) { - errno = ENOSPC; - ntfs_log_trace("Too big INDEX_ROOT (%u > %u)\n", - new_muse, alloc_size); - return STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT; - } - - /* Move attributes following @a to their new location. */ - memmove((u8 *)a + new_size, (u8 *)a + attr_size, - old_size - ((u8 *)a - (u8 *)m) - attr_size); - - /* Adjust @m to reflect the change in used space. */ - m->bytes_in_use = cpu_to_le32(new_muse); - - /* Adjust @a to reflect the new size. */ - if (new_size >= offsetof(ATTR_REC, length) + sizeof(a->length)) - a->length = cpu_to_le32(new_size); - } - return 0; -} - -/** - * ntfs_resident_attr_value_resize - resize the value of a resident attribute - * @m: mft record containing attribute record - * @a: attribute record whose value to resize - * @new_size: new size in bytes to which to resize the attribute value of @a - * - * Resize the value of the attribute @a in the mft record @m to @new_size bytes. - * If the value is made bigger, the newly "allocated" space is cleared. - * - * Return 0 on success and -1 on error with errno set to the error code. - * The following error codes are defined: - * ENOSPC - Not enough space in the mft record @m to perform the resize. - * Note that on error no modifications have been performed whatsoever. - */ -int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a, - const u32 new_size) -{ - int ret; - - ntfs_log_trace("Entering for new size %u.\n", (unsigned)new_size); - - /* Resize the resident part of the attribute record. */ - if ((ret = ntfs_attr_record_resize(m, a, (le16_to_cpu(a->value_offset) + - new_size + 7) & ~7)) < 0) - return ret; - /* - * If we made the attribute value bigger, clear the area between the - * old size and @new_size. - */ - if (new_size > le32_to_cpu(a->value_length)) - memset((u8*)a + le16_to_cpu(a->value_offset) + - le32_to_cpu(a->value_length), 0, new_size - - le32_to_cpu(a->value_length)); - /* Finally update the length of the attribute value. */ - a->value_length = cpu_to_le32(new_size); - return 0; -} - -/** - * ntfs_attr_record_move_to - move attribute record to target inode - * @ctx: attribute search context describing the attribute record - * @ni: opened ntfs inode to which move attribute record - * - * If this function succeed, user should reinit search context if he/she wants - * use it anymore. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attr_record_move_to(ntfs_attr_search_ctx *ctx, ntfs_inode *ni) -{ - ntfs_attr_search_ctx *nctx; - ATTR_RECORD *a; - int err; - - if (!ctx || !ctx->attr || !ctx->ntfs_ino || !ni) { - ntfs_log_trace("Invalid arguments passed.\n"); - errno = EINVAL; - return -1; - } - - ntfs_log_trace("Entering for ctx->attr->type 0x%x, ctx->ntfs_ino->mft_no " - "0x%llx, ni->mft_no 0x%llx.\n", - (unsigned) le32_to_cpu(ctx->attr->type), - (long long) ctx->ntfs_ino->mft_no, - (long long) ni->mft_no); - - if (ctx->ntfs_ino == ni) - return 0; - - if (!ctx->al_entry) { - ntfs_log_trace("Inode should contain attribute list to use this " - "function.\n"); - errno = EINVAL; - return -1; - } - - /* Find place in MFT record where attribute will be moved. */ - a = ctx->attr; - nctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!nctx) - return -1; - - /* - * Use ntfs_attr_find instead of ntfs_attr_lookup to find place for - * attribute in @ni->mrec, not any extent inode in case if @ni is base - * file record. - */ - if (!ntfs_attr_find(a->type, (ntfschar*)((u8*)a + le16_to_cpu( - a->name_offset)), a->name_length, CASE_SENSITIVE, NULL, - 0, nctx)) { - ntfs_log_trace("Attribute of such type, with same name already " - "present in this MFT record.\n"); - err = EEXIST; - goto put_err_out; - } - if (errno != ENOENT) { - err = errno; - ntfs_log_debug("Attribute lookup failed.\n"); - goto put_err_out; - } - - /* Make space and move attribute. */ - if (ntfs_make_room_for_attr(ni->mrec, (u8*) nctx->attr, - le32_to_cpu(a->length))) { - err = errno; - ntfs_log_trace("Couldn't make space for attribute.\n"); - goto put_err_out; - } - memcpy(nctx->attr, a, le32_to_cpu(a->length)); - nctx->attr->instance = nctx->mrec->next_attr_instance; - nctx->mrec->next_attr_instance = cpu_to_le16( - (le16_to_cpu(nctx->mrec->next_attr_instance) + 1) & 0xffff); - ntfs_attr_record_resize(ctx->mrec, a, 0); - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_inode_mark_dirty(ni); - - /* Update attribute list. */ - ctx->al_entry->mft_reference = - MK_LE_MREF(ni->mft_no, le16_to_cpu(ni->mrec->sequence_number)); - ctx->al_entry->instance = nctx->attr->instance; - ntfs_attrlist_mark_dirty(ni); - - ntfs_attr_put_search_ctx(nctx); - return 0; -put_err_out: - ntfs_attr_put_search_ctx(nctx); - errno = err; - return -1; -} - -/** - * ntfs_attr_record_move_away - move away attribute record from it's mft record - * @ctx: attribute search context describing the attribute record - * @extra: minimum amount of free space in the new holder of record - * - * New attribute record holder must have free @extra bytes after moving - * attribute record to it. - * - * If this function succeed, user should reinit search context if he/she wants - * use it anymore. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attr_record_move_away(ntfs_attr_search_ctx *ctx, int extra) -{ - ntfs_inode *base_ni, *ni; - MFT_RECORD *m; - int i; - - if (!ctx || !ctx->attr || !ctx->ntfs_ino || extra < 0) { - errno = EINVAL; - ntfs_log_perror("%s: ctx=%p ctx->attr=%p extra=%d", __FUNCTION__, - ctx, ctx ? ctx->attr : NULL, extra); - return -1; - } - - ntfs_log_trace("Entering for attr 0x%x, inode %llu\n", - (unsigned) le32_to_cpu(ctx->attr->type), - (unsigned long long)ctx->ntfs_ino->mft_no); - - if (ctx->ntfs_ino->nr_extents == -1) - base_ni = ctx->base_ntfs_ino; - else - base_ni = ctx->ntfs_ino; - - if (!NInoAttrList(base_ni)) { - errno = EINVAL; - ntfs_log_perror("Inode %llu has no attrlist", - (unsigned long long)base_ni->mft_no); - return -1; - } - - if (ntfs_inode_attach_all_extents(ctx->ntfs_ino)) { - ntfs_log_perror("Couldn't attach extents, inode=%llu", - (unsigned long long)base_ni->mft_no); - return -1; - } - - /* Walk through all extents and try to move attribute to them. */ - for (i = 0; i < base_ni->nr_extents; i++) { - ni = base_ni->extent_nis[i]; - m = ni->mrec; - - if (ctx->ntfs_ino->mft_no == ni->mft_no) - continue; - - if (le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use) < - le32_to_cpu(ctx->attr->length) + extra) - continue; - - /* - * ntfs_attr_record_move_to can fail if extent with other lowest - * VCN already present in inode we trying move record to. So, - * do not return error. - */ - if (!ntfs_attr_record_move_to(ctx, ni)) - return 0; - } - - /* - * Failed to move attribute to one of the current extents, so allocate - * new extent and move attribute to it. - */ - ni = ntfs_mft_record_alloc(base_ni->vol, base_ni); - if (!ni) { - ntfs_log_perror("Couldn't allocate MFT record"); - return -1; - } - if (ntfs_attr_record_move_to(ctx, ni)) { - ntfs_log_perror("Couldn't move attribute to MFT record"); - return -1; - } - return 0; -} - -/** - * ntfs_attr_make_non_resident - convert a resident to a non-resident attribute - * @na: open ntfs attribute to make non-resident - * @ctx: ntfs search context describing the attribute - * - * Convert a resident ntfs attribute to a non-resident one. - * - * Return 0 on success and -1 on error with errno set to the error code. The - * following error codes are defined: - * EPERM - The attribute is not allowed to be non-resident. - * TODO: others... - * - * NOTE to self: No changes in the attribute list are required to move from - * a resident to a non-resident attribute. - * - * Warning: We do not set the inode dirty and we do not write out anything! - * We expect the caller to do this as this is a fairly low level - * function and it is likely there will be further changes made. - */ -int ntfs_attr_make_non_resident(ntfs_attr *na, - ntfs_attr_search_ctx *ctx) -{ - s64 new_allocated_size, bw; - ntfs_volume *vol = na->ni->vol; - ATTR_REC *a = ctx->attr; - runlist *rl; - int mp_size, mp_ofs, name_ofs, arec_size, err; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long - long)na->ni->mft_no, na->type); - - /* Some preliminary sanity checking. */ - if (NAttrNonResident(na)) { - ntfs_log_trace("Eeek! Trying to make non-resident attribute " - "non-resident. Aborting...\n"); - errno = EINVAL; - return -1; - } - - /* Check that the attribute is allowed to be non-resident. */ - if (ntfs_attr_can_be_non_resident(vol, na->type)) - return -1; - - new_allocated_size = (le32_to_cpu(a->value_length) + vol->cluster_size - - 1) & ~(vol->cluster_size - 1); - - if (new_allocated_size > 0) { - /* Start by allocating clusters to hold the attribute value. */ - rl = ntfs_cluster_alloc(vol, 0, new_allocated_size >> - vol->cluster_size_bits, -1, DATA_ZONE); - if (!rl) - return -1; - } else - rl = NULL; - /* - * Setup the in-memory attribute structure to be non-resident so that - * we can use ntfs_attr_pwrite(). - */ - NAttrSetNonResident(na); - na->rl = rl; - na->allocated_size = new_allocated_size; - na->data_size = na->initialized_size = le32_to_cpu(a->value_length); - /* - * FIXME: For now just clear all of these as we don't support them when - * writing. - */ - NAttrClearSparse(na); - NAttrClearEncrypted(na); - if ((a->flags & ATTR_COMPRESSION_MASK) == ATTR_IS_COMPRESSED) { - /* set compression writing parameters */ - na->compression_block_size - = 1 << (STANDARD_COMPRESSION_UNIT + vol->cluster_size_bits); - na->compression_block_clusters = 1 << STANDARD_COMPRESSION_UNIT; - } - - if (rl) { - /* Now copy the attribute value to the allocated cluster(s). */ - bw = ntfs_attr_pwrite(na, 0, le32_to_cpu(a->value_length), - (u8*)a + le16_to_cpu(a->value_offset)); - if (bw != le32_to_cpu(a->value_length)) { - err = errno; - ntfs_log_debug("Eeek! Failed to write out attribute value " - "(bw = %lli, errno = %i). " - "Aborting...\n", (long long)bw, err); - if (bw >= 0) - err = EIO; - goto cluster_free_err_out; - } - } - /* Determine the size of the mapping pairs array. */ - mp_size = ntfs_get_size_for_mapping_pairs(vol, rl, 0, INT_MAX); - if (mp_size < 0) { - err = errno; - ntfs_log_debug("Eeek! Failed to get size for mapping pairs array. " - "Aborting...\n"); - goto cluster_free_err_out; - } - /* Calculate new offsets for the name and the mapping pairs array. */ - if (na->ni->flags & FILE_ATTR_COMPRESSED) - name_ofs = (sizeof(ATTR_REC) + 7) & ~7; - else - name_ofs = (sizeof(ATTR_REC) - sizeof(a->compressed_size) + 7) & ~7; - mp_ofs = (name_ofs + a->name_length * sizeof(ntfschar) + 7) & ~7; - /* - * Determine the size of the resident part of the non-resident - * attribute record. (Not compressed thus no compressed_size element - * present.) - */ - arec_size = (mp_ofs + mp_size + 7) & ~7; - - /* Resize the resident part of the attribute record. */ - if (ntfs_attr_record_resize(ctx->mrec, a, arec_size) < 0) { - err = errno; - goto cluster_free_err_out; - } - - /* - * Convert the resident part of the attribute record to describe a - * non-resident attribute. - */ - a->non_resident = 1; - - /* Move the attribute name if it exists and update the offset. */ - if (a->name_length) - memmove((u8*)a + name_ofs, (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - a->name_offset = cpu_to_le16(name_ofs); - - /* Setup the fields specific to non-resident attributes. */ - a->lowest_vcn = cpu_to_sle64(0); - a->highest_vcn = cpu_to_sle64((new_allocated_size - 1) >> - vol->cluster_size_bits); - - a->mapping_pairs_offset = cpu_to_le16(mp_ofs); - - /* - * Update the flags to match the in-memory ones. - * However cannot change the compression state if we had - * a fuse_file_info open with a mark for release. - * The decisions about compression can only be made when - * creating/recreating the stream, not when making non resident. - */ - a->flags &= ~(ATTR_IS_SPARSE | ATTR_IS_ENCRYPTED); - if ((a->flags & ATTR_COMPRESSION_MASK) == ATTR_IS_COMPRESSED) { - /* support only ATTR_IS_COMPRESSED compression mode */ - a->compression_unit = STANDARD_COMPRESSION_UNIT; - a->compressed_size = const_cpu_to_le64(0); - } else { - a->compression_unit = 0; - a->flags &= ~ATTR_COMPRESSION_MASK; - na->data_flags = a->flags; - } - - memset(&a->reserved1, 0, sizeof(a->reserved1)); - - a->allocated_size = cpu_to_sle64(new_allocated_size); - a->data_size = a->initialized_size = cpu_to_sle64(na->data_size); - - /* Generate the mapping pairs array in the attribute record. */ - if (ntfs_mapping_pairs_build(vol, (u8*)a + mp_ofs, arec_size - mp_ofs, - rl, 0, NULL) < 0) { - // FIXME: Eeek! We need rollback! (AIA) - ntfs_log_trace("Eeek! Failed to build mapping pairs. Leaving " - "corrupt attribute record on disk. In memory " - "runlist is still intact! Error code is %i. " - "FIXME: Need to rollback instead!\n", errno); - return -1; - } - - /* Done! */ - return 0; - -cluster_free_err_out: - if (rl && ntfs_cluster_free(vol, na, 0, -1) < 0) - ntfs_log_trace("Eeek! Failed to release allocated clusters in error " - "code path. Leaving inconsistent metadata...\n"); - NAttrClearNonResident(na); - na->allocated_size = na->data_size; - na->rl = NULL; - free(rl); - errno = err; - return -1; -} - - -static int ntfs_resident_attr_resize(ntfs_attr *na, const s64 newsize); - -/** - * ntfs_resident_attr_resize - resize a resident, open ntfs attribute - * @na: resident ntfs attribute to resize - * @newsize: new size (in bytes) to which to resize the attribute - * - * Change the size of a resident, open ntfs attribute @na to @newsize bytes. - * - * On success return 0 - * On error return values are: - * STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT - * STATUS_ERROR - otherwise - * The following error codes are defined: - * ENOMEM - Not enough memory to complete operation. - * ERANGE - @newsize is not valid for the attribute type of @na. - * ENOSPC - There is no enough space in base mft to resize $ATTRIBUTE_LIST. - */ -static int ntfs_resident_attr_resize_i(ntfs_attr *na, const s64 newsize) -{ - ntfs_attr_search_ctx *ctx; - ntfs_volume *vol; - ntfs_inode *ni; - int err, ret = STATUS_ERROR; - - ntfs_log_trace("Inode 0x%llx attr 0x%x new size %lld\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)newsize); - - /* Get the attribute record that needs modification. */ - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - if (ntfs_attr_lookup(na->type, na->name, na->name_len, 0, 0, NULL, 0, - ctx)) { - err = errno; - ntfs_log_perror("ntfs_attr_lookup failed"); - goto put_err_out; - } - vol = na->ni->vol; - /* - * Check the attribute type and the corresponding minimum and maximum - * sizes against @newsize and fail if @newsize is out of bounds. - */ - if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) { - err = errno; - if (err == ENOENT) - err = EIO; - ntfs_log_perror("%s: bounds check failed", __FUNCTION__); - goto put_err_out; - } - /* - * If @newsize is bigger than the mft record we need to make the - * attribute non-resident if the attribute type supports it. If it is - * smaller we can go ahead and attempt the resize. - */ - if (newsize < vol->mft_record_size) { - /* Perform the resize of the attribute record. */ - if (!(ret = ntfs_resident_attr_value_resize(ctx->mrec, ctx->attr, - newsize))) { - /* Update attribute size everywhere. */ - na->data_size = na->initialized_size = newsize; - na->allocated_size = (newsize + 7) & ~7; - if ((na->data_flags & ATTR_COMPRESSION_MASK) - || NAttrSparse(na)) - na->compressed_size = na->allocated_size; - if (na->type == AT_DATA && na->name == AT_UNNAMED) { - na->ni->data_size = na->data_size; - na->ni->allocated_size = na->allocated_size; - NInoFileNameSetDirty(na->ni); - } - goto resize_done; - } - /* Prefer AT_INDEX_ALLOCATION instead of AT_ATTRIBUTE_LIST */ - if (ret == STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT) { - err = errno; - goto put_err_out; - } - } - /* There is not enough space in the mft record to perform the resize. */ - - /* Make the attribute non-resident if possible. */ - if (!ntfs_attr_make_non_resident(na, ctx)) { - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - /* Resize non-resident attribute */ - return ntfs_attr_truncate(na, newsize); - } else if (errno != ENOSPC && errno != EPERM) { - err = errno; - ntfs_log_perror("Failed to make attribute non-resident"); - goto put_err_out; - } - - /* Try to make other attributes non-resident and retry each time. */ - ntfs_attr_init_search_ctx(ctx, NULL, na->ni->mrec); - while (!ntfs_attr_lookup(AT_UNUSED, NULL, 0, 0, 0, NULL, 0, ctx)) { - ntfs_attr *tna; - ATTR_RECORD *a; - - a = ctx->attr; - if (a->non_resident) - continue; - - /* - * Check out whether convert is reasonable. Assume that mapping - * pairs will take 8 bytes. - */ - if (le32_to_cpu(a->length) <= offsetof(ATTR_RECORD, - compressed_size) + ((a->name_length * - sizeof(ntfschar) + 7) & ~7) + 8) - continue; - - tna = ntfs_attr_open(na->ni, a->type, (ntfschar*)((u8*)a + - le16_to_cpu(a->name_offset)), a->name_length); - if (!tna) { - err = errno; - ntfs_log_perror("Couldn't open attribute"); - goto put_err_out; - } - if (ntfs_attr_make_non_resident(tna, ctx)) { - ntfs_attr_close(tna); - continue; - } - ntfs_inode_mark_dirty(tna->ni); - ntfs_attr_close(tna); - ntfs_attr_put_search_ctx(ctx); - return ntfs_resident_attr_resize(na, newsize); - } - /* Check whether error occurred. */ - if (errno != ENOENT) { - err = errno; - ntfs_log_perror("%s: Attribute lookup failed 1", __FUNCTION__); - goto put_err_out; - } - - /* - * The standard information and attribute list attributes can't be - * moved out from the base MFT record, so try to move out others. - */ - if (na->type==AT_STANDARD_INFORMATION || na->type==AT_ATTRIBUTE_LIST) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_free_space(na->ni, offsetof(ATTR_RECORD, - non_resident_end) + 8)) { - ntfs_log_perror("Could not free space in MFT record"); - return -1; - } - return ntfs_resident_attr_resize(na, newsize); - } - - /* - * Move the attribute to a new mft record, creating an attribute list - * attribute or modifying it if it is already present. - */ - - /* Point search context back to attribute which we need resize. */ - ntfs_attr_init_search_ctx(ctx, na->ni, NULL); - if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - ntfs_log_perror("%s: Attribute lookup failed 2", __FUNCTION__); - err = errno; - goto put_err_out; - } - - /* - * Check whether attribute is already single in this MFT record. - * 8 added for the attribute terminator. - */ - if (le32_to_cpu(ctx->mrec->bytes_in_use) == - le16_to_cpu(ctx->mrec->attrs_offset) + - le32_to_cpu(ctx->attr->length) + 8) { - err = ENOSPC; - ntfs_log_trace("MFT record is filled with one attribute\n"); - ret = STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT; - goto put_err_out; - } - - /* Add attribute list if not present. */ - if (na->ni->nr_extents == -1) - ni = na->ni->base_ni; - else - ni = na->ni; - if (!NInoAttrList(ni)) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_add_attrlist(ni)) - return -1; - return ntfs_resident_attr_resize(na, newsize); - } - /* Allocate new mft record. */ - ni = ntfs_mft_record_alloc(vol, ni); - if (!ni) { - err = errno; - ntfs_log_perror("Couldn't allocate new MFT record"); - goto put_err_out; - } - /* Move attribute to it. */ - if (ntfs_attr_record_move_to(ctx, ni)) { - err = errno; - ntfs_log_perror("Couldn't move attribute to new MFT record"); - goto put_err_out; - } - /* Update ntfs attribute. */ - if (na->ni->nr_extents == -1) - na->ni = ni; - - ntfs_attr_put_search_ctx(ctx); - /* Try to perform resize once again. */ - return ntfs_resident_attr_resize(na, newsize); - -resize_done: - /* - * Set the inode (and its base inode if it exists) dirty so it is - * written out later. - */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - return 0; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return ret; -} - -static int ntfs_resident_attr_resize(ntfs_attr *na, const s64 newsize) -{ - int ret; - - ntfs_log_enter("Entering\n"); - ret = ntfs_resident_attr_resize_i(na, newsize); - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_attr_make_resident - convert a non-resident to a resident attribute - * @na: open ntfs attribute to make resident - * @ctx: ntfs search context describing the attribute - * - * Convert a non-resident ntfs attribute to a resident one. - * - * Return 0 on success and -1 on error with errno set to the error code. The - * following error codes are defined: - * EINVAL - Invalid arguments passed. - * EPERM - The attribute is not allowed to be resident. - * EIO - I/O error, damaged inode or bug. - * ENOSPC - There is no enough space to perform conversion. - * EOPNOTSUPP - Requested conversion is not supported yet. - * - * Warning: We do not set the inode dirty and we do not write out anything! - * We expect the caller to do this as this is a fairly low level - * function and it is likely there will be further changes made. - */ -static int ntfs_attr_make_resident(ntfs_attr *na, ntfs_attr_search_ctx *ctx) -{ - ntfs_volume *vol = na->ni->vol; - ATTR_REC *a = ctx->attr; - int name_ofs, val_ofs, err = EIO; - s64 arec_size, bytes_read; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long - long)na->ni->mft_no, na->type); - - /* Should be called for the first extent of the attribute. */ - if (sle64_to_cpu(a->lowest_vcn)) { - ntfs_log_trace("Eeek! Should be called for the first extent of the " - "attribute. Aborting...\n"); - err = EINVAL; - return -1; - } - - /* Some preliminary sanity checking. */ - if (!NAttrNonResident(na)) { - ntfs_log_trace("Eeek! Trying to make resident attribute resident. " - "Aborting...\n"); - errno = EINVAL; - return -1; - } - - /* Make sure this is not $MFT/$BITMAP or Windows will not boot! */ - if (na->type == AT_BITMAP && na->ni->mft_no == FILE_MFT) { - errno = EPERM; - return -1; - } - - /* Check that the attribute is allowed to be resident. */ - if (ntfs_attr_can_be_resident(vol, na->type)) - return -1; - - if (na->data_flags & ATTR_IS_ENCRYPTED) { - ntfs_log_trace("Making encrypted streams resident is not " - "implemented yet.\n"); - errno = EOPNOTSUPP; - return -1; - } - - /* Work out offsets into and size of the resident attribute. */ - name_ofs = 24; /* = sizeof(resident_ATTR_REC); */ - val_ofs = (name_ofs + a->name_length * sizeof(ntfschar) + 7) & ~7; - arec_size = (val_ofs + na->data_size + 7) & ~7; - - /* Sanity check the size before we start modifying the attribute. */ - if (le32_to_cpu(ctx->mrec->bytes_in_use) - le32_to_cpu(a->length) + - arec_size > le32_to_cpu(ctx->mrec->bytes_allocated)) { - errno = ENOSPC; - ntfs_log_trace("Not enough space to make attribute resident\n"); - return -1; - } - - /* Read and cache the whole runlist if not already done. */ - if (ntfs_attr_map_whole_runlist(na)) - return -1; - - /* Move the attribute name if it exists and update the offset. */ - if (a->name_length) { - memmove((u8*)a + name_ofs, (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - } - a->name_offset = cpu_to_le16(name_ofs); - - /* Resize the resident part of the attribute record. */ - if (ntfs_attr_record_resize(ctx->mrec, a, arec_size) < 0) { - /* - * Bug, because ntfs_attr_record_resize should not fail (we - * already checked that attribute fits MFT record). - */ - ntfs_log_error("BUG! Failed to resize attribute record. " - "Please report to the %s. Aborting...\n", - NTFS_DEV_LIST); - errno = EIO; - return -1; - } - - /* Convert the attribute record to describe a resident attribute. */ - a->non_resident = 0; - a->flags = 0; - a->value_length = cpu_to_le32(na->data_size); - a->value_offset = cpu_to_le16(val_ofs); - /* - * If a data stream was wiped out, adjust the compression mode - * to current state of compression flag - */ - if (!na->data_size - && (na->type == AT_DATA) - && (na->ni->flags & FILE_ATTR_COMPRESSED)) { - a->flags |= ATTR_IS_COMPRESSED; - na->data_flags = a->flags; - } - /* - * File names cannot be non-resident so we would never see this here - * but at least it serves as a reminder that there may be attributes - * for which we do need to set this flag. (AIA) - */ - if (a->type == AT_FILE_NAME) - a->resident_flags = RESIDENT_ATTR_IS_INDEXED; - else - a->resident_flags = 0; - a->reservedR = 0; - - /* Sanity fixup... Shouldn't really happen. (AIA) */ - if (na->initialized_size > na->data_size) - na->initialized_size = na->data_size; - - /* Copy data from run list to resident attribute value. */ - bytes_read = ntfs_rl_pread(vol, na->rl, 0, na->initialized_size, - (u8*)a + val_ofs); - if (bytes_read != na->initialized_size) { - if (bytes_read < 0) - err = errno; - ntfs_log_trace("Eeek! Failed to read attribute data. Leaving " - "inconstant metadata. Run chkdsk. " - "Aborting...\n"); - errno = err; - return -1; - } - - /* Clear memory in gap between initialized_size and data_size. */ - if (na->initialized_size < na->data_size) - memset((u8*)a + val_ofs + na->initialized_size, 0, - na->data_size - na->initialized_size); - - /* - * Deallocate clusters from the runlist. - * - * NOTE: We can use ntfs_cluster_free() because we have already mapped - * the whole run list and thus it doesn't matter that the attribute - * record is in a transiently corrupted state at this moment in time. - */ - if (ntfs_cluster_free(vol, na, 0, -1) < 0) { - err = errno; - ntfs_log_perror("Eeek! Failed to release allocated clusters"); - ntfs_log_trace("Ignoring error and leaving behind wasted " - "clusters.\n"); - } - - /* Throw away the now unused runlist. */ - free(na->rl); - na->rl = NULL; - - /* Update in-memory struct ntfs_attr. */ - NAttrClearNonResident(na); - NAttrClearSparse(na); - NAttrClearEncrypted(na); - na->initialized_size = na->data_size; - na->allocated_size = na->compressed_size = (na->data_size + 7) & ~7; - na->compression_block_size = 0; - na->compression_block_size_bits = na->compression_block_clusters = 0; - return 0; -} - -/* - * If we are in the first extent, then set/clean sparse bit, - * update allocated and compressed size. - */ -static int ntfs_attr_update_meta(ATTR_RECORD *a, ntfs_attr *na, MFT_RECORD *m, - ntfs_attr_search_ctx *ctx) -{ - int sparse, ret = 0; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x\n", - (unsigned long long)na->ni->mft_no, na->type); - - if (a->lowest_vcn) - goto out; - - a->allocated_size = cpu_to_sle64(na->allocated_size); - - /* Update sparse bit. */ - sparse = ntfs_rl_sparse(na->rl); - if (sparse == -1) { - errno = EIO; - goto error; - } - - /* Attribute become sparse. */ - if (sparse && !(a->flags & (ATTR_IS_SPARSE | ATTR_IS_COMPRESSED))) { - /* - * Move attribute to another mft record, if attribute is too - * small to add compressed_size field to it and we have no - * free space in the current mft record. - */ - if ((le32_to_cpu(a->length) - - le16_to_cpu(a->mapping_pairs_offset) == 8) - && !(le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use))) { - - if (!NInoAttrList(na->ni)) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_add_attrlist(na->ni)) - goto leave; - goto retry; - } - if (ntfs_attr_record_move_away(ctx, 8)) { - ntfs_log_perror("Failed to move attribute"); - goto error; - } - ntfs_attr_put_search_ctx(ctx); - goto retry; - } - if (!(le32_to_cpu(a->length) - le16_to_cpu( - a->mapping_pairs_offset))) { - errno = EIO; - ntfs_log_perror("Mapping pairs space is 0"); - goto error; - } - - NAttrSetSparse(na); - a->flags |= ATTR_IS_SPARSE; - a->compression_unit = STANDARD_COMPRESSION_UNIT; /* Windows - set it so, even if attribute is not actually compressed. */ - - memmove((u8*)a + le16_to_cpu(a->name_offset) + 8, - (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - - a->name_offset = cpu_to_le16(le16_to_cpu(a->name_offset) + 8); - - a->mapping_pairs_offset = - cpu_to_le16(le16_to_cpu(a->mapping_pairs_offset) + 8); - } - - /* Attribute no longer sparse. */ - if (!sparse && (a->flags & ATTR_IS_SPARSE) && - !(a->flags & ATTR_IS_COMPRESSED)) { - - NAttrClearSparse(na); - a->flags &= ~ATTR_IS_SPARSE; - a->compression_unit = 0; - - memmove((u8*)a + le16_to_cpu(a->name_offset) - 8, - (u8*)a + le16_to_cpu(a->name_offset), - a->name_length * sizeof(ntfschar)); - - if (le16_to_cpu(a->name_offset) >= 8) - a->name_offset = cpu_to_le16(le16_to_cpu(a->name_offset) - 8); - - a->mapping_pairs_offset = - cpu_to_le16(le16_to_cpu(a->mapping_pairs_offset) - 8); - } - - /* Update compressed size if required. */ - if (sparse || (na->data_flags & ATTR_COMPRESSION_MASK)) { - s64 new_compr_size; - - new_compr_size = ntfs_rl_get_compressed_size(na->ni->vol, na->rl); - if (new_compr_size == -1) - goto error; - - na->compressed_size = new_compr_size; - a->compressed_size = cpu_to_sle64(new_compr_size); - } - /* - * Set FILE_NAME dirty flag, to update sparse bit and - * allocated size in the index. - */ - if (na->type == AT_DATA && na->name == AT_UNNAMED) { - if (sparse) - na->ni->allocated_size = na->compressed_size; - else - na->ni->allocated_size = na->allocated_size; - NInoFileNameSetDirty(na->ni); - } -out: - return ret; -leave: ret = -1; goto out; /* return -1 */ -retry: ret = -2; goto out; -error: ret = -3; goto out; -} - -#define NTFS_VCN_DELETE_MARK -2 -/** - * ntfs_attr_update_mapping_pairs_i - see ntfs_attr_update_mapping_pairs - */ -static int ntfs_attr_update_mapping_pairs_i(ntfs_attr *na, VCN from_vcn) -{ - ntfs_attr_search_ctx *ctx; - ntfs_inode *ni, *base_ni; - MFT_RECORD *m; - ATTR_RECORD *a; - VCN stop_vcn; - const runlist_element *stop_rl; - int err, mp_size, cur_max_mp_size, exp_max_mp_size, ret = -1; - BOOL finished_build; - -retry: - if (!na || !na->rl || from_vcn) { - errno = EINVAL; - ntfs_log_perror("%s: na=%p", __FUNCTION__, na); - return -1; - } - - ntfs_log_trace("Entering for inode %llu, attr 0x%x\n", - (unsigned long long)na->ni->mft_no, na->type); - - if (!NAttrNonResident(na)) { - errno = EINVAL; - ntfs_log_perror("%s: resident attribute", __FUNCTION__); - return -1; - } - - if (na->ni->nr_extents == -1) - base_ni = na->ni->base_ni; - else - base_ni = na->ni; - - ctx = ntfs_attr_get_search_ctx(base_ni, NULL); - if (!ctx) - return -1; - - /* Fill attribute records with new mapping pairs. */ - stop_vcn = 0; - stop_rl = na->rl; - finished_build = FALSE; - while (!ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, from_vcn, NULL, 0, ctx)) { - a = ctx->attr; - m = ctx->mrec; - /* - * If runlist is updating not from the beginning, then set - * @stop_vcn properly, i.e. to the lowest vcn of record that - * contain @from_vcn. Also we do not need @from_vcn anymore, - * set it to 0 to make ntfs_attr_lookup enumerate attributes. - */ - if (from_vcn) { - LCN first_lcn; - - stop_vcn = sle64_to_cpu(a->lowest_vcn); - from_vcn = 0; - /* - * Check whether the first run we need to update is - * the last run in runlist, if so, then deallocate - * all attrubute extents starting this one. - */ - first_lcn = ntfs_rl_vcn_to_lcn(na->rl, stop_vcn); - if (first_lcn == LCN_EINVAL) { - errno = EIO; - ntfs_log_perror("Bad runlist"); - goto put_err_out; - } - if (first_lcn == LCN_ENOENT || - first_lcn == LCN_RL_NOT_MAPPED) - finished_build = TRUE; - } - - /* - * Check whether we finished mapping pairs build, if so mark - * extent as need to delete (by setting highest vcn to - * NTFS_VCN_DELETE_MARK (-2), we shall check it later and - * delete extent) and continue search. - */ - if (finished_build) { - ntfs_log_trace("Mark attr 0x%x for delete in inode " - "%lld.\n", (unsigned)le32_to_cpu(a->type), - (long long)ctx->ntfs_ino->mft_no); - a->highest_vcn = cpu_to_sle64(NTFS_VCN_DELETE_MARK); - ntfs_inode_mark_dirty(ctx->ntfs_ino); - continue; - } - - switch (ntfs_attr_update_meta(a, na, m, ctx)) { - case -1: return -1; - case -2: goto retry; - case -3: goto put_err_out; - } - - /* - * Determine maximum possible length of mapping pairs, - * if we shall *not* expand space for mapping pairs. - */ - cur_max_mp_size = le32_to_cpu(a->length) - - le16_to_cpu(a->mapping_pairs_offset); - /* - * Determine maximum possible length of mapping pairs in the - * current mft record, if we shall expand space for mapping - * pairs. - */ - exp_max_mp_size = le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use) + cur_max_mp_size; - /* Get the size for the rest of mapping pairs array. */ - mp_size = ntfs_get_size_for_mapping_pairs(na->ni->vol, stop_rl, - stop_vcn, exp_max_mp_size); - if (mp_size <= 0) { - ntfs_log_perror("%s: get MP size failed", __FUNCTION__); - goto put_err_out; - } - /* Test mapping pairs for fitting in the current mft record. */ - if (mp_size > exp_max_mp_size) { - /* - * Mapping pairs of $ATTRIBUTE_LIST attribute must fit - * in the base mft record. Try to move out other - * attributes and try again. - */ - if (na->type == AT_ATTRIBUTE_LIST) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_free_space(na->ni, mp_size - - cur_max_mp_size)) { - ntfs_log_perror("Attribute list is too " - "big. Defragment the " - "volume\n"); - return -1; - } - goto retry; - } - - /* Add attribute list if it isn't present, and retry. */ - if (!NInoAttrList(base_ni)) { - ntfs_attr_put_search_ctx(ctx); - if (ntfs_inode_add_attrlist(base_ni)) { - ntfs_log_perror("Can not add attrlist"); - return -1; - } - goto retry; - } - - /* - * Set mapping pairs size to maximum possible for this - * mft record. We shall write the rest of mapping pairs - * to another MFT records. - */ - mp_size = exp_max_mp_size; - } - - /* Change space for mapping pairs if we need it. */ - if (((mp_size + 7) & ~7) != cur_max_mp_size) { - if (ntfs_attr_record_resize(m, a, - le16_to_cpu(a->mapping_pairs_offset) + - mp_size)) { - errno = EIO; - ntfs_log_perror("Failed to resize attribute"); - goto put_err_out; - } - } - - /* Update lowest vcn. */ - a->lowest_vcn = cpu_to_sle64(stop_vcn); - ntfs_inode_mark_dirty(ctx->ntfs_ino); - if ((ctx->ntfs_ino->nr_extents == -1 || - NInoAttrList(ctx->ntfs_ino)) && - ctx->attr->type != AT_ATTRIBUTE_LIST) { - ctx->al_entry->lowest_vcn = cpu_to_sle64(stop_vcn); - ntfs_attrlist_mark_dirty(ctx->ntfs_ino); - } - - /* - * Generate the new mapping pairs array directly into the - * correct destination, i.e. the attribute record itself. - */ - if (!ntfs_mapping_pairs_build(na->ni->vol, (u8*)a + le16_to_cpu( - a->mapping_pairs_offset), mp_size, na->rl, - stop_vcn, &stop_rl)) - finished_build = TRUE; - if (stop_rl) - stop_vcn = stop_rl->vcn; - else - stop_vcn = 0; - if (!finished_build && errno != ENOSPC) { - ntfs_log_perror("Failed to build mapping pairs"); - goto put_err_out; - } - a->highest_vcn = cpu_to_sle64(stop_vcn - 1); - } - /* Check whether error occurred. */ - if (errno != ENOENT) { - ntfs_log_perror("%s: Attribute lookup failed", __FUNCTION__); - goto put_err_out; - } - - /* Deallocate not used attribute extents and return with success. */ - if (finished_build) { - ntfs_attr_reinit_search_ctx(ctx); - ntfs_log_trace("Deallocate marked extents.\n"); - while (!ntfs_attr_lookup(na->type, na->name, na->name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (sle64_to_cpu(ctx->attr->highest_vcn) != - NTFS_VCN_DELETE_MARK) - continue; - /* Remove unused attribute record. */ - if (ntfs_attr_record_rm(ctx)) { - ntfs_log_perror("Could not remove unused attr"); - goto put_err_out; - } - ntfs_attr_reinit_search_ctx(ctx); - } - if (errno != ENOENT) { - ntfs_log_perror("%s: Attr lookup failed", __FUNCTION__); - goto put_err_out; - } - ntfs_log_trace("Deallocate done.\n"); - ntfs_attr_put_search_ctx(ctx); - goto ok; - } - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - - /* Allocate new MFT records for the rest of mapping pairs. */ - while (1) { - /* Calculate size of rest mapping pairs. */ - mp_size = ntfs_get_size_for_mapping_pairs(na->ni->vol, - na->rl, stop_vcn, INT_MAX); - if (mp_size <= 0) { - ntfs_log_perror("%s: get mp size failed", __FUNCTION__); - goto put_err_out; - } - /* Allocate new mft record. */ - ni = ntfs_mft_record_alloc(na->ni->vol, base_ni); - if (!ni) { - ntfs_log_perror("Could not allocate new MFT record"); - goto put_err_out; - } - m = ni->mrec; - /* - * If mapping size exceed available space, set them to - * possible maximum. - */ - cur_max_mp_size = le32_to_cpu(m->bytes_allocated) - - le32_to_cpu(m->bytes_in_use) - - (offsetof(ATTR_RECORD, compressed_size) + - (((na->data_flags & ATTR_COMPRESSION_MASK) - || NAttrSparse(na)) ? - sizeof(a->compressed_size) : 0)) - - ((sizeof(ntfschar) * na->name_len + 7) & ~7); - if (mp_size > cur_max_mp_size) - mp_size = cur_max_mp_size; - /* Add attribute extent to new record. */ - err = ntfs_non_resident_attr_record_add(ni, na->type, - na->name, na->name_len, stop_vcn, mp_size, - na->data_flags); - if (err == -1) { - err = errno; - ntfs_log_perror("Could not add attribute extent"); - if (ntfs_mft_record_free(na->ni->vol, ni)) - ntfs_log_perror("Could not free MFT record"); - errno = err; - goto put_err_out; - } - a = (ATTR_RECORD*)((u8*)m + err); - - err = ntfs_mapping_pairs_build(na->ni->vol, (u8*)a + - le16_to_cpu(a->mapping_pairs_offset), mp_size, na->rl, - stop_vcn, &stop_rl); - if (stop_rl) - stop_vcn = stop_rl->vcn; - else - stop_vcn = 0; - if (err < 0 && errno != ENOSPC) { - err = errno; - ntfs_log_perror("Failed to build MP"); - if (ntfs_mft_record_free(na->ni->vol, ni)) - ntfs_log_perror("Couldn't free MFT record"); - errno = err; - goto put_err_out; - } - a->highest_vcn = cpu_to_sle64(stop_vcn - 1); - ntfs_inode_mark_dirty(ni); - /* All mapping pairs has been written. */ - if (!err) - break; - } -ok: - ret = 0; -out: - return ret; -put_err_out: - if (ctx) - ntfs_attr_put_search_ctx(ctx); - goto out; -} -#undef NTFS_VCN_DELETE_MARK - -/** - * ntfs_attr_update_mapping_pairs - update mapping pairs for ntfs attribute - * @na: non-resident ntfs open attribute for which we need update - * @from_vcn: update runlist starting this VCN - * - * Build mapping pairs from @na->rl and write them to the disk. Also, this - * function updates sparse bit, allocated and compressed size (allocates/frees - * space for this field if required). - * - * @na->allocated_size should be set to correct value for the new runlist before - * call to this function. Vice-versa @na->compressed_size will be calculated and - * set to correct value during this function. - * - * FIXME: This function does not update sparse bit and compressed size correctly - * if called with @from_vcn != 0. - * - * FIXME: Rewrite without using NTFS_VCN_DELETE_MARK define. - * - * On success return 0 and on error return -1 with errno set to the error code. - * The following error codes are defined: - * EINVAL - Invalid arguments passed. - * ENOMEM - Not enough memory to complete operation. - * ENOSPC - There is no enough space in base mft to resize $ATTRIBUTE_LIST - * or there is no free MFT records left to allocate. - */ -int ntfs_attr_update_mapping_pairs(ntfs_attr *na, VCN from_vcn) -{ - int ret; - - ntfs_log_enter("Entering\n"); - ret = ntfs_attr_update_mapping_pairs_i(na, from_vcn); - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_non_resident_attr_shrink - shrink a non-resident, open ntfs attribute - * @na: non-resident ntfs attribute to shrink - * @newsize: new size (in bytes) to which to shrink the attribute - * - * Reduce the size of a non-resident, open ntfs attribute @na to @newsize bytes. - * - * On success return 0 and on error return -1 with errno set to the error code. - * The following error codes are defined: - * ENOMEM - Not enough memory to complete operation. - * ERANGE - @newsize is not valid for the attribute type of @na. - */ -static int ntfs_non_resident_attr_shrink(ntfs_attr *na, const s64 newsize) -{ - ntfs_volume *vol; - ntfs_attr_search_ctx *ctx; - VCN first_free_vcn; - s64 nr_freed_clusters; - int err; - - ntfs_log_trace("Inode 0x%llx attr 0x%x new size %lld\n", (unsigned long long) - na->ni->mft_no, na->type, (long long)newsize); - - vol = na->ni->vol; - - /* - * Check the attribute type and the corresponding minimum size - * against @newsize and fail if @newsize is too small. - */ - if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) { - if (errno == ERANGE) { - ntfs_log_trace("Eeek! Size bounds check failed. " - "Aborting...\n"); - } else if (errno == ENOENT) - errno = EIO; - return -1; - } - - /* The first cluster outside the new allocation. */ - first_free_vcn = (newsize + vol->cluster_size - 1) >> - vol->cluster_size_bits; - /* - * Compare the new allocation with the old one and only deallocate - * clusters if there is a change. - */ - if ((na->allocated_size >> vol->cluster_size_bits) != first_free_vcn) { - if (ntfs_attr_map_whole_runlist(na)) { - ntfs_log_trace("Eeek! ntfs_attr_map_whole_runlist " - "failed.\n"); - return -1; - } - /* Deallocate all clusters starting with the first free one. */ - nr_freed_clusters = ntfs_cluster_free(vol, na, first_free_vcn, - -1); - if (nr_freed_clusters < 0) { - ntfs_log_trace("Eeek! Freeing of clusters failed. " - "Aborting...\n"); - return -1; - } - - /* Truncate the runlist itself. */ - if (ntfs_rl_truncate(&na->rl, first_free_vcn)) { - /* - * Failed to truncate the runlist, so just throw it - * away, it will be mapped afresh on next use. - */ - free(na->rl); - na->rl = NULL; - ntfs_log_trace("Eeek! Run list truncation failed.\n"); - return -1; - } - - /* Prepare to mapping pairs update. */ - na->allocated_size = first_free_vcn << vol->cluster_size_bits; - /* Write mapping pairs for new runlist. */ - if (ntfs_attr_update_mapping_pairs(na, 0 /*first_free_vcn*/)) { - ntfs_log_trace("Eeek! Mapping pairs update failed. " - "Leaving inconstant metadata. " - "Run chkdsk.\n"); - return -1; - } - } - - /* Get the first attribute record. */ - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) - return -1; - - if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - err = errno; - if (err == ENOENT) - err = EIO; - ntfs_log_trace("Eeek! Lookup of first attribute extent failed. " - "Leaving inconstant metadata.\n"); - goto put_err_out; - } - - /* Update data and initialized size. */ - na->data_size = newsize; - ctx->attr->data_size = cpu_to_sle64(newsize); - if (newsize < na->initialized_size) { - na->initialized_size = newsize; - ctx->attr->initialized_size = cpu_to_sle64(newsize); - } - /* Update data size in the index. */ - if (na->type == AT_DATA && na->name == AT_UNNAMED) { - na->ni->data_size = na->data_size; - NInoFileNameSetDirty(na->ni); - } - - /* If the attribute now has zero size, make it resident. */ - if (!newsize) { - if (ntfs_attr_make_resident(na, ctx)) { - /* If couldn't make resident, just continue. */ - if (errno != EPERM) - ntfs_log_error("Failed to make attribute " - "resident. Leaving as is...\n"); - } - } - - /* Set the inode dirty so it is written out later. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - /* Done! */ - ntfs_attr_put_search_ctx(ctx); - return 0; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - -/** - * ntfs_non_resident_attr_expand - expand a non-resident, open ntfs attribute - * @na: non-resident ntfs attribute to expand - * @newsize: new size (in bytes) to which to expand the attribute - * - * Expand the size of a non-resident, open ntfs attribute @na to @newsize bytes, - * by allocating new clusters. - * - * On success return 0 and on error return -1 with errno set to the error code. - * The following error codes are defined: - * ENOMEM - Not enough memory to complete operation. - * ERANGE - @newsize is not valid for the attribute type of @na. - * ENOSPC - There is no enough space in base mft to resize $ATTRIBUTE_LIST. - */ -static int ntfs_non_resident_attr_expand_i(ntfs_attr *na, const s64 newsize) -{ - LCN lcn_seek_from; - VCN first_free_vcn; - ntfs_volume *vol; - ntfs_attr_search_ctx *ctx; - runlist *rl, *rln; - s64 org_alloc_size; - int err; - - ntfs_log_trace("Inode %lld, attr 0x%x, new size %lld old size %lld\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)newsize, (long long)na->data_size); - - vol = na->ni->vol; - - /* - * Check the attribute type and the corresponding maximum size - * against @newsize and fail if @newsize is too big. - */ - if (ntfs_attr_size_bounds_check(vol, na->type, newsize) < 0) { - if (errno == ENOENT) - errno = EIO; - ntfs_log_perror("%s: bounds check failed", __FUNCTION__); - return -1; - } - - /* Save for future use. */ - org_alloc_size = na->allocated_size; - /* The first cluster outside the new allocation. */ - first_free_vcn = (newsize + vol->cluster_size - 1) >> - vol->cluster_size_bits; - /* - * Compare the new allocation with the old one and only allocate - * clusters if there is a change. - */ - if ((na->allocated_size >> vol->cluster_size_bits) < first_free_vcn) { - if (ntfs_attr_map_whole_runlist(na)) { - ntfs_log_perror("ntfs_attr_map_whole_runlist failed"); - return -1; - } - - /* - * If we extend $DATA attribute on NTFS 3+ volume, we can add - * sparse runs instead of real allocation of clusters. - */ - if (na->type == AT_DATA && vol->major_ver >= 3) { - rl = ntfs_malloc(0x1000); - if (!rl) - return -1; - - rl[0].vcn = (na->allocated_size >> - vol->cluster_size_bits); - rl[0].lcn = LCN_HOLE; - rl[0].length = first_free_vcn - - (na->allocated_size >> vol->cluster_size_bits); - rl[1].vcn = first_free_vcn; - rl[1].lcn = LCN_ENOENT; - rl[1].length = 0; - } else { - /* - * Determine first after last LCN of attribute. - * We will start seek clusters from this LCN to avoid - * fragmentation. If there are no valid LCNs in the - * attribute let the cluster allocator choose the - * starting LCN. - */ - lcn_seek_from = -1; - if (na->rl->length) { - /* Seek to the last run list element. */ - for (rl = na->rl; (rl + 1)->length; rl++) - ; - /* - * If the last LCN is a hole or similar seek - * back to last valid LCN. - */ - while (rl->lcn < 0 && rl != na->rl) - rl--; - /* - * Only set lcn_seek_from it the LCN is valid. - */ - if (rl->lcn >= 0) - lcn_seek_from = rl->lcn + rl->length; - } - - rl = ntfs_cluster_alloc(vol, na->allocated_size >> - vol->cluster_size_bits, first_free_vcn - - (na->allocated_size >> - vol->cluster_size_bits), lcn_seek_from, - DATA_ZONE); - if (!rl) { - ntfs_log_perror("Cluster allocation failed " - "(%lld)", - (long long)first_free_vcn - - ((long long)na->allocated_size >> - vol->cluster_size_bits)); - return -1; - } - } - - /* Append new clusters to attribute runlist. */ - rln = ntfs_runlists_merge(na->rl, rl); - if (!rln) { - /* Failed, free just allocated clusters. */ - err = errno; - ntfs_log_perror("Run list merge failed"); - ntfs_cluster_free_from_rl(vol, rl); - free(rl); - errno = err; - return -1; - } - na->rl = rln; - - /* Prepare to mapping pairs update. */ - na->allocated_size = first_free_vcn << vol->cluster_size_bits; - /* Write mapping pairs for new runlist. */ - if (ntfs_attr_update_mapping_pairs(na, 0 /*na->allocated_size >> - vol->cluster_size_bits*/)) { - err = errno; - ntfs_log_perror("Mapping pairs update failed"); - goto rollback; - } - } - - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) { - err = errno; - if (na->allocated_size == org_alloc_size) { - errno = err; - return -1; - } else - goto rollback; - } - - if (ntfs_attr_lookup(na->type, na->name, na->name_len, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - err = errno; - ntfs_log_perror("Lookup of first attribute extent failed"); - if (err == ENOENT) - err = EIO; - if (na->allocated_size != org_alloc_size) { - ntfs_attr_put_search_ctx(ctx); - goto rollback; - } else - goto put_err_out; - } - - /* Update data size. */ - na->data_size = newsize; - ctx->attr->data_size = cpu_to_sle64(newsize); - /* Update data size in the index. */ - if (na->type == AT_DATA && na->name == AT_UNNAMED) { - na->ni->data_size = na->data_size; - NInoFileNameSetDirty(na->ni); - } - /* Set the inode dirty so it is written out later. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - /* Done! */ - ntfs_attr_put_search_ctx(ctx); - return 0; -rollback: - /* Free allocated clusters. */ - if (ntfs_cluster_free(vol, na, org_alloc_size >> - vol->cluster_size_bits, -1) < 0) { - err = EIO; - ntfs_log_perror("Leaking clusters"); - } - /* Now, truncate the runlist itself. */ - if (ntfs_rl_truncate(&na->rl, org_alloc_size >> - vol->cluster_size_bits)) { - /* - * Failed to truncate the runlist, so just throw it away, it - * will be mapped afresh on next use. - */ - free(na->rl); - na->rl = NULL; - ntfs_log_perror("Couldn't truncate runlist. Rollback failed"); - } else { - /* Prepare to mapping pairs update. */ - na->allocated_size = org_alloc_size; - /* Restore mapping pairs. */ - if (ntfs_attr_update_mapping_pairs(na, 0 /*na->allocated_size >> - vol->cluster_size_bits*/)) { - ntfs_log_perror("Failed to restore old mapping pairs"); - } - } - errno = err; - return -1; -put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - - -static int ntfs_non_resident_attr_expand(ntfs_attr *na, const s64 newsize) -{ - int ret; - - ntfs_log_enter("Entering\n"); - ret = ntfs_non_resident_attr_expand_i(na, newsize); - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_attr_truncate - resize an ntfs attribute - * @na: open ntfs attribute to resize - * @newsize: new size (in bytes) to which to resize the attribute - * - * Change the size of an open ntfs attribute @na to @newsize bytes. If the - * attribute is made bigger and the attribute is resident the newly - * "allocated" space is cleared and if the attribute is non-resident the - * newly allocated space is marked as not initialised and no real allocation - * on disk is performed. - * - * On success return 0. - * On error return values are: - * STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT - * STATUS_ERROR - otherwise - * The following error codes are defined: - * EINVAL - Invalid arguments were passed to the function. - * EOPNOTSUPP - The desired resize is not implemented yet. - * EACCES - Encrypted attribute. - */ -int ntfs_attr_truncate(ntfs_attr *na, const s64 newsize) -{ - int ret = STATUS_ERROR; - s64 fullsize; - BOOL compressed; - - if (!na || newsize < 0 || - (na->ni->mft_no == FILE_MFT && na->type == AT_DATA)) { - ntfs_log_trace("Invalid arguments passed.\n"); - errno = EINVAL; - return STATUS_ERROR; - } - - ntfs_log_enter("Entering for inode %lld, attr 0x%x, size %lld\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)newsize); - - if (na->data_size == newsize) { - ntfs_log_trace("Size is already ok\n"); - ret = STATUS_OK; - goto out; - } - /* - * Encrypted attributes are not supported. We return access denied, - * which is what Windows NT4 does, too. - */ - if (na->data_flags & ATTR_IS_ENCRYPTED) { - errno = EACCES; - ntfs_log_info("Failed to truncate encrypted attribute"); - goto out; - } - /* - * TODO: Implement making handling of compressed attributes. - * Currently we can only expand the attribute or delete it, - * and only for ATTR_IS_COMPRESSED. This is however possible - * for resident attributes when there is no open fuse context - * (important case : $INDEX_ROOT:$I30) - */ - compressed = (na->data_flags & ATTR_COMPRESSION_MASK) - != const_cpu_to_le16(0); - if (compressed - && NAttrNonResident(na) - && (((na->data_flags & ATTR_COMPRESSION_MASK) != ATTR_IS_COMPRESSED) - || (newsize && (newsize < na->data_size)))) { - errno = EOPNOTSUPP; - ntfs_log_perror("Failed to truncate compressed attribute"); - goto out; - } - if (NAttrNonResident(na)) { - /* - * For compressed data, the last block must be fully - * allocated, and we do not known the size of compression - * block until the attribute has been made non-resident. - * Moreover we can only process a single compression - * block at a time (from where we are about to write), - * so we silently do not allocate more. - * - * Note : do not request truncate on compressed files - * unless being able to face the consequences ! - */ - if (compressed && newsize) - fullsize = (na->initialized_size - | (na->compression_block_size - 1)) + 1; - else - fullsize = newsize; - if (fullsize > na->data_size) - ret = ntfs_non_resident_attr_expand(na, fullsize); - else - ret = ntfs_non_resident_attr_shrink(na, fullsize); - } else - ret = ntfs_resident_attr_resize(na, newsize); -out: - ntfs_log_leave("Return status %d\n", ret); - return ret; -} - -/* - * Stuff a hole in a compressed file - * - * An unallocated hole must be aligned on compression block size. - * If needed current block and target block are stuffed with zeroes. - * - * Returns 0 if succeeded, - * -1 if it failed (as explained in errno) - */ - -static int stuff_hole(ntfs_attr *na, const s64 pos) -{ - s64 size; - s64 begin_size; - s64 end_size; - char *buf; - int ret; - - ret = 0; - /* - * If the attribute is resident, the compression block size - * is not defined yet and we can make no decision. - * So we first try resizing to the target and if the - * attribute is still resident, we're done - */ - if (!NAttrNonResident(na)) { - ret = ntfs_resident_attr_resize(na, pos); - if (!ret && !NAttrNonResident(na)) - na->initialized_size = na->data_size = pos; - } - if (!ret && NAttrNonResident(na)) { - /* does the hole span over several compression block ? */ - if ((pos ^ na->initialized_size) - & ~(na->compression_block_size - 1)) { - begin_size = ((na->initialized_size - 1) - | (na->compression_block_size - 1)) - + 1 - na->initialized_size; - end_size = pos & (na->compression_block_size - 1); - size = (begin_size > end_size ? begin_size : end_size); - } else { - /* short stuffing in a single compression block */ - begin_size = size = pos - na->initialized_size; - end_size = 0; - } - if (size) - buf = (char*)ntfs_malloc(size); - else - buf = (char*)NULL; - if (buf || !size) { - memset(buf,0,size); - /* stuff into current block */ - if (begin_size - && (ntfs_attr_pwrite(na, - na->initialized_size, begin_size, buf) - != begin_size)) - ret = -1; - /* create an unstuffed hole */ - if (!ret - && ((na->initialized_size + end_size) < pos) - && ntfs_non_resident_attr_expand(na, - pos - end_size)) - ret = -1; - else - na->initialized_size - = na->data_size = pos - end_size; - /* stuff into the target block */ - if (!ret && end_size - && (ntfs_attr_pwrite(na, - na->initialized_size, end_size, buf) - != end_size)) - ret = -1; - if (buf) - free(buf); - } else - ret = -1; - } - /* make absolutely sure we have reached the target */ - if (!ret && (na->initialized_size != pos)) { - ntfs_log_error("Failed to stuff a compressed file" - "target %lld reached %lld\n", - (long long)pos, (long long)na->initialized_size); - errno = EIO; - ret = -1; - } - return (ret); -} - -/** - * ntfs_attr_readall - read the entire data from an ntfs attribute - * @ni: open ntfs inode in which the ntfs attribute resides - * @type: attribute type - * @name: attribute name in little endian Unicode or AT_UNNAMED or NULL - * @name_len: length of attribute @name in Unicode characters (if @name given) - * @data_size: if non-NULL then store here the data size - * - * This function will read the entire content of an ntfs attribute. - * If @name is AT_UNNAMED then look specifically for an unnamed attribute. - * If @name is NULL then the attribute could be either named or not. - * In both those cases @name_len is not used at all. - * - * On success a buffer is allocated with the content of the attribute - * and which needs to be freed when it's not needed anymore. If the - * @data_size parameter is non-NULL then the data size is set there. - * - * On error NULL is returned with errno set to the error code. - */ -void *ntfs_attr_readall(ntfs_inode *ni, const ATTR_TYPES type, - ntfschar *name, u32 name_len, s64 *data_size) -{ - ntfs_attr *na; - void *data, *ret = NULL; - s64 size; - - ntfs_log_enter("Entering\n"); - - na = ntfs_attr_open(ni, type, name, name_len); - if (!na) { - ntfs_log_perror("ntfs_attr_open failed"); - goto err_exit; - } - data = ntfs_malloc(na->data_size); - if (!data) - goto out; - - size = ntfs_attr_pread(na, 0, na->data_size, data); - if (size != na->data_size) { - ntfs_log_perror("ntfs_attr_pread failed"); - free(data); - goto out; - } - ret = data; - if (data_size) - *data_size = size; -out: - ntfs_attr_close(na); -err_exit: - ntfs_log_leave("\n"); - return ret; -} - - - -int ntfs_attr_exist(ntfs_inode *ni, const ATTR_TYPES type, ntfschar *name, - u32 name_len) -{ - ntfs_attr_search_ctx *ctx; - int ret; - - ntfs_log_trace("Entering\n"); - - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return 0; - - ret = ntfs_attr_lookup(type, name, name_len, CASE_SENSITIVE, 0, NULL, 0, - ctx); - - ntfs_attr_put_search_ctx(ctx); - - return !ret; -} - -int ntfs_attr_remove(ntfs_inode *ni, const ATTR_TYPES type, ntfschar *name, - u32 name_len) -{ - ntfs_attr *na; - int ret; - - ntfs_log_trace("Entering\n"); - - if (!ni) { - ntfs_log_error("%s: NULL inode pointer", __FUNCTION__); - errno = EINVAL; - return -1; - } - - na = ntfs_attr_open(ni, type, name, name_len); - if (!na) { - /* do not log removal of non-existent stream */ - if (type != AT_DATA) { - ntfs_log_perror("Failed to open attribute 0x%02x of inode " - "0x%llx", type, (unsigned long long)ni->mft_no); - } - return -1; - } - - ret = ntfs_attr_rm(na); - if (ret) - ntfs_log_perror("Failed to remove attribute 0x%02x of inode " - "0x%llx", type, (unsigned long long)ni->mft_no); - ntfs_attr_close(na); - - return ret; -} - -/* Below macros are 32-bit ready. */ -#define BCX(x) ((x) - (((x) >> 1) & 0x77777777) - \ - (((x) >> 2) & 0x33333333) - \ - (((x) >> 3) & 0x11111111)) -#define BITCOUNT(x) (((BCX(x) + (BCX(x) >> 4)) & 0x0F0F0F0F) % 255) - -static u8 *ntfs_init_lut256(void) -{ - int i; - u8 *lut; - - lut = ntfs_malloc(256); - if (lut) - for(i = 0; i < 256; i++) - *(lut + i) = 8 - BITCOUNT(i); - return lut; -} - -s64 ntfs_attr_get_free_bits(ntfs_attr *na) -{ - u8 *buf, *lut; - s64 br = 0; - s64 total = 0; - s64 nr_free = 0; - - lut = ntfs_init_lut256(); - if (!lut) - return -1; - - buf = ntfs_malloc(65536); - if (!buf) - goto out; - - while (1) { - u32 *p; - br = ntfs_attr_pread(na, total, 65536, buf); - if (br <= 0) - break; - total += br; - p = (u32 *)buf + br / 4 - 1; - for (; (u8 *)p >= buf; p--) { - nr_free += lut[ *p & 255] + - lut[(*p >> 8) & 255] + - lut[(*p >> 16) & 255] + - lut[(*p >> 24) ]; - } - switch (br % 4) { - case 3: nr_free += lut[*(buf + br - 3)]; - case 2: nr_free += lut[*(buf + br - 2)]; - case 1: nr_free += lut[*(buf + br - 1)]; - } - } - free(buf); -out: - free(lut); - if (!total || br < 0) - return -1; - return nr_free; -} - -#endif - diff --git a/source/libs/libntfs/attrlist.c b/source/libs/libntfs/attrlist.c deleted file mode 100644 index 9c62f316..00000000 --- a/source/libs/libntfs/attrlist.c +++ /dev/null @@ -1,314 +0,0 @@ -/** - * attrlist.c - Attribute list attribute handling code. Originated from the Linux-NTFS - * project. - * - * Copyright (c) 2004-2005 Anton Altaparmakov - * Copyright (c) 2004-2005 Yura Pakhuchiy - * Copyright (c) 2006 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "types.h" -#include "layout.h" -#include "attrib.h" -#include "attrlist.h" -#include "debug.h" -#include "unistr.h" -#include "logging.h" -#include "misc.h" - -/** - * ntfs_attrlist_need - check whether inode need attribute list - * @ni: opened ntfs inode for which perform check - * - * Check whether all are attributes belong to one MFT record, in that case - * attribute list is not needed. - * - * Return 1 if inode need attribute list, 0 if not, -1 on error with errno set - * to the error code. If function succeed errno set to 0. The following error - * codes are defined: - * EINVAL - Invalid arguments passed to function or attribute haven't got - * attribute list. - */ -int ntfs_attrlist_need(ntfs_inode *ni) -{ - ATTR_LIST_ENTRY *ale; - - if (!ni) { - ntfs_log_trace("Invalid arguments.\n"); - errno = EINVAL; - return -1; - } - - ntfs_log_trace("Entering for inode 0x%llx.\n", (long long) ni->mft_no); - - if (!NInoAttrList(ni)) { - ntfs_log_trace("Inode haven't got attribute list.\n"); - errno = EINVAL; - return -1; - } - - if (!ni->attr_list) { - ntfs_log_trace("Corrupt in-memory struct.\n"); - errno = EINVAL; - return -1; - } - - errno = 0; - ale = (ATTR_LIST_ENTRY *)ni->attr_list; - while ((u8*)ale < ni->attr_list + ni->attr_list_size) { - if (MREF_LE(ale->mft_reference) != ni->mft_no) - return 1; - ale = (ATTR_LIST_ENTRY *)((u8*)ale + le16_to_cpu(ale->length)); - } - return 0; -} - -/** - * ntfs_attrlist_entry_add - add an attribute list attribute entry - * @ni: opened ntfs inode, which contains that attribute - * @attr: attribute record to add to attribute list - * - * Return 0 on success and -1 on error with errno set to the error code. The - * following error codes are defined: - * EINVAL - Invalid arguments passed to function. - * ENOMEM - Not enough memory to allocate necessary buffers. - * EIO - I/O error occurred or damaged filesystem. - * EEXIST - Such attribute already present in attribute list. - */ -int ntfs_attrlist_entry_add(ntfs_inode *ni, ATTR_RECORD *attr) -{ - ATTR_LIST_ENTRY *ale; - MFT_REF mref; - ntfs_attr *na = NULL; - ntfs_attr_search_ctx *ctx; - u8 *new_al; - int entry_len, entry_offset, err; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", - (long long) ni->mft_no, - (unsigned) le32_to_cpu(attr->type)); - - if (!ni || !attr) { - ntfs_log_trace("Invalid arguments.\n"); - errno = EINVAL; - return -1; - } - - mref = MK_LE_MREF(ni->mft_no, le16_to_cpu(ni->mrec->sequence_number)); - - if (ni->nr_extents == -1) - ni = ni->base_ni; - - if (!NInoAttrList(ni)) { - ntfs_log_trace("Attribute list isn't present.\n"); - errno = ENOENT; - return -1; - } - - /* Determine size and allocate memory for new attribute list. */ - entry_len = (sizeof(ATTR_LIST_ENTRY) + sizeof(ntfschar) * - attr->name_length + 7) & ~7; - new_al = ntfs_calloc(ni->attr_list_size + entry_len); - if (!new_al) - return -1; - - /* Find place for the new entry. */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) { - err = errno; - goto err_out; - } - if (!ntfs_attr_lookup(attr->type, (attr->name_length) ? (ntfschar*) - ((u8*)attr + le16_to_cpu(attr->name_offset)) : - AT_UNNAMED, attr->name_length, CASE_SENSITIVE, - (attr->non_resident) ? le64_to_cpu(attr->lowest_vcn) : - 0, (attr->non_resident) ? NULL : ((u8*)attr + - le16_to_cpu(attr->value_offset)), (attr->non_resident) ? - 0 : le32_to_cpu(attr->value_length), ctx)) { - /* Found some extent, check it to be before new extent. */ - if (ctx->al_entry->lowest_vcn == attr->lowest_vcn) { - err = EEXIST; - ntfs_log_trace("Such attribute already present in the " - "attribute list.\n"); - ntfs_attr_put_search_ctx(ctx); - goto err_out; - } - /* Add new entry after this extent. */ - ale = (ATTR_LIST_ENTRY*)((u8*)ctx->al_entry + - le16_to_cpu(ctx->al_entry->length)); - } else { - /* Check for real errors. */ - if (errno != ENOENT) { - err = errno; - ntfs_log_trace("Attribute lookup failed.\n"); - ntfs_attr_put_search_ctx(ctx); - goto err_out; - } - /* No previous extents found. */ - ale = ctx->al_entry; - } - /* Don't need it anymore, @ctx->al_entry points to @ni->attr_list. */ - ntfs_attr_put_search_ctx(ctx); - - /* Determine new entry offset. */ - entry_offset = ((u8 *)ale - ni->attr_list); - /* Set pointer to new entry. */ - ale = (ATTR_LIST_ENTRY *)(new_al + entry_offset); - /* Zero it to fix valgrind warning. */ - memset(ale, 0, entry_len); - /* Form new entry. */ - ale->type = attr->type; - ale->length = cpu_to_le16(entry_len); - ale->name_length = attr->name_length; - ale->name_offset = offsetof(ATTR_LIST_ENTRY, name); - if (attr->non_resident) - ale->lowest_vcn = attr->lowest_vcn; - else - ale->lowest_vcn = 0; - ale->mft_reference = mref; - ale->instance = attr->instance; - memcpy(ale->name, (u8 *)attr + le16_to_cpu(attr->name_offset), - attr->name_length * sizeof(ntfschar)); - - /* Resize $ATTRIBUTE_LIST to new length. */ - na = ntfs_attr_open(ni, AT_ATTRIBUTE_LIST, AT_UNNAMED, 0); - if (!na) { - err = errno; - ntfs_log_trace("Failed to open $ATTRIBUTE_LIST attribute.\n"); - goto err_out; - } - if (ntfs_attr_truncate(na, ni->attr_list_size + entry_len)) { - err = errno; - ntfs_log_trace("$ATTRIBUTE_LIST resize failed.\n"); - goto err_out; - } - - /* Copy entries from old attribute list to new. */ - memcpy(new_al, ni->attr_list, entry_offset); - memcpy(new_al + entry_offset + entry_len, ni->attr_list + - entry_offset, ni->attr_list_size - entry_offset); - - /* Set new runlist. */ - free(ni->attr_list); - ni->attr_list = new_al; - ni->attr_list_size = ni->attr_list_size + entry_len; - NInoAttrListSetDirty(ni); - /* Done! */ - ntfs_attr_close(na); - return 0; -err_out: - if (na) - ntfs_attr_close(na); - free(new_al); - errno = err; - return -1; -} - -/** - * ntfs_attrlist_entry_rm - remove an attribute list attribute entry - * @ctx: attribute search context describing the attribute list entry - * - * Remove the attribute list entry @ctx->al_entry from the attribute list. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_attrlist_entry_rm(ntfs_attr_search_ctx *ctx) -{ - u8 *new_al; - int new_al_len; - ntfs_inode *base_ni; - ntfs_attr *na; - ATTR_LIST_ENTRY *ale; - int err; - - if (!ctx || !ctx->ntfs_ino || !ctx->al_entry) { - ntfs_log_trace("Invalid arguments.\n"); - errno = EINVAL; - return -1; - } - - if (ctx->base_ntfs_ino) - base_ni = ctx->base_ntfs_ino; - else - base_ni = ctx->ntfs_ino; - ale = ctx->al_entry; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, lowest_vcn %lld.\n", - (long long) ctx->ntfs_ino->mft_no, - (unsigned) le32_to_cpu(ctx->al_entry->type), - (long long) le64_to_cpu(ctx->al_entry->lowest_vcn)); - - if (!NInoAttrList(base_ni)) { - ntfs_log_trace("Attribute list isn't present.\n"); - errno = ENOENT; - return -1; - } - - /* Allocate memory for new attribute list. */ - new_al_len = base_ni->attr_list_size - le16_to_cpu(ale->length); - new_al = ntfs_calloc(new_al_len); - if (!new_al) - return -1; - - /* Reisze $ATTRIBUTE_LIST to new length. */ - na = ntfs_attr_open(base_ni, AT_ATTRIBUTE_LIST, AT_UNNAMED, 0); - if (!na) { - err = errno; - ntfs_log_trace("Failed to open $ATTRIBUTE_LIST attribute.\n"); - goto err_out; - } - if (ntfs_attr_truncate(na, new_al_len)) { - err = errno; - ntfs_log_trace("$ATTRIBUTE_LIST resize failed.\n"); - goto err_out; - } - - /* Copy entries from old attribute list to new. */ - memcpy(new_al, base_ni->attr_list, (u8*)ale - base_ni->attr_list); - memcpy(new_al + ((u8*)ale - base_ni->attr_list), (u8*)ale + le16_to_cpu( - ale->length), new_al_len - ((u8*)ale - base_ni->attr_list)); - - /* Set new runlist. */ - free(base_ni->attr_list); - base_ni->attr_list = new_al; - base_ni->attr_list_size = new_al_len; - NInoAttrListSetDirty(base_ni); - /* Done! */ - ntfs_attr_close(na); - return 0; -err_out: - if (na) - ntfs_attr_close(na); - free(new_al); - errno = err; - return -1; -} diff --git a/source/libs/libntfs/attrlist.h b/source/libs/libntfs/attrlist.h deleted file mode 100644 index 2952e48b..00000000 --- a/source/libs/libntfs/attrlist.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * attrlist.h - Exports for attribute list attribute handling. - * Originated from Linux-NTFS project. - * - * Copyright (c) 2004 Anton Altaparmakov - * Copyright (c) 2004 Yura Pakhuchiy - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_ATTRLIST_H -#define _NTFS_ATTRLIST_H - -#include "attrib.h" - -extern int ntfs_attrlist_need(ntfs_inode *ni); - -extern int ntfs_attrlist_entry_add(ntfs_inode *ni, ATTR_RECORD *attr); -extern int ntfs_attrlist_entry_rm(ntfs_attr_search_ctx *ctx); - -/** - * ntfs_attrlist_mark_dirty - set the attribute list dirty - * @ni: ntfs inode which base inode contain dirty attribute list - * - * Set the attribute list dirty so it is written out later (at the latest at - * ntfs_inode_close() time). - * - * This function cannot fail. - */ -static __inline__ void ntfs_attrlist_mark_dirty(ntfs_inode *ni) -{ - if (ni->nr_extents == -1) - NInoAttrListSetDirty(ni->base_ni); - else - NInoAttrListSetDirty(ni); -} - -#endif /* defined _NTFS_ATTRLIST_H */ diff --git a/source/libs/libntfs/bit_ops.h b/source/libs/libntfs/bit_ops.h deleted file mode 100644 index 762be0b3..00000000 --- a/source/libs/libntfs/bit_ops.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - bit_ops.h - Functions for dealing with conversion of data between types - - Copyright (c) 2006 Michael "Chishm" Chisholm - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _BIT_OPS_H -#define _BIT_OPS_H - -#include - -/*----------------------------------------------------------------- -Functions to deal with little endian values stored in uint8_t arrays ------------------------------------------------------------------*/ -static inline uint16_t u8array_to_u16 (const uint8_t* item, int offset) { - return ( item[offset] | (item[offset + 1] << 8)); -} - -static inline uint32_t u8array_to_u32 (const uint8_t* item, int offset) { - return ( item[offset] | (item[offset + 1] << 8) | (item[offset + 2] << 16) | (item[offset + 3] << 24)); -} - -static inline void u16_to_u8array (uint8_t* item, int offset, uint16_t value) { - item[offset] = (uint8_t) value; - item[offset + 1] = (uint8_t)(value >> 8); -} - -static inline void u32_to_u8array (uint8_t* item, int offset, uint32_t value) { - item[offset] = (uint8_t) value; - item[offset + 1] = (uint8_t)(value >> 8); - item[offset + 2] = (uint8_t)(value >> 16); - item[offset + 3] = (uint8_t)(value >> 24); -} - -#endif // _BIT_OPS_H diff --git a/source/libs/libntfs/bitmap.c b/source/libs/libntfs/bitmap.c deleted file mode 100644 index 65162a29..00000000 --- a/source/libs/libntfs/bitmap.c +++ /dev/null @@ -1,300 +0,0 @@ -/** - * bitmap.c - Bitmap handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002-2006 Anton Altaparmakov - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2004-2008 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "types.h" -#include "attrib.h" -#include "bitmap.h" -#include "debug.h" -#include "logging.h" -#include "misc.h" - -/** - * ntfs_bit_set - set a bit in a field of bits - * @bitmap: field of bits - * @bit: bit to set - * @new_value: value to set bit to (0 or 1) - * - * Set the bit @bit in the @bitmap to @new_value. Ignore all errors. - */ -void ntfs_bit_set(u8 *bitmap, const u64 bit, const u8 new_value) -{ - if (!bitmap || new_value > 1) - return; - if (!new_value) - bitmap[bit >> 3] &= ~(1 << (bit & 7)); - else - bitmap[bit >> 3] |= (1 << (bit & 7)); -} - -/** - * ntfs_bit_get - get value of a bit in a field of bits - * @bitmap: field of bits - * @bit: bit to get - * - * Get and return the value of the bit @bit in @bitmap (0 or 1). - * Return -1 on error. - */ -char ntfs_bit_get(const u8 *bitmap, const u64 bit) -{ - if (!bitmap) - return -1; - return (bitmap[bit >> 3] >> (bit & 7)) & 1; -} - -/** - * ntfs_bit_get_and_set - get value of a bit in a field of bits and set it - * @bitmap: field of bits - * @bit: bit to get/set - * @new_value: value to set bit to (0 or 1) - * - * Return the value of the bit @bit and set it to @new_value (0 or 1). - * Return -1 on error. - */ -char ntfs_bit_get_and_set(u8 *bitmap, const u64 bit, const u8 new_value) -{ - register u8 old_bit, shift; - - if (!bitmap || new_value > 1) - return -1; - shift = bit & 7; - old_bit = (bitmap[bit >> 3] >> shift) & 1; - if (new_value != old_bit) - bitmap[bit >> 3] ^= 1 << shift; - return old_bit; -} - -/** - * ntfs_bitmap_set_bits_in_run - set a run of bits in a bitmap to a value - * @na: attribute containing the bitmap - * @start_bit: first bit to set - * @count: number of bits to set - * @value: value to set the bits to (i.e. 0 or 1) - * - * Set @count bits starting at bit @start_bit in the bitmap described by the - * attribute @na to @value, where @value is either 0 or 1. - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -static int ntfs_bitmap_set_bits_in_run(ntfs_attr *na, s64 start_bit, - s64 count, int value) -{ - s64 bufsize, br; - u8 *buf, *lastbyte_buf; - int bit, firstbyte, lastbyte, lastbyte_pos, tmp, ret = -1; - - if (!na || start_bit < 0 || count < 0) { - errno = EINVAL; - ntfs_log_perror("%s: Invalid argument (%p, %lld, %lld)", - __FUNCTION__, na, (long long)start_bit, (long long)count); - return -1; - } - - bit = start_bit & 7; - if (bit) - firstbyte = 1; - else - firstbyte = 0; - - /* Calculate the required buffer size in bytes, capping it at 8kiB. */ - bufsize = ((count - (bit ? 8 - bit : 0) + 7) >> 3) + firstbyte; - if (bufsize > 8192) - bufsize = 8192; - - buf = ntfs_malloc(bufsize); - if (!buf) - return -1; - - /* Depending on @value, zero or set all bits in the allocated buffer. */ - memset(buf, value ? 0xff : 0, bufsize); - - /* If there is a first partial byte... */ - if (bit) { - /* read it in... */ - br = ntfs_attr_pread(na, start_bit >> 3, 1, buf); - if (br != 1) { - if (br >= 0) - errno = EIO; - goto free_err_out; - } - /* and set or clear the appropriate bits in it. */ - while ((bit & 7) && count--) { - if (value) - *buf |= 1 << bit++; - else - *buf &= ~(1 << bit++); - } - /* Update @start_bit to the new position. */ - start_bit = (start_bit + 7) & ~7; - } - - /* Loop until @count reaches zero. */ - lastbyte = 0; - lastbyte_buf = NULL; - bit = count & 7; - do { - /* If there is a last partial byte... */ - if (count > 0 && bit) { - lastbyte_pos = ((count + 7) >> 3) + firstbyte; - if (!lastbyte_pos) { - // FIXME: Eeek! BUG! - ntfs_log_error("Lastbyte is zero. Leaving " - "inconsistent metadata.\n"); - errno = EIO; - goto free_err_out; - } - /* and it is in the currently loaded bitmap window... */ - if (lastbyte_pos <= bufsize) { - lastbyte_buf = buf + lastbyte_pos - 1; - - /* read the byte in... */ - br = ntfs_attr_pread(na, (start_bit + count) >> - 3, 1, lastbyte_buf); - if (br != 1) { - // FIXME: Eeek! We need rollback! (AIA) - if (br >= 0) - errno = EIO; - ntfs_log_perror("Reading of last byte " - "failed (%lld). Leaving inconsistent " - "metadata", (long long)br); - goto free_err_out; - } - /* and set/clear the appropriate bits in it. */ - while (bit && count--) { - if (value) - *lastbyte_buf |= 1 << --bit; - else - *lastbyte_buf &= ~(1 << --bit); - } - /* We don't want to come back here... */ - bit = 0; - /* We have a last byte that we have handled. */ - lastbyte = 1; - } - } - - /* Write the prepared buffer to disk. */ - tmp = (start_bit >> 3) - firstbyte; - br = ntfs_attr_pwrite(na, tmp, bufsize, buf); - if (br != bufsize) { - // FIXME: Eeek! We need rollback! (AIA) - if (br >= 0) - errno = EIO; - ntfs_log_perror("Failed to write buffer to bitmap " - "(%lld != %lld). Leaving inconsistent metadata", - (long long)br, (long long)bufsize); - goto free_err_out; - } - - /* Update counters. */ - tmp = (bufsize - firstbyte - lastbyte) << 3; - if (firstbyte) { - firstbyte = 0; - /* - * Re-set the partial first byte so a subsequent write - * of the buffer does not have stale, incorrect bits. - */ - *buf = value ? 0xff : 0; - } - start_bit += tmp; - count -= tmp; - if (bufsize > (tmp = (count + 7) >> 3)) - bufsize = tmp; - - if (lastbyte && count != 0) { - // FIXME: Eeek! BUG! - ntfs_log_error("Last buffer but count is not zero " - "(%lld). Leaving inconsistent metadata.\n", - (long long)count); - errno = EIO; - goto free_err_out; - } - } while (count > 0); - - ret = 0; - -free_err_out: - free(buf); - return ret; -} - -/** - * ntfs_bitmap_set_run - set a run of bits in a bitmap - * @na: attribute containing the bitmap - * @start_bit: first bit to set - * @count: number of bits to set - * - * Set @count bits starting at bit @start_bit in the bitmap described by the - * attribute @na. - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -int ntfs_bitmap_set_run(ntfs_attr *na, s64 start_bit, s64 count) -{ - int ret; - - ntfs_log_enter("Set from bit %lld, count %lld\n", - (long long)start_bit, (long long)count); - ret = ntfs_bitmap_set_bits_in_run(na, start_bit, count, 1); - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_bitmap_clear_run - clear a run of bits in a bitmap - * @na: attribute containing the bitmap - * @start_bit: first bit to clear - * @count: number of bits to clear - * - * Clear @count bits starting at bit @start_bit in the bitmap described by the - * attribute @na. - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -int ntfs_bitmap_clear_run(ntfs_attr *na, s64 start_bit, s64 count) -{ - int ret; - - ntfs_log_enter("Clear from bit %lld, count %lld\n", - (long long)start_bit, (long long)count); - ret = ntfs_bitmap_set_bits_in_run(na, start_bit, count, 0); - ntfs_log_leave("\n"); - return ret; -} - diff --git a/source/libs/libntfs/bitmap.h b/source/libs/libntfs/bitmap.h deleted file mode 100644 index 10b5f6c5..00000000 --- a/source/libs/libntfs/bitmap.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * bitmap.h - Exports for bitmap handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * Copyright (c) 2004-2005 Richard Russon - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_BITMAP_H -#define _NTFS_BITMAP_H - -#include "types.h" -#include "attrib.h" - -/* - * NOTES: - * - * - Operations are 8-bit only to ensure the functions work both on little - * and big endian machines! So don't make them 32-bit ops! - * - bitmap starts at bit = 0 and ends at bit = bitmap size - 1. - * - _Caller_ has to make sure that the bit to operate on is less than the - * size of the bitmap. - */ - -extern void ntfs_bit_set(u8 *bitmap, const u64 bit, const u8 new_value); -extern char ntfs_bit_get(const u8 *bitmap, const u64 bit); -extern char ntfs_bit_get_and_set(u8 *bitmap, const u64 bit, const u8 new_value); -extern int ntfs_bitmap_set_run(ntfs_attr *na, s64 start_bit, s64 count); -extern int ntfs_bitmap_clear_run(ntfs_attr *na, s64 start_bit, s64 count); - -/** - * ntfs_bitmap_set_bit - set a bit in a bitmap - * @na: attribute containing the bitmap - * @bit: bit to set - * - * Set the @bit in the bitmap described by the attribute @na. - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -static __inline__ int ntfs_bitmap_set_bit(ntfs_attr *na, s64 bit) -{ - return ntfs_bitmap_set_run(na, bit, 1); -} - -/** - * ntfs_bitmap_clear_bit - clear a bit in a bitmap - * @na: attribute containing the bitmap - * @bit: bit to clear - * - * Clear @bit in the bitmap described by the attribute @na. - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -static __inline__ int ntfs_bitmap_clear_bit(ntfs_attr *na, s64 bit) -{ - return ntfs_bitmap_clear_run(na, bit, 1); -} - -/* - * rol32 - rotate a 32-bit value left - * - * @word: value to rotate - * @shift: bits to roll - */ -static __inline__ u32 ntfs_rol32(u32 word, unsigned int shift) -{ - return (word << shift) | (word >> (32 - shift)); -} - -/* - * ror32 - rotate a 32-bit value right - * - * @word: value to rotate - * @shift: bits to roll - */ -static __inline__ u32 ntfs_ror32(u32 word, unsigned int shift) -{ - return (word >> shift) | (word << (32 - shift)); -} - -#endif /* defined _NTFS_BITMAP_H */ - diff --git a/source/libs/libntfs/bootsect.c b/source/libs/libntfs/bootsect.c deleted file mode 100644 index e9bea370..00000000 --- a/source/libs/libntfs/bootsect.c +++ /dev/null @@ -1,285 +0,0 @@ -/** - * bootsect.c - Boot sector handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2006 Anton Altaparmakov - * Copyright (c) 2003-2008 Szabolcs Szakacsits - * Copyright (c) 2005 Yura Pakhuchiy - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "compat.h" -#include "bootsect.h" -#include "debug.h" -#include "logging.h" - -/** - * ntfs_boot_sector_is_ntfs - check if buffer contains a valid ntfs boot sector - * @b: buffer containing putative boot sector to analyze - * @silent: if zero, output progress messages to stderr - * - * Check if the buffer @b contains a valid ntfs boot sector. The buffer @b - * must be at least 512 bytes in size. - * - * If @silent is zero, output progress messages to stderr. Otherwise, do not - * output any messages (except when configured with --enable-debug in which - * case warning/debug messages may be displayed). - * - * Return TRUE if @b contains a valid ntfs boot sector and FALSE if not. - */ -BOOL ntfs_boot_sector_is_ntfs(NTFS_BOOT_SECTOR *b) -{ - u32 i; - BOOL ret = FALSE; - - ntfs_log_debug("Beginning bootsector check.\n"); - - ntfs_log_debug("Checking OEMid, NTFS signature.\n"); - if (b->oem_id != cpu_to_le64(0x202020205346544eULL)) { /* "NTFS " */ - ntfs_log_error("NTFS signature is missing.\n"); - goto not_ntfs; - } - - ntfs_log_debug("Checking bytes per sector.\n"); - if (le16_to_cpu(b->bpb.bytes_per_sector) < 256 || - le16_to_cpu(b->bpb.bytes_per_sector) > 4096) { - ntfs_log_error("Unexpected bytes per sector value (%d).\n", - le16_to_cpu(b->bpb.bytes_per_sector)); - goto not_ntfs; - } - - ntfs_log_debug("Checking sectors per cluster.\n"); - switch (b->bpb.sectors_per_cluster) { - case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128: - break; - default: - ntfs_log_error("Unexpected sectors per cluster value (%d).\n", - b->bpb.sectors_per_cluster); - goto not_ntfs; - } - - ntfs_log_debug("Checking cluster size.\n"); - i = (u32)le16_to_cpu(b->bpb.bytes_per_sector) * - b->bpb.sectors_per_cluster; - if (i > 65536) { - ntfs_log_error("Unexpected cluster size (%d).\n", i); - goto not_ntfs; - } - - ntfs_log_debug("Checking reserved fields are zero.\n"); - if (le16_to_cpu(b->bpb.reserved_sectors) || - le16_to_cpu(b->bpb.root_entries) || - le16_to_cpu(b->bpb.sectors) || - le16_to_cpu(b->bpb.sectors_per_fat) || - le32_to_cpu(b->bpb.large_sectors) || - b->bpb.fats) { - ntfs_log_error("Reserved fields aren't zero " - "(%d, %d, %d, %d, %d, %d).\n", - le16_to_cpu(b->bpb.reserved_sectors), - le16_to_cpu(b->bpb.root_entries), - le16_to_cpu(b->bpb.sectors), - le16_to_cpu(b->bpb.sectors_per_fat), - le32_to_cpu(b->bpb.large_sectors), - b->bpb.fats); - goto not_ntfs; - } - - ntfs_log_debug("Checking clusters per mft record.\n"); - if ((u8)b->clusters_per_mft_record < 0xe1 || - (u8)b->clusters_per_mft_record > 0xf7) { - switch (b->clusters_per_mft_record) { - case 1: case 2: case 4: case 8: case 0x10: case 0x20: case 0x40: - break; - default: - ntfs_log_error("Unexpected clusters per mft record " - "(%d).\n", b->clusters_per_mft_record); - goto not_ntfs; - } - } - - ntfs_log_debug("Checking clusters per index block.\n"); - if ((u8)b->clusters_per_index_record < 0xe1 || - (u8)b->clusters_per_index_record > 0xf7) { - switch (b->clusters_per_index_record) { - case 1: case 2: case 4: case 8: case 0x10: case 0x20: case 0x40: - break; - default: - ntfs_log_error("Unexpected clusters per index record " - "(%d).\n", b->clusters_per_index_record); - goto not_ntfs; - } - } - - if (b->end_of_sector_marker != cpu_to_le16(0xaa55)) - ntfs_log_debug("Warning: Bootsector has invalid end of sector " - "marker.\n"); - - ntfs_log_debug("Bootsector check completed successfully.\n"); - - ret = TRUE; -not_ntfs: - return ret; -} - -static const char *last_sector_error = -"HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,\n" -" or it was not setup correctly (e.g. by not using mdadm --build ...),\n" -" or a wrong device is tried to be mounted,\n" -" or the partition table is corrupt (partition is smaller than NTFS),\n" -" or the NTFS boot sector is corrupt (NTFS size is not valid).\n"; - -/** - * ntfs_boot_sector_parse - setup an ntfs volume from an ntfs boot sector - * @vol: ntfs_volume to setup - * @bs: buffer containing ntfs boot sector to parse - * - * Parse the ntfs bootsector @bs and setup the ntfs volume @vol with the - * obtained values. - * - * Return 0 on success or -1 on error with errno set to the error code EINVAL. - */ -int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs) -{ - s64 sectors; - u8 sectors_per_cluster; - s8 c; - - /* We return -1 with errno = EINVAL on error. */ - errno = EINVAL; - - vol->sector_size = le16_to_cpu(bs->bpb.bytes_per_sector); - vol->sector_size_bits = ffs(vol->sector_size) - 1; - ntfs_log_debug("SectorSize = 0x%x\n", vol->sector_size); - ntfs_log_debug("SectorSizeBits = %u\n", vol->sector_size_bits); - /* - * The bounds checks on mft_lcn and mft_mirr_lcn (i.e. them being - * below or equal the number_of_clusters) really belong in the - * ntfs_boot_sector_is_ntfs but in this way we can just do this once. - */ - sectors_per_cluster = bs->bpb.sectors_per_cluster; - ntfs_log_debug("SectorsPerCluster = 0x%x\n", sectors_per_cluster); - if (sectors_per_cluster & (sectors_per_cluster - 1)) { - ntfs_log_error("sectors_per_cluster (%d) is not a power of 2." - "\n", sectors_per_cluster); - return -1; - } - - sectors = sle64_to_cpu(bs->number_of_sectors); - ntfs_log_debug("NumberOfSectors = %lld\n", (long long)sectors); - if (!sectors) { - ntfs_log_error("Volume size is set to zero.\n"); - return -1; - } - if (vol->dev->d_ops->seek(vol->dev, - (sectors - 1) << vol->sector_size_bits, - SEEK_SET) == -1) { - ntfs_log_perror("Failed to read last sector (%lld)", - (long long)sectors); - ntfs_log_error("%s", last_sector_error); - return -1; - } - - vol->nr_clusters = sectors >> (ffs(sectors_per_cluster) - 1); - - vol->mft_lcn = sle64_to_cpu(bs->mft_lcn); - vol->mftmirr_lcn = sle64_to_cpu(bs->mftmirr_lcn); - ntfs_log_debug("MFT LCN = %lld\n", (long long)vol->mft_lcn); - ntfs_log_debug("MFTMirr LCN = %lld\n", (long long)vol->mftmirr_lcn); - if (vol->mft_lcn > vol->nr_clusters || - vol->mftmirr_lcn > vol->nr_clusters) { - ntfs_log_error("$MFT LCN (%lld) or $MFTMirr LCN (%lld) is " - "greater than the number of clusters (%lld).\n", - (long long)vol->mft_lcn, (long long)vol->mftmirr_lcn, - (long long)vol->nr_clusters); - return -1; - } - - vol->cluster_size = sectors_per_cluster * vol->sector_size; - if (vol->cluster_size & (vol->cluster_size - 1)) { - ntfs_log_error("cluster_size (%d) is not a power of 2.\n", - vol->cluster_size); - return -1; - } - vol->cluster_size_bits = ffs(vol->cluster_size) - 1; - /* - * Need to get the clusters per mft record and handle it if it is - * negative. Then calculate the mft_record_size. A value of 0x80 is - * illegal, thus signed char is actually ok! - */ - c = bs->clusters_per_mft_record; - ntfs_log_debug("ClusterSize = 0x%x\n", (unsigned)vol->cluster_size); - ntfs_log_debug("ClusterSizeBits = %u\n", vol->cluster_size_bits); - ntfs_log_debug("ClustersPerMftRecord = 0x%x\n", c); - /* - * When clusters_per_mft_record is negative, it means that it is to - * be taken to be the negative base 2 logarithm of the mft_record_size - * min bytes. Then: - * mft_record_size = 2^(-clusters_per_mft_record) bytes. - */ - if (c < 0) - vol->mft_record_size = 1 << -c; - else - vol->mft_record_size = c << vol->cluster_size_bits; - if (vol->mft_record_size & (vol->mft_record_size - 1)) { - ntfs_log_error("mft_record_size (%d) is not a power of 2.\n", - vol->mft_record_size); - return -1; - } - vol->mft_record_size_bits = ffs(vol->mft_record_size) - 1; - ntfs_log_debug("MftRecordSize = 0x%x\n", (unsigned)vol->mft_record_size); - ntfs_log_debug("MftRecordSizeBits = %u\n", vol->mft_record_size_bits); - /* Same as above for INDX record. */ - c = bs->clusters_per_index_record; - ntfs_log_debug("ClustersPerINDXRecord = 0x%x\n", c); - if (c < 0) - vol->indx_record_size = 1 << -c; - else - vol->indx_record_size = c << vol->cluster_size_bits; - vol->indx_record_size_bits = ffs(vol->indx_record_size) - 1; - ntfs_log_debug("INDXRecordSize = 0x%x\n", (unsigned)vol->indx_record_size); - ntfs_log_debug("INDXRecordSizeBits = %u\n", vol->indx_record_size_bits); - /* - * Work out the size of the MFT mirror in number of mft records. If the - * cluster size is less than or equal to the size taken by four mft - * records, the mft mirror stores the first four mft records. If the - * cluster size is bigger than the size taken by four mft records, the - * mft mirror contains as many mft records as will fit into one - * cluster. - */ - if (vol->cluster_size <= 4 * vol->mft_record_size) - vol->mftmirr_size = 4; - else - vol->mftmirr_size = vol->cluster_size / vol->mft_record_size; - return 0; -} - diff --git a/source/libs/libntfs/bootsect.h b/source/libs/libntfs/bootsect.h deleted file mode 100644 index a299e821..00000000 --- a/source/libs/libntfs/bootsect.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * bootsect.h - Exports for bootsector record handling. - * Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2002 Anton Altaparmakov - * Copyright (c) 2006 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_BOOTSECT_H -#define _NTFS_BOOTSECT_H - -#include "types.h" -#include "volume.h" -#include "layout.h" - -/** - * ntfs_boot_sector_is_ntfs - check a boot sector for describing an ntfs volume - * @b: buffer containing the boot sector - * - * This function checks the boot sector in @b for describing a valid ntfs - * volume. Return TRUE if @b is a valid NTFS boot sector or FALSE otherwise. - */ -extern BOOL ntfs_boot_sector_is_ntfs(NTFS_BOOT_SECTOR *b); -extern int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs); - -#endif /* defined _NTFS_BOOTSECT_H */ - diff --git a/source/libs/libntfs/cache.c b/source/libs/libntfs/cache.c deleted file mode 100644 index dd147672..00000000 --- a/source/libs/libntfs/cache.c +++ /dev/null @@ -1,609 +0,0 @@ -/** - * cache.c : deal with LRU caches - * - * Copyright (c) 2008-2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - -#include "types.h" -#include "security.h" -#include "cache.h" -#include "misc.h" -#include "logging.h" - -/* - * General functions to deal with LRU caches - * - * The cached data have to be organized in a structure in which - * the first fields must follow a mandatory pattern and further - * fields may contain any fixed size data. They are stored in an - * LRU list. - * - * A compare function must be provided for finding a wanted entry - * in the cache. Another function may be provided for invalidating - * an entry to facilitate multiple invalidation. - * - * These functions never return error codes. When there is a - * shortage of memory, data is simply not cached. - * When there is a hashing bug, hashing is dropped, and sequential - * searches are used. - */ - -/* - * Enter a new hash index, after a new record has been inserted - * - * Do not call when a record has been modified (with no key change) - */ - -static void inserthashindex(struct CACHE_HEADER *cache, - struct CACHED_GENERIC *current) -{ - int h; - struct HASH_ENTRY *link; - struct HASH_ENTRY *first; - - if (cache->dohash) { - h = cache->dohash(current); - if ((h >= 0) && (h < cache->max_hash)) { - /* get a free link and insert at top of hash list */ - link = cache->free_hash; - if (link) { - cache->free_hash = link->next; - first = cache->first_hash[h]; - if (first) - link->next = first; - else - link->next = NULL; - link->entry = current; - cache->first_hash[h] = link; - } else { - ntfs_log_error("No more hash entries," - " cache %s hashing dropped\n", - cache->name); - cache->dohash = (cache_hash)NULL; - } - } else { - ntfs_log_error("Illegal hash value," - " cache %s hashing dropped\n", - cache->name); - cache->dohash = (cache_hash)NULL; - } - } -} - -/* - * Drop a hash index when a record is about to be deleted - */ - -static void drophashindex(struct CACHE_HEADER *cache, - const struct CACHED_GENERIC *current, int hash) -{ - struct HASH_ENTRY *link; - struct HASH_ENTRY *previous; - - if (cache->dohash) { - if ((hash >= 0) && (hash < cache->max_hash)) { - /* find the link and unlink */ - link = cache->first_hash[hash]; - previous = (struct HASH_ENTRY*)NULL; - while (link && (link->entry != current)) { - previous = link; - link = link->next; - } - if (link) { - if (previous) - previous->next = link->next; - else - cache->first_hash[hash] = link->next; - link->next = cache->free_hash; - cache->free_hash = link; - } else { - ntfs_log_error("Bad hash list," - " cache %s hashing dropped\n", - cache->name); - cache->dohash = (cache_hash)NULL; - } - } else { - ntfs_log_error("Illegal hash value," - " cache %s hashing dropped\n", - cache->name); - cache->dohash = (cache_hash)NULL; - } - } -} - -/* - * Fetch an entry from cache - * - * returns the cache entry, or NULL if not available - * The returned entry may be modified, but not freed - */ - -struct CACHED_GENERIC *ntfs_fetch_cache(struct CACHE_HEADER *cache, - const struct CACHED_GENERIC *wanted, cache_compare compare) -{ - struct CACHED_GENERIC *current; - struct CACHED_GENERIC *previous; - struct HASH_ENTRY *link; - int h; - - current = (struct CACHED_GENERIC*)NULL; - if (cache) { - if (cache->dohash) { - /* - * When possible, use the hash table to - * locate the entry if present - */ - h = cache->dohash(wanted); - link = cache->first_hash[h]; - while (link && compare(link->entry, wanted)) - link = link->next; - if (link) - current = link->entry; - } - if (!cache->dohash) { - /* - * Search sequentially in LRU list if no hash table - * or if hashing has just failed - */ - current = cache->most_recent_entry; - while (current - && compare(current, wanted)) { - current = current->next; - } - } - if (current) { - previous = current->previous; - cache->hits++; - if (previous) { - /* - * found and not at head of list, unlink from current - * position and relink as head of list - */ - previous->next = current->next; - if (current->next) - current->next->previous - = current->previous; - else - cache->oldest_entry - = current->previous; - current->next = cache->most_recent_entry; - current->previous - = (struct CACHED_GENERIC*)NULL; - cache->most_recent_entry->previous = current; - cache->most_recent_entry = current; - } - } - cache->reads++; - } - return (current); -} - -/* - * Enter an inode number into cache - * returns the cache entry or NULL if not possible - */ - -struct CACHED_GENERIC *ntfs_enter_cache(struct CACHE_HEADER *cache, - const struct CACHED_GENERIC *item, - cache_compare compare) -{ - struct CACHED_GENERIC *current; - struct CACHED_GENERIC *before; - struct HASH_ENTRY *link; - int h; - - current = (struct CACHED_GENERIC*)NULL; - if (cache) { - if (cache->dohash) { - /* - * When possible, use the hash table to - * find out whether the entry if present - */ - h = cache->dohash(item); - link = cache->first_hash[h]; - while (link && compare(link->entry, item)) - link = link->next; - if (link) { - current = link->entry; - } - } - if (!cache->dohash) { - /* - * Search sequentially in LRU list to locate the end, - * and find out whether the entry is already in list - * As we normally go to the end, no statistics is - * kept. - */ - current = cache->most_recent_entry; - while (current - && compare(current, item)) { - current = current->next; - } - } - - if (!current) { - /* - * Not in list, get a free entry or reuse the - * last entry, and relink as head of list - * Note : we assume at least three entries, so - * before, previous and first are different when - * an entry is reused. - */ - - if (cache->free_entry) { - current = cache->free_entry; - cache->free_entry = cache->free_entry->next; - if (item->varsize) { - current->variable = ntfs_malloc( - item->varsize); - } else - current->variable = (void*)NULL; - current->varsize = item->varsize; - if (!cache->oldest_entry) - cache->oldest_entry = current; - } else { - /* reusing the oldest entry */ - current = cache->oldest_entry; - before = current->previous; - before->next = (struct CACHED_GENERIC*)NULL; - if (cache->dohash) - drophashindex(cache,current, - cache->dohash(current)); - if (cache->dofree) - cache->dofree(current); - cache->oldest_entry = current->previous; - if (item->varsize) { - if (current->varsize) - current->variable = realloc( - current->variable, - item->varsize); - else - current->variable = ntfs_malloc( - item->varsize); - } else { - if (current->varsize) - free(current->variable); - current->variable = (void*)NULL; - } - current->varsize = item->varsize; - } - current->next = cache->most_recent_entry; - current->previous = (struct CACHED_GENERIC*)NULL; - if (cache->most_recent_entry) - cache->most_recent_entry->previous = current; - cache->most_recent_entry = current; - memcpy(current->fixed, item->fixed, cache->fixed_size); - if (item->varsize) { - if (current->variable) { - memcpy(current->variable, - item->variable, item->varsize); - } else { - /* - * no more memory for variable part - * recycle entry in free list - * not an error, just uncacheable - */ - cache->most_recent_entry = current->next; - current->next = cache->free_entry; - cache->free_entry = current; - current = (struct CACHED_GENERIC*)NULL; - } - } else { - current->variable = (void*)NULL; - current->varsize = 0; - } - if (cache->dohash && current) - inserthashindex(cache,current); - } - cache->writes++; - } - return (current); -} - -/* - * Invalidate a cache entry - * The entry is moved to the free entry list - * A specific function may be called for entry deletion - */ - -static void do_invalidate(struct CACHE_HEADER *cache, - struct CACHED_GENERIC *current, int flags) -{ - struct CACHED_GENERIC *previous; - - previous = current->previous; - if ((flags & CACHE_FREE) && cache->dofree) - cache->dofree(current); - /* - * Relink into free list - */ - if (current->next) - current->next->previous = current->previous; - else - cache->oldest_entry = current->previous; - if (previous) - previous->next = current->next; - else - cache->most_recent_entry = current->next; - current->next = cache->free_entry; - cache->free_entry = current; - if (current->variable) - free(current->variable); - current->varsize = 0; - } - - -/* - * Invalidate entries in cache - * - * Several entries may have to be invalidated (at least for inodes - * associated to directories which have been renamed), a different - * compare function may be provided to select entries to invalidate - * - * Returns the number of deleted entries, this can be used by - * the caller to signal a cache corruption if the entry was - * supposed to be found. - */ - -int ntfs_invalidate_cache(struct CACHE_HEADER *cache, - const struct CACHED_GENERIC *item, cache_compare compare, - int flags) -{ - struct CACHED_GENERIC *current; - struct CACHED_GENERIC *previous; - struct CACHED_GENERIC *next; - struct HASH_ENTRY *link; - int count; - int h; - - current = (struct CACHED_GENERIC*)NULL; - count = 0; - if (cache) { - if (!(flags & CACHE_NOHASH) && cache->dohash) { - /* - * When possible, use the hash table to - * find out whether the entry if present - */ - h = cache->dohash(item); - link = cache->first_hash[h]; - while (link) { - if (compare(link->entry, item)) - link = link->next; - else { - current = link->entry; - link = link->next; - if (current) { - drophashindex(cache,current,h); - do_invalidate(cache, - current,flags); - count++; - } - } - } - } - if ((flags & CACHE_NOHASH) || !cache->dohash) { - /* - * Search sequentially in LRU list - */ - current = cache->most_recent_entry; - previous = (struct CACHED_GENERIC*)NULL; - while (current) { - if (!compare(current, item)) { - next = current->next; - if (cache->dohash) - drophashindex(cache,current, - cache->dohash(current)); - do_invalidate(cache,current,flags); - current = next; - count++; - } else { - previous = current; - current = current->next; - } - } - } - } - return (count); -} - -int ntfs_remove_cache(struct CACHE_HEADER *cache, - struct CACHED_GENERIC *item, int flags) -{ - int count; - - count = 0; - if (cache) { - if (cache->dohash) - drophashindex(cache,item,cache->dohash(item)); - do_invalidate(cache,item,flags); - count++; - } - return (count); -} - -/* - * Free memory allocated to a cache - */ - -static void ntfs_free_cache(struct CACHE_HEADER *cache) -{ - struct CACHED_GENERIC *entry; - - if (cache) { - for (entry=cache->most_recent_entry; entry; entry=entry->next) { - if (cache->dofree) - cache->dofree(entry); - if (entry->variable) - free(entry->variable); - } - free(cache); - } -} - -/* - * Create a cache - * - * Returns the cache header, or NULL if the cache could not be created - */ - -static struct CACHE_HEADER *ntfs_create_cache(const char *name, - cache_free dofree, cache_hash dohash, - int full_item_size, - int item_count, int max_hash) -{ - struct CACHE_HEADER *cache; - struct CACHED_GENERIC *pc; - struct CACHED_GENERIC *qc; - struct HASH_ENTRY *ph; - struct HASH_ENTRY *qh; - struct HASH_ENTRY **px; - size_t size; - int i; - - size = sizeof(struct CACHE_HEADER) + item_count*full_item_size; - if (max_hash) - size += item_count*sizeof(struct HASH_ENTRY) - + max_hash*sizeof(struct HASH_ENTRY*); - cache = (struct CACHE_HEADER*)ntfs_malloc(size); - if (cache) { - /* header */ - cache->name = name; - cache->dofree = dofree; - if (dohash && max_hash) { - cache->dohash = dohash; - cache->max_hash = max_hash; - } else { - cache->dohash = (cache_hash)NULL; - cache->max_hash = 0; - } - cache->fixed_size = full_item_size - sizeof(struct CACHED_GENERIC); - cache->reads = 0; - cache->writes = 0; - cache->hits = 0; - /* chain the data entries, and mark an invalid entry */ - cache->most_recent_entry = (struct CACHED_GENERIC*)NULL; - cache->oldest_entry = (struct CACHED_GENERIC*)NULL; - cache->free_entry = &cache->entry[0]; - pc = &cache->entry[0]; - for (i=0; i<(item_count - 1); i++) { - qc = (struct CACHED_GENERIC*)((char*)pc - + full_item_size); - pc->next = qc; - pc->variable = (void*)NULL; - pc->varsize = 0; - pc = qc; - } - /* special for the last entry */ - pc->next = (struct CACHED_GENERIC*)NULL; - pc->variable = (void*)NULL; - pc->varsize = 0; - - if (max_hash) { - /* chain the hash entries */ - ph = (struct HASH_ENTRY*)(((char*)pc) + full_item_size); - cache->free_hash = ph; - for (i=0; i<(item_count - 1); i++) { - qh = &ph[1]; - ph->next = qh; - ph = qh; - } - /* special for the last entry */ - if (item_count) { - ph->next = (struct HASH_ENTRY*)NULL; - } - /* create and initialize the hash indexes */ - px = (struct HASH_ENTRY**)&ph[1]; - cache->first_hash = px; - for (i=0; ifree_hash = (struct HASH_ENTRY*)NULL; - cache->first_hash = (struct HASH_ENTRY**)NULL; - } - } - return (cache); -} - -/* - * Create all LRU caches - * - * No error return, if creation is not possible, cacheing will - * just be not available - */ - -void ntfs_create_lru_caches(ntfs_volume *vol) -{ -#if CACHE_INODE_SIZE - /* inode cache */ - vol->xinode_cache = ntfs_create_cache("inode",(cache_free)NULL, - ntfs_dir_inode_hash, sizeof(struct CACHED_INODE), - CACHE_INODE_SIZE, 2*CACHE_INODE_SIZE); -#endif -#if CACHE_NIDATA_SIZE - /* idata cache */ - vol->nidata_cache = ntfs_create_cache("nidata", - ntfs_inode_nidata_free, ntfs_inode_nidata_hash, - sizeof(struct CACHED_NIDATA), - CACHE_NIDATA_SIZE, 2*CACHE_NIDATA_SIZE); -#endif -#if CACHE_LOOKUP_SIZE - /* lookup cache */ - vol->lookup_cache = ntfs_create_cache("lookup", - (cache_free)NULL, ntfs_dir_lookup_hash, - sizeof(struct CACHED_LOOKUP), - CACHE_LOOKUP_SIZE, 2*CACHE_LOOKUP_SIZE); -#endif - vol->securid_cache = ntfs_create_cache("securid",(cache_free)NULL, - (cache_hash)NULL,sizeof(struct CACHED_SECURID), CACHE_SECURID_SIZE, 0); -#if CACHE_LEGACY_SIZE - vol->legacy_cache = ntfs_create_cache("legacy",(cache_free)NULL, - (cache_hash)NULL, sizeof(struct CACHED_PERMISSIONS_LEGACY), CACHE_LEGACY_SIZE, 0); -#endif -} - -/* - * Free all LRU caches - */ - -void ntfs_free_lru_caches(ntfs_volume *vol) -{ -#if CACHE_INODE_SIZE - ntfs_free_cache(vol->xinode_cache); -#endif -#if CACHE_NIDATA_SIZE - ntfs_free_cache(vol->nidata_cache); -#endif -#if CACHE_LOOKUP_SIZE - ntfs_free_cache(vol->lookup_cache); -#endif - ntfs_free_cache(vol->securid_cache); -#if CACHE_LEGACY_SIZE - ntfs_free_cache(vol->legacy_cache); -#endif -} diff --git a/source/libs/libntfs/cache.h b/source/libs/libntfs/cache.h deleted file mode 100644 index 67e4f9da..00000000 --- a/source/libs/libntfs/cache.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * cache.h : deal with indexed LRU caches - * - * Copyright (c) 2008-2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_CACHE_H_ -#define _NTFS_CACHE_H_ - -#include "volume.h" - -struct CACHED_GENERIC { - struct CACHED_GENERIC *next; - struct CACHED_GENERIC *previous; - void *variable; - size_t varsize; - union { - /* force alignment for pointers and u64 */ - u64 u64align; - void *ptralign; - } fixed[0]; -} ; - -struct CACHED_INODE { - struct CACHED_INODE *next; - struct CACHED_INODE *previous; - const char *pathname; - size_t varsize; - /* above fields must match "struct CACHED_GENERIC" */ - u64 inum; -} ; - -struct CACHED_NIDATA { - struct CACHED_NIDATA *next; - struct CACHED_NIDATA *previous; - const char *pathname; /* not used */ - size_t varsize; /* not used */ - /* above fields must match "struct CACHED_GENERIC" */ - u64 inum; - ntfs_inode *ni; -} ; - -struct CACHED_LOOKUP { - struct CACHED_LOOKUP *next; - struct CACHED_LOOKUP *previous; - const char *name; - size_t namesize; - /* above fields must match "struct CACHED_GENERIC" */ - u64 parent; - u64 inum; -} ; - -enum { - CACHE_FREE = 1, - CACHE_NOHASH = 2 -} ; - -typedef int (*cache_compare)(const struct CACHED_GENERIC *cached, - const struct CACHED_GENERIC *item); -typedef void (*cache_free)(const struct CACHED_GENERIC *cached); -typedef int (*cache_hash)(const struct CACHED_GENERIC *cached); - -struct HASH_ENTRY { - struct HASH_ENTRY *next; - struct CACHED_GENERIC *entry; -} ; - -struct CACHE_HEADER { - const char *name; - struct CACHED_GENERIC *most_recent_entry; - struct CACHED_GENERIC *oldest_entry; - struct CACHED_GENERIC *free_entry; - struct HASH_ENTRY *free_hash; - struct HASH_ENTRY **first_hash; - cache_free dofree; - cache_hash dohash; - unsigned long reads; - unsigned long writes; - unsigned long hits; - int fixed_size; - int max_hash; - struct CACHED_GENERIC entry[0]; -} ; - - /* cast to generic, avoiding gcc warnings */ -#define GENERIC(pstr) ((const struct CACHED_GENERIC*)(const void*)(pstr)) - -struct CACHED_GENERIC *ntfs_fetch_cache(struct CACHE_HEADER *cache, - const struct CACHED_GENERIC *wanted, - cache_compare compare); -struct CACHED_GENERIC *ntfs_enter_cache(struct CACHE_HEADER *cache, - const struct CACHED_GENERIC *item, - cache_compare compare); -int ntfs_invalidate_cache(struct CACHE_HEADER *cache, - const struct CACHED_GENERIC *item, - cache_compare compare, int flags); -int ntfs_remove_cache(struct CACHE_HEADER *cache, - struct CACHED_GENERIC *item, int flags); - -void ntfs_create_lru_caches(ntfs_volume *vol); -void ntfs_free_lru_caches(ntfs_volume *vol); - -#endif /* _NTFS_CACHE_H_ */ - diff --git a/source/libs/libntfs/cache2.c b/source/libs/libntfs/cache2.c deleted file mode 100644 index fc8b80b1..00000000 --- a/source/libs/libntfs/cache2.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - cache.c - The cache is not visible to the user. It should be flushed - when any file is closed or changes are made to the filesystem. - - This cache implements a least-used-page replacement policy. This will - distribute sectors evenly over the pages, so if less than the maximum - pages are used at once, they should all eventually remain in the cache. - This also has the benefit of throwing out old sectors, so as not to keep - too many stale pages around. - - Copyright (c) 2006 Michael "Chishm" Chisholm - Copyright (c) 2009 shareese, rodries - Copyright (c) 2010 Dimok - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include - -#include "cache2.h" -#include "bit_ops.h" -#include "mem_allocate.h" - -#define CACHE_FREE UINT_MAX - -NTFS_CACHE* _NTFS_cache_constructor (unsigned int numberOfPages, unsigned int sectorsPerPage, const DISC_INTERFACE* discInterface, sec_t endOfPartition, sec_t sectorSize) { - NTFS_CACHE* cache; - unsigned int i; - NTFS_CACHE_ENTRY* cacheEntries; - - if(numberOfPages==0 || sectorsPerPage==0) return NULL; - - if (numberOfPages < 4) { - numberOfPages = 4; - } - - if (sectorsPerPage < 32) { - sectorsPerPage = 32; - } - - cache = (NTFS_CACHE*) ntfs_alloc (sizeof(NTFS_CACHE)); - if (cache == NULL) { - return NULL; - } - - cache->disc = discInterface; - cache->endOfPartition = endOfPartition; - cache->numberOfPages = numberOfPages; - cache->sectorsPerPage = sectorsPerPage; - cache->sectorSize = sectorSize; - - - cacheEntries = (NTFS_CACHE_ENTRY*) ntfs_alloc ( sizeof(NTFS_CACHE_ENTRY) * numberOfPages); - if (cacheEntries == NULL) { - ntfs_free (cache); - return NULL; - } - - for (i = 0; i < numberOfPages; i++) { - cacheEntries[i].sector = CACHE_FREE; - cacheEntries[i].count = 0; - cacheEntries[i].last_access = 0; - cacheEntries[i].dirty = false; - cacheEntries[i].cache = (uint8_t*) ntfs_align ( sectorsPerPage * cache->sectorSize ); - } - - cache->cacheEntries = cacheEntries; - - return cache; -} - -void _NTFS_cache_destructor (NTFS_CACHE* cache) { - unsigned int i; - - if(cache==NULL) return; - - // Clear out cache before destroying it - _NTFS_cache_flush(cache); - - // Free memory in reverse allocation order - for (i = 0; i < cache->numberOfPages; i++) { - ntfs_free (cache->cacheEntries[i].cache); - } - ntfs_free (cache->cacheEntries); - ntfs_free (cache); -} - -static u32 accessCounter = 0; - -static u32 accessTime(){ - accessCounter++; - return accessCounter; -} - -static NTFS_CACHE_ENTRY* _NTFS_cache_getPage(NTFS_CACHE *cache,sec_t sector) -{ - unsigned int i; - NTFS_CACHE_ENTRY* cacheEntries = cache->cacheEntries; - unsigned int numberOfPages = cache->numberOfPages; - unsigned int sectorsPerPage = cache->sectorsPerPage; - - bool foundFree = false; - unsigned int oldUsed = 0; - unsigned int oldAccess = UINT_MAX; - - for(i=0;i=cacheEntries[i].sector && sector<(cacheEntries[i].sector + cacheEntries[i].count)) { - cacheEntries[i].last_access = accessTime(); - return &(cacheEntries[i]); - } - - if(foundFree==false && (cacheEntries[i].sector==CACHE_FREE || cacheEntries[i].last_accessdisc->writeSectors(cacheEntries[oldUsed].sector,cacheEntries[oldUsed].count,cacheEntries[oldUsed].cache)) return NULL; - cacheEntries[oldUsed].dirty = false; - } - sector = (sector/sectorsPerPage)*sectorsPerPage; // align base sector to page size - sec_t next_page = sector + sectorsPerPage; - if(next_page > cache->endOfPartition) next_page = cache->endOfPartition; - - if(!cache->disc->readSectors(sector,next_page-sector,cacheEntries[oldUsed].cache)) return NULL; - - cacheEntries[oldUsed].sector = sector; - cacheEntries[oldUsed].count = next_page-sector; - cacheEntries[oldUsed].last_access = accessTime(); - - return &(cacheEntries[oldUsed]); -} - -static NTFS_CACHE_ENTRY* _NTFS_cache_findPage(NTFS_CACHE *cache, sec_t sector, sec_t count) { - - unsigned int i; - NTFS_CACHE_ENTRY* cacheEntries = cache->cacheEntries; - unsigned int numberOfPages = cache->numberOfPages; - NTFS_CACHE_ENTRY *entry = NULL; - sec_t lowest = UINT_MAX; - - for(i=0;i cacheEntries[i].sector) { - intersect = sector - cacheEntries[i].sector < cacheEntries[i].count; - } else { - intersect = cacheEntries[i].sector - sector < count; - } - - if ( intersect && (cacheEntries[i].sector < lowest)) { - lowest = cacheEntries[i].sector; - entry = &cacheEntries[i]; - } - } - } - - return entry; -} - -bool _NTFS_cache_readSectors(NTFS_CACHE *cache,sec_t sector,sec_t numSectors,void *buffer) -{ - sec_t sec; - sec_t secs_to_read; - NTFS_CACHE_ENTRY *entry; - uint8_t *dest = buffer; - - while(numSectors>0) { - entry = _NTFS_cache_getPage(cache,sector); - if(entry==NULL) return false; - - sec = sector - entry->sector; - secs_to_read = entry->count - sec; - if(secs_to_read>numSectors) secs_to_read = numSectors; - - memcpy(dest,entry->cache + (sec*cache->sectorSize),(secs_to_read*cache->sectorSize)); - - dest += (secs_to_read*cache->sectorSize); - sector += secs_to_read; - numSectors -= secs_to_read; - } - - return true; -} - -/* -Reads some data from a cache page, determined by the sector number -*/ - -bool _NTFS_cache_readPartialSector (NTFS_CACHE* cache, void* buffer, sec_t sector, unsigned int offset, size_t size) -{ - sec_t sec; - NTFS_CACHE_ENTRY *entry; - - if (offset + size > cache->sectorSize) return false; - - entry = _NTFS_cache_getPage(cache,sector); - if(entry==NULL) return false; - - sec = sector - entry->sector; - memcpy(buffer,entry->cache + ((sec*cache->sectorSize) + offset),size); - - return true; -} - -bool _NTFS_cache_readLittleEndianValue (NTFS_CACHE* cache, uint32_t *value, sec_t sector, unsigned int offset, int num_bytes) { - uint8_t buf[4]; - if (!_NTFS_cache_readPartialSector(cache, buf, sector, offset, num_bytes)) return false; - - switch(num_bytes) { - case 1: *value = buf[0]; break; - case 2: *value = u8array_to_u16(buf,0); break; - case 4: *value = u8array_to_u32(buf,0); break; - default: return false; - } - return true; -} - -/* -Writes some data to a cache page, making sure it is loaded into memory first. -*/ - -bool _NTFS_cache_writePartialSector (NTFS_CACHE* cache, const void* buffer, sec_t sector, unsigned int offset, size_t size) -{ - sec_t sec; - NTFS_CACHE_ENTRY *entry; - - if (offset + size > cache->sectorSize) return false; - - entry = _NTFS_cache_getPage(cache,sector); - if(entry==NULL) return false; - - sec = sector - entry->sector; - memcpy(entry->cache + ((sec*cache->sectorSize) + offset),buffer,size); - - entry->dirty = true; - return true; -} - -bool _NTFS_cache_writeLittleEndianValue (NTFS_CACHE* cache, const uint32_t value, sec_t sector, unsigned int offset, int size) { - uint8_t buf[4] = {0, 0, 0, 0}; - - switch(size) { - case 1: buf[0] = value; break; - case 2: u16_to_u8array(buf, 0, value); break; - case 4: u32_to_u8array(buf, 0, value); break; - default: return false; - } - - return _NTFS_cache_writePartialSector(cache, buf, sector, offset, size); -} - -/* -Writes some data to a cache page, zeroing out the page first -*/ - -bool _NTFS_cache_eraseWritePartialSector (NTFS_CACHE* cache, const void* buffer, sec_t sector, unsigned int offset, size_t size) -{ - sec_t sec; - NTFS_CACHE_ENTRY *entry; - - if (offset + size > cache->sectorSize) return false; - - entry = _NTFS_cache_getPage(cache,sector); - if(entry==NULL) return false; - - sec = sector - entry->sector; - memset(entry->cache + (sec*cache->sectorSize),0,cache->sectorSize); - memcpy(entry->cache + ((sec*cache->sectorSize) + offset),buffer,size); - - entry->dirty = true; - return true; -} - -bool _NTFS_cache_writeSectors (NTFS_CACHE* cache, sec_t sector, sec_t numSectors, const void* buffer) -{ - sec_t sec; - sec_t secs_to_write; - NTFS_CACHE_ENTRY* entry; - const uint8_t *src = buffer; - - while(numSectors>0) - { - entry = _NTFS_cache_findPage(cache,sector,numSectors); - - if(entry!=NULL) { - - if ( entry->sector > sector) { - - secs_to_write = entry->sector - sector; - - cache->disc->writeSectors(sector,secs_to_write,src); - src += (secs_to_write*cache->sectorSize); - sector += secs_to_write; - numSectors -= secs_to_write; - } - - sec = sector - entry->sector; - secs_to_write = entry->count - sec; - - if(secs_to_write>numSectors) secs_to_write = numSectors; - - memcpy(entry->cache + (sec*cache->sectorSize),src,(secs_to_write*cache->sectorSize)); - - src += (secs_to_write*cache->sectorSize); - sector += secs_to_write; - numSectors -= secs_to_write; - - entry->dirty = true; - - } else { - cache->disc->writeSectors(sector,numSectors,src); - numSectors=0; - } - } - return true; -} - -/* -Flushes all dirty pages to disc, clearing the dirty flag. -*/ -bool _NTFS_cache_flush (NTFS_CACHE* cache) { - unsigned int i; - if(cache==NULL) return true; - - for (i = 0; i < cache->numberOfPages; i++) { - if (cache->cacheEntries[i].dirty) { - if (!cache->disc->writeSectors (cache->cacheEntries[i].sector, cache->cacheEntries[i].count, cache->cacheEntries[i].cache)) { - return false; - } - } - cache->cacheEntries[i].dirty = false; - } - - return true; -} - -void _NTFS_cache_invalidate (NTFS_CACHE* cache) { - unsigned int i; - if(cache==NULL) - return; - - _NTFS_cache_flush(cache); - for (i = 0; i < cache->numberOfPages; i++) { - cache->cacheEntries[i].sector = CACHE_FREE; - cache->cacheEntries[i].last_access = 0; - cache->cacheEntries[i].count = 0; - cache->cacheEntries[i].dirty = false; - } -} \ No newline at end of file diff --git a/source/libs/libntfs/cache2.h b/source/libs/libntfs/cache2.h deleted file mode 100644 index 21daca7c..00000000 --- a/source/libs/libntfs/cache2.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - NTFS_CACHE.h - The NTFS_CACHE is not visible to the user. It should be flushed - when any file is closed or changes are made to the filesystem. - - This NTFS_CACHE implements a least-used-page replacement policy. This will - distribute sectors evenly over the pages, so if less than the maximum - pages are used at once, they should all eventually remain in the NTFS_CACHE. - This also has the benefit of throwing out old sectors, so as not to keep - too many stale pages around. - - Copyright (c) 2006 Michael "Chishm" Chisholm - Copyright (c) 2009 shareese, rodries - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef _CACHE2_H -#define _CACHE2_H - -//#include "common.h" -//#include "disc.h" - -#include -#include -#include -#include -#include - -typedef struct { - sec_t sector; - unsigned int count; - u64 last_access; - bool dirty; - u8* cache; -} NTFS_CACHE_ENTRY; - -typedef struct { - const DISC_INTERFACE* disc; - sec_t endOfPartition; - unsigned int numberOfPages; - unsigned int sectorsPerPage; - sec_t sectorSize; - NTFS_CACHE_ENTRY* cacheEntries; -} NTFS_CACHE; - -/* -Read data from a sector in the NTFS_CACHE -If the sector is not in the NTFS_CACHE, it will be swapped in -offset is the position to start reading from -size is the amount of data to read -Precondition: offset + size <= BYTES_PER_READ -*/ -//bool _NTFS_cache_readPartialSector (NTFS_CACHE* NTFS_CACHE, void* buffer, sec_t sector, unsigned int offset, size_t size); - -//bool _NTFS_cache_readLittleEndianValue (NTFS_CACHE* NTFS_CACHE, uint32_t *value, sec_t sector, unsigned int offset, int num_bytes); - -/* -Write data to a sector in the NTFS_CACHE -If the sector is not in the NTFS_CACHE, it will be swapped in. -When the sector is swapped out, the data will be written to the disc -offset is the position to start writing to -size is the amount of data to write -Precondition: offset + size <= BYTES_PER_READ -*/ -//bool _NTFS_cache_writePartialSector (NTFS_CACHE* NTFS_CACHE, const void* buffer, sec_t sector, unsigned int offset, size_t size); - -//bool _NTFS_cache_writeLittleEndianValue (NTFS_CACHE* NTFS_CACHE, const uint32_t value, sec_t sector, unsigned int offset, int num_bytes); - -/* -Write data to a sector in the NTFS_CACHE, zeroing the sector first -If the sector is not in the NTFS_CACHE, it will be swapped in. -When the sector is swapped out, the data will be written to the disc -offset is the position to start writing to -size is the amount of data to write -Precondition: offset + size <= BYTES_PER_READ -*/ -//bool _NTFS_cache_eraseWritePartialSector (NTFS_CACHE* NTFS_CACHE, const void* buffer, sec_t sector, unsigned int offset, size_t size); - -/* -Read several sectors from the NTFS_CACHE -*/ -bool _NTFS_cache_readSectors (NTFS_CACHE* NTFS_CACHE, sec_t sector, sec_t numSectors, void* buffer); - -/* -Read a full sector from the NTFS_CACHE -*/ -//static inline bool _NTFS_cache_readSector (NTFS_CACHE* NTFS_CACHE, void* buffer, sec_t sector) { -// return _NTFS_cache_readPartialSector (NTFS_CACHE, buffer, sector, 0, BYTES_PER_READ); -//} - -/* -Write a full sector to the NTFS_CACHE -*/ -//static inline bool _NTFS_cache_writeSector (NTFS_CACHE* NTFS_CACHE, const void* buffer, sec_t sector) { -// return _NTFS_cache_writePartialSector (NTFS_CACHE, buffer, sector, 0, BYTES_PER_READ); -//} - -bool _NTFS_cache_writeSectors (NTFS_CACHE* NTFS_CACHE, sec_t sector, sec_t numSectors, const void* buffer); - -/* -Write any dirty sectors back to disc and clear out the contents of the NTFS_CACHE -*/ -bool _NTFS_cache_flush (NTFS_CACHE* NTFS_CACHE); - -/* -Clear out the contents of the NTFS_CACHE without writing any dirty sectors first -*/ -void _NTFS_cache_invalidate (NTFS_CACHE* NTFS_CACHE); - -NTFS_CACHE* _NTFS_cache_constructor (unsigned int numberOfPages, unsigned int sectorsPerPage, const DISC_INTERFACE* discInterface, sec_t endOfPartition, sec_t sectorSize); - -void _NTFS_cache_destructor (NTFS_CACHE* NTFS_CACHE); - -#endif // _CACHE_H - diff --git a/source/libs/libntfs/collate.c b/source/libs/libntfs/collate.c deleted file mode 100644 index 5f7a015a..00000000 --- a/source/libs/libntfs/collate.c +++ /dev/null @@ -1,271 +0,0 @@ -/** - * collate.c - NTFS collation handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2004 Anton Altaparmakov - * Copyright (c) 2005 Yura Pakhuchiy - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "attrib.h" -#include "index.h" -#include "collate.h" -#include "debug.h" -#include "unistr.h" -#include "logging.h" - -/** - * ntfs_collate_binary - Which of two binary objects should be listed first - * @vol: unused - * @data1: - * @data1_len: - * @data2: - * @data2_len: - * - * Description... - * - * Returns: - */ -static int ntfs_collate_binary(ntfs_volume *vol __attribute__((unused)), - const void *data1, const int data1_len, - const void *data2, const int data2_len) -{ - int rc; - - ntfs_log_trace("Entering.\n"); - rc = memcmp(data1, data2, min(data1_len, data2_len)); - if (!rc && (data1_len != data2_len)) { - if (data1_len < data2_len) - rc = -1; - else - rc = 1; - } - ntfs_log_trace("Done, returning %i.\n", rc); - return rc; -} - -/** - * ntfs_collate_ntofs_ulong - Which of two long ints should be listed first - * @vol: unused - * @data1: - * @data1_len: - * @data2: - * @data2_len: - * - * Description... - * - * Returns: - */ -static int ntfs_collate_ntofs_ulong(ntfs_volume *vol __attribute__((unused)), - const void *data1, const int data1_len, - const void *data2, const int data2_len) -{ - int rc; - u32 d1, d2; - - ntfs_log_trace("Entering.\n"); - if (data1_len != data2_len || data1_len != 4) { - ntfs_log_error("data1_len or/and data2_len not equal to 4.\n"); - return NTFS_COLLATION_ERROR; - } - d1 = le32_to_cpup(data1); - d2 = le32_to_cpup(data2); - if (d1 < d2) - rc = -1; - else { - if (d1 == d2) - rc = 0; - else - rc = 1; - } - ntfs_log_trace("Done, returning %i.\n", rc); - return rc; -} - -/** - * ntfs_collate_ntofs_ulongs - Which of two le32 arrays should be listed first - * - * Returns: -1, 0 or 1 depending of how the arrays compare - */ - -static int ntfs_collate_ntofs_ulongs(ntfs_volume *vol __attribute__((unused)), - const void *data1, const int data1_len, - const void *data2, const int data2_len) -{ - int rc; - int len; - const le32 *p1, *p2; - u32 d1, d2; - - ntfs_log_trace("Entering.\n"); - if ((data1_len != data2_len) || (data1_len <= 0) || (data1_len & 3)) { - ntfs_log_error("data1_len or data2_len not valid\n"); - return NTFS_COLLATION_ERROR; - } - p1 = (const le32*)data1; - p2 = (const le32*)data2; - len = data1_len; - do { - d1 = le32_to_cpup(p1); - p1++; - d2 = le32_to_cpup(p2); - p2++; - } while ((d1 == d2) && ((len -= 4) > 0)); - if (d1 < d2) - rc = -1; - else { - if (d1 == d2) - rc = 0; - else - rc = 1; - } - ntfs_log_trace("Done, returning %i.\n", rc); - return rc; -} - -/** - * ntfs_collate_ntofs_security_hash - Which of two security descriptors - * should be listed first - * @vol: unused - * @data1: - * @data1_len: - * @data2: - * @data2_len: - * - * JPA compare two security hash keys made of two unsigned le32 - * - * Returns: -1, 0 or 1 depending of how the keys compare - */ -static int ntfs_collate_ntofs_security_hash(ntfs_volume *vol __attribute__((unused)), - const void *data1, const int data1_len, - const void *data2, const int data2_len) -{ - int rc; - u32 d1, d2; - const le32 *p1, *p2; - - ntfs_log_trace("Entering.\n"); - if (data1_len != data2_len || data1_len != 8) { - ntfs_log_error("data1_len or/and data2_len not equal to 8.\n"); - return NTFS_COLLATION_ERROR; - } - p1 = (const le32*)data1; - p2 = (const le32*)data2; - d1 = le32_to_cpup(p1); - d2 = le32_to_cpup(p2); - if (d1 < d2) - rc = -1; - else { - if (d1 > d2) - rc = 1; - else { - p1++; - p2++; - d1 = le32_to_cpup(p1); - d2 = le32_to_cpup(p2); - if (d1 < d2) - rc = -1; - else { - if (d1 > d2) - rc = 1; - else - rc = 0; - } - } - } - ntfs_log_trace("Done, returning %i.\n", rc); - return rc; -} - -/** - * ntfs_collate_file_name - Which of two filenames should be listed first - * @vol: - * @data1: - * @data1_len: unused - * @data2: - * @data2_len: unused - * - * Description... - * - * Returns: - */ -static int ntfs_collate_file_name(ntfs_volume *vol, - const void *data1, const int data1_len __attribute__((unused)), - const void *data2, const int data2_len __attribute__((unused))) -{ - const FILE_NAME_ATTR *file_name_attr1; - const FILE_NAME_ATTR *file_name_attr2; - int rc; - - ntfs_log_trace("Entering.\n"); - file_name_attr1 = (const FILE_NAME_ATTR*)data1; - file_name_attr2 = (const FILE_NAME_ATTR*)data2; - rc = ntfs_names_full_collate( - (ntfschar*)&file_name_attr1->file_name, - file_name_attr1->file_name_length, - (ntfschar*)&file_name_attr2->file_name, - file_name_attr2->file_name_length, - CASE_SENSITIVE, vol->upcase, vol->upcase_len); - ntfs_log_trace("Done, returning %i.\n", rc); - return rc; -} - -/* - * Get a pointer to appropriate collation function. - * - * Returns NULL if the needed function is not implemented - */ - -COLLATE ntfs_get_collate_function(COLLATION_RULES cr) -{ - COLLATE collate; - - switch (cr) { - case COLLATION_BINARY : - collate = ntfs_collate_binary; - break; - case COLLATION_FILE_NAME : - collate = ntfs_collate_file_name; - break; - case COLLATION_NTOFS_SECURITY_HASH : - collate = ntfs_collate_ntofs_security_hash; - break; - case COLLATION_NTOFS_ULONG : - collate = ntfs_collate_ntofs_ulong; - break; - case COLLATION_NTOFS_ULONGS : - collate = ntfs_collate_ntofs_ulongs; - break; - default : - errno = EOPNOTSUPP; - collate = (COLLATE)NULL; - break; - } - return (collate); -} diff --git a/source/libs/libntfs/collate.h b/source/libs/libntfs/collate.h deleted file mode 100644 index fe383835..00000000 --- a/source/libs/libntfs/collate.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * collate.h - Defines for NTFS collation handling. Originated from the Linux-NTFS - * project. - * - * Copyright (c) 2004 Anton Altaparmakov - * Copyright (c) 2005 Yura Pakhuchiy - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_COLLATE_H -#define _NTFS_COLLATE_H - -#include "types.h" -#include "volume.h" - -#define NTFS_COLLATION_ERROR -2 - -extern COLLATE ntfs_get_collate_function(COLLATION_RULES); - -#endif /* _NTFS_COLLATE_H */ diff --git a/source/libs/libntfs/compat.c b/source/libs/libntfs/compat.c deleted file mode 100644 index 63114a48..00000000 --- a/source/libs/libntfs/compat.c +++ /dev/null @@ -1,250 +0,0 @@ -/** - * compat.c - Tweaks for Windows compatibility - * - * Copyright (c) 2002 Richard Russon - * Copyright (c) 2002-2004 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "compat.h" - -#ifndef HAVE_FFS -/** - * ffs - Find the first set bit in an int - * @x: - * - * Description... - * - * Returns: - */ -int ffs(int x) -{ - int r = 1; - - if (!x) - return 0; - if (!(x & 0xffff)) { - x >>= 16; - r += 16; - } - if (!(x & 0xff)) { - x >>= 8; - r += 8; - } - if (!(x & 0xf)) { - x >>= 4; - r += 4; - } - if (!(x & 3)) { - x >>= 2; - r += 2; - } - if (!(x & 1)) { - x >>= 1; - r += 1; - } - return r; -} -#endif /* HAVE_FFS */ - -#ifndef HAVE_DAEMON -/* ************************************************************ - * From: src.opensolaris.org - * src/lib/libresolv2/common/bsd/daemon.c - */ -/* - * Copyright (c) 1997-2000 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)daemon.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: compat.c,v 1.1.1.1.2.1 2008-08-16 15:17:44 jpandre Exp $"; -#endif /* LIBC_SCCS and not lint */ - -/* - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -int daemon(int nochdir, int noclose) { - int fd; - - switch (fork()) { - case -1: - return (-1); - case 0: - break; - default: - _exit(0); - } - - if (setsid() == -1) - return (-1); - - if (!nochdir) - (void)chdir("/"); - - if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { - (void)dup2(fd, 0); - (void)dup2(fd, 1); - (void)dup2(fd, 2); - if (fd > 2) - (void)close (fd); - } - return (0); -} -/* - * End: src/lib/libresolv2/common/bsd/daemon.c - *************************************************************/ -#endif /* HAVE_DAEMON */ - -#ifndef HAVE_STRSEP -/* ************************************************************ - * From: src.opensolaris.org - * src/lib/libresolv2/common/bsd/strsep.c - */ -/* - * Copyright (c) 1997, by Sun Microsystems, Inc. - * All rights reserved. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "strsep.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: compat.c,v 1.1.1.1.2.1 2008-08-16 15:17:44 jpandre Exp $"; -#endif /* LIBC_SCCS and not lint */ - -/* - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif - -/* - * Get next token from string *stringp, where tokens are possibly-empty - * strings separated by characters from delim. - * - * Writes NULs into the string at *stringp to end tokens. - * delim need not remain constant from call to call. - * On return, *stringp points past the last NUL written (if there might - * be further tokens), or is NULL (if there are definitely no more tokens). - * - * If *stringp is NULL, strsep returns NULL. - */ -char *strsep(char **stringp, const char *delim) { - char *s; - const char *spanp; - int c, sc; - char *tok; - - if ((s = *stringp) == NULL) - return (NULL); - for (tok = s;;) { - c = *s++; - spanp = delim; - do { - if ((sc = *spanp++) == c) { - if (c == 0) - s = NULL; - else - s[-1] = 0; - *stringp = s; - return (tok); - } - } while (sc != 0); - } - /* NOTREACHED */ -} - -/* - * End: src/lib/libresolv2/common/bsd/strsep.c - *************************************************************/ -#endif /* HAVE_STRSEP */ - diff --git a/source/libs/libntfs/compat.h b/source/libs/libntfs/compat.h deleted file mode 100644 index 957752a0..00000000 --- a/source/libs/libntfs/compat.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * compat.h - Tweaks for Windows compatibility. - * - * Copyright (c) 2002 Richard Russon - * Copyright (c) 2002-2004 Anton Altaparmakov - * Copyright (c) 2008-2009 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_COMPAT_H -#define _NTFS_COMPAT_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - -#ifndef HAVE_FFS -extern int ffs(int i); -#endif /* HAVE_FFS */ - -#ifndef HAVE_DAEMON -extern int daemon(int nochdir, int noclose); -#endif /* HAVE_DAEMON */ - -#ifndef HAVE_STRSEP -extern char *strsep(char **stringp, const char *delim); -#endif /* HAVE_STRSEP */ - -#ifdef WINDOWS - -#define HAVE_STDIO_H /* mimic config.h */ -#define HAVE_STDARG_H - -#define atoll _atoi64 -#define fdatasync commit -#define __inline__ inline -#define __attribute__(X) /*nothing*/ - -#else /* !defined WINDOWS */ - -#ifndef O_BINARY -#define O_BINARY 0 /* unix is binary by default */ -#endif - -#ifdef GEKKO - -#include "mem_allocate.h" - -#define XATTR_CREATE 1 -#define XATTR_REPLACE 2 - -#define MINORBITS 20 -#define MINORMASK ((1U << MINORBITS) - 1) - -#define major(dev) ((unsigned int) ((dev) >> MINORBITS)) -#define minor(dev) ((unsigned int) ((dev) & MINORMASK)) -#define mkdev(ma,mi) (((ma) << MINORBITS) | (mi)) -#define random rand - -#endif /* defined GEKKO */ - -#endif /* defined WINDOWS */ - -#endif /* defined _NTFS_COMPAT_H */ - diff --git a/source/libs/libntfs/compress.c b/source/libs/libntfs/compress.c deleted file mode 100644 index fbd30ba9..00000000 --- a/source/libs/libntfs/compress.c +++ /dev/null @@ -1,1831 +0,0 @@ -/** - * compress.c - Compressed attribute handling code. Originated from the Linux-NTFS - * project. - * - * Copyright (c) 2004-2005 Anton Altaparmakov - * Copyright (c) 2004-2006 Szabolcs Szakacsits - * Copyright (c) 2005 Yura Pakhuchiy - * Copyright (c) 2009-2010 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * A part of the compression algorithm is based on lzhuf.c whose header - * describes the roles of the original authors (with no apparent copyright - * notice, and according to http://home.earthlink.net/~neilbawd/pall.html - * this was put into public domain in 1988 by Haruhiko OKUMURA). - * - * LZHUF.C English version 1.0 - * Based on Japanese version 29-NOV-1988 - * LZSS coded by Haruhiko OKUMURA - * Adaptive Huffman Coding coded by Haruyasu YOSHIZAKI - * Edited and translated to English by Kenji RIKITAKE - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "attrib.h" -#include "debug.h" -#include "volume.h" -#include "types.h" -#include "layout.h" -#include "runlist.h" -#include "compress.h" -#include "lcnalloc.h" -#include "logging.h" -#include "misc.h" - -/** - * enum ntfs_compression_constants - constants used in the compression code - */ -typedef enum { - /* Token types and access mask. */ - NTFS_SYMBOL_TOKEN = 0, - NTFS_PHRASE_TOKEN = 1, - NTFS_TOKEN_MASK = 1, - - /* Compression sub-block constants. */ - NTFS_SB_SIZE_MASK = 0x0fff, - NTFS_SB_SIZE = 0x1000, - NTFS_SB_IS_COMPRESSED = 0x8000, -} ntfs_compression_constants; - -#define THRESHOLD 3 /* minimal match length for compression */ -#define NIL NTFS_SB_SIZE /* End of tree's node */ - -struct COMPRESS_CONTEXT { - const unsigned char *inbuf; - unsigned int len; - unsigned int nbt; - int match_position; - unsigned int match_length; - u16 lson[NTFS_SB_SIZE + 1]; - u16 rson[NTFS_SB_SIZE + 257]; - u16 dad[NTFS_SB_SIZE + 1]; -} ; - -/* - * Initialize the match tree - */ - -static void ntfs_init_compress_tree(struct COMPRESS_CONTEXT *pctx) -{ - int i; - - for (i = NTFS_SB_SIZE + 1; i <= NTFS_SB_SIZE + 256; i++) - pctx->rson[i] = NIL; /* root */ - for (i = 0; i < NTFS_SB_SIZE; i++) - pctx->dad[i] = NIL; /* node */ -} - -/* - * Insert a new node into match tree for quickly locating - * further similar strings - */ - -static void ntfs_new_node (struct COMPRESS_CONTEXT *pctx, - unsigned int r) -{ - unsigned int pp; - BOOL less; - BOOL done; - const unsigned char *key; - int c; - unsigned long mxi; - unsigned int mxl; - - mxl = (1 << (16 - pctx->nbt)) + 2; - less = FALSE; - done = FALSE; - key = &pctx->inbuf[r]; - pp = NTFS_SB_SIZE + 1 + key[0]; - pctx->rson[r] = pctx->lson[r] = NIL; - pctx->match_length = 0; - do { - if (!less) { - if (pctx->rson[pp] != NIL) - pp = pctx->rson[pp]; - else { - pctx->rson[pp] = r; - pctx->dad[r] = pp; - done = TRUE; - } - } else { - if (pctx->lson[pp] != NIL) - pp = pctx->lson[pp]; - else { - pctx->lson[pp] = r; - pctx->dad[r] = pp; - done = TRUE; - } - } - if (!done) { - register unsigned long i; - register const unsigned char *p1,*p2; - - i = 1; - mxi = NTFS_SB_SIZE - r; - if (mxi < 2) - less = FALSE; - else { - p1 = key; - p2 = &pctx->inbuf[pp]; - /* this loop has a significant impact on performances */ - do { - } while ((p1[i] == p2[i]) && (++i < mxi)); - less = (i < mxi) && (p1[i] < p2[i]); - } - if (i >= THRESHOLD) { - if (i > pctx->match_length) { - pctx->match_position = - r - pp + 2*NTFS_SB_SIZE - 1; - if ((pctx->match_length = i) > mxl) { - i = pctx->rson[pp]; - pctx->rson[r] = i; - pctx->dad[i] = r; - i = pctx->lson[pp]; - pctx->lson[r] = i; - pctx->dad[i] = r; - i = pctx->dad[pp]; - pctx->dad[r] = i; - if (pctx->rson[i] == pp) - pctx->rson[i] = r; - else - pctx->lson[i] = r; - /* remove pp */ - pctx->dad[pp] = NIL; - done = TRUE; - pctx->match_length = mxl; - } - } else - if ((i == pctx->match_length) - && ((c = (r - pp + 2*NTFS_SB_SIZE - 1)) - < pctx->match_position)) - pctx->match_position = c; - } - } - } while (!done); -} - -/* - * Search for the longest previous string matching the - * current one - * - * Returns the end of the longest current string which matched - * or zero if there was a bug - */ - -static unsigned int ntfs_nextmatch(struct COMPRESS_CONTEXT *pctx, - unsigned int rr, int dd) -{ - unsigned int bestlen = 0; - - do { - rr++; - if (pctx->match_length > 0) - pctx->match_length--; - if (!pctx->len) { - ntfs_log_error("compress bug : void run\n"); - goto bug; - } - if (--pctx->len) { - if (rr >= NTFS_SB_SIZE) { - ntfs_log_error("compress bug : buffer overflow\n"); - goto bug; - } - if (((rr + bestlen) < NTFS_SB_SIZE)) { - while ((unsigned int)(1 << pctx->nbt) - <= (rr - 1)) - pctx->nbt++; - ntfs_new_node(pctx,rr); - if (pctx->match_length > bestlen) - bestlen = pctx->match_length; - } else - if (dd > 0) { - rr += dd; - if ((int)pctx->match_length > dd) - pctx->match_length -= dd; - else - pctx->match_length = 0; - if ((int)pctx->len < dd) { - ntfs_log_error("compress bug : run overflows\n"); - goto bug; - } - pctx->len -= dd; - dd = 0; - } - } - } while (dd-- > 0); - return (rr); -bug : - return (0); -} - -/* - * Compress an input block - * - * Returns the size of the compressed block (including header) - * or zero if there was an error - */ - -static unsigned int ntfs_compress_block(const char *inbuf, - unsigned int size, char *outbuf) -{ - struct COMPRESS_CONTEXT *pctx; - char *ptag; - int dd; - unsigned int rr; - unsigned int last_match_length; - unsigned int q; - unsigned int xout; - unsigned int ntag; - - pctx = (struct COMPRESS_CONTEXT*)malloc(sizeof(struct COMPRESS_CONTEXT)); - if (pctx) { - pctx->inbuf = (const unsigned char*)inbuf; - ntfs_init_compress_tree(pctx); - xout = 2; - ntag = 0; - ptag = &outbuf[xout++]; - *ptag = 0; - rr = 0; - pctx->nbt = 4; - pctx->len = size; - pctx->match_length = 0; - ntfs_new_node(pctx,0); - do { - if (pctx->match_length > pctx->len) - pctx->match_length = pctx->len; - if (pctx->match_length < THRESHOLD) { - pctx->match_length = 1; - if (ntag >= 8) { - ntag = 0; - ptag = &outbuf[xout++]; - *ptag = 0; - } - outbuf[xout++] = inbuf[rr]; - ntag++; - } else { - while ((unsigned int)(1 << pctx->nbt) - <= (rr - 1)) - pctx->nbt++; - q = (pctx->match_position << (16 - pctx->nbt)) - + pctx->match_length - THRESHOLD; - if (ntag >= 8) { - ntag = 0; - ptag = &outbuf[xout++]; - *ptag = 0; - } - *ptag |= 1 << ntag++; - outbuf[xout++] = q & 255; - outbuf[xout++] = (q >> 8) & 255; - } - last_match_length = pctx->match_length; - dd = last_match_length; - if (dd-- > 0) { - rr = ntfs_nextmatch(pctx,rr,dd); - if (!rr) - goto bug; - } - /* - * stop if input is exhausted or output has exceeded - * the maximum size. Two extra bytes have to be - * reserved in output buffer, as 3 bytes may be - * output in a loop. - */ - } while ((pctx->len > 0) - && (rr < size) && (xout < (NTFS_SB_SIZE + 2))); - /* uncompressed must be full size, so accept if better */ - if (xout < (NTFS_SB_SIZE + 2)) { - outbuf[0] = (xout - 3) & 255; - outbuf[1] = 0xb0 + (((xout - 3) >> 8) & 15); - } else { - memcpy(&outbuf[2],inbuf,size); - if (size < NTFS_SB_SIZE) - memset(&outbuf[size+2],0,NTFS_SB_SIZE - size); - outbuf[0] = 0xff; - outbuf[1] = 0x3f; - xout = NTFS_SB_SIZE + 2; - } - free(pctx); - } else { - xout = 0; - errno = ENOMEM; - } - return (xout); /* 0 for an error, > size if cannot compress */ -bug : - return (0); -} - -/** - * ntfs_decompress - decompress a compression block into an array of pages - * @dest: buffer to which to write the decompressed data - * @dest_size: size of buffer @dest in bytes - * @cb_start: compression block to decompress - * @cb_size: size of compression block @cb_start in bytes - * - * This decompresses the compression block @cb_start into the destination - * buffer @dest. - * - * @cb_start is a pointer to the compression block which needs decompressing - * and @cb_size is the size of @cb_start in bytes (8-64kiB). - * - * Return 0 if success or -EOVERFLOW on error in the compressed stream. - */ -static int ntfs_decompress(u8 *dest, const u32 dest_size, - u8 *const cb_start, const u32 cb_size) -{ - /* - * Pointers into the compressed data, i.e. the compression block (cb), - * and the therein contained sub-blocks (sb). - */ - u8 *cb_end = cb_start + cb_size; /* End of cb. */ - u8 *cb = cb_start; /* Current position in cb. */ - u8 *cb_sb_start = cb; /* Beginning of the current sb in the cb. */ - u8 *cb_sb_end; /* End of current sb / beginning of next sb. */ - /* Variables for uncompressed data / destination. */ - u8 *dest_end = dest + dest_size; /* End of dest buffer. */ - u8 *dest_sb_start; /* Start of current sub-block in dest. */ - u8 *dest_sb_end; /* End of current sb in dest. */ - /* Variables for tag and token parsing. */ - u8 tag; /* Current tag. */ - int token; /* Loop counter for the eight tokens in tag. */ - - ntfs_log_trace("Entering, cb_size = 0x%x.\n", (unsigned)cb_size); -do_next_sb: - ntfs_log_debug("Beginning sub-block at offset = %d in the cb.\n", - (int)(cb - cb_start)); - /* - * Have we reached the end of the compression block or the end of the - * decompressed data? The latter can happen for example if the current - * position in the compression block is one byte before its end so the - * first two checks do not detect it. - */ - if (cb == cb_end || !le16_to_cpup((le16*)cb) || dest == dest_end) { - ntfs_log_debug("Completed. Returning success (0).\n"); - return 0; - } - /* Setup offset for the current sub-block destination. */ - dest_sb_start = dest; - dest_sb_end = dest + NTFS_SB_SIZE; - /* Check that we are still within allowed boundaries. */ - if (dest_sb_end > dest_end) - goto return_overflow; - /* Does the minimum size of a compressed sb overflow valid range? */ - if (cb + 6 > cb_end) - goto return_overflow; - /* Setup the current sub-block source pointers and validate range. */ - cb_sb_start = cb; - cb_sb_end = cb_sb_start + (le16_to_cpup((le16*)cb) & NTFS_SB_SIZE_MASK) - + 3; - if (cb_sb_end > cb_end) - goto return_overflow; - /* Now, we are ready to process the current sub-block (sb). */ - if (!(le16_to_cpup((le16*)cb) & NTFS_SB_IS_COMPRESSED)) { - ntfs_log_debug("Found uncompressed sub-block.\n"); - /* This sb is not compressed, just copy it into destination. */ - /* Advance source position to first data byte. */ - cb += 2; - /* An uncompressed sb must be full size. */ - if (cb_sb_end - cb != NTFS_SB_SIZE) - goto return_overflow; - /* Copy the block and advance the source position. */ - memcpy(dest, cb, NTFS_SB_SIZE); - cb += NTFS_SB_SIZE; - /* Advance destination position to next sub-block. */ - dest += NTFS_SB_SIZE; - goto do_next_sb; - } - ntfs_log_debug("Found compressed sub-block.\n"); - /* This sb is compressed, decompress it into destination. */ - /* Forward to the first tag in the sub-block. */ - cb += 2; -do_next_tag: - if (cb == cb_sb_end) { - /* Check if the decompressed sub-block was not full-length. */ - if (dest < dest_sb_end) { - int nr_bytes = dest_sb_end - dest; - - ntfs_log_debug("Filling incomplete sub-block with zeroes.\n"); - /* Zero remainder and update destination position. */ - memset(dest, 0, nr_bytes); - dest += nr_bytes; - } - /* We have finished the current sub-block. */ - goto do_next_sb; - } - /* Check we are still in range. */ - if (cb > cb_sb_end || dest > dest_sb_end) - goto return_overflow; - /* Get the next tag and advance to first token. */ - tag = *cb++; - /* Parse the eight tokens described by the tag. */ - for (token = 0; token < 8; token++, tag >>= 1) { - u16 lg, pt, length, max_non_overlap; - register u16 i; - u8 *dest_back_addr; - - /* Check if we are done / still in range. */ - if (cb >= cb_sb_end || dest > dest_sb_end) - break; - /* Determine token type and parse appropriately.*/ - if ((tag & NTFS_TOKEN_MASK) == NTFS_SYMBOL_TOKEN) { - /* - * We have a symbol token, copy the symbol across, and - * advance the source and destination positions. - */ - *dest++ = *cb++; - /* Continue with the next token. */ - continue; - } - /* - * We have a phrase token. Make sure it is not the first tag in - * the sb as this is illegal and would confuse the code below. - */ - if (dest == dest_sb_start) - goto return_overflow; - /* - * Determine the number of bytes to go back (p) and the number - * of bytes to copy (l). We use an optimized algorithm in which - * we first calculate log2(current destination position in sb), - * which allows determination of l and p in O(1) rather than - * O(n). We just need an arch-optimized log2() function now. - */ - lg = 0; - for (i = dest - dest_sb_start - 1; i >= 0x10; i >>= 1) - lg++; - /* Get the phrase token into i. */ - pt = le16_to_cpup((le16*)cb); - /* - * Calculate starting position of the byte sequence in - * the destination using the fact that p = (pt >> (12 - lg)) + 1 - * and make sure we don't go too far back. - */ - dest_back_addr = dest - (pt >> (12 - lg)) - 1; - if (dest_back_addr < dest_sb_start) - goto return_overflow; - /* Now calculate the length of the byte sequence. */ - length = (pt & (0xfff >> lg)) + 3; - /* Verify destination is in range. */ - if (dest + length > dest_sb_end) - goto return_overflow; - /* The number of non-overlapping bytes. */ - max_non_overlap = dest - dest_back_addr; - if (length <= max_non_overlap) { - /* The byte sequence doesn't overlap, just copy it. */ - memcpy(dest, dest_back_addr, length); - /* Advance destination pointer. */ - dest += length; - } else { - /* - * The byte sequence does overlap, copy non-overlapping - * part and then do a slow byte by byte copy for the - * overlapping part. Also, advance the destination - * pointer. - */ - memcpy(dest, dest_back_addr, max_non_overlap); - dest += max_non_overlap; - dest_back_addr += max_non_overlap; - length -= max_non_overlap; - while (length--) - *dest++ = *dest_back_addr++; - } - /* Advance source position and continue with the next token. */ - cb += 2; - } - /* No tokens left in the current tag. Continue with the next tag. */ - goto do_next_tag; -return_overflow: - errno = EOVERFLOW; - ntfs_log_perror("Failed to decompress file"); - return -1; -} - -/** - * ntfs_is_cb_compressed - internal function, do not use - * - * This is a very specialised function determining if a cb is compressed or - * uncompressed. It is assumed that checking for a sparse cb has already been - * performed and that the cb is not sparse. It makes all sorts of other - * assumptions as well and hence it is not useful anywhere other than where it - * is used at the moment. Please, do not make this function available for use - * outside of compress.c as it is bound to confuse people and not do what they - * want. - * - * Return TRUE on errors so that the error will be detected later on in the - * code. Might be a bit confusing to debug but there really should never be - * errors coming from here. - */ -static BOOL ntfs_is_cb_compressed(ntfs_attr *na, runlist_element *rl, - VCN cb_start_vcn, int cb_clusters) -{ - /* - * The simplest case: the run starting at @cb_start_vcn contains - * @cb_clusters clusters which are all not sparse, thus the cb is not - * compressed. - */ -restart: - cb_clusters -= rl->length - (cb_start_vcn - rl->vcn); - while (cb_clusters > 0) { - /* Go to the next run. */ - rl++; - /* Map the next runlist fragment if it is not mapped. */ - if (rl->lcn < LCN_HOLE || !rl->length) { - cb_start_vcn = rl->vcn; - rl = ntfs_attr_find_vcn(na, rl->vcn); - if (!rl || rl->lcn < LCN_HOLE || !rl->length) - return TRUE; - /* - * If the runs were merged need to deal with the - * resulting partial run so simply restart. - */ - if (rl->vcn < cb_start_vcn) - goto restart; - } - /* If the current run is sparse, the cb is compressed. */ - if (rl->lcn == LCN_HOLE) - return TRUE; - /* If the whole cb is not sparse, it is not compressed. */ - if (rl->length >= cb_clusters) - return FALSE; - cb_clusters -= rl->length; - }; - /* All cb_clusters were not sparse thus the cb is not compressed. */ - return FALSE; -} - -/** - * ntfs_compressed_attr_pread - read from a compressed attribute - * @na: ntfs attribute to read from - * @pos: byte position in the attribute to begin reading from - * @count: number of bytes to read - * @b: output data buffer - * - * NOTE: You probably want to be using attrib.c::ntfs_attr_pread() instead. - * - * This function will read @count bytes starting at offset @pos from the - * compressed ntfs attribute @na into the data buffer @b. - * - * On success, return the number of successfully read bytes. If this number - * is lower than @count this means that the read reached end of file or that - * an error was encountered during the read so that the read is partial. - * 0 means end of file or nothing was read (also return 0 when @count is 0). - * - * On error and nothing has been read, return -1 with errno set appropriately - * to the return code of ntfs_pread(), or to EINVAL in case of invalid - * arguments. - */ -s64 ntfs_compressed_attr_pread(ntfs_attr *na, s64 pos, s64 count, void *b) -{ - s64 br, to_read, ofs, total, total2; - u64 cb_size_mask; - VCN start_vcn, vcn, end_vcn; - ntfs_volume *vol; - runlist_element *rl; - u8 *dest, *cb, *cb_pos, *cb_end; - u32 cb_size; - int err; - ATTR_FLAGS data_flags; - FILE_ATTR_FLAGS compression; - unsigned int nr_cbs, cb_clusters; - - ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, pos 0x%llx, count 0x%llx.\n", - (unsigned long long)na->ni->mft_no, na->type, - (long long)pos, (long long)count); - data_flags = na->data_flags; - compression = na->ni->flags & FILE_ATTR_COMPRESSED; - if (!na || !na->ni || !na->ni->vol || !b - || ((data_flags & ATTR_COMPRESSION_MASK) - != ATTR_IS_COMPRESSED) - || pos < 0 || count < 0) { - errno = EINVAL; - return -1; - } - /* - * Encrypted attributes are not supported. We return access denied, - * which is what Windows NT4 does, too. - */ - if (NAttrEncrypted(na)) { - errno = EACCES; - return -1; - } - if (!count) - return 0; - /* Truncate reads beyond end of attribute. */ - if (pos + count > na->data_size) { - if (pos >= na->data_size) { - return 0; - } - count = na->data_size - pos; - } - /* If it is a resident attribute, simply use ntfs_attr_pread(). */ - if (!NAttrNonResident(na)) - return ntfs_attr_pread(na, pos, count, b); - total = total2 = 0; - /* Zero out reads beyond initialized size. */ - if (pos + count > na->initialized_size) { - if (pos >= na->initialized_size) { - memset(b, 0, count); - return count; - } - total2 = pos + count - na->initialized_size; - count -= total2; - memset((u8*)b + count, 0, total2); - } - vol = na->ni->vol; - cb_size = na->compression_block_size; - cb_size_mask = cb_size - 1UL; - cb_clusters = na->compression_block_clusters; - - /* Need a temporary buffer for each loaded compression block. */ - cb = (u8*)ntfs_malloc(cb_size); - if (!cb) - return -1; - - /* Need a temporary buffer for each uncompressed block. */ - dest = (u8*)ntfs_malloc(cb_size); - if (!dest) { - free(cb); - return -1; - } - /* - * The first vcn in the first compression block (cb) which we need to - * decompress. - */ - start_vcn = (pos & ~cb_size_mask) >> vol->cluster_size_bits; - /* Offset in the uncompressed cb at which to start reading data. */ - ofs = pos & cb_size_mask; - /* - * The first vcn in the cb after the last cb which we need to - * decompress. - */ - end_vcn = ((pos + count + cb_size - 1) & ~cb_size_mask) >> - vol->cluster_size_bits; - /* Number of compression blocks (cbs) in the wanted vcn range. */ - nr_cbs = (end_vcn - start_vcn) << vol->cluster_size_bits >> - na->compression_block_size_bits; - cb_end = cb + cb_size; -do_next_cb: - nr_cbs--; - cb_pos = cb; - vcn = start_vcn; - start_vcn += cb_clusters; - - /* Check whether the compression block is sparse. */ - rl = ntfs_attr_find_vcn(na, vcn); - if (!rl || rl->lcn < LCN_HOLE) { - free(cb); - free(dest); - if (total) - return total; - /* FIXME: Do we want EIO or the error code? (AIA) */ - errno = EIO; - return -1; - } - if (rl->lcn == LCN_HOLE) { - /* Sparse cb, zero out destination range overlapping the cb. */ - ntfs_log_debug("Found sparse compression block.\n"); - to_read = min(count, cb_size - ofs); - memset(b, 0, to_read); - ofs = 0; - total += to_read; - count -= to_read; - b = (u8*)b + to_read; - } else if (!ntfs_is_cb_compressed(na, rl, vcn, cb_clusters)) { - s64 tdata_size, tinitialized_size; - /* - * Uncompressed cb, read it straight into the destination range - * overlapping the cb. - */ - ntfs_log_debug("Found uncompressed compression block.\n"); - /* - * Read the uncompressed data into the destination buffer. - * NOTE: We cheat a little bit here by marking the attribute as - * not compressed in the ntfs_attr structure so that we can - * read the data by simply using ntfs_attr_pread(). (-8 - * NOTE: we have to modify data_size and initialized_size - * temporarily as well... - */ - to_read = min(count, cb_size - ofs); - ofs += vcn << vol->cluster_size_bits; - NAttrClearCompressed(na); - na->data_flags &= ~ATTR_COMPRESSION_MASK; - tdata_size = na->data_size; - tinitialized_size = na->initialized_size; - na->data_size = na->initialized_size = na->allocated_size; - do { - br = ntfs_attr_pread(na, ofs, to_read, b); - if (br <= 0) { - if (!br) { - ntfs_log_error("Failed to read an" - " uncompressed cluster," - " inode %lld offs 0x%llx\n", - (long long)na->ni->mft_no, - (long long)ofs); - errno = EIO; - } - err = errno; - na->data_size = tdata_size; - na->initialized_size = tinitialized_size; - na->ni->flags |= compression; - na->data_flags = data_flags; - free(cb); - free(dest); - if (total) - return total; - errno = err; - return br; - } - total += br; - count -= br; - b = (u8*)b + br; - to_read -= br; - ofs += br; - } while (to_read > 0); - na->data_size = tdata_size; - na->initialized_size = tinitialized_size; - na->ni->flags |= compression; - na->data_flags = data_flags; - ofs = 0; - } else { - s64 tdata_size, tinitialized_size; - - /* - * Compressed cb, decompress it into the temporary buffer, then - * copy the data to the destination range overlapping the cb. - */ - ntfs_log_debug("Found compressed compression block.\n"); - /* - * Read the compressed data into the temporary buffer. - * NOTE: We cheat a little bit here by marking the attribute as - * not compressed in the ntfs_attr structure so that we can - * read the raw, compressed data by simply using - * ntfs_attr_pread(). (-8 - * NOTE: We have to modify data_size and initialized_size - * temporarily as well... - */ - to_read = cb_size; - NAttrClearCompressed(na); - na->data_flags &= ~ATTR_COMPRESSION_MASK; - tdata_size = na->data_size; - tinitialized_size = na->initialized_size; - na->data_size = na->initialized_size = na->allocated_size; - do { - br = ntfs_attr_pread(na, - (vcn << vol->cluster_size_bits) + - (cb_pos - cb), to_read, cb_pos); - if (br <= 0) { - if (!br) { - ntfs_log_error("Failed to read a" - " compressed cluster, " - " inode %lld offs 0x%llx\n", - (long long)na->ni->mft_no, - (long long)(vcn << vol->cluster_size_bits)); - errno = EIO; - } - err = errno; - na->data_size = tdata_size; - na->initialized_size = tinitialized_size; - na->ni->flags |= compression; - na->data_flags = data_flags; - free(cb); - free(dest); - if (total) - return total; - errno = err; - return br; - } - cb_pos += br; - to_read -= br; - } while (to_read > 0); - na->data_size = tdata_size; - na->initialized_size = tinitialized_size; - na->ni->flags |= compression; - na->data_flags = data_flags; - /* Just a precaution. */ - if (cb_pos + 2 <= cb_end) - *(u16*)cb_pos = 0; - ntfs_log_debug("Successfully read the compression block.\n"); - if (ntfs_decompress(dest, cb_size, cb, cb_size) < 0) { - err = errno; - free(cb); - free(dest); - if (total) - return total; - errno = err; - return -1; - } - to_read = min(count, cb_size - ofs); - memcpy(b, dest + ofs, to_read); - total += to_read; - count -= to_read; - b = (u8*)b + to_read; - ofs = 0; - } - /* Do we have more work to do? */ - if (nr_cbs) - goto do_next_cb; - /* We no longer need the buffers. */ - free(cb); - free(dest); - /* Return number of bytes read. */ - return total + total2; -} - -/* - * Read data from a set of clusters - * - * Returns the amount of data read - */ - -static u32 read_clusters(ntfs_volume *vol, const runlist_element *rl, - s64 offs, u32 to_read, char *inbuf) -{ - u32 count; - int xgot; - u32 got; - s64 xpos; - BOOL first; - char *xinbuf; - const runlist_element *xrl; - - got = 0; - xrl = rl; - xinbuf = inbuf; - first = TRUE; - do { - count = xrl->length << vol->cluster_size_bits; - xpos = xrl->lcn << vol->cluster_size_bits; - if (first) { - count -= offs; - xpos += offs; - } - if ((to_read - got) < count) - count = to_read - got; - xgot = ntfs_pread(vol->dev, xpos, count, xinbuf); - if (xgot == (int)count) { - got += count; - xpos += count; - xinbuf += count; - xrl++; - } - first = FALSE; - } while ((xgot == (int)count) && (got < to_read)); - return (got); -} - -/* - * Write data to a set of clusters - * - * Returns the amount of data written - */ - -static s32 write_clusters(ntfs_volume *vol, const runlist_element *rl, - s64 offs, s32 to_write, const char *outbuf) -{ - s32 count; - s32 put, xput; - s64 xpos; - BOOL first; - const char *xoutbuf; - const runlist_element *xrl; - - put = 0; - xrl = rl; - xoutbuf = outbuf; - first = TRUE; - do { - count = xrl->length << vol->cluster_size_bits; - xpos = xrl->lcn << vol->cluster_size_bits; - if (first) { - count -= offs; - xpos += offs; - } - if ((to_write - put) < count) - count = to_write - put; - xput = ntfs_pwrite(vol->dev, xpos, count, xoutbuf); - if (xput == count) { - put += count; - xpos += count; - xoutbuf += count; - xrl++; - } - first = FALSE; - } while ((xput == count) && (put < to_write)); - return (put); -} - - -/* - * Compress and write a set of blocks - * - * returns the size actually written (rounded to a full cluster) - * or 0 if all zeroes (nothing is written) - * or -1 if could not compress (nothing is written) - * or -2 if there were an irrecoverable error (errno set) - */ - -static s32 ntfs_comp_set(ntfs_attr *na, runlist_element *rl, - s64 offs, u32 insz, const char *inbuf) -{ - ntfs_volume *vol; - char *outbuf; - char *pbuf; - u32 compsz; - s32 written; - s32 rounded; - unsigned int clsz; - u32 p; - unsigned int sz; - unsigned int bsz; - BOOL fail; - BOOL allzeroes; - /* a single compressed zero */ - static char onezero[] = { 0x01, 0xb0, 0x00, 0x00 } ; - /* a couple of compressed zeroes */ - static char twozeroes[] = { 0x02, 0xb0, 0x00, 0x00, 0x00 } ; - /* more compressed zeroes, to be followed by some count */ - static char morezeroes[] = { 0x03, 0xb0, 0x02, 0x00 } ; - - vol = na->ni->vol; - written = -1; /* default return */ - clsz = 1 << vol->cluster_size_bits; - /* may need 2 extra bytes per block and 2 more bytes */ - outbuf = (char*)ntfs_malloc(na->compression_block_size - + 2*(na->compression_block_size/NTFS_SB_SIZE) - + 2); - if (outbuf) { - fail = FALSE; - compsz = 0; - allzeroes = TRUE; - for (p=0; (p na->compression_block_size)) - fail = TRUE; - else { - if (allzeroes) { - /* check whether this is all zeroes */ - switch (sz) { - case 4 : - allzeroes = !memcmp( - pbuf,onezero,4); - break; - case 5 : - allzeroes = !memcmp( - pbuf,twozeroes,5); - break; - case 6 : - allzeroes = !memcmp( - pbuf,morezeroes,4); - break; - default : - allzeroes = FALSE; - break; - } - } - compsz += sz; - } - } - if (!fail && !allzeroes) { - /* add a couple of null bytes, space has been checked */ - outbuf[compsz++] = 0; - outbuf[compsz++] = 0; - /* write a full cluster, to avoid partial reading */ - rounded = ((compsz - 1) | (clsz - 1)) + 1; - written = write_clusters(vol, rl, offs, rounded, outbuf); - if (written != rounded) { - /* - * TODO : previously written text has been - * spoilt, should return a specific error - */ - ntfs_log_error("error writing compressed data\n"); - errno = EIO; - written = -2; - } - } else - if (!fail) - written = 0; - free(outbuf); - } - return (written); -} - -/* - * Check the validity of a compressed runlist - * The check starts at the beginning of current run and ends - * at the end of runlist - * errno is set if the runlist is not valid - */ - -static BOOL valid_compressed_run(ntfs_attr *na, runlist_element *rl, - BOOL fullcheck, const char *text) -{ - runlist_element *xrl; - const char *err; - BOOL ok = TRUE; - - xrl = rl; - while (xrl->vcn & (na->compression_block_clusters - 1)) - xrl--; - err = (const char*)NULL; - while (xrl->length) { - if ((xrl->vcn + xrl->length) != xrl[1].vcn) - err = "Runs not adjacent"; - if (xrl->lcn == LCN_HOLE) { - if ((xrl->vcn + xrl->length) - & (na->compression_block_clusters - 1)) { - err = "Invalid hole"; - } - if (fullcheck && (xrl[1].lcn == LCN_HOLE)) { - err = "Adjacent holes"; - } - } - if (err) { - ntfs_log_error("%s at %s index %ld inode %lld\n", - err, text, (long)(xrl - na->rl), - (long long)na->ni->mft_no); - errno = EIO; - ok = FALSE; - err = (const char*)NULL; - } - xrl++; - } - return (ok); -} - -/* - * Free unneeded clusters after overwriting compressed data - * - * This generally requires one or two empty slots at the end of runlist, - * but we do not want to reallocate the runlist here because - * there are many pointers to it. - * So the empty slots have to be reserved beforehand - * - * Returns zero unless some error occurred (described by errno) - * - * +======= start of block =====+ - * 0 |A chunk may overflow | <-- rl usedcnt : A + B - * |A on previous block | then B - * |A | - * +-- end of allocated chunk --+ freelength : C - * |B | (incl overflow) - * +== end of compressed data ==+ - * |C | <-- freerl freecnt : C + D - * |C chunk may overflow | - * |C on next block | - * +-- end of allocated chunk --+ - * |D | - * |D chunk may overflow | - * 15 |D on next block | - * +======== end of block ======+ - * - */ - -static int ntfs_compress_overwr_free(ntfs_attr *na, runlist_element *rl, - s32 usedcnt, s32 freecnt, VCN *update_from) -{ - BOOL beginhole; - BOOL mergeholes; - s32 oldlength; - s32 freelength; - s64 freelcn; - s64 freevcn; - runlist_element *freerl; - ntfs_volume *vol; - s32 carry; - int res; - - vol = na->ni->vol; - res = 0; - freelcn = rl->lcn + usedcnt; - freevcn = rl->vcn + usedcnt; - freelength = rl->length - usedcnt; - beginhole = !usedcnt && !rl->vcn; - /* can merge with hole before ? */ - mergeholes = !usedcnt - && rl[0].vcn - && (rl[-1].lcn == LCN_HOLE); - /* truncate current run, carry to subsequent hole */ - carry = freelength; - oldlength = rl->length; - if (mergeholes) { - /* merging with a hole before */ - freerl = rl; - } else { - rl->length -= freelength; /* warning : can be zero */ - freerl = ++rl; - } - if (!mergeholes && (usedcnt || beginhole)) { - s32 freed; - runlist_element *frl; - runlist_element *erl; - int holes = 0; - BOOL threeparts; - - /* free the unneeded clusters from initial run, then freerl */ - threeparts = (freelength > freecnt); - freed = 0; - frl = freerl; - if (freelength) { - res = ntfs_cluster_free_basic(vol,freelcn, - (threeparts ? freecnt : freelength)); - if (!res) - freed += (threeparts ? freecnt : freelength); - if (!usedcnt) { - holes++; - freerl--; - freerl->length += (threeparts - ? freecnt : freelength); - if (freerl->vcn < *update_from) - *update_from = freerl->vcn; - } - } - while (!res && frl->length && (freed < freecnt)) { - if (frl->length <= (freecnt - freed)) { - res = ntfs_cluster_free_basic(vol, frl->lcn, - frl->length); - if (!res) { - freed += frl->length; - frl->lcn = LCN_HOLE; - frl->length += carry; - carry = 0; - holes++; - } - } else { - res = ntfs_cluster_free_basic(vol, frl->lcn, - freecnt - freed); - if (!res) { - frl->lcn += freecnt - freed; - frl->vcn += freecnt - freed; - frl->length -= freecnt - freed; - freed = freecnt; - } - } - frl++; - } - na->compressed_size -= freed << vol->cluster_size_bits; - switch (holes) { - case 0 : - /* there are no hole, must insert one */ - /* space for hole has been prereserved */ - if (freerl->lcn == LCN_HOLE) { - if (threeparts) { - erl = freerl; - while (erl->length) - erl++; - do { - erl[2] = *erl; - } while (erl-- != freerl); - - freerl[1].length = freelength - freecnt; - freerl->length = freecnt; - freerl[1].lcn = freelcn + freecnt; - freerl[1].vcn = freevcn + freecnt; - freerl[2].lcn = LCN_HOLE; - freerl[2].vcn = freerl[1].vcn - + freerl[1].length; - freerl->vcn = freevcn; - } else { - freerl->vcn = freevcn; - freerl->length += freelength; - } - } else { - erl = freerl; - while (erl->length) - erl++; - if (threeparts) { - do { - erl[2] = *erl; - } while (erl-- != freerl); - freerl[1].lcn = freelcn + freecnt; - freerl[1].vcn = freevcn + freecnt; - freerl[1].length = oldlength - usedcnt - freecnt; - } else { - do { - erl[1] = *erl; - } while (erl-- != freerl); - } - freerl->lcn = LCN_HOLE; - freerl->vcn = freevcn; - freerl->length = freecnt; - } - break; - case 1 : - /* there is a single hole, may have to merge */ - freerl->vcn = freevcn; - if (freerl[1].lcn == LCN_HOLE) { - freerl->length += freerl[1].length; - erl = freerl; - do { - erl++; - *erl = erl[1]; - } while (erl->length); - } - break; - default : - /* there were several holes, must merge them */ - freerl->lcn = LCN_HOLE; - freerl->vcn = freevcn; - freerl->length = freecnt; - if (freerl[holes].lcn == LCN_HOLE) { - freerl->length += freerl[holes].length; - holes++; - } - erl = freerl; - do { - erl++; - *erl = erl[holes - 1]; - } while (erl->length); - break; - } - } else { - s32 freed; - runlist_element *frl; - runlist_element *xrl; - - freed = 0; - frl = freerl--; - if (freerl->vcn < *update_from) - *update_from = freerl->vcn; - while (!res && frl->length && (freed < freecnt)) { - if (frl->length <= (freecnt - freed)) { - freerl->length += frl->length; - freed += frl->length; - res = ntfs_cluster_free_basic(vol, frl->lcn, - frl->length); - frl++; - } else { - freerl->length += freecnt - freed; - res = ntfs_cluster_free_basic(vol, frl->lcn, - freecnt - freed); - frl->lcn += freecnt - freed; - frl->vcn += freecnt - freed; - frl->length -= freecnt - freed; - freed = freecnt; - } - } - /* remove unneded runlist entries */ - xrl = freerl; - /* group with next run if also a hole */ - if (frl->length && (frl->lcn == LCN_HOLE)) { - xrl->length += frl->length; - frl++; - } - while (frl->length) { - *++xrl = *frl++; - } - *++xrl = *frl; /* terminator */ - na->compressed_size -= freed << vol->cluster_size_bits; - } - return (res); -} - - -/* - * Free unneeded clusters after compression - * - * This generally requires one or two empty slots at the end of runlist, - * but we do not want to reallocate the runlist here because - * there are many pointers to it. - * So the empty slots have to be reserved beforehand - * - * Returns zero unless some error occurred (described by errno) - */ - -static int ntfs_compress_free(ntfs_attr *na, runlist_element *rl, - s64 used, s64 reserved, BOOL appending, - VCN *update_from) -{ - s32 freecnt; - s32 usedcnt; - int res; - s64 freelcn; - s64 freevcn; - s32 freelength; - BOOL mergeholes; - BOOL beginhole; - ntfs_volume *vol; - runlist_element *freerl; - - res = -1; /* default return */ - vol = na->ni->vol; - freecnt = (reserved - used) >> vol->cluster_size_bits; - usedcnt = (reserved >> vol->cluster_size_bits) - freecnt; - if (rl->vcn < *update_from) - *update_from = rl->vcn; - /* skip entries fully used, if any */ - while (rl->length && (rl->length < usedcnt)) { - usedcnt -= rl->length; /* must be > 0 */ - rl++; - } - if (rl->length) { - /* - * Splitting the current allocation block requires - * an extra runlist element to create the hole. - * The required entry has been prereserved when - * mapping the runlist. - */ - /* get the free part in initial run */ - freelcn = rl->lcn + usedcnt; - freevcn = rl->vcn + usedcnt; - /* new count of allocated clusters */ - if (!((freevcn + freecnt) - & (na->compression_block_clusters - 1))) { - if (!appending) - res = ntfs_compress_overwr_free(na,rl, - usedcnt,freecnt,update_from); - else { - freelength = rl->length - usedcnt; - beginhole = !usedcnt && !rl->vcn; - mergeholes = !usedcnt - && rl[0].vcn - && (rl[-1].lcn == LCN_HOLE); - if (mergeholes) { - s32 carry; - - /* shorten the runs which have free space */ - carry = freecnt; - freerl = rl; - while (freerl->length < carry) { - carry -= freerl->length; - freerl++; - } - freerl->length = carry; - freerl = rl; - } else { - rl->length = usedcnt; /* can be zero ? */ - freerl = ++rl; - } - if ((freelength > 0) - && !mergeholes - && (usedcnt || beginhole)) { - /* - * move the unused part to the end. Doing so, - * the vcn will be out of order. This does - * not harm, the vcn are meaningless now, and - * only the lcn are meaningful for freeing. - */ - /* locate current end */ - while (rl->length) - rl++; - /* new terminator relocated */ - rl[1].vcn = rl->vcn; - rl[1].lcn = LCN_ENOENT; - rl[1].length = 0; - /* hole, currently allocated */ - rl->vcn = freevcn; - rl->lcn = freelcn; - rl->length = freelength; - } else { - /* why is this different from the begin hole case ? */ - if ((freelength > 0) - && !mergeholes - && !usedcnt) { - freerl--; - freerl->length = freelength; - if (freerl->vcn < *update_from) - *update_from - = freerl->vcn; - } - } - /* free the hole */ - res = ntfs_cluster_free_from_rl(vol,freerl); - if (!res) { - na->compressed_size -= freecnt - << vol->cluster_size_bits; - if (mergeholes) { - /* merge with adjacent hole */ - freerl--; - freerl->length += freecnt; - } else { - if (beginhole) - freerl--; - /* mark hole as free */ - freerl->lcn = LCN_HOLE; - freerl->vcn = freevcn; - freerl->length = freecnt; - } - if (freerl->vcn < *update_from) - *update_from = freerl->vcn; - /* and set up the new end */ - freerl[1].lcn = LCN_ENOENT; - freerl[1].vcn = freevcn + freecnt; - freerl[1].length = 0; - } - } - } else { - ntfs_log_error("Bad end of a compression block set\n"); - errno = EIO; - } - } else { - ntfs_log_error("No cluster to free after compression\n"); - errno = EIO; - } - return (res); -} - -/* - * Read existing data, decompress and append buffer - * Do nothing if something fails - */ - -static int ntfs_read_append(ntfs_attr *na, const runlist_element *rl, - s64 offs, u32 compsz, s32 pos, BOOL appending, - char *outbuf, s64 to_write, const void *b) -{ - int fail = 1; - char *compbuf; - u32 decompsz; - u32 got; - - if (compsz == na->compression_block_size) { - /* if the full block was requested, it was a hole */ - memset(outbuf,0,compsz); - memcpy(&outbuf[pos],b,to_write); - fail = 0; - } else { - compbuf = (char*)ntfs_malloc(compsz); - if (compbuf) { - /* must align to full block for decompression */ - if (appending) - decompsz = ((pos - 1) | (NTFS_SB_SIZE - 1)) + 1; - else - decompsz = na->compression_block_size; - got = read_clusters(na->ni->vol, rl, offs, - compsz, compbuf); - if ((got == compsz) - && !ntfs_decompress((u8*)outbuf,decompsz, - (u8*)compbuf,compsz)) { - memcpy(&outbuf[pos],b,to_write); - fail = 0; - } - free(compbuf); - } - } - return (fail); -} - -/* - * Flush a full compression block - * - * returns the size actually written (rounded to a full cluster) - * or 0 if could not compress (and written uncompressed) - * or -1 if there were an irrecoverable error (errno set) - */ - -static int ntfs_flush(ntfs_attr *na, runlist_element *rl, s64 offs, - const char *outbuf, s32 count, BOOL compress, - BOOL appending, VCN *update_from) -{ - int rounded; - int written; - int clsz; - - if (compress) { - written = ntfs_comp_set(na, rl, offs, count, outbuf); - if (written == -1) - compress = FALSE; - if ((written >= 0) - && ntfs_compress_free(na,rl,offs + written, - offs + na->compression_block_size, appending, - update_from)) - written = -1; - } else - written = 0; - if (!compress) { - clsz = 1 << na->ni->vol->cluster_size_bits; - rounded = ((count - 1) | (clsz - 1)) + 1; - written = write_clusters(na->ni->vol, rl, - offs, rounded, outbuf); - if (written != rounded) - written = -1; - } - return (written); -} - -/* - * Write some data to be compressed. - * Compression only occurs when a few clusters (usually 16) are - * full. When this occurs an extra runlist slot may be needed, so - * it has to be reserved beforehand. - * - * Returns the size of uncompressed data written, - * or negative if an error occurred. - * When the returned size is less than requested, new clusters have - * to be allocated before the function is called again. - */ - -s64 ntfs_compressed_pwrite(ntfs_attr *na, runlist_element *wrl, s64 wpos, - s64 offs, s64 to_write, s64 rounded, - const void *b, int compressed_part, - VCN *update_from) -{ - ntfs_volume *vol; - runlist_element *brl; /* entry containing the beginning of block */ - int compression_length; - s64 written; - s64 to_read; - s64 to_flush; - s64 roffs; - s64 got; - s64 start_vcn; - s64 nextblock; - s64 endwrite; - u32 compsz; - char *inbuf; - char *outbuf; - BOOL fail; - BOOL done; - BOOL compress; - BOOL appending; - - if (!valid_compressed_run(na,wrl,FALSE,"begin compressed write")) { - return (-1); - } - if ((*update_from < 0) - || (compressed_part < 0) - || (compressed_part > (int)na->compression_block_clusters)) { - ntfs_log_error("Bad update vcn or compressed_part %d for compressed write\n", - compressed_part); - errno = EIO; - return (-1); - } - /* make sure there are two unused entries in runlist */ - if (na->unused_runs < 2) { - ntfs_log_error("No unused runs for compressed write\n"); - errno = EIO; - return (-1); - } - if (wrl->vcn < *update_from) - *update_from = wrl->vcn; - written = -1; /* default return */ - vol = na->ni->vol; - compression_length = na->compression_block_clusters; - compress = FALSE; - done = FALSE; - /* - * Cannot accept writing beyond the current compression set - * because when compression occurs, clusters are freed - * and have to be reallocated. - * (cannot happen with standard fuse 4K buffers) - * Caller has to avoid this situation, or face consequences. - */ - nextblock = ((offs + (wrl->vcn << vol->cluster_size_bits)) - | (na->compression_block_size - 1)) + 1; - /* determine whether we are appending to file */ - endwrite = offs + to_write + (wrl->vcn << vol->cluster_size_bits); - appending = endwrite >= na->initialized_size; - if (endwrite >= nextblock) { - /* it is time to compress */ - compress = TRUE; - /* only process what we can */ - to_write = rounded = nextblock - - (offs + (wrl->vcn << vol->cluster_size_bits)); - } - start_vcn = 0; - fail = FALSE; - brl = wrl; - roffs = 0; - /* - * If we are about to compress or we need to decompress - * existing data, we have to process a full set of blocks. - * So relocate the parameters to the beginning of allocation - * containing the first byte of the set of blocks. - */ - if (compress || compressed_part) { - /* find the beginning of block */ - start_vcn = (wrl->vcn + (offs >> vol->cluster_size_bits)) - & -compression_length; - if (start_vcn < *update_from) - *update_from = start_vcn; - while (brl->vcn && (brl->vcn > start_vcn)) { - /* jumping back a hole means big trouble */ - if (brl->lcn == (LCN)LCN_HOLE) { - ntfs_log_error("jump back over a hole when appending\n"); - fail = TRUE; - errno = EIO; - } - brl--; - offs += brl->length << vol->cluster_size_bits; - } - roffs = (start_vcn - brl->vcn) << vol->cluster_size_bits; - } - if (compressed_part && !fail) { - /* - * The set of compression blocks contains compressed data - * (we are reopening an existing file to append to it) - * Decompress the data and append - */ - compsz = compressed_part << vol->cluster_size_bits; - outbuf = (char*)ntfs_malloc(na->compression_block_size); - if (outbuf) { - if (appending) { - to_read = offs - roffs; - to_flush = to_read + to_write; - } else { - to_read = na->data_size - - (brl->vcn << vol->cluster_size_bits); - if (to_read > na->compression_block_size) - to_read = na->compression_block_size; - to_flush = to_read; - } - if (!ntfs_read_append(na, brl, roffs, compsz, - (s32)(offs - roffs), appending, - outbuf, to_write, b)) { - written = ntfs_flush(na, brl, roffs, - outbuf, to_flush, compress, appending, - update_from); - if (written >= 0) { - written = to_write; - done = TRUE; - } - } - free(outbuf); - } - } else { - if (compress && !fail) { - /* - * we are filling up a block, read the full set - * of blocks and compress it - */ - inbuf = (char*)ntfs_malloc(na->compression_block_size); - if (inbuf) { - to_read = offs - roffs; - if (to_read) - got = read_clusters(vol, brl, roffs, - to_read, inbuf); - else - got = 0; - if (got == to_read) { - memcpy(&inbuf[to_read],b,to_write); - written = ntfs_comp_set(na, brl, roffs, - to_read + to_write, inbuf); - /* - * if compression was not successful, - * only write the part which was requested - */ - if ((written >= 0) - /* free the unused clusters */ - && !ntfs_compress_free(na,brl, - written + roffs, - na->compression_block_size - + roffs, - appending, update_from)) { - done = TRUE; - written = to_write; - } - } - free(inbuf); - } - } - if (!done) { - /* - * if the compression block is not full, or - * if compression failed for whatever reason, - * write uncompressed - */ - /* check we are not overflowing current allocation */ - if ((wpos + rounded) - > ((wrl->lcn + wrl->length) - << vol->cluster_size_bits)) { - ntfs_log_error("writing on unallocated clusters\n"); - errno = EIO; - } else { - written = ntfs_pwrite(vol->dev, wpos, - rounded, b); - if (written == rounded) - written = to_write; - } - } - } - if ((written >= 0) - && !valid_compressed_run(na,wrl,TRUE,"end compressed write")) - written = -1; - return (written); -} - -/* - * Close a file written compressed. - * This compresses the last partial compression block of the file. - * Two empty runlist slots have to be reserved beforehand. - * - * Returns zero if closing is successful. - */ - -int ntfs_compressed_close(ntfs_attr *na, runlist_element *wrl, s64 offs, - VCN *update_from) -{ - ntfs_volume *vol; - runlist_element *brl; /* entry containing the beginning of block */ - int compression_length; - s64 written; - s64 to_read; - s64 roffs; - s64 got; - s64 start_vcn; - char *inbuf; - BOOL fail; - BOOL done; - - if (na->unused_runs < 2) { - ntfs_log_error("No unused runs for compressed close\n"); - errno = EIO; - return (-1); - } - if (*update_from < 0) { - ntfs_log_error("Bad update vcn for compressed close\n"); - errno = EIO; - return (-1); - } - if (wrl->vcn < *update_from) - *update_from = wrl->vcn; - vol = na->ni->vol; - compression_length = na->compression_block_clusters; - done = FALSE; - /* - * There generally is an uncompressed block at end of file, - * read the full block and compress it - */ - inbuf = (char*)ntfs_malloc(na->compression_block_size); - if (inbuf) { - start_vcn = (wrl->vcn + (offs >> vol->cluster_size_bits)) - & -compression_length; - if (start_vcn < *update_from) - *update_from = start_vcn; - to_read = offs + ((wrl->vcn - start_vcn) - << vol->cluster_size_bits); - brl = wrl; - fail = FALSE; - while (brl->vcn && (brl->vcn > start_vcn)) { - if (brl->lcn == (LCN)LCN_HOLE) { - ntfs_log_error("jump back over a hole when closing\n"); - fail = TRUE; - errno = EIO; - } - brl--; - } - if (!fail) { - /* roffs can be an offset from another uncomp block */ - roffs = (start_vcn - brl->vcn) - << vol->cluster_size_bits; - if (to_read) { - got = read_clusters(vol, brl, roffs, to_read, - inbuf); - if (got == to_read) { - written = ntfs_comp_set(na, brl, roffs, - to_read, inbuf); - if ((written >= 0) - /* free the unused clusters */ - && !ntfs_compress_free(na,brl, - written + roffs, - na->compression_block_size + roffs, - TRUE, update_from)) { - done = TRUE; - } else - /* if compression failed, leave uncompressed */ - if (written == -1) - done = TRUE; - } - } else - done = TRUE; - free(inbuf); - } - } - if (done && !valid_compressed_run(na,wrl,TRUE,"end compressed close")) - done = FALSE; - return (!done); -} diff --git a/source/libs/libntfs/compress.h b/source/libs/libntfs/compress.h deleted file mode 100644 index c2569321..00000000 --- a/source/libs/libntfs/compress.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * compress.h - Exports for compressed attribute handling. - * Originated from the Linux-NTFS project. - * - * Copyright (c) 2004 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_COMPRESS_H -#define _NTFS_COMPRESS_H - -#include "types.h" -#include "attrib.h" - -extern s64 ntfs_compressed_attr_pread(ntfs_attr *na, s64 pos, s64 count, - void *b); - -extern s64 ntfs_compressed_pwrite(ntfs_attr *na, runlist_element *brl, s64 wpos, - s64 offs, s64 to_write, s64 rounded, - const void *b, int compressed_part, - VCN *update_from); - -extern int ntfs_compressed_close(ntfs_attr *na, runlist_element *brl, - s64 offs, VCN *update_from); - -#endif /* defined _NTFS_COMPRESS_H */ - diff --git a/source/libs/libntfs/config.h b/source/libs/libntfs/config.h deleted file mode 100644 index 54ffee73..00000000 --- a/source/libs/libntfs/config.h +++ /dev/null @@ -1,375 +0,0 @@ - -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if debug should be enabled */ -#undef ENABLE_DEBUG - -/* Define to 1 if the nfconv patch should be enabled */ -#undef ENABLE_NFCONV - -/* Define to 1 if using internal fuse */ -#undef FUSE_INTERNAL - -/* Define to 1 if you have the `atexit' function. */ -#define HAVE_ATEXIT 1 - -/* Define to 1 if you have the `basename' function. */ -#undef HAVE_BASENAME - -/* Define to 1 if you have the header file. */ -#undef HAVE_BYTESWAP_H - -/* Define to 1 if you have the `clock_gettime' function. */ -#undef HAVE_CLOCK_GETTIME - -/* Define to 1 if you have the header file. */ -#define HAVE_CTYPE_H 1 - -/* Define to 1 if you have the `daemon' function. */ -#undef HAVE_DAEMON - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `dup2' function. */ -#undef HAVE_DUP2 - -/* Define to 1 if you have the header file. */ -#undef HAVE_ENDIAN_H - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `fdatasync' function. */ -#undef HAVE_FDATASYNC - -/* Define to 1 if you have the header file. */ -#undef HAVE_FEATURES_H - -/* Define to 1 if you have the `ffs' function. */ -#define HAVE_FFS 1 - -/* Define to 1 if you have the `fork' function. */ -#define HAVE_FORK 1 - -/* Define to 1 if you have the `getmntent' function. */ -#undef HAVE_GETMNTENT - -/* Define to 1 if you have the header file. */ -#define HAVE_GETOPT_H 1 - -/* Define to 1 if you have the `getopt_long' function. */ -#define HAVE_GETOPT_LONG 1 - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the `hasmntopt' function. */ -#undef HAVE_HASMNTOPT - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIBGEN_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBINTL_H - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_FD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_HDREG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_MAJOR_H - -/* Define to 1 if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MACHINE_ENDIAN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MATH_H 1 - -/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ -#define HAVE_MBRTOWC 1 - -/* Define to 1 if you have the `mbsinit' function. */ -#define HAVE_MBSINIT 1 - -/* Define to 1 if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_MNTENT_H - -/* Define to 1 if you have the `realpath' function. */ -#undef HAVE_REALPATH - -/* Define to 1 if you have the `regcomp' function. */ -#undef HAVE_REGCOMP - -/* Define to 1 if you have the `setlocale' function. */ -#define HAVE_SETLOCALE 1 - -/* Define to 1 if you have the `setxattr' function. */ -#undef HAVE_SETXATTR - -/* Define to 1 if `stat' has the bug that it succeeds when given the - zero-length file name argument. */ -#define HAVE_STAT_EMPTY_STRING_BUG 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDARG_H 1 - -/* Define to 1 if stdbool.h conforms to C99. */ -#define HAVE_STDBOOL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strcasecmp' function. */ -#define HAVE_STRCASECMP 1 - -/* Define to 1 if you have the `strchr' function. */ -#define HAVE_STRCHR 1 - -/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define to 1 if you have the `strftime' function. */ -#define HAVE_STRFTIME 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strnlen' function. */ -#define HAVE_STRNLEN 1 - -/* Define to 1 if you have the `strsep' function. */ -#define HAVE_STRSEP 1 - -/* Define to 1 if you have the `strtol' function. */ -#define HAVE_STRTOL 1 - -/* Define to 1 if you have the `strtoul' function. */ -#define HAVE_STRTOUL 1 - -/* Define to 1 if `st_atim' is member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_ATIM - -/* Define to 1 if `st_atimespec' is member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_ATIMESPEC - -/* Define to 1 if `st_blocks' is member of `struct stat'. */ -#define HAVE_STRUCT_STAT_ST_BLOCKS 1 - -/* Define to 1 if `st_rdev' is member of `struct stat'. */ -#define HAVE_STRUCT_STAT_ST_RDEV 1 - -/* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use - `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ -#undef HAVE_ST_BLOCKS - -/* Define to 1 if you have the `sysconf' function. */ -#define HAVE_SYSCONF 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYSLOG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_BYTEORDER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_ENDIAN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MKDEV_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MOUNT_H - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STATVFS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSMACROS_H - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_VFS_H - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the `utime' function. */ -#undef HAVE_UTIME - -/* Define to 1 if you have the `utimensat' function. */ -#undef HAVE_UTIMENSAT - -/* Define to 1 if you have the header file. */ -#define HAVE_UTIME_H 1 - -/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ -#undef HAVE_UTIME_NULL - -/* Define to 1 if you have the `vprintf' function. */ -#define HAVE_VPRINTF 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_WCHAR_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_WINDOWS_H - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Don't update /etc/mtab */ -#undef IGNORE_MTAB - -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing - slash. */ -#undef LSTAT_FOLLOWS_SLASHED_SYMLINK -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - -/* Don't use default IO ops */ -#undef NO_NTFS_DEVICE_DEFAULT_IO_OPS - -/* Name of package */ -#define PACKAGE "ntfs-3g" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "ntfs-3g-devel@lists.sf.net" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "ntfs-3g" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "ntfs-3g 2010.8.8" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "ntfs-3g" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "2010.8.8" - -/* POSIX ACL support */ -#undef POSIXACLS - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# define _ALL_SOURCE 1 -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# define _POSIX_PTHREAD_SEMANTICS 1 -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# define _TANDEM_SOURCE 1 -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# define __EXTENSIONS__ 1 -#endif - -/* Version number of package */ -#define VERSION "2010.8.8" - -/* Define to 1 if this is a Windows OS */ -#undef WINDOWS - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#define WORDS_BIGENDIAN 1 - -/* Define to 1 if your processor stores words with the least significant byte - first (like Intel and VAX, unlike Motorola and SPARC). */ -#undef WORDS_LITTLEENDIAN - -/* Number of bits in a file offset, on hosts where this is settable. */ -#define _FILE_OFFSET_BITS 64 - -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - -/* Define for large files, on AIX-style hosts. */ -#define _LARGE_FILES 1 - -/* Required define if using POSIX threads */ -#undef _REENTRANT - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#define inline __inline__ -#endif - -/* Define to `long int' if does not define. */ -#undef off_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t diff --git a/source/libs/libntfs/debug.c b/source/libs/libntfs/debug.c deleted file mode 100644 index f1934833..00000000 --- a/source/libs/libntfs/debug.c +++ /dev/null @@ -1,79 +0,0 @@ -/** - * debug.c - Debugging output functions. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002-2004 Anton Altaparmakov - * Copyright (c) 2004-2006 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "types.h" -#include "runlist.h" -#include "debug.h" -#include "logging.h" - -#ifdef DEBUG -/** - * ntfs_debug_runlist_dump - Dump a runlist. - * @rl: - * - * Description... - * - * Returns: - */ -void ntfs_debug_runlist_dump(const runlist_element *rl) -{ - int i = 0; - const char *lcn_str[5] = { "LCN_HOLE ", "LCN_RL_NOT_MAPPED", - "LCN_ENOENT ", "LCN_EINVAL ", - "LCN_unknown " }; - - ntfs_log_debug("NTFS-fs DEBUG: Dumping runlist (values in hex):\n"); - if (!rl) { - ntfs_log_debug("Run list not present.\n"); - return; - } - ntfs_log_debug("VCN LCN Run length\n"); - do { - LCN lcn = (rl + i)->lcn; - - if (lcn < (LCN)0) { - int idx = -lcn - 1; - - if (idx > -LCN_EINVAL - 1) - idx = 4; - ntfs_log_debug("%-16lld %s %-16lld%s\n", - (long long)rl[i].vcn, lcn_str[idx], - (long long)rl[i].length, - rl[i].length ? "" : " (runlist end)"); - } else - ntfs_log_debug("%-16lld %-16lld %-16lld%s\n", - (long long)rl[i].vcn, (long long)rl[i].lcn, - (long long)rl[i].length, - rl[i].length ? "" : " (runlist end)"); - } while (rl[i++].length); -} - -#endif - diff --git a/source/libs/libntfs/debug.h b/source/libs/libntfs/debug.h deleted file mode 100644 index cf39b625..00000000 --- a/source/libs/libntfs/debug.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * debug.h - Debugging output functions. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002-2004 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_DEBUG_H -#define _NTFS_DEBUG_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "logging.h" - -struct _runlist_element; - -#ifdef DEBUG -extern void ntfs_debug_runlist_dump(const struct _runlist_element *rl); -#else -static __inline__ void ntfs_debug_runlist_dump(const struct _runlist_element *rl __attribute__((unused))) {} -#endif - -#define NTFS_BUG(msg) \ -{ \ - int ___i; \ - ntfs_log_critical("Bug in %s(): %s\n", __FUNCTION__, msg); \ - ntfs_log_debug("Forcing segmentation fault!"); \ - ___i = ((int*)NULL)[1]; \ -} - -#endif /* defined _NTFS_DEBUG_H */ diff --git a/source/libs/libntfs/device.c b/source/libs/libntfs/device.c deleted file mode 100644 index c77d8f95..00000000 --- a/source/libs/libntfs/device.c +++ /dev/null @@ -1,730 +0,0 @@ -/** - * device.c - Low level device io functions. Originated from the Linux-NTFS project. - * - * Copyright (c) 2004-2006 Anton Altaparmakov - * Copyright (c) 2004-2006 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_SYS_IOCTL_H -#include -#endif -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_MOUNT_H -#include -#endif -#ifdef HAVE_LINUX_FD_H -#include -#endif -#ifdef HAVE_LINUX_HDREG_H -#include -#endif - -#include "types.h" -#include "mst.h" -#include "debug.h" -#include "device.h" -#include "logging.h" -#include "misc.h" - -#if defined(linux) && defined(_IO) && !defined(BLKGETSIZE) -#define BLKGETSIZE _IO(0x12,96) /* Get device size in 512-byte blocks. */ -#endif -#if defined(linux) && defined(_IOR) && !defined(BLKGETSIZE64) -#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* Get device size in bytes. */ -#endif -#if defined(linux) && !defined(HDIO_GETGEO) -#define HDIO_GETGEO 0x0301 /* Get device geometry. */ -#endif -#if defined(linux) && defined(_IO) && !defined(BLKSSZGET) -# define BLKSSZGET _IO(0x12,104) /* Get device sector size in bytes. */ -#endif -#if defined(linux) && defined(_IO) && !defined(BLKBSZSET) -# define BLKBSZSET _IOW(0x12,113,size_t) /* Set device block size in bytes. */ -#endif - -/** - * ntfs_device_alloc - allocate an ntfs device structure and pre-initialize it - * @name: name of the device (must be present) - * @state: initial device state (usually zero) - * @dops: ntfs device operations to use with the device (must be present) - * @priv_data: pointer to private data (optional) - * - * Allocate an ntfs device structure and pre-initialize it with the user- - * specified device operations @dops, device state @state, device name @name, - * and optional private data @priv_data. - * - * Note, @name is copied and can hence be freed after this functions returns. - * - * On success return a pointer to the allocated ntfs device structure and on - * error return NULL with errno set to the error code returned by ntfs_malloc(). - */ -struct ntfs_device *ntfs_device_alloc(const char *name, const long state, - struct ntfs_device_operations *dops, void *priv_data) -{ - struct ntfs_device *dev; - - if (!name) { - errno = EINVAL; - return NULL; - } - - dev = ntfs_malloc(sizeof(struct ntfs_device)); - if (dev) { - if (!(dev->d_name = strdup(name))) { - int eo = errno; - free(dev); - errno = eo; - return NULL; - } - dev->d_ops = dops; - dev->d_state = state; - dev->d_private = priv_data; - } - return dev; -} - -/** - * ntfs_device_free - free an ntfs device structure - * @dev: ntfs device structure to free - * - * Free the ntfs device structure @dev. - * - * Return 0 on success or -1 on error with errno set to the error code. The - * following error codes are defined: - * EINVAL Invalid pointer @dev. - * EBUSY Device is still open. Close it before freeing it! - */ -int ntfs_device_free(struct ntfs_device *dev) -{ - if (!dev) { - errno = EINVAL; - return -1; - } - if (NDevOpen(dev)) { - errno = EBUSY; - return -1; - } - free(dev->d_name); - free(dev); - return 0; -} - -/** - * ntfs_pread - positioned read from disk - * @dev: device to read from - * @pos: position in device to read from - * @count: number of bytes to read - * @b: output data buffer - * - * This function will read @count bytes from device @dev at position @pos into - * the data buffer @b. - * - * On success, return the number of successfully read bytes. If this number is - * lower than @count this means that we have either reached end of file or - * encountered an error during the read so that the read is partial. 0 means - * end of file or nothing to read (@count is 0). - * - * On error and nothing has been read, return -1 with errno set appropriately - * to the return code of either seek, read, or set to EINVAL in case of - * invalid arguments. - */ -s64 ntfs_pread(struct ntfs_device *dev, const s64 pos, s64 count, void *b) -{ - s64 br, total; - struct ntfs_device_operations *dops; - - ntfs_log_trace("pos %lld, count %lld\n",(long long)pos,(long long)count); - - if (!b || count < 0 || pos < 0) { - errno = EINVAL; - return -1; - } - if (!count) - return 0; - - dops = dev->d_ops; - - for (total = 0; count; count -= br, total += br) { - br = dops->pread(dev, (char*)b + total, count, pos + total); - /* If everything ok, continue. */ - if (br > 0) - continue; - /* If EOF or error return number of bytes read. */ - if (!br || total) - return total; - /* Nothing read and error, return error status. */ - return br; - } - /* Finally, return the number of bytes read. */ - return total; -} - -/** - * ntfs_pwrite - positioned write to disk - * @dev: device to write to - * @pos: position in file descriptor to write to - * @count: number of bytes to write - * @b: data buffer to write to disk - * - * This function will write @count bytes from data buffer @b to the device @dev - * at position @pos. - * - * On success, return the number of successfully written bytes. If this number - * is lower than @count this means that the write has been interrupted in - * flight or that an error was encountered during the write so that the write - * is partial. 0 means nothing was written (also return 0 when @count is 0). - * - * On error and nothing has been written, return -1 with errno set - * appropriately to the return code of either seek, write, or set - * to EINVAL in case of invalid arguments. - */ -s64 ntfs_pwrite(struct ntfs_device *dev, const s64 pos, s64 count, - const void *b) -{ - s64 written, total, ret = -1; - struct ntfs_device_operations *dops; - - ntfs_log_trace("pos %lld, count %lld\n",(long long)pos,(long long)count); - - if (!b || count < 0 || pos < 0) { - errno = EINVAL; - goto out; - } - if (!count) - return 0; - if (NDevReadOnly(dev)) { - errno = EROFS; - goto out; - } - - dops = dev->d_ops; - - NDevSetDirty(dev); - for (total = 0; count; count -= written, total += written) { - written = dops->pwrite(dev, (const char*)b + total, count, - pos + total); - /* If everything ok, continue. */ - if (written > 0) - continue; - /* - * If nothing written or error return number of bytes written. - */ - if (!written || total) - break; - /* Nothing written and error, return error status. */ - total = written; - break; - } - ret = total; -out: - return ret; -} - -/** - * ntfs_mst_pread - multi sector transfer (mst) positioned read - * @dev: device to read from - * @pos: position in file descriptor to read from - * @count: number of blocks to read - * @bksize: size of each block that needs mst deprotecting - * @b: output data buffer - * - * Multi sector transfer (mst) positioned read. This function will read @count - * blocks of size @bksize bytes each from device @dev at position @pos into the - * the data buffer @b. - * - * On success, return the number of successfully read blocks. If this number is - * lower than @count this means that we have reached end of file, that the read - * was interrupted, or that an error was encountered during the read so that - * the read is partial. 0 means end of file or nothing was read (also return 0 - * when @count or @bksize are 0). - * - * On error and nothing was read, return -1 with errno set appropriately to the - * return code of either seek, read, or set to EINVAL in case of invalid - * arguments. - * - * NOTE: If an incomplete multi sector transfer has been detected the magic - * will have been changed to magic_BAAD but no error will be returned. Thus it - * is possible that we return count blocks as being read but that any number - * (between zero and count!) of these blocks is actually subject to a multi - * sector transfer error. This should be detected by the caller by checking for - * the magic being "BAAD". - */ -s64 ntfs_mst_pread(struct ntfs_device *dev, const s64 pos, s64 count, - const u32 bksize, void *b) -{ - s64 br, i; - - if (bksize & (bksize - 1) || bksize % NTFS_BLOCK_SIZE) { - errno = EINVAL; - return -1; - } - /* Do the read. */ - br = ntfs_pread(dev, pos, count * bksize, b); - if (br < 0) - return br; - /* - * Apply fixups to successfully read data, disregarding any errors - * returned from the MST fixup function. This is because we want to - * fixup everything possible and we rely on the fact that the "BAAD" - * magic will be detected later on. - */ - count = br / bksize; - for (i = 0; i < count; ++i) - ntfs_mst_post_read_fixup((NTFS_RECORD*) - ((u8*)b + i * bksize), bksize); - /* Finally, return the number of complete blocks read. */ - return count; -} - -/** - * ntfs_mst_pwrite - multi sector transfer (mst) positioned write - * @dev: device to write to - * @pos: position in file descriptor to write to - * @count: number of blocks to write - * @bksize: size of each block that needs mst protecting - * @b: data buffer to write to disk - * - * Multi sector transfer (mst) positioned write. This function will write - * @count blocks of size @bksize bytes each from data buffer @b to the device - * @dev at position @pos. - * - * On success, return the number of successfully written blocks. If this number - * is lower than @count this means that the write has been interrupted or that - * an error was encountered during the write so that the write is partial. 0 - * means nothing was written (also return 0 when @count or @bksize are 0). - * - * On error and nothing has been written, return -1 with errno set - * appropriately to the return code of either seek, write, or set - * to EINVAL in case of invalid arguments. - * - * NOTE: We mst protect the data, write it, then mst deprotect it using a quick - * deprotect algorithm (no checking). This saves us from making a copy before - * the write and at the same time causes the usn to be incremented in the - * buffer. This conceptually fits in better with the idea that cached data is - * always deprotected and protection is performed when the data is actually - * going to hit the disk and the cache is immediately deprotected again - * simulating an mst read on the written data. This way cache coherency is - * achieved. - */ -s64 ntfs_mst_pwrite(struct ntfs_device *dev, const s64 pos, s64 count, - const u32 bksize, void *b) -{ - s64 written, i; - - if (count < 0 || bksize % NTFS_BLOCK_SIZE) { - errno = EINVAL; - return -1; - } - if (!count) - return 0; - /* Prepare data for writing. */ - for (i = 0; i < count; ++i) { - int err; - - err = ntfs_mst_pre_write_fixup((NTFS_RECORD*) - ((u8*)b + i * bksize), bksize); - if (err < 0) { - /* Abort write at this position. */ - if (!i) - return err; - count = i; - break; - } - } - /* Write the prepared data. */ - written = ntfs_pwrite(dev, pos, count * bksize, b); - /* Quickly deprotect the data again. */ - for (i = 0; i < count; ++i) - ntfs_mst_post_write_fixup((NTFS_RECORD*)((u8*)b + i * bksize)); - if (written <= 0) - return written; - /* Finally, return the number of complete blocks written. */ - return written / bksize; -} - -/** - * ntfs_cluster_read - read ntfs clusters - * @vol: volume to read from - * @lcn: starting logical cluster number - * @count: number of clusters to read - * @b: output data buffer - * - * Read @count ntfs clusters starting at logical cluster number @lcn from - * volume @vol into buffer @b. Return number of clusters read or -1 on error, - * with errno set to the error code. - */ -s64 ntfs_cluster_read(const ntfs_volume *vol, const s64 lcn, const s64 count, - void *b) -{ - s64 br; - - if (!vol || lcn < 0 || count < 0) { - errno = EINVAL; - return -1; - } - if (vol->nr_clusters < lcn + count) { - errno = ESPIPE; - ntfs_log_perror("Trying to read outside of volume " - "(%lld < %lld)", (long long)vol->nr_clusters, - (long long)lcn + count); - return -1; - } - br = ntfs_pread(vol->dev, lcn << vol->cluster_size_bits, - count << vol->cluster_size_bits, b); - if (br < 0) { - ntfs_log_perror("Error reading cluster(s)"); - return br; - } - return br >> vol->cluster_size_bits; -} - -/** - * ntfs_cluster_write - write ntfs clusters - * @vol: volume to write to - * @lcn: starting logical cluster number - * @count: number of clusters to write - * @b: data buffer to write to disk - * - * Write @count ntfs clusters starting at logical cluster number @lcn from - * buffer @b to volume @vol. Return the number of clusters written or -1 on - * error, with errno set to the error code. - */ -s64 ntfs_cluster_write(const ntfs_volume *vol, const s64 lcn, - const s64 count, const void *b) -{ - s64 bw; - - if (!vol || lcn < 0 || count < 0) { - errno = EINVAL; - return -1; - } - if (vol->nr_clusters < lcn + count) { - errno = ESPIPE; - ntfs_log_perror("Trying to write outside of volume " - "(%lld < %lld)", (long long)vol->nr_clusters, - (long long)lcn + count); - return -1; - } - if (!NVolReadOnly(vol)) - bw = ntfs_pwrite(vol->dev, lcn << vol->cluster_size_bits, - count << vol->cluster_size_bits, b); - else - bw = count << vol->cluster_size_bits; - if (bw < 0) { - ntfs_log_perror("Error writing cluster(s)"); - return bw; - } - return bw >> vol->cluster_size_bits; -} - -/** - * ntfs_device_offset_valid - test if a device offset is valid - * @dev: open device - * @ofs: offset to test for validity - * - * Test if the offset @ofs is an existing location on the device described - * by the open device structure @dev. - * - * Return 0 if it is valid and -1 if it is not valid. - */ -static int ntfs_device_offset_valid(struct ntfs_device *dev, s64 ofs) -{ - char ch; - - if (dev->d_ops->seek(dev, ofs, SEEK_SET) >= 0 && - dev->d_ops->read(dev, &ch, 1) == 1) - return 0; - return -1; -} - -/** - * ntfs_device_size_get - return the size of a device in blocks - * @dev: open device - * @block_size: block size in bytes in which to return the result - * - * Return the number of @block_size sized blocks in the device described by the - * open device @dev. - * - * Adapted from e2fsutils-1.19, Copyright (C) 1995 Theodore Ts'o. - * - * On error return -1 with errno set to the error code. - */ -s64 ntfs_device_size_get(struct ntfs_device *dev, int block_size) -{ - s64 high, low; - - if (!dev || block_size <= 0 || (block_size - 1) & block_size) { - errno = EINVAL; - return -1; - } -#ifdef BLKGETSIZE64 - { u64 size; - - if (dev->d_ops->ioctl(dev, BLKGETSIZE64, &size) >= 0) { - ntfs_log_debug("BLKGETSIZE64 nr bytes = %llu (0x%llx)\n", - (unsigned long long)size, - (unsigned long long)size); - return (s64)size / block_size; - } - } -#endif -#ifdef BLKGETSIZE - { unsigned long size; - - if (dev->d_ops->ioctl(dev, BLKGETSIZE, &size) >= 0) { - ntfs_log_debug("BLKGETSIZE nr 512 byte blocks = %lu (0x%lx)\n", - size, size); - return (s64)size * 512 / block_size; - } - } -#endif -#ifdef FDGETPRM - { struct floppy_struct this_floppy; - - if (dev->d_ops->ioctl(dev, FDGETPRM, &this_floppy) >= 0) { - ntfs_log_debug("FDGETPRM nr 512 byte blocks = %lu (0x%lx)\n", - (unsigned long)this_floppy.size, - (unsigned long)this_floppy.size); - return (s64)this_floppy.size * 512 / block_size; - } - } -#endif - /* - * We couldn't figure it out by using a specialized ioctl, - * so do binary search to find the size of the device. - */ - low = 0LL; - for (high = 1024LL; !ntfs_device_offset_valid(dev, high); high <<= 1) - low = high; - while (low < high - 1LL) { - const s64 mid = (low + high) / 2; - - if (!ntfs_device_offset_valid(dev, mid)) - low = mid; - else - high = mid; - } - dev->d_ops->seek(dev, 0LL, SEEK_SET); - return (low + 1LL) / block_size; -} - -/** - * ntfs_device_partition_start_sector_get - get starting sector of a partition - * @dev: open device - * - * On success, return the starting sector of the partition @dev in the parent - * block device of @dev. On error return -1 with errno set to the error code. - * - * The following error codes are defined: - * EINVAL Input parameter error - * EOPNOTSUPP System does not support HDIO_GETGEO ioctl - * ENOTTY @dev is a file or a device not supporting HDIO_GETGEO - */ -s64 ntfs_device_partition_start_sector_get(struct ntfs_device *dev) -{ - if (!dev) { - errno = EINVAL; - return -1; - } -#ifdef HDIO_GETGEO - { struct hd_geometry geo; - - if (!dev->d_ops->ioctl(dev, HDIO_GETGEO, &geo)) { - ntfs_log_debug("HDIO_GETGEO start_sect = %lu (0x%lx)\n", - geo.start, geo.start); - return geo.start; - } - } -#else - errno = EOPNOTSUPP; -#endif - return -1; -} - -/** - * ntfs_device_heads_get - get number of heads of device - * @dev: open device - * - * On success, return the number of heads on the device @dev. On error return - * -1 with errno set to the error code. - * - * The following error codes are defined: - * EINVAL Input parameter error - * EOPNOTSUPP System does not support HDIO_GETGEO ioctl - * ENOTTY @dev is a file or a device not supporting HDIO_GETGEO - */ -int ntfs_device_heads_get(struct ntfs_device *dev) -{ - if (!dev) { - errno = EINVAL; - return -1; - } -#ifdef HDIO_GETGEO - { struct hd_geometry geo; - - if (!dev->d_ops->ioctl(dev, HDIO_GETGEO, &geo)) { - ntfs_log_debug("HDIO_GETGEO heads = %u (0x%x)\n", - (unsigned)geo.heads, - (unsigned)geo.heads); - return geo.heads; - } - } -#else - errno = EOPNOTSUPP; -#endif - return -1; -} - -/** - * ntfs_device_sectors_per_track_get - get number of sectors per track of device - * @dev: open device - * - * On success, return the number of sectors per track on the device @dev. On - * error return -1 with errno set to the error code. - * - * The following error codes are defined: - * EINVAL Input parameter error - * EOPNOTSUPP System does not support HDIO_GETGEO ioctl - * ENOTTY @dev is a file or a device not supporting HDIO_GETGEO - */ -int ntfs_device_sectors_per_track_get(struct ntfs_device *dev) -{ - if (!dev) { - errno = EINVAL; - return -1; - } -#ifdef HDIO_GETGEO - { struct hd_geometry geo; - - if (!dev->d_ops->ioctl(dev, HDIO_GETGEO, &geo)) { - ntfs_log_debug("HDIO_GETGEO sectors_per_track = %u (0x%x)\n", - (unsigned)geo.sectors, - (unsigned)geo.sectors); - return geo.sectors; - } - } -#else - errno = EOPNOTSUPP; -#endif - return -1; -} - -/** - * ntfs_device_sector_size_get - get sector size of a device - * @dev: open device - * - * On success, return the sector size in bytes of the device @dev. - * On error return -1 with errno set to the error code. - * - * The following error codes are defined: - * EINVAL Input parameter error - * EOPNOTSUPP System does not support BLKSSZGET ioctl - * ENOTTY @dev is a file or a device not supporting BLKSSZGET - */ -int ntfs_device_sector_size_get(struct ntfs_device *dev) -{ - if (!dev) { - errno = EINVAL; - return -1; - } -#ifdef BLKSSZGET - { - int sect_size = 0; - - if (!dev->d_ops->ioctl(dev, BLKSSZGET, §_size)) { - ntfs_log_debug("BLKSSZGET sector size = %d bytes\n", - sect_size); - return sect_size; - } - } -#else - errno = EOPNOTSUPP; -#endif - return -1; -} - -/** - * ntfs_device_block_size_set - set block size of a device - * @dev: open device - * @block_size: block size to set @dev to - * - * On success, return 0. - * On error return -1 with errno set to the error code. - * - * The following error codes are defined: - * EINVAL Input parameter error - * EOPNOTSUPP System does not support BLKBSZSET ioctl - * ENOTTY @dev is a file or a device not supporting BLKBSZSET - */ -int ntfs_device_block_size_set(struct ntfs_device *dev, - int block_size __attribute__((unused))) -{ - if (!dev) { - errno = EINVAL; - return -1; - } -#ifdef BLKBSZSET - { - size_t s_block_size = block_size; - if (!dev->d_ops->ioctl(dev, BLKBSZSET, &s_block_size)) { - ntfs_log_debug("Used BLKBSZSET to set block size to " - "%d bytes.\n", block_size); - return 0; - } - /* If not a block device, pretend it was successful. */ - if (!NDevBlock(dev)) - return 0; - } -#else - /* If not a block device, pretend it was successful. */ - if (!NDevBlock(dev)) - return 0; - errno = EOPNOTSUPP; -#endif - return -1; -} diff --git a/source/libs/libntfs/device.h b/source/libs/libntfs/device.h deleted file mode 100644 index a19d29c4..00000000 --- a/source/libs/libntfs/device.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * device.h - Exports for low level device io. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2006 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_DEVICE_H -#define _NTFS_DEVICE_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "device_io.h" -#include "types.h" -#include "support.h" -#include "volume.h" - -/** - * enum ntfs_device_state_bits - - * - * Defined bits for the state field in the ntfs_device structure. - */ -typedef enum { - ND_Open, /* 1: Device is open. */ - ND_ReadOnly, /* 1: Device is read-only. */ - ND_Dirty, /* 1: Device is dirty, needs sync. */ - ND_Block, /* 1: Device is a block device. */ -} ntfs_device_state_bits; - -#define test_ndev_flag(nd, flag) test_bit(ND_##flag, (nd)->d_state) -#define set_ndev_flag(nd, flag) set_bit(ND_##flag, (nd)->d_state) -#define clear_ndev_flag(nd, flag) clear_bit(ND_##flag, (nd)->d_state) - -#define NDevOpen(nd) test_ndev_flag(nd, Open) -#define NDevSetOpen(nd) set_ndev_flag(nd, Open) -#define NDevClearOpen(nd) clear_ndev_flag(nd, Open) - -#define NDevReadOnly(nd) test_ndev_flag(nd, ReadOnly) -#define NDevSetReadOnly(nd) set_ndev_flag(nd, ReadOnly) -#define NDevClearReadOnly(nd) clear_ndev_flag(nd, ReadOnly) - -#define NDevDirty(nd) test_ndev_flag(nd, Dirty) -#define NDevSetDirty(nd) set_ndev_flag(nd, Dirty) -#define NDevClearDirty(nd) clear_ndev_flag(nd, Dirty) - -#define NDevBlock(nd) test_ndev_flag(nd, Block) -#define NDevSetBlock(nd) set_ndev_flag(nd, Block) -#define NDevClearBlock(nd) clear_ndev_flag(nd, Block) - -/** - * struct ntfs_device - - * - * The ntfs device structure defining all operations needed to access the low - * level device underlying the ntfs volume. - */ -struct ntfs_device { - struct ntfs_device_operations *d_ops; /* Device operations. */ - unsigned long d_state; /* State of the device. */ - char *d_name; /* Name of device. */ - void *d_private; /* Private data used by the - device operations. */ -}; - -struct stat; - -/** - * struct ntfs_device_operations - - * - * The ntfs device operations defining all operations that can be performed on - * the low level device described by an ntfs device structure. - */ -struct ntfs_device_operations { - int (*open)(struct ntfs_device *dev, int flags); - int (*close)(struct ntfs_device *dev); - s64 (*seek)(struct ntfs_device *dev, s64 offset, int whence); - s64 (*read)(struct ntfs_device *dev, void *buf, s64 count); - s64 (*write)(struct ntfs_device *dev, const void *buf, s64 count); - s64 (*pread)(struct ntfs_device *dev, void *buf, s64 count, s64 offset); - s64 (*pwrite)(struct ntfs_device *dev, const void *buf, s64 count, - s64 offset); - int (*sync)(struct ntfs_device *dev); - int (*stat)(struct ntfs_device *dev, struct stat *buf); - int (*ioctl)(struct ntfs_device *dev, int request, void *argp); -}; - -extern struct ntfs_device *ntfs_device_alloc(const char *name, const long state, - struct ntfs_device_operations *dops, void *priv_data); -extern int ntfs_device_free(struct ntfs_device *dev); - -extern s64 ntfs_pread(struct ntfs_device *dev, const s64 pos, s64 count, - void *b); -extern s64 ntfs_pwrite(struct ntfs_device *dev, const s64 pos, s64 count, - const void *b); - -extern s64 ntfs_mst_pread(struct ntfs_device *dev, const s64 pos, s64 count, - const u32 bksize, void *b); -extern s64 ntfs_mst_pwrite(struct ntfs_device *dev, const s64 pos, s64 count, - const u32 bksize, void *b); - -extern s64 ntfs_cluster_read(const ntfs_volume *vol, const s64 lcn, - const s64 count, void *b); -extern s64 ntfs_cluster_write(const ntfs_volume *vol, const s64 lcn, - const s64 count, const void *b); - -extern s64 ntfs_device_size_get(struct ntfs_device *dev, int block_size); -extern s64 ntfs_device_partition_start_sector_get(struct ntfs_device *dev); -extern int ntfs_device_heads_get(struct ntfs_device *dev); -extern int ntfs_device_sectors_per_track_get(struct ntfs_device *dev); -extern int ntfs_device_sector_size_get(struct ntfs_device *dev); -extern int ntfs_device_block_size_set(struct ntfs_device *dev, int block_size); - -#endif /* defined _NTFS_DEVICE_H */ diff --git a/source/libs/libntfs/device_io.c b/source/libs/libntfs/device_io.c deleted file mode 100644 index f76bf703..00000000 --- a/source/libs/libntfs/device_io.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * device_io.c - Default device io operations. Originated from the Linux-NTFS project. - * - * Copyright (c) 2003 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "config.h" - -#ifndef GEKKO -#ifndef NO_NTFS_DEVICE_DEFAULT_IO_OPS - -#ifndef __CYGWIN32__ - -/* Not on Cygwin; use standard Unix style low level device operations. */ -#include "unix_io.c" - -#else /* __CYGWIN32__ */ - -/* On Cygwin; use Win32 low level device operations. */ -#include "win32_io.c" - -#endif /* __CYGWIN32__ */ - -#endif /* NO_NTFS_DEVICE_DEFAULT_IO_OPS */ -#endif /* GEKKO */ diff --git a/source/libs/libntfs/device_io.h b/source/libs/libntfs/device_io.h deleted file mode 100644 index fad4d85f..00000000 --- a/source/libs/libntfs/device_io.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * device_io.h - Exports for default device io. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2006 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_DEVICE_IO_H -#define _NTFS_DEVICE_IO_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef NO_NTFS_DEVICE_DEFAULT_IO_OPS - -#ifndef __CYGWIN32__ - -#ifndef GEKKO -/* Not on Cygwin; use standard Unix style low level device operations. */ -#define ntfs_device_default_io_ops ntfs_device_unix_io_ops -#else -/* Wii i/o device. */ -#define ntfs_device_default_io_ops ntfs_device_gekko_io_ops -#endif - -#else /* __CYGWIN32__ */ - -#ifndef HDIO_GETGEO -# define HDIO_GETGEO 0x301 -/** - * struct hd_geometry - - */ -struct hd_geometry { - unsigned char heads; - unsigned char sectors; - unsigned short cylinders; - unsigned long start; -}; -#endif -#ifndef BLKGETSIZE -# define BLKGETSIZE 0x1260 -#endif -#ifndef BLKSSZGET -# define BLKSSZGET 0x1268 -#endif -#ifndef BLKGETSIZE64 -# define BLKGETSIZE64 0x80041272 -#endif -#ifndef BLKBSZSET -# define BLKBSZSET 0x40041271 -#endif - -/* On Cygwin; use Win32 low level device operations. */ -#define ntfs_device_default_io_ops ntfs_device_win32_io_ops - -#endif /* __CYGWIN32__ */ - - -/* Forward declaration. */ -struct ntfs_device_operations; - -extern struct ntfs_device_operations ntfs_device_default_io_ops; - -#endif /* NO_NTFS_DEVICE_DEFAULT_IO_OPS */ - -#endif /* defined _NTFS_DEVICE_IO_H */ - diff --git a/source/libs/libntfs/dir.c b/source/libs/libntfs/dir.c deleted file mode 100644 index 2372f3f8..00000000 --- a/source/libs/libntfs/dir.c +++ /dev/null @@ -1,2660 +0,0 @@ -/** - * dir.c - Directory handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002-2005 Anton Altaparmakov - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2004-2008 Szabolcs Szakacsits - * Copyright (c) 2005-2007 Yura Pakhuchiy - * Copyright (c) 2008-2010 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#endif - -#include "param.h" -#include "types.h" -#include "debug.h" -#include "attrib.h" -#include "inode.h" -#include "dir.h" -#include "volume.h" -#include "mft.h" -#include "index.h" -#include "ntfstime.h" -#include "lcnalloc.h" -#include "logging.h" -#include "cache.h" -#include "misc.h" -#include "security.h" -#include "reparse.h" -#include "object_id.h" - -#ifdef HAVE_SETXATTR -#include -#endif - -/* - * The little endian Unicode strings "$I30", "$SII", "$SDH", "$O" - * and "$Q" as global constants. - */ -ntfschar NTFS_INDEX_I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'), - const_cpu_to_le16('3'), const_cpu_to_le16('0'), - const_cpu_to_le16('\0') }; -ntfschar NTFS_INDEX_SII[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('S'), - const_cpu_to_le16('I'), const_cpu_to_le16('I'), - const_cpu_to_le16('\0') }; -ntfschar NTFS_INDEX_SDH[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('S'), - const_cpu_to_le16('D'), const_cpu_to_le16('H'), - const_cpu_to_le16('\0') }; -ntfschar NTFS_INDEX_O[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('O'), - const_cpu_to_le16('\0') }; -ntfschar NTFS_INDEX_Q[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('Q'), - const_cpu_to_le16('\0') }; -ntfschar NTFS_INDEX_R[3] = { const_cpu_to_le16('$'), const_cpu_to_le16('R'), - const_cpu_to_le16('\0') }; - -#if CACHE_INODE_SIZE - -/* - * Pathname hashing - * - * Based on first char and second char (which may be '\0') - */ - -int ntfs_dir_inode_hash(const struct CACHED_GENERIC *cached) -{ - const char *path; - const unsigned char *name; - - path = (const char*)cached->variable; - if (!path) { - ntfs_log_error("Bad inode cache entry\n"); - return (-1); - } - name = (const unsigned char*)strrchr(path,'/'); - if (!name) - name = (const unsigned char*)path; - return (((name[0] << 1) + name[1] + strlen((const char*)name)) - % (2*CACHE_INODE_SIZE)); -} - -/* - * Pathname comparing for entering/fetching from cache - */ - -static int inode_cache_compare(const struct CACHED_GENERIC *cached, - const struct CACHED_GENERIC *wanted) -{ - return (!cached->variable - || strcmp(cached->variable, wanted->variable)); -} - -/* - * Pathname comparing for invalidating entries in cache - * - * A partial path is compared in order to invalidate all paths - * related to a renamed directory - * inode numbers are also checked, as deleting a long name may - * imply deleting a short name and conversely - * - * Only use associated with a CACHE_NOHASH flag - */ - -static int inode_cache_inv_compare(const struct CACHED_GENERIC *cached, - const struct CACHED_GENERIC *wanted) -{ - int len; - BOOL different; - const struct CACHED_INODE *w; - const struct CACHED_INODE *c; - - w = (const struct CACHED_INODE*)wanted; - c = (const struct CACHED_INODE*)cached; - if (w->pathname) { - len = strlen(w->pathname); - different = !cached->variable - || ((w->inum != MREF(c->inum)) - && (strncmp(c->pathname, w->pathname, len) - || ((c->pathname[len] != '\0') - && (c->pathname[len] != '/')))); - } else - different = !c->pathname - || (w->inum != MREF(c->inum)); - return (different); -} - -#endif - -#if CACHE_LOOKUP_SIZE - -/* - * File name comparing for entering/fetching from lookup cache - */ - -static int lookup_cache_compare(const struct CACHED_GENERIC *cached, - const struct CACHED_GENERIC *wanted) -{ - const struct CACHED_LOOKUP *c = (const struct CACHED_LOOKUP*) cached; - const struct CACHED_LOOKUP *w = (const struct CACHED_LOOKUP*) wanted; - return (!c->name - || (c->parent != w->parent) - || (c->namesize != w->namesize) - || memcmp(c->name, w->name, c->namesize)); -} - -/* - * Inode number comparing for invalidating lookup cache - * - * All entries with designated inode number are invalidated - * - * Only use associated with a CACHE_NOHASH flag - */ - -static int lookup_cache_inv_compare(const struct CACHED_GENERIC *cached, - const struct CACHED_GENERIC *wanted) -{ - const struct CACHED_LOOKUP *c = (const struct CACHED_LOOKUP*) cached; - const struct CACHED_LOOKUP *w = (const struct CACHED_LOOKUP*) wanted; - return (!c->name - || (c->parent != w->parent) - || (MREF(c->inum) != MREF(w->inum))); -} - -/* - * Lookup hashing - * - * Based on first, second and and last char - */ - -int ntfs_dir_lookup_hash(const struct CACHED_GENERIC *cached) -{ - const unsigned char *name; - int count; - unsigned int val; - - name = (const unsigned char*)cached->variable; - count = cached->varsize; - if (!name || !count) { - ntfs_log_error("Bad lookup cache entry\n"); - return (-1); - } - val = (name[0] << 2) + (name[1] << 1) + name[count - 1] + count; - return (val % (2*CACHE_LOOKUP_SIZE)); -} - -#endif - -/** - * ntfs_inode_lookup_by_name - find an inode in a directory given its name - * @dir_ni: ntfs inode of the directory in which to search for the name - * @uname: Unicode name for which to search in the directory - * @uname_len: length of the name @uname in Unicode characters - * - * Look for an inode with name @uname in the directory with inode @dir_ni. - * ntfs_inode_lookup_by_name() walks the contents of the directory looking for - * the Unicode name. If the name is found in the directory, the corresponding - * inode number (>= 0) is returned as a mft reference in cpu format, i.e. it - * is a 64-bit number containing the sequence number. - * - * On error, return -1 with errno set to the error code. If the inode is is not - * found errno is ENOENT. - * - * Note, @uname_len does not include the (optional) terminating NULL character. - * - * Note, we look for a case sensitive match first but we also look for a case - * insensitive match at the same time. If we find a case insensitive match, we - * save that for the case that we don't find an exact match, where we return - * the mft reference of the case insensitive match. - * - * If the volume is mounted with the case sensitive flag set, then we only - * allow exact matches. - */ -u64 ntfs_inode_lookup_by_name(ntfs_inode *dir_ni, - const ntfschar *uname, const int uname_len) -{ - VCN vcn; - u64 mref = 0; - s64 br; - ntfs_volume *vol = dir_ni->vol; - ntfs_attr_search_ctx *ctx; - INDEX_ROOT *ir; - INDEX_ENTRY *ie; - INDEX_ALLOCATION *ia; - IGNORE_CASE_BOOL case_sensitivity; - u8 *index_end; - ntfs_attr *ia_na; - int eo, rc; - u32 index_block_size, index_vcn_size; - u8 index_vcn_size_bits; - - ntfs_log_trace("Entering\n"); - - if (!dir_ni || !dir_ni->mrec || !uname || uname_len <= 0) { - errno = EINVAL; - return -1; - } - - ctx = ntfs_attr_get_search_ctx(dir_ni, NULL); - if (!ctx) - return -1; - - /* Find the index root attribute in the mft record. */ - if (ntfs_attr_lookup(AT_INDEX_ROOT, NTFS_INDEX_I30, 4, CASE_SENSITIVE, 0, NULL, - 0, ctx)) { - ntfs_log_perror("Index root attribute missing in directory inode " - "%lld", (unsigned long long)dir_ni->mft_no); - goto put_err_out; - } - case_sensitivity = (NVolCaseSensitive(vol) ? CASE_SENSITIVE : IGNORE_CASE); - /* Get to the index root value. */ - ir = (INDEX_ROOT*)((u8*)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - index_block_size = le32_to_cpu(ir->index_block_size); - if (index_block_size < NTFS_BLOCK_SIZE || - index_block_size & (index_block_size - 1)) { - ntfs_log_error("Index block size %u is invalid.\n", - (unsigned)index_block_size); - goto put_err_out; - } - index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length); - /* The first index entry. */ - ie = (INDEX_ENTRY*)((u8*)&ir->index + - le32_to_cpu(ir->index.entries_offset)); - /* - * Loop until we exceed valid memory (corruption case) or until we - * reach the last entry. - */ - for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) { - /* Bounds checks. */ - if ((u8*)ie < (u8*)ctx->mrec || (u8*)ie + - sizeof(INDEX_ENTRY_HEADER) > index_end || - (u8*)ie + le16_to_cpu(ie->key_length) > - index_end) { - ntfs_log_error("Index entry out of bounds in inode %lld" - "\n", (unsigned long long)dir_ni->mft_no); - goto put_err_out; - } - /* - * The last entry cannot contain a name. It can however contain - * a pointer to a child node in the B+tree so we just break out. - */ - if (ie->ie_flags & INDEX_ENTRY_END) - break; - - if (!le16_to_cpu(ie->length)) { - ntfs_log_error("Zero length index entry in inode %lld" - "\n", (unsigned long long)dir_ni->mft_no); - goto put_err_out; - } - /* - * Not a perfect match, need to do full blown collation so we - * know which way in the B+tree we have to go. - */ - rc = ntfs_names_full_collate(uname, uname_len, - (ntfschar*)&ie->key.file_name.file_name, - ie->key.file_name.file_name_length, - case_sensitivity, vol->upcase, vol->upcase_len); - /* - * If uname collates before the name of the current entry, there - * is definitely no such name in this index but we might need to - * descend into the B+tree so we just break out of the loop. - */ - if (rc == -1) - break; - /* The names are not equal, continue the search. */ - if (rc) - continue; - /* - * Perfect match, this will never happen as the - * ntfs_are_names_equal() call will have gotten a match but we - * still treat it correctly. - */ - mref = le64_to_cpu(ie->indexed_file); - ntfs_attr_put_search_ctx(ctx); - return mref; - } - /* - * We have finished with this index without success. Check for the - * presence of a child node and if not present return error code - * ENOENT, unless we have got the mft reference of a matching name - * cached in mref in which case return mref. - */ - if (!(ie->ie_flags & INDEX_ENTRY_NODE)) { - ntfs_attr_put_search_ctx(ctx); - if (mref) - return mref; - ntfs_log_debug("Entry not found.\n"); - errno = ENOENT; - return -1; - } /* Child node present, descend into it. */ - - /* Open the index allocation attribute. */ - ia_na = ntfs_attr_open(dir_ni, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4); - if (!ia_na) { - ntfs_log_perror("Failed to open index allocation (inode %lld)", - (unsigned long long)dir_ni->mft_no); - goto put_err_out; - } - - /* Allocate a buffer for the current index block. */ - ia = ntfs_malloc(index_block_size); - if (!ia) { - ntfs_attr_close(ia_na); - goto put_err_out; - } - - /* Determine the size of a vcn in the directory index. */ - if (vol->cluster_size <= index_block_size) { - index_vcn_size = vol->cluster_size; - index_vcn_size_bits = vol->cluster_size_bits; - } else { - index_vcn_size = vol->sector_size; - index_vcn_size_bits = vol->sector_size_bits; - } - - /* Get the starting vcn of the index_block holding the child node. */ - vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8); - -descend_into_child_node: - - /* Read the index block starting at vcn. */ - br = ntfs_attr_mst_pread(ia_na, vcn << index_vcn_size_bits, 1, - index_block_size, ia); - if (br != 1) { - if (br != -1) - errno = EIO; - ntfs_log_perror("Failed to read vcn 0x%llx", - (unsigned long long)vcn); - goto close_err_out; - } - - if (sle64_to_cpu(ia->index_block_vcn) != vcn) { - ntfs_log_error("Actual VCN (0x%llx) of index buffer is different " - "from expected VCN (0x%llx).\n", - (long long)sle64_to_cpu(ia->index_block_vcn), - (long long)vcn); - errno = EIO; - goto close_err_out; - } - if (le32_to_cpu(ia->index.allocated_size) + 0x18 != index_block_size) { - ntfs_log_error("Index buffer (VCN 0x%llx) of directory inode 0x%llx " - "has a size (%u) differing from the directory " - "specified size (%u).\n", (long long)vcn, - (unsigned long long)dir_ni->mft_no, - (unsigned) le32_to_cpu(ia->index.allocated_size) + 0x18, - (unsigned)index_block_size); - errno = EIO; - goto close_err_out; - } - index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length); - if (index_end > (u8*)ia + index_block_size) { - ntfs_log_error("Size of index buffer (VCN 0x%llx) of directory inode " - "0x%llx exceeds maximum size.\n", - (long long)vcn, (unsigned long long)dir_ni->mft_no); - errno = EIO; - goto close_err_out; - } - - /* The first index entry. */ - ie = (INDEX_ENTRY*)((u8*)&ia->index + - le32_to_cpu(ia->index.entries_offset)); - /* - * Iterate similar to above big loop but applied to index buffer, thus - * loop until we exceed valid memory (corruption case) or until we - * reach the last entry. - */ - for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) { - /* Bounds check. */ - if ((u8*)ie < (u8*)ia || (u8*)ie + - sizeof(INDEX_ENTRY_HEADER) > index_end || - (u8*)ie + le16_to_cpu(ie->key_length) > - index_end) { - ntfs_log_error("Index entry out of bounds in directory " - "inode %lld.\n", - (unsigned long long)dir_ni->mft_no); - errno = EIO; - goto close_err_out; - } - /* - * The last entry cannot contain a name. It can however contain - * a pointer to a child node in the B+tree so we just break out. - */ - if (ie->ie_flags & INDEX_ENTRY_END) - break; - - if (!le16_to_cpu(ie->length)) { - errno = EIO; - ntfs_log_error("Zero length index entry in inode %lld" - "\n", (unsigned long long)dir_ni->mft_no); - goto close_err_out; - } - /* - * Not a perfect match, need to do full blown collation so we - * know which way in the B+tree we have to go. - */ - rc = ntfs_names_full_collate(uname, uname_len, - (ntfschar*)&ie->key.file_name.file_name, - ie->key.file_name.file_name_length, - case_sensitivity, vol->upcase, vol->upcase_len); - /* - * If uname collates before the name of the current entry, there - * is definitely no such name in this index but we might need to - * descend into the B+tree so we just break out of the loop. - */ - if (rc == -1) - break; - /* The names are not equal, continue the search. */ - if (rc) - continue; - mref = le64_to_cpu(ie->indexed_file); - free(ia); - ntfs_attr_close(ia_na); - ntfs_attr_put_search_ctx(ctx); - return mref; - } - /* - * We have finished with this index buffer without success. Check for - * the presence of a child node. - */ - if (ie->ie_flags & INDEX_ENTRY_NODE) { - if ((ia->index.ih_flags & NODE_MASK) == LEAF_NODE) { - ntfs_log_error("Index entry with child node found in a leaf " - "node in directory inode %lld.\n", - (unsigned long long)dir_ni->mft_no); - errno = EIO; - goto close_err_out; - } - /* Child node present, descend into it. */ - vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8); - if (vcn >= 0) - goto descend_into_child_node; - ntfs_log_error("Negative child node vcn in directory inode " - "0x%llx.\n", (unsigned long long)dir_ni->mft_no); - errno = EIO; - goto close_err_out; - } - free(ia); - ntfs_attr_close(ia_na); - ntfs_attr_put_search_ctx(ctx); - /* - * No child node present, return error code ENOENT, unless we have got - * the mft reference of a matching name cached in mref in which case - * return mref. - */ - if (mref) - return mref; - ntfs_log_debug("Entry not found.\n"); - errno = ENOENT; - return -1; -put_err_out: - eo = EIO; - ntfs_log_debug("Corrupt directory. Aborting lookup.\n"); -eo_put_err_out: - ntfs_attr_put_search_ctx(ctx); - errno = eo; - return -1; -close_err_out: - eo = errno; - free(ia); - ntfs_attr_close(ia_na); - goto eo_put_err_out; -} - -/* - * Lookup a file in a directory from its UTF-8 name - * - * The name is first fetched from cache if one is defined - * - * Returns the inode number - * or -1 if not possible (errno tells why) - */ - -u64 ntfs_inode_lookup_by_mbsname(ntfs_inode *dir_ni, const char *name) -{ - int uname_len; - ntfschar *uname = (ntfschar*)NULL; - u64 inum; - char *cached_name; - const char *const_name; - - if (!NVolCaseSensitive(dir_ni->vol)) { - cached_name = ntfs_uppercase_mbs(name, - dir_ni->vol->upcase, dir_ni->vol->upcase_len); - const_name = cached_name; - } else { - cached_name = (char*)NULL; - const_name = name; - } - if (const_name) { -#if CACHE_LOOKUP_SIZE - - /* - * fetch inode from cache - */ - - if (dir_ni->vol->lookup_cache) { - struct CACHED_LOOKUP item; - struct CACHED_LOOKUP *cached; - - item.name = const_name; - item.namesize = strlen(const_name) + 1; - item.parent = dir_ni->mft_no; - cached = (struct CACHED_LOOKUP*)ntfs_fetch_cache( - dir_ni->vol->lookup_cache, - GENERIC(&item), lookup_cache_compare); - if (cached) { - inum = cached->inum; - if (inum == (u64)-1) - errno = ENOENT; - } else { - /* Generate unicode name. */ - uname_len = ntfs_mbstoucs(name, &uname); - if (uname_len >= 0) { - inum = ntfs_inode_lookup_by_name(dir_ni, - uname, uname_len); - item.inum = inum; - /* enter into cache, even if not found */ - ntfs_enter_cache(dir_ni->vol->lookup_cache, - GENERIC(&item), - lookup_cache_compare); - free(uname); - } else - inum = (s64)-1; - } - } else -#endif - { - /* Generate unicode name. */ - uname_len = ntfs_mbstoucs(cached_name, &uname); - if (uname_len >= 0) - inum = ntfs_inode_lookup_by_name(dir_ni, - uname, uname_len); - else - inum = (s64)-1; - } - if (cached_name) - free(cached_name); - } else - inum = (s64)-1; - return (inum); -} - -/* - * Update a cache lookup record when a name has been defined - * - * The UTF-8 name is required - */ - -void ntfs_inode_update_mbsname(ntfs_inode *dir_ni, const char *name, u64 inum) -{ -#if CACHE_LOOKUP_SIZE - struct CACHED_LOOKUP item; - struct CACHED_LOOKUP *cached; - char *cached_name; - - if (dir_ni->vol->lookup_cache) { - if (!NVolCaseSensitive(dir_ni->vol)) { - cached_name = ntfs_uppercase_mbs(name, - dir_ni->vol->upcase, dir_ni->vol->upcase_len); - item.name = cached_name; - } else { - cached_name = (char*)NULL; - item.name = name; - } - if (item.name) { - item.namesize = strlen(item.name) + 1; - item.parent = dir_ni->mft_no; - item.inum = inum; - cached = (struct CACHED_LOOKUP*)ntfs_enter_cache( - dir_ni->vol->lookup_cache, - GENERIC(&item), lookup_cache_compare); - if (cached) - cached->inum = inum; - if (cached_name) - free(cached_name); - } - } -#endif -} - -/** - * ntfs_pathname_to_inode - Find the inode which represents the given pathname - * @vol: An ntfs volume obtained from ntfs_mount - * @parent: A directory inode to begin the search (may be NULL) - * @pathname: Pathname to be located - * - * Take an ASCII pathname and find the inode that represents it. The function - * splits the path and then descends the directory tree. If @parent is NULL, - * then the root directory '.' will be used as the base for the search. - * - * Return: inode Success, the pathname was valid - * NULL Error, the pathname was invalid, or some other error occurred - */ -ntfs_inode *ntfs_pathname_to_inode(ntfs_volume *vol, ntfs_inode *parent, - const char *pathname) -{ - u64 inum; - int len, err = 0; - char *p, *q; - ntfs_inode *ni; - ntfs_inode *result = NULL; - ntfschar *unicode = NULL; - char *ascii = NULL; -#if CACHE_INODE_SIZE - struct CACHED_INODE item; - struct CACHED_INODE *cached; - char *fullname; -#endif - - if (!vol || !pathname) { - errno = EINVAL; - return NULL; - } - - ntfs_log_trace("path: '%s'\n", pathname); - - ascii = strdup(pathname); - if (!ascii) { - ntfs_log_error("Out of memory.\n"); - err = ENOMEM; - goto out; - } - - p = ascii; - /* Remove leading /'s. */ - while (p && *p && *p == PATH_SEP) - p++; -#if CACHE_INODE_SIZE - fullname = p; - if (p[0] && (p[strlen(p)-1] == PATH_SEP)) - ntfs_log_error("Unnormalized path %s\n",ascii); -#endif - if (parent) { - ni = parent; - } else { -#if CACHE_INODE_SIZE - /* - * fetch inode for full path from cache - */ - if (*fullname) { - item.pathname = fullname; - item.varsize = strlen(fullname) + 1; - cached = (struct CACHED_INODE*)ntfs_fetch_cache( - vol->xinode_cache, GENERIC(&item), - inode_cache_compare); - } else - cached = (struct CACHED_INODE*)NULL; - if (cached) { - /* - * return opened inode if found in cache - */ - inum = MREF(cached->inum); - ni = ntfs_inode_open(vol, inum); - if (!ni) { - ntfs_log_debug("Cannot open inode %llu: %s.\n", - (unsigned long long)inum, p); - err = EIO; - } - result = ni; - goto out; - } -#endif - ni = ntfs_inode_open(vol, FILE_root); - if (!ni) { - ntfs_log_debug("Couldn't open the inode of the root " - "directory.\n"); - err = EIO; - result = (ntfs_inode*)NULL; - goto out; - } - } - - while (p && *p) { - /* Find the end of the first token. */ - q = strchr(p, PATH_SEP); - if (q != NULL) { - *q = '\0'; - } -#if CACHE_INODE_SIZE - /* - * fetch inode for partial path from cache - */ - cached = (struct CACHED_INODE*)NULL; - if (!parent) { - item.pathname = fullname; - item.varsize = strlen(fullname) + 1; - cached = (struct CACHED_INODE*)ntfs_fetch_cache( - vol->xinode_cache, GENERIC(&item), - inode_cache_compare); - if (cached) { - inum = cached->inum; - } - } - /* - * if not in cache, translate, search, then - * insert into cache if found - */ - if (!cached) { - len = ntfs_mbstoucs(p, &unicode); - if (len < 0) { - ntfs_log_perror("Could not convert filename to Unicode:" - " '%s'", p); - err = errno; - goto close; - } else if (len > NTFS_MAX_NAME_LEN) { - err = ENAMETOOLONG; - goto close; - } - inum = ntfs_inode_lookup_by_name(ni, unicode, len); - if (!parent && (inum != (u64) -1)) { - item.inum = inum; - ntfs_enter_cache(vol->xinode_cache, - GENERIC(&item), - inode_cache_compare); - } - } -#else - len = ntfs_mbstoucs(p, &unicode); - if (len < 0) { - ntfs_log_perror("Could not convert filename to Unicode:" - " '%s'", p); - err = errno; - goto close; - } else if (len > NTFS_MAX_NAME_LEN) { - err = ENAMETOOLONG; - goto close; - } - inum = ntfs_inode_lookup_by_name(ni, unicode, len); -#endif - if (inum == (u64) -1) { - ntfs_log_debug("Couldn't find name '%s' in pathname " - "'%s'.\n", p, pathname); - err = ENOENT; - goto close; - } - - if (ni != parent) - if (ntfs_inode_close(ni)) { - err = errno; - goto out; - } - - inum = MREF(inum); - ni = ntfs_inode_open(vol, inum); - if (!ni) { - ntfs_log_debug("Cannot open inode %llu: %s.\n", - (unsigned long long)inum, p); - err = EIO; - goto close; - } - - free(unicode); - unicode = NULL; - - if (q) *q++ = PATH_SEP; /* JPA */ - p = q; - while (p && *p && *p == PATH_SEP) - p++; - } - - result = ni; - ni = NULL; -close: - if (ni && (ni != parent)) - if (ntfs_inode_close(ni) && !err) - err = errno; -out: - free(ascii); - free(unicode); - if (err) - errno = err; - return result; -} - -/* - * The little endian Unicode string ".." for ntfs_readdir(). - */ -static const ntfschar dotdot[3] = { const_cpu_to_le16('.'), - const_cpu_to_le16('.'), - const_cpu_to_le16('\0') }; - -/* - * union index_union - - * More helpers for ntfs_readdir(). - */ -typedef union { - INDEX_ROOT *ir; - INDEX_ALLOCATION *ia; -} index_union __attribute__((__transparent_union__)); - -/** - * enum INDEX_TYPE - - * More helpers for ntfs_readdir(). - */ -typedef enum { - INDEX_TYPE_ROOT, /* index root */ - INDEX_TYPE_ALLOCATION, /* index allocation */ -} INDEX_TYPE; - -/** - * ntfs_filldir - ntfs specific filldir method - * @dir_ni: ntfs inode of current directory - * @pos: current position in directory - * @ivcn_bits: log(2) of index vcn size - * @index_type: specifies whether @iu is an index root or an index allocation - * @iu: index root or index block to which @ie belongs - * @ie: current index entry - * @dirent: context for filldir callback supplied by the caller - * @filldir: filldir callback supplied by the caller - * - * Pass information specifying the current directory entry @ie to the @filldir - * callback. - */ -static int ntfs_filldir(ntfs_inode *dir_ni, s64 *pos, u8 ivcn_bits, - const INDEX_TYPE index_type, index_union iu, INDEX_ENTRY *ie, - void *dirent, ntfs_filldir_t filldir) -{ - FILE_NAME_ATTR *fn = &ie->key.file_name; - unsigned dt_type; - BOOL metadata; - ntfschar *loname; - int res; - MFT_REF mref; - - ntfs_log_trace("Entering.\n"); - - /* Advance the position even if going to skip the entry. */ - if (index_type == INDEX_TYPE_ALLOCATION) - *pos = (u8*)ie - (u8*)iu.ia + (sle64_to_cpu( - iu.ia->index_block_vcn) << ivcn_bits) + - dir_ni->vol->mft_record_size; - else /* if (index_type == INDEX_TYPE_ROOT) */ - *pos = (u8*)ie - (u8*)iu.ir; - /* Skip root directory self reference entry. */ - if (MREF_LE(ie->indexed_file) == FILE_root) - return 0; - if (ie->key.file_name.file_attributes & FILE_ATTR_I30_INDEX_PRESENT) - dt_type = NTFS_DT_DIR; - else if (fn->file_attributes & FILE_ATTR_SYSTEM) - dt_type = NTFS_DT_UNKNOWN; - else - dt_type = NTFS_DT_REG; - - /* return metadata files and hidden files if requested */ - mref = le64_to_cpu(ie->indexed_file); - metadata = (MREF(mref) != FILE_root) && (MREF(mref) < FILE_first_user); - if ((!metadata && (NVolShowHidFiles(dir_ni->vol) - || !(fn->file_attributes & FILE_ATTR_HIDDEN))) - || (NVolShowSysFiles(dir_ni->vol) && (NVolShowHidFiles(dir_ni->vol) - || metadata))) { - if (NVolCaseSensitive(dir_ni->vol)) { - res = filldir(dirent, fn->file_name, - fn->file_name_length, - fn->file_name_type, *pos, - mref, dt_type); - } else { - loname = (ntfschar*)ntfs_malloc(2*fn->file_name_length); - if (loname) { - memcpy(loname, fn->file_name, - 2*fn->file_name_length); - ntfs_name_locase(loname, fn->file_name_length, - dir_ni->vol->locase, - dir_ni->vol->upcase_len); - res = filldir(dirent, loname, - fn->file_name_length, - fn->file_name_type, *pos, - mref, dt_type); - free(loname); - } else - res = -1; - } - } else - res = 0; - return (res); -} - -/** - * ntfs_mft_get_parent_ref - find mft reference of parent directory of an inode - * @ni: ntfs inode whose parent directory to find - * - * Find the parent directory of the ntfs inode @ni. To do this, find the first - * file name attribute in the mft record of @ni and return the parent mft - * reference from that. - * - * Note this only makes sense for directories, since files can be hard linked - * from multiple directories and there is no way for us to tell which one is - * being looked for. - * - * Technically directories can have hard links, too, but we consider that as - * illegal as Linux/UNIX do not support directory hard links. - * - * Return the mft reference of the parent directory on success or -1 on error - * with errno set to the error code. - */ -static MFT_REF ntfs_mft_get_parent_ref(ntfs_inode *ni) -{ - MFT_REF mref; - ntfs_attr_search_ctx *ctx; - FILE_NAME_ATTR *fn; - int eo; - - ntfs_log_trace("Entering.\n"); - - if (!ni) { - errno = EINVAL; - return ERR_MREF(-1); - } - - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return ERR_MREF(-1); - if (ntfs_attr_lookup(AT_FILE_NAME, AT_UNNAMED, 0, 0, 0, NULL, 0, ctx)) { - ntfs_log_error("No file name found in inode %lld\n", - (unsigned long long)ni->mft_no); - goto err_out; - } - if (ctx->attr->non_resident) { - ntfs_log_error("File name attribute must be resident (inode " - "%lld)\n", (unsigned long long)ni->mft_no); - goto io_err_out; - } - fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - if ((u8*)fn + le32_to_cpu(ctx->attr->value_length) > - (u8*)ctx->attr + le32_to_cpu(ctx->attr->length)) { - ntfs_log_error("Corrupt file name attribute in inode %lld.\n", - (unsigned long long)ni->mft_no); - goto io_err_out; - } - mref = le64_to_cpu(fn->parent_directory); - ntfs_attr_put_search_ctx(ctx); - return mref; -io_err_out: - errno = EIO; -err_out: - eo = errno; - ntfs_attr_put_search_ctx(ctx); - errno = eo; - return ERR_MREF(-1); -} - -/** - * ntfs_readdir - read the contents of an ntfs directory - * @dir_ni: ntfs inode of current directory - * @pos: current position in directory - * @dirent: context for filldir callback supplied by the caller - * @filldir: filldir callback supplied by the caller - * - * Parse the index root and the index blocks that are marked in use in the - * index bitmap and hand each found directory entry to the @filldir callback - * supplied by the caller. - * - * Return 0 on success or -1 on error with errno set to the error code. - * - * Note: Index blocks are parsed in ascending vcn order, from which follows - * that the directory entries are not returned sorted. - */ -int ntfs_readdir(ntfs_inode *dir_ni, s64 *pos, - void *dirent, ntfs_filldir_t filldir) -{ - s64 i_size, br, ia_pos, bmp_pos, ia_start; - ntfs_volume *vol; - ntfs_attr *ia_na, *bmp_na = NULL; - ntfs_attr_search_ctx *ctx = NULL; - u8 *index_end, *bmp = NULL; - INDEX_ROOT *ir; - INDEX_ENTRY *ie; - INDEX_ALLOCATION *ia = NULL; - int rc, ir_pos, bmp_buf_size, bmp_buf_pos, eo; - u32 index_block_size, index_vcn_size; - u8 index_block_size_bits, index_vcn_size_bits; - - ntfs_log_trace("Entering.\n"); - - if (!dir_ni || !pos || !filldir) { - errno = EINVAL; - return -1; - } - - if (!(dir_ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)) { - errno = ENOTDIR; - return -1; - } - - vol = dir_ni->vol; - - ntfs_log_trace("Entering for inode %lld, *pos 0x%llx.\n", - (unsigned long long)dir_ni->mft_no, (long long)*pos); - - /* Open the index allocation attribute. */ - ia_na = ntfs_attr_open(dir_ni, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4); - if (!ia_na) { - if (errno != ENOENT) { - ntfs_log_perror("Failed to open index allocation attribute. " - "Directory inode %lld is corrupt or bug", - (unsigned long long)dir_ni->mft_no); - return -1; - } - i_size = 0; - } else - i_size = ia_na->data_size; - - rc = 0; - - /* Are we at end of dir yet? */ - if (*pos >= i_size + vol->mft_record_size) - goto done; - - /* Emulate . and .. for all directories. */ - if (!*pos) { - rc = filldir(dirent, dotdot, 1, FILE_NAME_POSIX, *pos, - MK_MREF(dir_ni->mft_no, - le16_to_cpu(dir_ni->mrec->sequence_number)), - NTFS_DT_DIR); - if (rc) - goto err_out; - ++*pos; - } - if (*pos == 1) { - MFT_REF parent_mref; - - parent_mref = ntfs_mft_get_parent_ref(dir_ni); - if (parent_mref == ERR_MREF(-1)) { - ntfs_log_perror("Parent directory not found"); - goto dir_err_out; - } - - rc = filldir(dirent, dotdot, 2, FILE_NAME_POSIX, *pos, - parent_mref, NTFS_DT_DIR); - if (rc) - goto err_out; - ++*pos; - } - - ctx = ntfs_attr_get_search_ctx(dir_ni, NULL); - if (!ctx) - goto err_out; - - /* Get the offset into the index root attribute. */ - ir_pos = (int)*pos; - /* Find the index root attribute in the mft record. */ - if (ntfs_attr_lookup(AT_INDEX_ROOT, NTFS_INDEX_I30, 4, CASE_SENSITIVE, 0, NULL, - 0, ctx)) { - ntfs_log_perror("Index root attribute missing in directory inode " - "%lld", (unsigned long long)dir_ni->mft_no); - goto dir_err_out; - } - /* Get to the index root value. */ - ir = (INDEX_ROOT*)((u8*)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - - /* Determine the size of a vcn in the directory index. */ - index_block_size = le32_to_cpu(ir->index_block_size); - if (index_block_size < NTFS_BLOCK_SIZE || - index_block_size & (index_block_size - 1)) { - ntfs_log_error("Index block size %u is invalid.\n", - (unsigned)index_block_size); - goto dir_err_out; - } - index_block_size_bits = ffs(index_block_size) - 1; - if (vol->cluster_size <= index_block_size) { - index_vcn_size = vol->cluster_size; - index_vcn_size_bits = vol->cluster_size_bits; - } else { - index_vcn_size = vol->sector_size; - index_vcn_size_bits = vol->sector_size_bits; - } - - /* Are we jumping straight into the index allocation attribute? */ - if (*pos >= vol->mft_record_size) { - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - goto skip_index_root; - } - - index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length); - /* The first index entry. */ - ie = (INDEX_ENTRY*)((u8*)&ir->index + - le32_to_cpu(ir->index.entries_offset)); - /* - * Loop until we exceed valid memory (corruption case) or until we - * reach the last entry or until filldir tells us it has had enough - * or signals an error (both covered by the rc test). - */ - for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) { - ntfs_log_debug("In index root, offset %d.\n", (int)((u8*)ie - (u8*)ir)); - /* Bounds checks. */ - if ((u8*)ie < (u8*)ctx->mrec || (u8*)ie + - sizeof(INDEX_ENTRY_HEADER) > index_end || - (u8*)ie + le16_to_cpu(ie->key_length) > - index_end) - goto dir_err_out; - /* The last entry cannot contain a name. */ - if (ie->ie_flags & INDEX_ENTRY_END) - break; - - if (!le16_to_cpu(ie->length)) - goto dir_err_out; - - /* Skip index root entry if continuing previous readdir. */ - if (ir_pos > (u8*)ie - (u8*)ir) - continue; - /* - * Submit the directory entry to ntfs_filldir(), which will - * invoke the filldir() callback as appropriate. - */ - rc = ntfs_filldir(dir_ni, pos, index_vcn_size_bits, - INDEX_TYPE_ROOT, ir, ie, dirent, filldir); - if (rc) { - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - goto err_out; - } - } - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - - /* If there is no index allocation attribute we are finished. */ - if (!ia_na) - goto EOD; - - /* Advance *pos to the beginning of the index allocation. */ - *pos = vol->mft_record_size; - -skip_index_root: - - if (!ia_na) - goto done; - - /* Allocate a buffer for the current index block. */ - ia = ntfs_malloc(index_block_size); - if (!ia) - goto err_out; - - bmp_na = ntfs_attr_open(dir_ni, AT_BITMAP, NTFS_INDEX_I30, 4); - if (!bmp_na) { - ntfs_log_perror("Failed to open index bitmap attribute"); - goto dir_err_out; - } - - /* Get the offset into the index allocation attribute. */ - ia_pos = *pos - vol->mft_record_size; - - bmp_pos = ia_pos >> index_block_size_bits; - if (bmp_pos >> 3 >= bmp_na->data_size) { - ntfs_log_error("Current index position exceeds index bitmap " - "size.\n"); - goto dir_err_out; - } - - bmp_buf_size = min(bmp_na->data_size - (bmp_pos >> 3), 4096); - bmp = ntfs_malloc(bmp_buf_size); - if (!bmp) - goto err_out; - - br = ntfs_attr_pread(bmp_na, bmp_pos >> 3, bmp_buf_size, bmp); - if (br != bmp_buf_size) { - if (br != -1) - errno = EIO; - ntfs_log_perror("Failed to read from index bitmap attribute"); - goto err_out; - } - - bmp_buf_pos = 0; - /* If the index block is not in use find the next one that is. */ - while (!(bmp[bmp_buf_pos >> 3] & (1 << (bmp_buf_pos & 7)))) { -find_next_index_buffer: - bmp_pos++; - bmp_buf_pos++; - /* If we have reached the end of the bitmap, we are done. */ - if (bmp_pos >> 3 >= bmp_na->data_size) - goto EOD; - ia_pos = bmp_pos << index_block_size_bits; - if (bmp_buf_pos >> 3 < bmp_buf_size) - continue; - /* Read next chunk from the index bitmap. */ - bmp_buf_pos = 0; - if ((bmp_pos >> 3) + bmp_buf_size > bmp_na->data_size) - bmp_buf_size = bmp_na->data_size - (bmp_pos >> 3); - br = ntfs_attr_pread(bmp_na, bmp_pos >> 3, bmp_buf_size, bmp); - if (br != bmp_buf_size) { - if (br != -1) - errno = EIO; - ntfs_log_perror("Failed to read from index bitmap attribute"); - goto err_out; - } - } - - ntfs_log_debug("Handling index block 0x%llx.\n", (long long)bmp_pos); - - /* Read the index block starting at bmp_pos. */ - br = ntfs_attr_mst_pread(ia_na, bmp_pos << index_block_size_bits, 1, - index_block_size, ia); - if (br != 1) { - if (br != -1) - errno = EIO; - ntfs_log_perror("Failed to read index block"); - goto err_out; - } - - ia_start = ia_pos & ~(s64)(index_block_size - 1); - if (sle64_to_cpu(ia->index_block_vcn) != ia_start >> - index_vcn_size_bits) { - ntfs_log_error("Actual VCN (0x%llx) of index buffer is different " - "from expected VCN (0x%llx) in inode 0x%llx.\n", - (long long)sle64_to_cpu(ia->index_block_vcn), - (long long)ia_start >> index_vcn_size_bits, - (unsigned long long)dir_ni->mft_no); - goto dir_err_out; - } - if (le32_to_cpu(ia->index.allocated_size) + 0x18 != index_block_size) { - ntfs_log_error("Index buffer (VCN 0x%llx) of directory inode %lld " - "has a size (%u) differing from the directory " - "specified size (%u).\n", (long long)ia_start >> - index_vcn_size_bits, - (unsigned long long)dir_ni->mft_no, - (unsigned) le32_to_cpu(ia->index.allocated_size) - + 0x18, (unsigned)index_block_size); - goto dir_err_out; - } - index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length); - if (index_end > (u8*)ia + index_block_size) { - ntfs_log_error("Size of index buffer (VCN 0x%llx) of directory inode " - "%lld exceeds maximum size.\n", - (long long)ia_start >> index_vcn_size_bits, - (unsigned long long)dir_ni->mft_no); - goto dir_err_out; - } - /* The first index entry. */ - ie = (INDEX_ENTRY*)((u8*)&ia->index + - le32_to_cpu(ia->index.entries_offset)); - /* - * Loop until we exceed valid memory (corruption case) or until we - * reach the last entry or until ntfs_filldir tells us it has had - * enough or signals an error (both covered by the rc test). - */ - for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) { - ntfs_log_debug("In index allocation, offset 0x%llx.\n", - (long long)ia_start + ((u8*)ie - (u8*)ia)); - /* Bounds checks. */ - if ((u8*)ie < (u8*)ia || (u8*)ie + - sizeof(INDEX_ENTRY_HEADER) > index_end || - (u8*)ie + le16_to_cpu(ie->key_length) > - index_end) { - ntfs_log_error("Index entry out of bounds in directory inode " - "%lld.\n", (unsigned long long)dir_ni->mft_no); - goto dir_err_out; - } - /* The last entry cannot contain a name. */ - if (ie->ie_flags & INDEX_ENTRY_END) - break; - - if (!le16_to_cpu(ie->length)) - goto dir_err_out; - - /* Skip index entry if continuing previous readdir. */ - if (ia_pos - ia_start > (u8*)ie - (u8*)ia) - continue; - /* - * Submit the directory entry to ntfs_filldir(), which will - * invoke the filldir() callback as appropriate. - */ - rc = ntfs_filldir(dir_ni, pos, index_vcn_size_bits, - INDEX_TYPE_ALLOCATION, ia, ie, dirent, filldir); - if (rc) - goto err_out; - } - goto find_next_index_buffer; -EOD: - /* We are finished, set *pos to EOD. */ - *pos = i_size + vol->mft_record_size; -done: - free(ia); - free(bmp); - if (bmp_na) - ntfs_attr_close(bmp_na); - if (ia_na) - ntfs_attr_close(ia_na); - ntfs_log_debug("EOD, *pos 0x%llx, returning 0.\n", (long long)*pos); - return 0; -dir_err_out: - errno = EIO; -err_out: - eo = errno; - ntfs_log_trace("failed.\n"); - if (ctx) - ntfs_attr_put_search_ctx(ctx); - free(ia); - free(bmp); - if (bmp_na) - ntfs_attr_close(bmp_na); - if (ia_na) - ntfs_attr_close(ia_na); - errno = eo; - return -1; -} - - -/** - * __ntfs_create - create object on ntfs volume - * @dir_ni: ntfs inode for directory in which create new object - * @securid: id of inheritable security descriptor, 0 if none - * @name: unicode name of new object - * @name_len: length of the name in unicode characters - * @type: type of the object to create - * @dev: major and minor device numbers (obtained from makedev()) - * @target: target in unicode (only for symlinks) - * @target_len: length of target in unicode characters - * - * Internal, use ntfs_create{,_device,_symlink} wrappers instead. - * - * @type can be: - * S_IFREG to create regular file - * S_IFDIR to create directory - * S_IFBLK to create block device - * S_IFCHR to create character device - * S_IFLNK to create symbolic link - * S_IFIFO to create FIFO - * S_IFSOCK to create socket - * other values are invalid. - * - * @dev is used only if @type is S_IFBLK or S_IFCHR, in other cases its value - * ignored. - * - * @target and @target_len are used only if @type is S_IFLNK, in other cases - * their value ignored. - * - * Return opened ntfs inode that describes created object on success or NULL - * on error with errno set to the error code. - */ -static ntfs_inode *__ntfs_create(ntfs_inode *dir_ni, le32 securid, - ntfschar *name, u8 name_len, mode_t type, dev_t dev, - ntfschar *target, int target_len) -{ - ntfs_inode *ni; - int rollback_data = 0, rollback_sd = 0; - FILE_NAME_ATTR *fn = NULL; - STANDARD_INFORMATION *si = NULL; - int err, fn_len, si_len; - - ntfs_log_trace("Entering.\n"); - - /* Sanity checks. */ - if (!dir_ni || !name || !name_len) { - ntfs_log_error("Invalid arguments.\n"); - errno = EINVAL; - return NULL; - } - - if (dir_ni->flags & FILE_ATTR_REPARSE_POINT) { - errno = EOPNOTSUPP; - return NULL; - } - - ni = ntfs_mft_record_alloc(dir_ni->vol, NULL); - if (!ni) - return NULL; -#if CACHE_NIDATA_SIZE - ntfs_inode_invalidate(dir_ni->vol, ni->mft_no); -#endif - /* - * Create STANDARD_INFORMATION attribute. - * JPA Depending on available inherited security descriptor, - * Write STANDARD_INFORMATION v1.2 (no inheritance) or v3 - */ - if (securid) - si_len = sizeof(STANDARD_INFORMATION); - else - si_len = offsetof(STANDARD_INFORMATION, v1_end); - si = ntfs_calloc(si_len); - if (!si) { - err = errno; - goto err_out; - } - si->creation_time = ni->creation_time; - si->last_data_change_time = ni->last_data_change_time; - si->last_mft_change_time = ni->last_mft_change_time; - si->last_access_time = ni->last_access_time; - if (securid) { - set_nino_flag(ni, v3_Extensions); - ni->owner_id = si->owner_id = 0; - ni->security_id = si->security_id = securid; - ni->quota_charged = si->quota_charged = const_cpu_to_le64(0); - ni->usn = si->usn = const_cpu_to_le64(0); - } else - clear_nino_flag(ni, v3_Extensions); - if (!S_ISREG(type) && !S_ISDIR(type)) { - si->file_attributes = FILE_ATTR_SYSTEM; - ni->flags = FILE_ATTR_SYSTEM; - } - ni->flags |= FILE_ATTR_ARCHIVE; - if (NVolHideDotFiles(dir_ni->vol) - && (name_len > 1) - && (name[0] == const_cpu_to_le16('.')) - && (name[1] != const_cpu_to_le16('.'))) - ni->flags |= FILE_ATTR_HIDDEN; - /* - * Set compression flag according to parent directory - * unless NTFS version < 3.0 or cluster size > 4K - * or compression has been disabled - */ - if ((dir_ni->flags & FILE_ATTR_COMPRESSED) - && (dir_ni->vol->major_ver >= 3) - && NVolCompression(dir_ni->vol) - && (dir_ni->vol->cluster_size <= MAX_COMPRESSION_CLUSTER_SIZE) - && (S_ISREG(type) || S_ISDIR(type))) - ni->flags |= FILE_ATTR_COMPRESSED; - /* Add STANDARD_INFORMATION to inode. */ - if (ntfs_attr_add(ni, AT_STANDARD_INFORMATION, AT_UNNAMED, 0, - (u8*)si, si_len)) { - err = errno; - ntfs_log_error("Failed to add STANDARD_INFORMATION " - "attribute.\n"); - goto err_out; - } - - if (!securid) { - if (ntfs_sd_add_everyone(ni)) { - err = errno; - goto err_out; - } - } - rollback_sd = 1; - - if (S_ISDIR(type)) { - INDEX_ROOT *ir = NULL; - INDEX_ENTRY *ie; - int ir_len, index_len; - - /* Create INDEX_ROOT attribute. */ - index_len = sizeof(INDEX_HEADER) + sizeof(INDEX_ENTRY_HEADER); - ir_len = offsetof(INDEX_ROOT, index) + index_len; - ir = ntfs_calloc(ir_len); - if (!ir) { - err = errno; - goto err_out; - } - ir->type = AT_FILE_NAME; - ir->collation_rule = COLLATION_FILE_NAME; - ir->index_block_size = cpu_to_le32(ni->vol->indx_record_size); - if (ni->vol->cluster_size <= ni->vol->indx_record_size) - ir->clusters_per_index_block = - ni->vol->indx_record_size >> - ni->vol->cluster_size_bits; - else - ir->clusters_per_index_block = - ni->vol->indx_record_size >> - ni->vol->sector_size_bits; - ir->index.entries_offset = cpu_to_le32(sizeof(INDEX_HEADER)); - ir->index.index_length = cpu_to_le32(index_len); - ir->index.allocated_size = cpu_to_le32(index_len); - ie = (INDEX_ENTRY*)((u8*)ir + sizeof(INDEX_ROOT)); - ie->length = cpu_to_le16(sizeof(INDEX_ENTRY_HEADER)); - ie->key_length = 0; - ie->ie_flags = INDEX_ENTRY_END; - /* Add INDEX_ROOT attribute to inode. */ - if (ntfs_attr_add(ni, AT_INDEX_ROOT, NTFS_INDEX_I30, 4, - (u8*)ir, ir_len)) { - err = errno; - free(ir); - ntfs_log_error("Failed to add INDEX_ROOT attribute.\n"); - goto err_out; - } - free(ir); - } else { - INTX_FILE *data; - int data_len; - - switch (type) { - case S_IFBLK: - case S_IFCHR: - data_len = offsetof(INTX_FILE, device_end); - data = ntfs_malloc(data_len); - if (!data) { - err = errno; - goto err_out; - } - data->major = cpu_to_le64(major(dev)); - data->minor = cpu_to_le64(minor(dev)); - if (type == S_IFBLK) - data->magic = INTX_BLOCK_DEVICE; - if (type == S_IFCHR) - data->magic = INTX_CHARACTER_DEVICE; - break; - case S_IFLNK: - data_len = sizeof(INTX_FILE_TYPES) + - target_len * sizeof(ntfschar); - data = ntfs_malloc(data_len); - if (!data) { - err = errno; - goto err_out; - } - data->magic = INTX_SYMBOLIC_LINK; - memcpy(data->target, target, - target_len * sizeof(ntfschar)); - break; - case S_IFSOCK: - data = NULL; - data_len = 1; - break; - default: /* FIFO or regular file. */ - data = NULL; - data_len = 0; - break; - } - /* Add DATA attribute to inode. */ - if (ntfs_attr_add(ni, AT_DATA, AT_UNNAMED, 0, (u8*)data, - data_len)) { - err = errno; - ntfs_log_error("Failed to add DATA attribute.\n"); - free(data); - goto err_out; - } - rollback_data = 1; - free(data); - } - /* Create FILE_NAME attribute. */ - fn_len = sizeof(FILE_NAME_ATTR) + name_len * sizeof(ntfschar); - fn = ntfs_calloc(fn_len); - if (!fn) { - err = errno; - goto err_out; - } - fn->parent_directory = MK_LE_MREF(dir_ni->mft_no, - le16_to_cpu(dir_ni->mrec->sequence_number)); - fn->file_name_length = name_len; - fn->file_name_type = FILE_NAME_POSIX; - if (S_ISDIR(type)) - fn->file_attributes = FILE_ATTR_I30_INDEX_PRESENT; - if (!S_ISREG(type) && !S_ISDIR(type)) - fn->file_attributes = FILE_ATTR_SYSTEM; - else - fn->file_attributes |= ni->flags & FILE_ATTR_COMPRESSED; - fn->file_attributes |= FILE_ATTR_ARCHIVE; - fn->file_attributes |= ni->flags & FILE_ATTR_HIDDEN; - fn->creation_time = ni->creation_time; - fn->last_data_change_time = ni->last_data_change_time; - fn->last_mft_change_time = ni->last_mft_change_time; - fn->last_access_time = ni->last_access_time; - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - fn->data_size = fn->allocated_size = const_cpu_to_le64(0); - else { - fn->data_size = cpu_to_sle64(ni->data_size); - fn->allocated_size = cpu_to_sle64(ni->allocated_size); - } - memcpy(fn->file_name, name, name_len * sizeof(ntfschar)); - /* Add FILE_NAME attribute to inode. */ - if (ntfs_attr_add(ni, AT_FILE_NAME, AT_UNNAMED, 0, (u8*)fn, fn_len)) { - err = errno; - ntfs_log_error("Failed to add FILE_NAME attribute.\n"); - goto err_out; - } - /* Add FILE_NAME attribute to index. */ - if (ntfs_index_add_filename(dir_ni, fn, MK_MREF(ni->mft_no, - le16_to_cpu(ni->mrec->sequence_number)))) { - err = errno; - ntfs_log_perror("Failed to add entry to the index"); - goto err_out; - } - /* Set hard links count and directory flag. */ - ni->mrec->link_count = cpu_to_le16(1); - if (S_ISDIR(type)) - ni->mrec->flags |= MFT_RECORD_IS_DIRECTORY; - ntfs_inode_mark_dirty(ni); - /* Done! */ - free(fn); - free(si); - ntfs_log_trace("Done.\n"); - return ni; -err_out: - ntfs_log_trace("Failed.\n"); - - if (rollback_sd) - ntfs_attr_remove(ni, AT_SECURITY_DESCRIPTOR, AT_UNNAMED, 0); - - if (rollback_data) - ntfs_attr_remove(ni, AT_DATA, AT_UNNAMED, 0); - /* - * Free extent MFT records (should not exist any with current - * ntfs_create implementation, but for any case if something will be - * changed in the future). - */ - while (ni->nr_extents) - if (ntfs_mft_record_free(ni->vol, *(ni->extent_nis))) { - err = errno; - ntfs_log_error("Failed to free extent MFT record. " - "Leaving inconsistent metadata.\n"); - } - if (ntfs_mft_record_free(ni->vol, ni)) - ntfs_log_error("Failed to free MFT record. " - "Leaving inconsistent metadata. Run chkdsk.\n"); - free(fn); - free(si); - errno = err; - return NULL; -} - -/** - * Some wrappers around __ntfs_create() ... - */ - -ntfs_inode *ntfs_create(ntfs_inode *dir_ni, le32 securid, ntfschar *name, - u8 name_len, mode_t type) -{ - if (type != S_IFREG && type != S_IFDIR && type != S_IFIFO && - type != S_IFSOCK) { - ntfs_log_error("Invalid arguments.\n"); - return NULL; - } - return __ntfs_create(dir_ni, securid, name, name_len, type, 0, NULL, 0); -} - -ntfs_inode *ntfs_create_device(ntfs_inode *dir_ni, le32 securid, - ntfschar *name, u8 name_len, mode_t type, dev_t dev) -{ - if (type != S_IFCHR && type != S_IFBLK) { - ntfs_log_error("Invalid arguments.\n"); - return NULL; - } - return __ntfs_create(dir_ni, securid, name, name_len, type, dev, NULL, 0); -} - -ntfs_inode *ntfs_create_symlink(ntfs_inode *dir_ni, le32 securid, - ntfschar *name, u8 name_len, ntfschar *target, int target_len) -{ - if (!target || !target_len) { - ntfs_log_error("%s: Invalid argument (%p, %d)\n", __FUNCTION__, - target, target_len); - return NULL; - } - return __ntfs_create(dir_ni, securid, name, name_len, S_IFLNK, 0, - target, target_len); -} - -int ntfs_check_empty_dir(ntfs_inode *ni) -{ - ntfs_attr *na; - int ret = 0; - - if (!(ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)) - return 0; - - na = ntfs_attr_open(ni, AT_INDEX_ROOT, NTFS_INDEX_I30, 4); - if (!na) { - errno = EIO; - ntfs_log_perror("Failed to open directory"); - return -1; - } - - /* Non-empty directory? */ - if ((na->data_size != sizeof(INDEX_ROOT) + sizeof(INDEX_ENTRY_HEADER))){ - /* Both ENOTEMPTY and EEXIST are ok. We use the more common. */ - errno = ENOTEMPTY; - ntfs_log_debug("Directory is not empty\n"); - ret = -1; - } - - ntfs_attr_close(na); - return ret; -} - -static int ntfs_check_unlinkable_dir(ntfs_inode *ni, FILE_NAME_ATTR *fn) -{ - int link_count = le16_to_cpu(ni->mrec->link_count); - int ret; - - ret = ntfs_check_empty_dir(ni); - if (!ret || errno != ENOTEMPTY) - return ret; - /* - * Directory is non-empty, so we can unlink only if there is more than - * one "real" hard link, i.e. links aren't different DOS and WIN32 names - */ - if ((link_count == 1) || - (link_count == 2 && fn->file_name_type == FILE_NAME_DOS)) { - errno = ENOTEMPTY; - ntfs_log_debug("Non-empty directory without hard links\n"); - goto no_hardlink; - } - - ret = 0; -no_hardlink: - return ret; -} - -/** - * ntfs_delete - delete file or directory from ntfs volume - * @ni: ntfs inode for object to delte - * @dir_ni: ntfs inode for directory in which delete object - * @name: unicode name of the object to delete - * @name_len: length of the name in unicode characters - * - * @ni is always closed after the call to this function (even if it failed), - * user does not need to call ntfs_inode_close himself. - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -int ntfs_delete(ntfs_volume *vol, const char *pathname, - ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, u8 name_len) -{ - ntfs_attr_search_ctx *actx = NULL; - FILE_NAME_ATTR *fn = NULL; - BOOL looking_for_dos_name = FALSE, looking_for_win32_name = FALSE; - BOOL case_sensitive_match = TRUE; - int err = 0; -#if CACHE_NIDATA_SIZE - int i; -#endif -#if CACHE_INODE_SIZE - struct CACHED_INODE item; - const char *p; - u64 inum = (u64)-1; - int count; -#endif -#if CACHE_LOOKUP_SIZE - struct CACHED_LOOKUP lkitem; -#endif - - ntfs_log_trace("Entering.\n"); - - if (!ni || !dir_ni || !name || !name_len) { - ntfs_log_error("Invalid arguments.\n"); - errno = EINVAL; - goto err_out; - } - if (ni->nr_extents == -1) - ni = ni->base_ni; - if (dir_ni->nr_extents == -1) - dir_ni = dir_ni->base_ni; - /* - * Search for FILE_NAME attribute with such name. If it's in POSIX or - * WIN32_AND_DOS namespace, then simply remove it from index and inode. - * If filename in DOS or in WIN32 namespace, then remove DOS name first, - * only then remove WIN32 name. - */ - actx = ntfs_attr_get_search_ctx(ni, NULL); - if (!actx) - goto err_out; -search: - while (!ntfs_attr_lookup(AT_FILE_NAME, AT_UNNAMED, 0, CASE_SENSITIVE, - 0, NULL, 0, actx)) { - char *s; - BOOL case_sensitive = IGNORE_CASE; - - errno = 0; - fn = (FILE_NAME_ATTR*)((u8*)actx->attr + - le16_to_cpu(actx->attr->value_offset)); - s = ntfs_attr_name_get(fn->file_name, fn->file_name_length); - ntfs_log_trace("name: '%s' type: %d dos: %d win32: %d " - "case: %d\n", s, fn->file_name_type, - looking_for_dos_name, looking_for_win32_name, - case_sensitive_match); - ntfs_attr_name_free(&s); - if (looking_for_dos_name) { - if (fn->file_name_type == FILE_NAME_DOS) - break; - else - continue; - } - if (looking_for_win32_name) { - if (fn->file_name_type == FILE_NAME_WIN32) - break; - else - continue; - } - - /* Ignore hard links from other directories */ - if (dir_ni->mft_no != MREF_LE(fn->parent_directory)) { - ntfs_log_debug("MFT record numbers don't match " - "(%llu != %llu)\n", - (long long unsigned)dir_ni->mft_no, - (long long unsigned)MREF_LE(fn->parent_directory)); - continue; - } - - if (fn->file_name_type == FILE_NAME_POSIX || case_sensitive_match) - case_sensitive = CASE_SENSITIVE; - - if (ntfs_names_are_equal(fn->file_name, fn->file_name_length, - name, name_len, case_sensitive, - ni->vol->upcase, ni->vol->upcase_len)){ - - if (fn->file_name_type == FILE_NAME_WIN32) { - looking_for_dos_name = TRUE; - ntfs_attr_reinit_search_ctx(actx); - continue; - } - if (fn->file_name_type == FILE_NAME_DOS) - looking_for_dos_name = TRUE; - break; - } - } - if (errno) { - /* - * If case sensitive search failed, then try once again - * ignoring case. - */ - if (errno == ENOENT && case_sensitive_match) { - case_sensitive_match = FALSE; - ntfs_attr_reinit_search_ctx(actx); - goto search; - } - goto err_out; - } - - if (ntfs_check_unlinkable_dir(ni, fn) < 0) - goto err_out; - - if (ntfs_index_remove(dir_ni, ni, fn, le32_to_cpu(actx->attr->value_length))) - goto err_out; - - if (ntfs_attr_record_rm(actx)) - goto err_out; - - ni->mrec->link_count = cpu_to_le16(le16_to_cpu( - ni->mrec->link_count) - 1); - - ntfs_inode_mark_dirty(ni); - if (looking_for_dos_name) { - looking_for_dos_name = FALSE; - looking_for_win32_name = TRUE; - ntfs_attr_reinit_search_ctx(actx); - goto search; - } - /* TODO: Update object id, quota and securiry indexes if required. */ - /* - * If hard link count is not equal to zero then we are done. In other - * case there are no reference to this inode left, so we should free all - * non-resident attributes and mark all MFT record as not in use. - */ -#if CACHE_LOOKUP_SIZE - /* invalidate entry in lookup cache */ - lkitem.name = (const char*)NULL; - lkitem.namesize = 0; - lkitem.inum = ni->mft_no; - lkitem.parent = dir_ni->mft_no; - ntfs_invalidate_cache(vol->lookup_cache, GENERIC(&lkitem), - lookup_cache_inv_compare, CACHE_NOHASH); -#endif -#if CACHE_INODE_SIZE - inum = ni->mft_no; - if (pathname) { - /* invalide cache entry, even if there was an error */ - /* Remove leading /'s. */ - p = pathname; - while (*p == PATH_SEP) - p++; - if (p[0] && (p[strlen(p)-1] == PATH_SEP)) - ntfs_log_error("Unnormalized path %s\n",pathname); - item.pathname = p; - item.varsize = strlen(p); - } else { - item.pathname = (const char*)NULL; - item.varsize = 0; - } - item.inum = inum; - count = ntfs_invalidate_cache(vol->xinode_cache, GENERIC(&item), - inode_cache_inv_compare, CACHE_NOHASH); - if (pathname && !count) - ntfs_log_error("Could not delete inode cache entry for %s\n", - pathname); -#endif - if (ni->mrec->link_count) { - ntfs_inode_update_times(ni, NTFS_UPDATE_CTIME); - goto ok; - } - if (ntfs_delete_reparse_index(ni)) { - /* - * Failed to remove the reparse index : proceed anyway - * This is not a critical error, the entry is useless - * because of sequence_number, and stopping file deletion - * would be much worse as the file is not referenced now. - */ - err = errno; - } - if (ntfs_delete_object_id_index(ni)) { - /* - * Failed to remove the object id index : proceed anyway - * This is not a critical error. - */ - err = errno; - } - ntfs_attr_reinit_search_ctx(actx); - while (!ntfs_attrs_walk(actx)) { - if (actx->attr->non_resident) { - runlist *rl; - - rl = ntfs_mapping_pairs_decompress(ni->vol, actx->attr, - NULL); - if (!rl) { - err = errno; - ntfs_log_error("Failed to decompress runlist. " - "Leaving inconsistent metadata.\n"); - continue; - } - if (ntfs_cluster_free_from_rl(ni->vol, rl)) { - err = errno; - ntfs_log_error("Failed to free clusters. " - "Leaving inconsistent metadata.\n"); - continue; - } - free(rl); - } - } - if (errno != ENOENT) { - err = errno; - ntfs_log_error("Attribute enumeration failed. " - "Probably leaving inconsistent metadata.\n"); - } - /* All extents should be attached after attribute walk. */ -#if CACHE_NIDATA_SIZE - /* - * Disconnect extents before deleting them, so they are - * not wrongly moved to cache through the chainings - */ - for (i=ni->nr_extents-1; i>=0; i--) { - ni->extent_nis[i]->base_ni = (ntfs_inode*)NULL; - ni->extent_nis[i]->nr_extents = 0; - if (ntfs_mft_record_free(ni->vol, ni->extent_nis[i])) { - err = errno; - ntfs_log_error("Failed to free extent MFT record. " - "Leaving inconsistent metadata.\n"); - } - } - free(ni->extent_nis); - ni->nr_extents = 0; - ni->extent_nis = (ntfs_inode**)NULL; -#else - while (ni->nr_extents) - if (ntfs_mft_record_free(ni->vol, *(ni->extent_nis))) { - err = errno; - ntfs_log_error("Failed to free extent MFT record. " - "Leaving inconsistent metadata.\n"); - } -#endif - if (ntfs_mft_record_free(ni->vol, ni)) { - err = errno; - ntfs_log_error("Failed to free base MFT record. " - "Leaving inconsistent metadata.\n"); - } - ni = NULL; -ok: - ntfs_inode_update_times(dir_ni, NTFS_UPDATE_MCTIME); -out: - if (actx) - ntfs_attr_put_search_ctx(actx); - if (ntfs_inode_close(dir_ni) && !err) - err = errno; - if (ntfs_inode_close(ni) && !err) - err = errno; - if (err) { - errno = err; - ntfs_log_debug("Could not delete file: %s\n", strerror(errno)); - return -1; - } - ntfs_log_trace("Done.\n"); - return 0; -err_out: - err = errno; - goto out; -} - -/** - * ntfs_link - create hard link for file or directory - * @ni: ntfs inode for object to create hard link - * @dir_ni: ntfs inode for directory in which new link should be placed - * @name: unicode name of the new link - * @name_len: length of the name in unicode characters - * - * NOTE: At present we allow creating hardlinks to directories, we use them - * in a temporary state during rename. But it's defenitely bad idea to have - * hard links to directories as a result of operation. - * FIXME: Create internal __ntfs_link that allows hard links to a directories - * and external ntfs_link that do not. Write ntfs_rename that uses __ntfs_link. - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -static int ntfs_link_i(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, - u8 name_len, FILE_NAME_TYPE_FLAGS nametype) -{ - FILE_NAME_ATTR *fn = NULL; - int fn_len, err; - - ntfs_log_trace("Entering.\n"); - - if (!ni || !dir_ni || !name || !name_len || - ni->mft_no == dir_ni->mft_no) { - err = EINVAL; - ntfs_log_perror("ntfs_link wrong arguments"); - goto err_out; - } - - if ((ni->flags & FILE_ATTR_REPARSE_POINT) - && !ntfs_possible_symlink(ni)) { - err = EOPNOTSUPP; - goto err_out; - } - - /* Create FILE_NAME attribute. */ - fn_len = sizeof(FILE_NAME_ATTR) + name_len * sizeof(ntfschar); - fn = ntfs_calloc(fn_len); - if (!fn) { - err = errno; - goto err_out; - } - fn->parent_directory = MK_LE_MREF(dir_ni->mft_no, - le16_to_cpu(dir_ni->mrec->sequence_number)); - fn->file_name_length = name_len; - fn->file_name_type = nametype; - fn->file_attributes = ni->flags; - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - fn->file_attributes |= FILE_ATTR_I30_INDEX_PRESENT; - fn->data_size = fn->allocated_size = const_cpu_to_le64(0); - } else { - fn->allocated_size = cpu_to_sle64(ni->allocated_size); - fn->data_size = cpu_to_sle64(ni->data_size); - } - fn->creation_time = ni->creation_time; - fn->last_data_change_time = ni->last_data_change_time; - fn->last_mft_change_time = ni->last_mft_change_time; - fn->last_access_time = ni->last_access_time; - memcpy(fn->file_name, name, name_len * sizeof(ntfschar)); - /* Add FILE_NAME attribute to index. */ - if (ntfs_index_add_filename(dir_ni, fn, MK_MREF(ni->mft_no, - le16_to_cpu(ni->mrec->sequence_number)))) { - err = errno; - ntfs_log_perror("Failed to add filename to the index"); - goto err_out; - } - /* Add FILE_NAME attribute to inode. */ - if (ntfs_attr_add(ni, AT_FILE_NAME, AT_UNNAMED, 0, (u8*)fn, fn_len)) { - ntfs_log_error("Failed to add FILE_NAME attribute.\n"); - err = errno; - /* Try to remove just added attribute from index. */ - if (ntfs_index_remove(dir_ni, ni, fn, fn_len)) - goto rollback_failed; - goto err_out; - } - /* Increment hard links count. */ - ni->mrec->link_count = cpu_to_le16(le16_to_cpu( - ni->mrec->link_count) + 1); - /* Done! */ - ntfs_inode_mark_dirty(ni); - free(fn); - ntfs_log_trace("Done.\n"); - return 0; -rollback_failed: - ntfs_log_error("Rollback failed. Leaving inconsistent metadata.\n"); -err_out: - free(fn); - errno = err; - return -1; -} - -int ntfs_link(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, u8 name_len) -{ - return (ntfs_link_i(ni, dir_ni, name, name_len, FILE_NAME_POSIX)); -} - -/* - * Get a parent directory from an inode entry - * - * This is only used in situations where the path used to access - * the current file is not known for sure. The result may be different - * from the path when the file is linked in several parent directories. - * - * Currently this is only used for translating ".." in the target - * of a Vista relative symbolic link - */ - -ntfs_inode *ntfs_dir_parent_inode(ntfs_inode *ni) -{ - ntfs_inode *dir_ni = (ntfs_inode*)NULL; - u64 inum; - FILE_NAME_ATTR *fn; - ntfs_attr_search_ctx *ctx; - - if (ni->mft_no != FILE_root) { - /* find the name in the attributes */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return ((ntfs_inode*)NULL); - - if (!ntfs_attr_lookup(AT_FILE_NAME, AT_UNNAMED, 0, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - /* We know this will always be resident. */ - fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - inum = le64_to_cpu(fn->parent_directory); - if (inum != (u64)-1) { - dir_ni = ntfs_inode_open(ni->vol, MREF(inum)); - } - } - ntfs_attr_put_search_ctx(ctx); - } - return (dir_ni); -} - -#ifdef HAVE_SETXATTR - -#define MAX_DOS_NAME_LENGTH 12 - -/* - * Get a DOS name for a file in designated directory - * - * Returns size if found - * 0 if not found - * -1 if there was an error (described by errno) - */ - -static int get_dos_name(ntfs_inode *ni, u64 dnum, ntfschar *dosname) -{ - size_t outsize = 0; - FILE_NAME_ATTR *fn; - ntfs_attr_search_ctx *ctx; - - /* find the name in the attributes */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return -1; - - while (!ntfs_attr_lookup(AT_FILE_NAME, AT_UNNAMED, 0, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - /* We know this will always be resident. */ - fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - - if ((fn->file_name_type & FILE_NAME_DOS) - && (MREF_LE(fn->parent_directory) == dnum)) { - /* - * Found a DOS or WIN32+DOS name for the entry - * copy name, after truncation for safety - */ - outsize = fn->file_name_length; -/* TODO : reject if name is too long ? */ - if (outsize > MAX_DOS_NAME_LENGTH) - outsize = MAX_DOS_NAME_LENGTH; - memcpy(dosname,fn->file_name,outsize*sizeof(ntfschar)); - } - } - ntfs_attr_put_search_ctx(ctx); - return (outsize); -} - - -/* - * Get a long name for a file in designated directory - * - * Returns size if found - * 0 if not found - * -1 if there was an error (described by errno) - */ - -static int get_long_name(ntfs_inode *ni, u64 dnum, ntfschar *longname) -{ - size_t outsize = 0; - FILE_NAME_ATTR *fn; - ntfs_attr_search_ctx *ctx; - - /* find the name in the attributes */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return -1; - - /* first search for WIN32 or DOS+WIN32 names */ - while (!ntfs_attr_lookup(AT_FILE_NAME, AT_UNNAMED, 0, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - /* We know this will always be resident. */ - fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - - if ((fn->file_name_type & FILE_NAME_WIN32) - && (MREF_LE(fn->parent_directory) == dnum)) { - /* - * Found a WIN32 or WIN32+DOS name for the entry - * copy name - */ - outsize = fn->file_name_length; - memcpy(longname,fn->file_name,outsize*sizeof(ntfschar)); - } - } - /* if not found search for POSIX names */ - if (!outsize) { - ntfs_attr_reinit_search_ctx(ctx); - while (!ntfs_attr_lookup(AT_FILE_NAME, AT_UNNAMED, 0, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - /* We know this will always be resident. */ - fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - - if ((fn->file_name_type == FILE_NAME_POSIX) - && (MREF_LE(fn->parent_directory) == dnum)) { - /* - * Found a POSIX name for the entry - * copy name - */ - outsize = fn->file_name_length; - memcpy(longname,fn->file_name,outsize*sizeof(ntfschar)); - } - } - } - ntfs_attr_put_search_ctx(ctx); - return (outsize); -} - - -/* - * Get the ntfs DOS name into an extended attribute - */ - -int ntfs_get_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni, - char *value, size_t size) -{ - int outsize = 0; - char *outname = (char*)NULL; - u64 dnum; - int doslen; - ntfschar dosname[MAX_DOS_NAME_LENGTH]; - - dnum = dir_ni->mft_no; - doslen = get_dos_name(ni, dnum, dosname); - if (doslen > 0) { - /* - * Found a DOS name for the entry, make - * uppercase and encode into the buffer - * if there is enough space - */ - ntfs_name_upcase(dosname, doslen, - ni->vol->upcase, ni->vol->upcase_len); - if (ntfs_ucstombs(dosname, doslen, &outname, size) < 0) { - ntfs_log_error("Cannot represent dosname in current locale.\n"); - outsize = -errno; - } else { - outsize = strlen(outname); - if (value && (outsize <= (int)size)) - memcpy(value, outname, outsize); - else - if (size && (outsize > (int)size)) - outsize = -ERANGE; - free(outname); - } - } else { - if (doslen == 0) - errno = ENODATA; - outsize = -errno; - } - return (outsize); -} - -/* - * Change the name space of an existing file or directory - * - * Returns the old namespace if successful - * -1 if an error occurred (described by errno) - */ - -static int set_namespace(ntfs_inode *ni, ntfs_inode *dir_ni, - ntfschar *name, int len, - FILE_NAME_TYPE_FLAGS nametype) -{ - ntfs_attr_search_ctx *actx; - ntfs_index_context *icx; - FILE_NAME_ATTR *fnx; - FILE_NAME_ATTR *fn = NULL; - BOOL found; - int lkup; - int ret; - - ret = -1; - actx = ntfs_attr_get_search_ctx(ni, NULL); - if (actx) { - found = FALSE; - do { - lkup = ntfs_attr_lookup(AT_FILE_NAME, AT_UNNAMED, 0, - CASE_SENSITIVE, 0, NULL, 0, actx); - if (!lkup) { - fn = (FILE_NAME_ATTR*)((u8*)actx->attr + - le16_to_cpu(actx->attr->value_offset)); - found = (MREF_LE(fn->parent_directory) - == dir_ni->mft_no) - && !memcmp(fn->file_name, name, - len*sizeof(ntfschar)); - } - } while (!lkup && !found); - if (found) { - icx = ntfs_index_ctx_get(dir_ni, NTFS_INDEX_I30, 4); - if (icx) { - lkup = ntfs_index_lookup((char*)fn, len, icx); - if (!lkup && icx->data && icx->data_len) { - fnx = (FILE_NAME_ATTR*)icx->data; - ret = fn->file_name_type; - fn->file_name_type = nametype; - fnx->file_name_type = nametype; - ntfs_inode_mark_dirty(ni); - ntfs_index_entry_mark_dirty(icx); - } - ntfs_index_ctx_put(icx); - } - } - ntfs_attr_put_search_ctx(actx); - } - return (ret); -} - -/* - * Set a DOS name to a file and adjust name spaces - * - * If the new names are collapsible (same uppercased chars) : - * - * - the existing DOS name or DOS+Win32 name is made Posix - * - if it was a real DOS name, the existing long name is made DOS+Win32 - * and the existing DOS name is deleted - * - finally the existing long name is made DOS+Win32 unless already done - * - * If the new names are not collapsible : - * - * - insert the short name as a DOS name - * - delete the old long name or existing short name - * - insert the new long name (as a Win32 or DOS+Win32 name) - * - * Deleting the old long name will not delete the file - * provided the old name was in the Posix name space, - * because the alternate name has been set before. - * - * The inodes of file and parent directory are always closed - * - * Returns 0 if successful - * -1 if failed - */ - -static int set_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni, - ntfschar *shortname, int shortlen, - ntfschar *longname, int longlen, - ntfschar *deletename, int deletelen, BOOL existed) -{ - unsigned int linkcount; - ntfs_volume *vol; - BOOL collapsible; - BOOL deleted; - BOOL done; - FILE_NAME_TYPE_FLAGS oldnametype; - u64 dnum; - u64 fnum; - int res; - - res = -1; - vol = ni->vol; - dnum = dir_ni->mft_no; - fnum = ni->mft_no; - /* save initial link count */ - linkcount = le16_to_cpu(ni->mrec->link_count); - - /* check whether the same name may be used as DOS and WIN32 */ - collapsible = ntfs_collapsible_chars(ni->vol, shortname, shortlen, - longname, longlen); - if (collapsible) { - deleted = FALSE; - done = FALSE; - if (existed) { - oldnametype = set_namespace(ni, dir_ni, deletename, - deletelen, FILE_NAME_POSIX); - if (oldnametype == FILE_NAME_DOS) { - if (set_namespace(ni, dir_ni, longname, longlen, - FILE_NAME_WIN32_AND_DOS) >= 0) { - if (!ntfs_delete(vol, - (const char*)NULL, ni, dir_ni, - deletename, deletelen)) - res = 0; - deleted = TRUE; - } else - done = TRUE; - } - } - if (!deleted) { - if (!done && (set_namespace(ni, dir_ni, - longname, longlen, - FILE_NAME_WIN32_AND_DOS) >= 0)) - res = 0; - ntfs_inode_update_times(ni, NTFS_UPDATE_CTIME); - ntfs_inode_update_times(dir_ni, NTFS_UPDATE_MCTIME); - if (ntfs_inode_close_in_dir(ni,dir_ni) && !res) - res = -1; - if (ntfs_inode_close(dir_ni) && !res) - res = -1; - } - } else { - if (!ntfs_link_i(ni, dir_ni, shortname, shortlen, - FILE_NAME_DOS) - /* make sure a new link was recorded */ - && (le16_to_cpu(ni->mrec->link_count) > linkcount)) { - /* delete the existing long name or short name */ -// is it ok to not provide the path ? - if (!ntfs_delete(vol, (char*)NULL, ni, dir_ni, - deletename, deletelen)) { - /* delete closes the inodes, so have to open again */ - dir_ni = ntfs_inode_open(vol, dnum); - if (dir_ni) { - ni = ntfs_inode_open(vol, fnum); - if (ni) { - if (!ntfs_link_i(ni, dir_ni, - longname, longlen, - FILE_NAME_WIN32)) - res = 0; - if (ntfs_inode_close_in_dir(ni, - dir_ni) - && !res) - res = -1; - } - if (ntfs_inode_close(dir_ni) && !res) - res = -1; - } - } - } else { - ntfs_inode_close_in_dir(ni,dir_ni); - ntfs_inode_close(dir_ni); - } - } - return (res); -} - - -/* - * Set the ntfs DOS name into an extended attribute - * - * The DOS name will be added as another file name attribute - * using the existing file name information from the original - * name or overwriting the DOS Name if one exists. - * - * The inode of the file is always closed - */ - -int ntfs_set_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni, - const char *value, size_t size, int flags) -{ - int res = 0; - int longlen = 0; - int shortlen = 0; - char newname[MAX_DOS_NAME_LENGTH + 1]; - ntfschar oldname[MAX_DOS_NAME_LENGTH]; - int oldlen; - ntfs_volume *vol; - u64 fnum; - u64 dnum; - BOOL closed = FALSE; - ntfschar *shortname = NULL; - ntfschar longname[NTFS_MAX_NAME_LEN]; - - vol = ni->vol; - fnum = ni->mft_no; - /* convert the string to the NTFS wide chars */ - if (size > MAX_DOS_NAME_LENGTH) - size = MAX_DOS_NAME_LENGTH; - strncpy(newname, value, size); - newname[size] = 0; - shortlen = ntfs_mbstoucs(newname, &shortname); - /* make sure the short name has valid chars */ - if ((shortlen < 0) || ntfs_forbidden_chars(shortname,shortlen)) { - ntfs_inode_close_in_dir(ni,dir_ni); - ntfs_inode_close(dir_ni); - res = -errno; - return res; - } - dnum = dir_ni->mft_no; - longlen = get_long_name(ni, dnum, longname); - if (longlen > 0) { - oldlen = get_dos_name(ni, dnum, oldname); - if ((oldlen >= 0) - && !ntfs_forbidden_chars(longname, longlen)) { - if (oldlen > 0) { - if (flags & XATTR_CREATE) { - res = -1; - errno = EEXIST; - } else - if ((shortlen == oldlen) - && !memcmp(shortname,oldname, - oldlen*sizeof(ntfschar))) - /* already set, done */ - res = 0; - else { - res = set_dos_name(ni, dir_ni, - shortname, shortlen, - longname, longlen, - oldname, oldlen, TRUE); - closed = TRUE; - } - } else { - if (flags & XATTR_REPLACE) { - res = -1; - errno = ENODATA; - } else { - res = set_dos_name(ni, dir_ni, - shortname, shortlen, - longname, longlen, - longname, longlen, FALSE); - closed = TRUE; - } - } - } else - res = -1; - } else { - res = -1; - errno = ENOENT; - } - free(shortname); - if (!closed) { - ntfs_inode_close_in_dir(ni,dir_ni); - ntfs_inode_close(dir_ni); - } - return (res ? -1 : 0); -} - -/* - * Delete the ntfs DOS name - */ - -int ntfs_remove_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni) -{ - int res; - int oldnametype; - int longlen = 0; - int shortlen; - u64 dnum; - ntfs_volume *vol; - BOOL deleted = FALSE; - ntfschar shortname[MAX_DOS_NAME_LENGTH]; - ntfschar longname[NTFS_MAX_NAME_LEN]; - - res = -1; - vol = ni->vol; - dnum = dir_ni->mft_no; - longlen = get_long_name(ni, dnum, longname); - if (longlen > 0) { - shortlen = get_dos_name(ni, dnum, shortname); - if (shortlen >= 0) { - /* migrate the long name as Posix */ - oldnametype = set_namespace(ni,dir_ni,longname,longlen, - FILE_NAME_POSIX); - switch (oldnametype) { - case FILE_NAME_WIN32_AND_DOS : - /* name was Win32+DOS : done */ - res = 0; - break; - case FILE_NAME_DOS : - /* name was DOS, make it back to DOS */ - set_namespace(ni,dir_ni,longname,longlen, - FILE_NAME_DOS); - errno = ENOENT; - break; - case FILE_NAME_WIN32 : - /* name was Win32, make it Posix and delete */ - if (set_namespace(ni,dir_ni,shortname,shortlen, - FILE_NAME_POSIX) >= 0) { - if (!ntfs_delete(vol, - (const char*)NULL, ni, - dir_ni, shortname, - shortlen)) - res = 0; - deleted = TRUE; - } else { - /* - * DOS name has been found, but cannot - * migrate to Posix : something bad - * has happened - */ - errno = EIO; - ntfs_log_error("Could not change" - " DOS name of inode %lld to Posix\n", - (long long)ni->mft_no); - } - break; - default : - /* name was Posix or not found : error */ - errno = ENOENT; - break; - } - } - } else { - errno = ENOENT; - res = -1; - } - if (!deleted) { - ntfs_inode_close_in_dir(ni,dir_ni); - ntfs_inode_close(dir_ni); - } - return (res); -} - -#endif diff --git a/source/libs/libntfs/dir.h b/source/libs/libntfs/dir.h deleted file mode 100644 index 56e76fe7..00000000 --- a/source/libs/libntfs/dir.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * dir.h - Exports for directory handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002 Anton Altaparmakov - * Copyright (c) 2005-2006 Yura Pakhuchiy - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2005-2008 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_DIR_H -#define _NTFS_DIR_H - -#include "types.h" - -#define PATH_SEP '/' - -/* - * We do not have these under DJGPP, so define our version that do not conflict - * with other S_IFs defined under DJGPP. - */ -#ifdef DJGPP -#ifndef S_IFLNK -#define S_IFLNK 0120000 -#endif -#ifndef S_ISLNK -#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -#endif -#ifndef S_IFSOCK -#define S_IFSOCK 0140000 -#endif -#ifndef S_ISSOCK -#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) -#endif -#endif - -/* - * The little endian Unicode strings $I30, $SII, $SDH, $O, $Q, $R - * as a global constant. - */ -extern ntfschar NTFS_INDEX_I30[5]; -extern ntfschar NTFS_INDEX_SII[5]; -extern ntfschar NTFS_INDEX_SDH[5]; -extern ntfschar NTFS_INDEX_O[3]; -extern ntfschar NTFS_INDEX_Q[3]; -extern ntfschar NTFS_INDEX_R[3]; - -extern u64 ntfs_inode_lookup_by_name(ntfs_inode *dir_ni, - const ntfschar *uname, const int uname_len); -extern u64 ntfs_inode_lookup_by_mbsname(ntfs_inode *dir_ni, const char *name); -extern void ntfs_inode_update_mbsname(ntfs_inode *dir_ni, const char *name, - u64 inum); - -extern ntfs_inode *ntfs_pathname_to_inode(ntfs_volume *vol, ntfs_inode *parent, - const char *pathname); -extern ntfs_inode *ntfs_create(ntfs_inode *dir_ni, le32 securid, - ntfschar *name, u8 name_len, mode_t type); -extern ntfs_inode *ntfs_create_device(ntfs_inode *dir_ni, le32 securid, - ntfschar *name, u8 name_len, mode_t type, dev_t dev); -extern ntfs_inode *ntfs_create_symlink(ntfs_inode *dir_ni, le32 securid, - ntfschar *name, u8 name_len, ntfschar *target, int target_len); -extern int ntfs_check_empty_dir(ntfs_inode *ni); -extern int ntfs_delete(ntfs_volume *vol, const char *path, - ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, - u8 name_len); - -extern int ntfs_link(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, - u8 name_len); - -/* - * File types (adapted from include ) - */ -#define NTFS_DT_UNKNOWN 0 -#define NTFS_DT_FIFO 1 -#define NTFS_DT_CHR 2 -#define NTFS_DT_DIR 4 -#define NTFS_DT_BLK 6 -#define NTFS_DT_REG 8 -#define NTFS_DT_LNK 10 -#define NTFS_DT_SOCK 12 -#define NTFS_DT_WHT 14 - -/* - * This is the "ntfs_filldir" function type, used by ntfs_readdir() to let - * the caller specify what kind of dirent layout it wants to have. - * This allows the caller to read directories into their application or - * to have different dirent layouts depending on the binary type. - */ -typedef int (*ntfs_filldir_t)(void *dirent, const ntfschar *name, - const int name_len, const int name_type, const s64 pos, - const MFT_REF mref, const unsigned dt_type); - -extern int ntfs_readdir(ntfs_inode *dir_ni, s64 *pos, - void *dirent, ntfs_filldir_t filldir); - -ntfs_inode *ntfs_dir_parent_inode(ntfs_inode *ni); - -int ntfs_get_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni, - char *value, size_t size); -int ntfs_set_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni, - const char *value, size_t size, int flags); -int ntfs_remove_ntfs_dos_name(ntfs_inode *ni, ntfs_inode *dir_ni); - -#if CACHE_INODE_SIZE - -struct CACHED_GENERIC; - -extern int ntfs_dir_inode_hash(const struct CACHED_GENERIC *cached); -extern int ntfs_dir_lookup_hash(const struct CACHED_GENERIC *cached); - -#endif - -#endif /* defined _NTFS_DIR_H */ - diff --git a/source/libs/libntfs/efs.c b/source/libs/libntfs/efs.c deleted file mode 100644 index 6ccec20a..00000000 --- a/source/libs/libntfs/efs.c +++ /dev/null @@ -1,439 +0,0 @@ -/** - * efs.c - Limited processing of encrypted files - * - * This module is part of ntfs-3g library - * - * Copyright (c) 2009 Martin Bene - * Copyright (c) 2009-2010 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef HAVE_SETXATTR -#include -#endif - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#endif - -#include "types.h" -#include "debug.h" -#include "attrib.h" -#include "inode.h" -#include "dir.h" -#include "efs.h" -#include "index.h" -#include "logging.h" -#include "misc.h" -#include "efs.h" - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -static ntfschar logged_utility_stream_name[] = { - const_cpu_to_le16('$'), - const_cpu_to_le16('E'), - const_cpu_to_le16('F'), - const_cpu_to_le16('S'), - const_cpu_to_le16(0) -} ; - - -/* - * Get the ntfs EFS info into an extended attribute - */ - -int ntfs_get_efs_info(ntfs_inode *ni, char *value, size_t size) -{ - EFS_ATTR_HEADER *efs_info; - s64 attr_size = 0; - - if (ni) { - if (ni->flags & FILE_ATTR_ENCRYPTED) { - efs_info = (EFS_ATTR_HEADER*)ntfs_attr_readall(ni, - AT_LOGGED_UTILITY_STREAM,(ntfschar*)NULL, 0, - &attr_size); - if (efs_info - && (le32_to_cpu(efs_info->length) == attr_size)) { - if (attr_size <= (s64)size) { - if (value) - memcpy(value,efs_info,attr_size); - else { - errno = EFAULT; - attr_size = 0; - } - } else - if (size) { - errno = ERANGE; - attr_size = 0; - } - free (efs_info); - } else { - if (efs_info) { - free(efs_info); - ntfs_log_error("Bad efs_info for inode %lld\n", - (long long)ni->mft_no); - } else { - ntfs_log_error("Could not get efsinfo" - " for inode %lld\n", - (long long)ni->mft_no); - } - errno = EIO; - attr_size = 0; - } - } else { - errno = ENODATA; - ntfs_log_trace("Inode %lld is not encrypted\n", - (long long)ni->mft_no); - } - } - return (attr_size ? (int)attr_size : -errno); -} - -/* - * Fix all encrypted AT_DATA attributes of an inode - * - * The fix may require making an attribute non resident, which - * requires more space in the MFT record, and may cause some - * attribute to be expelled and the full record to be reorganized. - * When this happens, the search for data attributes has to be - * reinitialized. - * - * Returns zero if successful. - * -1 if there is a problem. - */ - -static int fixup_loop(ntfs_inode *ni) -{ - ntfs_attr_search_ctx *ctx; - ntfs_attr *na; - ATTR_RECORD *a; - BOOL restart; - BOOL first; - int cnt; - int maxcnt; - int res = 0; - - maxcnt = 0; - do { - restart = FALSE; - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) { - ntfs_log_error("Failed to get ctx for efs\n"); - res = -1; - } - cnt = 0; - while (!restart && !res - && !ntfs_attr_lookup(AT_DATA, NULL, 0, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - cnt++; - a = ctx->attr; - na = ntfs_attr_open(ctx->ntfs_ino, AT_DATA, - (ntfschar*)((u8*)a + le16_to_cpu(a->name_offset)), - a->name_length); - if (!na) { - ntfs_log_error("can't open DATA Attribute\n"); - res = -1; - } - if (na && !(ctx->attr->flags & ATTR_IS_ENCRYPTED)) { - if (!NAttrNonResident(na) - && ntfs_attr_make_non_resident(na, ctx)) { - /* - * ntfs_attr_make_non_resident fails if there - * is not enough space in the MFT record. - * When this happens, force making non-resident - * so that some other attribute is expelled. - */ - if (ntfs_attr_force_non_resident(na)) { - res = -1; - } else { - /* make sure there is some progress */ - if (cnt <= maxcnt) { - errno = EIO; - ntfs_log_error("Multiple failure" - " making non resident\n"); - res = -1; - } else { - ntfs_attr_put_search_ctx(ctx); - ctx = (ntfs_attr_search_ctx*)NULL; - restart = TRUE; - maxcnt = cnt; - } - } - } - if (!restart && !res - && ntfs_efs_fixup_attribute(ctx, na)) { - ntfs_log_error("Error in efs fixup of AT_DATA Attribute\n"); - res = -1; - } - } - if (na) - ntfs_attr_close(na); - } - first = FALSE; - } while (restart && !res); - if (ctx) - ntfs_attr_put_search_ctx(ctx); - return (res); -} - -/* - * Set the efs data from an extended attribute - * Warning : the new data is not checked - * Returns 0, or -1 if there is a problem - */ - -int ntfs_set_efs_info(ntfs_inode *ni, const char *value, size_t size, - int flags) - -{ - int res; - int written; - ntfs_attr *na; - const EFS_ATTR_HEADER *info_header; - - res = 0; - if (ni && value && size) { - if (ni->flags & (FILE_ATTR_ENCRYPTED | FILE_ATTR_COMPRESSED)) { - if (ni->flags & FILE_ATTR_ENCRYPTED) { - ntfs_log_trace("Inode %lld already encrypted\n", - (long long)ni->mft_no); - errno = EEXIST; - } else { - /* - * Possible problem : if encrypted file was - * restored in a compressed directory, it was - * restored as compressed. - * TODO : decompress first. - */ - ntfs_log_error("Inode %lld cannot be encrypted and compressed\n", - (long long)ni->mft_no); - errno = EIO; - } - return -1; - } - info_header = (const EFS_ATTR_HEADER*)value; - /* make sure we get a likely efsinfo */ - if (le32_to_cpu(info_header->length) != size) { - errno = EINVAL; - return (-1); - } - if (!ntfs_attr_exist(ni,AT_LOGGED_UTILITY_STREAM, - (ntfschar*)NULL,0)) { - if (!(flags & XATTR_REPLACE)) { - /* - * no logged_utility_stream attribute : add one, - * apparently, this does not feed the new value in - */ - res = ntfs_attr_add(ni,AT_LOGGED_UTILITY_STREAM, - logged_utility_stream_name,4, - (u8*)NULL,(s64)size); - } else { - errno = ENODATA; - res = -1; - } - } else { - errno = EEXIST; - res = -1; - } - if (!res) { - /* - * open and update the existing efs data - */ - na = ntfs_attr_open(ni, AT_LOGGED_UTILITY_STREAM, - logged_utility_stream_name, 4); - if (na) { - /* resize attribute */ - res = ntfs_attr_truncate(na, (s64)size); - /* overwrite value if any */ - if (!res && value) { - written = (int)ntfs_attr_pwrite(na, - (s64)0, (s64)size, value); - if (written != (s64)size) { - ntfs_log_error("Failed to " - "update efs data\n"); - errno = EIO; - res = -1; - } - } - ntfs_attr_close(na); - } else - res = -1; - } - if (!res) { - /* Don't handle AT_DATA Attribute(s) if inode is a directory */ - if (!(ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)) { - /* iterate over AT_DATA attributes */ - /* set encrypted flag, truncate attribute to match padding bytes */ - - if (fixup_loop(ni)) - return -1; - } - ni->flags |= FILE_ATTR_ENCRYPTED; - NInoSetDirty(ni); - NInoFileNameSetDirty(ni); - } - } else { - errno = EINVAL; - res = -1; - } - return (res ? -1 : 0); -} - -/* - * Fixup raw encrypted AT_DATA Attribute - * read padding length from last two bytes - * truncate attribute, make non-resident, - * set data size to match padding length - * set ATTR_IS_ENCRYPTED flag on attribute - * - * Return 0 if successful - * -1 if failed (errno tells why) - */ - -int ntfs_efs_fixup_attribute(ntfs_attr_search_ctx *ctx, ntfs_attr *na) -{ - u64 newsize; - u64 oldsize; - le16 appended_bytes; - u16 padding_length; - ntfs_inode *ni; - BOOL close_ctx = FALSE; - - if (!na) { - ntfs_log_error("no na specified for efs_fixup_attribute\n"); - goto err_out; - } - if (!ctx) { - ctx = ntfs_attr_get_search_ctx(na->ni, NULL); - if (!ctx) { - ntfs_log_error("Failed to get ctx for efs\n"); - goto err_out; - } - close_ctx = TRUE; - if (ntfs_attr_lookup(AT_DATA, na->name, na->name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - ntfs_log_error("attr lookup for AT_DATA attribute failed in efs fixup\n"); - goto err_out; - } - } else { - if (!NAttrNonResident(na)) { - ntfs_log_error("Cannot make non resident" - " when a context has been allocated\n"); - goto err_out; - } - } - - /* no extra bytes are added to void attributes */ - oldsize = na->data_size; - if (oldsize) { - /* make sure size is valid for a raw encrypted stream */ - if ((oldsize & 511) != 2) { - ntfs_log_error("Bad raw encrypted stream\n"); - goto err_out; - } - /* read padding length from last two bytes of attribute */ - if (ntfs_attr_pread(na, oldsize - 2, 2, &appended_bytes) != 2) { - ntfs_log_error("Error reading padding length\n"); - goto err_out; - } - padding_length = le16_to_cpu(appended_bytes); - if (padding_length > 511 || padding_length > na->data_size-2) { - errno = EINVAL; - ntfs_log_error("invalid padding length %d for data_size %lld\n", - padding_length, (long long)oldsize); - goto err_out; - } - newsize = oldsize - padding_length - 2; - /* - * truncate attribute to possibly free clusters allocated - * for the last two bytes, but do not truncate to new size - * to avoid losing useful data - */ - if (ntfs_attr_truncate(na, oldsize - 2)) { - ntfs_log_error("Error truncating attribute\n"); - goto err_out; - } - } else - newsize = 0; - - /* - * Encrypted AT_DATA Attributes MUST be non-resident - * This has to be done after the attribute is resized, as - * resizing down to zero may cause the attribute to be made - * resident. - */ - if (!NAttrNonResident(na) - && ntfs_attr_make_non_resident(na, ctx)) { - if (!close_ctx - || ntfs_attr_force_non_resident(na)) { - ntfs_log_error("Error making DATA attribute non-resident\n"); - goto err_out; - } else { - /* - * must reinitialize context after forcing - * non-resident. We need a context for updating - * the state, and at this point, we are sure - * the context is not used elsewhere. - */ - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(AT_DATA, na->name, na->name_len, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - ntfs_log_error("attr lookup for AT_DATA attribute failed in efs fixup\n"); - goto err_out; - } - } - } - ni = na->ni; - if (!na->name_len) { - ni->data_size = newsize; - ni->allocated_size = na->allocated_size; - } - NInoSetDirty(ni); - NInoFileNameSetDirty(ni); - - ctx->attr->data_size = cpu_to_le64(newsize); - if (le64_to_cpu(ctx->attr->initialized_size) > newsize) - ctx->attr->initialized_size = ctx->attr->data_size; - ctx->attr->flags |= ATTR_IS_ENCRYPTED; - if (close_ctx) - ntfs_attr_put_search_ctx(ctx); - - return (0); -err_out: - if (close_ctx && ctx) - ntfs_attr_put_search_ctx(ctx); - return (-1); -} - -#endif /* HAVE_SETXATTR */ diff --git a/source/libs/libntfs/efs.h b/source/libs/libntfs/efs.h deleted file mode 100644 index 6eada067..00000000 --- a/source/libs/libntfs/efs.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * Copyright (c) 2009 Martin Bene - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef EFS_H -#define EFS_H - -int ntfs_get_efs_info(ntfs_inode *ni, char *value, size_t size); - -int ntfs_set_efs_info(ntfs_inode *ni, - const char *value, size_t size, int flags); -int ntfs_efs_fixup_attribute(ntfs_attr_search_ctx *ctx, ntfs_attr *na); - -#endif /* EFS_H */ diff --git a/source/libs/libntfs/endians.h b/source/libs/libntfs/endians.h deleted file mode 100644 index 397f1c20..00000000 --- a/source/libs/libntfs/endians.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * endians.h - Definitions related to handling of byte ordering. - * Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2005 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_ENDIANS_H -#define _NTFS_ENDIANS_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/* - * Notes: - * We define the conversion functions including typecasts since the - * defaults don't necessarily perform appropriate typecasts. - * Also, using our own functions means that we can change them if it - * turns out that we do need to use the unaligned access macros on - * architectures requiring aligned memory accesses... - */ - -#ifdef HAVE_ENDIAN_H -#include -#endif -#ifdef HAVE_SYS_ENDIAN_H -#include -#endif -#ifdef HAVE_MACHINE_ENDIAN_H -#include -#endif -#ifdef HAVE_SYS_BYTEORDER_H -#include -#endif -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#ifndef __BYTE_ORDER -# if defined(_BYTE_ORDER) -# define __BYTE_ORDER _BYTE_ORDER -# define __LITTLE_ENDIAN _LITTLE_ENDIAN -# define __BIG_ENDIAN _BIG_ENDIAN -# elif defined(BYTE_ORDER) -# define __BYTE_ORDER BYTE_ORDER -# define __LITTLE_ENDIAN LITTLE_ENDIAN -# define __BIG_ENDIAN BIG_ENDIAN -# elif defined(__BYTE_ORDER__) -# define __BYTE_ORDER __BYTE_ORDER__ -# define __LITTLE_ENDIAN __LITTLE_ENDIAN__ -# define __BIG_ENDIAN __BIG_ENDIAN__ -# elif (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \ - defined(WORDS_LITTLEENDIAN) -# define __BYTE_ORDER 1 -# define __LITTLE_ENDIAN 1 -# define __BIG_ENDIAN 0 -# elif (!defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN)) || \ - defined(WORDS_BIGENDIAN) -# define __BYTE_ORDER 0 -# define __LITTLE_ENDIAN 1 -# define __BIG_ENDIAN 0 -# else -# error "__BYTE_ORDER is not defined." -# endif -#endif - -#define __ntfs_bswap_constant_16(x) \ - (u16)((((u16)(x) & 0xff00) >> 8) | \ - (((u16)(x) & 0x00ff) << 8)) - -#define __ntfs_bswap_constant_32(x) \ - (u32)((((u32)(x) & 0xff000000u) >> 24) | \ - (((u32)(x) & 0x00ff0000u) >> 8) | \ - (((u32)(x) & 0x0000ff00u) << 8) | \ - (((u32)(x) & 0x000000ffu) << 24)) - -#define __ntfs_bswap_constant_64(x) \ - (u64)((((u64)(x) & 0xff00000000000000ull) >> 56) | \ - (((u64)(x) & 0x00ff000000000000ull) >> 40) | \ - (((u64)(x) & 0x0000ff0000000000ull) >> 24) | \ - (((u64)(x) & 0x000000ff00000000ull) >> 8) | \ - (((u64)(x) & 0x00000000ff000000ull) << 8) | \ - (((u64)(x) & 0x0000000000ff0000ull) << 24) | \ - (((u64)(x) & 0x000000000000ff00ull) << 40) | \ - (((u64)(x) & 0x00000000000000ffull) << 56)) - -#ifdef HAVE_BYTESWAP_H -# include -#else -# define bswap_16(x) __ntfs_bswap_constant_16(x) -# define bswap_32(x) __ntfs_bswap_constant_32(x) -# define bswap_64(x) __ntfs_bswap_constant_64(x) -#endif - -#if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN) - -#define __le16_to_cpu(x) (x) -#define __le32_to_cpu(x) (x) -#define __le64_to_cpu(x) (x) - -#define __cpu_to_le16(x) (x) -#define __cpu_to_le32(x) (x) -#define __cpu_to_le64(x) (x) - -#define __constant_le16_to_cpu(x) (x) -#define __constant_le32_to_cpu(x) (x) -#define __constant_le64_to_cpu(x) (x) - -#define __constant_cpu_to_le16(x) (x) -#define __constant_cpu_to_le32(x) (x) -#define __constant_cpu_to_le64(x) (x) - -#elif defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN) - -#define __le16_to_cpu(x) bswap_16(x) -#define __le32_to_cpu(x) bswap_32(x) -#define __le64_to_cpu(x) bswap_64(x) - -#define __cpu_to_le16(x) bswap_16(x) -#define __cpu_to_le32(x) bswap_32(x) -#define __cpu_to_le64(x) bswap_64(x) - -#define __constant_le16_to_cpu(x) __ntfs_bswap_constant_16((u16)(x)) -#define __constant_le32_to_cpu(x) __ntfs_bswap_constant_32((u32)(x)) -#define __constant_le64_to_cpu(x) __ntfs_bswap_constant_64((u64)(x)) - -#define __constant_cpu_to_le16(x) __ntfs_bswap_constant_16((u16)(x)) -#define __constant_cpu_to_le32(x) __ntfs_bswap_constant_32((u32)(x)) -#define __constant_cpu_to_le64(x) __ntfs_bswap_constant_64((u64)(x)) - -#else - -#error "You must define __BYTE_ORDER to be __LITTLE_ENDIAN or __BIG_ENDIAN." - -#endif - -/* Unsigned from LE to CPU conversion. */ - -#define le16_to_cpu(x) (u16)__le16_to_cpu((u16)(x)) -#define le32_to_cpu(x) (u32)__le32_to_cpu((u32)(x)) -#define le64_to_cpu(x) (u64)__le64_to_cpu((u64)(x)) - -#define le16_to_cpup(x) (u16)__le16_to_cpu(*(const u16*)(x)) -#define le32_to_cpup(x) (u32)__le32_to_cpu(*(const u32*)(x)) -#define le64_to_cpup(x) (u64)__le64_to_cpu(*(const u64*)(x)) - -/* Signed from LE to CPU conversion. */ - -#define sle16_to_cpu(x) (s16)__le16_to_cpu((s16)(x)) -#define sle32_to_cpu(x) (s32)__le32_to_cpu((s32)(x)) -#define sle64_to_cpu(x) (s64)__le64_to_cpu((s64)(x)) - -#define sle16_to_cpup(x) (s16)__le16_to_cpu(*(s16*)(x)) -#define sle32_to_cpup(x) (s32)__le32_to_cpu(*(s32*)(x)) -#define sle64_to_cpup(x) (s64)__le64_to_cpu(*(s64*)(x)) - -/* Unsigned from CPU to LE conversion. */ - -#define cpu_to_le16(x) (u16)__cpu_to_le16((u16)(x)) -#define cpu_to_le32(x) (u32)__cpu_to_le32((u32)(x)) -#define cpu_to_le64(x) (u64)__cpu_to_le64((u64)(x)) - -#define cpu_to_le16p(x) (u16)__cpu_to_le16(*(u16*)(x)) -#define cpu_to_le32p(x) (u32)__cpu_to_le32(*(u32*)(x)) -#define cpu_to_le64p(x) (u64)__cpu_to_le64(*(u64*)(x)) - -/* Signed from CPU to LE conversion. */ - -#define cpu_to_sle16(x) (s16)__cpu_to_le16((s16)(x)) -#define cpu_to_sle32(x) (s32)__cpu_to_le32((s32)(x)) -#define cpu_to_sle64(x) (s64)__cpu_to_le64((s64)(x)) - -#define cpu_to_sle16p(x) (s16)__cpu_to_le16(*(s16*)(x)) -#define cpu_to_sle32p(x) (s32)__cpu_to_le32(*(s32*)(x)) -#define cpu_to_sle64p(x) (s64)__cpu_to_le64(*(s64*)(x)) - -/* Constant endianness conversion defines. */ - -#define const_le16_to_cpu(x) __constant_le16_to_cpu(x) -#define const_le32_to_cpu(x) __constant_le32_to_cpu(x) -#define const_le64_to_cpu(x) __constant_le64_to_cpu(x) - -#define const_cpu_to_le16(x) __constant_cpu_to_le16(x) -#define const_cpu_to_le32(x) __constant_cpu_to_le32(x) -#define const_cpu_to_le64(x) __constant_cpu_to_le64(x) - -#endif /* defined _NTFS_ENDIANS_H */ diff --git a/source/libs/libntfs/gekko_io.c b/source/libs/libntfs/gekko_io.c deleted file mode 100644 index 48ca90d4..00000000 --- a/source/libs/libntfs/gekko_io.c +++ /dev/null @@ -1,647 +0,0 @@ -/** - * gekko_io.c - Gekko style disk io functions. - * - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2010 Dimok - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_MATH_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif -#ifdef HAVE_LOCALE_H -#include -#endif - -#include "ntfs.h" -#include "types.h" -#include "logging.h" -#include "device_io.h" -#include "gekko_io.h" -#include "cache.h" -#include "device.h" -#include "bootsect.h" - -#define DEV_FD(dev) ((gekko_fd *)dev->d_private) - -/* Prototypes */ -static s64 ntfs_device_gekko_io_readbytes(struct ntfs_device *dev, s64 offset, s64 count, void *buf); -static bool ntfs_device_gekko_io_readsectors(struct ntfs_device *dev, sec_t sector, sec_t numSectors, void* buffer); -static s64 ntfs_device_gekko_io_writebytes(struct ntfs_device *dev, s64 offset, s64 count, const void *buf); -static bool ntfs_device_gekko_io_writesectors(struct ntfs_device *dev, sec_t sector, sec_t numSectors, const void* buffer); - -/** - * - */ -static int ntfs_device_gekko_io_open(struct ntfs_device *dev, int flags) -{ - ntfs_log_trace("dev %p, flags %i\n", dev, flags); - - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return -1; - } - - // Get the device interface - const DISC_INTERFACE* interface = fd->interface; - if (!interface) { - errno = ENODEV; - return -1; - } - - // Start the device interface and ensure that it is inserted - if (!interface->startup()) { - ntfs_log_perror("device failed to start\n"); - errno = EIO; - return -1; - } - if (!interface->isInserted()) { - ntfs_log_perror("device media is not inserted\n"); - errno = EIO; - return -1; - } - - // Check that the device isn't already open (used by another volume?) - if (NDevOpen(dev)) { - ntfs_log_perror("device is busy (already open)\n"); - errno = EBUSY; - return -1; - } - - // Check that there is a valid NTFS boot sector at the start of the device - NTFS_BOOT_SECTOR boot; - if (interface->readSectors(fd->startSector, 1, &boot)) { - if (!ntfs_boot_sector_is_ntfs(&boot)) { - errno = EINVALPART; - return -1; - } - } else { - ntfs_log_perror("read failure @ sector %d\n", fd->startSector); - errno = EIO; - return -1; - } - - // Parse the boot sector - fd->hiddenSectors = le32_to_cpu(boot.bpb.hidden_sectors); - fd->sectorSize = le16_to_cpu(boot.bpb.bytes_per_sector); - fd->sectorCount = sle64_to_cpu(boot.number_of_sectors); - fd->pos = 0; - fd->len = (fd->sectorCount * fd->sectorSize); - fd->ino = le64_to_cpu(boot.volume_serial_number); - - // Mark the device as read-only (if required) - if (flags & O_RDONLY) { - NDevSetReadOnly(dev); - } - - // Create the cache - fd->cache = _NTFS_cache_constructor(fd->cachePageCount, fd->cachePageSize, interface, fd->startSector + fd->sectorCount, fd->sectorSize); - - // Mark the device as open - NDevSetBlock(dev); - NDevSetOpen(dev); - - return 0; -} - -/** - * - */ -static int ntfs_device_gekko_io_close(struct ntfs_device *dev) -{ - ntfs_log_trace("dev %p\n", dev); - - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return -1; - } - - // Check that the device is actually open - if (!NDevOpen(dev)) { - ntfs_log_perror("device is not open\n"); - errno = EIO; - return -1; - } - - // Mark the device as closed - NDevClearOpen(dev); - NDevClearBlock(dev); - - // Flush the device (if dirty and not read-only) - if (NDevDirty(dev) && !NDevReadOnly(dev)) { - ntfs_log_debug("device is dirty, will now sync\n"); - - // ...? - - // Mark the device as clean - NDevClearDirty(dev); - - } - - // Flush and destroy the cache (if required) - if (fd->cache) { - _NTFS_cache_flush(fd->cache); - _NTFS_cache_destructor(fd->cache); - } - - // Shutdown the device interface - /*const DISC_INTERFACE* interface = fd->interface; - if (interface) { - interface->shutdown(); - }*/ - - // Free the device driver private data - ntfs_free(dev->d_private); - dev->d_private = NULL; - - return 0; -} - -/** - * - */ -static s64 ntfs_device_gekko_io_seek(struct ntfs_device *dev, s64 offset, int whence) -{ - ntfs_log_trace("dev %p, offset %Li, whence %i\n", dev, offset, whence); - - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return -1; - } - - // Set the current position on the device (in bytes) - switch(whence) { - case SEEK_SET: fd->pos = MIN(MAX(offset, 0), fd->len); break; - case SEEK_CUR: fd->pos = MIN(MAX(fd->pos + offset, 0), fd->len); break; - case SEEK_END: fd->pos = MIN(MAX(fd->len + offset, 0), fd->len); break; - } - - return 0; -} - -/** - * - */ -static s64 ntfs_device_gekko_io_read(struct ntfs_device *dev, void *buf, s64 count) -{ - return ntfs_device_gekko_io_readbytes(dev, DEV_FD(dev)->pos, count, buf); -} - -/** - * - */ -static s64 ntfs_device_gekko_io_write(struct ntfs_device *dev, const void *buf, s64 count) -{ - return ntfs_device_gekko_io_writebytes(dev, DEV_FD(dev)->pos, count, buf); -} - -/** - * - */ -static s64 ntfs_device_gekko_io_pread(struct ntfs_device *dev, void *buf, s64 count, s64 offset) -{ - return ntfs_device_gekko_io_readbytes(dev, offset, count, buf); -} - -/** - * - */ -static s64 ntfs_device_gekko_io_pwrite(struct ntfs_device *dev, const void *buf, s64 count, s64 offset) -{ - return ntfs_device_gekko_io_writebytes(dev, offset, count, buf); -} - -/** - * - */ -static s64 ntfs_device_gekko_io_readbytes(struct ntfs_device *dev, s64 offset, s64 count, void *buf) -{ - ntfs_log_trace("dev %p, offset %Li, count %Li\n", dev, offset, count); - - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return -1; - } - - // Get the device interface - const DISC_INTERFACE* interface = fd->interface; - if (!interface) { - errno = ENODEV; - return -1; - } - - if(offset < 0) - { - errno = EROFS; - return -1; - } - - if(!count) - return 0; - - sec_t sec_start = (sec_t) fd->startSector; - sec_t sec_count = 1; - u32 buffer_offset = (u32) (offset % fd->sectorSize); - u8 *buffer = NULL; - - // Determine the range of sectors required for this read - if (offset > 0) { - sec_start += (sec_t) floor((f64) offset / (f64) fd->sectorSize); - } - if (buffer_offset+count > fd->sectorSize) { - sec_count = (sec_t) ceil((f64) (buffer_offset+count) / (f64) fd->sectorSize); - } - - // If this read happens to be on the sector boundaries then do the read straight into the destination buffer - - if((buffer_offset == 0) && (count % fd->sectorSize == 0)) { - - // Read from the device - ntfs_log_trace("direct read from sector %d (%d sector(s) long)\n", sec_start, sec_count); - if (!ntfs_device_gekko_io_readsectors(dev, sec_start, sec_count, buf)) { - ntfs_log_perror("direct read failure @ sector %d (%d sector(s) long)\n", sec_start, sec_count); - errno = EIO; - return -1; - } - - // Else read into a buffer and copy over only what was requested - } - else - { - - // Allocate a buffer to hold the read data - buffer = (u8*)ntfs_alloc(sec_count * fd->sectorSize); - if (!buffer) { - errno = ENOMEM; - return -1; - } - - // Read from the device - ntfs_log_trace("buffered read from sector %d (%d sector(s) long)\n", sec_start, sec_count); - ntfs_log_trace("count: %d sec_count:%d fd->sectorSize: %d )\n", (u32)count, (u32)sec_count,(u32)fd->sectorSize); - if (!ntfs_device_gekko_io_readsectors(dev, sec_start, sec_count, buffer)) { - ntfs_log_perror("buffered read failure @ sector %d (%d sector(s) long)\n", sec_start, sec_count); - ntfs_free(buffer); - errno = EIO; - return -1; - } - - // Copy what was requested to the destination buffer - memcpy(buf, buffer + buffer_offset, count); - ntfs_free(buffer); - - } - - return count; -} - -/** - * - */ -static s64 ntfs_device_gekko_io_writebytes(struct ntfs_device *dev, s64 offset, s64 count, const void *buf) -{ - ntfs_log_trace("dev %p, offset %lli, count %lli\n", dev, offset, count); - - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return -1; - } - - // Get the device interface - const DISC_INTERFACE* interface = fd->interface; - if (!interface) { - errno = ENODEV; - return -1; - } - - // Check that the device can be written to - if (NDevReadOnly(dev)) { - errno = EROFS; - return -1; - } - - if(count < 0 || offset < 0) { - errno = EROFS; - return -1; - } - - if(count == 0) - return 0; - - sec_t sec_start = (sec_t) fd->startSector; - sec_t sec_count = 1; - u32 buffer_offset = (u32) (offset % fd->sectorSize); - u8 *buffer = NULL; - - // Determine the range of sectors required for this write - if (offset > 0) { - sec_start += (sec_t) floor((f64) offset / (f64) fd->sectorSize); - } - if ((buffer_offset+count) > fd->sectorSize) { - sec_count = (sec_t) ceil((f64) (buffer_offset+count) / (f64) fd->sectorSize); - } - - // If this write happens to be on the sector boundaries then do the write straight to disc - if((buffer_offset == 0) && (count % fd->sectorSize == 0)) - { - // Write to the device - ntfs_log_trace("direct write to sector %d (%d sector(s) long)\n", sec_start, sec_count); - if (!ntfs_device_gekko_io_writesectors(dev, sec_start, sec_count, buf)) { - ntfs_log_perror("direct write failure @ sector %d (%d sector(s) long)\n", sec_start, sec_count); - errno = EIO; - return -1; - } - // Else write from a buffer aligned to the sector boundaries - } - else - { - // Allocate a buffer to hold the write data - buffer = (u8 *) ntfs_alloc(sec_count * fd->sectorSize); - if (!buffer) { - errno = ENOMEM; - return -1; - } - // Read the first and last sectors of the buffer from disc (if required) - // NOTE: This is done because the data does not line up with the sector boundaries, - // we just read in the buffer edges where the data overlaps with the rest of the disc - if(buffer_offset != 0) - { - if (!ntfs_device_gekko_io_readsectors(dev, sec_start, 1, buffer)) { - ntfs_log_perror("read failure @ sector %d\n", sec_start); - ntfs_free(buffer); - errno = EIO; - return -1; - } - } - if((buffer_offset+count) % fd->sectorSize != 0) - { - if (!ntfs_device_gekko_io_readsectors(dev, sec_start + sec_count - 1, 1, buffer + ((sec_count-1) * fd->sectorSize))) { - ntfs_log_perror("read failure @ sector %d\n", sec_start + sec_count - 1); - ntfs_free(buffer); - errno = EIO; - return -1; - } - } - - // Copy the data into the write buffer - memcpy(buffer + buffer_offset, buf, count); - - // Write to the device - ntfs_log_trace("buffered write to sector %d (%d sector(s) long)\n", sec_start, sec_count); - if (!ntfs_device_gekko_io_writesectors(dev, sec_start, sec_count, buffer)) { - ntfs_log_perror("buffered write failure @ sector %d\n", sec_start); - ntfs_free(buffer); - errno = EIO; - return -1; - } - - // Free the buffer - ntfs_free(buffer); - } - - // Mark the device as dirty (if we actually wrote anything) - NDevSetDirty(dev); - - return count; -} - -static bool ntfs_device_gekko_io_readsectors(struct ntfs_device *dev, sec_t sector, sec_t numSectors, void* buffer) -{ - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return false; - } - // Read the sectors from disc (or cache, if enabled) - if (fd->cache) - return _NTFS_cache_readSectors(fd->cache, sector, numSectors, buffer); - else - return fd->interface->readSectors(sector, numSectors, buffer); - - return false; -} - -static bool ntfs_device_gekko_io_writesectors(struct ntfs_device *dev, sec_t sector, sec_t numSectors, const void* buffer) -{ - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return false; - } - - // Write the sectors to disc (or cache, if enabled) - if (fd->cache) - return _NTFS_cache_writeSectors(fd->cache, sector, numSectors, buffer); - else - return fd->interface->writeSectors(sector, numSectors, buffer); - - return false; -} - -/** - * - */ -static int ntfs_device_gekko_io_sync(struct ntfs_device *dev) -{ - gekko_fd *fd = DEV_FD(dev); - ntfs_log_trace("dev %p\n", dev); - - // Check that the device can be written to - if (NDevReadOnly(dev)) { - errno = EROFS; - return -1; - } - - // Mark the device as clean - NDevClearDirty(dev); - - // Flush any sectors in the disc cache (if required) - if (fd->cache) { - if (!_NTFS_cache_flush(fd->cache)) { - errno = EIO; - return -1; - } - } - - return 0; -} - -/** - * - */ -static int ntfs_device_gekko_io_stat(struct ntfs_device *dev, struct stat *buf) -{ - ntfs_log_trace("dev %p, buf %p\n", dev, buf); - - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return -1; - } - - // Short circuit cases were we don't actually have to do anything - if (!buf) - return 0; - - // Build the device mode - mode_t mode = (S_IFBLK) | - (S_IRUSR | S_IRGRP | S_IROTH) | - ((!NDevReadOnly(dev)) ? (S_IWUSR | S_IWGRP | S_IWOTH) : 0); - - // Zero out the stat buffer - memset(buf, 0, sizeof(struct stat)); - - // Build the device stats - buf->st_dev = fd->interface->ioType; - buf->st_ino = fd->ino; - buf->st_mode = mode; - buf->st_rdev = fd->interface->ioType; - buf->st_blksize = fd->sectorSize; - buf->st_blocks = fd->sectorCount; - - return 0; -} - -/** - * - */ -static int ntfs_device_gekko_io_ioctl(struct ntfs_device *dev, int request, void *argp) -{ - ntfs_log_trace("dev %p, request %i, argp %p\n", dev, request, argp); - - // Get the device driver descriptor - gekko_fd *fd = DEV_FD(dev); - if (!fd) { - errno = EBADF; - return -1; - } - - // Figure out which i/o control was requested - switch (request) { - - // Get block device size (sectors) - #if defined(BLKGETSIZE) - case BLKGETSIZE: { - *(u32*)argp = fd->sectorCount; - return 0; - } - #endif - - // Get block device size (bytes) - #if defined(BLKGETSIZE64) - case BLKGETSIZE64: { - *(u64*)argp = (fd->sectorCount * fd->sectorSize); - return 0; - } - #endif - - // Get hard drive geometry - #if defined(HDIO_GETGEO) - case HDIO_GETGEO: { - struct hd_geometry *geo = (struct hd_geometry*)argp; - geo->sectors = 0; - geo->heads = 0; - geo->cylinders = 0; - geo->start = fd->hiddenSectors; - return -1; - } - #endif - - // Get block device sector size (bytes) - #if defined(BLKSSZGET) - case BLKSSZGET: { - *(int*)argp = fd->sectorSize; - return 0; - } - #endif - - // Set block device block size (bytes) - #if defined(BLKBSZSET) - case BLKBSZSET: { - int sectorSize = *(int*)argp; - fd->sectorSize = sectorSize; - return 0; - } - #endif - - // Unimplemented ioctrl - default: { - ntfs_log_perror("Unimplemented ioctrl %i\n", request); - errno = EOPNOTSUPP; - return -1; - } - - } - - return 0; -} - -/** - * Device operations for working with gekko style devices and files. - */ -struct ntfs_device_operations ntfs_device_gekko_io_ops = { - .open = ntfs_device_gekko_io_open, - .close = ntfs_device_gekko_io_close, - .seek = ntfs_device_gekko_io_seek, - .read = ntfs_device_gekko_io_read, - .write = ntfs_device_gekko_io_write, - .pread = ntfs_device_gekko_io_pread, - .pwrite = ntfs_device_gekko_io_pwrite, - .sync = ntfs_device_gekko_io_sync, - .stat = ntfs_device_gekko_io_stat, - .ioctl = ntfs_device_gekko_io_ioctl, -}; diff --git a/source/libs/libntfs/gekko_io.h b/source/libs/libntfs/gekko_io.h deleted file mode 100644 index d5018e89..00000000 --- a/source/libs/libntfs/gekko_io.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -* gekko_io.h - Platform specifics for device io. -* -* Copyright (c) 2009 Rhys "Shareese" Koedijk -* -* This program/include file is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as published -* by the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program/include file is distributed in the hope that it will be -* useful, but WITHOUT ANY WARRANTY; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef _GEKKO_IO_H -#define _GEKKO_IO_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "types.h" -#include "cache2.h" -#include -#include - -/** - * gekko_fd - Gekko device driver descriptor - */ -typedef struct _gekko_fd { - const DISC_INTERFACE* interface; /* Device disc interface */ - sec_t startSector; /* LBA of partition start */ - sec_t hiddenSectors; /* LBA offset to true partition start (as described by boot sector) */ - u16 sectorSize; /* Device sector size (in bytes) */ - u64 sectorCount; /* Total number of sectors in partition */ - u64 pos; /* Current position within the partition (in bytes) */ - u64 len; /* Total length of partition (in bytes) */ - ino_t ino; /* Device identifier */ - NTFS_CACHE *cache; /* Cache */ - u32 cachePageCount; /* The number of pages in the cache */ - u32 cachePageSize; /* The number of sectors per cache page */ -} gekko_fd; - -/* Forward declarations */ -struct ntfs_device_operations; - -/* Gekko device driver i/o operations */ -extern struct ntfs_device_operations ntfs_device_gekko_io_ops; - -#endif /* _GEKKO_IO_H */ diff --git a/source/libs/libntfs/index.c b/source/libs/libntfs/index.c deleted file mode 100644 index 7df0deec..00000000 --- a/source/libs/libntfs/index.c +++ /dev/null @@ -1,2063 +0,0 @@ -/** - * index.c - NTFS index handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2004-2005 Anton Altaparmakov - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2005-2006 Yura Pakhuchiy - * Copyright (c) 2005-2008 Szabolcs Szakacsits - * Copyright (c) 2007 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "attrib.h" -#include "debug.h" -#include "index.h" -#include "collate.h" -#include "mst.h" -#include "dir.h" -#include "logging.h" -#include "bitmap.h" -#include "reparse.h" -#include "misc.h" - -/** - * ntfs_index_entry_mark_dirty - mark an index entry dirty - * @ictx: ntfs index context describing the index entry - * - * Mark the index entry described by the index entry context @ictx dirty. - * - * If the index entry is in the index root attribute, simply mark the inode - * containing the index root attribute dirty. This ensures the mftrecord, and - * hence the index root attribute, will be written out to disk later. - * - * If the index entry is in an index block belonging to the index allocation - * attribute, set ib_dirty to TRUE, thus index block will be updated during - * ntfs_index_ctx_put. - */ -void ntfs_index_entry_mark_dirty(ntfs_index_context *ictx) -{ - if (ictx->is_in_root) - ntfs_inode_mark_dirty(ictx->actx->ntfs_ino); - else - ictx->ib_dirty = TRUE; -} - -static s64 ntfs_ib_vcn_to_pos(ntfs_index_context *icx, VCN vcn) -{ - return vcn << icx->vcn_size_bits; -} - -static VCN ntfs_ib_pos_to_vcn(ntfs_index_context *icx, s64 pos) -{ - return pos >> icx->vcn_size_bits; -} - -static int ntfs_ib_write(ntfs_index_context *icx, INDEX_BLOCK *ib) -{ - s64 ret, vcn = sle64_to_cpu(ib->index_block_vcn); - - ntfs_log_trace("vcn: %lld\n", (long long)vcn); - - ret = ntfs_attr_mst_pwrite(icx->ia_na, ntfs_ib_vcn_to_pos(icx, vcn), - 1, icx->block_size, ib); - if (ret != 1) { - ntfs_log_perror("Failed to write index block %lld, inode %llu", - (long long)vcn, (unsigned long long)icx->ni->mft_no); - return STATUS_ERROR; - } - - return STATUS_OK; -} - -static int ntfs_icx_ib_write(ntfs_index_context *icx) -{ - if (ntfs_ib_write(icx, icx->ib)) - return STATUS_ERROR; - - icx->ib_dirty = FALSE; - - return STATUS_OK; -} - -/** - * ntfs_index_ctx_get - allocate and initialize a new index context - * @ni: ntfs inode with which to initialize the context - * @name: name of the which context describes - * @name_len: length of the index name - * - * Allocate a new index context, initialize it with @ni and return it. - * Return NULL if allocation failed. - */ -ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *ni, - ntfschar *name, u32 name_len) -{ - ntfs_index_context *icx; - - ntfs_log_trace("Entering\n"); - - if (!ni) { - errno = EINVAL; - return NULL; - } - if (ni->nr_extents == -1) - ni = ni->base_ni; - icx = ntfs_calloc(sizeof(ntfs_index_context)); - if (icx) - *icx = (ntfs_index_context) { - .ni = ni, - .name = name, - .name_len = name_len, - }; - return icx; -} - -static void ntfs_index_ctx_free(ntfs_index_context *icx) -{ - ntfs_log_trace("Entering\n"); - - if (!icx->entry) - return; - - if (icx->actx) - ntfs_attr_put_search_ctx(icx->actx); - - if (!icx->is_in_root) { - if (icx->ib_dirty) { - /* FIXME: Error handling!!! */ - ntfs_ib_write(icx, icx->ib); - } - free(icx->ib); - } - - ntfs_attr_close(icx->ia_na); -} - -/** - * ntfs_index_ctx_put - release an index context - * @icx: index context to free - * - * Release the index context @icx, releasing all associated resources. - */ -void ntfs_index_ctx_put(ntfs_index_context *icx) -{ - ntfs_index_ctx_free(icx); - free(icx); -} - -/** - * ntfs_index_ctx_reinit - reinitialize an index context - * @icx: index context to reinitialize - * - * Reinitialize the index context @icx so it can be used for ntfs_index_lookup. - */ -void ntfs_index_ctx_reinit(ntfs_index_context *icx) -{ - ntfs_log_trace("Entering\n"); - - ntfs_index_ctx_free(icx); - - *icx = (ntfs_index_context) { - .ni = icx->ni, - .name = icx->name, - .name_len = icx->name_len, - }; -} - -static VCN *ntfs_ie_get_vcn_addr(INDEX_ENTRY *ie) -{ - return (VCN *)((u8 *)ie + le16_to_cpu(ie->length) - sizeof(VCN)); -} - -/** - * Get the subnode vcn to which the index entry refers. - */ -VCN ntfs_ie_get_vcn(INDEX_ENTRY *ie) -{ - return sle64_to_cpup(ntfs_ie_get_vcn_addr(ie)); -} - -static INDEX_ENTRY *ntfs_ie_get_first(INDEX_HEADER *ih) -{ - return (INDEX_ENTRY *)((u8 *)ih + le32_to_cpu(ih->entries_offset)); -} - -static INDEX_ENTRY *ntfs_ie_get_next(INDEX_ENTRY *ie) -{ - return (INDEX_ENTRY *)((char *)ie + le16_to_cpu(ie->length)); -} - -static u8 *ntfs_ie_get_end(INDEX_HEADER *ih) -{ - /* FIXME: check if it isn't overflowing the index block size */ - return (u8 *)ih + le32_to_cpu(ih->index_length); -} - -static int ntfs_ie_end(INDEX_ENTRY *ie) -{ - return ie->ie_flags & INDEX_ENTRY_END || !ie->length; -} - -/** - * Find the last entry in the index block - */ -static INDEX_ENTRY *ntfs_ie_get_last(INDEX_ENTRY *ie, char *ies_end) -{ - ntfs_log_trace("Entering\n"); - - while ((char *)ie < ies_end && !ntfs_ie_end(ie)) - ie = ntfs_ie_get_next(ie); - - return ie; -} - -static INDEX_ENTRY *ntfs_ie_get_by_pos(INDEX_HEADER *ih, int pos) -{ - INDEX_ENTRY *ie; - - ntfs_log_trace("pos: %d\n", pos); - - ie = ntfs_ie_get_first(ih); - - while (pos-- > 0) - ie = ntfs_ie_get_next(ie); - - return ie; -} - -static INDEX_ENTRY *ntfs_ie_prev(INDEX_HEADER *ih, INDEX_ENTRY *ie) -{ - INDEX_ENTRY *ie_prev = NULL; - INDEX_ENTRY *tmp; - - ntfs_log_trace("Entering\n"); - - tmp = ntfs_ie_get_first(ih); - - while (tmp != ie) { - ie_prev = tmp; - tmp = ntfs_ie_get_next(tmp); - } - - return ie_prev; -} - -char *ntfs_ie_filename_get(INDEX_ENTRY *ie) -{ - FILE_NAME_ATTR *fn; - - fn = (FILE_NAME_ATTR *)&ie->key; - return ntfs_attr_name_get(fn->file_name, fn->file_name_length); -} - -void ntfs_ie_filename_dump(INDEX_ENTRY *ie) -{ - char *s; - - s = ntfs_ie_filename_get(ie); - ntfs_log_debug("'%s' ", s); - ntfs_attr_name_free(&s); -} - -void ntfs_ih_filename_dump(INDEX_HEADER *ih) -{ - INDEX_ENTRY *ie; - - ntfs_log_trace("Entering\n"); - - ie = ntfs_ie_get_first(ih); - while (!ntfs_ie_end(ie)) { - ntfs_ie_filename_dump(ie); - ie = ntfs_ie_get_next(ie); - } -} - -static int ntfs_ih_numof_entries(INDEX_HEADER *ih) -{ - int n; - INDEX_ENTRY *ie; - u8 *end; - - ntfs_log_trace("Entering\n"); - - end = ntfs_ie_get_end(ih); - ie = ntfs_ie_get_first(ih); - for (n = 0; !ntfs_ie_end(ie) && (u8 *)ie < end; n++) - ie = ntfs_ie_get_next(ie); - return n; -} - -static int ntfs_ih_one_entry(INDEX_HEADER *ih) -{ - return (ntfs_ih_numof_entries(ih) == 1); -} - -static int ntfs_ih_zero_entry(INDEX_HEADER *ih) -{ - return (ntfs_ih_numof_entries(ih) == 0); -} - -static void ntfs_ie_delete(INDEX_HEADER *ih, INDEX_ENTRY *ie) -{ - u32 new_size; - - ntfs_log_trace("Entering\n"); - - new_size = le32_to_cpu(ih->index_length) - le16_to_cpu(ie->length); - ih->index_length = cpu_to_le32(new_size); - memmove(ie, (u8 *)ie + le16_to_cpu(ie->length), - new_size - ((u8 *)ie - (u8 *)ih)); -} - -static void ntfs_ie_set_vcn(INDEX_ENTRY *ie, VCN vcn) -{ - *ntfs_ie_get_vcn_addr(ie) = cpu_to_le64(vcn); -} - -/** - * Insert @ie index entry at @pos entry. Used @ih values should be ok already. - */ -static void ntfs_ie_insert(INDEX_HEADER *ih, INDEX_ENTRY *ie, INDEX_ENTRY *pos) -{ - int ie_size = le16_to_cpu(ie->length); - - ntfs_log_trace("Entering\n"); - - ih->index_length = cpu_to_le32(le32_to_cpu(ih->index_length) + ie_size); - memmove((u8 *)pos + ie_size, pos, - le32_to_cpu(ih->index_length) - ((u8 *)pos - (u8 *)ih) - ie_size); - memcpy(pos, ie, ie_size); -} - -static INDEX_ENTRY *ntfs_ie_dup(INDEX_ENTRY *ie) -{ - INDEX_ENTRY *dup; - - ntfs_log_trace("Entering\n"); - - dup = ntfs_malloc(le16_to_cpu(ie->length)); - if (dup) - memcpy(dup, ie, le16_to_cpu(ie->length)); - - return dup; -} - -static INDEX_ENTRY *ntfs_ie_dup_novcn(INDEX_ENTRY *ie) -{ - INDEX_ENTRY *dup; - int size = le16_to_cpu(ie->length); - - ntfs_log_trace("Entering\n"); - - if (ie->ie_flags & INDEX_ENTRY_NODE) - size -= sizeof(VCN); - - dup = ntfs_malloc(size); - if (dup) { - memcpy(dup, ie, size); - dup->ie_flags &= ~INDEX_ENTRY_NODE; - dup->length = cpu_to_le16(size); - } - return dup; -} - -static int ntfs_ia_check(ntfs_index_context *icx, INDEX_BLOCK *ib, VCN vcn) -{ - u32 ib_size = (unsigned)le32_to_cpu(ib->index.allocated_size) + 0x18; - - ntfs_log_trace("Entering\n"); - - if (!ntfs_is_indx_record(ib->magic)) { - - ntfs_log_error("Corrupt index block signature: vcn %lld inode " - "%llu\n", (long long)vcn, - (unsigned long long)icx->ni->mft_no); - return -1; - } - - if (sle64_to_cpu(ib->index_block_vcn) != vcn) { - - ntfs_log_error("Corrupt index block: VCN (%lld) is different " - "from expected VCN (%lld) in inode %llu\n", - (long long)sle64_to_cpu(ib->index_block_vcn), - (long long)vcn, - (unsigned long long)icx->ni->mft_no); - return -1; - } - - if (ib_size != icx->block_size) { - - ntfs_log_error("Corrupt index block : VCN (%lld) of inode %llu " - "has a size (%u) differing from the index " - "specified size (%u)\n", (long long)vcn, - (unsigned long long)icx->ni->mft_no, ib_size, - icx->block_size); - return -1; - } - return 0; -} - -static INDEX_ROOT *ntfs_ir_lookup(ntfs_inode *ni, ntfschar *name, - u32 name_len, ntfs_attr_search_ctx **ctx) -{ - ATTR_RECORD *a; - INDEX_ROOT *ir = NULL; - - ntfs_log_trace("Entering\n"); - - *ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!*ctx) - return NULL; - - if (ntfs_attr_lookup(AT_INDEX_ROOT, name, name_len, CASE_SENSITIVE, - 0, NULL, 0, *ctx)) { - ntfs_log_perror("Failed to lookup $INDEX_ROOT"); - goto err_out; - } - - a = (*ctx)->attr; - if (a->non_resident) { - errno = EINVAL; - ntfs_log_perror("Non-resident $INDEX_ROOT detected"); - goto err_out; - } - - ir = (INDEX_ROOT *)((char *)a + le16_to_cpu(a->value_offset)); -err_out: - if (!ir) { - ntfs_attr_put_search_ctx(*ctx); - *ctx = NULL; - } - return ir; -} - -static INDEX_ROOT *ntfs_ir_lookup2(ntfs_inode *ni, ntfschar *name, u32 len) -{ - ntfs_attr_search_ctx *ctx; - INDEX_ROOT *ir; - - ir = ntfs_ir_lookup(ni, name, len, &ctx); - if (ir) - ntfs_attr_put_search_ctx(ctx); - return ir; -} - -/** - * Find a key in the index block. - * - * Return values: - * STATUS_OK with errno set to ESUCCESS if we know for sure that the - * entry exists and @ie_out points to this entry. - * STATUS_NOT_FOUND with errno set to ENOENT if we know for sure the - * entry doesn't exist and @ie_out is the insertion point. - * STATUS_KEEP_SEARCHING if we can't answer the above question and - * @vcn will contain the node index block. - * STATUS_ERROR with errno set if on unexpected error during lookup. - */ -static int ntfs_ie_lookup(const void *key, const int key_len, - ntfs_index_context *icx, INDEX_HEADER *ih, - VCN *vcn, INDEX_ENTRY **ie_out) -{ - INDEX_ENTRY *ie; - u8 *index_end; - int rc, item = 0; - - ntfs_log_trace("Entering\n"); - - index_end = ntfs_ie_get_end(ih); - - /* - * Loop until we exceed valid memory (corruption case) or until we - * reach the last entry. - */ - for (ie = ntfs_ie_get_first(ih); ; ie = ntfs_ie_get_next(ie)) { - /* Bounds checks. */ - if ((u8 *)ie + sizeof(INDEX_ENTRY_HEADER) > index_end || - (u8 *)ie + le16_to_cpu(ie->length) > index_end) { - errno = ERANGE; - ntfs_log_error("Index entry out of bounds in inode " - "%llu.\n", - (unsigned long long)icx->ni->mft_no); - return STATUS_ERROR; - } - /* - * The last entry cannot contain a key. It can however contain - * a pointer to a child node in the B+tree so we just break out. - */ - if (ntfs_ie_end(ie)) - break; - /* - * Not a perfect match, need to do full blown collation so we - * know which way in the B+tree we have to go. - */ - if (!icx->collate) { - ntfs_log_error("Collation function not defined\n"); - errno = EOPNOTSUPP; - return STATUS_ERROR; - } - rc = icx->collate(icx->ni->vol, key, key_len, - &ie->key, le16_to_cpu(ie->key_length)); - if (rc == NTFS_COLLATION_ERROR) { - ntfs_log_error("Collation error. Perhaps a filename " - "contains invalid characters?\n"); - errno = ERANGE; - return STATUS_ERROR; - } - /* - * If @key collates before the key of the current entry, there - * is definitely no such key in this index but we might need to - * descend into the B+tree so we just break out of the loop. - */ - if (rc == -1) - break; - - if (!rc) { - *ie_out = ie; - errno = 0; - icx->parent_pos[icx->pindex] = item; - return STATUS_OK; - } - - item++; - } - /* - * We have finished with this index block without success. Check for the - * presence of a child node and if not present return with errno ENOENT, - * otherwise we will keep searching in another index block. - */ - if (!(ie->ie_flags & INDEX_ENTRY_NODE)) { - ntfs_log_debug("Index entry wasn't found.\n"); - *ie_out = ie; - errno = ENOENT; - return STATUS_NOT_FOUND; - } - - /* Get the starting vcn of the index_block holding the child node. */ - *vcn = ntfs_ie_get_vcn(ie); - if (*vcn < 0) { - errno = EINVAL; - ntfs_log_perror("Negative vcn in inode %llu", - (unsigned long long)icx->ni->mft_no); - return STATUS_ERROR; - } - - ntfs_log_trace("Parent entry number %d\n", item); - icx->parent_pos[icx->pindex] = item; - - return STATUS_KEEP_SEARCHING; -} - -static ntfs_attr *ntfs_ia_open(ntfs_index_context *icx, ntfs_inode *ni) -{ - ntfs_attr *na; - - na = ntfs_attr_open(ni, AT_INDEX_ALLOCATION, icx->name, icx->name_len); - if (!na) { - ntfs_log_perror("Failed to open index allocation of inode " - "%llu", (unsigned long long)ni->mft_no); - return NULL; - } - - return na; -} - -static int ntfs_ib_read(ntfs_index_context *icx, VCN vcn, INDEX_BLOCK *dst) -{ - s64 pos, ret; - - ntfs_log_trace("vcn: %lld\n", (long long)vcn); - - pos = ntfs_ib_vcn_to_pos(icx, vcn); - - ret = ntfs_attr_mst_pread(icx->ia_na, pos, 1, icx->block_size, (u8 *)dst); - if (ret != 1) { - if (ret == -1) - ntfs_log_perror("Failed to read index block"); - else - ntfs_log_error("Failed to read full index block at " - "%lld\n", (long long)pos); - return -1; - } - - if (ntfs_ia_check(icx, dst, vcn)) - return -1; - - return 0; -} - -static int ntfs_icx_parent_inc(ntfs_index_context *icx) -{ - icx->pindex++; - if (icx->pindex >= MAX_PARENT_VCN) { - errno = EOPNOTSUPP; - ntfs_log_perror("Index is over %d level deep", MAX_PARENT_VCN); - return STATUS_ERROR; - } - return STATUS_OK; -} - -static int ntfs_icx_parent_dec(ntfs_index_context *icx) -{ - icx->pindex--; - if (icx->pindex < 0) { - errno = EINVAL; - ntfs_log_perror("Corrupt index pointer (%d)", icx->pindex); - return STATUS_ERROR; - } - return STATUS_OK; -} - -/** - * ntfs_index_lookup - find a key in an index and return its index entry - * @key: [IN] key for which to search in the index - * @key_len: [IN] length of @key in bytes - * @icx: [IN/OUT] context describing the index and the returned entry - * - * Before calling ntfs_index_lookup(), @icx must have been obtained from a - * call to ntfs_index_ctx_get(). - * - * Look for the @key in the index specified by the index lookup context @icx. - * ntfs_index_lookup() walks the contents of the index looking for the @key. - * - * If the @key is found in the index, 0 is returned and @icx is setup to - * describe the index entry containing the matching @key. @icx->entry is the - * index entry and @icx->data and @icx->data_len are the index entry data and - * its length in bytes, respectively. - * - * If the @key is not found in the index, -1 is returned, errno = ENOENT and - * @icx is setup to describe the index entry whose key collates immediately - * after the search @key, i.e. this is the position in the index at which - * an index entry with a key of @key would need to be inserted. - * - * If an error occurs return -1, set errno to error code and @icx is left - * untouched. - * - * When finished with the entry and its data, call ntfs_index_ctx_put() to free - * the context and other associated resources. - * - * If the index entry was modified, call ntfs_index_entry_mark_dirty() before - * the call to ntfs_index_ctx_put() to ensure that the changes are written - * to disk. - */ -int ntfs_index_lookup(const void *key, const int key_len, ntfs_index_context *icx) -{ - VCN old_vcn, vcn; - ntfs_inode *ni = icx->ni; - INDEX_ROOT *ir; - INDEX_ENTRY *ie; - INDEX_BLOCK *ib = NULL; - int ret, err = 0; - - ntfs_log_trace("Entering\n"); - - if (!key || key_len <= 0) { - errno = EINVAL; - ntfs_log_perror("key: %p key_len: %d", key, key_len); - return -1; - } - - ir = ntfs_ir_lookup(ni, icx->name, icx->name_len, &icx->actx); - if (!ir) { - if (errno == ENOENT) - errno = EIO; - return -1; - } - - icx->block_size = le32_to_cpu(ir->index_block_size); - if (icx->block_size < NTFS_BLOCK_SIZE) { - errno = EINVAL; - ntfs_log_perror("Index block size (%d) is smaller than the " - "sector size (%d)", icx->block_size, NTFS_BLOCK_SIZE); - goto err_out; - } - - if (ni->vol->cluster_size <= icx->block_size) - icx->vcn_size_bits = ni->vol->cluster_size_bits; - else - icx->vcn_size_bits = ni->vol->sector_size_bits; - /* get the appropriate collation function */ - icx->collate = ntfs_get_collate_function(ir->collation_rule); - if (!icx->collate) { - err = errno = EOPNOTSUPP; - ntfs_log_perror("Unknown collation rule 0x%x", - (unsigned)le32_to_cpu(ir->collation_rule)); - goto err_out; - } - - old_vcn = VCN_INDEX_ROOT_PARENT; - /* - * FIXME: check for both ir and ib that the first index entry is - * within the index block. - */ - ret = ntfs_ie_lookup(key, key_len, icx, &ir->index, &vcn, &ie); - if (ret == STATUS_ERROR) { - err = errno; - goto err_out; - } - - icx->ir = ir; - - if (ret != STATUS_KEEP_SEARCHING) { - /* STATUS_OK or STATUS_NOT_FOUND */ - err = errno; - icx->is_in_root = TRUE; - icx->parent_vcn[icx->pindex] = old_vcn; - goto done; - } - - /* Child node present, descend into it. */ - - icx->ia_na = ntfs_ia_open(icx, ni); - if (!icx->ia_na) - goto err_out; - - ib = ntfs_malloc(icx->block_size); - if (!ib) { - err = errno; - goto err_out; - } - -descend_into_child_node: - - icx->parent_vcn[icx->pindex] = old_vcn; - if (ntfs_icx_parent_inc(icx)) { - err = errno; - goto err_out; - } - old_vcn = vcn; - - ntfs_log_debug("Descend into node with VCN %lld\n", (long long)vcn); - - if (ntfs_ib_read(icx, vcn, ib)) - goto err_out; - - ret = ntfs_ie_lookup(key, key_len, icx, &ib->index, &vcn, &ie); - if (ret != STATUS_KEEP_SEARCHING) { - err = errno; - if (ret == STATUS_ERROR) - goto err_out; - - /* STATUS_OK or STATUS_NOT_FOUND */ - icx->is_in_root = FALSE; - icx->ib = ib; - icx->parent_vcn[icx->pindex] = vcn; - goto done; - } - - if ((ib->index.ih_flags & NODE_MASK) == LEAF_NODE) { - ntfs_log_error("Index entry with child node found in a leaf " - "node in inode 0x%llx.\n", - (unsigned long long)ni->mft_no); - goto err_out; - } - - goto descend_into_child_node; -err_out: - free(ib); - if (!err) - err = EIO; - errno = err; - return -1; -done: - icx->entry = ie; - icx->data = (u8 *)ie + offsetof(INDEX_ENTRY, key); - icx->data_len = le16_to_cpu(ie->key_length); - ntfs_log_trace("Done.\n"); - if (err) { - errno = err; - return -1; - } - return 0; - -} - -static INDEX_BLOCK *ntfs_ib_alloc(VCN ib_vcn, u32 ib_size, - INDEX_HEADER_FLAGS node_type) -{ - INDEX_BLOCK *ib; - int ih_size = sizeof(INDEX_HEADER); - - ntfs_log_trace("ib_vcn: %lld ib_size: %u\n", (long long)ib_vcn, ib_size); - - ib = ntfs_calloc(ib_size); - if (!ib) - return NULL; - - ib->magic = magic_INDX; - ib->usa_ofs = cpu_to_le16(sizeof(INDEX_BLOCK)); - ib->usa_count = cpu_to_le16(ib_size / NTFS_BLOCK_SIZE + 1); - /* Set USN to 1 */ - *(u16 *)((char *)ib + le16_to_cpu(ib->usa_ofs)) = cpu_to_le16(1); - ib->lsn = cpu_to_le64(0); - - ib->index_block_vcn = cpu_to_sle64(ib_vcn); - - ib->index.entries_offset = cpu_to_le32((ih_size + - le16_to_cpu(ib->usa_count) * 2 + 7) & ~7); - ib->index.index_length = 0; - ib->index.allocated_size = cpu_to_le32(ib_size - - (sizeof(INDEX_BLOCK) - ih_size)); - ib->index.ih_flags = node_type; - - return ib; -} - -/** - * Find the median by going through all the entries - */ -static INDEX_ENTRY *ntfs_ie_get_median(INDEX_HEADER *ih) -{ - INDEX_ENTRY *ie, *ie_start; - u8 *ie_end; - int i = 0, median; - - ntfs_log_trace("Entering\n"); - - ie = ie_start = ntfs_ie_get_first(ih); - ie_end = (u8 *)ntfs_ie_get_end(ih); - - while ((u8 *)ie < ie_end && !ntfs_ie_end(ie)) { - ie = ntfs_ie_get_next(ie); - i++; - } - /* - * NOTE: this could be also the entry at the half of the index block. - */ - median = i / 2 - 1; - - ntfs_log_trace("Entries: %d median: %d\n", i, median); - - for (i = 0, ie = ie_start; i <= median; i++) - ie = ntfs_ie_get_next(ie); - - return ie; -} - -static s64 ntfs_ibm_vcn_to_pos(ntfs_index_context *icx, VCN vcn) -{ - return ntfs_ib_vcn_to_pos(icx, vcn) / icx->block_size; -} - -static s64 ntfs_ibm_pos_to_vcn(ntfs_index_context *icx, s64 pos) -{ - return ntfs_ib_pos_to_vcn(icx, pos * icx->block_size); -} - -static int ntfs_ibm_add(ntfs_index_context *icx) -{ - u8 bmp[8]; - - ntfs_log_trace("Entering\n"); - - if (ntfs_attr_exist(icx->ni, AT_BITMAP, icx->name, icx->name_len)) - return STATUS_OK; - /* - * AT_BITMAP must be at least 8 bytes. - */ - memset(bmp, 0, sizeof(bmp)); - if (ntfs_attr_add(icx->ni, AT_BITMAP, icx->name, icx->name_len, - bmp, sizeof(bmp))) { - ntfs_log_perror("Failed to add AT_BITMAP"); - return STATUS_ERROR; - } - - return STATUS_OK; -} - -static int ntfs_ibm_modify(ntfs_index_context *icx, VCN vcn, int set) -{ - u8 byte; - s64 pos = ntfs_ibm_vcn_to_pos(icx, vcn); - u32 bpos = pos / 8; - u32 bit = 1 << (pos % 8); - ntfs_attr *na; - int ret = STATUS_ERROR; - - ntfs_log_trace("%s vcn: %lld\n", set ? "set" : "clear", (long long)vcn); - - na = ntfs_attr_open(icx->ni, AT_BITMAP, icx->name, icx->name_len); - if (!na) { - ntfs_log_perror("Failed to open $BITMAP attribute"); - return -1; - } - - if (set) { - if (na->data_size < bpos + 1) { - if (ntfs_attr_truncate(na, (na->data_size + 8) & ~7)) { - ntfs_log_perror("Failed to truncate AT_BITMAP"); - goto err_na; - } - } - } - - if (ntfs_attr_pread(na, bpos, 1, &byte) != 1) { - ntfs_log_perror("Failed to read $BITMAP"); - goto err_na; - } - - if (set) - byte |= bit; - else - byte &= ~bit; - - if (ntfs_attr_pwrite(na, bpos, 1, &byte) != 1) { - ntfs_log_perror("Failed to write $Bitmap"); - goto err_na; - } - - ret = STATUS_OK; -err_na: - ntfs_attr_close(na); - return ret; -} - - -static int ntfs_ibm_set(ntfs_index_context *icx, VCN vcn) -{ - return ntfs_ibm_modify(icx, vcn, 1); -} - -static int ntfs_ibm_clear(ntfs_index_context *icx, VCN vcn) -{ - return ntfs_ibm_modify(icx, vcn, 0); -} - -static VCN ntfs_ibm_get_free(ntfs_index_context *icx) -{ - u8 *bm; - int bit; - s64 vcn, byte, size; - - ntfs_log_trace("Entering\n"); - - bm = ntfs_attr_readall(icx->ni, AT_BITMAP, icx->name, icx->name_len, - &size); - if (!bm) - return (VCN)-1; - - for (byte = 0; byte < size; byte++) { - - if (bm[byte] == 255) - continue; - - for (bit = 0; bit < 8; bit++) { - if (!(bm[byte] & (1 << bit))) { - vcn = ntfs_ibm_pos_to_vcn(icx, byte * 8 + bit); - goto out; - } - } - } - - vcn = ntfs_ibm_pos_to_vcn(icx, size * 8); -out: - ntfs_log_trace("allocated vcn: %lld\n", (long long)vcn); - - if (ntfs_ibm_set(icx, vcn)) - vcn = (VCN)-1; - - free(bm); - return vcn; -} - -static INDEX_BLOCK *ntfs_ir_to_ib(INDEX_ROOT *ir, VCN ib_vcn) -{ - INDEX_BLOCK *ib; - INDEX_ENTRY *ie_last; - char *ies_start, *ies_end; - int i; - - ntfs_log_trace("Entering\n"); - - ib = ntfs_ib_alloc(ib_vcn, le32_to_cpu(ir->index_block_size), LEAF_NODE); - if (!ib) - return NULL; - - ies_start = (char *)ntfs_ie_get_first(&ir->index); - ies_end = (char *)ntfs_ie_get_end(&ir->index); - ie_last = ntfs_ie_get_last((INDEX_ENTRY *)ies_start, ies_end); - /* - * Copy all entries, including the termination entry - * as well, which can never have any data. - */ - i = (char *)ie_last - ies_start + le16_to_cpu(ie_last->length); - memcpy(ntfs_ie_get_first(&ib->index), ies_start, i); - - ib->index.ih_flags = ir->index.ih_flags; - ib->index.index_length = cpu_to_le32(i + - le32_to_cpu(ib->index.entries_offset)); - return ib; -} - -static void ntfs_ir_nill(INDEX_ROOT *ir) -{ - INDEX_ENTRY *ie_last; - char *ies_start, *ies_end; - - ntfs_log_trace("Entering\n"); - /* - * TODO: This function could be much simpler. - */ - ies_start = (char *)ntfs_ie_get_first(&ir->index); - ies_end = (char *)ntfs_ie_get_end(&ir->index); - ie_last = ntfs_ie_get_last((INDEX_ENTRY *)ies_start, ies_end); - /* - * Move the index root termination entry forward - */ - if ((char *)ie_last > ies_start) { - memmove(ies_start, (char *)ie_last, le16_to_cpu(ie_last->length)); - ie_last = (INDEX_ENTRY *)ies_start; - } -} - -static int ntfs_ib_copy_tail(ntfs_index_context *icx, INDEX_BLOCK *src, - INDEX_ENTRY *median, VCN new_vcn) -{ - u8 *ies_end; - INDEX_ENTRY *ie_head; /* first entry after the median */ - int tail_size, ret; - INDEX_BLOCK *dst; - - ntfs_log_trace("Entering\n"); - - dst = ntfs_ib_alloc(new_vcn, icx->block_size, - src->index.ih_flags & NODE_MASK); - if (!dst) - return STATUS_ERROR; - - ie_head = ntfs_ie_get_next(median); - - ies_end = (u8 *)ntfs_ie_get_end(&src->index); - tail_size = ies_end - (u8 *)ie_head; - memcpy(ntfs_ie_get_first(&dst->index), ie_head, tail_size); - - dst->index.index_length = cpu_to_le32(tail_size + - le32_to_cpu(dst->index.entries_offset)); - ret = ntfs_ib_write(icx, dst); - - free(dst); - return ret; -} - -static int ntfs_ib_cut_tail(ntfs_index_context *icx, INDEX_BLOCK *ib, - INDEX_ENTRY *ie) -{ - char *ies_start, *ies_end; - INDEX_ENTRY *ie_last; - - ntfs_log_trace("Entering\n"); - - ies_start = (char *)ntfs_ie_get_first(&ib->index); - ies_end = (char *)ntfs_ie_get_end(&ib->index); - - ie_last = ntfs_ie_get_last((INDEX_ENTRY *)ies_start, ies_end); - if (ie_last->ie_flags & INDEX_ENTRY_NODE) - ntfs_ie_set_vcn(ie_last, ntfs_ie_get_vcn(ie)); - - memcpy(ie, ie_last, le16_to_cpu(ie_last->length)); - - ib->index.index_length = cpu_to_le32(((char *)ie - ies_start) + - le16_to_cpu(ie->length) + le32_to_cpu(ib->index.entries_offset)); - - if (ntfs_ib_write(icx, ib)) - return STATUS_ERROR; - - return STATUS_OK; -} - -static int ntfs_ia_add(ntfs_index_context *icx) -{ - ntfs_log_trace("Entering\n"); - - if (ntfs_ibm_add(icx)) - return -1; - - if (!ntfs_attr_exist(icx->ni, AT_INDEX_ALLOCATION, icx->name, icx->name_len)) { - - if (ntfs_attr_add(icx->ni, AT_INDEX_ALLOCATION, icx->name, - icx->name_len, NULL, 0)) { - ntfs_log_perror("Failed to add AT_INDEX_ALLOCATION"); - return -1; - } - } - - icx->ia_na = ntfs_ia_open(icx, icx->ni); - if (!icx->ia_na) - return -1; - - return 0; -} - -static int ntfs_ir_reparent(ntfs_index_context *icx) -{ - ntfs_attr_search_ctx *ctx = NULL; - INDEX_ROOT *ir; - INDEX_ENTRY *ie; - INDEX_BLOCK *ib = NULL; - VCN new_ib_vcn; - int ret = STATUS_ERROR; - - ntfs_log_trace("Entering\n"); - - ir = ntfs_ir_lookup2(icx->ni, icx->name, icx->name_len); - if (!ir) - goto out; - - if ((ir->index.ih_flags & NODE_MASK) == SMALL_INDEX) - if (ntfs_ia_add(icx)) - goto out; - - new_ib_vcn = ntfs_ibm_get_free(icx); - if (new_ib_vcn == -1) - goto out; - - ir = ntfs_ir_lookup2(icx->ni, icx->name, icx->name_len); - if (!ir) - goto clear_bmp; - - ib = ntfs_ir_to_ib(ir, new_ib_vcn); - if (ib == NULL) { - ntfs_log_perror("Failed to move index root to index block"); - goto clear_bmp; - } - - if (ntfs_ib_write(icx, ib)) - goto clear_bmp; - - ir = ntfs_ir_lookup(icx->ni, icx->name, icx->name_len, &ctx); - if (!ir) - goto clear_bmp; - - ntfs_ir_nill(ir); - - ie = ntfs_ie_get_first(&ir->index); - ie->ie_flags |= INDEX_ENTRY_NODE; - ie->length = cpu_to_le16(sizeof(INDEX_ENTRY_HEADER) + sizeof(VCN)); - - ir->index.ih_flags = LARGE_INDEX; - ir->index.index_length = cpu_to_le32(le32_to_cpu(ir->index.entries_offset) - + le16_to_cpu(ie->length)); - ir->index.allocated_size = ir->index.index_length; - - if (ntfs_resident_attr_value_resize(ctx->mrec, ctx->attr, - sizeof(INDEX_ROOT) - sizeof(INDEX_HEADER) + - le32_to_cpu(ir->index.allocated_size))) - /* FIXME: revert index root */ - goto clear_bmp; - /* - * FIXME: do it earlier if we have enough space in IR (should always), - * so in error case we wouldn't lose the IB. - */ - ntfs_ie_set_vcn(ie, new_ib_vcn); - - ret = STATUS_OK; -err_out: - free(ib); - ntfs_attr_put_search_ctx(ctx); -out: - return ret; -clear_bmp: - ntfs_ibm_clear(icx, new_ib_vcn); - goto err_out; -} - -/** - * ntfs_ir_truncate - Truncate index root attribute - * - * Returns STATUS_OK, STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT or STATUS_ERROR. - */ -static int ntfs_ir_truncate(ntfs_index_context *icx, int data_size) -{ - ntfs_attr *na; - int ret; - - ntfs_log_trace("Entering\n"); - - na = ntfs_attr_open(icx->ni, AT_INDEX_ROOT, icx->name, icx->name_len); - if (!na) { - ntfs_log_perror("Failed to open INDEX_ROOT"); - return STATUS_ERROR; - } - /* - * INDEX_ROOT must be resident and its entries can be moved to - * INDEX_BLOCK, so ENOSPC isn't a real error. - */ - ret = ntfs_attr_truncate(na, data_size + offsetof(INDEX_ROOT, index)); - if (ret == STATUS_OK) { - - icx->ir = ntfs_ir_lookup2(icx->ni, icx->name, icx->name_len); - if (!icx->ir) - return STATUS_ERROR; - - icx->ir->index.allocated_size = cpu_to_le32(data_size); - - } else if (ret == STATUS_ERROR) - ntfs_log_perror("Failed to truncate INDEX_ROOT"); - - ntfs_attr_close(na); - return ret; -} - -/** - * ntfs_ir_make_space - Make more space for the index root attribute - * - * On success return STATUS_OK or STATUS_KEEP_SEARCHING. - * On error return STATUS_ERROR. - */ -static int ntfs_ir_make_space(ntfs_index_context *icx, int data_size) -{ - int ret; - - ntfs_log_trace("Entering\n"); - - ret = ntfs_ir_truncate(icx, data_size); - if (ret == STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT) { - - ret = ntfs_ir_reparent(icx); - if (ret == STATUS_OK) - ret = STATUS_KEEP_SEARCHING; - else - ntfs_log_perror("Failed to nodify INDEX_ROOT"); - } - - return ret; -} - -/* - * NOTE: 'ie' must be a copy of a real index entry. - */ -static int ntfs_ie_add_vcn(INDEX_ENTRY **ie) -{ - INDEX_ENTRY *p, *old = *ie; - - old->length = cpu_to_le16(le16_to_cpu(old->length) + sizeof(VCN)); - p = realloc(old, le16_to_cpu(old->length)); - if (!p) - return STATUS_ERROR; - - p->ie_flags |= INDEX_ENTRY_NODE; - *ie = p; - - return STATUS_OK; -} - -static int ntfs_ih_insert(INDEX_HEADER *ih, INDEX_ENTRY *orig_ie, VCN new_vcn, - int pos) -{ - INDEX_ENTRY *ie_node, *ie; - int ret = STATUS_ERROR; - VCN old_vcn; - - ntfs_log_trace("Entering\n"); - - ie = ntfs_ie_dup(orig_ie); - if (!ie) - return STATUS_ERROR; - - if (!(ie->ie_flags & INDEX_ENTRY_NODE)) - if (ntfs_ie_add_vcn(&ie)) - goto out; - - ie_node = ntfs_ie_get_by_pos(ih, pos); - old_vcn = ntfs_ie_get_vcn(ie_node); - ntfs_ie_set_vcn(ie_node, new_vcn); - - ntfs_ie_insert(ih, ie, ie_node); - ntfs_ie_set_vcn(ie_node, old_vcn); - ret = STATUS_OK; -out: - free(ie); - - return ret; -} - -static VCN ntfs_icx_parent_vcn(ntfs_index_context *icx) -{ - return icx->parent_vcn[icx->pindex]; -} - -static VCN ntfs_icx_parent_pos(ntfs_index_context *icx) -{ - return icx->parent_pos[icx->pindex]; -} - - -static int ntfs_ir_insert_median(ntfs_index_context *icx, INDEX_ENTRY *median, - VCN new_vcn) -{ - u32 new_size; - int ret; - - ntfs_log_trace("Entering\n"); - - icx->ir = ntfs_ir_lookup2(icx->ni, icx->name, icx->name_len); - if (!icx->ir) - return STATUS_ERROR; - - new_size = le32_to_cpu(icx->ir->index.index_length) + - le16_to_cpu(median->length); - if (!(median->ie_flags & INDEX_ENTRY_NODE)) - new_size += sizeof(VCN); - - ret = ntfs_ir_make_space(icx, new_size); - if (ret != STATUS_OK) - return ret; - - icx->ir = ntfs_ir_lookup2(icx->ni, icx->name, icx->name_len); - if (!icx->ir) - return STATUS_ERROR; - - return ntfs_ih_insert(&icx->ir->index, median, new_vcn, - ntfs_icx_parent_pos(icx)); -} - -static int ntfs_ib_split(ntfs_index_context *icx, INDEX_BLOCK *ib); - -/** - * On success return STATUS_OK or STATUS_KEEP_SEARCHING. - * On error return STATUS_ERROR. - */ -static int ntfs_ib_insert(ntfs_index_context *icx, INDEX_ENTRY *ie, VCN new_vcn) -{ - INDEX_BLOCK *ib; - u32 idx_size, allocated_size; - int err = STATUS_ERROR; - VCN old_vcn; - - ntfs_log_trace("Entering\n"); - - ib = ntfs_malloc(icx->block_size); - if (!ib) - return -1; - - old_vcn = ntfs_icx_parent_vcn(icx); - - if (ntfs_ib_read(icx, old_vcn, ib)) - goto err_out; - - idx_size = le32_to_cpu(ib->index.index_length); - allocated_size = le32_to_cpu(ib->index.allocated_size); - /* FIXME: sizeof(VCN) should be included only if ie has no VCN */ - if (idx_size + le16_to_cpu(ie->length) + sizeof(VCN) > allocated_size) { - err = ntfs_ib_split(icx, ib); - if (err == STATUS_OK) - err = STATUS_KEEP_SEARCHING; - goto err_out; - } - - if (ntfs_ih_insert(&ib->index, ie, new_vcn, ntfs_icx_parent_pos(icx))) - goto err_out; - - if (ntfs_ib_write(icx, ib)) - goto err_out; - - err = STATUS_OK; -err_out: - free(ib); - return err; -} - -/** - * ntfs_ib_split - Split an index block - * - * On success return STATUS_OK or STATUS_KEEP_SEARCHING. - * On error return is STATUS_ERROR. - */ -static int ntfs_ib_split(ntfs_index_context *icx, INDEX_BLOCK *ib) -{ - INDEX_ENTRY *median; - VCN new_vcn; - int ret; - - ntfs_log_trace("Entering\n"); - - if (ntfs_icx_parent_dec(icx)) - return STATUS_ERROR; - - median = ntfs_ie_get_median(&ib->index); - new_vcn = ntfs_ibm_get_free(icx); - if (new_vcn == -1) - return STATUS_ERROR; - - if (ntfs_ib_copy_tail(icx, ib, median, new_vcn)) { - ntfs_ibm_clear(icx, new_vcn); - return STATUS_ERROR; - } - - if (ntfs_icx_parent_vcn(icx) == VCN_INDEX_ROOT_PARENT) - ret = ntfs_ir_insert_median(icx, median, new_vcn); - else - ret = ntfs_ib_insert(icx, median, new_vcn); - - if (ret != STATUS_OK) { - ntfs_ibm_clear(icx, new_vcn); - return ret; - } - - ret = ntfs_ib_cut_tail(icx, ib, median); - - return ret; -} - -/* JPA static */ -int ntfs_ie_add(ntfs_index_context *icx, INDEX_ENTRY *ie) -{ - INDEX_HEADER *ih; - int allocated_size, new_size; - int ret = STATUS_ERROR; - -#ifdef DEBUG -/* removed by JPA to make function usable for security indexes - char *fn; - fn = ntfs_ie_filename_get(ie); - ntfs_log_trace("file: '%s'\n", fn); - ntfs_attr_name_free(&fn); -*/ -#endif - - while (1) { - - if (!ntfs_index_lookup(&ie->key, le16_to_cpu(ie->key_length), icx)) { - errno = EEXIST; - ntfs_log_perror("Index already have such entry"); - goto err_out; - } - if (errno != ENOENT) { - ntfs_log_perror("Failed to find place for new entry"); - goto err_out; - } - - if (icx->is_in_root) - ih = &icx->ir->index; - else - ih = &icx->ib->index; - - allocated_size = le32_to_cpu(ih->allocated_size); - new_size = le32_to_cpu(ih->index_length) + le16_to_cpu(ie->length); - - if (new_size <= allocated_size) - break; - - ntfs_log_trace("index block sizes: allocated: %d needed: %d\n", - allocated_size, new_size); - - if (icx->is_in_root) { - if (ntfs_ir_make_space(icx, new_size) == STATUS_ERROR) - goto err_out; - } else { - if (ntfs_ib_split(icx, icx->ib) == STATUS_ERROR) - goto err_out; - } - - ntfs_inode_mark_dirty(icx->actx->ntfs_ino); - ntfs_index_ctx_reinit(icx); - } - - ntfs_ie_insert(ih, ie, icx->entry); - ntfs_index_entry_mark_dirty(icx); - - ret = STATUS_OK; -err_out: - ntfs_log_trace("%s\n", ret ? "Failed" : "Done"); - return ret; -} - -/** - * ntfs_index_add_filename - add filename to directory index - * @ni: ntfs inode describing directory to which index add filename - * @fn: FILE_NAME attribute to add - * @mref: reference of the inode which @fn describes - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -int ntfs_index_add_filename(ntfs_inode *ni, FILE_NAME_ATTR *fn, MFT_REF mref) -{ - INDEX_ENTRY *ie; - ntfs_index_context *icx; - int fn_size, ie_size, err, ret = -1; - - ntfs_log_trace("Entering\n"); - - if (!ni || !fn) { - ntfs_log_error("Invalid arguments.\n"); - errno = EINVAL; - return -1; - } - - fn_size = (fn->file_name_length * sizeof(ntfschar)) + - sizeof(FILE_NAME_ATTR); - ie_size = (sizeof(INDEX_ENTRY_HEADER) + fn_size + 7) & ~7; - - ie = ntfs_calloc(ie_size); - if (!ie) - return -1; - - ie->indexed_file = cpu_to_le64(mref); - ie->length = cpu_to_le16(ie_size); - ie->key_length = cpu_to_le16(fn_size); - memcpy(&ie->key, fn, fn_size); - - icx = ntfs_index_ctx_get(ni, NTFS_INDEX_I30, 4); - if (!icx) - goto out; - - ret = ntfs_ie_add(icx, ie); - err = errno; - ntfs_index_ctx_put(icx); - errno = err; -out: - free(ie); - return ret; -} - -static int ntfs_ih_takeout(ntfs_index_context *icx, INDEX_HEADER *ih, - INDEX_ENTRY *ie, INDEX_BLOCK *ib) -{ - INDEX_ENTRY *ie_roam; - int ret = STATUS_ERROR; - - ntfs_log_trace("Entering\n"); - - ie_roam = ntfs_ie_dup_novcn(ie); - if (!ie_roam) - return STATUS_ERROR; - - ntfs_ie_delete(ih, ie); - - if (ntfs_icx_parent_vcn(icx) == VCN_INDEX_ROOT_PARENT) - ntfs_inode_mark_dirty(icx->actx->ntfs_ino); - else - if (ntfs_ib_write(icx, ib)) - goto out; - - ntfs_index_ctx_reinit(icx); - - ret = ntfs_ie_add(icx, ie_roam); -out: - free(ie_roam); - return ret; -} - -/** - * Used if an empty index block to be deleted has END entry as the parent - * in the INDEX_ROOT which is the only one there. - */ -static void ntfs_ir_leafify(ntfs_index_context *icx, INDEX_HEADER *ih) -{ - INDEX_ENTRY *ie; - - ntfs_log_trace("Entering\n"); - - ie = ntfs_ie_get_first(ih); - ie->ie_flags &= ~INDEX_ENTRY_NODE; - ie->length = cpu_to_le16(le16_to_cpu(ie->length) - sizeof(VCN)); - - ih->index_length = cpu_to_le32(le32_to_cpu(ih->index_length) - sizeof(VCN)); - ih->ih_flags &= ~LARGE_INDEX; - - /* Not fatal error */ - ntfs_ir_truncate(icx, le32_to_cpu(ih->index_length)); -} - -/** - * Used if an empty index block to be deleted has END entry as the parent - * in the INDEX_ROOT which is not the only one there. - */ -static int ntfs_ih_reparent_end(ntfs_index_context *icx, INDEX_HEADER *ih, - INDEX_BLOCK *ib) -{ - INDEX_ENTRY *ie, *ie_prev; - - ntfs_log_trace("Entering\n"); - - ie = ntfs_ie_get_by_pos(ih, ntfs_icx_parent_pos(icx)); - ie_prev = ntfs_ie_prev(ih, ie); - - ntfs_ie_set_vcn(ie, ntfs_ie_get_vcn(ie_prev)); - - return ntfs_ih_takeout(icx, ih, ie_prev, ib); -} - -static int ntfs_index_rm_leaf(ntfs_index_context *icx) -{ - INDEX_BLOCK *ib = NULL; - INDEX_HEADER *parent_ih; - INDEX_ENTRY *ie; - int ret = STATUS_ERROR; - - ntfs_log_trace("pindex: %d\n", icx->pindex); - - if (ntfs_icx_parent_dec(icx)) - return STATUS_ERROR; - - if (ntfs_ibm_clear(icx, icx->parent_vcn[icx->pindex + 1])) - return STATUS_ERROR; - - if (ntfs_icx_parent_vcn(icx) == VCN_INDEX_ROOT_PARENT) - parent_ih = &icx->ir->index; - else { - ib = ntfs_malloc(icx->block_size); - if (!ib) - return STATUS_ERROR; - - if (ntfs_ib_read(icx, ntfs_icx_parent_vcn(icx), ib)) - goto out; - - parent_ih = &ib->index; - } - - ie = ntfs_ie_get_by_pos(parent_ih, ntfs_icx_parent_pos(icx)); - if (!ntfs_ie_end(ie)) { - ret = ntfs_ih_takeout(icx, parent_ih, ie, ib); - goto out; - } - - if (ntfs_ih_zero_entry(parent_ih)) { - - if (ntfs_icx_parent_vcn(icx) == VCN_INDEX_ROOT_PARENT) { - ntfs_ir_leafify(icx, parent_ih); - goto ok; - } - - ret = ntfs_index_rm_leaf(icx); - goto out; - } - - if (ntfs_ih_reparent_end(icx, parent_ih, ib)) - goto out; -ok: - ret = STATUS_OK; -out: - free(ib); - return ret; -} - -static int ntfs_index_rm_node(ntfs_index_context *icx) -{ - int entry_pos, pindex; - VCN vcn; - INDEX_BLOCK *ib = NULL; - INDEX_ENTRY *ie_succ, *ie, *entry = icx->entry; - INDEX_HEADER *ih; - u32 new_size; - int delta, ret = STATUS_ERROR; - - ntfs_log_trace("Entering\n"); - - if (!icx->ia_na) { - icx->ia_na = ntfs_ia_open(icx, icx->ni); - if (!icx->ia_na) - return STATUS_ERROR; - } - - ib = ntfs_malloc(icx->block_size); - if (!ib) - return STATUS_ERROR; - - ie_succ = ntfs_ie_get_next(icx->entry); - entry_pos = icx->parent_pos[icx->pindex]++; - pindex = icx->pindex; -descend: - vcn = ntfs_ie_get_vcn(ie_succ); - if (ntfs_ib_read(icx, vcn, ib)) - goto out; - - ie_succ = ntfs_ie_get_first(&ib->index); - - if (ntfs_icx_parent_inc(icx)) - goto out; - - icx->parent_vcn[icx->pindex] = vcn; - icx->parent_pos[icx->pindex] = 0; - - if ((ib->index.ih_flags & NODE_MASK) == INDEX_NODE) - goto descend; - - if (ntfs_ih_zero_entry(&ib->index)) { - errno = EIO; - ntfs_log_perror("Empty index block"); - goto out; - } - - ie = ntfs_ie_dup(ie_succ); - if (!ie) - goto out; - - if (ntfs_ie_add_vcn(&ie)) - goto out2; - - ntfs_ie_set_vcn(ie, ntfs_ie_get_vcn(icx->entry)); - - if (icx->is_in_root) - ih = &icx->ir->index; - else - ih = &icx->ib->index; - - delta = le16_to_cpu(ie->length) - le16_to_cpu(icx->entry->length); - new_size = le32_to_cpu(ih->index_length) + delta; - if (delta > 0) { - if (icx->is_in_root) { - ret = ntfs_ir_make_space(icx, new_size); - if (ret != STATUS_OK) - goto out2; - - ih = &icx->ir->index; - entry = ntfs_ie_get_by_pos(ih, entry_pos); - - } else if (new_size > le32_to_cpu(ih->allocated_size)) { - icx->pindex = pindex; - ret = ntfs_ib_split(icx, icx->ib); - if (ret == STATUS_OK) - ret = STATUS_KEEP_SEARCHING; - goto out2; - } - } - - ntfs_ie_delete(ih, entry); - ntfs_ie_insert(ih, ie, entry); - - if (icx->is_in_root) { - if (ntfs_ir_truncate(icx, new_size)) - goto out2; - } else - if (ntfs_icx_ib_write(icx)) - goto out2; - - ntfs_ie_delete(&ib->index, ie_succ); - - if (ntfs_ih_zero_entry(&ib->index)) { - if (ntfs_index_rm_leaf(icx)) - goto out2; - } else - if (ntfs_ib_write(icx, ib)) - goto out2; - - ret = STATUS_OK; -out2: - free(ie); -out: - free(ib); - return ret; -} - -/** - * ntfs_index_rm - remove entry from the index - * @icx: index context describing entry to delete - * - * Delete entry described by @icx from the index. Index context is always - * reinitialized after use of this function, so it can be used for index - * lookup once again. - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -/*static JPA*/ -int ntfs_index_rm(ntfs_index_context *icx) -{ - INDEX_HEADER *ih; - int err, ret = STATUS_OK; - - ntfs_log_trace("Entering\n"); - - if (!icx || (!icx->ib && !icx->ir) || ntfs_ie_end(icx->entry)) { - ntfs_log_error("Invalid arguments.\n"); - errno = EINVAL; - goto err_out; - } - if (icx->is_in_root) - ih = &icx->ir->index; - else - ih = &icx->ib->index; - - if (icx->entry->ie_flags & INDEX_ENTRY_NODE) { - - ret = ntfs_index_rm_node(icx); - - } else if (icx->is_in_root || !ntfs_ih_one_entry(ih)) { - - ntfs_ie_delete(ih, icx->entry); - - if (icx->is_in_root) { - err = ntfs_ir_truncate(icx, le32_to_cpu(ih->index_length)); - if (err != STATUS_OK) - goto err_out; - } else - if (ntfs_icx_ib_write(icx)) - goto err_out; - } else { - if (ntfs_index_rm_leaf(icx)) - goto err_out; - } -out: - return ret; -err_out: - ret = STATUS_ERROR; - goto out; -} - -int ntfs_index_remove(ntfs_inode *dir_ni, ntfs_inode *ni, - const void *key, const int keylen) -{ - int ret = STATUS_ERROR; - ntfs_index_context *icx; - - icx = ntfs_index_ctx_get(dir_ni, NTFS_INDEX_I30, 4); - if (!icx) - return -1; - - while (1) { - - if (ntfs_index_lookup(key, keylen, icx)) - goto err_out; - - if ((((FILE_NAME_ATTR *)icx->data)->file_attributes & - FILE_ATTR_REPARSE_POINT) - && !ntfs_possible_symlink(ni)) { - errno = EOPNOTSUPP; - goto err_out; - } - - ret = ntfs_index_rm(icx); - if (ret == STATUS_ERROR) - goto err_out; - else if (ret == STATUS_OK) - break; - - ntfs_inode_mark_dirty(icx->actx->ntfs_ino); - ntfs_index_ctx_reinit(icx); - } - - ntfs_inode_mark_dirty(icx->actx->ntfs_ino); -out: - ntfs_index_ctx_put(icx); - return ret; -err_out: - ret = STATUS_ERROR; - ntfs_log_perror("Delete failed"); - goto out; -} - -/** - * ntfs_index_root_get - read the index root of an attribute - * @ni: open ntfs inode in which the ntfs attribute resides - * @attr: attribute for which we want its index root - * - * This function will read the related index root an ntfs attribute. - * - * On success a buffer is allocated with the content of the index root - * and which needs to be freed when it's not needed anymore. - * - * On error NULL is returned with errno set to the error code. - */ -INDEX_ROOT *ntfs_index_root_get(ntfs_inode *ni, ATTR_RECORD *attr) -{ - ntfs_attr_search_ctx *ctx; - ntfschar *name; - INDEX_ROOT *root = NULL; - - name = (ntfschar *)((u8 *)attr + le16_to_cpu(attr->name_offset)); - - if (!ntfs_ir_lookup(ni, name, attr->name_length, &ctx)) - return NULL; - - root = ntfs_malloc(sizeof(INDEX_ROOT)); - if (!root) - goto out; - - *root = *((INDEX_ROOT *)((u8 *)ctx->attr + - le16_to_cpu(ctx->attr->value_offset))); -out: - ntfs_attr_put_search_ctx(ctx); - return root; -} - - -/* - * Walk down the index tree (leaf bound) - * until there are no subnode in the first index entry - * returns the entry at the bottom left in subnode - */ - -static INDEX_ENTRY *ntfs_index_walk_down(INDEX_ENTRY *ie, - ntfs_index_context *ictx) -{ - INDEX_ENTRY *entry; - s64 vcn; - - entry = ie; - do { - vcn = ntfs_ie_get_vcn(entry); - if (ictx->is_in_root) { - - /* down from level zero */ - - ictx->ir = (INDEX_ROOT*)NULL; - ictx->ib = (INDEX_BLOCK*)ntfs_malloc(ictx->block_size); - ictx->pindex = 1; - ictx->is_in_root = FALSE; - } else { - - /* down from non-zero level */ - - ictx->pindex++; - } - ictx->parent_pos[ictx->pindex] = 0; - ictx->parent_vcn[ictx->pindex] = vcn; - if (!ntfs_ib_read(ictx,vcn,ictx->ib)) { - ictx->entry = ntfs_ie_get_first(&ictx->ib->index); - entry = ictx->entry; - } else - entry = (INDEX_ENTRY*)NULL; - } while (entry && (entry->ie_flags & INDEX_ENTRY_NODE)); - return (entry); -} - -/* - * Walk up the index tree (root bound) - * until there is a valid data entry in parent - * returns the parent entry or NULL if no more parent - */ - -static INDEX_ENTRY *ntfs_index_walk_up(INDEX_ENTRY *ie, - ntfs_index_context *ictx) -{ - INDEX_ENTRY *entry; - s64 vcn; - - entry = ie; - if (ictx->pindex > 0) { - do { - ictx->pindex--; - if (!ictx->pindex) { - - /* we have reached the root */ - - free(ictx->ib); - ictx->ib = (INDEX_BLOCK*)NULL; - ictx->is_in_root = TRUE; - /* a new search context is to be allocated */ - if (ictx->actx) - free(ictx->actx); - ictx->ir = ntfs_ir_lookup(ictx->ni, - ictx->name, ictx->name_len, - &ictx->actx); - if (ictx->ir) - entry = ntfs_ie_get_by_pos( - &ictx->ir->index, - ictx->parent_pos[ictx->pindex]); - else - entry = (INDEX_ENTRY*)NULL; - } else { - /* up into non-root node */ - vcn = ictx->parent_vcn[ictx->pindex]; - if (!ntfs_ib_read(ictx,vcn,ictx->ib)) { - entry = ntfs_ie_get_by_pos( - &ictx->ib->index, - ictx->parent_pos[ictx->pindex]); - } else - entry = (INDEX_ENTRY*)NULL; - } - ictx->entry = entry; - } while (entry && (ictx->pindex > 0) - && (entry->ie_flags & INDEX_ENTRY_END)); - } else - entry = (INDEX_ENTRY*)NULL; - return (entry); -} - -/* - * Get next entry in an index according to collating sequence. - * Must be initialized through a ntfs_index_lookup() - * - * Returns next entry or NULL if none - * - * Sample layout : - * - * +---+---+---+---+---+---+---+---+ n ptrs to subnodes - * | | | 10| 25| 33| | | | n-1 keys in between - * +---+---+---+---+---+---+---+---+ no key in last entry - * | A | A - * | | | +-------------------------------+ - * +--------------------------+ | +-----+ | - * | +--+ | | - * V | V | - * +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ - * | 11| 12| 13| 14| 15| 16| 17| | | | 26| 27| 28| 29| 30| 31| 32| | - * +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ - * | | - * +-----------------------+ | - * | | - * +---+---+---+---+---+---+---+---+ - * | 18| 19| 20| 21| 22| 23| 24| | - * +---+---+---+---+---+---+---+---+ - */ - -INDEX_ENTRY *ntfs_index_next(INDEX_ENTRY *ie, ntfs_index_context *ictx) -{ - INDEX_ENTRY *next; - int flags; - - /* - * lookup() may have returned an invalid node - * when searching for a partial key - * if this happens, walk up - */ - - if (ie->ie_flags & INDEX_ENTRY_END) - next = ntfs_index_walk_up(ie, ictx); - else { - /* - * get next entry in same node - * there is always one after any entry with data - */ - - next = (INDEX_ENTRY*)((char*)ie + le16_to_cpu(ie->length)); - ++ictx->parent_pos[ictx->pindex]; - flags = next->ie_flags; - - /* walk down if it has a subnode */ - - if (flags & INDEX_ENTRY_NODE) { - next = ntfs_index_walk_down(next,ictx); - } else { - - /* walk up it has no subnode, nor data */ - - if (flags & INDEX_ENTRY_END) { - next = ntfs_index_walk_up(next, ictx); - } - } - } - /* return NULL if stuck at end of a block */ - - if (next && (next->ie_flags & INDEX_ENTRY_END)) - next = (INDEX_ENTRY*)NULL; - return (next); -} - - diff --git a/source/libs/libntfs/index.h b/source/libs/libntfs/index.h deleted file mode 100644 index c0e76180..00000000 --- a/source/libs/libntfs/index.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * index.h - Defines for NTFS index handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2004 Anton Altaparmakov - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2005 Yura Pakhuchiy - * Copyright (c) 2006-2008 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_INDEX_H -#define _NTFS_INDEX_H - -/* Convenience macros to test the versions of gcc. - * Use them like this: - * #if __GNUC_PREREQ (2,8) - * ... code requiring gcc 2.8 or later ... - * #endif - * Note - they won't work for gcc1 or glibc1, since the _MINOR macros - * were not defined then. - */ - -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif - -/* allows us to warn about unused results of certain function calls */ -#ifndef __attribute_warn_unused_result__ -# if __GNUC_PREREQ (3,4) -# define __attribute_warn_unused_result__ \ - __attribute__ ((__warn_unused_result__)) -# else -# define __attribute_warn_unused_result__ /* empty */ -# endif -#endif - -#include "attrib.h" -#include "types.h" -#include "layout.h" -#include "inode.h" -#include "mft.h" - -#define VCN_INDEX_ROOT_PARENT ((VCN)-2) - -#define MAX_PARENT_VCN 32 - -typedef int (*COLLATE)(ntfs_volume *vol, const void *data1, int len1, - const void *data2, int len2); - -/** - * struct ntfs_index_context - - * @ni: inode containing the @entry described by this context - * @name: name of the index described by this context - * @name_len: length of the index name - * @entry: index entry (points into @ir or @ia) - * @data: index entry data (points into @entry) - * @data_len: length in bytes of @data - * @is_in_root: TRUE if @entry is in @ir or FALSE if it is in @ia - * @ir: index root if @is_in_root or NULL otherwise - * @actx: attribute search context if in root or NULL otherwise - * @ia: index block if @is_in_root is FALSE or NULL otherwise - * @ia_na: opened INDEX_ALLOCATION attribute - * @parent_pos: parent entries' positions in the index block - * @parent_vcn: entry's parent node or VCN_INDEX_ROOT_PARENT - * @new_vcn: new VCN if we need to create a new index block - * @median: move to the parent if splitting index blocks - * @ib_dirty: TRUE if index block was changed - * @block_size: index block size - * @vcn_size_bits: VCN size bits for this index block - * - * @ni is the inode this context belongs to. - * - * @entry is the index entry described by this context. @data and @data_len - * are the index entry data and its length in bytes, respectively. @data - * simply points into @entry. This is probably what the user is interested in. - * - * If @is_in_root is TRUE, @entry is in the index root attribute @ir described - * by the attribute search context @actx and inode @ni. @ia and - * @ib_dirty are undefined in this case. - * - * If @is_in_root is FALSE, @entry is in the index allocation attribute and @ia - * point to the index allocation block and VCN where it's placed, - * respectively. @ir and @actx are NULL in this case. @ia_na is opened - * INDEX_ALLOCATION attribute. @ib_dirty is TRUE if index block was changed and - * FALSE otherwise. - * - * To obtain a context call ntfs_index_ctx_get(). - * - * When finished with the @entry and its @data, call ntfs_index_ctx_put() to - * free the context and other associated resources. - * - * If the index entry was modified, call ntfs_index_entry_mark_dirty() before - * the call to ntfs_index_ctx_put() to ensure that the changes are written - * to disk. - */ -typedef struct { - ntfs_inode *ni; - ntfschar *name; - u32 name_len; - INDEX_ENTRY *entry; - void *data; - u16 data_len; - COLLATE collate; - BOOL is_in_root; - INDEX_ROOT *ir; - ntfs_attr_search_ctx *actx; - INDEX_BLOCK *ib; - ntfs_attr *ia_na; - int parent_pos[MAX_PARENT_VCN]; /* parent entries' positions */ - VCN parent_vcn[MAX_PARENT_VCN]; /* entry's parent nodes */ - int pindex; /* maximum it's the number of the parent nodes */ - BOOL ib_dirty; - u32 block_size; - u8 vcn_size_bits; -} ntfs_index_context; - -extern ntfs_index_context *ntfs_index_ctx_get(ntfs_inode *ni, - ntfschar *name, u32 name_len); -extern void ntfs_index_ctx_put(ntfs_index_context *ictx); -extern void ntfs_index_ctx_reinit(ntfs_index_context *ictx); - -extern int ntfs_index_lookup(const void *key, const int key_len, - ntfs_index_context *ictx) __attribute_warn_unused_result__; - -extern INDEX_ENTRY *ntfs_index_next(INDEX_ENTRY *ie, - ntfs_index_context *ictx); - -extern int ntfs_index_add_filename(ntfs_inode *ni, FILE_NAME_ATTR *fn, - MFT_REF mref); -extern int ntfs_index_remove(ntfs_inode *dir_ni, ntfs_inode *ni, - const void *key, const int keylen); - -extern INDEX_ROOT *ntfs_index_root_get(ntfs_inode *ni, ATTR_RECORD *attr); - -extern VCN ntfs_ie_get_vcn(INDEX_ENTRY *ie); - -extern void ntfs_index_entry_mark_dirty(ntfs_index_context *ictx); - -extern char *ntfs_ie_filename_get(INDEX_ENTRY *ie); -extern void ntfs_ie_filename_dump(INDEX_ENTRY *ie); -extern void ntfs_ih_filename_dump(INDEX_HEADER *ih); - -/* the following was added by JPA for use in security.c */ -extern int ntfs_ie_add(ntfs_index_context *icx, INDEX_ENTRY *ie); -extern int ntfs_index_rm(ntfs_index_context *icx); - -#endif /* _NTFS_INDEX_H */ - diff --git a/source/libs/libntfs/inode.c b/source/libs/libntfs/inode.c deleted file mode 100644 index 6f3fa060..00000000 --- a/source/libs/libntfs/inode.c +++ /dev/null @@ -1,1566 +0,0 @@ -/** - * inode.c - Inode handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002-2005 Anton Altaparmakov - * Copyright (c) 2002-2008 Szabolcs Szakacsits - * Copyright (c) 2004-2007 Yura Pakhuchiy - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2009-2010 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_SETXATTR -#include -#endif - -#include "param.h" -#include "compat.h" -#include "types.h" -#include "volume.h" -#include "cache.h" -#include "inode.h" -#include "attrib.h" -#include "debug.h" -#include "mft.h" -#include "attrlist.h" -#include "runlist.h" -#include "lcnalloc.h" -#include "index.h" -#include "dir.h" -#include "ntfstime.h" -#include "logging.h" -#include "misc.h" - -ntfs_inode *ntfs_inode_base(ntfs_inode *ni) -{ - if (ni->nr_extents == -1) - return ni->base_ni; - return ni; -} - -/** - * ntfs_inode_mark_dirty - set the inode (and its base inode if it exists) dirty - * @ni: ntfs inode to set dirty - * - * Set the inode @ni dirty so it is written out later (at the latest at - * ntfs_inode_close() time). If @ni is an extent inode, set the base inode - * dirty, too. - * - * This function cannot fail. - */ -void ntfs_inode_mark_dirty(ntfs_inode *ni) -{ - NInoSetDirty(ni); - if (ni->nr_extents == -1) - NInoSetDirty(ni->base_ni); -} - -/** - * __ntfs_inode_allocate - Create and initialise an NTFS inode object - * @vol: - * - * Description... - * - * Returns: - */ -static ntfs_inode *__ntfs_inode_allocate(ntfs_volume *vol) -{ - ntfs_inode *ni; - - ni = (ntfs_inode*)ntfs_calloc(sizeof(ntfs_inode)); - if (ni) - ni->vol = vol; - return ni; -} - -/** - * ntfs_inode_allocate - Create an NTFS inode object - * @vol: - * - * Description... - * - * Returns: - */ -ntfs_inode *ntfs_inode_allocate(ntfs_volume *vol) -{ - return __ntfs_inode_allocate(vol); -} - -/** - * __ntfs_inode_release - Destroy an NTFS inode object - * @ni: - * - * Description... - * - * Returns: - */ -static void __ntfs_inode_release(ntfs_inode *ni) -{ - if (NInoDirty(ni)) - ntfs_log_error("Releasing dirty inode %lld!\n", - (long long)ni->mft_no); - if (NInoAttrList(ni) && ni->attr_list) - free(ni->attr_list); - free(ni->mrec); - free(ni); - return; -} - -/** - * ntfs_inode_open - open an inode ready for access - * @vol: volume to get the inode from - * @mref: inode number / mft record number to open - * - * Allocate an ntfs_inode structure and initialize it for the given inode - * specified by @mref. @mref specifies the inode number / mft record to read, - * including the sequence number, which can be 0 if no sequence number checking - * is to be performed. - * - * Then, allocate a buffer for the mft record, read the mft record from the - * volume @vol, and attach it to the ntfs_inode structure (->mrec). The - * mft record is mst deprotected and sanity checked for validity and we abort - * if deprotection or checks fail. - * - * Finally, search for an attribute list attribute in the mft record and if one - * is found, load the attribute list attribute value and attach it to the - * ntfs_inode structure (->attr_list). Also set the NI_AttrList bit to indicate - * this. - * - * Return a pointer to the ntfs_inode structure on success or NULL on error, - * with errno set to the error code. - */ -static ntfs_inode *ntfs_inode_real_open(ntfs_volume *vol, const MFT_REF mref) -{ - s64 l; - ntfs_inode *ni = NULL; - ntfs_attr_search_ctx *ctx; - STANDARD_INFORMATION *std_info; - le32 lthle; - int olderrno; - - ntfs_log_enter("Entering for inode %lld\n", (long long)MREF(mref)); - if (!vol) { - errno = EINVAL; - goto out; - } - ni = __ntfs_inode_allocate(vol); - if (!ni) - goto out; - if (ntfs_file_record_read(vol, mref, &ni->mrec, NULL)) - goto err_out; - if (!(ni->mrec->flags & MFT_RECORD_IN_USE)) { - errno = ENOENT; - goto err_out; - } - ni->mft_no = MREF(mref); - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - goto err_out; - /* Receive some basic information about inode. */ - if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED, - 0, CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (!ni->mrec->base_mft_record) - ntfs_log_perror("No STANDARD_INFORMATION in base record" - " %lld", (long long)MREF(mref)); - goto put_err_out; - } - std_info = (STANDARD_INFORMATION *)((u8 *)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - ni->flags = std_info->file_attributes; - ni->creation_time = std_info->creation_time; - ni->last_data_change_time = std_info->last_data_change_time; - ni->last_mft_change_time = std_info->last_mft_change_time; - ni->last_access_time = std_info->last_access_time; - /* JPA insert v3 extensions if present */ - /* length may be seen as 72 (v1.x) or 96 (v3.x) */ - lthle = ctx->attr->length; - if (le32_to_cpu(lthle) > sizeof(STANDARD_INFORMATION)) { - set_nino_flag(ni, v3_Extensions); - ni->owner_id = std_info->owner_id; - ni->security_id = std_info->security_id; - ni->quota_charged = std_info->quota_charged; - ni->usn = std_info->usn; - } else { - clear_nino_flag(ni, v3_Extensions); - ni->owner_id = const_cpu_to_le32(0); - ni->security_id = const_cpu_to_le32(0); - } - /* Set attribute list information. */ - olderrno = errno; - if (ntfs_attr_lookup(AT_ATTRIBUTE_LIST, AT_UNNAMED, 0, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (errno != ENOENT) - goto put_err_out; - /* Attribute list attribute does not present. */ - /* restore previous errno to avoid misinterpretation */ - errno = olderrno; - goto get_size; - } - NInoSetAttrList(ni); - l = ntfs_get_attribute_value_length(ctx->attr); - if (!l) - goto put_err_out; - if (l > 0x40000) { - errno = EIO; - ntfs_log_perror("Too large attrlist attribute (%lld), inode " - "%lld", (long long)l, (long long)MREF(mref)); - goto put_err_out; - } - ni->attr_list_size = l; - ni->attr_list = ntfs_malloc(ni->attr_list_size); - if (!ni->attr_list) - goto put_err_out; - l = ntfs_get_attribute_value(vol, ctx->attr, ni->attr_list); - if (!l) - goto put_err_out; - if (l != ni->attr_list_size) { - errno = EIO; - ntfs_log_perror("Unexpected attrlist size (%lld <> %u), inode " - "%lld", (long long)l, ni->attr_list_size, - (long long)MREF(mref)); - goto put_err_out; - } -get_size: - olderrno = errno; - if (ntfs_attr_lookup(AT_DATA, AT_UNNAMED, 0, 0, 0, NULL, 0, ctx)) { - if (errno != ENOENT) - goto put_err_out; - /* Directory or special file. */ - /* restore previous errno to avoid misinterpretation */ - errno = olderrno; - ni->data_size = ni->allocated_size = 0; - } else { - if (ctx->attr->non_resident) { - ni->data_size = sle64_to_cpu(ctx->attr->data_size); - if (ctx->attr->flags & - (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE)) - ni->allocated_size = sle64_to_cpu( - ctx->attr->compressed_size); - else - ni->allocated_size = sle64_to_cpu( - ctx->attr->allocated_size); - } else { - ni->data_size = le32_to_cpu(ctx->attr->value_length); - ni->allocated_size = (ni->data_size + 7) & ~7; - } - set_nino_flag(ni,KnownSize); - } - ntfs_attr_put_search_ctx(ctx); -out: - ntfs_log_leave("\n"); - return ni; - -put_err_out: - ntfs_attr_put_search_ctx(ctx); -err_out: - __ntfs_inode_release(ni); - ni = NULL; - goto out; -} - -/** - * ntfs_inode_close - close an ntfs inode and free all associated memory - * @ni: ntfs inode to close - * - * Make sure the ntfs inode @ni is clean. - * - * If the ntfs inode @ni is a base inode, close all associated extent inodes, - * then deallocate all memory attached to it, and finally free the ntfs inode - * structure itself. - * - * If it is an extent inode, we disconnect it from its base inode before we - * destroy it. - * - * It is OK to pass NULL to this function, it is just noop in this case. - * - * Return 0 on success or -1 on error with errno set to the error code. On - * error, @ni has not been freed. The user should attempt to handle the error - * and call ntfs_inode_close() again. The following error codes are defined: - * - * EBUSY @ni and/or its attribute list runlist is/are dirty and the - * attempt to write it/them to disk failed. - * EINVAL @ni is invalid (probably it is an extent inode). - * EIO I/O error while trying to write inode to disk. - */ - -int ntfs_inode_real_close(ntfs_inode *ni) -{ - int ret = -1; - - if (!ni) - return 0; - - ntfs_log_enter("Entering for inode %lld\n", (long long)ni->mft_no); - - /* If we have dirty metadata, write it out. */ - if (NInoDirty(ni) || NInoAttrListDirty(ni)) { - if (ntfs_inode_sync(ni)) { - if (errno != EIO) - errno = EBUSY; - goto err; - } - } - /* Is this a base inode with mapped extent inodes? */ - if (ni->nr_extents > 0) { - while (ni->nr_extents > 0) { - if (ntfs_inode_real_close(ni->extent_nis[0])) { - if (errno != EIO) - errno = EBUSY; - goto err; - } - } - } else if (ni->nr_extents == -1) { - ntfs_inode **tmp_nis; - ntfs_inode *base_ni; - s32 i; - - /* - * If the inode is an extent inode, disconnect it from the - * base inode before destroying it. - */ - base_ni = ni->base_ni; - for (i = 0; i < base_ni->nr_extents; ++i) { - tmp_nis = base_ni->extent_nis; - if (tmp_nis[i] != ni) - continue; - /* Found it. Disconnect. */ - memmove(tmp_nis + i, tmp_nis + i + 1, - (base_ni->nr_extents - i - 1) * - sizeof(ntfs_inode *)); - /* Buffer should be for multiple of four extents. */ - if ((--base_ni->nr_extents) & 3) { - i = -1; - break; - } - /* - * ElectricFence is unhappy with realloc(x,0) as free(x) - * thus we explicitly separate these two cases. - */ - if (base_ni->nr_extents) { - /* Resize the memory buffer. */ - tmp_nis = realloc(tmp_nis, base_ni->nr_extents * - sizeof(ntfs_inode *)); - /* Ignore errors, they don't really matter. */ - if (tmp_nis) - base_ni->extent_nis = tmp_nis; - } else if (tmp_nis) { - free(tmp_nis); - base_ni->extent_nis = (ntfs_inode**)NULL; - } - /* Allow for error checking. */ - i = -1; - break; - } - - /* - * We could successfully sync, so only log this error - * and try to sync other inode extents too. - */ - if (i != -1) - ntfs_log_error("Extent inode %lld was not found\n", - (long long)ni->mft_no); - } - - __ntfs_inode_release(ni); - ret = 0; -err: - ntfs_log_leave("\n"); - return ret; -} - -#if CACHE_NIDATA_SIZE - -/* - * Free an inode structure when there is not more space - * in the cache - */ - -void ntfs_inode_nidata_free(const struct CACHED_GENERIC *cached) -{ - ntfs_inode_real_close(((const struct CACHED_NIDATA*)cached)->ni); -} - -/* - * Compute a hash value for an inode entry - */ - -int ntfs_inode_nidata_hash(const struct CACHED_GENERIC *item) -{ - return (((const struct CACHED_NIDATA*)item)->inum - % (2*CACHE_NIDATA_SIZE)); -} - -/* - * inum comparing for entering/fetching from cache - */ - -static int idata_cache_compare(const struct CACHED_GENERIC *cached, - const struct CACHED_GENERIC *wanted) -{ - return (((const struct CACHED_NIDATA*)cached)->inum - != ((const struct CACHED_NIDATA*)wanted)->inum); -} - -/* - * Invalidate an inode entry when not needed anymore. - * The entry should have been synced, it may be reused later, - * if it is requested before it is dropped from cache. - */ - -void ntfs_inode_invalidate(ntfs_volume *vol, const MFT_REF mref) -{ - struct CACHED_NIDATA item; - int count; - - item.inum = MREF(mref); - item.ni = (ntfs_inode*)NULL; - item.pathname = (const char*)NULL; - item.varsize = 0; - count = ntfs_invalidate_cache(vol->nidata_cache, - GENERIC(&item),idata_cache_compare,CACHE_FREE); -} - -#endif - -/* - * Open an inode - * - * When possible, an entry recorded in the cache is reused - * - * **NEVER REOPEN** an inode, this can lead to a duplicated - * cache entry (hard to detect), and to an obsolete one being - * reused. System files are however protected from being cached. - */ - -ntfs_inode *ntfs_inode_open(ntfs_volume *vol, const MFT_REF mref) -{ - ntfs_inode *ni; -#if CACHE_NIDATA_SIZE - struct CACHED_NIDATA item; - struct CACHED_NIDATA *cached; - - /* fetch idata from cache */ - item.inum = MREF(mref); - debug_double_inode(item.inum,1); - item.pathname = (const char*)NULL; - item.varsize = 0; - cached = (struct CACHED_NIDATA*)ntfs_fetch_cache(vol->nidata_cache, - GENERIC(&item),idata_cache_compare); - if (cached) { - ni = cached->ni; - /* do not keep open entries in cache */ - ntfs_remove_cache(vol->nidata_cache, - (struct CACHED_GENERIC*)cached,0); - } else { - ni = ntfs_inode_real_open(vol, mref); - } -#else - ni = ntfs_inode_real_open(vol, mref); -#endif - return (ni); -} - -/* - * Close an inode entry - * - * If cacheing is in use, the entry is synced and kept available - * in cache for further use. - * - * System files (inode < 16 or having the IS_4 flag) are protected - * against being cached. - */ - -int ntfs_inode_close(ntfs_inode *ni) -{ - int res; -#if CACHE_NIDATA_SIZE - BOOL dirty; - struct CACHED_NIDATA item; - - if (ni) { - debug_double_inode(ni->mft_no,0); - /* do not cache system files : could lead to double entries */ - if (ni->vol && ni->vol->nidata_cache - && ((ni->mft_no == FILE_root) - || ((ni->mft_no >= FILE_first_user) - && !(ni->mrec->flags & MFT_RECORD_IS_4)))) { - /* If we have dirty metadata, write it out. */ - dirty = NInoDirty(ni) || NInoAttrListDirty(ni); - if (dirty) { - res = ntfs_inode_sync(ni); - /* do a real close if sync failed */ - if (res) - ntfs_inode_real_close(ni); - } else - res = 0; - - if (!res) { - /* feed idata into cache */ - item.inum = ni->mft_no; - item.ni = ni; - item.pathname = (const char*)NULL; - item.varsize = 0; - debug_cached_inode(ni); - ntfs_enter_cache(ni->vol->nidata_cache, - GENERIC(&item), idata_cache_compare); - } - } else { - /* cache not ready or system file, really close */ - res = ntfs_inode_real_close(ni); - } - } else - res = 0; -#else - res = ntfs_inode_real_close(ni); -#endif - return (res); -} - -/** - * ntfs_extent_inode_open - load an extent inode and attach it to its base - * @base_ni: base ntfs inode - * @mref: mft reference of the extent inode to load (in little endian) - * - * First check if the extent inode @mref is already attached to the base ntfs - * inode @base_ni, and if so, return a pointer to the attached extent inode. - * - * If the extent inode is not already attached to the base inode, allocate an - * ntfs_inode structure and initialize it for the given inode @mref. @mref - * specifies the inode number / mft record to read, including the sequence - * number, which can be 0 if no sequence number checking is to be performed. - * - * Then, allocate a buffer for the mft record, read the mft record from the - * volume @base_ni->vol, and attach it to the ntfs_inode structure (->mrec). - * The mft record is mst deprotected and sanity checked for validity and we - * abort if deprotection or checks fail. - * - * Finally attach the ntfs inode to its base inode @base_ni and return a - * pointer to the ntfs_inode structure on success or NULL on error, with errno - * set to the error code. - * - * Note, extent inodes are never closed directly. They are automatically - * disposed off by the closing of the base inode. - */ -ntfs_inode *ntfs_extent_inode_open(ntfs_inode *base_ni, const MFT_REF mref) -{ - u64 mft_no = MREF_LE(mref); - ntfs_inode *ni = NULL; - ntfs_inode **extent_nis; - int i; - - if (!base_ni) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return NULL; - } - - ntfs_log_enter("Opening extent inode %lld (base mft record %lld).\n", - (unsigned long long)mft_no, - (unsigned long long)base_ni->mft_no); - - /* Is the extent inode already open and attached to the base inode? */ - if (base_ni->nr_extents > 0) { - extent_nis = base_ni->extent_nis; - for (i = 0; i < base_ni->nr_extents; i++) { - u16 seq_no; - - ni = extent_nis[i]; - if (mft_no != ni->mft_no) - continue; - /* Verify the sequence number if given. */ - seq_no = MSEQNO_LE(mref); - if (seq_no && seq_no != le16_to_cpu( - ni->mrec->sequence_number)) { - errno = EIO; - ntfs_log_perror("Found stale extent mft " - "reference mft=%lld", - (long long)ni->mft_no); - goto out; - } - goto out; - } - } - /* Wasn't there, we need to load the extent inode. */ - ni = __ntfs_inode_allocate(base_ni->vol); - if (!ni) - goto out; - if (ntfs_file_record_read(base_ni->vol, le64_to_cpu(mref), &ni->mrec, NULL)) - goto err_out; - ni->mft_no = mft_no; - ni->nr_extents = -1; - ni->base_ni = base_ni; - /* Attach extent inode to base inode, reallocating memory if needed. */ - if (!(base_ni->nr_extents & 3)) { - i = (base_ni->nr_extents + 4) * sizeof(ntfs_inode *); - - extent_nis = ntfs_malloc(i); - if (!extent_nis) - goto err_out; - if (base_ni->nr_extents) { - memcpy(extent_nis, base_ni->extent_nis, - i - 4 * sizeof(ntfs_inode *)); - free(base_ni->extent_nis); - } - base_ni->extent_nis = extent_nis; - } - base_ni->extent_nis[base_ni->nr_extents++] = ni; -out: - ntfs_log_leave("\n"); - return ni; -err_out: - __ntfs_inode_release(ni); - ni = NULL; - goto out; -} - -/** - * ntfs_inode_attach_all_extents - attach all extents for target inode - * @ni: opened ntfs inode for which perform attach - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -int ntfs_inode_attach_all_extents(ntfs_inode *ni) -{ - ATTR_LIST_ENTRY *ale; - u64 prev_attached = 0; - - if (!ni) { - ntfs_log_trace("Invalid arguments.\n"); - errno = EINVAL; - return -1; - } - - if (ni->nr_extents == -1) - ni = ni->base_ni; - - ntfs_log_trace("Entering for inode 0x%llx.\n", (long long) ni->mft_no); - - /* Inode haven't got attribute list, thus nothing to attach. */ - if (!NInoAttrList(ni)) - return 0; - - if (!ni->attr_list) { - ntfs_log_trace("Corrupt in-memory struct.\n"); - errno = EINVAL; - return -1; - } - - /* Walk through attribute list and attach all extents. */ - errno = 0; - ale = (ATTR_LIST_ENTRY *)ni->attr_list; - while ((u8*)ale < ni->attr_list + ni->attr_list_size) { - if (ni->mft_no != MREF_LE(ale->mft_reference) && - prev_attached != MREF_LE(ale->mft_reference)) { - if (!ntfs_extent_inode_open(ni, ale->mft_reference)) { - ntfs_log_trace("Couldn't attach extent inode.\n"); - return -1; - } - prev_attached = MREF_LE(ale->mft_reference); - } - ale = (ATTR_LIST_ENTRY *)((u8*)ale + le16_to_cpu(ale->length)); - } - return 0; -} - -/** - * ntfs_inode_sync_standard_information - update standard information attribute - * @ni: ntfs inode to update standard information - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -static int ntfs_inode_sync_standard_information(ntfs_inode *ni) -{ - ntfs_attr_search_ctx *ctx; - STANDARD_INFORMATION *std_info; - u32 lth; - le32 lthle; - - ntfs_log_trace("Entering for inode %lld\n", (long long)ni->mft_no); - - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return -1; - if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED, - 0, CASE_SENSITIVE, 0, NULL, 0, ctx)) { - ntfs_log_perror("Failed to sync standard info (inode %lld)", - (long long)ni->mft_no); - ntfs_attr_put_search_ctx(ctx); - return -1; - } - std_info = (STANDARD_INFORMATION *)((u8 *)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - std_info->file_attributes = ni->flags; - if (!test_nino_flag(ni, TimesSet)) { - std_info->creation_time = ni->creation_time; - std_info->last_data_change_time = ni->last_data_change_time; - std_info->last_mft_change_time = ni->last_mft_change_time; - std_info->last_access_time = ni->last_access_time; - } - - /* JPA update v3.x extensions, ensuring consistency */ - - lthle = ctx->attr->length; - lth = le32_to_cpu(lthle); - if (test_nino_flag(ni, v3_Extensions) - && (lth <= sizeof(STANDARD_INFORMATION))) - ntfs_log_error("bad sync of standard information\n"); - - if (lth > sizeof(STANDARD_INFORMATION)) { - std_info->owner_id = ni->owner_id; - std_info->security_id = ni->security_id; - std_info->quota_charged = ni->quota_charged; - std_info->usn = ni->usn; - } - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - return 0; -} - -/** - * ntfs_inode_sync_file_name - update FILE_NAME attributes - * @ni: ntfs inode to update FILE_NAME attributes - * - * Update all FILE_NAME attributes for inode @ni in the index. - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -static int ntfs_inode_sync_file_name(ntfs_inode *ni, ntfs_inode *dir_ni) -{ - ntfs_attr_search_ctx *ctx = NULL; - ntfs_index_context *ictx; - ntfs_inode *index_ni; - FILE_NAME_ATTR *fn; - FILE_NAME_ATTR *fnx; - REPARSE_POINT *rpp; - le32 reparse_tag; - int err = 0; - - ntfs_log_trace("Entering for inode %lld\n", (long long)ni->mft_no); - - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) { - err = errno; - goto err_out; - } - /* Collect the reparse tag, if any */ - reparse_tag = cpu_to_le32(0); - if (ni->flags & FILE_ATTR_REPARSE_POINT) { - if (!ntfs_attr_lookup(AT_REPARSE_POINT, NULL, - 0, CASE_SENSITIVE, 0, NULL, 0, ctx)) { - rpp = (REPARSE_POINT*)((u8 *)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - reparse_tag = rpp->reparse_tag; - } - ntfs_attr_reinit_search_ctx(ctx); - } - /* Walk through all FILE_NAME attributes and update them. */ - while (!ntfs_attr_lookup(AT_FILE_NAME, NULL, 0, 0, 0, NULL, 0, ctx)) { - fn = (FILE_NAME_ATTR *)((u8 *)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - if (MREF_LE(fn->parent_directory) == ni->mft_no) { - /* - * WARNING: We cheat here and obtain 2 attribute - * search contexts for one inode (first we obtained - * above, second will be obtained inside - * ntfs_index_lookup), it's acceptable for library, - * but will deadlock in the kernel. - */ - index_ni = ni; - } else - if (dir_ni) - index_ni = dir_ni; - else - index_ni = ntfs_inode_open(ni->vol, - le64_to_cpu(fn->parent_directory)); - if (!index_ni) { - if (!err) - err = errno; - ntfs_log_perror("Failed to open inode %lld with index", - (long long)le64_to_cpu(fn->parent_directory)); - continue; - } - ictx = ntfs_index_ctx_get(index_ni, NTFS_INDEX_I30, 4); - if (!ictx) { - if (!err) - err = errno; - ntfs_log_perror("Failed to get index ctx, inode %lld", - (long long)index_ni->mft_no); - if ((ni != index_ni) && !dir_ni - && ntfs_inode_close(index_ni) && !err) - err = errno; - continue; - } - if (ntfs_index_lookup(fn, sizeof(FILE_NAME_ATTR), ictx)) { - if (!err) { - if (errno == ENOENT) - err = EIO; - else - err = errno; - } - ntfs_log_perror("Index lookup failed, inode %lld", - (long long)index_ni->mft_no); - ntfs_index_ctx_put(ictx); - if (ni != index_ni && ntfs_inode_close(index_ni) && !err) - err = errno; - continue; - } - /* Update flags and file size. */ - fnx = (FILE_NAME_ATTR *)ictx->data; - fnx->file_attributes = - (fnx->file_attributes & ~FILE_ATTR_VALID_FLAGS) | - (ni->flags & FILE_ATTR_VALID_FLAGS); - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - fnx->data_size = fnx->allocated_size - = const_cpu_to_le64(0); - else { - fnx->allocated_size = cpu_to_sle64(ni->allocated_size); - fnx->data_size = cpu_to_sle64(ni->data_size); - } - /* update or clear the reparse tag in the index */ - fnx->reparse_point_tag = reparse_tag; - if (!test_nino_flag(ni, TimesSet)) { - fnx->creation_time = ni->creation_time; - fnx->last_data_change_time = ni->last_data_change_time; - fnx->last_mft_change_time = ni->last_mft_change_time; - fnx->last_access_time = ni->last_access_time; - } else { - fnx->creation_time = fn->creation_time; - fnx->last_data_change_time = fn->last_data_change_time; - fnx->last_mft_change_time = fn->last_mft_change_time; - fnx->last_access_time = fn->last_access_time; - } - ntfs_index_entry_mark_dirty(ictx); - ntfs_index_ctx_put(ictx); - if ((ni != index_ni) && !dir_ni - && ntfs_inode_close(index_ni) && !err) - err = errno; - } - /* Check for real error occurred. */ - if (errno != ENOENT) { - err = errno; - ntfs_log_perror("Attribute lookup failed, inode %lld", - (long long)ni->mft_no); - goto err_out; - } - ntfs_attr_put_search_ctx(ctx); - if (err) { - errno = err; - return -1; - } - return 0; -err_out: - if (ctx) - ntfs_attr_put_search_ctx(ctx); - errno = err; - return -1; -} - -/** - * ntfs_inode_sync - write the inode (and its dirty extents) to disk - * @ni: ntfs inode to write - * - * Write the inode @ni to disk as well as its dirty extent inodes if such - * exist and @ni is a base inode. If @ni is an extent inode, only @ni is - * written completely disregarding its base inode and any other extent inodes. - * - * For a base inode with dirty extent inodes if any writes fail for whatever - * reason, the failing inode is skipped and the sync process is continued. At - * the end the error condition that brought about the failure is returned. Thus - * the smallest amount of data loss possible occurs. - * - * Return 0 on success or -1 on error with errno set to the error code. - * The following error codes are defined: - * EINVAL - Invalid arguments were passed to the function. - * EBUSY - Inode and/or one of its extents is busy, try again later. - * EIO - I/O error while writing the inode (or one of its extents). - */ -static int ntfs_inode_sync_in_dir(ntfs_inode *ni, ntfs_inode *dir_ni) -{ - int ret = 0; - int err = 0; - if (!ni) { - errno = EINVAL; - ntfs_log_error("Failed to sync NULL inode\n"); - return -1; - } - - ntfs_log_enter("Entering for inode %lld\n", (long long)ni->mft_no); - - /* Update STANDARD_INFORMATION. */ - if ((ni->mrec->flags & MFT_RECORD_IN_USE) && ni->nr_extents != -1 && - ntfs_inode_sync_standard_information(ni)) { - if (!err || errno == EIO) { - err = errno; - if (err != EIO) - err = EBUSY; - } - } - - /* Update FILE_NAME's in the index. */ - if ((ni->mrec->flags & MFT_RECORD_IN_USE) && ni->nr_extents != -1 && - NInoFileNameTestAndClearDirty(ni) && - ntfs_inode_sync_file_name(ni, dir_ni)) { - if (!err || errno == EIO) { - err = errno; - if (err != EIO) - err = EBUSY; - } - ntfs_log_perror("Failed to sync FILE_NAME (inode %lld)", - (long long)ni->mft_no); - NInoFileNameSetDirty(ni); - } - - /* Write out attribute list from cache to disk. */ - if ((ni->mrec->flags & MFT_RECORD_IN_USE) && ni->nr_extents != -1 && - NInoAttrList(ni) && NInoAttrListTestAndClearDirty(ni)) { - ntfs_attr *na; - - na = ntfs_attr_open(ni, AT_ATTRIBUTE_LIST, AT_UNNAMED, 0); - if (!na) { - if (!err || errno == EIO) { - err = errno; - if (err != EIO) - err = EBUSY; - ntfs_log_perror("Attribute list sync failed " - "(open, inode %lld)", - (long long)ni->mft_no); - } - NInoAttrListSetDirty(ni); - goto sync_inode; - } - - if (na->data_size == ni->attr_list_size) { - if (ntfs_attr_pwrite(na, 0, ni->attr_list_size, - ni->attr_list) != ni->attr_list_size) { - if (!err || errno == EIO) { - err = errno; - if (err != EIO) - err = EBUSY; - ntfs_log_perror("Attribute list sync " - "failed (write, inode %lld)", - (long long)ni->mft_no); - } - NInoAttrListSetDirty(ni); - } - } else { - err = EIO; - ntfs_log_error("Attribute list sync failed (bad size, " - "inode %lld)\n", (long long)ni->mft_no); - NInoAttrListSetDirty(ni); - } - ntfs_attr_close(na); - } - -sync_inode: - /* Write this inode out to the $MFT (and $MFTMirr if applicable). */ - if (NInoTestAndClearDirty(ni)) { - if (ntfs_mft_record_write(ni->vol, ni->mft_no, ni->mrec)) { - if (!err || errno == EIO) { - err = errno; - if (err != EIO) - err = EBUSY; - } - NInoSetDirty(ni); - ntfs_log_perror("MFT record sync failed, inode %lld", - (long long)ni->mft_no); - } - } - - /* If this is a base inode with extents write all dirty extents, too. */ - if (ni->nr_extents > 0) { - s32 i; - - for (i = 0; i < ni->nr_extents; ++i) { - ntfs_inode *eni; - - eni = ni->extent_nis[i]; - if (!NInoTestAndClearDirty(eni)) - continue; - - if (ntfs_mft_record_write(eni->vol, eni->mft_no, - eni->mrec)) { - if (!err || errno == EIO) { - err = errno; - if (err != EIO) - err = EBUSY; - } - NInoSetDirty(eni); - ntfs_log_perror("Extent MFT record sync failed," - " inode %lld/%lld", - (long long)ni->mft_no, - (long long)eni->mft_no); - } - } - } - - if (err) { - errno = err; - ret = -1; - } - - ntfs_log_leave("\n"); - return ret; -} - -int ntfs_inode_sync(ntfs_inode *ni) -{ - return (ntfs_inode_sync_in_dir(ni, (ntfs_inode*)NULL)); -} - -/* - * Close an inode with an open parent inode - */ - -int ntfs_inode_close_in_dir(ntfs_inode *ni, ntfs_inode *dir_ni) -{ - int res; - - res = ntfs_inode_sync_in_dir(ni, dir_ni); - if (res) { - if (errno != EIO) - errno = EBUSY; - } else - res = ntfs_inode_close(ni); - return (res); -} - -/** - * ntfs_inode_add_attrlist - add attribute list to inode and fill it - * @ni: opened ntfs inode to which add attribute list - * - * Return 0 on success or -1 on error with errno set to the error code. - * The following error codes are defined: - * EINVAL - Invalid arguments were passed to the function. - * EEXIST - Attribute list already exist. - * EIO - Input/Ouput error occurred. - * ENOMEM - Not enough memory to perform add. - */ -int ntfs_inode_add_attrlist(ntfs_inode *ni) -{ - int err; - ntfs_attr_search_ctx *ctx; - u8 *al = NULL, *aln; - int al_len = 0; - ATTR_LIST_ENTRY *ale = NULL; - ntfs_attr *na; - - if (!ni) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return -1; - } - - ntfs_log_trace("inode %llu\n", (unsigned long long) ni->mft_no); - - if (NInoAttrList(ni) || ni->nr_extents) { - errno = EEXIST; - ntfs_log_perror("Inode already has attribute list"); - return -1; - } - - /* Form attribute list. */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) { - err = errno; - goto err_out; - } - /* Walk through all attributes. */ - while (!ntfs_attr_lookup(AT_UNUSED, NULL, 0, 0, 0, NULL, 0, ctx)) { - - int ale_size; - - if (ctx->attr->type == AT_ATTRIBUTE_LIST) { - err = EIO; - ntfs_log_perror("Attribute list already present"); - goto put_err_out; - } - - ale_size = (sizeof(ATTR_LIST_ENTRY) + sizeof(ntfschar) * - ctx->attr->name_length + 7) & ~7; - al_len += ale_size; - - aln = realloc(al, al_len); - if (!aln) { - err = errno; - ntfs_log_perror("Failed to realloc %d bytes", al_len); - goto put_err_out; - } - ale = (ATTR_LIST_ENTRY *)(aln + ((u8 *)ale - al)); - al = aln; - - memset(ale, 0, ale_size); - - /* Add attribute to attribute list. */ - ale->type = ctx->attr->type; - ale->length = cpu_to_le16((sizeof(ATTR_LIST_ENTRY) + - sizeof(ntfschar) * ctx->attr->name_length + 7) & ~7); - ale->name_length = ctx->attr->name_length; - ale->name_offset = (u8 *)ale->name - (u8 *)ale; - if (ctx->attr->non_resident) - ale->lowest_vcn = ctx->attr->lowest_vcn; - else - ale->lowest_vcn = 0; - ale->mft_reference = MK_LE_MREF(ni->mft_no, - le16_to_cpu(ni->mrec->sequence_number)); - ale->instance = ctx->attr->instance; - memcpy(ale->name, (u8 *)ctx->attr + - le16_to_cpu(ctx->attr->name_offset), - ctx->attr->name_length * sizeof(ntfschar)); - ale = (ATTR_LIST_ENTRY *)(al + al_len); - } - /* Check for real error occurred. */ - if (errno != ENOENT) { - err = errno; - ntfs_log_perror("%s: Attribute lookup failed, inode %lld", - __FUNCTION__, (long long)ni->mft_no); - goto put_err_out; - } - - /* Set in-memory attribute list. */ - ni->attr_list = al; - ni->attr_list_size = al_len; - NInoSetAttrList(ni); - NInoAttrListSetDirty(ni); - - /* Free space if there is not enough it for $ATTRIBUTE_LIST. */ - if (le32_to_cpu(ni->mrec->bytes_allocated) - - le32_to_cpu(ni->mrec->bytes_in_use) < - offsetof(ATTR_RECORD, resident_end)) { - if (ntfs_inode_free_space(ni, - offsetof(ATTR_RECORD, resident_end))) { - /* Failed to free space. */ - err = errno; - ntfs_log_perror("Failed to free space for attrlist"); - goto rollback; - } - } - - /* Add $ATTRIBUTE_LIST to mft record. */ - if (ntfs_resident_attr_record_add(ni, - AT_ATTRIBUTE_LIST, NULL, 0, NULL, 0, 0) < 0) { - err = errno; - ntfs_log_perror("Couldn't add $ATTRIBUTE_LIST to MFT"); - goto rollback; - } - - /* Resize it. */ - na = ntfs_attr_open(ni, AT_ATTRIBUTE_LIST, AT_UNNAMED, 0); - if (!na) { - err = errno; - ntfs_log_perror("Failed to open just added $ATTRIBUTE_LIST"); - goto remove_attrlist_record; - } - if (ntfs_attr_truncate(na, al_len)) { - err = errno; - ntfs_log_perror("Failed to resize just added $ATTRIBUTE_LIST"); - ntfs_attr_close(na); - goto remove_attrlist_record;; - } - - ntfs_attr_put_search_ctx(ctx); - ntfs_attr_close(na); - return 0; - -remove_attrlist_record: - /* Prevent ntfs_attr_recorm_rm from freeing attribute list. */ - ni->attr_list = NULL; - NInoClearAttrList(ni); - /* Remove $ATTRIBUTE_LIST record. */ - ntfs_attr_reinit_search_ctx(ctx); - if (!ntfs_attr_lookup(AT_ATTRIBUTE_LIST, NULL, 0, - CASE_SENSITIVE, 0, NULL, 0, ctx)) { - if (ntfs_attr_record_rm(ctx)) - ntfs_log_perror("Rollback failed to remove attrlist"); - } else - ntfs_log_perror("Rollback failed to find attrlist"); - /* Setup back in-memory runlist. */ - ni->attr_list = al; - ni->attr_list_size = al_len; - NInoSetAttrList(ni); -rollback: - /* - * Scan attribute list for attributes that placed not in the base MFT - * record and move them to it. - */ - ntfs_attr_reinit_search_ctx(ctx); - ale = (ATTR_LIST_ENTRY*)al; - while ((u8*)ale < al + al_len) { - if (MREF_LE(ale->mft_reference) != ni->mft_no) { - if (!ntfs_attr_lookup(ale->type, ale->name, - ale->name_length, - CASE_SENSITIVE, - sle64_to_cpu(ale->lowest_vcn), - NULL, 0, ctx)) { - if (ntfs_attr_record_move_to(ctx, ni)) - ntfs_log_perror("Rollback failed to " - "move attribute"); - } else - ntfs_log_perror("Rollback failed to find attr"); - ntfs_attr_reinit_search_ctx(ctx); - } - ale = (ATTR_LIST_ENTRY*)((u8*)ale + le16_to_cpu(ale->length)); - } - /* Remove in-memory attribute list. */ - ni->attr_list = NULL; - ni->attr_list_size = 0; - NInoClearAttrList(ni); - NInoAttrListClearDirty(ni); -put_err_out: - ntfs_attr_put_search_ctx(ctx); -err_out: - free(al); - errno = err; - return -1; -} - -/** - * ntfs_inode_free_space - free space in the MFT record of an inode - * @ni: ntfs inode in which MFT record needs more free space - * @size: amount of space needed to free - * - * Return 0 on success or -1 on error with errno set to the error code. - */ -int ntfs_inode_free_space(ntfs_inode *ni, int size) -{ - ntfs_attr_search_ctx *ctx; - int freed; - - if (!ni || size < 0) { - errno = EINVAL; - ntfs_log_perror("%s: ni=%p size=%d", __FUNCTION__, ni, size); - return -1; - } - - ntfs_log_trace("Entering for inode %lld, size %d\n", - (unsigned long long)ni->mft_no, size); - - freed = (le32_to_cpu(ni->mrec->bytes_allocated) - - le32_to_cpu(ni->mrec->bytes_in_use)); - - if (size <= freed) - return 0; - - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (!ctx) - return -1; - /* - * $STANDARD_INFORMATION and $ATTRIBUTE_LIST must stay in the base MFT - * record, so position search context on the first attribute after them. - */ - if (ntfs_attr_position(AT_FILE_NAME, ctx)) - goto put_err_out; - - while (1) { - int record_size; - /* - * Check whether attribute is from different MFT record. If so, - * find next, because we don't need such. - */ - while (ctx->ntfs_ino->mft_no != ni->mft_no) { -retry: - if (ntfs_attr_position(AT_UNUSED, ctx)) - goto put_err_out; - } - - if (ntfs_inode_base(ctx->ntfs_ino)->mft_no == FILE_MFT && - ctx->attr->type == AT_DATA) - goto retry; - - if (ctx->attr->type == AT_INDEX_ROOT) - goto retry; - - record_size = le32_to_cpu(ctx->attr->length); - - if (ntfs_attr_record_move_away(ctx, 0)) { - ntfs_log_perror("Failed to move out attribute #2"); - break; - } - freed += record_size; - - /* Check whether we are done. */ - if (size <= freed) { - ntfs_attr_put_search_ctx(ctx); - return 0; - } - /* - * Reposition to first attribute after $STANDARD_INFORMATION - * and $ATTRIBUTE_LIST instead of simply skipping this attribute - * because in the case when we have got only in-memory attribute - * list then ntfs_attr_lookup will fail when it tries to find - * $ATTRIBUTE_LIST. - */ - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_position(AT_FILE_NAME, ctx)) - break; - } -put_err_out: - ntfs_attr_put_search_ctx(ctx); - if (errno == ENOSPC) - ntfs_log_trace("No attributes left that could be moved out.\n"); - return -1; -} - -/** - * ntfs_inode_update_times - update selected time fields for ntfs inode - * @ni: ntfs inode for which update time fields - * @mask: select which time fields should be updated - * - * This function updates time fields to current time. Fields to update are - * selected using @mask (see enum @ntfs_time_update_flags for posssible values). - */ -void ntfs_inode_update_times(ntfs_inode *ni, ntfs_time_update_flags mask) -{ - ntfs_time now; - - if (!ni) { - ntfs_log_error("%s(): Invalid arguments.\n", __FUNCTION__); - return; - } - - if ((ni->mft_no < FILE_first_user && ni->mft_no != FILE_root) || - NVolReadOnly(ni->vol) || !mask) - return; - - now = ntfs_current_time(); - if (mask & NTFS_UPDATE_ATIME) - ni->last_access_time = now; - if (mask & NTFS_UPDATE_MTIME) - ni->last_data_change_time = now; - if (mask & NTFS_UPDATE_CTIME) - ni->last_mft_change_time = now; - - NInoFileNameSetDirty(ni); - NInoSetDirty(ni); -} - -/** - * ntfs_inode_badclus_bad - check for $Badclus:$Bad data attribute - * @mft_no: mft record number where @attr is present - * @attr: attribute record used to check for the $Bad attribute - * - * Check if the mft record given by @mft_no and @attr contains the bad sector - * list. Please note that mft record numbers describing $Badclus extent inodes - * will not match the current $Badclus:$Bad check. - * - * On success return 1 if the file is $Badclus:$Bad, otherwise return 0. - * On error return -1 with errno set to the error code. - */ -int ntfs_inode_badclus_bad(u64 mft_no, ATTR_RECORD *attr) -{ - int len, ret = 0; - ntfschar *ustr; - - if (!attr) { - ntfs_log_error("Invalid argument.\n"); - errno = EINVAL; - return -1; - } - - if (mft_no != FILE_BadClus) - return 0; - - if (attr->type != AT_DATA) - return 0; - - if ((ustr = ntfs_str2ucs("$Bad", &len)) == NULL) { - ntfs_log_perror("Couldn't convert '$Bad' to Unicode"); - return -1; - } - - if (ustr && ntfs_names_are_equal(ustr, len, - (ntfschar *)((u8 *)attr + le16_to_cpu(attr->name_offset)), - attr->name_length, 0, NULL, 0)) - ret = 1; - - ntfs_ucsfree(ustr); - - return ret; -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Get high precision NTFS times - * - * They are returned in following order : create, update, access, change - * provided they fit in requested size. - * - * Returns the modified size if successfull (or 32 if buffer size is null) - * -errno if failed - */ - -int ntfs_inode_get_times(ntfs_inode *ni, char *value, size_t size) -{ - ntfs_attr_search_ctx *ctx; - STANDARD_INFORMATION *std_info; - u64 *times; - int ret; - - ret = 0; - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (ctx) { - if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED, - 0, CASE_SENSITIVE, 0, NULL, 0, ctx)) { - ntfs_log_perror("Failed to get standard info (inode %lld)", - (long long)ni->mft_no); - } else { - std_info = (STANDARD_INFORMATION *)((u8 *)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - if (value && (size >= 8)) { - times = (u64*)value; - times[0] = le64_to_cpu(std_info->creation_time); - ret = 8; - if (size >= 16) { - times[1] = le64_to_cpu(std_info->last_data_change_time); - ret = 16; - } - if (size >= 24) { - times[2] = le64_to_cpu(std_info->last_access_time); - ret = 24; - } - if (size >= 32) { - times[3] = le64_to_cpu(std_info->last_mft_change_time); - ret = 32; - } - } else - if (!size) - ret = 32; - else - ret = -ERANGE; - } - ntfs_attr_put_search_ctx(ctx); - } - return (ret ? ret : -errno); -} - -/* - * Set high precision NTFS times - * - * They are expected in this order : create, update, access - * provided they are present in input. The change time is set to - * current time. - * - * The times are inserted directly in the standard_information and - * file names attributes to avoid manipulating low precision times - * - * Returns 0 if success - * -1 if there were an error (described by errno) - */ - -int ntfs_inode_set_times(ntfs_inode *ni, const char *value, size_t size, - int flags) -{ - ntfs_attr_search_ctx *ctx; - STANDARD_INFORMATION *std_info; - FILE_NAME_ATTR *fn; - const u64 *times; - ntfs_time now; - int cnt; - int ret; - - ret = -1; - if ((size >= 8) && !(flags & XATTR_CREATE)) { - times = (const u64*)value; - now = ntfs_current_time(); - /* update the standard information attribute */ - ctx = ntfs_attr_get_search_ctx(ni, NULL); - if (ctx) { - if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, - AT_UNNAMED, 0, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - ntfs_log_perror("Failed to get standard info (inode %lld)", - (long long)ni->mft_no); - } else { - std_info = (STANDARD_INFORMATION *)((u8 *)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - /* - * Mark times set to avoid overwriting - * them when the inode is closed. - * The inode structure must also be updated - * (with loss of precision) because of cacheing. - * TODO : use NTFS precision in inode, and - * return sub-second times in getattr() - */ - set_nino_flag(ni, TimesSet); - std_info->creation_time = cpu_to_le64(times[0]); - ni->creation_time - = std_info->creation_time; - if (size >= 16) { - std_info->last_data_change_time = cpu_to_le64(times[1]); - ni->last_data_change_time - = std_info->last_data_change_time; - } - if (size >= 24) { - std_info->last_access_time = cpu_to_le64(times[2]); - ni->last_access_time - = std_info->last_access_time; - } - std_info->last_mft_change_time = now; - ni->last_mft_change_time = now; - ntfs_inode_mark_dirty(ctx->ntfs_ino); - NInoFileNameSetDirty(ni); - - /* update the file names attributes */ - ntfs_attr_reinit_search_ctx(ctx); - cnt = 0; - while (!ntfs_attr_lookup(AT_FILE_NAME, - AT_UNNAMED, 0, CASE_SENSITIVE, - 0, NULL, 0, ctx)) { - fn = (FILE_NAME_ATTR*)((u8 *)ctx->attr + - le16_to_cpu(ctx->attr->value_offset)); - fn->creation_time - = cpu_to_le64(times[0]); - if (size >= 16) - fn->last_data_change_time - = cpu_to_le64(times[1]); - if (size >= 24) - fn->last_access_time - = cpu_to_le64(times[2]); - fn->last_mft_change_time = now; - cnt++; - } - if (cnt) - ret = 0; - else { - ntfs_log_perror("Failed to get file names (inode %lld)", - (long long)ni->mft_no); - } - } - ntfs_attr_put_search_ctx(ctx); - } - } else - if (size < 8) - errno = ERANGE; - else - errno = EEXIST; - return (ret); -} - -#endif /* HAVE_SETXATTR */ diff --git a/source/libs/libntfs/inode.h b/source/libs/libntfs/inode.h deleted file mode 100644 index 5a6f7da6..00000000 --- a/source/libs/libntfs/inode.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - * inode.h - Defines for NTFS inode handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2001-2004 Anton Altaparmakov - * Copyright (c) 2004-2007 Yura Pakhuchiy - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2006-2008 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_INODE_H -#define _NTFS_INODE_H - -/* Forward declaration */ -typedef struct _ntfs_inode ntfs_inode; - -#include "types.h" -#include "layout.h" -#include "support.h" -#include "volume.h" -#include "ntfstime.h" - -/** - * enum ntfs_inode_state_bits - - * - * Defined bits for the state field in the ntfs_inode structure. - * (f) = files only, (d) = directories only - */ -typedef enum { - NI_Dirty, /* 1: Mft record needs to be written to disk. */ - - /* The NI_AttrList* tests only make sense for base inodes. */ - NI_AttrList, /* 1: Mft record contains an attribute list. */ - NI_AttrListDirty, /* 1: Attribute list needs to be written to the - mft record and then to disk. */ - NI_FileNameDirty, /* 1: FILE_NAME attributes need to be updated - in the index. */ - NI_v3_Extensions, /* 1: JPA v3.x extensions present. */ - NI_TimesSet, /* 1: Use times which were set */ - NI_KnownSize, /* 1: Set if sizes are meaningful */ -} ntfs_inode_state_bits; - -#define test_nino_flag(ni, flag) test_bit(NI_##flag, (ni)->state) -#define set_nino_flag(ni, flag) set_bit(NI_##flag, (ni)->state) -#define clear_nino_flag(ni, flag) clear_bit(NI_##flag, (ni)->state) - -#define test_and_set_nino_flag(ni, flag) \ - test_and_set_bit(NI_##flag, (ni)->state) -#define test_and_clear_nino_flag(ni, flag) \ - test_and_clear_bit(NI_##flag, (ni)->state) - -#define NInoDirty(ni) test_nino_flag(ni, Dirty) -#define NInoSetDirty(ni) set_nino_flag(ni, Dirty) -#define NInoClearDirty(ni) clear_nino_flag(ni, Dirty) -#define NInoTestAndSetDirty(ni) test_and_set_nino_flag(ni, Dirty) -#define NInoTestAndClearDirty(ni) test_and_clear_nino_flag(ni, Dirty) - -#define NInoAttrList(ni) test_nino_flag(ni, AttrList) -#define NInoSetAttrList(ni) set_nino_flag(ni, AttrList) -#define NInoClearAttrList(ni) clear_nino_flag(ni, AttrList) - - -#define test_nino_al_flag(ni, flag) test_nino_flag(ni, AttrList##flag) -#define set_nino_al_flag(ni, flag) set_nino_flag(ni, AttrList##flag) -#define clear_nino_al_flag(ni, flag) clear_nino_flag(ni, AttrList##flag) - -#define test_and_set_nino_al_flag(ni, flag) \ - test_and_set_nino_flag(ni, AttrList##flag) -#define test_and_clear_nino_al_flag(ni, flag) \ - test_and_clear_nino_flag(ni, AttrList##flag) - -#define NInoAttrListDirty(ni) test_nino_al_flag(ni, Dirty) -#define NInoAttrListSetDirty(ni) set_nino_al_flag(ni, Dirty) -#define NInoAttrListClearDirty(ni) clear_nino_al_flag(ni, Dirty) -#define NInoAttrListTestAndSetDirty(ni) test_and_set_nino_al_flag(ni, Dirty) -#define NInoAttrListTestAndClearDirty(ni) test_and_clear_nino_al_flag(ni, Dirty) - -#define NInoFileNameDirty(ni) test_nino_flag(ni, FileNameDirty) -#define NInoFileNameSetDirty(ni) set_nino_flag(ni, FileNameDirty) -#define NInoFileNameClearDirty(ni) clear_nino_flag(ni, FileNameDirty) -#define NInoFileNameTestAndSetDirty(ni) \ - test_and_set_nino_flag(ni, FileNameDirty) -#define NInoFileNameTestAndClearDirty(ni) \ - test_and_clear_nino_flag(ni, FileNameDirty) - -/** - * struct _ntfs_inode - The NTFS in-memory inode structure. - * - * It is just used as an extension to the fields already provided in the VFS - * inode. - */ -struct _ntfs_inode { - u64 mft_no; /* Inode / mft record number. */ - MFT_RECORD *mrec; /* The actual mft record of the inode. */ - ntfs_volume *vol; /* Pointer to the ntfs volume of this inode. */ - unsigned long state; /* NTFS specific flags describing this inode. - See ntfs_inode_state_bits above. */ - FILE_ATTR_FLAGS flags; /* Flags describing the file. - (Copy from STANDARD_INFORMATION) */ - /* - * Attribute list support (for use by the attribute lookup functions). - * Setup during ntfs_open_inode() for all inodes with attribute lists. - * Only valid if NI_AttrList is set in state. - */ - u32 attr_list_size; /* Length of attribute list value in bytes. */ - u8 *attr_list; /* Attribute list value itself. */ - /* Below fields are always valid. */ - s32 nr_extents; /* For a base mft record, the number of - attached extent inodes (0 if none), for - extent records this is -1. */ - union { /* This union is only used if nr_extents != 0. */ - ntfs_inode **extent_nis;/* For nr_extents > 0, array of the - ntfs inodes of the extent mft - records belonging to this base - inode which have been loaded. */ - ntfs_inode *base_ni; /* For nr_extents == -1, the ntfs - inode of the base mft record. */ - }; - - /* Below fields are valid only for base inode. */ - - /* - * These two fields are used to sync filename index and guaranteed to be - * correct, however value in index itself maybe wrong (windows itself - * do not update them properly). - * For directories, they hold the index size, provided the - * flag KnownSize is set. - */ - s64 data_size; /* Data size of unnamed DATA attribute - (or INDEX_ROOT for directories) */ - s64 allocated_size; /* Allocated size stored in the filename - index. (NOTE: Equal to allocated size of - the unnamed data attribute for normal or - encrypted files and to compressed size - of the unnamed data attribute for sparse or - compressed files.) */ - - /* - * These four fields are copy of relevant fields from - * STANDARD_INFORMATION attribute and used to sync it and FILE_NAME - * attribute in the index. - */ - ntfs_time creation_time; - ntfs_time last_data_change_time; - ntfs_time last_mft_change_time; - ntfs_time last_access_time; - /* NTFS 3.x extensions added by JPA */ - /* only if NI_v3_Extensions is set in state */ - le32 owner_id; - le32 security_id; - le64 quota_charged; - le64 usn; -}; - -typedef enum { - NTFS_UPDATE_ATIME = 1 << 0, - NTFS_UPDATE_MTIME = 1 << 1, - NTFS_UPDATE_CTIME = 1 << 2, -} ntfs_time_update_flags; - -#define NTFS_UPDATE_MCTIME (NTFS_UPDATE_MTIME | NTFS_UPDATE_CTIME) -#define NTFS_UPDATE_AMCTIME (NTFS_UPDATE_ATIME | NTFS_UPDATE_MCTIME) - -extern ntfs_inode *ntfs_inode_base(ntfs_inode *ni); - -extern ntfs_inode *ntfs_inode_allocate(ntfs_volume *vol); - -extern ntfs_inode *ntfs_inode_open(ntfs_volume *vol, const MFT_REF mref); - -extern int ntfs_inode_close(ntfs_inode *ni); -extern int ntfs_inode_close_in_dir(ntfs_inode *ni, ntfs_inode *dir_ni); - -#if CACHE_NIDATA_SIZE - -struct CACHED_GENERIC; - -extern int ntfs_inode_real_close(ntfs_inode *ni); -extern void ntfs_inode_invalidate(ntfs_volume *vol, const MFT_REF mref); -extern void ntfs_inode_nidata_free(const struct CACHED_GENERIC *cached); -extern int ntfs_inode_nidata_hash(const struct CACHED_GENERIC *item); - -#endif - - -extern ntfs_inode *ntfs_extent_inode_open(ntfs_inode *base_ni, - const MFT_REF mref); - -extern int ntfs_inode_attach_all_extents(ntfs_inode *ni); - -extern void ntfs_inode_mark_dirty(ntfs_inode *ni); - -extern void ntfs_inode_update_times(ntfs_inode *ni, ntfs_time_update_flags mask); - -extern int ntfs_inode_sync(ntfs_inode *ni); - -extern int ntfs_inode_add_attrlist(ntfs_inode *ni); - -extern int ntfs_inode_free_space(ntfs_inode *ni, int size); - -extern int ntfs_inode_badclus_bad(u64 mft_no, ATTR_RECORD *a); - -extern int ntfs_inode_get_times(ntfs_inode *ni, char *value, size_t size); - -extern int ntfs_inode_set_times(ntfs_inode *ni, const char *value, - size_t size, int flags); - -/* debugging */ -#define debug_double_inode(num, type) -#define debug_cached_inode(ni) - -#endif /* defined _NTFS_INODE_H */ diff --git a/source/libs/libntfs/layout.h b/source/libs/libntfs/layout.h deleted file mode 100644 index 8670557e..00000000 --- a/source/libs/libntfs/layout.h +++ /dev/null @@ -1,2661 +0,0 @@ -/* - * layout.h - Ntfs on-disk layout structures. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2005 Anton Altaparmakov - * Copyright (c) 2005 Yura Pakhuchiy - * Copyright (c) 2005-2006 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_LAYOUT_H -#define _NTFS_LAYOUT_H - -#include "types.h" -#include "endians.h" -#include "support.h" - -/* The NTFS oem_id */ -#define magicNTFS const_cpu_to_le64(0x202020205346544e) /* "NTFS " */ -#define NTFS_SB_MAGIC 0x5346544e /* 'NTFS' */ - -/* - * Location of bootsector on partition: - * The standard NTFS_BOOT_SECTOR is on sector 0 of the partition. - * On NT4 and above there is one backup copy of the boot sector to - * be found on the last sector of the partition (not normally accessible - * from within Windows as the bootsector contained number of sectors - * value is one less than the actual value!). - * On versions of NT 3.51 and earlier, the backup copy was located at - * number of sectors/2 (integer divide), i.e. in the middle of the volume. - */ - -/** - * struct BIOS_PARAMETER_BLOCK - BIOS parameter block (bpb) structure. - */ -typedef struct { - u16 bytes_per_sector; /* Size of a sector in bytes. */ - u8 sectors_per_cluster; /* Size of a cluster in sectors. */ - u16 reserved_sectors; /* zero */ - u8 fats; /* zero */ - u16 root_entries; /* zero */ - u16 sectors; /* zero */ - u8 media_type; /* 0xf8 = hard disk */ - u16 sectors_per_fat; /* zero */ -/*0x0d*/u16 sectors_per_track; /* Required to boot Windows. */ -/*0x0f*/u16 heads; /* Required to boot Windows. */ -/*0x11*/u32 hidden_sectors; /* Offset to the start of the partition - relative to the disk in sectors. - Required to boot Windows. */ -/*0x15*/u32 large_sectors; /* zero */ -/* sizeof() = 25 (0x19) bytes */ -} __attribute__((__packed__)) BIOS_PARAMETER_BLOCK; - -/** - * struct NTFS_BOOT_SECTOR - NTFS boot sector structure. - */ -typedef struct { - u8 jump[3]; /* Irrelevant (jump to boot up code).*/ - u64 oem_id; /* Magic "NTFS ". */ -/*0x0b*/BIOS_PARAMETER_BLOCK bpb; /* See BIOS_PARAMETER_BLOCK. */ - u8 physical_drive; /* 0x00 floppy, 0x80 hard disk */ - u8 current_head; /* zero */ - u8 extended_boot_signature; /* 0x80 */ - u8 reserved2; /* zero */ -/*0x28*/s64 number_of_sectors; /* Number of sectors in volume. Gives - maximum volume size of 2^63 sectors. - Assuming standard sector size of 512 - bytes, the maximum byte size is - approx. 4.7x10^21 bytes. (-; */ - s64 mft_lcn; /* Cluster location of mft data. */ - s64 mftmirr_lcn; /* Cluster location of copy of mft. */ - s8 clusters_per_mft_record; /* Mft record size in clusters. */ - u8 reserved0[3]; /* zero */ - s8 clusters_per_index_record; /* Index block size in clusters. */ - u8 reserved1[3]; /* zero */ - u64 volume_serial_number; /* Irrelevant (serial number). */ - u32 checksum; /* Boot sector checksum. */ -/*0x54*/u8 bootstrap[426]; /* Irrelevant (boot up code). */ - u16 end_of_sector_marker; /* End of bootsector magic. Always is - 0xaa55 in little endian. */ -/* sizeof() = 512 (0x200) bytes */ -} __attribute__((__packed__)) NTFS_BOOT_SECTOR; - -/** - * enum NTFS_RECORD_TYPES - - * - * Magic identifiers present at the beginning of all ntfs record containing - * records (like mft records for example). - */ -typedef enum { - /* Found in $MFT/$DATA. */ - magic_FILE = const_cpu_to_le32(0x454c4946), /* Mft entry. */ - magic_INDX = const_cpu_to_le32(0x58444e49), /* Index buffer. */ - magic_HOLE = const_cpu_to_le32(0x454c4f48), /* ? (NTFS 3.0+?) */ - - /* Found in $LogFile/$DATA. */ - magic_RSTR = const_cpu_to_le32(0x52545352), /* Restart page. */ - magic_RCRD = const_cpu_to_le32(0x44524352), /* Log record page. */ - - /* Found in $LogFile/$DATA. (May be found in $MFT/$DATA, also?) */ - magic_CHKD = const_cpu_to_le32(0x444b4843), /* Modified by chkdsk. */ - - /* Found in all ntfs record containing records. */ - magic_BAAD = const_cpu_to_le32(0x44414142), /* Failed multi sector - transfer was detected. */ - - /* - * Found in $LogFile/$DATA when a page is full or 0xff bytes and is - * thus not initialized. User has to initialize the page before using - * it. - */ - magic_empty = const_cpu_to_le32(0xffffffff),/* Record is empty and has - to be initialized before - it can be used. */ -} NTFS_RECORD_TYPES; - -/* - * Generic magic comparison macros. Finally found a use for the ## preprocessor - * operator! (-8 - */ -#define ntfs_is_magic(x, m) ( (u32)(x) == (u32)magic_##m ) -#define ntfs_is_magicp(p, m) ( *(u32*)(p) == (u32)magic_##m ) - -/* - * Specialised magic comparison macros for the NTFS_RECORD_TYPES defined above. - */ -#define ntfs_is_file_record(x) ( ntfs_is_magic (x, FILE) ) -#define ntfs_is_file_recordp(p) ( ntfs_is_magicp(p, FILE) ) -#define ntfs_is_mft_record(x) ( ntfs_is_file_record(x) ) -#define ntfs_is_mft_recordp(p) ( ntfs_is_file_recordp(p) ) -#define ntfs_is_indx_record(x) ( ntfs_is_magic (x, INDX) ) -#define ntfs_is_indx_recordp(p) ( ntfs_is_magicp(p, INDX) ) -#define ntfs_is_hole_record(x) ( ntfs_is_magic (x, HOLE) ) -#define ntfs_is_hole_recordp(p) ( ntfs_is_magicp(p, HOLE) ) - -#define ntfs_is_rstr_record(x) ( ntfs_is_magic (x, RSTR) ) -#define ntfs_is_rstr_recordp(p) ( ntfs_is_magicp(p, RSTR) ) -#define ntfs_is_rcrd_record(x) ( ntfs_is_magic (x, RCRD) ) -#define ntfs_is_rcrd_recordp(p) ( ntfs_is_magicp(p, RCRD) ) - -#define ntfs_is_chkd_record(x) ( ntfs_is_magic (x, CHKD) ) -#define ntfs_is_chkd_recordp(p) ( ntfs_is_magicp(p, CHKD) ) - -#define ntfs_is_baad_record(x) ( ntfs_is_magic (x, BAAD) ) -#define ntfs_is_baad_recordp(p) ( ntfs_is_magicp(p, BAAD) ) - -#define ntfs_is_empty_record(x) ( ntfs_is_magic (x, empty) ) -#define ntfs_is_empty_recordp(p) ( ntfs_is_magicp(p, empty) ) - - -#define NTFS_BLOCK_SIZE 512 -#define NTFS_BLOCK_SIZE_BITS 9 - -/** - * struct NTFS_RECORD - - * - * The Update Sequence Array (usa) is an array of the u16 values which belong - * to the end of each sector protected by the update sequence record in which - * this array is contained. Note that the first entry is the Update Sequence - * Number (usn), a cyclic counter of how many times the protected record has - * been written to disk. The values 0 and -1 (ie. 0xffff) are not used. All - * last u16's of each sector have to be equal to the usn (during reading) or - * are set to it (during writing). If they are not, an incomplete multi sector - * transfer has occurred when the data was written. - * The maximum size for the update sequence array is fixed to: - * maximum size = usa_ofs + (usa_count * 2) = 510 bytes - * The 510 bytes comes from the fact that the last u16 in the array has to - * (obviously) finish before the last u16 of the first 512-byte sector. - * This formula can be used as a consistency check in that usa_ofs + - * (usa_count * 2) has to be less than or equal to 510. - */ -typedef struct { - NTFS_RECORD_TYPES magic;/* A four-byte magic identifying the - record type and/or status. */ - u16 usa_ofs; /* Offset to the Update Sequence Array (usa) - from the start of the ntfs record. */ - u16 usa_count; /* Number of u16 sized entries in the usa - including the Update Sequence Number (usn), - thus the number of fixups is the usa_count - minus 1. */ -} __attribute__((__packed__)) NTFS_RECORD; - -/** - * enum NTFS_SYSTEM_FILES - System files mft record numbers. - * - * All these files are always marked as used in the bitmap attribute of the - * mft; presumably in order to avoid accidental allocation for random other - * mft records. Also, the sequence number for each of the system files is - * always equal to their mft record number and it is never modified. - */ -typedef enum { - FILE_MFT = 0, /* Master file table (mft). Data attribute - contains the entries and bitmap attribute - records which ones are in use (bit==1). */ - FILE_MFTMirr = 1, /* Mft mirror: copy of first four mft records - in data attribute. If cluster size > 4kiB, - copy of first N mft records, with - N = cluster_size / mft_record_size. */ - FILE_LogFile = 2, /* Journalling log in data attribute. */ - FILE_Volume = 3, /* Volume name attribute and volume information - attribute (flags and ntfs version). Windows - refers to this file as volume DASD (Direct - Access Storage Device). */ - FILE_AttrDef = 4, /* Array of attribute definitions in data - attribute. */ - FILE_root = 5, /* Root directory. */ - FILE_Bitmap = 6, /* Allocation bitmap of all clusters (lcns) in - data attribute. */ - FILE_Boot = 7, /* Boot sector (always at cluster 0) in data - attribute. */ - FILE_BadClus = 8, /* Contains all bad clusters in the non-resident - data attribute. */ - FILE_Secure = 9, /* Shared security descriptors in data attribute - and two indexes into the descriptors. - Appeared in Windows 2000. Before that, this - file was named $Quota but was unused. */ - FILE_UpCase = 10, /* Uppercase equivalents of all 65536 Unicode - characters in data attribute. */ - FILE_Extend = 11, /* Directory containing other system files (eg. - $ObjId, $Quota, $Reparse and $UsnJrnl). This - is new to NTFS3.0. */ - FILE_reserved12 = 12, /* Reserved for future use (records 12-15). */ - FILE_reserved13 = 13, - FILE_reserved14 = 14, - FILE_reserved15 = 15, - FILE_first_user = 16, /* First user file, used as test limit for - whether to allow opening a file or not. */ -} NTFS_SYSTEM_FILES; - -/** - * enum MFT_RECORD_FLAGS - - * - * These are the so far known MFT_RECORD_* flags (16-bit) which contain - * information about the mft record in which they are present. - * - * MFT_RECORD_IS_4 exists on all $Extend sub-files. - * It seems that it marks it is a metadata file with MFT record >24, however, - * it is unknown if it is limited to metadata files only. - * - * MFT_RECORD_IS_VIEW_INDEX exists on every metafile with a non directory - * index, that means an INDEX_ROOT and an INDEX_ALLOCATION with a name other - * than "$I30". It is unknown if it is limited to metadata files only. - */ -typedef enum { - MFT_RECORD_IN_USE = const_cpu_to_le16(0x0001), - MFT_RECORD_IS_DIRECTORY = const_cpu_to_le16(0x0002), - MFT_RECORD_IS_4 = const_cpu_to_le16(0x0004), - MFT_RECORD_IS_VIEW_INDEX = const_cpu_to_le16(0x0008), - MFT_REC_SPACE_FILLER = 0xffff, /* Just to make flags - 16-bit. */ -} __attribute__((__packed__)) MFT_RECORD_FLAGS; - -/* - * mft references (aka file references or file record segment references) are - * used whenever a structure needs to refer to a record in the mft. - * - * A reference consists of a 48-bit index into the mft and a 16-bit sequence - * number used to detect stale references. - * - * For error reporting purposes we treat the 48-bit index as a signed quantity. - * - * The sequence number is a circular counter (skipping 0) describing how many - * times the referenced mft record has been (re)used. This has to match the - * sequence number of the mft record being referenced, otherwise the reference - * is considered stale and removed (FIXME: only ntfsck or the driver itself?). - * - * If the sequence number is zero it is assumed that no sequence number - * consistency checking should be performed. - * - * FIXME: Since inodes are 32-bit as of now, the driver needs to always check - * for high_part being 0 and if not either BUG(), cause a panic() or handle - * the situation in some other way. This shouldn't be a problem as a volume has - * to become HUGE in order to need more than 32-bits worth of mft records. - * Assuming the standard mft record size of 1kb only the records (never mind - * the non-resident attributes, etc.) would require 4Tb of space on their own - * for the first 32 bits worth of records. This is only if some strange person - * doesn't decide to foul play and make the mft sparse which would be a really - * horrible thing to do as it would trash our current driver implementation. )-: - * Do I hear screams "we want 64-bit inodes!" ?!? (-; - * - * FIXME: The mft zone is defined as the first 12% of the volume. This space is - * reserved so that the mft can grow contiguously and hence doesn't become - * fragmented. Volume free space includes the empty part of the mft zone and - * when the volume's free 88% are used up, the mft zone is shrunk by a factor - * of 2, thus making more space available for more files/data. This process is - * repeated every time there is no more free space except for the mft zone until - * there really is no more free space. - */ - -/* - * Typedef the MFT_REF as a 64-bit value for easier handling. - * Also define two unpacking macros to get to the reference (MREF) and - * sequence number (MSEQNO) respectively. - * The _LE versions are to be applied on little endian MFT_REFs. - * Note: The _LE versions will return a CPU endian formatted value! - */ -#define MFT_REF_MASK_CPU 0x0000ffffffffffffULL -#define MFT_REF_MASK_LE const_cpu_to_le64(MFT_REF_MASK_CPU) - -typedef u64 MFT_REF; - -#define MK_MREF(m, s) ((MFT_REF)(((MFT_REF)(s) << 48) | \ - ((MFT_REF)(m) & MFT_REF_MASK_CPU))) -#define MK_LE_MREF(m, s) const_cpu_to_le64(((MFT_REF)(((MFT_REF)(s) << 48) | \ - ((MFT_REF)(m) & MFT_REF_MASK_CPU)))) - -#define MREF(x) ((u64)((x) & MFT_REF_MASK_CPU)) -#define MSEQNO(x) ((u16)(((x) >> 48) & 0xffff)) -#define MREF_LE(x) ((u64)(const_le64_to_cpu(x) & MFT_REF_MASK_CPU)) -#define MSEQNO_LE(x) ((u16)((const_le64_to_cpu(x) >> 48) & 0xffff)) - -#define IS_ERR_MREF(x) (((x) & 0x0000800000000000ULL) ? 1 : 0) -#define ERR_MREF(x) ((u64)((s64)(x))) -#define MREF_ERR(x) ((int)((s64)(x))) - -/** - * struct MFT_RECORD - An MFT record layout (NTFS 3.1+) - * - * The mft record header present at the beginning of every record in the mft. - * This is followed by a sequence of variable length attribute records which - * is terminated by an attribute of type AT_END which is a truncated attribute - * in that it only consists of the attribute type code AT_END and none of the - * other members of the attribute structure are present. - */ -typedef struct { -/*Ofs*/ -/* 0 NTFS_RECORD; -- Unfolded here as gcc doesn't like unnamed structs. */ - NTFS_RECORD_TYPES magic;/* Usually the magic is "FILE". */ - u16 usa_ofs; /* See NTFS_RECORD definition above. */ - u16 usa_count; /* See NTFS_RECORD definition above. */ - -/* 8*/ LSN lsn; /* $LogFile sequence number for this record. - Changed every time the record is modified. */ -/* 16*/ u16 sequence_number; /* Number of times this mft record has been - reused. (See description for MFT_REF - above.) NOTE: The increment (skipping zero) - is done when the file is deleted. NOTE: If - this is zero it is left zero. */ -/* 18*/ u16 link_count; /* Number of hard links, i.e. the number of - directory entries referencing this record. - NOTE: Only used in mft base records. - NOTE: When deleting a directory entry we - check the link_count and if it is 1 we - delete the file. Otherwise we delete the - FILE_NAME_ATTR being referenced by the - directory entry from the mft record and - decrement the link_count. - FIXME: Careful with Win32 + DOS names! */ -/* 20*/ u16 attrs_offset; /* Byte offset to the first attribute in this - mft record from the start of the mft record. - NOTE: Must be aligned to 8-byte boundary. */ -/* 22*/ MFT_RECORD_FLAGS flags; /* Bit array of MFT_RECORD_FLAGS. When a file - is deleted, the MFT_RECORD_IN_USE flag is - set to zero. */ -/* 24*/ u32 bytes_in_use; /* Number of bytes used in this mft record. - NOTE: Must be aligned to 8-byte boundary. */ -/* 28*/ u32 bytes_allocated; /* Number of bytes allocated for this mft - record. This should be equal to the mft - record size. */ -/* 32*/ MFT_REF base_mft_record; /* This is zero for base mft records. - When it is not zero it is a mft reference - pointing to the base mft record to which - this record belongs (this is then used to - locate the attribute list attribute present - in the base record which describes this - extension record and hence might need - modification when the extension record - itself is modified, also locating the - attribute list also means finding the other - potential extents, belonging to the non-base - mft record). */ -/* 40*/ u16 next_attr_instance; /* The instance number that will be - assigned to the next attribute added to this - mft record. NOTE: Incremented each time - after it is used. NOTE: Every time the mft - record is reused this number is set to zero. - NOTE: The first instance number is always 0. - */ -/* The below fields are specific to NTFS 3.1+ (Windows XP and above): */ -/* 42*/ u16 reserved; /* Reserved/alignment. */ -/* 44*/ u32 mft_record_number; /* Number of this mft record. */ -/* sizeof() = 48 bytes */ -/* - * When (re)using the mft record, we place the update sequence array at this - * offset, i.e. before we start with the attributes. This also makes sense, - * otherwise we could run into problems with the update sequence array - * containing in itself the last two bytes of a sector which would mean that - * multi sector transfer protection wouldn't work. As you can't protect data - * by overwriting it since you then can't get it back... - * When reading we obviously use the data from the ntfs record header. - */ -} __attribute__((__packed__)) MFT_RECORD; - -/** - * struct MFT_RECORD_OLD - An MFT record layout (NTFS <=3.0) - * - * This is the version without the NTFS 3.1+ specific fields. - */ -typedef struct { -/*Ofs*/ -/* 0 NTFS_RECORD; -- Unfolded here as gcc doesn't like unnamed structs. */ - NTFS_RECORD_TYPES magic;/* Usually the magic is "FILE". */ - u16 usa_ofs; /* See NTFS_RECORD definition above. */ - u16 usa_count; /* See NTFS_RECORD definition above. */ - -/* 8*/ LSN lsn; /* $LogFile sequence number for this record. - Changed every time the record is modified. */ -/* 16*/ u16 sequence_number; /* Number of times this mft record has been - reused. (See description for MFT_REF - above.) NOTE: The increment (skipping zero) - is done when the file is deleted. NOTE: If - this is zero it is left zero. */ -/* 18*/ u16 link_count; /* Number of hard links, i.e. the number of - directory entries referencing this record. - NOTE: Only used in mft base records. - NOTE: When deleting a directory entry we - check the link_count and if it is 1 we - delete the file. Otherwise we delete the - FILE_NAME_ATTR being referenced by the - directory entry from the mft record and - decrement the link_count. - FIXME: Careful with Win32 + DOS names! */ -/* 20*/ u16 attrs_offset; /* Byte offset to the first attribute in this - mft record from the start of the mft record. - NOTE: Must be aligned to 8-byte boundary. */ -/* 22*/ MFT_RECORD_FLAGS flags; /* Bit array of MFT_RECORD_FLAGS. When a file - is deleted, the MFT_RECORD_IN_USE flag is - set to zero. */ -/* 24*/ u32 bytes_in_use; /* Number of bytes used in this mft record. - NOTE: Must be aligned to 8-byte boundary. */ -/* 28*/ u32 bytes_allocated; /* Number of bytes allocated for this mft - record. This should be equal to the mft - record size. */ -/* 32*/ MFT_REF base_mft_record; /* This is zero for base mft records. - When it is not zero it is a mft reference - pointing to the base mft record to which - this record belongs (this is then used to - locate the attribute list attribute present - in the base record which describes this - extension record and hence might need - modification when the extension record - itself is modified, also locating the - attribute list also means finding the other - potential extents, belonging to the non-base - mft record). */ -/* 40*/ u16 next_attr_instance; /* The instance number that will be - assigned to the next attribute added to this - mft record. NOTE: Incremented each time - after it is used. NOTE: Every time the mft - record is reused this number is set to zero. - NOTE: The first instance number is always 0. - */ -/* sizeof() = 42 bytes */ -/* - * When (re)using the mft record, we place the update sequence array at this - * offset, i.e. before we start with the attributes. This also makes sense, - * otherwise we could run into problems with the update sequence array - * containing in itself the last two bytes of a sector which would mean that - * multi sector transfer protection wouldn't work. As you can't protect data - * by overwriting it since you then can't get it back... - * When reading we obviously use the data from the ntfs record header. - */ -} __attribute__((__packed__)) MFT_RECORD_OLD; - -/** - * enum ATTR_TYPES - System defined attributes (32-bit). - * - * Each attribute type has a corresponding attribute name (Unicode string of - * maximum 64 character length) as described by the attribute definitions - * present in the data attribute of the $AttrDef system file. - * - * On NTFS 3.0 volumes the names are just as the types are named in the below - * enum exchanging AT_ for the dollar sign ($). If that isn't a revealing - * choice of symbol... (-; - */ -typedef enum { - AT_UNUSED = const_cpu_to_le32( 0), - AT_STANDARD_INFORMATION = const_cpu_to_le32( 0x10), - AT_ATTRIBUTE_LIST = const_cpu_to_le32( 0x20), - AT_FILE_NAME = const_cpu_to_le32( 0x30), - AT_OBJECT_ID = const_cpu_to_le32( 0x40), - AT_SECURITY_DESCRIPTOR = const_cpu_to_le32( 0x50), - AT_VOLUME_NAME = const_cpu_to_le32( 0x60), - AT_VOLUME_INFORMATION = const_cpu_to_le32( 0x70), - AT_DATA = const_cpu_to_le32( 0x80), - AT_INDEX_ROOT = const_cpu_to_le32( 0x90), - AT_INDEX_ALLOCATION = const_cpu_to_le32( 0xa0), - AT_BITMAP = const_cpu_to_le32( 0xb0), - AT_REPARSE_POINT = const_cpu_to_le32( 0xc0), - AT_EA_INFORMATION = const_cpu_to_le32( 0xd0), - AT_EA = const_cpu_to_le32( 0xe0), - AT_PROPERTY_SET = const_cpu_to_le32( 0xf0), - AT_LOGGED_UTILITY_STREAM = const_cpu_to_le32( 0x100), - AT_FIRST_USER_DEFINED_ATTRIBUTE = const_cpu_to_le32( 0x1000), - AT_END = const_cpu_to_le32(0xffffffff), -} ATTR_TYPES; - -/** - * enum COLLATION_RULES - The collation rules for sorting views/indexes/etc - * (32-bit). - * - * COLLATION_UNICODE_STRING - Collate Unicode strings by comparing their binary - * Unicode values, except that when a character can be uppercased, the - * upper case value collates before the lower case one. - * COLLATION_FILE_NAME - Collate file names as Unicode strings. The collation - * is done very much like COLLATION_UNICODE_STRING. In fact I have no idea - * what the difference is. Perhaps the difference is that file names - * would treat some special characters in an odd way (see - * unistr.c::ntfs_collate_names() and unistr.c::legal_ansi_char_array[] - * for what I mean but COLLATION_UNICODE_STRING would not give any special - * treatment to any characters at all, but this is speculation. - * COLLATION_NTOFS_ULONG - Sorting is done according to ascending u32 key - * values. E.g. used for $SII index in FILE_Secure, which sorts by - * security_id (u32). - * COLLATION_NTOFS_SID - Sorting is done according to ascending SID values. - * E.g. used for $O index in FILE_Extend/$Quota. - * COLLATION_NTOFS_SECURITY_HASH - Sorting is done first by ascending hash - * values and second by ascending security_id values. E.g. used for $SDH - * index in FILE_Secure. - * COLLATION_NTOFS_ULONGS - Sorting is done according to a sequence of ascending - * u32 key values. E.g. used for $O index in FILE_Extend/$ObjId, which - * sorts by object_id (16-byte), by splitting up the object_id in four - * u32 values and using them as individual keys. E.g. take the following - * two security_ids, stored as follows on disk: - * 1st: a1 61 65 b7 65 7b d4 11 9e 3d 00 e0 81 10 42 59 - * 2nd: 38 14 37 d2 d2 f3 d4 11 a5 21 c8 6b 79 b1 97 45 - * To compare them, they are split into four u32 values each, like so: - * 1st: 0xb76561a1 0x11d47b65 0xe0003d9e 0x59421081 - * 2nd: 0xd2371438 0x11d4f3d2 0x6bc821a5 0x4597b179 - * Now, it is apparent why the 2nd object_id collates after the 1st: the - * first u32 value of the 1st object_id is less than the first u32 of - * the 2nd object_id. If the first u32 values of both object_ids were - * equal then the second u32 values would be compared, etc. - */ -typedef enum { - COLLATION_BINARY = const_cpu_to_le32(0), /* Collate by binary - compare where the first byte is most - significant. */ - COLLATION_FILE_NAME = const_cpu_to_le32(1), /* Collate file names - as Unicode strings. */ - COLLATION_UNICODE_STRING = const_cpu_to_le32(2), /* Collate Unicode - strings by comparing their binary - Unicode values, except that when a - character can be uppercased, the upper - case value collates before the lower - case one. */ - COLLATION_NTOFS_ULONG = const_cpu_to_le32(16), - COLLATION_NTOFS_SID = const_cpu_to_le32(17), - COLLATION_NTOFS_SECURITY_HASH = const_cpu_to_le32(18), - COLLATION_NTOFS_ULONGS = const_cpu_to_le32(19), -} COLLATION_RULES; - -/** - * enum ATTR_DEF_FLAGS - - * - * The flags (32-bit) describing attribute properties in the attribute - * definition structure. FIXME: This information is based on Regis's - * information and, according to him, it is not certain and probably - * incomplete. The INDEXABLE flag is fairly certainly correct as only the file - * name attribute has this flag set and this is the only attribute indexed in - * NT4. - */ -typedef enum { - ATTR_DEF_INDEXABLE = const_cpu_to_le32(0x02), /* Attribute can be - indexed. */ - ATTR_DEF_MULTIPLE = const_cpu_to_le32(0x04), /* Attribute type - can be present multiple times in the - mft records of an inode. */ - ATTR_DEF_NOT_ZERO = const_cpu_to_le32(0x08), /* Attribute value - must contain at least one non-zero - byte. */ - ATTR_DEF_INDEXED_UNIQUE = const_cpu_to_le32(0x10), /* Attribute must be - indexed and the attribute value must be - unique for the attribute type in all of - the mft records of an inode. */ - ATTR_DEF_NAMED_UNIQUE = const_cpu_to_le32(0x20), /* Attribute must be - named and the name must be unique for - the attribute type in all of the mft - records of an inode. */ - ATTR_DEF_RESIDENT = const_cpu_to_le32(0x40), /* Attribute must be - resident. */ - ATTR_DEF_ALWAYS_LOG = const_cpu_to_le32(0x80), /* Always log - modifications to this attribute, - regardless of whether it is resident or - non-resident. Without this, only log - modifications if the attribute is - resident. */ -} ATTR_DEF_FLAGS; - -/** - * struct ATTR_DEF - - * - * The data attribute of FILE_AttrDef contains a sequence of attribute - * definitions for the NTFS volume. With this, it is supposed to be safe for an - * older NTFS driver to mount a volume containing a newer NTFS version without - * damaging it (that's the theory. In practice it's: not damaging it too much). - * Entries are sorted by attribute type. The flags describe whether the - * attribute can be resident/non-resident and possibly other things, but the - * actual bits are unknown. - */ -typedef struct { -/*hex ofs*/ -/* 0*/ ntfschar name[0x40]; /* Unicode name of the attribute. Zero - terminated. */ -/* 80*/ ATTR_TYPES type; /* Type of the attribute. */ -/* 84*/ u32 display_rule; /* Default display rule. - FIXME: What does it mean? (AIA) */ -/* 88*/ COLLATION_RULES collation_rule; /* Default collation rule. */ -/* 8c*/ ATTR_DEF_FLAGS flags; /* Flags describing the attribute. */ -/* 90*/ s64 min_size; /* Optional minimum attribute size. */ -/* 98*/ s64 max_size; /* Maximum size of attribute. */ -/* sizeof() = 0xa0 or 160 bytes */ -} __attribute__((__packed__)) ATTR_DEF; - -/** - * enum ATTR_FLAGS - Attribute flags (16-bit). - */ -typedef enum { - ATTR_IS_COMPRESSED = const_cpu_to_le16(0x0001), - ATTR_COMPRESSION_MASK = const_cpu_to_le16(0x00ff), /* Compression - method mask. Also, first - illegal value. */ - ATTR_IS_ENCRYPTED = const_cpu_to_le16(0x4000), - ATTR_IS_SPARSE = const_cpu_to_le16(0x8000), -} __attribute__((__packed__)) ATTR_FLAGS; - -/* - * Attribute compression. - * - * Only the data attribute is ever compressed in the current ntfs driver in - * Windows. Further, compression is only applied when the data attribute is - * non-resident. Finally, to use compression, the maximum allowed cluster size - * on a volume is 4kib. - * - * The compression method is based on independently compressing blocks of X - * clusters, where X is determined from the compression_unit value found in the - * non-resident attribute record header (more precisely: X = 2^compression_unit - * clusters). On Windows NT/2k, X always is 16 clusters (compression_unit = 4). - * - * There are three different cases of how a compression block of X clusters - * can be stored: - * - * 1) The data in the block is all zero (a sparse block): - * This is stored as a sparse block in the runlist, i.e. the runlist - * entry has length = X and lcn = -1. The mapping pairs array actually - * uses a delta_lcn value length of 0, i.e. delta_lcn is not present at - * all, which is then interpreted by the driver as lcn = -1. - * NOTE: Even uncompressed files can be sparse on NTFS 3.0 volumes, then - * the same principles apply as above, except that the length is not - * restricted to being any particular value. - * - * 2) The data in the block is not compressed: - * This happens when compression doesn't reduce the size of the block - * in clusters. I.e. if compression has a small effect so that the - * compressed data still occupies X clusters, then the uncompressed data - * is stored in the block. - * This case is recognised by the fact that the runlist entry has - * length = X and lcn >= 0. The mapping pairs array stores this as - * normal with a run length of X and some specific delta_lcn, i.e. - * delta_lcn has to be present. - * - * 3) The data in the block is compressed: - * The common case. This case is recognised by the fact that the run - * list entry has length L < X and lcn >= 0. The mapping pairs array - * stores this as normal with a run length of X and some specific - * delta_lcn, i.e. delta_lcn has to be present. This runlist entry is - * immediately followed by a sparse entry with length = X - L and - * lcn = -1. The latter entry is to make up the vcn counting to the - * full compression block size X. - * - * In fact, life is more complicated because adjacent entries of the same type - * can be coalesced. This means that one has to keep track of the number of - * clusters handled and work on a basis of X clusters at a time being one - * block. An example: if length L > X this means that this particular runlist - * entry contains a block of length X and part of one or more blocks of length - * L - X. Another example: if length L < X, this does not necessarily mean that - * the block is compressed as it might be that the lcn changes inside the block - * and hence the following runlist entry describes the continuation of the - * potentially compressed block. The block would be compressed if the - * following runlist entry describes at least X - L sparse clusters, thus - * making up the compression block length as described in point 3 above. (Of - * course, there can be several runlist entries with small lengths so that the - * sparse entry does not follow the first data containing entry with - * length < X.) - * - * NOTE: At the end of the compressed attribute value, there most likely is not - * just the right amount of data to make up a compression block, thus this data - * is not even attempted to be compressed. It is just stored as is, unless - * the number of clusters it occupies is reduced when compressed in which case - * it is stored as a compressed compression block, complete with sparse - * clusters at the end. - */ - -/** - * enum RESIDENT_ATTR_FLAGS - Flags of resident attributes (8-bit). - */ -typedef enum { - RESIDENT_ATTR_IS_INDEXED = 0x01, /* Attribute is referenced in an index - (has implications for deleting and - modifying the attribute). */ -} __attribute__((__packed__)) RESIDENT_ATTR_FLAGS; - -/** - * struct ATTR_RECORD - Attribute record header. - * - * Always aligned to 8-byte boundary. - */ -typedef struct { -/*Ofs*/ -/* 0*/ ATTR_TYPES type; /* The (32-bit) type of the attribute. */ -/* 4*/ u32 length; /* Byte size of the resident part of the - attribute (aligned to 8-byte boundary). - Used to get to the next attribute. */ -/* 8*/ u8 non_resident; /* If 0, attribute is resident. - If 1, attribute is non-resident. */ -/* 9*/ u8 name_length; /* Unicode character size of name of attribute. - 0 if unnamed. */ -/* 10*/ u16 name_offset; /* If name_length != 0, the byte offset to the - beginning of the name from the attribute - record. Note that the name is stored as a - Unicode string. When creating, place offset - just at the end of the record header. Then, - follow with attribute value or mapping pairs - array, resident and non-resident attributes - respectively, aligning to an 8-byte - boundary. */ -/* 12*/ ATTR_FLAGS flags; /* Flags describing the attribute. */ -/* 14*/ u16 instance; /* The instance of this attribute record. This - number is unique within this mft record (see - MFT_RECORD/next_attribute_instance notes - above for more details). */ -/* 16*/ union { - /* Resident attributes. */ - struct { -/* 16 */ u32 value_length; /* Byte size of attribute value. */ -/* 20 */ u16 value_offset; /* Byte offset of the attribute - value from the start of the - attribute record. When creating, - align to 8-byte boundary if we - have a name present as this might - not have a length of a multiple - of 8-bytes. */ -/* 22 */ RESIDENT_ATTR_FLAGS resident_flags; /* See above. */ -/* 23 */ s8 reservedR; /* Reserved/alignment to 8-byte - boundary. */ -/* 24 */ void *resident_end[0]; /* Use offsetof(ATTR_RECORD, - resident_end) to get size of - a resident attribute. */ - } __attribute__((__packed__)); - /* Non-resident attributes. */ - struct { -/* 16*/ VCN lowest_vcn; /* Lowest valid virtual cluster number - for this portion of the attribute value or - 0 if this is the only extent (usually the - case). - Only when an attribute list is used - does lowest_vcn != 0 ever occur. */ -/* 24*/ VCN highest_vcn; /* Highest valid vcn of this extent of - the attribute value. - Usually there is only one - portion, so this usually equals the attribute - value size in clusters minus 1. Can be -1 for - zero length files. Can be 0 for "single extent" - attributes. */ -/* 32*/ u16 mapping_pairs_offset; /* Byte offset from the - beginning of the structure to the mapping pairs - array which contains the mappings between the - vcns and the logical cluster numbers (lcns). - When creating, place this at the end of this - record header aligned to 8-byte boundary. */ -/* 34*/ u8 compression_unit; /* The compression unit expressed - as the log to the base 2 of the number of - clusters in a compression unit. 0 means not - compressed. (This effectively limits the - compression unit size to be a power of two - clusters.) WinNT4 only uses a value of 4. */ -/* 35*/ u8 reserved1[5]; /* Align to 8-byte boundary. */ -/* The sizes below are only used when lowest_vcn is zero, as otherwise it would - be difficult to keep them up-to-date.*/ -/* 40*/ s64 allocated_size; /* Byte size of disk space - allocated to hold the attribute value. Always - is a multiple of the cluster size. When a file - is compressed, this field is a multiple of the - compression block size (2^compression_unit) and - it represents the logically allocated space - rather than the actual on disk usage. For this - use the compressed_size (see below). */ -/* 48*/ s64 data_size; /* Byte size of the attribute - value. Can be larger than allocated_size if - attribute value is compressed or sparse. */ -/* 56*/ s64 initialized_size; /* Byte size of initialized - portion of the attribute value. Usually equals - data_size. */ -/* 64 */ void *non_resident_end[0]; /* Use offsetof(ATTR_RECORD, - non_resident_end) to get - size of a non resident - attribute. */ -/* sizeof(uncompressed attr) = 64*/ -/* 64*/ s64 compressed_size; /* Byte size of the attribute - value after compression. Only present when - compressed. Always is a multiple of the - cluster size. Represents the actual amount of - disk space being used on the disk. */ -/* 72 */ void *compressed_end[0]; - /* Use offsetof(ATTR_RECORD, compressed_end) to - get size of a compressed attribute. */ -/* sizeof(compressed attr) = 72*/ - } __attribute__((__packed__)); - } __attribute__((__packed__)); -} __attribute__((__packed__)) ATTR_RECORD; - -typedef ATTR_RECORD ATTR_REC; - -/** - * enum FILE_ATTR_FLAGS - File attribute flags (32-bit). - */ -typedef enum { - /* - * These flags are only present in the STANDARD_INFORMATION attribute - * (in the field file_attributes). - */ - FILE_ATTR_READONLY = const_cpu_to_le32(0x00000001), - FILE_ATTR_HIDDEN = const_cpu_to_le32(0x00000002), - FILE_ATTR_SYSTEM = const_cpu_to_le32(0x00000004), - /* Old DOS volid. Unused in NT. = cpu_to_le32(0x00000008), */ - - FILE_ATTR_DIRECTORY = const_cpu_to_le32(0x00000010), - /* FILE_ATTR_DIRECTORY is not considered valid in NT. It is reserved - for the DOS SUBDIRECTORY flag. */ - FILE_ATTR_ARCHIVE = const_cpu_to_le32(0x00000020), - FILE_ATTR_DEVICE = const_cpu_to_le32(0x00000040), - FILE_ATTR_NORMAL = const_cpu_to_le32(0x00000080), - - FILE_ATTR_TEMPORARY = const_cpu_to_le32(0x00000100), - FILE_ATTR_SPARSE_FILE = const_cpu_to_le32(0x00000200), - FILE_ATTR_REPARSE_POINT = const_cpu_to_le32(0x00000400), - FILE_ATTR_COMPRESSED = const_cpu_to_le32(0x00000800), - - FILE_ATTR_OFFLINE = const_cpu_to_le32(0x00001000), - FILE_ATTR_NOT_CONTENT_INDEXED = const_cpu_to_le32(0x00002000), - FILE_ATTR_ENCRYPTED = const_cpu_to_le32(0x00004000), - - FILE_ATTR_VALID_FLAGS = const_cpu_to_le32(0x00007fb7), - /* FILE_ATTR_VALID_FLAGS masks out the old DOS VolId and the - FILE_ATTR_DEVICE and preserves everything else. This mask - is used to obtain all flags that are valid for reading. */ - FILE_ATTR_VALID_SET_FLAGS = const_cpu_to_le32(0x000031a7), - /* FILE_ATTR_VALID_SET_FLAGS masks out the old DOS VolId, the - FILE_ATTR_DEVICE, FILE_ATTR_DIRECTORY, FILE_ATTR_SPARSE_FILE, - FILE_ATTR_REPARSE_POINT, FILE_ATRE_COMPRESSED and FILE_ATTR_ENCRYPTED - and preserves the rest. This mask is used to to obtain all flags that - are valid for setting. */ - - /** - * FILE_ATTR_I30_INDEX_PRESENT - Is it a directory? - * - * This is a copy of the MFT_RECORD_IS_DIRECTORY bit from the mft - * record, telling us whether this is a directory or not, i.e. whether - * it has an index root attribute named "$I30" or not. - * - * This flag is only present in the FILE_NAME attribute (in the - * file_attributes field). - */ - FILE_ATTR_I30_INDEX_PRESENT = const_cpu_to_le32(0x10000000), - - /** - * FILE_ATTR_VIEW_INDEX_PRESENT - Does have a non-directory index? - * - * This is a copy of the MFT_RECORD_IS_VIEW_INDEX bit from the mft - * record, telling us whether this file has a view index present (eg. - * object id index, quota index, one of the security indexes and the - * reparse points index). - * - * This flag is only present in the $STANDARD_INFORMATION and - * $FILE_NAME attributes. - */ - FILE_ATTR_VIEW_INDEX_PRESENT = const_cpu_to_le32(0x20000000), -} __attribute__((__packed__)) FILE_ATTR_FLAGS; - -/* - * NOTE on times in NTFS: All times are in MS standard time format, i.e. they - * are the number of 100-nanosecond intervals since 1st January 1601, 00:00:00 - * universal coordinated time (UTC). (In Linux time starts 1st January 1970, - * 00:00:00 UTC and is stored as the number of 1-second intervals since then.) - */ - -/** - * struct STANDARD_INFORMATION - Attribute: Standard information (0x10). - * - * NOTE: Always resident. - * NOTE: Present in all base file records on a volume. - * NOTE: There is conflicting information about the meaning of each of the time - * fields but the meaning as defined below has been verified to be - * correct by practical experimentation on Windows NT4 SP6a and is hence - * assumed to be the one and only correct interpretation. - */ -typedef struct { -/*Ofs*/ -/* 0*/ s64 creation_time; /* Time file was created. Updated when - a filename is changed(?). */ -/* 8*/ s64 last_data_change_time; /* Time the data attribute was last - modified. */ -/* 16*/ s64 last_mft_change_time; /* Time this mft record was last - modified. */ -/* 24*/ s64 last_access_time; /* Approximate time when the file was - last accessed (obviously this is not - updated on read-only volumes). In - Windows this is only updated when - accessed if some time delta has - passed since the last update. Also, - last access times updates can be - disabled altogether for speed. */ -/* 32*/ FILE_ATTR_FLAGS file_attributes; /* Flags describing the file. */ -/* 36*/ union { - /* NTFS 1.2 (and previous, presumably) */ - struct { - /* 36 */ u8 reserved12[12]; /* Reserved/alignment to 8-byte - boundary. */ - /* 48 */ void *v1_end[0]; /* Marker for offsetof(). */ - } __attribute__((__packed__)); -/* sizeof() = 48 bytes */ - /* NTFS 3.0 */ - struct { -/* - * If a volume has been upgraded from a previous NTFS version, then these - * fields are present only if the file has been accessed since the upgrade. - * Recognize the difference by comparing the length of the resident attribute - * value. If it is 48, then the following fields are missing. If it is 72 then - * the fields are present. Maybe just check like this: - * if (resident.ValueLength < sizeof(STANDARD_INFORMATION)) { - * Assume NTFS 1.2- format. - * If (volume version is 3.0+) - * Upgrade attribute to NTFS 3.0 format. - * else - * Use NTFS 1.2- format for access. - * } else - * Use NTFS 3.0 format for access. - * Only problem is that it might be legal to set the length of the value to - * arbitrarily large values thus spoiling this check. - But chkdsk probably - * views that as a corruption, assuming that it behaves like this for all - * attributes. - */ - /* 36*/ u32 maximum_versions; /* Maximum allowed versions for - file. Zero if version numbering is disabled. */ - /* 40*/ u32 version_number; /* This file's version (if any). - Set to zero if maximum_versions is zero. */ - /* 44*/ u32 class_id; /* Class id from bidirectional - class id index (?). */ - /* 48*/ u32 owner_id; /* Owner_id of the user owning - the file. Translate via $Q index in FILE_Extend - /$Quota to the quota control entry for the user - owning the file. Zero if quotas are disabled. */ - /* 52*/ u32 security_id; /* Security_id for the file. - Translate via $SII index and $SDS data stream - in FILE_Secure to the security descriptor. */ - /* 56*/ u64 quota_charged; /* Byte size of the charge to - the quota for all streams of the file. Note: Is - zero if quotas are disabled. */ - /* 64*/ u64 usn; /* Last update sequence number - of the file. This is a direct index into the - change (aka usn) journal file. It is zero if - the usn journal is disabled. - NOTE: To disable the journal need to delete - the journal file itself and to then walk the - whole mft and set all Usn entries in all mft - records to zero! (This can take a while!) - The journal is FILE_Extend/$UsnJrnl. Win2k - will recreate the journal and initiate - logging if necessary when mounting the - partition. This, in contrast to disabling the - journal is a very fast process, so the user - won't even notice it. */ - /* 72*/ void *v3_end[0]; /* Marker for offsetof(). */ - } __attribute__((__packed__)); - } __attribute__((__packed__)); -/* sizeof() = 72 bytes (NTFS 3.0) */ -} __attribute__((__packed__)) STANDARD_INFORMATION; - -/** - * struct ATTR_LIST_ENTRY - Attribute: Attribute list (0x20). - * - * - Can be either resident or non-resident. - * - Value consists of a sequence of variable length, 8-byte aligned, - * ATTR_LIST_ENTRY records. - * - The attribute list attribute contains one entry for each attribute of - * the file in which the list is located, except for the list attribute - * itself. The list is sorted: first by attribute type, second by attribute - * name (if present), third by instance number. The extents of one - * non-resident attribute (if present) immediately follow after the initial - * extent. They are ordered by lowest_vcn and have their instance set to zero. - * It is not allowed to have two attributes with all sorting keys equal. - * - Further restrictions: - * - If not resident, the vcn to lcn mapping array has to fit inside the - * base mft record. - * - The attribute list attribute value has a maximum size of 256kb. This - * is imposed by the Windows cache manager. - * - Attribute lists are only used when the attributes of mft record do not - * fit inside the mft record despite all attributes (that can be made - * non-resident) having been made non-resident. This can happen e.g. when: - * - File has a large number of hard links (lots of file name - * attributes present). - * - The mapping pairs array of some non-resident attribute becomes so - * large due to fragmentation that it overflows the mft record. - * - The security descriptor is very complex (not applicable to - * NTFS 3.0 volumes). - * - There are many named streams. - */ -typedef struct { -/*Ofs*/ -/* 0*/ ATTR_TYPES type; /* Type of referenced attribute. */ -/* 4*/ u16 length; /* Byte size of this entry. */ -/* 6*/ u8 name_length; /* Size in Unicode chars of the name of the - attribute or 0 if unnamed. */ -/* 7*/ u8 name_offset; /* Byte offset to beginning of attribute name - (always set this to where the name would - start even if unnamed). */ -/* 8*/ VCN lowest_vcn; /* Lowest virtual cluster number of this portion - of the attribute value. This is usually 0. It - is non-zero for the case where one attribute - does not fit into one mft record and thus - several mft records are allocated to hold - this attribute. In the latter case, each mft - record holds one extent of the attribute and - there is one attribute list entry for each - extent. NOTE: This is DEFINITELY a signed - value! The windows driver uses cmp, followed - by jg when comparing this, thus it treats it - as signed. */ -/* 16*/ MFT_REF mft_reference; /* The reference of the mft record holding - the ATTR_RECORD for this portion of the - attribute value. */ -/* 24*/ u16 instance; /* If lowest_vcn = 0, the instance of the - attribute being referenced; otherwise 0. */ -/* 26*/ ntfschar name[0]; /* Use when creating only. When reading use - name_offset to determine the location of the - name. */ -/* sizeof() = 26 + (attribute_name_length * 2) bytes */ -} __attribute__((__packed__)) ATTR_LIST_ENTRY; - -/* - * The maximum allowed length for a file name. - */ -#define NTFS_MAX_NAME_LEN 255 - -/** - * enum FILE_NAME_TYPE_FLAGS - Possible namespaces for filenames in ntfs. - * (8-bit). - */ -typedef enum { - FILE_NAME_POSIX = 0x00, - /* This is the largest namespace. It is case sensitive and - allows all Unicode characters except for: '\0' and '/'. - Beware that in WinNT/2k files which eg have the same name - except for their case will not be distinguished by the - standard utilities and thus a "del filename" will delete - both "filename" and "fileName" without warning. */ - FILE_NAME_WIN32 = 0x01, - /* The standard WinNT/2k NTFS long filenames. Case insensitive. - All Unicode chars except: '\0', '"', '*', '/', ':', '<', - '>', '?', '\' and '|'. Further, names cannot end with a '.' - or a space. */ - FILE_NAME_DOS = 0x02, - /* The standard DOS filenames (8.3 format). Uppercase only. - All 8-bit characters greater space, except: '"', '*', '+', - ',', '/', ':', ';', '<', '=', '>', '?' and '\'. */ - FILE_NAME_WIN32_AND_DOS = 0x03, - /* 3 means that both the Win32 and the DOS filenames are - identical and hence have been saved in this single filename - record. */ -} __attribute__((__packed__)) FILE_NAME_TYPE_FLAGS; - -/** - * struct FILE_NAME_ATTR - Attribute: Filename (0x30). - * - * NOTE: Always resident. - * NOTE: All fields, except the parent_directory, are only updated when the - * filename is changed. Until then, they just become out of sync with - * reality and the more up to date values are present in the standard - * information attribute. - * NOTE: There is conflicting information about the meaning of each of the time - * fields but the meaning as defined below has been verified to be - * correct by practical experimentation on Windows NT4 SP6a and is hence - * assumed to be the one and only correct interpretation. - */ -typedef struct { -/*hex ofs*/ -/* 0*/ MFT_REF parent_directory; /* Directory this filename is - referenced from. */ -/* 8*/ s64 creation_time; /* Time file was created. */ -/* 10*/ s64 last_data_change_time; /* Time the data attribute was last - modified. */ -/* 18*/ s64 last_mft_change_time; /* Time this mft record was last - modified. */ -/* 20*/ s64 last_access_time; /* Last time this mft record was - accessed. */ -/* 28*/ s64 allocated_size; /* Byte size of on-disk allocated space - for the data attribute. So for - normal $DATA, this is the - allocated_size from the unnamed - $DATA attribute and for compressed - and/or sparse $DATA, this is the - compressed_size from the unnamed - $DATA attribute. NOTE: This is a - multiple of the cluster size. */ -/* 30*/ s64 data_size; /* Byte size of actual data in data - attribute. */ -/* 38*/ FILE_ATTR_FLAGS file_attributes; /* Flags describing the file. */ -/* 3c*/ union { - /* 3c*/ struct { - /* 3c*/ u16 packed_ea_size; /* Size of the buffer needed to - pack the extended attributes - (EAs), if such are present.*/ - /* 3e*/ u16 reserved; /* Reserved for alignment. */ - } __attribute__((__packed__)); - /* 3c*/ u32 reparse_point_tag; /* Type of reparse point, - present only in reparse - points and only if there are - no EAs. */ - } __attribute__((__packed__)); -/* 40*/ u8 file_name_length; /* Length of file name in - (Unicode) characters. */ -/* 41*/ FILE_NAME_TYPE_FLAGS file_name_type; /* Namespace of the file name.*/ -/* 42*/ ntfschar file_name[0]; /* File name in Unicode. */ -} __attribute__((__packed__)) FILE_NAME_ATTR; - -/** - * struct GUID - GUID structures store globally unique identifiers (GUID). - * - * A GUID is a 128-bit value consisting of one group of eight hexadecimal - * digits, followed by three groups of four hexadecimal digits each, followed - * by one group of twelve hexadecimal digits. GUIDs are Microsoft's - * implementation of the distributed computing environment (DCE) universally - * unique identifier (UUID). - * - * Example of a GUID: - * 1F010768-5A73-BC91-0010-A52216A7227B - */ -typedef struct { - u32 data1; /* The first eight hexadecimal digits of the GUID. */ - u16 data2; /* The first group of four hexadecimal digits. */ - u16 data3; /* The second group of four hexadecimal digits. */ - u8 data4[8]; /* The first two bytes are the third group of four - hexadecimal digits. The remaining six bytes are the - final 12 hexadecimal digits. */ -} __attribute__((__packed__)) GUID; - -/** - * struct OBJ_ID_INDEX_DATA - FILE_Extend/$ObjId contains an index named $O. - * - * This index contains all object_ids present on the volume as the index keys - * and the corresponding mft_record numbers as the index entry data parts. - * - * The data part (defined below) also contains three other object_ids: - * birth_volume_id - object_id of FILE_Volume on which the file was first - * created. Optional (i.e. can be zero). - * birth_object_id - object_id of file when it was first created. Usually - * equals the object_id. Optional (i.e. can be zero). - * domain_id - Reserved (always zero). - */ -typedef struct { - MFT_REF mft_reference; /* Mft record containing the object_id in - the index entry key. */ - union { - struct { - GUID birth_volume_id; - GUID birth_object_id; - GUID domain_id; - } __attribute__((__packed__)); - u8 extended_info[48]; - } __attribute__((__packed__)); -} __attribute__((__packed__)) OBJ_ID_INDEX_DATA; - -/** - * struct OBJECT_ID_ATTR - Attribute: Object id (NTFS 3.0+) (0x40). - * - * NOTE: Always resident. - */ -typedef struct { - GUID object_id; /* Unique id assigned to the - file.*/ - /* The following fields are optional. The attribute value size is 16 - bytes, i.e. sizeof(GUID), if these are not present at all. Note, - the entries can be present but one or more (or all) can be zero - meaning that that particular value(s) is(are) not defined. Note, - when the fields are missing here, it is well possible that they are - to be found within the $Extend/$ObjId system file indexed under the - above object_id. */ - union { - struct { - GUID birth_volume_id; /* Unique id of volume on which - the file was first created.*/ - GUID birth_object_id; /* Unique id of file when it was - first created. */ - GUID domain_id; /* Reserved, zero. */ - } __attribute__((__packed__)); - u8 extended_info[48]; - } __attribute__((__packed__)); -} __attribute__((__packed__)) OBJECT_ID_ATTR; - -#if 0 -/** - * enum IDENTIFIER_AUTHORITIES - - * - * The pre-defined IDENTIFIER_AUTHORITIES used as SID_IDENTIFIER_AUTHORITY in - * the SID structure (see below). - */ -typedef enum { /* SID string prefix. */ - SECURITY_NULL_SID_AUTHORITY = {0, 0, 0, 0, 0, 0}, /* S-1-0 */ - SECURITY_WORLD_SID_AUTHORITY = {0, 0, 0, 0, 0, 1}, /* S-1-1 */ - SECURITY_LOCAL_SID_AUTHORITY = {0, 0, 0, 0, 0, 2}, /* S-1-2 */ - SECURITY_CREATOR_SID_AUTHORITY = {0, 0, 0, 0, 0, 3}, /* S-1-3 */ - SECURITY_NON_UNIQUE_AUTHORITY = {0, 0, 0, 0, 0, 4}, /* S-1-4 */ - SECURITY_NT_SID_AUTHORITY = {0, 0, 0, 0, 0, 5}, /* S-1-5 */ -} IDENTIFIER_AUTHORITIES; -#endif - -/** - * enum RELATIVE_IDENTIFIERS - - * - * These relative identifiers (RIDs) are used with the above identifier - * authorities to make up universal well-known SIDs. - * - * Note: The relative identifier (RID) refers to the portion of a SID, which - * identifies a user or group in relation to the authority that issued the SID. - * For example, the universal well-known SID Creator Owner ID (S-1-3-0) is - * made up of the identifier authority SECURITY_CREATOR_SID_AUTHORITY (3) and - * the relative identifier SECURITY_CREATOR_OWNER_RID (0). - */ -typedef enum { /* Identifier authority. */ - SECURITY_NULL_RID = 0, /* S-1-0 */ - SECURITY_WORLD_RID = 0, /* S-1-1 */ - SECURITY_LOCAL_RID = 0, /* S-1-2 */ - - SECURITY_CREATOR_OWNER_RID = 0, /* S-1-3 */ - SECURITY_CREATOR_GROUP_RID = 1, /* S-1-3 */ - - SECURITY_CREATOR_OWNER_SERVER_RID = 2, /* S-1-3 */ - SECURITY_CREATOR_GROUP_SERVER_RID = 3, /* S-1-3 */ - - SECURITY_DIALUP_RID = 1, - SECURITY_NETWORK_RID = 2, - SECURITY_BATCH_RID = 3, - SECURITY_INTERACTIVE_RID = 4, - SECURITY_SERVICE_RID = 6, - SECURITY_ANONYMOUS_LOGON_RID = 7, - SECURITY_PROXY_RID = 8, - SECURITY_ENTERPRISE_CONTROLLERS_RID=9, - SECURITY_SERVER_LOGON_RID = 9, - SECURITY_PRINCIPAL_SELF_RID = 0xa, - SECURITY_AUTHENTICATED_USER_RID = 0xb, - SECURITY_RESTRICTED_CODE_RID = 0xc, - SECURITY_TERMINAL_SERVER_RID = 0xd, - - SECURITY_LOGON_IDS_RID = 5, - SECURITY_LOGON_IDS_RID_COUNT = 3, - - SECURITY_LOCAL_SYSTEM_RID = 0x12, - - SECURITY_NT_NON_UNIQUE = 0x15, - - SECURITY_BUILTIN_DOMAIN_RID = 0x20, - - /* - * Well-known domain relative sub-authority values (RIDs). - */ - - /* Users. */ - DOMAIN_USER_RID_ADMIN = 0x1f4, - DOMAIN_USER_RID_GUEST = 0x1f5, - DOMAIN_USER_RID_KRBTGT = 0x1f6, - - /* Groups. */ - DOMAIN_GROUP_RID_ADMINS = 0x200, - DOMAIN_GROUP_RID_USERS = 0x201, - DOMAIN_GROUP_RID_GUESTS = 0x202, - DOMAIN_GROUP_RID_COMPUTERS = 0x203, - DOMAIN_GROUP_RID_CONTROLLERS = 0x204, - DOMAIN_GROUP_RID_CERT_ADMINS = 0x205, - DOMAIN_GROUP_RID_SCHEMA_ADMINS = 0x206, - DOMAIN_GROUP_RID_ENTERPRISE_ADMINS= 0x207, - DOMAIN_GROUP_RID_POLICY_ADMINS = 0x208, - - /* Aliases. */ - DOMAIN_ALIAS_RID_ADMINS = 0x220, - DOMAIN_ALIAS_RID_USERS = 0x221, - DOMAIN_ALIAS_RID_GUESTS = 0x222, - DOMAIN_ALIAS_RID_POWER_USERS = 0x223, - - DOMAIN_ALIAS_RID_ACCOUNT_OPS = 0x224, - DOMAIN_ALIAS_RID_SYSTEM_OPS = 0x225, - DOMAIN_ALIAS_RID_PRINT_OPS = 0x226, - DOMAIN_ALIAS_RID_BACKUP_OPS = 0x227, - - DOMAIN_ALIAS_RID_REPLICATOR = 0x228, - DOMAIN_ALIAS_RID_RAS_SERVERS = 0x229, - DOMAIN_ALIAS_RID_PREW2KCOMPACCESS = 0x22a, -} RELATIVE_IDENTIFIERS; - -/* - * The universal well-known SIDs: - * - * NULL_SID S-1-0-0 - * WORLD_SID S-1-1-0 - * LOCAL_SID S-1-2-0 - * CREATOR_OWNER_SID S-1-3-0 - * CREATOR_GROUP_SID S-1-3-1 - * CREATOR_OWNER_SERVER_SID S-1-3-2 - * CREATOR_GROUP_SERVER_SID S-1-3-3 - * - * (Non-unique IDs) S-1-4 - * - * NT well-known SIDs: - * - * NT_AUTHORITY_SID S-1-5 - * DIALUP_SID S-1-5-1 - * - * NETWORD_SID S-1-5-2 - * BATCH_SID S-1-5-3 - * INTERACTIVE_SID S-1-5-4 - * SERVICE_SID S-1-5-6 - * ANONYMOUS_LOGON_SID S-1-5-7 (aka null logon session) - * PROXY_SID S-1-5-8 - * SERVER_LOGON_SID S-1-5-9 (aka domain controller account) - * SELF_SID S-1-5-10 (self RID) - * AUTHENTICATED_USER_SID S-1-5-11 - * RESTRICTED_CODE_SID S-1-5-12 (running restricted code) - * TERMINAL_SERVER_SID S-1-5-13 (running on terminal server) - * - * (Logon IDs) S-1-5-5-X-Y - * - * (NT non-unique IDs) S-1-5-0x15-... - * - * (Built-in domain) S-1-5-0x20 - */ - -/** - * union SID_IDENTIFIER_AUTHORITY - A 48-bit value used in the SID structure - * - * NOTE: This is stored as a big endian number. - */ -typedef union { - struct { - u16 high_part; /* High 16-bits. */ - u32 low_part; /* Low 32-bits. */ - } __attribute__((__packed__)); - u8 value[6]; /* Value as individual bytes. */ -} __attribute__((__packed__)) SID_IDENTIFIER_AUTHORITY; - -/** - * struct SID - - * - * The SID structure is a variable-length structure used to uniquely identify - * users or groups. SID stands for security identifier. - * - * The standard textual representation of the SID is of the form: - * S-R-I-S-S... - * Where: - * - The first "S" is the literal character 'S' identifying the following - * digits as a SID. - * - R is the revision level of the SID expressed as a sequence of digits - * in decimal. - * - I is the 48-bit identifier_authority, expressed as digits in decimal, - * if I < 2^32, or hexadecimal prefixed by "0x", if I >= 2^32. - * - S... is one or more sub_authority values, expressed as digits in - * decimal. - * - * Example SID; the domain-relative SID of the local Administrators group on - * Windows NT/2k: - * S-1-5-32-544 - * This translates to a SID with: - * revision = 1, - * sub_authority_count = 2, - * identifier_authority = {0,0,0,0,0,5}, // SECURITY_NT_AUTHORITY - * sub_authority[0] = 32, // SECURITY_BUILTIN_DOMAIN_RID - * sub_authority[1] = 544 // DOMAIN_ALIAS_RID_ADMINS - */ -typedef struct { - u8 revision; - u8 sub_authority_count; - SID_IDENTIFIER_AUTHORITY identifier_authority; - u32 sub_authority[1]; /* At least one sub_authority. */ -} __attribute__((__packed__)) SID; - -/** - * enum SID_CONSTANTS - Current constants for SIDs. - */ -typedef enum { - SID_REVISION = 1, /* Current revision level. */ - SID_MAX_SUB_AUTHORITIES = 15, /* Maximum number of those. */ - SID_RECOMMENDED_SUB_AUTHORITIES = 1, /* Will change to around 6 in - a future revision. */ -} SID_CONSTANTS; - -/** - * enum ACE_TYPES - The predefined ACE types (8-bit, see below). - */ -typedef enum { - ACCESS_MIN_MS_ACE_TYPE = 0, - ACCESS_ALLOWED_ACE_TYPE = 0, - ACCESS_DENIED_ACE_TYPE = 1, - SYSTEM_AUDIT_ACE_TYPE = 2, - SYSTEM_ALARM_ACE_TYPE = 3, /* Not implemented as of Win2k. */ - ACCESS_MAX_MS_V2_ACE_TYPE = 3, - - ACCESS_ALLOWED_COMPOUND_ACE_TYPE= 4, - ACCESS_MAX_MS_V3_ACE_TYPE = 4, - - /* The following are Win2k only. */ - ACCESS_MIN_MS_OBJECT_ACE_TYPE = 5, - ACCESS_ALLOWED_OBJECT_ACE_TYPE = 5, - ACCESS_DENIED_OBJECT_ACE_TYPE = 6, - SYSTEM_AUDIT_OBJECT_ACE_TYPE = 7, - SYSTEM_ALARM_OBJECT_ACE_TYPE = 8, - ACCESS_MAX_MS_OBJECT_ACE_TYPE = 8, - - ACCESS_MAX_MS_V4_ACE_TYPE = 8, - - /* This one is for WinNT&2k. */ - ACCESS_MAX_MS_ACE_TYPE = 8, -} __attribute__((__packed__)) ACE_TYPES; - -/** - * enum ACE_FLAGS - The ACE flags (8-bit) for audit and inheritance. - * - * SUCCESSFUL_ACCESS_ACE_FLAG is only used with system audit and alarm ACE - * types to indicate that a message is generated (in Windows!) for successful - * accesses. - * - * FAILED_ACCESS_ACE_FLAG is only used with system audit and alarm ACE types - * to indicate that a message is generated (in Windows!) for failed accesses. - */ -typedef enum { - /* The inheritance flags. */ - OBJECT_INHERIT_ACE = 0x01, - CONTAINER_INHERIT_ACE = 0x02, - NO_PROPAGATE_INHERIT_ACE = 0x04, - INHERIT_ONLY_ACE = 0x08, - INHERITED_ACE = 0x10, /* Win2k only. */ - VALID_INHERIT_FLAGS = 0x1f, - - /* The audit flags. */ - SUCCESSFUL_ACCESS_ACE_FLAG = 0x40, - FAILED_ACCESS_ACE_FLAG = 0x80, -} __attribute__((__packed__)) ACE_FLAGS; - -/** - * struct ACE_HEADER - - * - * An ACE is an access-control entry in an access-control list (ACL). - * An ACE defines access to an object for a specific user or group or defines - * the types of access that generate system-administration messages or alarms - * for a specific user or group. The user or group is identified by a security - * identifier (SID). - * - * Each ACE starts with an ACE_HEADER structure (aligned on 4-byte boundary), - * which specifies the type and size of the ACE. The format of the subsequent - * data depends on the ACE type. - */ -typedef struct { - ACE_TYPES type; /* Type of the ACE. */ - ACE_FLAGS flags; /* Flags describing the ACE. */ - u16 size; /* Size in bytes of the ACE. */ -} __attribute__((__packed__)) ACE_HEADER; - -/** - * enum ACCESS_MASK - The access mask (32-bit). - * - * Defines the access rights. - */ -typedef enum { - /* - * The specific rights (bits 0 to 15). Depend on the type of the - * object being secured by the ACE. - */ - - /* Specific rights for files and directories are as follows: */ - - /* Right to read data from the file. (FILE) */ - FILE_READ_DATA = const_cpu_to_le32(0x00000001), - /* Right to list contents of a directory. (DIRECTORY) */ - FILE_LIST_DIRECTORY = const_cpu_to_le32(0x00000001), - - /* Right to write data to the file. (FILE) */ - FILE_WRITE_DATA = const_cpu_to_le32(0x00000002), - /* Right to create a file in the directory. (DIRECTORY) */ - FILE_ADD_FILE = const_cpu_to_le32(0x00000002), - - /* Right to append data to the file. (FILE) */ - FILE_APPEND_DATA = const_cpu_to_le32(0x00000004), - /* Right to create a subdirectory. (DIRECTORY) */ - FILE_ADD_SUBDIRECTORY = const_cpu_to_le32(0x00000004), - - /* Right to read extended attributes. (FILE/DIRECTORY) */ - FILE_READ_EA = const_cpu_to_le32(0x00000008), - - /* Right to write extended attributes. (FILE/DIRECTORY) */ - FILE_WRITE_EA = const_cpu_to_le32(0x00000010), - - /* Right to execute a file. (FILE) */ - FILE_EXECUTE = const_cpu_to_le32(0x00000020), - /* Right to traverse the directory. (DIRECTORY) */ - FILE_TRAVERSE = const_cpu_to_le32(0x00000020), - - /* - * Right to delete a directory and all the files it contains (its - * children), even if the files are read-only. (DIRECTORY) - */ - FILE_DELETE_CHILD = const_cpu_to_le32(0x00000040), - - /* Right to read file attributes. (FILE/DIRECTORY) */ - FILE_READ_ATTRIBUTES = const_cpu_to_le32(0x00000080), - - /* Right to change file attributes. (FILE/DIRECTORY) */ - FILE_WRITE_ATTRIBUTES = const_cpu_to_le32(0x00000100), - - /* - * The standard rights (bits 16 to 23). Are independent of the type of - * object being secured. - */ - - /* Right to delete the object. */ - DELETE = const_cpu_to_le32(0x00010000), - - /* - * Right to read the information in the object's security descriptor, - * not including the information in the SACL. I.e. right to read the - * security descriptor and owner. - */ - READ_CONTROL = const_cpu_to_le32(0x00020000), - - /* Right to modify the DACL in the object's security descriptor. */ - WRITE_DAC = const_cpu_to_le32(0x00040000), - - /* Right to change the owner in the object's security descriptor. */ - WRITE_OWNER = const_cpu_to_le32(0x00080000), - - /* - * Right to use the object for synchronization. Enables a process to - * wait until the object is in the signalled state. Some object types - * do not support this access right. - */ - SYNCHRONIZE = const_cpu_to_le32(0x00100000), - - /* - * The following STANDARD_RIGHTS_* are combinations of the above for - * convenience and are defined by the Win32 API. - */ - - /* These are currently defined to READ_CONTROL. */ - STANDARD_RIGHTS_READ = const_cpu_to_le32(0x00020000), - STANDARD_RIGHTS_WRITE = const_cpu_to_le32(0x00020000), - STANDARD_RIGHTS_EXECUTE = const_cpu_to_le32(0x00020000), - - /* Combines DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER access. */ - STANDARD_RIGHTS_REQUIRED = const_cpu_to_le32(0x000f0000), - - /* - * Combines DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, and - * SYNCHRONIZE access. - */ - STANDARD_RIGHTS_ALL = const_cpu_to_le32(0x001f0000), - - /* - * The access system ACL and maximum allowed access types (bits 24 to - * 25, bits 26 to 27 are reserved). - */ - ACCESS_SYSTEM_SECURITY = const_cpu_to_le32(0x01000000), - MAXIMUM_ALLOWED = const_cpu_to_le32(0x02000000), - - /* - * The generic rights (bits 28 to 31). These map onto the standard and - * specific rights. - */ - - /* Read, write, and execute access. */ - GENERIC_ALL = const_cpu_to_le32(0x10000000), - - /* Execute access. */ - GENERIC_EXECUTE = const_cpu_to_le32(0x20000000), - - /* - * Write access. For files, this maps onto: - * FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA | - * FILE_WRITE_EA | STANDARD_RIGHTS_WRITE | SYNCHRONIZE - * For directories, the mapping has the same numerical value. See - * above for the descriptions of the rights granted. - */ - GENERIC_WRITE = const_cpu_to_le32(0x40000000), - - /* - * Read access. For files, this maps onto: - * FILE_READ_ATTRIBUTES | FILE_READ_DATA | FILE_READ_EA | - * STANDARD_RIGHTS_READ | SYNCHRONIZE - * For directories, the mapping has the same numerical value. See - * above for the descriptions of the rights granted. - */ - GENERIC_READ = const_cpu_to_le32(0x80000000), -} ACCESS_MASK; - -/** - * struct GENERIC_MAPPING - - * - * The generic mapping array. Used to denote the mapping of each generic - * access right to a specific access mask. - * - * FIXME: What exactly is this and what is it for? (AIA) - */ -typedef struct { - ACCESS_MASK generic_read; - ACCESS_MASK generic_write; - ACCESS_MASK generic_execute; - ACCESS_MASK generic_all; -} __attribute__((__packed__)) GENERIC_MAPPING; - -/* - * The predefined ACE type structures are as defined below. - */ - -/** - * struct ACCESS_DENIED_ACE - - * - * ACCESS_ALLOWED_ACE, ACCESS_DENIED_ACE, SYSTEM_AUDIT_ACE, SYSTEM_ALARM_ACE - */ -typedef struct { -/* 0 ACE_HEADER; -- Unfolded here as gcc doesn't like unnamed structs. */ - ACE_TYPES type; /* Type of the ACE. */ - ACE_FLAGS flags; /* Flags describing the ACE. */ - u16 size; /* Size in bytes of the ACE. */ - -/* 4*/ ACCESS_MASK mask; /* Access mask associated with the ACE. */ -/* 8*/ SID sid; /* The SID associated with the ACE. */ -} __attribute__((__packed__)) ACCESS_ALLOWED_ACE, ACCESS_DENIED_ACE, - SYSTEM_AUDIT_ACE, SYSTEM_ALARM_ACE; - -/** - * enum OBJECT_ACE_FLAGS - The object ACE flags (32-bit). - */ -typedef enum { - ACE_OBJECT_TYPE_PRESENT = const_cpu_to_le32(1), - ACE_INHERITED_OBJECT_TYPE_PRESENT = const_cpu_to_le32(2), -} OBJECT_ACE_FLAGS; - -/** - * struct ACCESS_ALLOWED_OBJECT_ACE - - */ -typedef struct { -/* 0 ACE_HEADER; -- Unfolded here as gcc doesn't like unnamed structs. */ - ACE_TYPES type; /* Type of the ACE. */ - ACE_FLAGS flags; /* Flags describing the ACE. */ - u16 size; /* Size in bytes of the ACE. */ - -/* 4*/ ACCESS_MASK mask; /* Access mask associated with the ACE. */ -/* 8*/ OBJECT_ACE_FLAGS object_flags; /* Flags describing the object ACE. */ -/* 12*/ GUID object_type; -/* 28*/ GUID inherited_object_type; -/* 44*/ SID sid; /* The SID associated with the ACE. */ -} __attribute__((__packed__)) ACCESS_ALLOWED_OBJECT_ACE, - ACCESS_DENIED_OBJECT_ACE, - SYSTEM_AUDIT_OBJECT_ACE, - SYSTEM_ALARM_OBJECT_ACE; - -/** - * struct ACL - An ACL is an access-control list (ACL). - * - * An ACL starts with an ACL header structure, which specifies the size of - * the ACL and the number of ACEs it contains. The ACL header is followed by - * zero or more access control entries (ACEs). The ACL as well as each ACE - * are aligned on 4-byte boundaries. - */ -typedef struct { - u8 revision; /* Revision of this ACL. */ - u8 alignment1; - u16 size; /* Allocated space in bytes for ACL. Includes this - header, the ACEs and the remaining free space. */ - u16 ace_count; /* Number of ACEs in the ACL. */ - u16 alignment2; -/* sizeof() = 8 bytes */ -} __attribute__((__packed__)) ACL; - -/** - * enum ACL_CONSTANTS - Current constants for ACLs. - */ -typedef enum { - /* Current revision. */ - ACL_REVISION = 2, - ACL_REVISION_DS = 4, - - /* History of revisions. */ - ACL_REVISION1 = 1, - MIN_ACL_REVISION = 2, - ACL_REVISION2 = 2, - ACL_REVISION3 = 3, - ACL_REVISION4 = 4, - MAX_ACL_REVISION = 4, -} ACL_CONSTANTS; - -/** - * enum SECURITY_DESCRIPTOR_CONTROL - - * - * The security descriptor control flags (16-bit). - * - * SE_OWNER_DEFAULTED - This boolean flag, when set, indicates that the - * SID pointed to by the Owner field was provided by a - * defaulting mechanism rather than explicitly provided by the - * original provider of the security descriptor. This may - * affect the treatment of the SID with respect to inheritance - * of an owner. - * - * SE_GROUP_DEFAULTED - This boolean flag, when set, indicates that the - * SID in the Group field was provided by a defaulting mechanism - * rather than explicitly provided by the original provider of - * the security descriptor. This may affect the treatment of - * the SID with respect to inheritance of a primary group. - * - * SE_DACL_PRESENT - This boolean flag, when set, indicates that the - * security descriptor contains a discretionary ACL. If this - * flag is set and the Dacl field of the SECURITY_DESCRIPTOR is - * null, then a null ACL is explicitly being specified. - * - * SE_DACL_DEFAULTED - This boolean flag, when set, indicates that the - * ACL pointed to by the Dacl field was provided by a defaulting - * mechanism rather than explicitly provided by the original - * provider of the security descriptor. This may affect the - * treatment of the ACL with respect to inheritance of an ACL. - * This flag is ignored if the DaclPresent flag is not set. - * - * SE_SACL_PRESENT - This boolean flag, when set, indicates that the - * security descriptor contains a system ACL pointed to by the - * Sacl field. If this flag is set and the Sacl field of the - * SECURITY_DESCRIPTOR is null, then an empty (but present) - * ACL is being specified. - * - * SE_SACL_DEFAULTED - This boolean flag, when set, indicates that the - * ACL pointed to by the Sacl field was provided by a defaulting - * mechanism rather than explicitly provided by the original - * provider of the security descriptor. This may affect the - * treatment of the ACL with respect to inheritance of an ACL. - * This flag is ignored if the SaclPresent flag is not set. - * - * SE_SELF_RELATIVE - This boolean flag, when set, indicates that the - * security descriptor is in self-relative form. In this form, - * all fields of the security descriptor are contiguous in memory - * and all pointer fields are expressed as offsets from the - * beginning of the security descriptor. - */ -typedef enum { - SE_OWNER_DEFAULTED = const_cpu_to_le16(0x0001), - SE_GROUP_DEFAULTED = const_cpu_to_le16(0x0002), - SE_DACL_PRESENT = const_cpu_to_le16(0x0004), - SE_DACL_DEFAULTED = const_cpu_to_le16(0x0008), - SE_SACL_PRESENT = const_cpu_to_le16(0x0010), - SE_SACL_DEFAULTED = const_cpu_to_le16(0x0020), - SE_DACL_AUTO_INHERIT_REQ = const_cpu_to_le16(0x0100), - SE_SACL_AUTO_INHERIT_REQ = const_cpu_to_le16(0x0200), - SE_DACL_AUTO_INHERITED = const_cpu_to_le16(0x0400), - SE_SACL_AUTO_INHERITED = const_cpu_to_le16(0x0800), - SE_DACL_PROTECTED = const_cpu_to_le16(0x1000), - SE_SACL_PROTECTED = const_cpu_to_le16(0x2000), - SE_RM_CONTROL_VALID = const_cpu_to_le16(0x4000), - SE_SELF_RELATIVE = const_cpu_to_le16(0x8000), -} __attribute__((__packed__)) SECURITY_DESCRIPTOR_CONTROL; - -/** - * struct SECURITY_DESCRIPTOR_RELATIVE - - * - * Self-relative security descriptor. Contains the owner and group SIDs as well - * as the sacl and dacl ACLs inside the security descriptor itself. - */ -typedef struct { - u8 revision; /* Revision level of the security descriptor. */ - u8 alignment; - SECURITY_DESCRIPTOR_CONTROL control; /* Flags qualifying the type of - the descriptor as well as the following fields. */ - u32 owner; /* Byte offset to a SID representing an object's - owner. If this is NULL, no owner SID is present in - the descriptor. */ - u32 group; /* Byte offset to a SID representing an object's - primary group. If this is NULL, no primary group - SID is present in the descriptor. */ - u32 sacl; /* Byte offset to a system ACL. Only valid, if - SE_SACL_PRESENT is set in the control field. If - SE_SACL_PRESENT is set but sacl is NULL, a NULL ACL - is specified. */ - u32 dacl; /* Byte offset to a discretionary ACL. Only valid, if - SE_DACL_PRESENT is set in the control field. If - SE_DACL_PRESENT is set but dacl is NULL, a NULL ACL - (unconditionally granting access) is specified. */ -/* sizeof() = 0x14 bytes */ -} __attribute__((__packed__)) SECURITY_DESCRIPTOR_RELATIVE; - -/** - * struct SECURITY_DESCRIPTOR - Absolute security descriptor. - * - * Does not contain the owner and group SIDs, nor the sacl and dacl ACLs inside - * the security descriptor. Instead, it contains pointers to these structures - * in memory. Obviously, absolute security descriptors are only useful for in - * memory representations of security descriptors. - * - * On disk, a self-relative security descriptor is used. - */ -typedef struct { - u8 revision; /* Revision level of the security descriptor. */ - u8 alignment; - SECURITY_DESCRIPTOR_CONTROL control; /* Flags qualifying the type of - the descriptor as well as the following fields. */ - SID *owner; /* Points to a SID representing an object's owner. If - this is NULL, no owner SID is present in the - descriptor. */ - SID *group; /* Points to a SID representing an object's primary - group. If this is NULL, no primary group SID is - present in the descriptor. */ - ACL *sacl; /* Points to a system ACL. Only valid, if - SE_SACL_PRESENT is set in the control field. If - SE_SACL_PRESENT is set but sacl is NULL, a NULL ACL - is specified. */ - ACL *dacl; /* Points to a discretionary ACL. Only valid, if - SE_DACL_PRESENT is set in the control field. If - SE_DACL_PRESENT is set but dacl is NULL, a NULL ACL - (unconditionally granting access) is specified. */ -} __attribute__((__packed__)) SECURITY_DESCRIPTOR; - -/** - * enum SECURITY_DESCRIPTOR_CONSTANTS - - * - * Current constants for security descriptors. - */ -typedef enum { - /* Current revision. */ - SECURITY_DESCRIPTOR_REVISION = 1, - SECURITY_DESCRIPTOR_REVISION1 = 1, - - /* The sizes of both the absolute and relative security descriptors is - the same as pointers, at least on ia32 architecture are 32-bit. */ - SECURITY_DESCRIPTOR_MIN_LENGTH = sizeof(SECURITY_DESCRIPTOR), -} SECURITY_DESCRIPTOR_CONSTANTS; - -/* - * Attribute: Security descriptor (0x50). - * - * A standard self-relative security descriptor. - * - * NOTE: Can be resident or non-resident. - * NOTE: Not used in NTFS 3.0+, as security descriptors are stored centrally - * in FILE_Secure and the correct descriptor is found using the security_id - * from the standard information attribute. - */ -typedef SECURITY_DESCRIPTOR_RELATIVE SECURITY_DESCRIPTOR_ATTR; - -/* - * On NTFS 3.0+, all security descriptors are stored in FILE_Secure. Only one - * referenced instance of each unique security descriptor is stored. - * - * FILE_Secure contains no unnamed data attribute, i.e. it has zero length. It - * does, however, contain two indexes ($SDH and $SII) as well as a named data - * stream ($SDS). - * - * Every unique security descriptor is assigned a unique security identifier - * (security_id, not to be confused with a SID). The security_id is unique for - * the NTFS volume and is used as an index into the $SII index, which maps - * security_ids to the security descriptor's storage location within the $SDS - * data attribute. The $SII index is sorted by ascending security_id. - * - * A simple hash is computed from each security descriptor. This hash is used - * as an index into the $SDH index, which maps security descriptor hashes to - * the security descriptor's storage location within the $SDS data attribute. - * The $SDH index is sorted by security descriptor hash and is stored in a B+ - * tree. When searching $SDH (with the intent of determining whether or not a - * new security descriptor is already present in the $SDS data stream), if a - * matching hash is found, but the security descriptors do not match, the - * search in the $SDH index is continued, searching for a next matching hash. - * - * When a precise match is found, the security_id corresponding to the security - * descriptor in the $SDS attribute is read from the found $SDH index entry and - * is stored in the $STANDARD_INFORMATION attribute of the file/directory to - * which the security descriptor is being applied. The $STANDARD_INFORMATION - * attribute is present in all base mft records (i.e. in all files and - * directories). - * - * If a match is not found, the security descriptor is assigned a new unique - * security_id and is added to the $SDS data attribute. Then, entries - * referencing the this security descriptor in the $SDS data attribute are - * added to the $SDH and $SII indexes. - * - * Note: Entries are never deleted from FILE_Secure, even if nothing - * references an entry any more. - */ - -/** - * struct SECURITY_DESCRIPTOR_HEADER - - * - * This header precedes each security descriptor in the $SDS data stream. - * This is also the index entry data part of both the $SII and $SDH indexes. - */ -typedef struct { - u32 hash; /* Hash of the security descriptor. */ - u32 security_id; /* The security_id assigned to the descriptor. */ - u64 offset; /* Byte offset of this entry in the $SDS stream. */ - u32 length; /* Size in bytes of this entry in $SDS stream. */ -} __attribute__((__packed__)) SECURITY_DESCRIPTOR_HEADER; - -/** - * struct SDH_INDEX_DATA - - */ -typedef struct { - u32 hash; /* Hash of the security descriptor. */ - u32 security_id; /* The security_id assigned to the descriptor. */ - u64 offset; /* Byte offset of this entry in the $SDS stream. */ - u32 length; /* Size in bytes of this entry in $SDS stream. */ - u32 reserved_II; /* Padding - always unicode "II" or zero. This field - isn't counted in INDEX_ENTRY's data_length. */ -} __attribute__((__packed__)) SDH_INDEX_DATA; - -/** - * struct SII_INDEX_DATA - - */ -typedef SECURITY_DESCRIPTOR_HEADER SII_INDEX_DATA; - -/** - * struct SDS_ENTRY - - * - * The $SDS data stream contains the security descriptors, aligned on 16-byte - * boundaries, sorted by security_id in a B+ tree. Security descriptors cannot - * cross 256kib boundaries (this restriction is imposed by the Windows cache - * manager). Each security descriptor is contained in a SDS_ENTRY structure. - * Also, each security descriptor is stored twice in the $SDS stream with a - * fixed offset of 0x40000 bytes (256kib, the Windows cache manager's max size) - * between them; i.e. if a SDS_ENTRY specifies an offset of 0x51d0, then the - * the first copy of the security descriptor will be at offset 0x51d0 in the - * $SDS data stream and the second copy will be at offset 0x451d0. - */ -typedef struct { -/* 0 SECURITY_DESCRIPTOR_HEADER; -- Unfolded here as gcc doesn't like - unnamed structs. */ - u32 hash; /* Hash of the security descriptor. */ - u32 security_id; /* The security_id assigned to the descriptor. */ - u64 offset; /* Byte offset of this entry in the $SDS stream. */ - u32 length; /* Size in bytes of this entry in $SDS stream. */ -/* 20*/ SECURITY_DESCRIPTOR_RELATIVE sid; /* The self-relative security - descriptor. */ -} __attribute__((__packed__)) SDS_ENTRY; - -/** - * struct SII_INDEX_KEY - The index entry key used in the $SII index. - * - * The collation type is COLLATION_NTOFS_ULONG. - */ -typedef struct { - u32 security_id; /* The security_id assigned to the descriptor. */ -} __attribute__((__packed__)) SII_INDEX_KEY; - -/** - * struct SDH_INDEX_KEY - The index entry key used in the $SDH index. - * - * The keys are sorted first by hash and then by security_id. - * The collation rule is COLLATION_NTOFS_SECURITY_HASH. - */ -typedef struct { - u32 hash; /* Hash of the security descriptor. */ - u32 security_id; /* The security_id assigned to the descriptor. */ -} __attribute__((__packed__)) SDH_INDEX_KEY; - -/** - * struct VOLUME_NAME - Attribute: Volume name (0x60). - * - * NOTE: Always resident. - * NOTE: Present only in FILE_Volume. - */ -typedef struct { - ntfschar name[0]; /* The name of the volume in Unicode. */ -} __attribute__((__packed__)) VOLUME_NAME; - -/** - * enum VOLUME_FLAGS - Possible flags for the volume (16-bit). - */ -typedef enum { - VOLUME_IS_DIRTY = const_cpu_to_le16(0x0001), - VOLUME_RESIZE_LOG_FILE = const_cpu_to_le16(0x0002), - VOLUME_UPGRADE_ON_MOUNT = const_cpu_to_le16(0x0004), - VOLUME_MOUNTED_ON_NT4 = const_cpu_to_le16(0x0008), - VOLUME_DELETE_USN_UNDERWAY = const_cpu_to_le16(0x0010), - VOLUME_REPAIR_OBJECT_ID = const_cpu_to_le16(0x0020), - VOLUME_CHKDSK_UNDERWAY = const_cpu_to_le16(0x4000), - VOLUME_MODIFIED_BY_CHKDSK = const_cpu_to_le16(0x8000), - VOLUME_FLAGS_MASK = const_cpu_to_le16(0xc03f), -} __attribute__((__packed__)) VOLUME_FLAGS; - -/** - * struct VOLUME_INFORMATION - Attribute: Volume information (0x70). - * - * NOTE: Always resident. - * NOTE: Present only in FILE_Volume. - * NOTE: Windows 2000 uses NTFS 3.0 while Windows NT4 service pack 6a uses - * NTFS 1.2. I haven't personally seen other values yet. - */ -typedef struct { - u64 reserved; /* Not used (yet?). */ - u8 major_ver; /* Major version of the ntfs format. */ - u8 minor_ver; /* Minor version of the ntfs format. */ - VOLUME_FLAGS flags; /* Bit array of VOLUME_* flags. */ -} __attribute__((__packed__)) VOLUME_INFORMATION; - -/** - * struct DATA_ATTR - Attribute: Data attribute (0x80). - * - * NOTE: Can be resident or non-resident. - * - * Data contents of a file (i.e. the unnamed stream) or of a named stream. - */ -typedef struct { - u8 data[0]; /* The file's data contents. */ -} __attribute__((__packed__)) DATA_ATTR; - -/** - * enum INDEX_HEADER_FLAGS - Index header flags (8-bit). - */ -typedef enum { - /* When index header is in an index root attribute: */ - SMALL_INDEX = 0, /* The index is small enough to fit inside the - index root attribute and there is no index - allocation attribute present. */ - LARGE_INDEX = 1, /* The index is too large to fit in the index - root attribute and/or an index allocation - attribute is present. */ - /* - * When index header is in an index block, i.e. is part of index - * allocation attribute: - */ - LEAF_NODE = 0, /* This is a leaf node, i.e. there are no more - nodes branching off it. */ - INDEX_NODE = 1, /* This node indexes other nodes, i.e. is not a - leaf node. */ - NODE_MASK = 1, /* Mask for accessing the *_NODE bits. */ -} __attribute__((__packed__)) INDEX_HEADER_FLAGS; - -/** - * struct INDEX_HEADER - - * - * This is the header for indexes, describing the INDEX_ENTRY records, which - * follow the INDEX_HEADER. Together the index header and the index entries - * make up a complete index. - * - * IMPORTANT NOTE: The offset, length and size structure members are counted - * relative to the start of the index header structure and not relative to the - * start of the index root or index allocation structures themselves. - */ -typedef struct { -/* 0*/ u32 entries_offset; /* Byte offset from the INDEX_HEADER to first - INDEX_ENTRY, aligned to 8-byte boundary. */ -/* 4*/ u32 index_length; /* Data size in byte of the INDEX_ENTRY's, - including the INDEX_HEADER, aligned to 8. */ -/* 8*/ u32 allocated_size; /* Allocated byte size of this index (block), - multiple of 8 bytes. See more below. */ - /* - For the index root attribute, the above two numbers are always - equal, as the attribute is resident and it is resized as needed. - - For the index allocation attribute, the attribute is not resident - and the allocated_size is equal to the index_block_size specified - by the corresponding INDEX_ROOT attribute minus the INDEX_BLOCK - size not counting the INDEX_HEADER part (i.e. minus -24). - */ -/* 12*/ INDEX_HEADER_FLAGS ih_flags; /* Bit field of INDEX_HEADER_FLAGS. */ -/* 13*/ u8 reserved[3]; /* Reserved/align to 8-byte boundary.*/ -/* sizeof() == 16 */ -} __attribute__((__packed__)) INDEX_HEADER; - -/** - * struct INDEX_ROOT - Attribute: Index root (0x90). - * - * NOTE: Always resident. - * - * This is followed by a sequence of index entries (INDEX_ENTRY structures) - * as described by the index header. - * - * When a directory is small enough to fit inside the index root then this - * is the only attribute describing the directory. When the directory is too - * large to fit in the index root, on the other hand, two additional attributes - * are present: an index allocation attribute, containing sub-nodes of the B+ - * directory tree (see below), and a bitmap attribute, describing which virtual - * cluster numbers (vcns) in the index allocation attribute are in use by an - * index block. - * - * NOTE: The root directory (FILE_root) contains an entry for itself. Other - * directories do not contain entries for themselves, though. - */ -typedef struct { -/* 0*/ ATTR_TYPES type; /* Type of the indexed attribute. Is - $FILE_NAME for directories, zero - for view indexes. No other values - allowed. */ -/* 4*/ COLLATION_RULES collation_rule; /* Collation rule used to sort the - index entries. If type is $FILE_NAME, - this must be COLLATION_FILE_NAME. */ -/* 8*/ u32 index_block_size; /* Size of index block in bytes (in - the index allocation attribute). */ -/* 12*/ s8 clusters_per_index_block; /* Size of index block in clusters (in - the index allocation attribute), when - an index block is >= than a cluster, - otherwise sectors per index block. */ -/* 13*/ u8 reserved[3]; /* Reserved/align to 8-byte boundary. */ -/* 16*/ INDEX_HEADER index; /* Index header describing the - following index entries. */ -/* sizeof()= 32 bytes */ -} __attribute__((__packed__)) INDEX_ROOT; - -/** - * struct INDEX_BLOCK - Attribute: Index allocation (0xa0). - * - * NOTE: Always non-resident (doesn't make sense to be resident anyway!). - * - * This is an array of index blocks. Each index block starts with an - * INDEX_BLOCK structure containing an index header, followed by a sequence of - * index entries (INDEX_ENTRY structures), as described by the INDEX_HEADER. - */ -typedef struct { -/* 0 NTFS_RECORD; -- Unfolded here as gcc doesn't like unnamed structs. */ - NTFS_RECORD_TYPES magic;/* Magic is "INDX". */ - u16 usa_ofs; /* See NTFS_RECORD definition. */ - u16 usa_count; /* See NTFS_RECORD definition. */ - -/* 8*/ LSN lsn; /* $LogFile sequence number of the last - modification of this index block. */ -/* 16*/ VCN index_block_vcn; /* Virtual cluster number of the index block. */ -/* 24*/ INDEX_HEADER index; /* Describes the following index entries. */ -/* sizeof()= 40 (0x28) bytes */ -/* - * When creating the index block, we place the update sequence array at this - * offset, i.e. before we start with the index entries. This also makes sense, - * otherwise we could run into problems with the update sequence array - * containing in itself the last two bytes of a sector which would mean that - * multi sector transfer protection wouldn't work. As you can't protect data - * by overwriting it since you then can't get it back... - * When reading use the data from the ntfs record header. - */ -} __attribute__((__packed__)) INDEX_BLOCK; - -typedef INDEX_BLOCK INDEX_ALLOCATION; - -/** - * struct REPARSE_INDEX_KEY - - * - * The system file FILE_Extend/$Reparse contains an index named $R listing - * all reparse points on the volume. The index entry keys are as defined - * below. Note, that there is no index data associated with the index entries. - * - * The index entries are sorted by the index key file_id. The collation rule is - * COLLATION_NTOFS_ULONGS. FIXME: Verify whether the reparse_tag is not the - * primary key / is not a key at all. (AIA) - */ -typedef struct { - u32 reparse_tag; /* Reparse point type (inc. flags). */ - MFT_REF file_id; /* Mft record of the file containing the - reparse point attribute. */ -} __attribute__((__packed__)) REPARSE_INDEX_KEY; - -/** - * enum QUOTA_FLAGS - Quota flags (32-bit). - */ -typedef enum { - /* The user quota flags. Names explain meaning. */ - QUOTA_FLAG_DEFAULT_LIMITS = const_cpu_to_le32(0x00000001), - QUOTA_FLAG_LIMIT_REACHED = const_cpu_to_le32(0x00000002), - QUOTA_FLAG_ID_DELETED = const_cpu_to_le32(0x00000004), - - QUOTA_FLAG_USER_MASK = const_cpu_to_le32(0x00000007), - /* Bit mask for user quota flags. */ - - /* These flags are only present in the quota defaults index entry, - i.e. in the entry where owner_id = QUOTA_DEFAULTS_ID. */ - QUOTA_FLAG_TRACKING_ENABLED = const_cpu_to_le32(0x00000010), - QUOTA_FLAG_ENFORCEMENT_ENABLED = const_cpu_to_le32(0x00000020), - QUOTA_FLAG_TRACKING_REQUESTED = const_cpu_to_le32(0x00000040), - QUOTA_FLAG_LOG_THRESHOLD = const_cpu_to_le32(0x00000080), - QUOTA_FLAG_LOG_LIMIT = const_cpu_to_le32(0x00000100), - QUOTA_FLAG_OUT_OF_DATE = const_cpu_to_le32(0x00000200), - QUOTA_FLAG_CORRUPT = const_cpu_to_le32(0x00000400), - QUOTA_FLAG_PENDING_DELETES = const_cpu_to_le32(0x00000800), -} QUOTA_FLAGS; - -/** - * struct QUOTA_CONTROL_ENTRY - - * - * The system file FILE_Extend/$Quota contains two indexes $O and $Q. Quotas - * are on a per volume and per user basis. - * - * The $Q index contains one entry for each existing user_id on the volume. The - * index key is the user_id of the user/group owning this quota control entry, - * i.e. the key is the owner_id. The user_id of the owner of a file, i.e. the - * owner_id, is found in the standard information attribute. The collation rule - * for $Q is COLLATION_NTOFS_ULONG. - * - * The $O index contains one entry for each user/group who has been assigned - * a quota on that volume. The index key holds the SID of the user_id the - * entry belongs to, i.e. the owner_id. The collation rule for $O is - * COLLATION_NTOFS_SID. - * - * The $O index entry data is the user_id of the user corresponding to the SID. - * This user_id is used as an index into $Q to find the quota control entry - * associated with the SID. - * - * The $Q index entry data is the quota control entry and is defined below. - */ -typedef struct { - u32 version; /* Currently equals 2. */ - QUOTA_FLAGS flags; /* Flags describing this quota entry. */ - u64 bytes_used; /* How many bytes of the quota are in use. */ - s64 change_time; /* Last time this quota entry was changed. */ - s64 threshold; /* Soft quota (-1 if not limited). */ - s64 limit; /* Hard quota (-1 if not limited). */ - s64 exceeded_time; /* How long the soft quota has been exceeded. */ -/* The below field is NOT present for the quota defaults entry. */ - SID sid; /* The SID of the user/object associated with - this quota entry. If this field is missing - then the INDEX_ENTRY is padded with zeros - to multiply of 8 which are not counted in - the data_length field. If the sid is present - then this structure is padded with zeros to - multiply of 8 and the padding is counted in - the INDEX_ENTRY's data_length. */ -} __attribute__((__packed__)) QUOTA_CONTROL_ENTRY; - -/** - * struct QUOTA_O_INDEX_DATA - - */ -typedef struct { - u32 owner_id; - u32 unknown; /* Always 32. Seems to be padding and it's not - counted in the INDEX_ENTRY's data_length. - This field shouldn't be really here. */ -} __attribute__((__packed__)) QUOTA_O_INDEX_DATA; - -/** - * enum PREDEFINED_OWNER_IDS - Predefined owner_id values (32-bit). - */ -typedef enum { - QUOTA_INVALID_ID = const_cpu_to_le32(0x00000000), - QUOTA_DEFAULTS_ID = const_cpu_to_le32(0x00000001), - QUOTA_FIRST_USER_ID = const_cpu_to_le32(0x00000100), -} PREDEFINED_OWNER_IDS; - -/** - * enum INDEX_ENTRY_FLAGS - Index entry flags (16-bit). - */ -typedef enum { - INDEX_ENTRY_NODE = const_cpu_to_le16(1), /* This entry contains a - sub-node, i.e. a reference to an index - block in form of a virtual cluster - number (see below). */ - INDEX_ENTRY_END = const_cpu_to_le16(2), /* This signifies the last - entry in an index block. The index - entry does not represent a file but it - can point to a sub-node. */ - INDEX_ENTRY_SPACE_FILLER = 0xffff, /* Just to force 16-bit width. */ -} __attribute__((__packed__)) INDEX_ENTRY_FLAGS; - -/** - * struct INDEX_ENTRY_HEADER - This the index entry header (see below). - * - * ========================================================== - * !!!!! SEE DESCRIPTION OF THE FIELDS AT INDEX_ENTRY !!!!! - * ========================================================== - */ -typedef struct { -/* 0*/ union { - MFT_REF indexed_file; - struct { - u16 data_offset; - u16 data_length; - u32 reservedV; - } __attribute__((__packed__)); - } __attribute__((__packed__)); -/* 8*/ u16 length; -/* 10*/ u16 key_length; -/* 12*/ INDEX_ENTRY_FLAGS flags; -/* 14*/ u16 reserved; -/* sizeof() = 16 bytes */ -} __attribute__((__packed__)) INDEX_ENTRY_HEADER; - -/** - * struct INDEX_ENTRY - This is an index entry. - * - * A sequence of such entries follows each INDEX_HEADER structure. Together - * they make up a complete index. The index follows either an index root - * attribute or an index allocation attribute. - * - * NOTE: Before NTFS 3.0 only filename attributes were indexed. - */ -typedef struct { -/* 0 INDEX_ENTRY_HEADER; -- Unfolded here as gcc dislikes unnamed structs. */ - union { /* Only valid when INDEX_ENTRY_END is not set. */ - MFT_REF indexed_file; /* The mft reference of the file - described by this index - entry. Used for directory - indexes. */ - struct { /* Used for views/indexes to find the entry's data. */ - u16 data_offset; /* Data byte offset from this - INDEX_ENTRY. Follows the - index key. */ - u16 data_length; /* Data length in bytes. */ - u32 reservedV; /* Reserved (zero). */ - } __attribute__((__packed__)); - } __attribute__((__packed__)); -/* 8*/ u16 length; /* Byte size of this index entry, multiple of - 8-bytes. Size includes INDEX_ENTRY_HEADER - and the optional subnode VCN. See below. */ -/* 10*/ u16 key_length; /* Byte size of the key value, which is in the - index entry. It follows field reserved. Not - multiple of 8-bytes. */ -/* 12*/ INDEX_ENTRY_FLAGS ie_flags; /* Bit field of INDEX_ENTRY_* flags. */ -/* 14*/ u16 reserved; /* Reserved/align to 8-byte boundary. */ -/* End of INDEX_ENTRY_HEADER */ -/* 16*/ union { /* The key of the indexed attribute. NOTE: Only present - if INDEX_ENTRY_END bit in flags is not set. NOTE: On - NTFS versions before 3.0 the only valid key is the - FILE_NAME_ATTR. On NTFS 3.0+ the following - additional index keys are defined: */ - FILE_NAME_ATTR file_name;/* $I30 index in directories. */ - SII_INDEX_KEY sii; /* $SII index in $Secure. */ - SDH_INDEX_KEY sdh; /* $SDH index in $Secure. */ - GUID object_id; /* $O index in FILE_Extend/$ObjId: The - object_id of the mft record found in - the data part of the index. */ - REPARSE_INDEX_KEY reparse; /* $R index in - FILE_Extend/$Reparse. */ - SID sid; /* $O index in FILE_Extend/$Quota: - SID of the owner of the user_id. */ - u32 owner_id; /* $Q index in FILE_Extend/$Quota: - user_id of the owner of the quota - control entry in the data part of - the index. */ - } __attribute__((__packed__)) key; - /* The (optional) index data is inserted here when creating. - VCN vcn; If INDEX_ENTRY_NODE bit in ie_flags is set, the last - eight bytes of this index entry contain the virtual - cluster number of the index block that holds the - entries immediately preceding the current entry. - - If the key_length is zero, then the vcn immediately - follows the INDEX_ENTRY_HEADER. - - The address of the vcn of "ie" INDEX_ENTRY is given by - (char*)ie + le16_to_cpu(ie->length) - sizeof(VCN) - */ -} __attribute__((__packed__)) INDEX_ENTRY; - -/** - * struct BITMAP_ATTR - Attribute: Bitmap (0xb0). - * - * Contains an array of bits (aka a bitfield). - * - * When used in conjunction with the index allocation attribute, each bit - * corresponds to one index block within the index allocation attribute. Thus - * the number of bits in the bitmap * index block size / cluster size is the - * number of clusters in the index allocation attribute. - */ -typedef struct { - u8 bitmap[0]; /* Array of bits. */ -} __attribute__((__packed__)) BITMAP_ATTR; - -/** - * enum PREDEFINED_REPARSE_TAGS - - * - * The reparse point tag defines the type of the reparse point. It also - * includes several flags, which further describe the reparse point. - * - * The reparse point tag is an unsigned 32-bit value divided in three parts: - * - * 1. The least significant 16 bits (i.e. bits 0 to 15) specify the type of - * the reparse point. - * 2. The 13 bits after this (i.e. bits 16 to 28) are reserved for future use. - * 3. The most significant three bits are flags describing the reparse point. - * They are defined as follows: - * bit 29: Name surrogate bit. If set, the filename is an alias for - * another object in the system. - * bit 30: High-latency bit. If set, accessing the first byte of data will - * be slow. (E.g. the data is stored on a tape drive.) - * bit 31: Microsoft bit. If set, the tag is owned by Microsoft. User - * defined tags have to use zero here. - */ -typedef enum { - IO_REPARSE_TAG_IS_ALIAS = const_cpu_to_le32(0x20000000), - IO_REPARSE_TAG_IS_HIGH_LATENCY = const_cpu_to_le32(0x40000000), - IO_REPARSE_TAG_IS_MICROSOFT = const_cpu_to_le32(0x80000000), - - IO_REPARSE_TAG_RESERVED_ZERO = const_cpu_to_le32(0x00000000), - IO_REPARSE_TAG_RESERVED_ONE = const_cpu_to_le32(0x00000001), - IO_REPARSE_TAG_RESERVED_RANGE = const_cpu_to_le32(0x00000001), - - IO_REPARSE_TAG_NSS = const_cpu_to_le32(0x68000005), - IO_REPARSE_TAG_NSS_RECOVER = const_cpu_to_le32(0x68000006), - IO_REPARSE_TAG_SIS = const_cpu_to_le32(0x68000007), - IO_REPARSE_TAG_DFS = const_cpu_to_le32(0x68000008), - - IO_REPARSE_TAG_MOUNT_POINT = const_cpu_to_le32(0x88000003), - - IO_REPARSE_TAG_HSM = const_cpu_to_le32(0xa8000004), - - IO_REPARSE_TAG_SYMBOLIC_LINK = const_cpu_to_le32(0xe8000000), - - IO_REPARSE_TAG_VALID_VALUES = const_cpu_to_le32(0xe000ffff), -} PREDEFINED_REPARSE_TAGS; - -/** - * struct REPARSE_POINT - Attribute: Reparse point (0xc0). - * - * NOTE: Can be resident or non-resident. - */ -typedef struct { - u32 reparse_tag; /* Reparse point type (inc. flags). */ - u16 reparse_data_length; /* Byte size of reparse data. */ - u16 reserved; /* Align to 8-byte boundary. */ - u8 reparse_data[0]; /* Meaning depends on reparse_tag. */ -} __attribute__((__packed__)) REPARSE_POINT; - -/** - * struct EA_INFORMATION - Attribute: Extended attribute information (0xd0). - * - * NOTE: Always resident. - */ -typedef struct { - u16 ea_length; /* Byte size of the packed extended - attributes. */ - u16 need_ea_count; /* The number of extended attributes which have - the NEED_EA bit set. */ - u32 ea_query_length; /* Byte size of the buffer required to query - the extended attributes when calling - ZwQueryEaFile() in Windows NT/2k. I.e. the - byte size of the unpacked extended - attributes. */ -} __attribute__((__packed__)) EA_INFORMATION; - -/** - * enum EA_FLAGS - Extended attribute flags (8-bit). - */ -typedef enum { - NEED_EA = 0x80, /* Indicate that the file to which the EA - belongs cannot be interpreted without - understanding the associated extended - attributes. */ -} __attribute__((__packed__)) EA_FLAGS; - -/** - * struct EA_ATTR - Attribute: Extended attribute (EA) (0xe0). - * - * Like the attribute list and the index buffer list, the EA attribute value is - * a sequence of EA_ATTR variable length records. - * - * FIXME: It appears weird that the EA name is not Unicode. Is it true? - * FIXME: It seems that name is always uppercased. Is it true? - */ -typedef struct { - u32 next_entry_offset; /* Offset to the next EA_ATTR. */ - EA_FLAGS flags; /* Flags describing the EA. */ - u8 name_length; /* Length of the name of the extended - attribute in bytes. */ - u16 value_length; /* Byte size of the EA's value. */ - u8 name[0]; /* Name of the EA. */ - u8 value[0]; /* The value of the EA. Immediately - follows the name. */ -} __attribute__((__packed__)) EA_ATTR; - -/** - * struct PROPERTY_SET - Attribute: Property set (0xf0). - * - * Intended to support Native Structure Storage (NSS) - a feature removed from - * NTFS 3.0 during beta testing. - */ -typedef struct { - /* Irrelevant as feature unused. */ -} __attribute__((__packed__)) PROPERTY_SET; - -/** - * struct LOGGED_UTILITY_STREAM - Attribute: Logged utility stream (0x100). - * - * NOTE: Can be resident or non-resident. - * - * Operations on this attribute are logged to the journal ($LogFile) like - * normal metadata changes. - * - * Used by the Encrypting File System (EFS). All encrypted files have this - * attribute with the name $EFS. See below for the relevant structures. - */ -typedef struct { - /* Can be anything the creator chooses. */ -} __attribute__((__packed__)) LOGGED_UTILITY_STREAM; - -/* - * $EFS Data Structure: - * - * The following information is about the data structures that are contained - * inside a logged utility stream (0x100) with a name of "$EFS". - * - * The stream starts with an instance of EFS_ATTR_HEADER. - * - * Next, at offsets offset_to_ddf_array and offset_to_drf_array (unless any of - * them is 0) there is a EFS_DF_ARRAY_HEADER immediately followed by a sequence - * of multiple data decryption/recovery fields. - * - * Each data decryption/recovery field starts with a EFS_DF_HEADER and the next - * one (if it exists) can be found by adding EFS_DF_HEADER->df_length bytes to - * the offset of the beginning of the current EFS_DF_HEADER. - * - * The data decryption/recovery field contains an EFS_DF_CERTIFICATE_HEADER, a - * SID, an optional GUID, an optional container name, a non-optional user name, - * and the encrypted FEK. - * - * Note all the below are best guesses so may have mistakes/inaccuracies. - * Corrections/clarifications/additions are always welcome! - * - * Ntfs.sys takes an EFS value length of <= 0x54 or > 0x40000 to BSOD, i.e. it - * is invalid. - */ - -/** - * struct EFS_ATTR_HEADER - "$EFS" header. - * - * The header of the Logged utility stream (0x100) attribute named "$EFS". - */ -typedef struct { -/* 0*/ u32 length; /* Length of EFS attribute in bytes. */ - u32 state; /* Always 0? */ - u32 version; /* Efs version. Always 2? */ - u32 crypto_api_version; /* Always 0? */ -/* 16*/ u8 unknown4[16]; /* MD5 hash of decrypted FEK? This field is - created with a call to UuidCreate() so is - unlikely to be an MD5 hash and is more - likely to be GUID of this encrytped file - or something like that. */ -/* 32*/ u8 unknown5[16]; /* MD5 hash of DDFs? */ -/* 48*/ u8 unknown6[16]; /* MD5 hash of DRFs? */ -/* 64*/ u32 offset_to_ddf_array;/* Offset in bytes to the array of data - decryption fields (DDF), see below. Zero if - no DDFs are present. */ - u32 offset_to_drf_array;/* Offset in bytes to the array of data - recovery fields (DRF), see below. Zero if - no DRFs are present. */ - u32 reserved; /* Reserved. */ -} __attribute__((__packed__)) EFS_ATTR_HEADER; - -/** - * struct EFS_DF_ARRAY_HEADER - - */ -typedef struct { - u32 df_count; /* Number of data decryption/recovery fields in - the array. */ -} __attribute__((__packed__)) EFS_DF_ARRAY_HEADER; - -/** - * struct EFS_DF_HEADER - - */ -typedef struct { -/* 0*/ u32 df_length; /* Length of this data decryption/recovery - field in bytes. */ - u32 cred_header_offset; /* Offset in bytes to the credential header. */ - u32 fek_size; /* Size in bytes of the encrypted file - encryption key (FEK). */ - u32 fek_offset; /* Offset in bytes to the FEK from the start of - the data decryption/recovery field. */ -/* 16*/ u32 unknown1; /* always 0? Might be just padding. */ -} __attribute__((__packed__)) EFS_DF_HEADER; - -/** - * struct EFS_DF_CREDENTIAL_HEADER - - */ -typedef struct { -/* 0*/ u32 cred_length; /* Length of this credential in bytes. */ - u32 sid_offset; /* Offset in bytes to the user's sid from start - of this structure. Zero if no sid is - present. */ -/* 8*/ u32 type; /* Type of this credential: - 1 = CryptoAPI container. - 2 = Unexpected type. - 3 = Certificate thumbprint. - other = Unknown type. */ - union { - /* CryptoAPI container. */ - struct { -/* 12*/ u32 container_name_offset; /* Offset in bytes to - the name of the container from start of this - structure (may not be zero). */ -/* 16*/ u32 provider_name_offset; /* Offset in bytes to - the name of the provider from start of this - structure (may not be zero). */ - u32 public_key_blob_offset; /* Offset in bytes to - the public key blob from start of this - structure. */ -/* 24*/ u32 public_key_blob_size; /* Size in bytes of - public key blob. */ - } __attribute__((__packed__)); - /* Certificate thumbprint. */ - struct { -/* 12*/ u32 cert_thumbprint_header_size; /* Size in - bytes of the header of the certificate - thumbprint. */ -/* 16*/ u32 cert_thumbprint_header_offset; /* Offset in - bytes to the header of the certificate - thumbprint from start of this structure. */ - u32 unknown1; /* Always 0? Might be padding... */ - u32 unknown2; /* Always 0? Might be padding... */ - } __attribute__((__packed__)); - } __attribute__((__packed__)); -} __attribute__((__packed__)) EFS_DF_CREDENTIAL_HEADER; - -typedef EFS_DF_CREDENTIAL_HEADER EFS_DF_CRED_HEADER; - -/** - * struct EFS_DF_CERTIFICATE_THUMBPRINT_HEADER - - */ -typedef struct { -/* 0*/ u32 thumbprint_offset; /* Offset in bytes to the thumbprint. */ - u32 thumbprint_size; /* Size of thumbprint in bytes. */ -/* 8*/ u32 container_name_offset; /* Offset in bytes to the name of the - container from start of this - structure or 0 if no name present. */ - u32 provider_name_offset; /* Offset in bytes to the name of the - cryptographic provider from start of - this structure or 0 if no name - present. */ -/* 16*/ u32 user_name_offset; /* Offset in bytes to the user name - from start of this structure or 0 if - no user name present. (This is also - known as lpDisplayInformation.) */ -} __attribute__((__packed__)) EFS_DF_CERTIFICATE_THUMBPRINT_HEADER; - -typedef EFS_DF_CERTIFICATE_THUMBPRINT_HEADER EFS_DF_CERT_THUMBPRINT_HEADER; - -typedef enum { - INTX_SYMBOLIC_LINK = - const_cpu_to_le64(0x014B4E4C78746E49ULL), /* "IntxLNK\1" */ - INTX_CHARACTER_DEVICE = - const_cpu_to_le64(0x0052484378746E49ULL), /* "IntxCHR\0" */ - INTX_BLOCK_DEVICE = - const_cpu_to_le64(0x004B4C4278746E49ULL), /* "IntxBLK\0" */ -} INTX_FILE_TYPES; - -typedef struct { - INTX_FILE_TYPES magic; /* Intx file magic. */ - union { - /* For character and block devices. */ - struct { - u64 major; /* Major device number. */ - u64 minor; /* Minor device number. */ - void *device_end[0]; /* Marker for offsetof(). */ - } __attribute__((__packed__)); - /* For symbolic links. */ - ntfschar target[0]; - } __attribute__((__packed__)); -} __attribute__((__packed__)) INTX_FILE; - -#endif /* defined _NTFS_LAYOUT_H */ diff --git a/source/libs/libntfs/lcnalloc.c b/source/libs/libntfs/lcnalloc.c deleted file mode 100644 index e84d2431..00000000 --- a/source/libs/libntfs/lcnalloc.c +++ /dev/null @@ -1,771 +0,0 @@ -/** - * lcnalloc.c - Cluster (de)allocation code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002-2004 Anton Altaparmakov - * Copyright (c) 2004 Yura Pakhuchiy - * Copyright (c) 2004-2008 Szabolcs Szakacsits - * Copyright (c) 2008-2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "types.h" -#include "attrib.h" -#include "bitmap.h" -#include "debug.h" -#include "runlist.h" -#include "volume.h" -#include "lcnalloc.h" -#include "logging.h" -#include "misc.h" - -/* - * Plenty possibilities for big optimizations all over in the cluster - * allocation, however at the moment the dominant bottleneck (~ 90%) is - * the update of the mapping pairs which converges to the cubic Faulhaber's - * formula as the function of the number of extents (fragments, runs). - */ -#define NTFS_LCNALLOC_BSIZE 4096 -#define NTFS_LCNALLOC_SKIP NTFS_LCNALLOC_BSIZE - -enum { - ZONE_MFT = 1, - ZONE_DATA1 = 2, - ZONE_DATA2 = 4 -} ; - -static void ntfs_cluster_set_zone_pos(LCN start, LCN end, LCN *pos, LCN tc) -{ - ntfs_log_trace("pos: %lld tc: %lld\n", (long long)*pos, (long long)tc); - - if (tc >= end) - *pos = start; - else if (tc >= start) - *pos = tc; -} - -static void ntfs_cluster_update_zone_pos(ntfs_volume *vol, u8 zone, LCN tc) -{ - ntfs_log_trace("tc = %lld, zone = %d\n", (long long)tc, zone); - - if (zone == ZONE_MFT) - ntfs_cluster_set_zone_pos(vol->mft_lcn, vol->mft_zone_end, - &vol->mft_zone_pos, tc); - else if (zone == ZONE_DATA1) - ntfs_cluster_set_zone_pos(vol->mft_zone_end, vol->nr_clusters, - &vol->data1_zone_pos, tc); - else /* zone == ZONE_DATA2 */ - ntfs_cluster_set_zone_pos(0, vol->mft_zone_start, - &vol->data2_zone_pos, tc); -} - -/* - * Unmark full zones when a cluster has been freed in a full zone - * - * Next allocation will reuse the freed cluster - */ - -static void update_full_status(ntfs_volume *vol, LCN lcn) -{ - if (lcn >= vol->mft_zone_end) { - if (vol->full_zones & ZONE_DATA1) { - ntfs_cluster_update_zone_pos(vol, ZONE_DATA1, lcn); - vol->full_zones &= ~ZONE_DATA1; - } - } else - if (lcn < vol->mft_zone_start) { - if (vol->full_zones & ZONE_DATA2) { - ntfs_cluster_update_zone_pos(vol, ZONE_DATA2, lcn); - vol->full_zones &= ~ZONE_DATA2; - } - } else { - if (vol->full_zones & ZONE_MFT) { - ntfs_cluster_update_zone_pos(vol, ZONE_MFT, lcn); - vol->full_zones &= ~ZONE_MFT; - } - } -} - -static s64 max_empty_bit_range(unsigned char *buf, int size) -{ - int i, j, run = 0; - int max_range = 0; - s64 start_pos = -1; - - ntfs_log_trace("Entering\n"); - - i = 0; - while (i < size) { - switch (*buf) { - case 0 : - do { - buf++; - run += 8; - i++; - } while ((i < size) && !*buf); - break; - case 255 : - if (run > max_range) { - max_range = run; - start_pos = (s64)i * 8 - run; - } - run = 0; - do { - buf++; - i++; - } while ((i < size) && (*buf == 255)); - break; - default : - for (j = 0; j < 8; j++) { - - int bit = *buf & (1 << j); - - if (bit) { - if (run > max_range) { - max_range = run; - start_pos = (s64)i * 8 + (j - run); - } - run = 0; - } else - run++; - } - i++; - buf++; - - } - } - - if (run > max_range) - start_pos = (s64)i * 8 - run; - - return start_pos; -} - -static int bitmap_writeback(ntfs_volume *vol, s64 pos, s64 size, void *b, - u8 *writeback) -{ - s64 written; - - ntfs_log_trace("Entering\n"); - - if (!*writeback) - return 0; - - *writeback = 0; - - written = ntfs_attr_pwrite(vol->lcnbmp_na, pos, size, b); - if (written != size) { - if (!written) - errno = EIO; - ntfs_log_perror("Bitmap write error (%lld, %lld)", - (long long)pos, (long long)size); - return -1; - } - - return 0; -} - -/** - * ntfs_cluster_alloc - allocate clusters on an ntfs volume - * @vol: mounted ntfs volume on which to allocate the clusters - * @start_vcn: vcn to use for the first allocated cluster - * @count: number of clusters to allocate - * @start_lcn: starting lcn at which to allocate the clusters (or -1 if none) - * @zone: zone from which to allocate the clusters - * - * Allocate @count clusters preferably starting at cluster @start_lcn or at the - * current allocator position if @start_lcn is -1, on the mounted ntfs volume - * @vol. @zone is either DATA_ZONE for allocation of normal clusters and - * MFT_ZONE for allocation of clusters for the master file table, i.e. the - * $MFT/$DATA attribute. - * - * On success return a runlist describing the allocated cluster(s). - * - * On error return NULL with errno set to the error code. - * - * Notes on the allocation algorithm - * ================================= - * - * There are two data zones. First is the area between the end of the mft zone - * and the end of the volume, and second is the area between the start of the - * volume and the start of the mft zone. On unmodified/standard NTFS 1.x - * volumes, the second data zone doesn't exist due to the mft zone being - * expanded to cover the start of the volume in order to reserve space for the - * mft bitmap attribute. - * - * The complexity stems from the need of implementing the mft vs data zoned - * approach and from the fact that we have access to the lcn bitmap via up to - * NTFS_LCNALLOC_BSIZE bytes at a time, so we need to cope with crossing over - * boundaries of two buffers. Further, the fact that the allocator allows for - * caller supplied hints as to the location of where allocation should begin - * and the fact that the allocator keeps track of where in the data zones the - * next natural allocation should occur, contribute to the complexity of the - * function. But it should all be worthwhile, because this allocator: - * 1) implements MFT zone reservation - * 2) causes reduction in fragmentation. - * The code is not optimized for speed. - */ -runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count, - LCN start_lcn, const NTFS_CLUSTER_ALLOCATION_ZONES zone) -{ - LCN zone_start, zone_end; /* current search range */ - LCN last_read_pos, lcn; - LCN bmp_pos; /* current bit position inside the bitmap */ - LCN prev_lcn = 0, prev_run_len = 0; - s64 clusters, br; - runlist *rl = NULL, *trl; - u8 *buf, *byte, bit, writeback; - u8 pass = 1; /* 1: inside zone; 2: start of zone */ - u8 search_zone; /* 4: data2 (start) 1: mft (middle) 2: data1 (end) */ - u8 done_zones = 0; - u8 has_guess, used_zone_pos; - int err = 0, rlpos, rlsize, buf_size; - - ntfs_log_enter("Entering with count = 0x%llx, start_lcn = 0x%llx, " - "zone = %s_ZONE.\n", (long long)count, (long long) - start_lcn, zone == MFT_ZONE ? "MFT" : "DATA"); - - if (!vol || count < 0 || start_lcn < -1 || !vol->lcnbmp_na || - (s8)zone < FIRST_ZONE || zone > LAST_ZONE) { - errno = EINVAL; - ntfs_log_perror("%s: vcn: %lld, count: %lld, lcn: %lld", - __FUNCTION__, (long long)start_vcn, - (long long)count, (long long)start_lcn); - goto out; - } - - /* Return empty runlist if @count == 0 */ - if (!count) { - rl = ntfs_malloc(0x1000); - if (rl) { - rl[0].vcn = start_vcn; - rl[0].lcn = LCN_RL_NOT_MAPPED; - rl[0].length = 0; - } - goto out; - } - - buf = ntfs_malloc(NTFS_LCNALLOC_BSIZE); - if (!buf) - goto out; - /* - * If no @start_lcn was requested, use the current zone - * position otherwise use the requested @start_lcn. - */ - has_guess = 1; - zone_start = start_lcn; - - if (zone_start < 0) { - if (zone == DATA_ZONE) - zone_start = vol->data1_zone_pos; - else - zone_start = vol->mft_zone_pos; - has_guess = 0; - } - - used_zone_pos = has_guess ? 0 : 1; - - if (!zone_start || zone_start == vol->mft_zone_start || - zone_start == vol->mft_zone_end) - pass = 2; - - if (zone_start < vol->mft_zone_start) { - zone_end = vol->mft_zone_start; - search_zone = ZONE_DATA2; - } else if (zone_start < vol->mft_zone_end) { - zone_end = vol->mft_zone_end; - search_zone = ZONE_MFT; - } else { - zone_end = vol->nr_clusters; - search_zone = ZONE_DATA1; - } - - bmp_pos = zone_start; - - /* Loop until all clusters are allocated. */ - clusters = count; - rlpos = rlsize = 0; - while (1) { - /* check whether we have exhausted the current zone */ - if (search_zone & vol->full_zones) - goto zone_pass_done; - last_read_pos = bmp_pos >> 3; - br = ntfs_attr_pread(vol->lcnbmp_na, last_read_pos, - NTFS_LCNALLOC_BSIZE, buf); - if (br <= 0) { - if (!br) - goto zone_pass_done; - err = errno; - ntfs_log_perror("Reading $BITMAP failed"); - goto err_ret; - } - /* - * We might have read less than NTFS_LCNALLOC_BSIZE bytes - * if we are close to the end of the attribute. - */ - buf_size = (int)br << 3; - lcn = bmp_pos & 7; - bmp_pos &= ~7; - writeback = 0; - - while (lcn < buf_size) { - byte = buf + (lcn >> 3); - bit = 1 << (lcn & 7); - if (has_guess) { - if (*byte & bit) { - has_guess = 0; - break; - } - } else { - lcn = max_empty_bit_range(buf, br); - if (lcn < 0) - break; - has_guess = 1; - continue; - } - - /* First free bit is at lcn + bmp_pos. */ - - /* Reallocate memory if necessary. */ - if ((rlpos + 2) * (int)sizeof(runlist) >= rlsize) { - rlsize += 4096; - trl = realloc(rl, rlsize); - if (!trl) { - err = ENOMEM; - ntfs_log_perror("realloc() failed"); - goto wb_err_ret; - } - rl = trl; - } - - /* Allocate the bitmap bit. */ - *byte |= bit; - writeback = 1; - if (vol->free_clusters <= 0) - ntfs_log_error("Non-positive free clusters " - "(%lld)!\n", - (long long)vol->free_clusters); - else - vol->free_clusters--; - - /* - * Coalesce with previous run if adjacent LCNs. - * Otherwise, append a new run. - */ - if (prev_lcn == lcn + bmp_pos - prev_run_len && rlpos) { - ntfs_log_debug("Cluster coalesce: prev_lcn: " - "%lld lcn: %lld bmp_pos: %lld " - "prev_run_len: %lld\n", - (long long)prev_lcn, - (long long)lcn, (long long)bmp_pos, - (long long)prev_run_len); - rl[rlpos - 1].length = ++prev_run_len; - } else { - if (rlpos) - rl[rlpos].vcn = rl[rlpos - 1].vcn + - prev_run_len; - else { - rl[rlpos].vcn = start_vcn; - ntfs_log_debug("Start_vcn: %lld\n", - (long long)start_vcn); - } - - rl[rlpos].lcn = prev_lcn = lcn + bmp_pos; - rl[rlpos].length = prev_run_len = 1; - rlpos++; - } - - ntfs_log_debug("RUN: %-16lld %-16lld %-16lld\n", - (long long)rl[rlpos - 1].vcn, - (long long)rl[rlpos - 1].lcn, - (long long)rl[rlpos - 1].length); - /* Done? */ - if (!--clusters) { - if (used_zone_pos) - ntfs_cluster_update_zone_pos(vol, - search_zone, lcn + bmp_pos + 1 + - NTFS_LCNALLOC_SKIP); - goto done_ret; - } - - lcn++; - } - - if (bitmap_writeback(vol, last_read_pos, br, buf, &writeback)) { - err = errno; - goto err_ret; - } - - if (!used_zone_pos) { - - used_zone_pos = 1; - - if (search_zone == ZONE_MFT) - zone_start = vol->mft_zone_pos; - else if (search_zone == ZONE_DATA1) - zone_start = vol->data1_zone_pos; - else - zone_start = vol->data2_zone_pos; - - if (!zone_start || zone_start == vol->mft_zone_start || - zone_start == vol->mft_zone_end) - pass = 2; - bmp_pos = zone_start; - } else - bmp_pos += buf_size; - - if (bmp_pos < zone_end) - continue; - -zone_pass_done: - ntfs_log_trace("Finished current zone pass(%i).\n", pass); - if (pass == 1) { - pass = 2; - zone_end = zone_start; - - if (search_zone == ZONE_MFT) - zone_start = vol->mft_zone_start; - else if (search_zone == ZONE_DATA1) - zone_start = vol->mft_zone_end; - else - zone_start = 0; - - /* Sanity check. */ - if (zone_end < zone_start) - zone_end = zone_start; - - bmp_pos = zone_start; - - continue; - } - /* pass == 2 */ -done_zones_check: - done_zones |= search_zone; - vol->full_zones |= search_zone; - if (done_zones < (ZONE_MFT + ZONE_DATA1 + ZONE_DATA2)) { - ntfs_log_trace("Switching zone.\n"); - pass = 1; - if (rlpos) { - LCN tc = rl[rlpos - 1].lcn + - rl[rlpos - 1].length + NTFS_LCNALLOC_SKIP; - - if (used_zone_pos) - ntfs_cluster_update_zone_pos(vol, - search_zone, tc); - } - - switch (search_zone) { - case ZONE_MFT: - ntfs_log_trace("Zone switch: mft -> data1\n"); -switch_to_data1_zone: search_zone = ZONE_DATA1; - zone_start = vol->data1_zone_pos; - zone_end = vol->nr_clusters; - if (zone_start == vol->mft_zone_end) - pass = 2; - break; - case ZONE_DATA1: - ntfs_log_trace("Zone switch: data1 -> data2\n"); - search_zone = ZONE_DATA2; - zone_start = vol->data2_zone_pos; - zone_end = vol->mft_zone_start; - if (!zone_start) - pass = 2; - break; - case ZONE_DATA2: - if (!(done_zones & ZONE_DATA1)) { - ntfs_log_trace("data2 -> data1\n"); - goto switch_to_data1_zone; - } - ntfs_log_trace("Zone switch: data2 -> mft\n"); - search_zone = ZONE_MFT; - zone_start = vol->mft_zone_pos; - zone_end = vol->mft_zone_end; - if (zone_start == vol->mft_zone_start) - pass = 2; - break; - } - - bmp_pos = zone_start; - - if (zone_start == zone_end) { - ntfs_log_trace("Empty zone, skipped.\n"); - goto done_zones_check; - } - - continue; - } - - ntfs_log_trace("All zones are finished, no space on device.\n"); - err = ENOSPC; - goto err_ret; - } -done_ret: - ntfs_log_debug("At done_ret.\n"); - /* Add runlist terminator element. */ - rl[rlpos].vcn = rl[rlpos - 1].vcn + rl[rlpos - 1].length; - rl[rlpos].lcn = LCN_RL_NOT_MAPPED; - rl[rlpos].length = 0; - if (bitmap_writeback(vol, last_read_pos, br, buf, &writeback)) { - err = errno; - goto err_ret; - } -done_err_ret: - free(buf); - if (err) { - errno = err; - ntfs_log_perror("Failed to allocate clusters"); - rl = NULL; - } -out: - ntfs_log_leave("\n"); - return rl; - -wb_err_ret: - ntfs_log_trace("At wb_err_ret.\n"); - if (bitmap_writeback(vol, last_read_pos, br, buf, &writeback)) - err = errno; -err_ret: - ntfs_log_trace("At err_ret.\n"); - if (rl) { - /* Add runlist terminator element. */ - rl[rlpos].vcn = rl[rlpos - 1].vcn + rl[rlpos - 1].length; - rl[rlpos].lcn = LCN_RL_NOT_MAPPED; - rl[rlpos].length = 0; - ntfs_debug_runlist_dump(rl); - ntfs_cluster_free_from_rl(vol, rl); - free(rl); - rl = NULL; - } - goto done_err_ret; -} - -/** - * ntfs_cluster_free_from_rl - free clusters from runlist - * @vol: mounted ntfs volume on which to free the clusters - * @rl: runlist from which deallocate clusters - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -int ntfs_cluster_free_from_rl(ntfs_volume *vol, runlist *rl) -{ - s64 nr_freed = 0; - int ret = -1; - - ntfs_log_trace("Entering.\n"); - - for (; rl->length; rl++) { - - ntfs_log_trace("Dealloc lcn 0x%llx, len 0x%llx.\n", - (long long)rl->lcn, (long long)rl->length); - - if (rl->lcn >= 0) { - update_full_status(vol,rl->lcn); - if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn, - rl->length)) { - ntfs_log_perror("Cluster deallocation failed " - "(%lld, %lld)", - (long long)rl->lcn, - (long long)rl->length); - goto out; - } - nr_freed += rl->length ; - } - } - - ret = 0; -out: - vol->free_clusters += nr_freed; - if (vol->free_clusters > vol->nr_clusters) - ntfs_log_error("Too many free clusters (%lld > %lld)!", - (long long)vol->free_clusters, - (long long)vol->nr_clusters); - return ret; -} - -/* - * Basic cluster run free - * Returns 0 if successful - */ - -int ntfs_cluster_free_basic(ntfs_volume *vol, s64 lcn, s64 count) -{ - s64 nr_freed = 0; - int ret = -1; - - ntfs_log_trace("Entering.\n"); - ntfs_log_trace("Dealloc lcn 0x%llx, len 0x%llx.\n", - (long long)lcn, (long long)count); - - if (lcn >= 0) { - update_full_status(vol,lcn); - if (ntfs_bitmap_clear_run(vol->lcnbmp_na, lcn, - count)) { - ntfs_log_perror("Cluster deallocation failed " - "(%lld, %lld)", - (long long)lcn, - (long long)count); - goto out; - } - nr_freed += count; - } - ret = 0; -out: - vol->free_clusters += nr_freed; - if (vol->free_clusters > vol->nr_clusters) - ntfs_log_error("Too many free clusters (%lld > %lld)!", - (long long)vol->free_clusters, - (long long)vol->nr_clusters); - return ret; -} - -/** - * ntfs_cluster_free - free clusters on an ntfs volume - * @vol: mounted ntfs volume on which to free the clusters - * @na: attribute whose runlist describes the clusters to free - * @start_vcn: vcn in @rl at which to start freeing clusters - * @count: number of clusters to free or -1 for all clusters - * - * Free @count clusters starting at the cluster @start_vcn in the runlist - * described by the attribute @na from the mounted ntfs volume @vol. - * - * If @count is -1, all clusters from @start_vcn to the end of the runlist - * are deallocated. - * - * On success return the number of deallocated clusters (not counting sparse - * clusters) and on error return -1 with errno set to the error code. - */ -int ntfs_cluster_free(ntfs_volume *vol, ntfs_attr *na, VCN start_vcn, s64 count) -{ - runlist *rl; - s64 delta, to_free, nr_freed = 0; - int ret = -1; - - if (!vol || !vol->lcnbmp_na || !na || start_vcn < 0 || - (count < 0 && count != -1)) { - ntfs_log_trace("Invalid arguments!\n"); - errno = EINVAL; - return -1; - } - - ntfs_log_enter("Entering for inode 0x%llx, attr 0x%x, count 0x%llx, " - "vcn 0x%llx.\n", (unsigned long long)na->ni->mft_no, - na->type, (long long)count, (long long)start_vcn); - - rl = ntfs_attr_find_vcn(na, start_vcn); - if (!rl) { - if (errno == ENOENT) - ret = 0; - goto leave; - } - - if (rl->lcn < 0 && rl->lcn != LCN_HOLE) { - errno = EIO; - ntfs_log_perror("%s: Unexpected lcn (%lld)", __FUNCTION__, - (long long)rl->lcn); - goto leave; - } - - /* Find the starting cluster inside the run that needs freeing. */ - delta = start_vcn - rl->vcn; - - /* The number of clusters in this run that need freeing. */ - to_free = rl->length - delta; - if (count >= 0 && to_free > count) - to_free = count; - - if (rl->lcn != LCN_HOLE) { - /* Do the actual freeing of the clusters in this run. */ - update_full_status(vol,rl->lcn + delta); - if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn + delta, - to_free)) - goto leave; - nr_freed = to_free; - } - - /* Go to the next run and adjust the number of clusters left to free. */ - ++rl; - if (count >= 0) - count -= to_free; - - /* - * Loop over the remaining runs, using @count as a capping value, and - * free them. - */ - for (; rl->length && count != 0; ++rl) { - // FIXME: Need to try ntfs_attr_map_runlist() for attribute - // list support! (AIA) - if (rl->lcn < 0 && rl->lcn != LCN_HOLE) { - // FIXME: Eeek! We need rollback! (AIA) - errno = EIO; - ntfs_log_perror("%s: Invalid lcn (%lli)", - __FUNCTION__, (long long)rl->lcn); - goto out; - } - - /* The number of clusters in this run that need freeing. */ - to_free = rl->length; - if (count >= 0 && to_free > count) - to_free = count; - - if (rl->lcn != LCN_HOLE) { - update_full_status(vol,rl->lcn); - if (ntfs_bitmap_clear_run(vol->lcnbmp_na, rl->lcn, - to_free)) { - // FIXME: Eeek! We need rollback! (AIA) - ntfs_log_perror("%s: Clearing bitmap run failed", - __FUNCTION__); - goto out; - } - nr_freed += to_free; - } - - if (count >= 0) - count -= to_free; - } - - if (count != -1 && count != 0) { - // FIXME: Eeek! BUG() - errno = EIO; - ntfs_log_perror("%s: count still not zero (%lld)", __FUNCTION__, - (long long)count); - goto out; - } - - ret = nr_freed; -out: - vol->free_clusters += nr_freed ; - if (vol->free_clusters > vol->nr_clusters) - ntfs_log_error("Too many free clusters (%lld > %lld)!", - (long long)vol->free_clusters, - (long long)vol->nr_clusters); -leave: - ntfs_log_leave("\n"); - return ret; -} diff --git a/source/libs/libntfs/lcnalloc.h b/source/libs/libntfs/lcnalloc.h deleted file mode 100644 index cbf4c5cd..00000000 --- a/source/libs/libntfs/lcnalloc.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * lcnalloc.h - Exports for cluster (de)allocation. Originated from the Linux-NTFS - * project. - * - * Copyright (c) 2002 Anton Altaparmakov - * Copyright (c) 2004 Yura Pakhuchiy - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_LCNALLOC_H -#define _NTFS_LCNALLOC_H - -#include "types.h" -#include "runlist.h" -#include "volume.h" - -/** - * enum NTFS_CLUSTER_ALLOCATION_ZONES - - */ -typedef enum { - FIRST_ZONE = 0, /* For sanity checking. */ - MFT_ZONE = 0, /* Allocate from $MFT zone. */ - DATA_ZONE = 1, /* Allocate from $DATA zone. */ - LAST_ZONE = 1, /* For sanity checking. */ -} NTFS_CLUSTER_ALLOCATION_ZONES; - -extern runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count, - LCN start_lcn, const NTFS_CLUSTER_ALLOCATION_ZONES zone); - -extern int ntfs_cluster_free_from_rl(ntfs_volume *vol, runlist *rl); -extern int ntfs_cluster_free_basic(ntfs_volume *vol, s64 lcn, s64 count); - -extern int ntfs_cluster_free(ntfs_volume *vol, ntfs_attr *na, VCN start_vcn, - s64 count); - -#endif /* defined _NTFS_LCNALLOC_H */ - diff --git a/source/libs/libntfs/libcustomntfs.a b/source/libs/libntfs/libcustomntfs.a new file mode 100644 index 0000000000000000000000000000000000000000..5bba67a53d4241450b10ed06088cc2a13ea1a4e2 GIT binary patch literal 582894 zcmdqK4Rlo1x$wVdGQb2<->Drn)d+*6Enh;=sFM$HBGHDA+PpF`xk#IYB$$*y(j@4h zGjnDV+9u$?ZwS<)h8PrG__6xZ*86{H1&sCM#p=3?)p}cc>-EN~_lnhZFTM3%5kuzx zd-geJ<|KmJd%NECU+*l!Is4;0``OQazV@^C*=KfXeMdv{vgwNh6MsvtD!TgWYl^N5 z76t+Zy2$x|AP`(~otY7+o351Wn@R;1{pJ6<{!yv_OaI&#+@ajF)@J?+Zc^^af6J*O ze@(wS_h0XY%KcgY9$u#0KfPJGe>Ok;mvxy^|Ea(74wdzn{5x@>@?<^wpZ|O8yUO!l z{G0NHe^V3wzWSn?V*h=6t(x+m`P)9OrhLlZ)R}9Q{`>L;YO4Kr)pym@Py1VctD5@f z{%!k-n)+#f`yN+Q56u6|{{3;8ntJ9J>Az`#@2Wrhuk$7~?f(aV-miRF{l)&)-KD($ zwZF|>8#-${TN?Sht4ZlpOK0tt&ZZ8@H8bkFx+GszH}vYkpz9h=Pu%&f+y z&V~*PLPKk9+nt-6tYl+b?d=_HTiR>=1wQR(ho;kP*XRTL9yj+o7y{?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{3$hw3{R;`WOd3J3C&Zc zCp1qv$I;A__xyzBDHl1KioY_T*%HuP8PK`j!g{WH$_+^$JmtoK=FJv1IJYHz@RY%T zCgpkC9#NNj&^hBy2X=i{??HZ=G~-&hP1(b=_q`s5W=v-^cqUQ^;vsN3hcr&X=E(`J zc{71^M{-1&iq~DqI@e)fY(rG*;N8G=4&DP?@8E}lr#bilaD#)N2F^M7S>Q$o9|oT3 mVDU5C!AF2`DtEGII(W*h2|QIi;0*u!6Sz(^af&}B`@aC@2 -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "attrib.h" -#include "debug.h" -#include "logfile.h" -#include "volume.h" -#include "mst.h" -#include "logging.h" -#include "misc.h" - -/** - * ntfs_check_restart_page_header - check the page header for consistency - * @rp: restart page header to check - * @pos: position in logfile at which the restart page header resides - * - * Check the restart page header @rp for consistency and return TRUE if it is - * consistent and FALSE otherwise. - * - * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not - * require the full restart page. - */ -static BOOL ntfs_check_restart_page_header(RESTART_PAGE_HEADER *rp, s64 pos) -{ - u32 logfile_system_page_size, logfile_log_page_size; - u16 ra_ofs, usa_count, usa_ofs, usa_end = 0; - BOOL have_usa = TRUE; - - ntfs_log_trace("Entering.\n"); - /* - * If the system or log page sizes are smaller than the ntfs block size - * or either is not a power of 2 we cannot handle this log file. - */ - logfile_system_page_size = le32_to_cpu(rp->system_page_size); - logfile_log_page_size = le32_to_cpu(rp->log_page_size); - if (logfile_system_page_size < NTFS_BLOCK_SIZE || - logfile_log_page_size < NTFS_BLOCK_SIZE || - logfile_system_page_size & - (logfile_system_page_size - 1) || - logfile_log_page_size & (logfile_log_page_size - 1)) { - ntfs_log_error("$LogFile uses unsupported page size.\n"); - return FALSE; - } - /* - * We must be either at !pos (1st restart page) or at pos = system page - * size (2nd restart page). - */ - if (pos && pos != logfile_system_page_size) { - ntfs_log_error("Found restart area in incorrect " - "position in $LogFile.\n"); - return FALSE; - } - /* We only know how to handle version 1.1. */ - if (sle16_to_cpu(rp->major_ver) != 1 || - sle16_to_cpu(rp->minor_ver) != 1) { - ntfs_log_error("$LogFile version %i.%i is not " - "supported. (This driver supports version " - "1.1 only.)\n", (int)sle16_to_cpu(rp->major_ver), - (int)sle16_to_cpu(rp->minor_ver)); - return FALSE; - } - /* - * If chkdsk has been run the restart page may not be protected by an - * update sequence array. - */ - if (ntfs_is_chkd_record(rp->magic) && !le16_to_cpu(rp->usa_count)) { - have_usa = FALSE; - goto skip_usa_checks; - } - /* Verify the size of the update sequence array. */ - usa_count = 1 + (logfile_system_page_size >> NTFS_BLOCK_SIZE_BITS); - if (usa_count != le16_to_cpu(rp->usa_count)) { - ntfs_log_error("$LogFile restart page specifies " - "inconsistent update sequence array count.\n"); - return FALSE; - } - /* Verify the position of the update sequence array. */ - usa_ofs = le16_to_cpu(rp->usa_ofs); - usa_end = usa_ofs + usa_count * sizeof(u16); - if (usa_ofs < sizeof(RESTART_PAGE_HEADER) || - usa_end > NTFS_BLOCK_SIZE - sizeof(u16)) { - ntfs_log_error("$LogFile restart page specifies " - "inconsistent update sequence array offset.\n"); - return FALSE; - } -skip_usa_checks: - /* - * Verify the position of the restart area. It must be: - * - aligned to 8-byte boundary, - * - after the update sequence array, and - * - within the system page size. - */ - ra_ofs = le16_to_cpu(rp->restart_area_offset); - if (ra_ofs & 7 || (have_usa ? ra_ofs < usa_end : - ra_ofs < sizeof(RESTART_PAGE_HEADER)) || - ra_ofs > logfile_system_page_size) { - ntfs_log_error("$LogFile restart page specifies " - "inconsistent restart area offset.\n"); - return FALSE; - } - /* - * Only restart pages modified by chkdsk are allowed to have chkdsk_lsn - * set. - */ - if (!ntfs_is_chkd_record(rp->magic) && sle64_to_cpu(rp->chkdsk_lsn)) { - ntfs_log_error("$LogFile restart page is not modified " - "by chkdsk but a chkdsk LSN is specified.\n"); - return FALSE; - } - ntfs_log_trace("Done.\n"); - return TRUE; -} - -/** - * ntfs_check_restart_area - check the restart area for consistency - * @rp: restart page whose restart area to check - * - * Check the restart area of the restart page @rp for consistency and return - * TRUE if it is consistent and FALSE otherwise. - * - * This function assumes that the restart page header has already been - * consistency checked. - * - * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not - * require the full restart page. - */ -static BOOL ntfs_check_restart_area(RESTART_PAGE_HEADER *rp) -{ - u64 file_size; - RESTART_AREA *ra; - u16 ra_ofs, ra_len, ca_ofs; - u8 fs_bits; - - ntfs_log_trace("Entering.\n"); - ra_ofs = le16_to_cpu(rp->restart_area_offset); - ra = (RESTART_AREA*)((u8*)rp + ra_ofs); - /* - * Everything before ra->file_size must be before the first word - * protected by an update sequence number. This ensures that it is - * safe to access ra->client_array_offset. - */ - if (ra_ofs + offsetof(RESTART_AREA, file_size) > - NTFS_BLOCK_SIZE - sizeof(u16)) { - ntfs_log_error("$LogFile restart area specifies " - "inconsistent file offset.\n"); - return FALSE; - } - /* - * Now that we can access ra->client_array_offset, make sure everything - * up to the log client array is before the first word protected by an - * update sequence number. This ensures we can access all of the - * restart area elements safely. Also, the client array offset must be - * aligned to an 8-byte boundary. - */ - ca_ofs = le16_to_cpu(ra->client_array_offset); - if (((ca_ofs + 7) & ~7) != ca_ofs || - ra_ofs + ca_ofs > (u16)(NTFS_BLOCK_SIZE - - sizeof(u16))) { - ntfs_log_error("$LogFile restart area specifies " - "inconsistent client array offset.\n"); - return FALSE; - } - /* - * The restart area must end within the system page size both when - * calculated manually and as specified by ra->restart_area_length. - * Also, the calculated length must not exceed the specified length. - */ - ra_len = ca_ofs + le16_to_cpu(ra->log_clients) * - sizeof(LOG_CLIENT_RECORD); - if ((u32)(ra_ofs + ra_len) > le32_to_cpu(rp->system_page_size) || - (u32)(ra_ofs + le16_to_cpu(ra->restart_area_length)) > - le32_to_cpu(rp->system_page_size) || - ra_len > le16_to_cpu(ra->restart_area_length)) { - ntfs_log_error("$LogFile restart area is out of bounds " - "of the system page size specified by the " - "restart page header and/or the specified " - "restart area length is inconsistent.\n"); - return FALSE; - } - /* - * The ra->client_free_list and ra->client_in_use_list must be either - * LOGFILE_NO_CLIENT or less than ra->log_clients or they are - * overflowing the client array. - */ - if ((ra->client_free_list != LOGFILE_NO_CLIENT && - le16_to_cpu(ra->client_free_list) >= - le16_to_cpu(ra->log_clients)) || - (ra->client_in_use_list != LOGFILE_NO_CLIENT && - le16_to_cpu(ra->client_in_use_list) >= - le16_to_cpu(ra->log_clients))) { - ntfs_log_error("$LogFile restart area specifies " - "overflowing client free and/or in use lists.\n"); - return FALSE; - } - /* - * Check ra->seq_number_bits against ra->file_size for consistency. - * We cannot just use ffs() because the file size is not a power of 2. - */ - file_size = (u64)sle64_to_cpu(ra->file_size); - fs_bits = 0; - while (file_size) { - file_size >>= 1; - fs_bits++; - } - if (le32_to_cpu(ra->seq_number_bits) != (u32)(67 - fs_bits)) { - ntfs_log_error("$LogFile restart area specifies " - "inconsistent sequence number bits.\n"); - return FALSE; - } - /* The log record header length must be a multiple of 8. */ - if (((le16_to_cpu(ra->log_record_header_length) + 7) & ~7) != - le16_to_cpu(ra->log_record_header_length)) { - ntfs_log_error("$LogFile restart area specifies " - "inconsistent log record header length.\n"); - return FALSE; - } - /* Ditto for the log page data offset. */ - if (((le16_to_cpu(ra->log_page_data_offset) + 7) & ~7) != - le16_to_cpu(ra->log_page_data_offset)) { - ntfs_log_error("$LogFile restart area specifies " - "inconsistent log page data offset.\n"); - return FALSE; - } - ntfs_log_trace("Done.\n"); - return TRUE; -} - -/** - * ntfs_check_log_client_array - check the log client array for consistency - * @rp: restart page whose log client array to check - * - * Check the log client array of the restart page @rp for consistency and - * return TRUE if it is consistent and FALSE otherwise. - * - * This function assumes that the restart page header and the restart area have - * already been consistency checked. - * - * Unlike ntfs_check_restart_page_header() and ntfs_check_restart_area(), this - * function needs @rp->system_page_size bytes in @rp, i.e. it requires the full - * restart page and the page must be multi sector transfer deprotected. - */ -static BOOL ntfs_check_log_client_array(RESTART_PAGE_HEADER *rp) -{ - RESTART_AREA *ra; - LOG_CLIENT_RECORD *ca, *cr; - u16 nr_clients, idx; - BOOL in_free_list, idx_is_first; - - ntfs_log_trace("Entering.\n"); - ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset)); - ca = (LOG_CLIENT_RECORD*)((u8*)ra + - le16_to_cpu(ra->client_array_offset)); - /* - * Check the ra->client_free_list first and then check the - * ra->client_in_use_list. Check each of the log client records in - * each of the lists and check that the array does not overflow the - * ra->log_clients value. Also keep track of the number of records - * visited as there cannot be more than ra->log_clients records and - * that way we detect eventual loops in within a list. - */ - nr_clients = le16_to_cpu(ra->log_clients); - idx = le16_to_cpu(ra->client_free_list); - in_free_list = TRUE; -check_list: - for (idx_is_first = TRUE; idx != LOGFILE_NO_CLIENT_CPU; nr_clients--, - idx = le16_to_cpu(cr->next_client)) { - if (!nr_clients || idx >= le16_to_cpu(ra->log_clients)) - goto err_out; - /* Set @cr to the current log client record. */ - cr = ca + idx; - /* The first log client record must not have a prev_client. */ - if (idx_is_first) { - if (cr->prev_client != LOGFILE_NO_CLIENT) - goto err_out; - idx_is_first = FALSE; - } - } - /* Switch to and check the in use list if we just did the free list. */ - if (in_free_list) { - in_free_list = FALSE; - idx = le16_to_cpu(ra->client_in_use_list); - goto check_list; - } - ntfs_log_trace("Done.\n"); - return TRUE; -err_out: - ntfs_log_error("$LogFile log client array is corrupt.\n"); - return FALSE; -} - -/** - * ntfs_check_and_load_restart_page - check the restart page for consistency - * @log_na: opened ntfs attribute for journal $LogFile - * @rp: restart page to check - * @pos: position in @log_na at which the restart page resides - * @wrp: [OUT] copy of the multi sector transfer deprotected restart page - * @lsn: [OUT] set to the current logfile lsn on success - * - * Check the restart page @rp for consistency and return 0 if it is consistent - * and errno otherwise. The restart page may have been modified by chkdsk in - * which case its magic is CHKD instead of RSTR. - * - * This function only needs NTFS_BLOCK_SIZE bytes in @rp, i.e. it does not - * require the full restart page. - * - * If @wrp is not NULL, on success, *@wrp will point to a buffer containing a - * copy of the complete multi sector transfer deprotected page. On failure, - * *@wrp is undefined. - * - * Similarly, if @lsn is not NULL, on success *@lsn will be set to the current - * logfile lsn according to this restart page. On failure, *@lsn is undefined. - * - * The following error codes are defined: - * EINVAL - The restart page is inconsistent. - * ENOMEM - Not enough memory to load the restart page. - * EIO - Failed to reading from $LogFile. - */ -static int ntfs_check_and_load_restart_page(ntfs_attr *log_na, - RESTART_PAGE_HEADER *rp, s64 pos, RESTART_PAGE_HEADER **wrp, - LSN *lsn) -{ - RESTART_AREA *ra; - RESTART_PAGE_HEADER *trp; - int err; - - ntfs_log_trace("Entering.\n"); - /* Check the restart page header for consistency. */ - if (!ntfs_check_restart_page_header(rp, pos)) { - /* Error output already done inside the function. */ - return EINVAL; - } - /* Check the restart area for consistency. */ - if (!ntfs_check_restart_area(rp)) { - /* Error output already done inside the function. */ - return EINVAL; - } - ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset)); - /* - * Allocate a buffer to store the whole restart page so we can multi - * sector transfer deprotect it. - */ - trp = ntfs_malloc(le32_to_cpu(rp->system_page_size)); - if (!trp) - return errno; - /* - * Read the whole of the restart page into the buffer. If it fits - * completely inside @rp, just copy it from there. Otherwise read it - * from disk. - */ - if (le32_to_cpu(rp->system_page_size) <= NTFS_BLOCK_SIZE) - memcpy(trp, rp, le32_to_cpu(rp->system_page_size)); - else if (ntfs_attr_pread(log_na, pos, - le32_to_cpu(rp->system_page_size), trp) != - le32_to_cpu(rp->system_page_size)) { - err = errno; - ntfs_log_error("Failed to read whole restart page into the " - "buffer.\n"); - if (err != ENOMEM) - err = EIO; - goto err_out; - } - /* - * Perform the multi sector transfer deprotection on the buffer if the - * restart page is protected. - */ - if ((!ntfs_is_chkd_record(trp->magic) || le16_to_cpu(trp->usa_count)) - && ntfs_mst_post_read_fixup((NTFS_RECORD*)trp, - le32_to_cpu(rp->system_page_size))) { - /* - * A multi sector tranfer error was detected. We only need to - * abort if the restart page contents exceed the multi sector - * transfer fixup of the first sector. - */ - if (le16_to_cpu(rp->restart_area_offset) + - le16_to_cpu(ra->restart_area_length) > - NTFS_BLOCK_SIZE - (int)sizeof(u16)) { - ntfs_log_error("Multi sector transfer error " - "detected in $LogFile restart page.\n"); - err = EINVAL; - goto err_out; - } - } - /* - * If the restart page is modified by chkdsk or there are no active - * logfile clients, the logfile is consistent. Otherwise, need to - * check the log client records for consistency, too. - */ - err = 0; - if (ntfs_is_rstr_record(rp->magic) && - ra->client_in_use_list != LOGFILE_NO_CLIENT) { - if (!ntfs_check_log_client_array(trp)) { - err = EINVAL; - goto err_out; - } - } - if (lsn) { - if (ntfs_is_rstr_record(rp->magic)) - *lsn = sle64_to_cpu(ra->current_lsn); - else /* if (ntfs_is_chkd_record(rp->magic)) */ - *lsn = sle64_to_cpu(rp->chkdsk_lsn); - } - ntfs_log_trace("Done.\n"); - if (wrp) - *wrp = trp; - else { -err_out: - free(trp); - } - return err; -} - -/** - * ntfs_check_logfile - check in the journal if the volume is consistent - * @log_na: ntfs attribute of loaded journal $LogFile to check - * @rp: [OUT] on success this is a copy of the current restart page - * - * Check the $LogFile journal for consistency and return TRUE if it is - * consistent and FALSE if not. On success, the current restart page is - * returned in *@rp. Caller must call ntfs_free(*@rp) when finished with it. - * - * At present we only check the two restart pages and ignore the log record - * pages. - * - * Note that the MstProtected flag is not set on the $LogFile inode and hence - * when reading pages they are not deprotected. This is because we do not know - * if the $LogFile was created on a system with a different page size to ours - * yet and mst deprotection would fail if our page size is smaller. - */ -BOOL ntfs_check_logfile(ntfs_attr *log_na, RESTART_PAGE_HEADER **rp) -{ - s64 size, pos; - LSN rstr1_lsn, rstr2_lsn; - ntfs_volume *vol = log_na->ni->vol; - u8 *kaddr = NULL; - RESTART_PAGE_HEADER *rstr1_ph = NULL; - RESTART_PAGE_HEADER *rstr2_ph = NULL; - int log_page_size, log_page_mask, err; - BOOL logfile_is_empty = TRUE; - u8 log_page_bits; - - ntfs_log_trace("Entering.\n"); - /* An empty $LogFile must have been clean before it got emptied. */ - if (NVolLogFileEmpty(vol)) - goto is_empty; - size = log_na->data_size; - /* Make sure the file doesn't exceed the maximum allowed size. */ - if (size > (s64)MaxLogFileSize) - size = MaxLogFileSize; - log_page_size = DefaultLogPageSize; - log_page_mask = log_page_size - 1; - /* - * Use generic_ffs() instead of ffs() to enable the compiler to - * optimize log_page_size and log_page_bits into constants. - */ - log_page_bits = ffs(log_page_size) - 1; - size &= ~(log_page_size - 1); - - /* - * Ensure the log file is big enough to store at least the two restart - * pages and the minimum number of log record pages. - */ - if (size < log_page_size * 2 || (size - log_page_size * 2) >> - log_page_bits < MinLogRecordPages) { - ntfs_log_error("$LogFile is too small.\n"); - return FALSE; - } - /* Allocate memory for restart page. */ - kaddr = ntfs_malloc(NTFS_BLOCK_SIZE); - if (!kaddr) - return FALSE; - /* - * Read through the file looking for a restart page. Since the restart - * page header is at the beginning of a page we only need to search at - * what could be the beginning of a page (for each page size) rather - * than scanning the whole file byte by byte. If all potential places - * contain empty and uninitialized records, the log file can be assumed - * to be empty. - */ - for (pos = 0; pos < size; pos <<= 1) { - /* - * Read first NTFS_BLOCK_SIZE bytes of potential restart page. - */ - if (ntfs_attr_pread(log_na, pos, NTFS_BLOCK_SIZE, kaddr) != - NTFS_BLOCK_SIZE) { - ntfs_log_error("Failed to read first NTFS_BLOCK_SIZE " - "bytes of potential restart page.\n"); - goto err_out; - } - - /* - * A non-empty block means the logfile is not empty while an - * empty block after a non-empty block has been encountered - * means we are done. - */ - if (!ntfs_is_empty_recordp((le32*)kaddr)) - logfile_is_empty = FALSE; - else if (!logfile_is_empty) - break; - /* - * A log record page means there cannot be a restart page after - * this so no need to continue searching. - */ - if (ntfs_is_rcrd_recordp((le32*)kaddr)) - break; - /* If not a (modified by chkdsk) restart page, continue. */ - if (!ntfs_is_rstr_recordp((le32*)kaddr) && - !ntfs_is_chkd_recordp((le32*)kaddr)) { - if (!pos) - pos = NTFS_BLOCK_SIZE >> 1; - continue; - } - /* - * Check the (modified by chkdsk) restart page for consistency - * and get a copy of the complete multi sector transfer - * deprotected restart page. - */ - err = ntfs_check_and_load_restart_page(log_na, - (RESTART_PAGE_HEADER*)kaddr, pos, - !rstr1_ph ? &rstr1_ph : &rstr2_ph, - !rstr1_ph ? &rstr1_lsn : &rstr2_lsn); - if (!err) { - /* - * If we have now found the first (modified by chkdsk) - * restart page, continue looking for the second one. - */ - if (!pos) { - pos = NTFS_BLOCK_SIZE >> 1; - continue; - } - /* - * We have now found the second (modified by chkdsk) - * restart page, so we can stop looking. - */ - break; - } - /* - * Error output already done inside the function. Note, we do - * not abort if the restart page was invalid as we might still - * find a valid one further in the file. - */ - if (err != EINVAL) - goto err_out; - /* Continue looking. */ - if (!pos) - pos = NTFS_BLOCK_SIZE >> 1; - } - if (kaddr) { - free(kaddr); - kaddr = NULL; - } - if (logfile_is_empty) { - NVolSetLogFileEmpty(vol); -is_empty: - ntfs_log_trace("Done. ($LogFile is empty.)\n"); - return TRUE; - } - if (!rstr1_ph) { - if (rstr2_ph) - ntfs_log_error("BUG: rstr2_ph isn't NULL!\n"); - ntfs_log_error("Did not find any restart pages in " - "$LogFile and it was not empty.\n"); - return FALSE; - } - /* If both restart pages were found, use the more recent one. */ - if (rstr2_ph) { - /* - * If the second restart area is more recent, switch to it. - * Otherwise just throw it away. - */ - if (rstr2_lsn > rstr1_lsn) { - ntfs_log_debug("Using second restart page as it is more " - "recent.\n"); - free(rstr1_ph); - rstr1_ph = rstr2_ph; - /* rstr1_lsn = rstr2_lsn; */ - } else { - ntfs_log_debug("Using first restart page as it is more " - "recent.\n"); - free(rstr2_ph); - } - rstr2_ph = NULL; - } - /* All consistency checks passed. */ - if (rp) - *rp = rstr1_ph; - else - free(rstr1_ph); - ntfs_log_trace("Done.\n"); - return TRUE; -err_out: - free(kaddr); - free(rstr1_ph); - free(rstr2_ph); - return FALSE; -} - -/** - * ntfs_is_logfile_clean - check in the journal if the volume is clean - * @log_na: ntfs attribute of loaded journal $LogFile to check - * @rp: copy of the current restart page - * - * Analyze the $LogFile journal and return TRUE if it indicates the volume was - * shutdown cleanly and FALSE if not. - * - * At present we only look at the two restart pages and ignore the log record - * pages. This is a little bit crude in that there will be a very small number - * of cases where we think that a volume is dirty when in fact it is clean. - * This should only affect volumes that have not been shutdown cleanly but did - * not have any pending, non-check-pointed i/o, i.e. they were completely idle - * at least for the five seconds preceding the unclean shutdown. - * - * This function assumes that the $LogFile journal has already been consistency - * checked by a call to ntfs_check_logfile() and in particular if the $LogFile - * is empty this function requires that NVolLogFileEmpty() is true otherwise an - * empty volume will be reported as dirty. - */ -BOOL ntfs_is_logfile_clean(ntfs_attr *log_na, RESTART_PAGE_HEADER *rp) -{ - RESTART_AREA *ra; - - ntfs_log_trace("Entering.\n"); - /* An empty $LogFile must have been clean before it got emptied. */ - if (NVolLogFileEmpty(log_na->ni->vol)) { - ntfs_log_trace("$LogFile is empty\n"); - return TRUE; - } - if (!rp) { - ntfs_log_error("Restart page header is NULL\n"); - return FALSE; - } - if (!ntfs_is_rstr_record(rp->magic) && - !ntfs_is_chkd_record(rp->magic)) { - ntfs_log_error("Restart page buffer is invalid\n"); - return FALSE; - } - - ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset)); - /* - * If the $LogFile has active clients, i.e. it is open, and we do not - * have the RESTART_VOLUME_IS_CLEAN bit set in the restart area flags, - * we assume there was an unclean shutdown. - */ - if (ra->client_in_use_list != LOGFILE_NO_CLIENT && - !(ra->flags & RESTART_VOLUME_IS_CLEAN)) { - ntfs_log_error("The disk contains an unclean file system (%d, " - "%d).\n", le16_to_cpu(ra->client_in_use_list), - le16_to_cpu(ra->flags)); - return FALSE; - } - /* $LogFile indicates a clean shutdown. */ - ntfs_log_trace("$LogFile indicates a clean shutdown\n"); - return TRUE; -} - -/** - * ntfs_empty_logfile - empty the contents of the $LogFile journal - * @na: ntfs attribute of journal $LogFile to empty - * - * Empty the contents of the $LogFile journal @na and return 0 on success and - * -1 on error. - * - * This function assumes that the $LogFile journal has already been consistency - * checked by a call to ntfs_check_logfile() and that ntfs_is_logfile_clean() - * has been used to ensure that the $LogFile is clean. - */ -int ntfs_empty_logfile(ntfs_attr *na) -{ - s64 pos, count; - char buf[NTFS_BUF_SIZE]; - - ntfs_log_trace("Entering.\n"); - - if (NVolLogFileEmpty(na->ni->vol)) - return 0; - - if (!NAttrNonResident(na)) { - errno = EIO; - ntfs_log_perror("Resident $LogFile $DATA attribute"); - return -1; - } - - memset(buf, -1, NTFS_BUF_SIZE); - - pos = 0; - while ((count = na->data_size - pos) > 0) { - - if (count > NTFS_BUF_SIZE) - count = NTFS_BUF_SIZE; - - count = ntfs_attr_pwrite(na, pos, count, buf); - if (count <= 0) { - ntfs_log_perror("Failed to reset $LogFile"); - if (count != -1) - errno = EIO; - return -1; - } - pos += count; - } - - NVolSetLogFileEmpty(na->ni->vol); - - return 0; -} diff --git a/source/libs/libntfs/logfile.h b/source/libs/libntfs/logfile.h deleted file mode 100644 index 798d562d..00000000 --- a/source/libs/libntfs/logfile.h +++ /dev/null @@ -1,394 +0,0 @@ -/* - * logfile.h - Exports for $LogFile handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2005 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_LOGFILE_H -#define _NTFS_LOGFILE_H - -#include "types.h" -#include "endians.h" -#include "layout.h" - -/* - * Journal ($LogFile) organization: - * - * Two restart areas present in the first two pages (restart pages, one restart - * area in each page). When the volume is dismounted they should be identical, - * except for the update sequence array which usually has a different update - * sequence number. - * - * These are followed by log records organized in pages headed by a log record - * header going up to log file size. Not all pages contain log records when a - * volume is first formatted, but as the volume ages, all records will be used. - * When the log file fills up, the records at the beginning are purged (by - * modifying the oldest_lsn to a higher value presumably) and writing begins - * at the beginning of the file. Effectively, the log file is viewed as a - * circular entity. - * - * NOTE: Windows NT, 2000, and XP all use log file version 1.1 but they accept - * versions <= 1.x, including 0.-1. (Yes, that is a minus one in there!) We - * probably only want to support 1.1 as this seems to be the current version - * and we don't know how that differs from the older versions. The only - * exception is if the journal is clean as marked by the two restart pages - * then it doesn't matter whether we are on an earlier version. We can just - * reinitialize the logfile and start again with version 1.1. - */ - -/* Some $LogFile related constants. */ -#define MaxLogFileSize 0x100000000ULL -#define DefaultLogPageSize 4096 -#define MinLogRecordPages 48 - -/** - * struct RESTART_PAGE_HEADER - Log file restart page header. - * - * Begins the restart area. - */ -typedef struct { -/*Ofs*/ -/* 0 NTFS_RECORD; -- Unfolded here as gcc doesn't like unnamed structs. */ -/* 0*/ NTFS_RECORD_TYPES magic;/* The magic is "RSTR". */ -/* 4*/ le16 usa_ofs; /* See NTFS_RECORD definition in layout.h. - When creating, set this to be immediately - after this header structure (without any - alignment). */ -/* 6*/ le16 usa_count; /* See NTFS_RECORD definition in layout.h. */ - -/* 8*/ leLSN chkdsk_lsn; /* The last log file sequence number found by - chkdsk. Only used when the magic is changed - to "CHKD". Otherwise this is zero. */ -/* 16*/ le32 system_page_size; /* Byte size of system pages when the log file - was created, has to be >= 512 and a power of - 2. Use this to calculate the required size - of the usa (usa_count) and add it to usa_ofs. - Then verify that the result is less than the - value of the restart_area_offset. */ -/* 20*/ le32 log_page_size; /* Byte size of log file pages, has to be >= - 512 and a power of 2. The default is 4096 - and is used when the system page size is - between 4096 and 8192. Otherwise this is - set to the system page size instead. */ -/* 24*/ le16 restart_area_offset;/* Byte offset from the start of this header to - the RESTART_AREA. Value has to be aligned - to 8-byte boundary. When creating, set this - to be after the usa. */ -/* 26*/ sle16 minor_ver; /* Log file minor version. Only check if major - version is 1. */ -/* 28*/ sle16 major_ver; /* Log file major version. We only support - version 1.1. */ -/* sizeof() = 30 (0x1e) bytes */ -} __attribute__((__packed__)) RESTART_PAGE_HEADER; - -/* - * Constant for the log client indices meaning that there are no client records - * in this particular client array. Also inside the client records themselves, - * this means that there are no client records preceding or following this one. - */ -#define LOGFILE_NO_CLIENT const_cpu_to_le16(0xffff) -#define LOGFILE_NO_CLIENT_CPU 0xffff - -/* - * These are the so far known RESTART_AREA_* flags (16-bit) which contain - * information about the log file in which they are present. - */ -enum { - RESTART_VOLUME_IS_CLEAN = const_cpu_to_le16(0x0002), - RESTART_SPACE_FILLER = 0xffff, /* gcc: Force enum bit width to 16. */ -} __attribute__((__packed__)); - -typedef le16 RESTART_AREA_FLAGS; - -/** - * struct RESTART_AREA - Log file restart area record. - * - * The offset of this record is found by adding the offset of the - * RESTART_PAGE_HEADER to the restart_area_offset value found in it. - * See notes at restart_area_offset above. - */ -typedef struct { -/*Ofs*/ -/* 0*/ leLSN current_lsn; /* The current, i.e. last LSN inside the log - when the restart area was last written. - This happens often but what is the interval? - Is it just fixed time or is it every time a - check point is written or something else? - On create set to 0. */ -/* 8*/ le16 log_clients; /* Number of log client records in the array of - log client records which follows this - restart area. Must be 1. */ -/* 10*/ le16 client_free_list; /* The index of the first free log client record - in the array of log client records. - LOGFILE_NO_CLIENT means that there are no - free log client records in the array. - If != LOGFILE_NO_CLIENT, check that - log_clients > client_free_list. On Win2k - and presumably earlier, on a clean volume - this is != LOGFILE_NO_CLIENT, and it should - be 0, i.e. the first (and only) client - record is free and thus the logfile is - closed and hence clean. A dirty volume - would have left the logfile open and hence - this would be LOGFILE_NO_CLIENT. On WinXP - and presumably later, the logfile is always - open, even on clean shutdown so this should - always be LOGFILE_NO_CLIENT. */ -/* 12*/ le16 client_in_use_list;/* The index of the first in-use log client - record in the array of log client records. - LOGFILE_NO_CLIENT means that there are no - in-use log client records in the array. If - != LOGFILE_NO_CLIENT check that log_clients - > client_in_use_list. On Win2k and - presumably earlier, on a clean volume this - is LOGFILE_NO_CLIENT, i.e. there are no - client records in use and thus the logfile - is closed and hence clean. A dirty volume - would have left the logfile open and hence - this would be != LOGFILE_NO_CLIENT, and it - should be 0, i.e. the first (and only) - client record is in use. On WinXP and - presumably later, the logfile is always - open, even on clean shutdown so this should - always be 0. */ -/* 14*/ RESTART_AREA_FLAGS flags;/* Flags modifying LFS behaviour. On Win2k - and presumably earlier this is always 0. On - WinXP and presumably later, if the logfile - was shutdown cleanly, the second bit, - RESTART_VOLUME_IS_CLEAN, is set. This bit - is cleared when the volume is mounted by - WinXP and set when the volume is dismounted, - thus if the logfile is dirty, this bit is - clear. Thus we don't need to check the - Windows version to determine if the logfile - is clean. Instead if the logfile is closed, - we know it must be clean. If it is open and - this bit is set, we also know it must be - clean. If on the other hand the logfile is - open and this bit is clear, we can be almost - certain that the logfile is dirty. */ -/* 16*/ le32 seq_number_bits; /* How many bits to use for the sequence - number. This is calculated as 67 - the - number of bits required to store the logfile - size in bytes and this can be used in with - the specified file_size as a consistency - check. */ -/* 20*/ le16 restart_area_length;/* Length of the restart area including the - client array. Following checks required if - version matches. Otherwise, skip them. - restart_area_offset + restart_area_length - has to be <= system_page_size. Also, - restart_area_length has to be >= - client_array_offset + (log_clients * - sizeof(log client record)). */ -/* 22*/ le16 client_array_offset;/* Offset from the start of this record to - the first log client record if versions are - matched. When creating, set this to be - after this restart area structure, aligned - to 8-bytes boundary. If the versions do not - match, this is ignored and the offset is - assumed to be (sizeof(RESTART_AREA) + 7) & - ~7, i.e. rounded up to first 8-byte - boundary. Either way, client_array_offset - has to be aligned to an 8-byte boundary. - Also, restart_area_offset + - client_array_offset has to be <= 510. - Finally, client_array_offset + (log_clients - * sizeof(log client record)) has to be <= - system_page_size. On Win2k and presumably - earlier, this is 0x30, i.e. immediately - following this record. On WinXP and - presumably later, this is 0x40, i.e. there - are 16 extra bytes between this record and - the client array. This probably means that - the RESTART_AREA record is actually bigger - in WinXP and later. */ -/* 24*/ sle64 file_size; /* Usable byte size of the log file. If the - restart_area_offset + the offset of the - file_size are > 510 then corruption has - occurred. This is the very first check when - starting with the restart_area as if it - fails it means that some of the above values - will be corrupted by the multi sector - transfer protection. The file_size has to - be rounded down to be a multiple of the - log_page_size in the RESTART_PAGE_HEADER and - then it has to be at least big enough to - store the two restart pages and 48 (0x30) - log record pages. */ -/* 32*/ le32 last_lsn_data_length;/* Length of data of last LSN, not including - the log record header. On create set to - 0. */ -/* 36*/ le16 log_record_header_length;/* Byte size of the log record header. - If the version matches then check that the - value of log_record_header_length is a - multiple of 8, i.e. - (log_record_header_length + 7) & ~7 == - log_record_header_length. When creating set - it to sizeof(LOG_RECORD_HEADER), aligned to - 8 bytes. */ -/* 38*/ le16 log_page_data_offset;/* Offset to the start of data in a log record - page. Must be a multiple of 8. On create - set it to immediately after the update - sequence array of the log record page. */ -/* 40*/ le32 restart_log_open_count;/* A counter that gets incremented every - time the logfile is restarted which happens - at mount time when the logfile is opened. - When creating set to a random value. Win2k - sets it to the low 32 bits of the current - system time in NTFS format (see time.h). */ -/* 44*/ le32 reserved; /* Reserved/alignment to 8-byte boundary. */ -/* sizeof() = 48 (0x30) bytes */ -} __attribute__((__packed__)) RESTART_AREA; - -/** - * struct LOG_CLIENT_RECORD - Log client record. - * - * The offset of this record is found by adding the offset of the - * RESTART_AREA to the client_array_offset value found in it. - */ -typedef struct { -/*Ofs*/ -/* 0*/ leLSN oldest_lsn; /* Oldest LSN needed by this client. On create - set to 0. */ -/* 8*/ leLSN client_restart_lsn;/* LSN at which this client needs to restart - the volume, i.e. the current position within - the log file. At present, if clean this - should = current_lsn in restart area but it - probably also = current_lsn when dirty most - of the time. At create set to 0. */ -/* 16*/ le16 prev_client; /* The offset to the previous log client record - in the array of log client records. - LOGFILE_NO_CLIENT means there is no previous - client record, i.e. this is the first one. - This is always LOGFILE_NO_CLIENT. */ -/* 18*/ le16 next_client; /* The offset to the next log client record in - the array of log client records. - LOGFILE_NO_CLIENT means there are no next - client records, i.e. this is the last one. - This is always LOGFILE_NO_CLIENT. */ -/* 20*/ le16 seq_number; /* On Win2k and presumably earlier, this is set - to zero every time the logfile is restarted - and it is incremented when the logfile is - closed at dismount time. Thus it is 0 when - dirty and 1 when clean. On WinXP and - presumably later, this is always 0. */ -/* 22*/ u8 reserved[6]; /* Reserved/alignment. */ -/* 28*/ le32 client_name_length;/* Length of client name in bytes. Should - always be 8. */ -/* 32*/ ntfschar client_name[64];/* Name of the client in Unicode. Should - always be "NTFS" with the remaining bytes - set to 0. */ -/* sizeof() = 160 (0xa0) bytes */ -} __attribute__((__packed__)) LOG_CLIENT_RECORD; - -/** - * struct RECORD_PAGE_HEADER - Log page record page header. - * - * Each log page begins with this header and is followed by several LOG_RECORD - * structures, starting at offset 0x40 (the size of this structure and the - * following update sequence array and then aligned to 8 byte boundary, but is - * this specified anywhere?). - */ -typedef struct { -/* 0 NTFS_RECORD; -- Unfolded here as gcc doesn't like unnamed structs. */ - NTFS_RECORD_TYPES magic;/* Usually the magic is "RCRD". */ - u16 usa_ofs; /* See NTFS_RECORD definition in layout.h. - When creating, set this to be immediately - after this header structure (without any - alignment). */ - u16 usa_count; /* See NTFS_RECORD definition in layout.h. */ - - union { - LSN last_lsn; - s64 file_offset; - } __attribute__((__packed__)) copy; - u32 flags; - u16 page_count; - u16 page_position; - union { - struct { - u16 next_record_offset; - u8 reserved[6]; - LSN last_end_lsn; - } __attribute__((__packed__)) packed; - } __attribute__((__packed__)) header; -} __attribute__((__packed__)) RECORD_PAGE_HEADER; - -/** - * enum LOG_RECORD_FLAGS - Possible 16-bit flags for log records. - * - * (Or is it log record pages?) - */ -typedef enum { - LOG_RECORD_MULTI_PAGE = const_cpu_to_le16(0x0001), /* ??? */ - LOG_RECORD_SIZE_PLACE_HOLDER = 0xffff, - /* This has nothing to do with the log record. It is only so - gcc knows to make the flags 16-bit. */ -} __attribute__((__packed__)) LOG_RECORD_FLAGS; - -/** - * struct LOG_CLIENT_ID - The log client id structure identifying a log client. - */ -typedef struct { - u16 seq_number; - u16 client_index; -} __attribute__((__packed__)) LOG_CLIENT_ID; - -/** - * struct LOG_RECORD - Log record header. - * - * Each log record seems to have a constant size of 0x70 bytes. - */ -typedef struct { - LSN this_lsn; - LSN client_previous_lsn; - LSN client_undo_next_lsn; - u32 client_data_length; - LOG_CLIENT_ID client_id; - u32 record_type; - u32 transaction_id; - u16 flags; - u16 reserved_or_alignment[3]; -/* Now are at ofs 0x30 into struct. */ - u16 redo_operation; - u16 undo_operation; - u16 redo_offset; - u16 redo_length; - u16 undo_offset; - u16 undo_length; - u16 target_attribute; - u16 lcns_to_follow; /* Number of lcn_list entries - following this entry. */ -/* Now at ofs 0x40. */ - u16 record_offset; - u16 attribute_offset; - u32 alignment_or_reserved; - VCN target_vcn; -/* Now at ofs 0x50. */ - struct { /* Only present if lcns_to_follow - is not 0. */ - LCN lcn; - } __attribute__((__packed__)) lcn_list[0]; -} __attribute__((__packed__)) LOG_RECORD; - -extern BOOL ntfs_check_logfile(ntfs_attr *log_na, RESTART_PAGE_HEADER **rp); -extern BOOL ntfs_is_logfile_clean(ntfs_attr *log_na, RESTART_PAGE_HEADER *rp); -extern int ntfs_empty_logfile(ntfs_attr *na); - -#endif /* defined _NTFS_LOGFILE_H */ diff --git a/source/libs/libntfs/logging.c b/source/libs/libntfs/logging.c deleted file mode 100644 index 385bcaa6..00000000 --- a/source/libs/libntfs/logging.c +++ /dev/null @@ -1,613 +0,0 @@ -/** - * logging.c - Centralised logging. Originated from the Linux-NTFS project. - * - * Copyright (c) 2005 Richard Russon - * Copyright (c) 2005-2008 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STDARG_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYSLOG_H -#include -#endif - -#include "logging.h" -#include "misc.h" - -#ifndef PATH_SEP -#define PATH_SEP '/' -#endif - -#ifdef DEBUG -static int tab; -#endif - -/* Some gcc 3.x, 4.[01].X crash with internal compiler error. */ -#if __GNUC__ <= 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 1) -# define BROKEN_GCC_FORMAT_ATTRIBUTE -#else -# define BROKEN_GCC_FORMAT_ATTRIBUTE __attribute__((format(printf, 6, 0))) -#endif - -/** - * struct ntfs_logging - Control info for the logging system - * @levels: Bitfield of logging levels - * @flags: Flags which affect the output style - * @handler: Function to perform the actual logging - */ -struct ntfs_logging { - u32 levels; - u32 flags; - ntfs_log_handler *handler BROKEN_GCC_FORMAT_ATTRIBUTE; -}; - -/** - * ntfs_log - * This struct controls all the logging within the library and tools. - */ -static struct ntfs_logging ntfs_log = { -#ifdef DEBUG - NTFS_LOG_LEVEL_DEBUG | NTFS_LOG_LEVEL_TRACE | NTFS_LOG_LEVEL_ENTER | - NTFS_LOG_LEVEL_LEAVE | -#endif - NTFS_LOG_LEVEL_INFO | NTFS_LOG_LEVEL_QUIET | NTFS_LOG_LEVEL_WARNING | - NTFS_LOG_LEVEL_ERROR | NTFS_LOG_LEVEL_PERROR | NTFS_LOG_LEVEL_CRITICAL | - NTFS_LOG_LEVEL_PROGRESS, - NTFS_LOG_FLAG_ONLYNAME, -#ifdef DEBUG - ntfs_log_handler_outerr -#else - ntfs_log_handler_null -#endif -}; - - -/** - * ntfs_log_get_levels - Get a list of the current logging levels - * - * Find out which logging levels are enabled. - * - * Returns: Log levels in a 32-bit field - */ -u32 ntfs_log_get_levels(void) -{ - return ntfs_log.levels; -} - -/** - * ntfs_log_set_levels - Enable extra logging levels - * @levels: 32-bit field of log levels to set - * - * Enable one or more logging levels. - * The logging levels are named: NTFS_LOG_LEVEL_*. - * - * Returns: Log levels that were enabled before the call - */ -u32 ntfs_log_set_levels(u32 levels) -{ - u32 old; - old = ntfs_log.levels; - ntfs_log.levels |= levels; - return old; -} - -/** - * ntfs_log_clear_levels - Disable some logging levels - * @levels: 32-bit field of log levels to clear - * - * Disable one or more logging levels. - * The logging levels are named: NTFS_LOG_LEVEL_*. - * - * Returns: Log levels that were enabled before the call - */ -u32 ntfs_log_clear_levels(u32 levels) -{ - u32 old; - old = ntfs_log.levels; - ntfs_log.levels &= (~levels); - return old; -} - - -/** - * ntfs_log_get_flags - Get a list of logging style flags - * - * Find out which logging flags are enabled. - * - * Returns: Logging flags in a 32-bit field - */ -u32 ntfs_log_get_flags(void) -{ - return ntfs_log.flags; -} - -/** - * ntfs_log_set_flags - Enable extra logging style flags - * @flags: 32-bit field of logging flags to set - * - * Enable one or more logging flags. - * The log flags are named: NTFS_LOG_LEVEL_*. - * - * Returns: Logging flags that were enabled before the call - */ -u32 ntfs_log_set_flags(u32 flags) -{ - u32 old; - old = ntfs_log.flags; - ntfs_log.flags |= flags; - return old; -} - -/** - * ntfs_log_clear_flags - Disable some logging styles - * @flags: 32-bit field of logging flags to clear - * - * Disable one or more logging flags. - * The log flags are named: NTFS_LOG_LEVEL_*. - * - * Returns: Logging flags that were enabled before the call - */ -u32 ntfs_log_clear_flags(u32 flags) -{ - u32 old; - old = ntfs_log.flags; - ntfs_log.flags &= (~flags); - return old; -} - - -/** - * ntfs_log_get_stream - Default output streams for logging levels - * @level: Log level - * - * By default, urgent messages are sent to "stderr". - * Other messages are sent to "stdout". - * - * Returns: "string" Prefix to be used - */ -static FILE * ntfs_log_get_stream(u32 level) -{ - FILE *stream; - - switch (level) { - case NTFS_LOG_LEVEL_INFO: - case NTFS_LOG_LEVEL_QUIET: - case NTFS_LOG_LEVEL_PROGRESS: - case NTFS_LOG_LEVEL_VERBOSE: - stream = stdout; - break; - - case NTFS_LOG_LEVEL_DEBUG: - case NTFS_LOG_LEVEL_TRACE: - case NTFS_LOG_LEVEL_ENTER: - case NTFS_LOG_LEVEL_LEAVE: - case NTFS_LOG_LEVEL_WARNING: - case NTFS_LOG_LEVEL_ERROR: - case NTFS_LOG_LEVEL_CRITICAL: - case NTFS_LOG_LEVEL_PERROR: - default: - stream = stderr; - break; - } - - return stream; -} - -/** - * ntfs_log_get_prefix - Default prefixes for logging levels - * @level: Log level to be prefixed - * - * Prefixing the logging output can make it easier to parse. - * - * Returns: "string" Prefix to be used - */ -static const char * ntfs_log_get_prefix(u32 level) -{ - const char *prefix; - - switch (level) { - case NTFS_LOG_LEVEL_DEBUG: - prefix = "DEBUG: "; - break; - case NTFS_LOG_LEVEL_TRACE: - prefix = "TRACE: "; - break; - case NTFS_LOG_LEVEL_QUIET: - prefix = "QUIET: "; - break; - case NTFS_LOG_LEVEL_INFO: - prefix = "INFO: "; - break; - case NTFS_LOG_LEVEL_VERBOSE: - prefix = "VERBOSE: "; - break; - case NTFS_LOG_LEVEL_PROGRESS: - prefix = "PROGRESS: "; - break; - case NTFS_LOG_LEVEL_WARNING: - prefix = "WARNING: "; - break; - case NTFS_LOG_LEVEL_ERROR: - prefix = "ERROR: "; - break; - case NTFS_LOG_LEVEL_PERROR: - prefix = "ERROR: "; - break; - case NTFS_LOG_LEVEL_CRITICAL: - prefix = "CRITICAL: "; - break; - default: - prefix = ""; - break; - } - - return prefix; -} - - -/** - * ntfs_log_set_handler - Provide an alternate logging handler - * @handler: function to perform the logging - * - * This alternate handler will be called for all future logging requests. - * If no @handler is specified, logging will revert to the default handler. - */ -void ntfs_log_set_handler(ntfs_log_handler *handler) -{ - if (handler) { - ntfs_log.handler = handler; -#ifdef HAVE_SYSLOG_H - if (handler == ntfs_log_handler_syslog) - openlog("ntfs-3g", LOG_PID, LOG_USER); -#endif - } else - ntfs_log.handler = ntfs_log_handler_null; -} - -/** - * ntfs_log_redirect - Pass on the request to the real handler - * @function: Function in which the log line occurred - * @file: File in which the log line occurred - * @line: Line number on which the log line occurred - * @level: Level at which the line is logged - * @data: User specified data, possibly specific to a handler - * @format: printf-style formatting string - * @...: Arguments to be formatted - * - * This is just a redirector function. The arguments are simply passed to the - * main logging handler (as defined in the global logging struct @ntfs_log). - * - * Returns: -1 Error occurred - * 0 Message wasn't logged - * num Number of output characters - */ -int ntfs_log_redirect(const char *function, const char *file, - int line, u32 level, void *data, const char *format, ...) -{ - int olderr = errno; - int ret; - va_list args; - - if (!(ntfs_log.levels & level)) /* Don't log this message */ - return 0; - - va_start(args, format); - errno = olderr; - ret = ntfs_log.handler(function, file, line, level, data, format, args); - va_end(args); - - errno = olderr; - return ret; -} - - -/** - * ntfs_log_handler_syslog - syslog logging handler - * @function: Function in which the log line occurred - * @file: File in which the log line occurred - * @line: Line number on which the log line occurred - * @level: Level at which the line is logged - * @data: User specified data, possibly specific to a handler - * @format: printf-style formatting string - * @args: Arguments to be formatted - * - * A simple syslog logging handler. Ignores colors. - * - * Returns: -1 Error occurred - * 0 Message wasn't logged - * num Number of output characters - */ - - -#ifdef HAVE_SYSLOG_H - -#define LOG_LINE_LEN 512 - -int ntfs_log_handler_syslog(const char *function __attribute__((unused)), - const char *file __attribute__((unused)), - int line __attribute__((unused)), u32 level, - void *data __attribute__((unused)), - const char *format, va_list args) -{ - char logbuf[LOG_LINE_LEN]; - int ret, olderr = errno; - -#ifndef DEBUG - if ((level & NTFS_LOG_LEVEL_PERROR) && errno == ENOSPC) - return 1; -#endif - ret = vsnprintf(logbuf, LOG_LINE_LEN, format, args); - if (ret < 0) { - vsyslog(LOG_NOTICE, format, args); - ret = 1; - goto out; - } - - if ((LOG_LINE_LEN > ret + 3) && (level & NTFS_LOG_LEVEL_PERROR)) { - strncat(logbuf, ": ", LOG_LINE_LEN - ret - 1); - strncat(logbuf, strerror(olderr), LOG_LINE_LEN - (ret + 3)); - ret = strlen(logbuf); - } - - syslog(LOG_NOTICE, "%s", logbuf); -out: - errno = olderr; - return ret; -} -#endif - -/** - * ntfs_log_handler_fprintf - Basic logging handler - * @function: Function in which the log line occurred - * @file: File in which the log line occurred - * @line: Line number on which the log line occurred - * @level: Level at which the line is logged - * @data: User specified data, possibly specific to a handler - * @format: printf-style formatting string - * @args: Arguments to be formatted - * - * A simple logging handler. This is where the log line is finally displayed. - * It is more likely that you will want to set the handler to either - * ntfs_log_handler_outerr or ntfs_log_handler_stderr. - * - * Note: For this handler, @data is a pointer to a FILE output stream. - * If @data is NULL, nothing will be displayed. - * - * Returns: -1 Error occurred - * 0 Message wasn't logged - * num Number of output characters - */ -int ntfs_log_handler_fprintf(const char *function, const char *file, - int line, u32 level, void *data, const char *format, va_list args) -{ -#ifdef DEBUG - int i; -#endif - int ret = 0; - int olderr = errno; - FILE *stream; - - if (!data) /* Interpret data as a FILE stream. */ - return 0; /* If it's NULL, we can't do anything. */ - stream = (FILE*)data; - -#ifdef DEBUG - if (level == NTFS_LOG_LEVEL_LEAVE) { - if (tab) - tab--; - return 0; - } - - for (i = 0; i < tab; i++) - ret += fprintf(stream, " "); -#endif - if ((ntfs_log.flags & NTFS_LOG_FLAG_ONLYNAME) && - (strchr(file, PATH_SEP))) /* Abbreviate the filename */ - file = strrchr(file, PATH_SEP) + 1; - - if (ntfs_log.flags & NTFS_LOG_FLAG_PREFIX) /* Prefix the output */ - ret += fprintf(stream, "%s", ntfs_log_get_prefix(level)); - - if (ntfs_log.flags & NTFS_LOG_FLAG_FILENAME) /* Source filename */ - ret += fprintf(stream, "%s ", file); - - if (ntfs_log.flags & NTFS_LOG_FLAG_LINE) /* Source line number */ - ret += fprintf(stream, "(%d) ", line); - - if ((ntfs_log.flags & NTFS_LOG_FLAG_FUNCTION) || /* Source function */ - (level & NTFS_LOG_LEVEL_TRACE) || (level & NTFS_LOG_LEVEL_ENTER)) - ret += fprintf(stream, "%s(): ", function); - - ret += vfprintf(stream, format, args); - - if (level & NTFS_LOG_LEVEL_PERROR) - ret += fprintf(stream, ": %s\n", strerror(olderr)); - -#ifdef DEBUG - if (level == NTFS_LOG_LEVEL_ENTER) - tab++; -#endif - fflush(stream); - errno = olderr; - return ret; -} - -/** - * ntfs_log_handler_null - Null logging handler (no output) - * @function: Function in which the log line occurred - * @file: File in which the log line occurred - * @line: Line number on which the log line occurred - * @level: Level at which the line is logged - * @data: User specified data, possibly specific to a handler - * @format: printf-style formatting string - * @args: Arguments to be formatted - * - * This handler produces no output. It provides a way to temporarily disable - * logging, without having to change the levels and flags. - * - * Returns: 0 Message wasn't logged - */ -int ntfs_log_handler_null(const char *function __attribute__((unused)), const char *file __attribute__((unused)), - int line __attribute__((unused)), u32 level __attribute__((unused)), void *data __attribute__((unused)), - const char *format __attribute__((unused)), va_list args __attribute__((unused))) -{ - return 0; -} - -/** - * ntfs_log_handler_stdout - All logs go to stdout - * @function: Function in which the log line occurred - * @file: File in which the log line occurred - * @line: Line number on which the log line occurred - * @level: Level at which the line is logged - * @data: User specified data, possibly specific to a handler - * @format: printf-style formatting string - * @args: Arguments to be formatted - * - * Display a log message to stdout. - * - * Note: For this handler, @data is a pointer to a FILE output stream. - * If @data is NULL, then stdout will be used. - * - * Note: This function calls ntfs_log_handler_fprintf to do the main work. - * - * Returns: -1 Error occurred - * 0 Message wasn't logged - * num Number of output characters - */ -int ntfs_log_handler_stdout(const char *function, const char *file, - int line, u32 level, void *data, const char *format, va_list args) -{ - if (!data) - data = stdout; - - return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); -} - -/** - * ntfs_log_handler_outerr - Logs go to stdout/stderr depending on level - * @function: Function in which the log line occurred - * @file: File in which the log line occurred - * @line: Line number on which the log line occurred - * @level: Level at which the line is logged - * @data: User specified data, possibly specific to a handler - * @format: printf-style formatting string - * @args: Arguments to be formatted - * - * Display a log message. The output stream will be determined by the log - * level. - * - * Note: For this handler, @data is a pointer to a FILE output stream. - * If @data is NULL, the function ntfs_log_get_stream will be called - * - * Note: This function calls ntfs_log_handler_fprintf to do the main work. - * - * Returns: -1 Error occurred - * 0 Message wasn't logged - * num Number of output characters - */ -int ntfs_log_handler_outerr(const char *function, const char *file, - int line, u32 level, void *data, const char *format, va_list args) -{ - if (!data) - data = ntfs_log_get_stream(level); - - return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); -} - -/** - * ntfs_log_handler_stderr - All logs go to stderr - * @function: Function in which the log line occurred - * @file: File in which the log line occurred - * @line: Line number on which the log line occurred - * @level: Level at which the line is logged - * @data: User specified data, possibly specific to a handler - * @format: printf-style formatting string - * @args: Arguments to be formatted - * - * Display a log message to stderr. - * - * Note: For this handler, @data is a pointer to a FILE output stream. - * If @data is NULL, then stdout will be used. - * - * Note: This function calls ntfs_log_handler_fprintf to do the main work. - * - * Returns: -1 Error occurred - * 0 Message wasn't logged - * num Number of output characters - */ -int ntfs_log_handler_stderr(const char *function, const char *file, - int line, u32 level, void *data, const char *format, va_list args) -{ - if (!data) - data = stderr; - - return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); -} - - -/** - * ntfs_log_parse_option - Act upon command line options - * @option: Option flag - * - * Delegate some of the work of parsing the command line. All the options begin - * with "--log-". Options cause log levels to be enabled in @ntfs_log (the - * global logging structure). - * - * Note: The "colour" option changes the logging handler. - * - * Returns: TRUE Option understood - * FALSE Invalid log option - */ -BOOL ntfs_log_parse_option(const char *option) -{ - if (strcmp(option, "--log-debug") == 0) { - ntfs_log_set_levels(NTFS_LOG_LEVEL_DEBUG); - return TRUE; - } else if (strcmp(option, "--log-verbose") == 0) { - ntfs_log_set_levels(NTFS_LOG_LEVEL_VERBOSE); - return TRUE; - } else if (strcmp(option, "--log-quiet") == 0) { - ntfs_log_clear_levels(NTFS_LOG_LEVEL_QUIET); - return TRUE; - } else if (strcmp(option, "--log-trace") == 0) { - ntfs_log_set_levels(NTFS_LOG_LEVEL_TRACE); - return TRUE; - } - - ntfs_log_debug("Unknown logging option '%s'\n", option); - return FALSE; -} - diff --git a/source/libs/libntfs/logging.h b/source/libs/libntfs/logging.h deleted file mode 100644 index 401f5c97..00000000 --- a/source/libs/libntfs/logging.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * logging.h - Centralised logging. Originated from the Linux-NTFS project. - * - * Copyright (c) 2005 Richard Russon - * Copyright (c) 2007-2008 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _LOGGING_H_ -#define _LOGGING_H_ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDARG_H -#include -#endif - -#include "types.h" - -/* Function prototype for the logging handlers */ -typedef int (ntfs_log_handler)(const char *function, const char *file, int line, - u32 level, void *data, const char *format, va_list args); - -/* Set the logging handler from one of the functions, below. */ -void ntfs_log_set_handler(ntfs_log_handler *handler - __attribute__((format(printf, 6, 0)))); - -/* Logging handlers */ -ntfs_log_handler ntfs_log_handler_syslog __attribute__((format(printf, 6, 0))); -ntfs_log_handler ntfs_log_handler_fprintf __attribute__((format(printf, 6, 0))); -ntfs_log_handler ntfs_log_handler_null __attribute__((format(printf, 6, 0))); -ntfs_log_handler ntfs_log_handler_stdout __attribute__((format(printf, 6, 0))); -ntfs_log_handler ntfs_log_handler_outerr __attribute__((format(printf, 6, 0))); -ntfs_log_handler ntfs_log_handler_stderr __attribute__((format(printf, 6, 0))); - -/* Enable/disable certain log levels */ -u32 ntfs_log_set_levels(u32 levels); -u32 ntfs_log_clear_levels(u32 levels); -u32 ntfs_log_get_levels(void); - -/* Enable/disable certain log flags */ -u32 ntfs_log_set_flags(u32 flags); -u32 ntfs_log_clear_flags(u32 flags); -u32 ntfs_log_get_flags(void); - -/* Turn command-line options into logging flags */ -BOOL ntfs_log_parse_option(const char *option); - -int ntfs_log_redirect(const char *function, const char *file, int line, - u32 level, void *data, const char *format, ...) - __attribute__((format(printf, 6, 7))); - -/* Logging levels - Determine what gets logged */ -#define NTFS_LOG_LEVEL_DEBUG (1 << 0) /* x = 42 */ -#define NTFS_LOG_LEVEL_TRACE (1 << 1) /* Entering function x() */ -#define NTFS_LOG_LEVEL_QUIET (1 << 2) /* Quietable output */ -#define NTFS_LOG_LEVEL_INFO (1 << 3) /* Volume needs defragmenting */ -#define NTFS_LOG_LEVEL_VERBOSE (1 << 4) /* Forced to continue */ -#define NTFS_LOG_LEVEL_PROGRESS (1 << 5) /* 54% complete */ -#define NTFS_LOG_LEVEL_WARNING (1 << 6) /* You should backup before starting */ -#define NTFS_LOG_LEVEL_ERROR (1 << 7) /* Operation failed, no damage done */ -#define NTFS_LOG_LEVEL_PERROR (1 << 8) /* Message : standard error description */ -#define NTFS_LOG_LEVEL_CRITICAL (1 << 9) /* Operation failed,damage may have occurred */ -#define NTFS_LOG_LEVEL_ENTER (1 << 10) /* Enter a function */ -#define NTFS_LOG_LEVEL_LEAVE (1 << 11) /* Leave a function */ - -/* Logging style flags - Manage the style of the output */ -#define NTFS_LOG_FLAG_PREFIX (1 << 0) /* Prefix messages with "ERROR: ", etc */ -#define NTFS_LOG_FLAG_FILENAME (1 << 1) /* Show the file origin of the message */ -#define NTFS_LOG_FLAG_LINE (1 << 2) /* Show the line number of the message */ -#define NTFS_LOG_FLAG_FUNCTION (1 << 3) /* Show the function name containing the message */ -#define NTFS_LOG_FLAG_ONLYNAME (1 << 4) /* Only display the filename, not the pathname */ - -/* Macros to simplify logging. One for each level defined above. - * Note, ntfs_log_debug/trace have effect only if DEBUG is defined. - */ -#define ntfs_log_critical(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_CRITICAL,NULL,FORMAT,##ARGS) -#define ntfs_log_error(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_ERROR,NULL,FORMAT,##ARGS) -#define ntfs_log_info(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_INFO,NULL,FORMAT,##ARGS) -#define ntfs_log_perror(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_PERROR,NULL,FORMAT,##ARGS) -#define ntfs_log_progress(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_PROGRESS,NULL,FORMAT,##ARGS) -#define ntfs_log_quiet(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_QUIET,NULL,FORMAT,##ARGS) -#define ntfs_log_verbose(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_VERBOSE,NULL,FORMAT,##ARGS) -#define ntfs_log_warning(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_WARNING,NULL,FORMAT,##ARGS) - -/* By default debug and trace messages are compiled into the program, - * but not displayed. - */ -#ifdef DEBUG -#define ntfs_log_debug(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_DEBUG,NULL,FORMAT,##ARGS) -#define ntfs_log_trace(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_TRACE,NULL,FORMAT,##ARGS) -#define ntfs_log_enter(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_ENTER,NULL,FORMAT,##ARGS) -#define ntfs_log_leave(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_LEAVE,NULL,FORMAT,##ARGS) -#else -#define ntfs_log_debug(FORMAT, ARGS...)do {} while (0) -#define ntfs_log_trace(FORMAT, ARGS...)do {} while (0) -#define ntfs_log_enter(FORMAT, ARGS...)do {} while (0) -#define ntfs_log_leave(FORMAT, ARGS...)do {} while (0) -#endif /* DEBUG */ - -#endif /* _LOGGING_H_ */ - diff --git a/source/libs/libntfs/mem_allocate.h b/source/libs/libntfs/mem_allocate.h deleted file mode 100644 index 999cfaee..00000000 --- a/source/libs/libntfs/mem_allocate.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * mem_allocate.h - Memory allocation and destruction calls. - * - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _MEM_ALLOCATE_H -#define _MEM_ALLOCATE_H - -#include -#include "memory/mem2.h" - - -static inline void* ntfs_alloc (size_t size) -{ - return MEM2_alloc(size); -} - -static inline void* ntfs_align (size_t size) -{ - return MEM2_alloc(size); -} - -static inline void ntfs_free (void* mem) -{ - free(mem); -} - -#endif /* _MEM_ALLOCATE_H */ diff --git a/source/libs/libntfs/mft.c b/source/libs/libntfs/mft.c deleted file mode 100644 index e93c6646..00000000 --- a/source/libs/libntfs/mft.c +++ /dev/null @@ -1,1909 +0,0 @@ -/** - * mft.c - Mft record handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2004-2008 Szabolcs Szakacsits - * Copyright (c) 2005 Yura Pakhuchiy - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif -#include - -#include "compat.h" -#include "types.h" -#include "device.h" -#include "debug.h" -#include "bitmap.h" -#include "attrib.h" -#include "inode.h" -#include "volume.h" -#include "layout.h" -#include "lcnalloc.h" -#include "mft.h" -#include "logging.h" -#include "misc.h" - -/** - * ntfs_mft_records_read - read records from the mft from disk - * @vol: volume to read from - * @mref: starting mft record number to read - * @count: number of mft records to read - * @b: output data buffer - * - * Read @count mft records starting at @mref from volume @vol into buffer - * @b. Return 0 on success or -1 on error, with errno set to the error - * code. - * - * If any of the records exceed the initialized size of the $MFT/$DATA - * attribute, i.e. they cannot possibly be allocated mft records, assume this - * is a bug and return error code ESPIPE. - * - * The read mft records are mst deprotected and are hence ready to use. The - * caller should check each record with is_baad_record() in case mst - * deprotection failed. - * - * NOTE: @b has to be at least of size @count * vol->mft_record_size. - */ -int ntfs_mft_records_read(const ntfs_volume *vol, const MFT_REF mref, - const s64 count, MFT_RECORD *b) -{ - s64 br; - VCN m; - - ntfs_log_trace("inode %llu\n", (unsigned long long)MREF(mref)); - - if (!vol || !vol->mft_na || !b || count < 0) { - errno = EINVAL; - ntfs_log_perror("%s: b=%p count=%lld mft=%llu", __FUNCTION__, - b, (long long)count, (unsigned long long)MREF(mref)); - return -1; - } - m = MREF(mref); - /* Refuse to read non-allocated mft records. */ - if (m + count > vol->mft_na->initialized_size >> - vol->mft_record_size_bits) { - errno = ESPIPE; - ntfs_log_perror("Trying to read non-allocated mft records " - "(%lld > %lld)", (long long)m + count, - (long long)vol->mft_na->initialized_size >> - vol->mft_record_size_bits); - return -1; - } - br = ntfs_attr_mst_pread(vol->mft_na, m << vol->mft_record_size_bits, - count, vol->mft_record_size, b); - if (br != count) { - if (br != -1) - errno = EIO; - ntfs_log_perror("Failed to read of MFT, mft=%llu count=%lld " - "br=%lld", (long long)m, (long long)count, - (long long)br); - return -1; - } - return 0; -} - -/** - * ntfs_mft_records_write - write mft records to disk - * @vol: volume to write to - * @mref: starting mft record number to write - * @count: number of mft records to write - * @b: data buffer containing the mft records to write - * - * Write @count mft records starting at @mref from data buffer @b to volume - * @vol. Return 0 on success or -1 on error, with errno set to the error code. - * - * If any of the records exceed the initialized size of the $MFT/$DATA - * attribute, i.e. they cannot possibly be allocated mft records, assume this - * is a bug and return error code ESPIPE. - * - * Before the mft records are written, they are mst protected. After the write, - * they are deprotected again, thus resulting in an increase in the update - * sequence number inside the data buffer @b. - * - * If any mft records are written which are also represented in the mft mirror - * $MFTMirr, we make a copy of the relevant parts of the data buffer @b into a - * temporary buffer before we do the actual write. Then if at least one mft - * record was successfully written, we write the appropriate mft records from - * the copied buffer to the mft mirror, too. - */ -int ntfs_mft_records_write(const ntfs_volume *vol, const MFT_REF mref, - const s64 count, MFT_RECORD *b) -{ - s64 bw; - VCN m; - void *bmirr = NULL; - int cnt = 0, res = 0; - - if (!vol || !vol->mft_na || vol->mftmirr_size <= 0 || !b || count < 0) { - errno = EINVAL; - return -1; - } - m = MREF(mref); - /* Refuse to write non-allocated mft records. */ - if (m + count > vol->mft_na->initialized_size >> - vol->mft_record_size_bits) { - errno = ESPIPE; - ntfs_log_perror("Trying to write non-allocated mft records " - "(%lld > %lld)", (long long)m + count, - (long long)vol->mft_na->initialized_size >> - vol->mft_record_size_bits); - return -1; - } - if (m < vol->mftmirr_size) { - if (!vol->mftmirr_na) { - errno = EINVAL; - return -1; - } - cnt = vol->mftmirr_size - m; - if (cnt > count) - cnt = count; - bmirr = ntfs_malloc(cnt * vol->mft_record_size); - if (!bmirr) - return -1; - memcpy(bmirr, b, cnt * vol->mft_record_size); - } - bw = ntfs_attr_mst_pwrite(vol->mft_na, m << vol->mft_record_size_bits, - count, vol->mft_record_size, b); - if (bw != count) { - if (bw != -1) - errno = EIO; - if (bw >= 0) - ntfs_log_debug("Error: partial write while writing $Mft " - "record(s)!\n"); - else - ntfs_log_perror("Error writing $Mft record(s)"); - res = errno; - } - if (bmirr && bw > 0) { - if (bw < cnt) - cnt = bw; - bw = ntfs_attr_mst_pwrite(vol->mftmirr_na, - m << vol->mft_record_size_bits, cnt, - vol->mft_record_size, bmirr); - if (bw != cnt) { - if (bw != -1) - errno = EIO; - ntfs_log_debug("Error: failed to sync $MFTMirr! Run " - "chkdsk.\n"); - res = errno; - } - } - free(bmirr); - if (!res) - return res; - errno = res; - return -1; -} - -int ntfs_mft_record_check(const ntfs_volume *vol, const MFT_REF mref, - MFT_RECORD *m) -{ - ATTR_RECORD *a; - int ret = -1; - - if (!ntfs_is_file_record(m->magic)) { - ntfs_log_error("Record %llu has no FILE magic (0x%x)\n", - (unsigned long long)MREF(mref), *(le32 *)m); - goto err_out; - } - - if (le32_to_cpu(m->bytes_allocated) != vol->mft_record_size) { - ntfs_log_error("Record %llu has corrupt allocation size " - "(%u <> %u)\n", (unsigned long long)MREF(mref), - vol->mft_record_size, - le32_to_cpu(m->bytes_allocated)); - goto err_out; - } - - a = (ATTR_RECORD *)((char *)m + le16_to_cpu(m->attrs_offset)); - if (p2n(a) < p2n(m) || (char *)a > (char *)m + vol->mft_record_size) { - ntfs_log_error("Record %llu is corrupt\n", - (unsigned long long)MREF(mref)); - goto err_out; - } - - ret = 0; -err_out: - if (ret) - errno = EIO; - return ret; -} - -/** - * ntfs_file_record_read - read a FILE record from the mft from disk - * @vol: volume to read from - * @mref: mft reference specifying mft record to read - * @mrec: address of pointer in which to return the mft record - * @attr: address of pointer in which to return the first attribute - * - * Read a FILE record from the mft of @vol from the storage medium. @mref - * specifies the mft record to read, including the sequence number, which can - * be 0 if no sequence number checking is to be performed. - * - * The function allocates a buffer large enough to hold the mft record and - * reads the record into the buffer (mst deprotecting it in the process). - * *@mrec is then set to point to the buffer. - * - * If @attr is not NULL, *@attr is set to point to the first attribute in the - * mft record, i.e. *@attr is a pointer into *@mrec. - * - * Return 0 on success, or -1 on error, with errno set to the error code. - * - * The read mft record is checked for having the magic FILE, - * and for having a matching sequence number (if MSEQNO(*@mref) != 0). - * If either of these fails, -1 is returned and errno is set to EIO. If you get - * this, but you still want to read the mft record (e.g. in order to correct - * it), use ntfs_mft_record_read() directly. - * - * Note: Caller has to free *@mrec when finished. - * - * Note: We do not check if the mft record is flagged in use. The caller can - * check if desired. - */ -int ntfs_file_record_read(const ntfs_volume *vol, const MFT_REF mref, - MFT_RECORD **mrec, ATTR_RECORD **attr) -{ - MFT_RECORD *m; - - if (!vol || !mrec) { - errno = EINVAL; - ntfs_log_perror("%s: mrec=%p", __FUNCTION__, mrec); - return -1; - } - - m = *mrec; - if (!m) { - m = ntfs_malloc(vol->mft_record_size); - if (!m) - return -1; - } - if (ntfs_mft_record_read(vol, mref, m)) - goto err_out; - - if (ntfs_mft_record_check(vol, mref, m)) - goto err_out; - - if (MSEQNO(mref) && MSEQNO(mref) != le16_to_cpu(m->sequence_number)) { - ntfs_log_error("Record %llu has wrong SeqNo (%d <> %d)\n", - (unsigned long long)MREF(mref), MSEQNO(mref), - le16_to_cpu(m->sequence_number)); - errno = EIO; - goto err_out; - } - *mrec = m; - if (attr) - *attr = (ATTR_RECORD*)((char*)m + le16_to_cpu(m->attrs_offset)); - return 0; -err_out: - if (m != *mrec) - free(m); - return -1; -} - -/** - * ntfs_mft_record_layout - layout an mft record into a memory buffer - * @vol: volume to which the mft record will belong - * @mref: mft reference specifying the mft record number - * @mrec: destination buffer of size >= @vol->mft_record_size bytes - * - * Layout an empty, unused mft record with the mft reference @mref into the - * buffer @m. The volume @vol is needed because the mft record structure was - * modified in NTFS 3.1 so we need to know which volume version this mft record - * will be used on. - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -int ntfs_mft_record_layout(const ntfs_volume *vol, const MFT_REF mref, - MFT_RECORD *mrec) -{ - ATTR_RECORD *a; - - if (!vol || !mrec) { - errno = EINVAL; - ntfs_log_perror("%s: mrec=%p", __FUNCTION__, mrec); - return -1; - } - /* Aligned to 2-byte boundary. */ - if (vol->major_ver < 3 || (vol->major_ver == 3 && !vol->minor_ver)) - mrec->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD_OLD) + 1) & ~1); - else { - /* Abort if mref is > 32 bits. */ - if (MREF(mref) & 0x0000ffff00000000ull) { - errno = ERANGE; - ntfs_log_perror("Mft reference exceeds 32 bits"); - return -1; - } - mrec->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD) + 1) & ~1); - /* - * Set the NTFS 3.1+ specific fields while we know that the - * volume version is 3.1+. - */ - mrec->reserved = cpu_to_le16(0); - mrec->mft_record_number = cpu_to_le32(MREF(mref)); - } - mrec->magic = magic_FILE; - if (vol->mft_record_size >= NTFS_BLOCK_SIZE) - mrec->usa_count = cpu_to_le16(vol->mft_record_size / - NTFS_BLOCK_SIZE + 1); - else { - mrec->usa_count = cpu_to_le16(1); - ntfs_log_error("Sector size is bigger than MFT record size. " - "Setting usa_count to 1. If Windows chkdsk " - "reports this as corruption, please email %s " - "stating that you saw this message and that " - "the file system created was corrupt. " - "Thank you.\n", NTFS_DEV_LIST); - } - /* Set the update sequence number to 1. */ - *(u16*)((u8*)mrec + le16_to_cpu(mrec->usa_ofs)) = cpu_to_le16(1); - mrec->lsn = cpu_to_le64(0ull); - mrec->sequence_number = cpu_to_le16(1); - mrec->link_count = cpu_to_le16(0); - /* Aligned to 8-byte boundary. */ - mrec->attrs_offset = cpu_to_le16((le16_to_cpu(mrec->usa_ofs) + - (le16_to_cpu(mrec->usa_count) << 1) + 7) & ~7); - mrec->flags = cpu_to_le16(0); - /* - * Using attrs_offset plus eight bytes (for the termination attribute), - * aligned to 8-byte boundary. - */ - mrec->bytes_in_use = cpu_to_le32((le16_to_cpu(mrec->attrs_offset) + 8 + - 7) & ~7); - mrec->bytes_allocated = cpu_to_le32(vol->mft_record_size); - mrec->base_mft_record = cpu_to_le64((MFT_REF)0); - mrec->next_attr_instance = cpu_to_le16(0); - a = (ATTR_RECORD*)((u8*)mrec + le16_to_cpu(mrec->attrs_offset)); - a->type = AT_END; - a->length = cpu_to_le32(0); - /* Finally, clear the unused part of the mft record. */ - memset((u8*)a + 8, 0, vol->mft_record_size - ((u8*)a + 8 - (u8*)mrec)); - return 0; -} - -/** - * ntfs_mft_record_format - format an mft record on an ntfs volume - * @vol: volume on which to format the mft record - * @mref: mft reference specifying mft record to format - * - * Format the mft record with the mft reference @mref in $MFT/$DATA, i.e. lay - * out an empty, unused mft record in memory and write it to the volume @vol. - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -int ntfs_mft_record_format(const ntfs_volume *vol, const MFT_REF mref) -{ - MFT_RECORD *m; - int ret = -1; - - ntfs_log_enter("Entering\n"); - - m = ntfs_calloc(vol->mft_record_size); - if (!m) - goto out; - - if (ntfs_mft_record_layout(vol, mref, m)) - goto free_m; - - if (ntfs_mft_record_write(vol, mref, m)) - goto free_m; - - ret = 0; -free_m: - free(m); -out: - ntfs_log_leave("\n"); - return ret; -} - -static const char *es = " Leaving inconsistent metadata. Run chkdsk."; - -/** - * ntfs_ffz - Find the first unset (zero) bit in a word - * @word: - * - * Description... - * - * Returns: - */ -static inline unsigned int ntfs_ffz(unsigned int word) -{ - return ffs(~word) - 1; -} - -static int ntfs_is_mft(ntfs_inode *ni) -{ - if (ni && ni->mft_no == FILE_MFT) - return 1; - return 0; -} - -#ifndef PAGE_SIZE -#define PAGE_SIZE 4096 -#endif - -#define RESERVED_MFT_RECORDS 64 - -/** - * ntfs_mft_bitmap_find_free_rec - find a free mft record in the mft bitmap - * @vol: volume on which to search for a free mft record - * @base_ni: open base inode if allocating an extent mft record or NULL - * - * Search for a free mft record in the mft bitmap attribute on the ntfs volume - * @vol. - * - * If @base_ni is NULL start the search at the default allocator position. - * - * If @base_ni is not NULL start the search at the mft record after the base - * mft record @base_ni. - * - * Return the free mft record on success and -1 on error with errno set to the - * error code. An error code of ENOSPC means that there are no free mft - * records in the currently initialized mft bitmap. - */ -static int ntfs_mft_bitmap_find_free_rec(ntfs_volume *vol, ntfs_inode *base_ni) -{ - s64 pass_end, ll, data_pos, pass_start, ofs, bit; - ntfs_attr *mftbmp_na; - u8 *buf, *byte; - unsigned int size; - u8 pass, b; - int ret = -1; - - ntfs_log_enter("Entering\n"); - - mftbmp_na = vol->mftbmp_na; - /* - * Set the end of the pass making sure we do not overflow the mft - * bitmap. - */ - size = PAGE_SIZE; - pass_end = vol->mft_na->allocated_size >> vol->mft_record_size_bits; - ll = mftbmp_na->initialized_size << 3; - if (pass_end > ll) - pass_end = ll; - pass = 1; - if (!base_ni) - data_pos = vol->mft_data_pos; - else - data_pos = base_ni->mft_no + 1; - if (data_pos < RESERVED_MFT_RECORDS) - data_pos = RESERVED_MFT_RECORDS; - if (data_pos >= pass_end) { - data_pos = RESERVED_MFT_RECORDS; - pass = 2; - /* This happens on a freshly formatted volume. */ - if (data_pos >= pass_end) { - errno = ENOSPC; - goto leave; - } - } - if (ntfs_is_mft(base_ni)) { - data_pos = 0; - pass = 2; - } - pass_start = data_pos; - buf = ntfs_malloc(PAGE_SIZE); - if (!buf) - goto leave; - - ntfs_log_debug("Starting bitmap search: pass %u, pass_start 0x%llx, " - "pass_end 0x%llx, data_pos 0x%llx.\n", pass, - (long long)pass_start, (long long)pass_end, - (long long)data_pos); -#ifdef DEBUG - byte = NULL; - b = 0; -#endif - /* Loop until a free mft record is found. */ - for (; pass <= 2; size = PAGE_SIZE) { - /* Cap size to pass_end. */ - ofs = data_pos >> 3; - ll = ((pass_end + 7) >> 3) - ofs; - if (size > ll) - size = ll; - ll = ntfs_attr_pread(mftbmp_na, ofs, size, buf); - if (ll < 0) { - ntfs_log_perror("Failed to read $MFT bitmap"); - free(buf); - goto leave; - } - ntfs_log_debug("Read 0x%llx bytes.\n", (long long)ll); - /* If we read at least one byte, search @buf for a zero bit. */ - if (ll) { - size = ll << 3; - bit = data_pos & 7; - data_pos &= ~7ull; - ntfs_log_debug("Before inner for loop: size 0x%x, " - "data_pos 0x%llx, bit 0x%llx, " - "*byte 0x%hhx, b %u.\n", size, - (long long)data_pos, (long long)bit, - byte ? *byte : -1, b); - for (; bit < size && data_pos + bit < pass_end; - bit &= ~7ull, bit += 8) { - /* - * If we're extending $MFT and running out of the first - * mft record (base record) then give up searching since - * no guarantee that the found record will be accessible. - */ - if (ntfs_is_mft(base_ni) && bit > 400) - goto out; - - byte = buf + (bit >> 3); - if (*byte == 0xff) - continue; - - /* Note: ffz() result must be zero based. */ - b = ntfs_ffz((unsigned long)*byte); - if (b < 8 && b >= (bit & 7)) { - free(buf); - ret = data_pos + (bit & ~7ull) + b; - goto leave; - } - } - ntfs_log_debug("After inner for loop: size 0x%x, " - "data_pos 0x%llx, bit 0x%llx, " - "*byte 0x%hhx, b %u.\n", size, - (long long)data_pos, (long long)bit, - byte ? *byte : -1, b); - data_pos += size; - /* - * If the end of the pass has not been reached yet, - * continue searching the mft bitmap for a zero bit. - */ - if (data_pos < pass_end) - continue; - } - /* Do the next pass. */ - pass++; - if (pass == 2) { - /* - * Starting the second pass, in which we scan the first - * part of the zone which we omitted earlier. - */ - pass_end = pass_start; - data_pos = pass_start = RESERVED_MFT_RECORDS; - ntfs_log_debug("pass %i, pass_start 0x%llx, pass_end " - "0x%llx.\n", pass, (long long)pass_start, - (long long)pass_end); - if (data_pos >= pass_end) - break; - } - } - /* No free mft records in currently initialized mft bitmap. */ -out: - free(buf); - errno = ENOSPC; -leave: - ntfs_log_leave("\n"); - return ret; -} - -static int ntfs_mft_attr_extend(ntfs_attr *na) -{ - int ret = STATUS_ERROR; - ntfs_log_enter("Entering\n"); - - if (!NInoAttrList(na->ni)) { - if (ntfs_inode_add_attrlist(na->ni)) { - ntfs_log_perror("%s: Can not add attrlist #3", __FUNCTION__); - goto out; - } - /* We can't sync the $MFT inode since its runlist is bogus. */ - ret = STATUS_KEEP_SEARCHING; - goto out; - } - - if (ntfs_attr_update_mapping_pairs(na, 0)) { - ntfs_log_perror("%s: MP update failed", __FUNCTION__); - goto out; - } - - ret = STATUS_OK; -out: - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_mft_bitmap_extend_allocation_i - see ntfs_mft_bitmap_extend_allocation - */ -static int ntfs_mft_bitmap_extend_allocation_i(ntfs_volume *vol) -{ - LCN lcn; - s64 ll = 0; /* silence compiler warning */ - ntfs_attr *mftbmp_na; - runlist_element *rl, *rl2 = NULL; /* silence compiler warning */ - ntfs_attr_search_ctx *ctx; - MFT_RECORD *m = NULL; /* silence compiler warning */ - ATTR_RECORD *a = NULL; /* silence compiler warning */ - int err, mp_size; - int ret = STATUS_ERROR; - u32 old_alen = 0; /* silence compiler warning */ - BOOL mp_rebuilt = FALSE; - BOOL update_mp = FALSE; - - mftbmp_na = vol->mftbmp_na; - /* - * Determine the last lcn of the mft bitmap. The allocated size of the - * mft bitmap cannot be zero so we are ok to do this. - */ - rl = ntfs_attr_find_vcn(mftbmp_na, (mftbmp_na->allocated_size - 1) >> - vol->cluster_size_bits); - if (!rl || !rl->length || rl->lcn < 0) { - ntfs_log_error("Failed to determine last allocated " - "cluster of mft bitmap attribute.\n"); - if (rl) - errno = EIO; - return STATUS_ERROR; - } - lcn = rl->lcn + rl->length; - - rl2 = ntfs_cluster_alloc(vol, rl[1].vcn, 1, lcn, DATA_ZONE); - if (!rl2) { - ntfs_log_error("Failed to allocate a cluster for " - "the mft bitmap.\n"); - return STATUS_ERROR; - } - rl = ntfs_runlists_merge(mftbmp_na->rl, rl2); - if (!rl) { - err = errno; - ntfs_log_error("Failed to merge runlists for mft " - "bitmap.\n"); - if (ntfs_cluster_free_from_rl(vol, rl2)) - ntfs_log_error("Failed to deallocate " - "cluster.%s\n", es); - free(rl2); - errno = err; - return STATUS_ERROR; - } - mftbmp_na->rl = rl; - ntfs_log_debug("Adding one run to mft bitmap.\n"); - /* Find the last run in the new runlist. */ - for (; rl[1].length; rl++) - ; - /* - * Update the attribute record as well. Note: @rl is the last - * (non-terminator) runlist element of mft bitmap. - */ - ctx = ntfs_attr_get_search_ctx(mftbmp_na->ni, NULL); - if (!ctx) - goto undo_alloc; - - if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, - mftbmp_na->name_len, 0, rl[1].vcn, NULL, 0, ctx)) { - ntfs_log_error("Failed to find last attribute extent of " - "mft bitmap attribute.\n"); - goto undo_alloc; - } - m = ctx->mrec; - a = ctx->attr; - ll = sle64_to_cpu(a->lowest_vcn); - rl2 = ntfs_attr_find_vcn(mftbmp_na, ll); - if (!rl2 || !rl2->length) { - ntfs_log_error("Failed to determine previous last " - "allocated cluster of mft bitmap attribute.\n"); - if (rl2) - errno = EIO; - goto undo_alloc; - } - /* Get the size for the new mapping pairs array for this extent. */ - mp_size = ntfs_get_size_for_mapping_pairs(vol, rl2, ll, INT_MAX); - if (mp_size <= 0) { - ntfs_log_error("Get size for mapping pairs failed for " - "mft bitmap attribute extent.\n"); - goto undo_alloc; - } - /* Expand the attribute record if necessary. */ - old_alen = le32_to_cpu(a->length); - if (ntfs_attr_record_resize(m, a, mp_size + - le16_to_cpu(a->mapping_pairs_offset))) { - ntfs_log_info("extending $MFT bitmap\n"); - ret = ntfs_mft_attr_extend(vol->mftbmp_na); - if (ret == STATUS_OK) - goto ok; - if (ret == STATUS_ERROR) { - ntfs_log_perror("%s: ntfs_mft_attr_extend failed", __FUNCTION__); - update_mp = TRUE; - } - goto undo_alloc; - } - mp_rebuilt = TRUE; - /* Generate the mapping pairs array directly into the attr record. */ - if (ntfs_mapping_pairs_build(vol, (u8*)a + - le16_to_cpu(a->mapping_pairs_offset), mp_size, rl2, ll, - NULL)) { - ntfs_log_error("Failed to build mapping pairs array for " - "mft bitmap attribute.\n"); - errno = EIO; - goto undo_alloc; - } - /* Update the highest_vcn. */ - a->highest_vcn = cpu_to_sle64(rl[1].vcn - 1); - /* - * We now have extended the mft bitmap allocated_size by one cluster. - * Reflect this in the ntfs_attr structure and the attribute record. - */ - if (a->lowest_vcn) { - /* - * We are not in the first attribute extent, switch to it, but - * first ensure the changes will make it to disk later. - */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, - mftbmp_na->name_len, 0, 0, NULL, 0, ctx)) { - ntfs_log_error("Failed to find first attribute " - "extent of mft bitmap attribute.\n"); - goto restore_undo_alloc; - } - a = ctx->attr; - } -ok: - mftbmp_na->allocated_size += vol->cluster_size; - a->allocated_size = cpu_to_sle64(mftbmp_na->allocated_size); - /* Ensure the changes make it to disk. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - return STATUS_OK; - -restore_undo_alloc: - err = errno; - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, - mftbmp_na->name_len, 0, rl[1].vcn, NULL, 0, ctx)) { - ntfs_log_error("Failed to find last attribute extent of " - "mft bitmap attribute.%s\n", es); - ntfs_attr_put_search_ctx(ctx); - mftbmp_na->allocated_size += vol->cluster_size; - /* - * The only thing that is now wrong is ->allocated_size of the - * base attribute extent which chkdsk should be able to fix. - */ - errno = err; - return STATUS_ERROR; - } - m = ctx->mrec; - a = ctx->attr; - a->highest_vcn = cpu_to_sle64(rl[1].vcn - 2); - errno = err; -undo_alloc: - err = errno; - - /* Remove the last run from the runlist. */ - lcn = rl->lcn; - rl->lcn = rl[1].lcn; - rl->length = 0; - - /* FIXME: use an ntfs_cluster_free_* function */ - if (ntfs_bitmap_clear_bit(vol->lcnbmp_na, lcn)) - ntfs_log_error("Failed to free cluster.%s\n", es); - else - vol->free_clusters++; - if (mp_rebuilt) { - if (ntfs_mapping_pairs_build(vol, (u8*)a + - le16_to_cpu(a->mapping_pairs_offset), - old_alen - le16_to_cpu(a->mapping_pairs_offset), - rl2, ll, NULL)) - ntfs_log_error("Failed to restore mapping " - "pairs array.%s\n", es); - if (ntfs_attr_record_resize(m, a, old_alen)) - ntfs_log_error("Failed to restore attribute " - "record.%s\n", es); - ntfs_inode_mark_dirty(ctx->ntfs_ino); - } - if (update_mp) { - if (ntfs_attr_update_mapping_pairs(vol->mftbmp_na, 0)) - ntfs_log_perror("%s: MP update failed", __FUNCTION__); - } - if (ctx) - ntfs_attr_put_search_ctx(ctx); - errno = err; - return ret; -} - -/** - * ntfs_mft_bitmap_extend_allocation - extend mft bitmap attribute by a cluster - * @vol: volume on which to extend the mft bitmap attribute - * - * Extend the mft bitmap attribute on the ntfs volume @vol by one cluster. - * - * Note: Only changes allocated_size, i.e. does not touch initialized_size or - * data_size. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -static int ntfs_mft_bitmap_extend_allocation(ntfs_volume *vol) -{ - int ret; - - ntfs_log_enter("Entering\n"); - ret = ntfs_mft_bitmap_extend_allocation_i(vol); - ntfs_log_leave("\n"); - return ret; -} -/** - * ntfs_mft_bitmap_extend_initialized - extend mft bitmap initialized data - * @vol: volume on which to extend the mft bitmap attribute - * - * Extend the initialized portion of the mft bitmap attribute on the ntfs - * volume @vol by 8 bytes. - * - * Note: Only changes initialized_size and data_size, i.e. requires that - * allocated_size is big enough to fit the new initialized_size. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -static int ntfs_mft_bitmap_extend_initialized(ntfs_volume *vol) -{ - s64 old_data_size, old_initialized_size, ll; - ntfs_attr *mftbmp_na; - ntfs_attr_search_ctx *ctx; - ATTR_RECORD *a; - int err; - int ret = -1; - - ntfs_log_enter("Entering\n"); - - mftbmp_na = vol->mftbmp_na; - ctx = ntfs_attr_get_search_ctx(mftbmp_na->ni, NULL); - if (!ctx) - goto out; - - if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, - mftbmp_na->name_len, 0, 0, NULL, 0, ctx)) { - ntfs_log_error("Failed to find first attribute extent of " - "mft bitmap attribute.\n"); - err = errno; - goto put_err_out; - } - a = ctx->attr; - old_data_size = mftbmp_na->data_size; - old_initialized_size = mftbmp_na->initialized_size; - mftbmp_na->initialized_size += 8; - a->initialized_size = cpu_to_sle64(mftbmp_na->initialized_size); - if (mftbmp_na->initialized_size > mftbmp_na->data_size) { - mftbmp_na->data_size = mftbmp_na->initialized_size; - a->data_size = cpu_to_sle64(mftbmp_na->data_size); - } - /* Ensure the changes make it to disk. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - /* Initialize the mft bitmap attribute value with zeroes. */ - ll = 0; - ll = ntfs_attr_pwrite(mftbmp_na, old_initialized_size, 8, &ll); - if (ll == 8) { - ntfs_log_debug("Wrote eight initialized bytes to mft bitmap.\n"); - vol->free_mft_records += (8 * 8); - ret = 0; - goto out; - } - ntfs_log_error("Failed to write to mft bitmap.\n"); - err = errno; - if (ll >= 0) - err = EIO; - /* Try to recover from the error. */ - ctx = ntfs_attr_get_search_ctx(mftbmp_na->ni, NULL); - if (!ctx) - goto err_out; - - if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, - mftbmp_na->name_len, 0, 0, NULL, 0, ctx)) { - ntfs_log_error("Failed to find first attribute extent of " - "mft bitmap attribute.%s\n", es); -put_err_out: - ntfs_attr_put_search_ctx(ctx); - goto err_out; - } - a = ctx->attr; - mftbmp_na->initialized_size = old_initialized_size; - a->initialized_size = cpu_to_sle64(old_initialized_size); - if (mftbmp_na->data_size != old_data_size) { - mftbmp_na->data_size = old_data_size; - a->data_size = cpu_to_sle64(old_data_size); - } - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - ntfs_log_debug("Restored status of mftbmp: allocated_size 0x%llx, " - "data_size 0x%llx, initialized_size 0x%llx.\n", - (long long)mftbmp_na->allocated_size, - (long long)mftbmp_na->data_size, - (long long)mftbmp_na->initialized_size); -err_out: - errno = err; -out: - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_mft_data_extend_allocation - extend mft data attribute - * @vol: volume on which to extend the mft data attribute - * - * Extend the mft data attribute on the ntfs volume @vol by 16 mft records - * worth of clusters or if not enough space for this by one mft record worth - * of clusters. - * - * Note: Only changes allocated_size, i.e. does not touch initialized_size or - * data_size. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -static int ntfs_mft_data_extend_allocation(ntfs_volume *vol) -{ - LCN lcn; - VCN old_last_vcn; - s64 min_nr, nr, ll = 0; /* silence compiler warning */ - ntfs_attr *mft_na; - runlist_element *rl, *rl2; - ntfs_attr_search_ctx *ctx; - MFT_RECORD *m = NULL; /* silence compiler warning */ - ATTR_RECORD *a = NULL; /* silence compiler warning */ - int err, mp_size; - int ret = STATUS_ERROR; - u32 old_alen = 0; /* silence compiler warning */ - BOOL mp_rebuilt = FALSE; - BOOL update_mp = FALSE; - - ntfs_log_enter("Extending mft data allocation.\n"); - - mft_na = vol->mft_na; - /* - * Determine the preferred allocation location, i.e. the last lcn of - * the mft data attribute. The allocated size of the mft data - * attribute cannot be zero so we are ok to do this. - */ - rl = ntfs_attr_find_vcn(mft_na, - (mft_na->allocated_size - 1) >> vol->cluster_size_bits); - - if (!rl || !rl->length || rl->lcn < 0) { - ntfs_log_error("Failed to determine last allocated " - "cluster of mft data attribute.\n"); - if (rl) - errno = EIO; - goto out; - } - - lcn = rl->lcn + rl->length; - ntfs_log_debug("Last lcn of mft data attribute is 0x%llx.\n", (long long)lcn); - /* Minimum allocation is one mft record worth of clusters. */ - min_nr = vol->mft_record_size >> vol->cluster_size_bits; - if (!min_nr) - min_nr = 1; - /* Want to allocate 16 mft records worth of clusters. */ - nr = vol->mft_record_size << 4 >> vol->cluster_size_bits; - if (!nr) - nr = min_nr; - - old_last_vcn = rl[1].vcn; - do { - rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE); - if (rl2) - break; - if (errno != ENOSPC || nr == min_nr) { - ntfs_log_perror("Failed to allocate (%lld) clusters " - "for $MFT", (long long)nr); - goto out; - } - /* - * There is not enough space to do the allocation, but there - * might be enough space to do a minimal allocation so try that - * before failing. - */ - nr = min_nr; - ntfs_log_debug("Retrying mft data allocation with minimal cluster " - "count %lli.\n", (long long)nr); - } while (1); - - ntfs_log_debug("Allocated %lld clusters.\n", (long long)nr); - - rl = ntfs_runlists_merge(mft_na->rl, rl2); - if (!rl) { - err = errno; - ntfs_log_error("Failed to merge runlists for mft data " - "attribute.\n"); - if (ntfs_cluster_free_from_rl(vol, rl2)) - ntfs_log_error("Failed to deallocate clusters " - "from the mft data attribute.%s\n", es); - free(rl2); - errno = err; - goto out; - } - mft_na->rl = rl; - - /* Find the last run in the new runlist. */ - for (; rl[1].length; rl++) - ; - /* Update the attribute record as well. */ - ctx = ntfs_attr_get_search_ctx(mft_na->ni, NULL); - if (!ctx) - goto undo_alloc; - - if (ntfs_attr_lookup(mft_na->type, mft_na->name, mft_na->name_len, 0, - rl[1].vcn, NULL, 0, ctx)) { - ntfs_log_error("Failed to find last attribute extent of " - "mft data attribute.\n"); - goto undo_alloc; - } - m = ctx->mrec; - a = ctx->attr; - ll = sle64_to_cpu(a->lowest_vcn); - rl2 = ntfs_attr_find_vcn(mft_na, ll); - if (!rl2 || !rl2->length) { - ntfs_log_error("Failed to determine previous last " - "allocated cluster of mft data attribute.\n"); - if (rl2) - errno = EIO; - goto undo_alloc; - } - /* Get the size for the new mapping pairs array for this extent. */ - mp_size = ntfs_get_size_for_mapping_pairs(vol, rl2, ll, INT_MAX); - if (mp_size <= 0) { - ntfs_log_error("Get size for mapping pairs failed for " - "mft data attribute extent.\n"); - goto undo_alloc; - } - /* Expand the attribute record if necessary. */ - old_alen = le32_to_cpu(a->length); - if (ntfs_attr_record_resize(m, a, - mp_size + le16_to_cpu(a->mapping_pairs_offset))) { - ret = ntfs_mft_attr_extend(vol->mft_na); - if (ret == STATUS_OK) - goto ok; - if (ret == STATUS_ERROR) { - ntfs_log_perror("%s: ntfs_mft_attr_extend failed", __FUNCTION__); - update_mp = TRUE; - } - goto undo_alloc; - } - mp_rebuilt = TRUE; - /* - * Generate the mapping pairs array directly into the attribute record. - */ - if (ntfs_mapping_pairs_build(vol, - (u8*)a + le16_to_cpu(a->mapping_pairs_offset), mp_size, - rl2, ll, NULL)) { - ntfs_log_error("Failed to build mapping pairs array of " - "mft data attribute.\n"); - errno = EIO; - goto undo_alloc; - } - /* Update the highest_vcn. */ - a->highest_vcn = cpu_to_sle64(rl[1].vcn - 1); - /* - * We now have extended the mft data allocated_size by nr clusters. - * Reflect this in the ntfs_attr structure and the attribute record. - * @rl is the last (non-terminator) runlist element of mft data - * attribute. - */ - if (a->lowest_vcn) { - /* - * We are not in the first attribute extent, switch to it, but - * first ensure the changes will make it to disk later. - */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(mft_na->type, mft_na->name, - mft_na->name_len, 0, 0, NULL, 0, ctx)) { - ntfs_log_error("Failed to find first attribute " - "extent of mft data attribute.\n"); - goto restore_undo_alloc; - } - a = ctx->attr; - } -ok: - mft_na->allocated_size += nr << vol->cluster_size_bits; - a->allocated_size = cpu_to_sle64(mft_na->allocated_size); - /* Ensure the changes make it to disk. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - ret = STATUS_OK; -out: - ntfs_log_leave("\n"); - return ret; - -restore_undo_alloc: - err = errno; - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(mft_na->type, mft_na->name, mft_na->name_len, 0, - rl[1].vcn, NULL, 0, ctx)) { - ntfs_log_error("Failed to find last attribute extent of " - "mft data attribute.%s\n", es); - ntfs_attr_put_search_ctx(ctx); - mft_na->allocated_size += nr << vol->cluster_size_bits; - /* - * The only thing that is now wrong is ->allocated_size of the - * base attribute extent which chkdsk should be able to fix. - */ - errno = err; - ret = STATUS_ERROR; - goto out; - } - m = ctx->mrec; - a = ctx->attr; - a->highest_vcn = cpu_to_sle64(old_last_vcn - 1); - errno = err; -undo_alloc: - err = errno; - if (ntfs_cluster_free(vol, mft_na, old_last_vcn, -1) < 0) - ntfs_log_error("Failed to free clusters from mft data " - "attribute.%s\n", es); - if (ntfs_rl_truncate(&mft_na->rl, old_last_vcn)) - ntfs_log_error("Failed to truncate mft data attribute " - "runlist.%s\n", es); - if (mp_rebuilt) { - if (ntfs_mapping_pairs_build(vol, (u8*)a + - le16_to_cpu(a->mapping_pairs_offset), - old_alen - le16_to_cpu(a->mapping_pairs_offset), - rl2, ll, NULL)) - ntfs_log_error("Failed to restore mapping pairs " - "array.%s\n", es); - if (ntfs_attr_record_resize(m, a, old_alen)) - ntfs_log_error("Failed to restore attribute " - "record.%s\n", es); - ntfs_inode_mark_dirty(ctx->ntfs_ino); - } - if (update_mp) { - if (ntfs_attr_update_mapping_pairs(vol->mft_na, 0)) - ntfs_log_perror("%s: MP update failed", __FUNCTION__); - } - if (ctx) - ntfs_attr_put_search_ctx(ctx); - errno = err; - goto out; -} - - -static int ntfs_mft_record_init(ntfs_volume *vol, s64 size) -{ - int ret = -1; - ntfs_attr *mft_na, *mftbmp_na; - s64 old_data_initialized, old_data_size; - ntfs_attr_search_ctx *ctx; - - ntfs_log_enter("Entering\n"); - - /* NOTE: Caller must sanity check vol, vol->mft_na and vol->mftbmp_na */ - - mft_na = vol->mft_na; - mftbmp_na = vol->mftbmp_na; - - /* - * The mft record is outside the initialized data. Extend the mft data - * attribute until it covers the allocated record. The loop is only - * actually traversed more than once when a freshly formatted volume - * is first written to so it optimizes away nicely in the common case. - */ - ntfs_log_debug("Status of mft data before extension: " - "allocated_size 0x%llx, data_size 0x%llx, " - "initialized_size 0x%llx.\n", - (long long)mft_na->allocated_size, - (long long)mft_na->data_size, - (long long)mft_na->initialized_size); - while (size > mft_na->allocated_size) { - if (ntfs_mft_data_extend_allocation(vol) == STATUS_ERROR) - goto out; - ntfs_log_debug("Status of mft data after allocation extension: " - "allocated_size 0x%llx, data_size 0x%llx, " - "initialized_size 0x%llx.\n", - (long long)mft_na->allocated_size, - (long long)mft_na->data_size, - (long long)mft_na->initialized_size); - } - - old_data_initialized = mft_na->initialized_size; - old_data_size = mft_na->data_size; - - /* - * Extend mft data initialized size (and data size of course) to reach - * the allocated mft record, formatting the mft records along the way. - * Note: We only modify the ntfs_attr structure as that is all that is - * needed by ntfs_mft_record_format(). We will update the attribute - * record itself in one fell swoop later on. - */ - while (size > mft_na->initialized_size) { - s64 ll2 = mft_na->initialized_size >> vol->mft_record_size_bits; - mft_na->initialized_size += vol->mft_record_size; - if (mft_na->initialized_size > mft_na->data_size) - mft_na->data_size = mft_na->initialized_size; - ntfs_log_debug("Initializing mft record 0x%llx.\n", (long long)ll2); - if (ntfs_mft_record_format(vol, ll2) < 0) { - ntfs_log_perror("Failed to format mft record"); - goto undo_data_init; - } - } - - /* Update the mft data attribute record to reflect the new sizes. */ - ctx = ntfs_attr_get_search_ctx(mft_na->ni, NULL); - if (!ctx) - goto undo_data_init; - - if (ntfs_attr_lookup(mft_na->type, mft_na->name, mft_na->name_len, 0, - 0, NULL, 0, ctx)) { - ntfs_log_error("Failed to find first attribute extent of " - "mft data attribute.\n"); - ntfs_attr_put_search_ctx(ctx); - goto undo_data_init; - } - ctx->attr->initialized_size = cpu_to_sle64(mft_na->initialized_size); - ctx->attr->data_size = cpu_to_sle64(mft_na->data_size); - ctx->attr->allocated_size = cpu_to_sle64(mft_na->allocated_size); - - /* Ensure the changes make it to disk. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - ntfs_log_debug("Status of mft data after mft record initialization: " - "allocated_size 0x%llx, data_size 0x%llx, " - "initialized_size 0x%llx.\n", - (long long)mft_na->allocated_size, - (long long)mft_na->data_size, - (long long)mft_na->initialized_size); - - /* Sanity checks. */ - if (mft_na->data_size > mft_na->allocated_size || - mft_na->initialized_size > mft_na->data_size) - NTFS_BUG("mft_na sanity checks failed"); - - /* Sync MFT to minimize data loss if there won't be clean unmount. */ - if (ntfs_inode_sync(mft_na->ni)) - goto undo_data_init; - - ret = 0; -out: - ntfs_log_leave("\n"); - return ret; - -undo_data_init: - mft_na->initialized_size = old_data_initialized; - mft_na->data_size = old_data_size; - goto out; -} - -static int ntfs_mft_rec_init(ntfs_volume *vol, s64 size) -{ - int ret = -1; - ntfs_attr *mft_na, *mftbmp_na; - s64 old_data_initialized, old_data_size; - ntfs_attr_search_ctx *ctx; - - ntfs_log_enter("Entering\n"); - - mft_na = vol->mft_na; - mftbmp_na = vol->mftbmp_na; - - if (size > mft_na->allocated_size || size > mft_na->initialized_size) { - errno = EIO; - ntfs_log_perror("%s: unexpected $MFT sizes, see below", __FUNCTION__); - ntfs_log_error("$MFT: size=%lld allocated_size=%lld " - "data_size=%lld initialized_size=%lld\n", - (long long)size, - (long long)mft_na->allocated_size, - (long long)mft_na->data_size, - (long long)mft_na->initialized_size); - goto out; - } - - old_data_initialized = mft_na->initialized_size; - old_data_size = mft_na->data_size; - - /* Update the mft data attribute record to reflect the new sizes. */ - ctx = ntfs_attr_get_search_ctx(mft_na->ni, NULL); - if (!ctx) - goto undo_data_init; - - if (ntfs_attr_lookup(mft_na->type, mft_na->name, mft_na->name_len, 0, - 0, NULL, 0, ctx)) { - ntfs_log_error("Failed to find first attribute extent of " - "mft data attribute.\n"); - ntfs_attr_put_search_ctx(ctx); - goto undo_data_init; - } - ctx->attr->initialized_size = cpu_to_sle64(mft_na->initialized_size); - ctx->attr->data_size = cpu_to_sle64(mft_na->data_size); - - /* CHECKME: ctx->attr->allocation_size is already ok? */ - - /* Ensure the changes make it to disk. */ - ntfs_inode_mark_dirty(ctx->ntfs_ino); - ntfs_attr_put_search_ctx(ctx); - - /* Sanity checks. */ - if (mft_na->data_size > mft_na->allocated_size || - mft_na->initialized_size > mft_na->data_size) - NTFS_BUG("mft_na sanity checks failed"); -out: - ntfs_log_leave("\n"); - return ret; - -undo_data_init: - mft_na->initialized_size = old_data_initialized; - mft_na->data_size = old_data_size; - goto out; -} - -static ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol) -{ - s64 ll, bit; - ntfs_attr *mft_na, *mftbmp_na; - MFT_RECORD *m; - ntfs_inode *ni = NULL; - ntfs_inode *base_ni; - int err; - le16 seq_no, usn; - - ntfs_log_enter("Entering\n"); - - mft_na = vol->mft_na; - mftbmp_na = vol->mftbmp_na; - - base_ni = mft_na->ni; - - bit = ntfs_mft_bitmap_find_free_rec(vol, base_ni); - if (bit >= 0) - goto found_free_rec; - - if (errno != ENOSPC) - goto out; - - errno = ENOSPC; - /* strerror() is intentionally used below, we want to log this error. */ - ntfs_log_error("No free mft record for $MFT: %s\n", strerror(errno)); - goto err_out; - -found_free_rec: - if (ntfs_bitmap_set_bit(mftbmp_na, bit)) { - ntfs_log_error("Failed to allocate bit in mft bitmap #2\n"); - goto err_out; - } - - ll = (bit + 1) << vol->mft_record_size_bits; - if (ll > mft_na->initialized_size) - if (ntfs_mft_rec_init(vol, ll) < 0) - goto undo_mftbmp_alloc; - /* - * We now have allocated and initialized the mft record. Need to read - * it from disk and re-format it, preserving the sequence number if it - * is not zero as well as the update sequence number if it is not zero - * or -1 (0xffff). - */ - m = ntfs_malloc(vol->mft_record_size); - if (!m) - goto undo_mftbmp_alloc; - - if (ntfs_mft_record_read(vol, bit, m)) { - free(m); - goto undo_mftbmp_alloc; - } - /* Sanity check that the mft record is really not in use. */ - if (ntfs_is_file_record(m->magic) && (m->flags & MFT_RECORD_IN_USE)) { - ntfs_log_error("Inode %lld is used but it wasn't marked in " - "$MFT bitmap. Fixed.\n", (long long)bit); - free(m); - goto undo_mftbmp_alloc; - } - - seq_no = m->sequence_number; - usn = *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)); - if (ntfs_mft_record_layout(vol, bit, m)) { - ntfs_log_error("Failed to re-format mft record.\n"); - free(m); - goto undo_mftbmp_alloc; - } - if (seq_no) - m->sequence_number = seq_no; - seq_no = usn; - if (seq_no && seq_no != const_cpu_to_le16(0xffff)) - *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = usn; - /* Set the mft record itself in use. */ - m->flags |= MFT_RECORD_IN_USE; - /* Now need to open an ntfs inode for the mft record. */ - ni = ntfs_inode_allocate(vol); - if (!ni) { - ntfs_log_error("Failed to allocate buffer for inode.\n"); - free(m); - goto undo_mftbmp_alloc; - } - ni->mft_no = bit; - ni->mrec = m; - /* - * If we are allocating an extent mft record, make the opened inode an - * extent inode and attach it to the base inode. Also, set the base - * mft record reference in the extent inode. - */ - ni->nr_extents = -1; - ni->base_ni = base_ni; - m->base_mft_record = MK_LE_MREF(base_ni->mft_no, - le16_to_cpu(base_ni->mrec->sequence_number)); - /* - * Attach the extent inode to the base inode, reallocating - * memory if needed. - */ - if (!(base_ni->nr_extents & 3)) { - ntfs_inode **extent_nis; - int i; - - i = (base_ni->nr_extents + 4) * sizeof(ntfs_inode *); - extent_nis = ntfs_malloc(i); - if (!extent_nis) { - free(m); - free(ni); - goto undo_mftbmp_alloc; - } - if (base_ni->nr_extents) { - memcpy(extent_nis, base_ni->extent_nis, - i - 4 * sizeof(ntfs_inode *)); - free(base_ni->extent_nis); - } - base_ni->extent_nis = extent_nis; - } - base_ni->extent_nis[base_ni->nr_extents++] = ni; - - /* Make sure the allocated inode is written out to disk later. */ - ntfs_inode_mark_dirty(ni); - /* Initialize time, allocated and data size in ntfs_inode struct. */ - ni->data_size = ni->allocated_size = 0; - ni->flags = 0; - ni->creation_time = ni->last_data_change_time = - ni->last_mft_change_time = - ni->last_access_time = ntfs_current_time(); - /* Update the default mft allocation position if it was used. */ - if (!base_ni) - vol->mft_data_pos = bit + 1; - /* Return the opened, allocated inode of the allocated mft record. */ - ntfs_log_error("allocated %sinode %lld\n", - base_ni ? "extent " : "", (long long)bit); -out: - ntfs_log_leave("\n"); - return ni; - -undo_mftbmp_alloc: - err = errno; - if (ntfs_bitmap_clear_bit(mftbmp_na, bit)) - ntfs_log_error("Failed to clear bit in mft bitmap.%s\n", es); - errno = err; -err_out: - if (!errno) - errno = EIO; - ni = NULL; - goto out; -} - -/** - * ntfs_mft_record_alloc - allocate an mft record on an ntfs volume - * @vol: volume on which to allocate the mft record - * @base_ni: open base inode if allocating an extent mft record or NULL - * - * Allocate an mft record in $MFT/$DATA of an open ntfs volume @vol. - * - * If @base_ni is NULL make the mft record a base mft record and allocate it at - * the default allocator position. - * - * If @base_ni is not NULL make the allocated mft record an extent record, - * allocate it starting at the mft record after the base mft record and attach - * the allocated and opened ntfs inode to the base inode @base_ni. - * - * On success return the now opened ntfs (extent) inode of the mft record. - * - * On error return NULL with errno set to the error code. - * - * To find a free mft record, we scan the mft bitmap for a zero bit. To - * optimize this we start scanning at the place specified by @base_ni or if - * @base_ni is NULL we start where we last stopped and we perform wrap around - * when we reach the end. Note, we do not try to allocate mft records below - * number 24 because numbers 0 to 15 are the defined system files anyway and 16 - * to 24 are special in that they are used for storing extension mft records - * for the $DATA attribute of $MFT. This is required to avoid the possibility - * of creating a run list with a circular dependence which once written to disk - * can never be read in again. Windows will only use records 16 to 24 for - * normal files if the volume is completely out of space. We never use them - * which means that when the volume is really out of space we cannot create any - * more files while Windows can still create up to 8 small files. We can start - * doing this at some later time, it does not matter much for now. - * - * When scanning the mft bitmap, we only search up to the last allocated mft - * record. If there are no free records left in the range 24 to number of - * allocated mft records, then we extend the $MFT/$DATA attribute in order to - * create free mft records. We extend the allocated size of $MFT/$DATA by 16 - * records at a time or one cluster, if cluster size is above 16kiB. If there - * is not sufficient space to do this, we try to extend by a single mft record - * or one cluster, if cluster size is above the mft record size, but we only do - * this if there is enough free space, which we know from the values returned - * by the failed cluster allocation function when we tried to do the first - * allocation. - * - * No matter how many mft records we allocate, we initialize only the first - * allocated mft record, incrementing mft data size and initialized size - * accordingly, open an ntfs_inode for it and return it to the caller, unless - * there are less than 24 mft records, in which case we allocate and initialize - * mft records until we reach record 24 which we consider as the first free mft - * record for use by normal files. - * - * If during any stage we overflow the initialized data in the mft bitmap, we - * extend the initialized size (and data size) by 8 bytes, allocating another - * cluster if required. The bitmap data size has to be at least equal to the - * number of mft records in the mft, but it can be bigger, in which case the - * superfluous bits are padded with zeroes. - * - * Thus, when we return successfully (return value non-zero), we will have: - * - initialized / extended the mft bitmap if necessary, - * - initialized / extended the mft data if necessary, - * - set the bit corresponding to the mft record being allocated in the - * mft bitmap, - * - open an ntfs_inode for the allocated mft record, and we will - * - return the ntfs_inode. - * - * On error (return value zero), nothing will have changed. If we had changed - * anything before the error occurred, we will have reverted back to the - * starting state before returning to the caller. Thus, except for bugs, we - * should always leave the volume in a consistent state when returning from - * this function. - * - * Note, this function cannot make use of most of the normal functions, like - * for example for attribute resizing, etc, because when the run list overflows - * the base mft record and an attribute list is used, it is very important that - * the extension mft records used to store the $DATA attribute of $MFT can be - * reached without having to read the information contained inside them, as - * this would make it impossible to find them in the first place after the - * volume is dismounted. $MFT/$BITMAP probably does not need to follow this - * rule because the bitmap is not essential for finding the mft records, but on - * the other hand, handling the bitmap in this special way would make life - * easier because otherwise there might be circular invocations of functions - * when reading the bitmap but if we are careful, we should be able to avoid - * all problems. - */ -ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, ntfs_inode *base_ni) -{ - s64 ll, bit; - ntfs_attr *mft_na, *mftbmp_na; - MFT_RECORD *m; - ntfs_inode *ni = NULL; - int err; - le16 seq_no, usn; - - if (base_ni) - ntfs_log_enter("Entering (allocating an extent mft record for " - "base mft record %lld).\n", - (long long)base_ni->mft_no); - else - ntfs_log_enter("Entering (allocating a base mft record)\n"); - if (!vol || !vol->mft_na || !vol->mftbmp_na) { - errno = EINVAL; - goto out; - } - - if (ntfs_is_mft(base_ni)) { - ni = ntfs_mft_rec_alloc(vol); - goto out; - } - - mft_na = vol->mft_na; - mftbmp_na = vol->mftbmp_na; -retry: - bit = ntfs_mft_bitmap_find_free_rec(vol, base_ni); - if (bit >= 0) { - ntfs_log_debug("found free record (#1) at %lld\n", - (long long)bit); - goto found_free_rec; - } - if (errno != ENOSPC) - goto out; - /* - * No free mft records left. If the mft bitmap already covers more - * than the currently used mft records, the next records are all free, - * so we can simply allocate the first unused mft record. - * Note: We also have to make sure that the mft bitmap at least covers - * the first 24 mft records as they are special and whilst they may not - * be in use, we do not allocate from them. - */ - ll = mft_na->initialized_size >> vol->mft_record_size_bits; - if (mftbmp_na->initialized_size << 3 > ll && - mftbmp_na->initialized_size > RESERVED_MFT_RECORDS / 8) { - bit = ll; - if (bit < RESERVED_MFT_RECORDS) - bit = RESERVED_MFT_RECORDS; - ntfs_log_debug("found free record (#2) at %lld\n", - (long long)bit); - goto found_free_rec; - } - /* - * The mft bitmap needs to be expanded until it covers the first unused - * mft record that we can allocate. - * Note: The smallest mft record we allocate is mft record 24. - */ - ntfs_log_debug("Status of mftbmp before extension: allocated_size 0x%llx, " - "data_size 0x%llx, initialized_size 0x%llx.\n", - (long long)mftbmp_na->allocated_size, - (long long)mftbmp_na->data_size, - (long long)mftbmp_na->initialized_size); - if (mftbmp_na->initialized_size + 8 > mftbmp_na->allocated_size) { - - int ret = ntfs_mft_bitmap_extend_allocation(vol); - - if (ret == STATUS_ERROR) - goto err_out; - if (ret == STATUS_KEEP_SEARCHING) { - ret = ntfs_mft_bitmap_extend_allocation(vol); - if (ret != STATUS_OK) - goto err_out; - } - - ntfs_log_debug("Status of mftbmp after allocation extension: " - "allocated_size 0x%llx, data_size 0x%llx, " - "initialized_size 0x%llx.\n", - (long long)mftbmp_na->allocated_size, - (long long)mftbmp_na->data_size, - (long long)mftbmp_na->initialized_size); - } - /* - * We now have sufficient allocated space, extend the initialized_size - * as well as the data_size if necessary and fill the new space with - * zeroes. - */ - bit = mftbmp_na->initialized_size << 3; - if (ntfs_mft_bitmap_extend_initialized(vol)) - goto err_out; - ntfs_log_debug("Status of mftbmp after initialized extension: " - "allocated_size 0x%llx, data_size 0x%llx, " - "initialized_size 0x%llx.\n", - (long long)mftbmp_na->allocated_size, - (long long)mftbmp_na->data_size, - (long long)mftbmp_na->initialized_size); - ntfs_log_debug("found free record (#3) at %lld\n", (long long)bit); -found_free_rec: - /* @bit is the found free mft record, allocate it in the mft bitmap. */ - if (ntfs_bitmap_set_bit(mftbmp_na, bit)) { - ntfs_log_error("Failed to allocate bit in mft bitmap.\n"); - goto err_out; - } - - /* The mft bitmap is now uptodate. Deal with mft data attribute now. */ - ll = (bit + 1) << vol->mft_record_size_bits; - if (ll > mft_na->initialized_size) - if (ntfs_mft_record_init(vol, ll) < 0) - goto undo_mftbmp_alloc; - - /* - * We now have allocated and initialized the mft record. Need to read - * it from disk and re-format it, preserving the sequence number if it - * is not zero as well as the update sequence number if it is not zero - * or -1 (0xffff). - */ - m = ntfs_malloc(vol->mft_record_size); - if (!m) - goto undo_mftbmp_alloc; - - if (ntfs_mft_record_read(vol, bit, m)) { - free(m); - goto undo_mftbmp_alloc; - } - /* Sanity check that the mft record is really not in use. */ - if (ntfs_is_file_record(m->magic) && (m->flags & MFT_RECORD_IN_USE)) { - ntfs_log_error("Inode %lld is used but it wasn't marked in " - "$MFT bitmap. Fixed.\n", (long long)bit); - free(m); - goto retry; - } - seq_no = m->sequence_number; - usn = *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)); - if (ntfs_mft_record_layout(vol, bit, m)) { - ntfs_log_error("Failed to re-format mft record.\n"); - free(m); - goto undo_mftbmp_alloc; - } - if (seq_no) - m->sequence_number = seq_no; - seq_no = usn; - if (seq_no && seq_no != const_cpu_to_le16(0xffff)) - *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = usn; - /* Set the mft record itself in use. */ - m->flags |= MFT_RECORD_IN_USE; - /* Now need to open an ntfs inode for the mft record. */ - ni = ntfs_inode_allocate(vol); - if (!ni) { - ntfs_log_error("Failed to allocate buffer for inode.\n"); - free(m); - goto undo_mftbmp_alloc; - } - ni->mft_no = bit; - ni->mrec = m; - /* - * If we are allocating an extent mft record, make the opened inode an - * extent inode and attach it to the base inode. Also, set the base - * mft record reference in the extent inode. - */ - if (base_ni) { - ni->nr_extents = -1; - ni->base_ni = base_ni; - m->base_mft_record = MK_LE_MREF(base_ni->mft_no, - le16_to_cpu(base_ni->mrec->sequence_number)); - /* - * Attach the extent inode to the base inode, reallocating - * memory if needed. - */ - if (!(base_ni->nr_extents & 3)) { - ntfs_inode **extent_nis; - int i; - - i = (base_ni->nr_extents + 4) * sizeof(ntfs_inode *); - extent_nis = ntfs_malloc(i); - if (!extent_nis) { - free(m); - free(ni); - goto undo_mftbmp_alloc; - } - if (base_ni->nr_extents) { - memcpy(extent_nis, base_ni->extent_nis, - i - 4 * sizeof(ntfs_inode *)); - free(base_ni->extent_nis); - } - base_ni->extent_nis = extent_nis; - } - base_ni->extent_nis[base_ni->nr_extents++] = ni; - } - /* Make sure the allocated inode is written out to disk later. */ - ntfs_inode_mark_dirty(ni); - /* Initialize time, allocated and data size in ntfs_inode struct. */ - ni->data_size = ni->allocated_size = 0; - ni->flags = 0; - ni->creation_time = ni->last_data_change_time = - ni->last_mft_change_time = - ni->last_access_time = ntfs_current_time(); - /* Update the default mft allocation position if it was used. */ - if (!base_ni) - vol->mft_data_pos = bit + 1; - /* Return the opened, allocated inode of the allocated mft record. */ - ntfs_log_debug("allocated %sinode 0x%llx.\n", - base_ni ? "extent " : "", (long long)bit); - vol->free_mft_records--; -out: - ntfs_log_leave("\n"); - return ni; - -undo_mftbmp_alloc: - err = errno; - if (ntfs_bitmap_clear_bit(mftbmp_na, bit)) - ntfs_log_error("Failed to clear bit in mft bitmap.%s\n", es); - errno = err; -err_out: - if (!errno) - errno = EIO; - ni = NULL; - goto out; -} - -/** - * ntfs_mft_record_free - free an mft record on an ntfs volume - * @vol: volume on which to free the mft record - * @ni: open ntfs inode of the mft record to free - * - * Free the mft record of the open inode @ni on the mounted ntfs volume @vol. - * Note that this function calls ntfs_inode_close() internally and hence you - * cannot use the pointer @ni any more after this function returns success. - * - * On success return 0 and on error return -1 with errno set to the error code. - */ -int ntfs_mft_record_free(ntfs_volume *vol, ntfs_inode *ni) -{ - u64 mft_no; - int err; - u16 seq_no; - le16 old_seq_no; - - ntfs_log_trace("Entering for inode 0x%llx.\n", (long long) ni->mft_no); - - if (!vol || !vol->mftbmp_na || !ni) { - errno = EINVAL; - return -1; - } - - /* Cache the mft reference for later. */ - mft_no = ni->mft_no; - - /* Mark the mft record as not in use. */ - ni->mrec->flags &= ~MFT_RECORD_IN_USE; - - /* Increment the sequence number, skipping zero, if it is not zero. */ - old_seq_no = ni->mrec->sequence_number; - seq_no = le16_to_cpu(old_seq_no); - if (seq_no == 0xffff) - seq_no = 1; - else if (seq_no) - seq_no++; - ni->mrec->sequence_number = cpu_to_le16(seq_no); - - /* Set the inode dirty and write it out. */ - ntfs_inode_mark_dirty(ni); - if (ntfs_inode_sync(ni)) { - err = errno; - goto sync_rollback; - } - - /* Clear the bit in the $MFT/$BITMAP corresponding to this record. */ - if (ntfs_bitmap_clear_bit(vol->mftbmp_na, mft_no)) { - err = errno; - // FIXME: If ntfs_bitmap_clear_run() guarantees rollback on - // error, this could be changed to goto sync_rollback; - goto bitmap_rollback; - } - - /* Throw away the now freed inode. */ -#if CACHE_NIDATA_SIZE - if (!ntfs_inode_real_close(ni)) { -#else - if (!ntfs_inode_close(ni)) { -#endif - vol->free_mft_records++; - return 0; - } - err = errno; - - /* Rollback what we did... */ -bitmap_rollback: - if (ntfs_bitmap_set_bit(vol->mftbmp_na, mft_no)) - ntfs_log_debug("Eeek! Rollback failed in ntfs_mft_record_free(). " - "Leaving inconsistent metadata!\n"); -sync_rollback: - ni->mrec->flags |= MFT_RECORD_IN_USE; - ni->mrec->sequence_number = old_seq_no; - ntfs_inode_mark_dirty(ni); - errno = err; - return -1; -} - -/** - * ntfs_mft_usn_dec - Decrement USN by one - * @mrec: pointer to an mft record - * - * On success return 0 and on error return -1 with errno set. - */ -int ntfs_mft_usn_dec(MFT_RECORD *mrec) -{ - u16 usn; - le16 *usnp; - - if (!mrec) { - errno = EINVAL; - return -1; - } - usnp = (le16*)((char*)mrec + le16_to_cpu(mrec->usa_ofs)); - usn = le16_to_cpup(usnp); - if (usn-- <= 1) - usn = 0xfffe; - *usnp = cpu_to_le16(usn); - - return 0; -} - diff --git a/source/libs/libntfs/mft.h b/source/libs/libntfs/mft.h deleted file mode 100644 index bb15f0f3..00000000 --- a/source/libs/libntfs/mft.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * mft.h - Exports for MFT record handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2002 Anton Altaparmakov - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2006-2008 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_MFT_H -#define _NTFS_MFT_H - -#include "volume.h" -#include "inode.h" -#include "layout.h" -#include "logging.h" - -extern int ntfs_mft_records_read(const ntfs_volume *vol, const MFT_REF mref, - const s64 count, MFT_RECORD *b); - -/** - * ntfs_mft_record_read - read a record from the mft - * @vol: volume to read from - * @mref: mft record number to read - * @b: output data buffer - * - * Read the mft record specified by @mref from volume @vol into buffer @b. - * Return 0 on success or -1 on error, with errno set to the error code. - * - * The read mft record is mst deprotected and is hence ready to use. The caller - * should check the record with is_baad_record() in case mst deprotection - * failed. - * - * NOTE: @b has to be at least of size vol->mft_record_size. - */ -static __inline__ int ntfs_mft_record_read(const ntfs_volume *vol, - const MFT_REF mref, MFT_RECORD *b) -{ - int ret; - - ntfs_log_enter("Entering for inode %lld\n", (long long)MREF(mref)); - ret = ntfs_mft_records_read(vol, mref, 1, b); - ntfs_log_leave("\n"); - return ret; -} - -extern int ntfs_mft_record_check(const ntfs_volume *vol, const MFT_REF mref, - MFT_RECORD *m); - -extern int ntfs_file_record_read(const ntfs_volume *vol, const MFT_REF mref, - MFT_RECORD **mrec, ATTR_RECORD **attr); - -extern int ntfs_mft_records_write(const ntfs_volume *vol, const MFT_REF mref, - const s64 count, MFT_RECORD *b); - -/** - * ntfs_mft_record_write - write an mft record to disk - * @vol: volume to write to - * @mref: mft record number to write - * @b: data buffer containing the mft record to write - * - * Write the mft record specified by @mref from buffer @b to volume @vol. - * Return 0 on success or -1 on error, with errno set to the error code. - * - * Before the mft record is written, it is mst protected. After the write, it - * is deprotected again, thus resulting in an increase in the update sequence - * number inside the buffer @b. - * - * NOTE: @b has to be at least of size vol->mft_record_size. - */ -static __inline__ int ntfs_mft_record_write(const ntfs_volume *vol, - const MFT_REF mref, MFT_RECORD *b) -{ - int ret; - - ntfs_log_enter("Entering for inode %lld\n", (long long)MREF(mref)); - ret = ntfs_mft_records_write(vol, mref, 1, b); - ntfs_log_leave("\n"); - return ret; -} - -/** - * ntfs_mft_record_get_data_size - return number of bytes used in mft record @b - * @m: mft record to get the data size of - * - * Takes the mft record @m and returns the number of bytes used in the record - * or 0 on error (i.e. @m is not a valid mft record). Zero is not a valid size - * for an mft record as it at least has to have the MFT_RECORD itself and a - * zero length attribute of type AT_END, thus making the minimum size 56 bytes. - * - * Aside: The size is independent of NTFS versions 1.x/3.x because the 8-byte - * alignment of the first attribute mask the difference in MFT_RECORD size - * between NTFS 1.x and 3.x. Also, you would expect every mft record to - * contain an update sequence array as well but that could in theory be - * non-existent (don't know if Windows' NTFS driver/chkdsk wouldn't view this - * as corruption in itself though). - */ -static __inline__ u32 ntfs_mft_record_get_data_size(const MFT_RECORD *m) -{ - if (!m || !ntfs_is_mft_record(m->magic)) - return 0; - /* Get the number of used bytes and return it. */ - return le32_to_cpu(m->bytes_in_use); -} - -extern int ntfs_mft_record_layout(const ntfs_volume *vol, const MFT_REF mref, - MFT_RECORD *mrec); - -extern int ntfs_mft_record_format(const ntfs_volume *vol, const MFT_REF mref); - -extern ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, ntfs_inode *base_ni); - -extern int ntfs_mft_record_free(ntfs_volume *vol, ntfs_inode *ni); - -extern int ntfs_mft_usn_dec(MFT_RECORD *mrec); - -#endif /* defined _NTFS_MFT_H */ - diff --git a/source/libs/libntfs/misc.c b/source/libs/libntfs/misc.c deleted file mode 100644 index b2e17cbf..00000000 --- a/source/libs/libntfs/misc.c +++ /dev/null @@ -1,61 +0,0 @@ -/** - * misc.c : miscellaneous : - * - dealing with errors in memory allocation - * - * Copyright (c) 2008 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - -#include "types.h" -#include "misc.h" -#include "logging.h" - -/** - * ntfs_calloc - * - * Return a pointer to the allocated memory or NULL if the request fails. - */ -void *ntfs_calloc(size_t size) -{ - void *p; - - p = calloc(1, size); - if (!p) - ntfs_log_perror("Failed to calloc %lld bytes", (long long)size); - return p; -} - -void *ntfs_malloc(size_t size) -{ - void *p; - - p = malloc(size); - if (!p) - ntfs_log_perror("Failed to malloc %lld bytes", (long long)size); - return p; -} diff --git a/source/libs/libntfs/misc.h b/source/libs/libntfs/misc.h deleted file mode 100644 index a03e964e..00000000 --- a/source/libs/libntfs/misc.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * misc.h : miscellaneous exports - * - memory allocation - * - * Copyright (c) 2008 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_MISC_H_ -#define _NTFS_MISC_H_ - -void *ntfs_calloc(size_t size); -void *ntfs_malloc(size_t size); - -#endif /* _NTFS_MISC_H_ */ - diff --git a/source/libs/libntfs/mst.c b/source/libs/libntfs/mst.c deleted file mode 100644 index 470942d6..00000000 --- a/source/libs/libntfs/mst.c +++ /dev/null @@ -1,231 +0,0 @@ -/** - * mst.c - Multi sector fixup handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * Copyright (c) 2006-2009 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "mst.h" -#include "logging.h" - -/** - * ntfs_mst_post_read_fixup - deprotect multi sector transfer protected data - * @b: pointer to the data to deprotect - * @size: size in bytes of @b - * - * Perform the necessary post read multi sector transfer fixups and detect the - * presence of incomplete multi sector transfers. - In that case, overwrite the - * magic of the ntfs record header being processed with "BAAD" (in memory only!) - * and abort processing. - * - * Return 0 on success and -1 on error, with errno set to the error code. The - * following error codes are defined: - * EINVAL Invalid arguments or invalid NTFS record in buffer @b. - * EIO Multi sector transfer error was detected. Magic of the NTFS - * record in @b will have been set to "BAAD". - */ -int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size) -{ - u16 usa_ofs, usa_count, usn; - u16 *usa_pos, *data_pos; - - ntfs_log_trace("Entering\n"); - - /* Setup the variables. */ - usa_ofs = le16_to_cpu(b->usa_ofs); - /* Decrement usa_count to get number of fixups. */ - usa_count = le16_to_cpu(b->usa_count) - 1; - /* Size and alignment checks. */ - if (size & (NTFS_BLOCK_SIZE - 1) || usa_ofs & 1 || - (u32)(usa_ofs + (usa_count * 2)) > size || - (size >> NTFS_BLOCK_SIZE_BITS) != usa_count) { - errno = EINVAL; - ntfs_log_perror("%s: magic: 0x%08x size: %d usa_ofs: %d " - "usa_count: %d", __FUNCTION__, *(le32 *)b, - size, usa_ofs, usa_count); - return -1; - } - /* Position of usn in update sequence array. */ - usa_pos = (u16*)b + usa_ofs/sizeof(u16); - /* - * The update sequence number which has to be equal to each of the - * u16 values before they are fixed up. Note no need to care for - * endianness since we are comparing and moving data for on disk - * structures which means the data is consistent. - If it is - * consistency the wrong endianness it doesn't make any difference. - */ - usn = *usa_pos; - /* - * Position in protected data of first u16 that needs fixing up. - */ - data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1; - /* - * Check for incomplete multi sector transfer(s). - */ - while (usa_count--) { - if (*data_pos != usn) { - /* - * Incomplete multi sector transfer detected! )-: - * Set the magic to "BAAD" and return failure. - * Note that magic_BAAD is already converted to le32. - */ - errno = EIO; - ntfs_log_perror("Incomplete multi-sector transfer: " - "magic: 0x%08x size: %d usa_ofs: %d usa_count:" - " %d data: %d usn: %d", *(le32 *)b, size, - usa_ofs, usa_count, *data_pos, usn); - b->magic = magic_BAAD; - return -1; - } - data_pos += NTFS_BLOCK_SIZE/sizeof(u16); - } - /* Re-setup the variables. */ - usa_count = le16_to_cpu(b->usa_count) - 1; - data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1; - /* Fixup all sectors. */ - while (usa_count--) { - /* - * Increment position in usa and restore original data from - * the usa into the data buffer. - */ - *data_pos = *(++usa_pos); - /* Increment position in data as well. */ - data_pos += NTFS_BLOCK_SIZE/sizeof(u16); - } - return 0; -} - -/** - * ntfs_mst_pre_write_fixup - apply multi sector transfer protection - * @b: pointer to the data to protect - * @size: size in bytes of @b - * - * Perform the necessary pre write multi sector transfer fixup on the data - * pointer to by @b of @size. - * - * Return 0 if fixups applied successfully or -1 if no fixups were performed - * due to errors. In that case errno i set to the error code (EINVAL). - * - * NOTE: We consider the absence / invalidity of an update sequence array to - * mean error. This means that you have to create a valid update sequence - * array header in the ntfs record before calling this function, otherwise it - * will fail (the header needs to contain the position of the update sequence - * array together with the number of elements in the array). You also need to - * initialise the update sequence number before calling this function - * otherwise a random word will be used (whatever was in the record at that - * position at that time). - */ -int ntfs_mst_pre_write_fixup(NTFS_RECORD *b, const u32 size) -{ - u16 usa_ofs, usa_count, usn; - u16 *usa_pos, *data_pos; - - ntfs_log_trace("Entering\n"); - - /* Sanity check + only fixup if it makes sense. */ - if (!b || ntfs_is_baad_record(b->magic) || - ntfs_is_hole_record(b->magic)) { - errno = EINVAL; - ntfs_log_perror("%s: bad argument", __FUNCTION__); - return -1; - } - /* Setup the variables. */ - usa_ofs = le16_to_cpu(b->usa_ofs); - /* Decrement usa_count to get number of fixups. */ - usa_count = le16_to_cpu(b->usa_count) - 1; - /* Size and alignment checks. */ - if (size & (NTFS_BLOCK_SIZE - 1) || usa_ofs & 1 || - (u32)(usa_ofs + (usa_count * 2)) > size || - (size >> NTFS_BLOCK_SIZE_BITS) != usa_count) { - errno = EINVAL; - ntfs_log_perror("%s", __FUNCTION__); - return -1; - } - /* Position of usn in update sequence array. */ - usa_pos = (u16*)((u8*)b + usa_ofs); - /* - * Cyclically increment the update sequence number - * (skipping 0 and -1, i.e. 0xffff). - */ - usn = le16_to_cpup(usa_pos) + 1; - if (usn == 0xffff || !usn) - usn = 1; - usn = cpu_to_le16(usn); - *usa_pos = usn; - /* Position in data of first u16 that needs fixing up. */ - data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1; - /* Fixup all sectors. */ - while (usa_count--) { - /* - * Increment the position in the usa and save the - * original data from the data buffer into the usa. - */ - *(++usa_pos) = *data_pos; - /* Apply fixup to data. */ - *data_pos = usn; - /* Increment position in data as well. */ - data_pos += NTFS_BLOCK_SIZE/sizeof(u16); - } - return 0; -} - -/** - * ntfs_mst_post_write_fixup - deprotect multi sector transfer protected data - * @b: pointer to the data to deprotect - * - * Perform the necessary post write multi sector transfer fixup, not checking - * for any errors, because we assume we have just used - * ntfs_mst_pre_write_fixup(), thus the data will be fine or we would never - * have gotten here. - */ -void ntfs_mst_post_write_fixup(NTFS_RECORD *b) -{ - u16 *usa_pos, *data_pos; - - u16 usa_ofs = le16_to_cpu(b->usa_ofs); - u16 usa_count = le16_to_cpu(b->usa_count) - 1; - - ntfs_log_trace("Entering\n"); - - /* Position of usn in update sequence array. */ - usa_pos = (u16*)b + usa_ofs/sizeof(u16); - - /* Position in protected data of first u16 that needs fixing up. */ - data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1; - - /* Fixup all sectors. */ - while (usa_count--) { - /* - * Increment position in usa and restore original data from - * the usa into the data buffer. - */ - *data_pos = *(++usa_pos); - - /* Increment position in data as well. */ - data_pos += NTFS_BLOCK_SIZE/sizeof(u16); - } -} - diff --git a/source/libs/libntfs/mst.h b/source/libs/libntfs/mst.h deleted file mode 100644 index ca813821..00000000 --- a/source/libs/libntfs/mst.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * mst.h - Exports for multi sector transfer fixup functions. - * Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2002 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_MST_H -#define _NTFS_MST_H - -#include "types.h" -#include "layout.h" - -extern int ntfs_mst_post_read_fixup(NTFS_RECORD *b, const u32 size); -extern int ntfs_mst_pre_write_fixup(NTFS_RECORD *b, const u32 size); -extern void ntfs_mst_post_write_fixup(NTFS_RECORD *b); - -#endif /* defined _NTFS_MST_H */ - diff --git a/source/libs/libntfs/ntfs.c b/source/libs/libntfs/ntfs.c deleted file mode 100644 index 10a35193..00000000 --- a/source/libs/libntfs/ntfs.c +++ /dev/null @@ -1,726 +0,0 @@ -/** - * ntfs.c - Simple functionality for startup, mounting and unmounting of NTFS-based devices. - * - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - -#include "ntfs.h" -#include "ntfsinternal.h" -#include "ntfsfile.h" -#include "ntfsdir.h" -#include "gekko_io.h" -#include "cache.h" - -// NTFS device driver devoptab -static const devoptab_t devops_ntfs = { - NULL, /* Device name */ - sizeof (ntfs_file_state), - ntfs_open_r, - ntfs_close_r, - ntfs_write_r, - ntfs_read_r, - ntfs_seek_r, - ntfs_fstat_r, - ntfs_stat_r, - ntfs_link_r, - ntfs_unlink_r, - ntfs_chdir_r, - ntfs_rename_r, - ntfs_mkdir_r, - sizeof (ntfs_dir_state), - ntfs_diropen_r, - ntfs_dirreset_r, - ntfs_dirnext_r, - ntfs_dirclose_r, - ntfs_statvfs_r, - ntfs_ftruncate_r, - ntfs_fsync_r, - NULL /* Device data */ -}; - -void ntfsInit (void) -{ - static bool isInit = false; - - // Initialise ntfs-3g (if not already done so) - if (!isInit) { - isInit = true; - - // Set the log handler - #ifdef NTFS_ENABLE_LOG - ntfs_log_set_handler(ntfs_log_handler_stderr); - #else - ntfs_log_set_handler(ntfs_log_handler_null); - #endif - // Set our current local - ntfs_set_locale(); - - } - - return; -} - -int ntfsFindPartitions (const DISC_INTERFACE *interface, sec_t **partitions) -{ - MASTER_BOOT_RECORD mbr; - PARTITION_RECORD *partition = NULL; - sec_t partition_starts[NTFS_MAX_PARTITIONS] = {0}; - int partition_count = 0; - sec_t part_lba = 0; - int i; - - union { - u8 buffer[512]; - MASTER_BOOT_RECORD mbr; - EXTENDED_BOOT_RECORD ebr; - NTFS_BOOT_SECTOR boot; - } sector; - - // Sanity check - if (!interface) { - errno = EINVAL; - return -1; - } - if (!partitions) - return 0; - - // Initialise ntfs-3g - ntfsInit(); - - // Start the device and check that it is inserted - if (!interface->startup()) { - errno = EIO; - return -1; - } - if (!interface->isInserted()) { - return 0; - } - - // Read the first sector on the device - if (!interface->readSectors(0, 1, §or.buffer)) { - errno = EIO; - return -1; - } - - // If this is the devices master boot record - if (sector.mbr.signature == MBR_SIGNATURE) { - memcpy(&mbr, §or, sizeof(MASTER_BOOT_RECORD)); - ntfs_log_debug("Valid Master Boot Record found\n"); - - // Search the partition table for all NTFS partitions (max. 4 primary partitions) - for (i = 0; i < 4; i++) { - partition = &mbr.partitions[i]; - part_lba = le32_to_cpu(mbr.partitions[i].lba_start); - - ntfs_log_debug("Partition %i: %s, sector %d, type 0x%x\n", i + 1, - partition->status == PARTITION_STATUS_BOOTABLE ? "bootable (active)" : "non-bootable", - part_lba, partition->type); - - // Figure out what type of partition this is - switch (partition->type) { - - // Ignore empty partitions - case PARTITION_TYPE_EMPTY: - continue; - - // NTFS partition - case PARTITION_TYPE_NTFS: { - ntfs_log_debug("Partition %i: Claims to be NTFS\n", i + 1); - - // Read and validate the NTFS partition - if (interface->readSectors(part_lba, 1, §or)) { - if (sector.boot.oem_id == NTFS_OEM_ID) { - ntfs_log_debug("Partition %i: Valid NTFS boot sector found\n", i + 1); - if (partition_count < NTFS_MAX_PARTITIONS) { - partition_starts[partition_count] = part_lba; - partition_count++; - } - } else { - ntfs_log_debug("Partition %i: Invalid NTFS boot sector, not actually NTFS\n", i + 1); - } - } - - break; - - } - - // DOS 3.3+ or Windows 95 extended partition - case PARTITION_TYPE_DOS33_EXTENDED: - case PARTITION_TYPE_WIN95_EXTENDED: { - ntfs_log_debug("Partition %i: Claims to be Extended\n", i + 1); - - // Walk the extended partition chain, finding all NTFS partitions within it - sec_t ebr_lba = part_lba; - sec_t next_erb_lba = 0; - do { - - // Read and validate the extended boot record - if (interface->readSectors(ebr_lba + next_erb_lba, 1, §or)) { - if (sector.ebr.signature == EBR_SIGNATURE) { - ntfs_log_debug("Logical Partition @ %d: type 0x%x\n", ebr_lba + next_erb_lba, - sector.ebr.partition.status == PARTITION_STATUS_BOOTABLE ? "bootable (active)" : "non-bootable", - sector.ebr.partition.type); - - // Get the start sector of the current partition - // and the next extended boot record in the chain - part_lba = ebr_lba + next_erb_lba + le32_to_cpu(sector.ebr.partition.lba_start); - next_erb_lba = le32_to_cpu(sector.ebr.next_ebr.lba_start); - - // Check if this partition has a valid NTFS boot record - if (interface->readSectors(part_lba, 1, §or)) { - if (sector.boot.oem_id == NTFS_OEM_ID) { - ntfs_log_debug("Logical Partition @ %d: Valid NTFS boot sector found\n", part_lba); - if(sector.ebr.partition.type != PARTITION_TYPE_NTFS) { - ntfs_log_warning("Logical Partition @ %d: Is NTFS but type is 0x%x; 0x%x was expected\n", part_lba, sector.ebr.partition.type, PARTITION_TYPE_NTFS); - } - if (partition_count < NTFS_MAX_PARTITIONS) { - partition_starts[partition_count] = part_lba; - partition_count++; - } - } - } - - } else { - next_erb_lba = 0; - } - } - - } while (next_erb_lba); - - break; - - } - - // Unknown or unsupported partition type - default: { - - // Check if this partition has a valid NTFS boot record anyway, - // it might be misrepresented due to a lazy partition editor - if (interface->readSectors(part_lba, 1, §or)) { - if (sector.boot.oem_id == NTFS_OEM_ID) { - ntfs_log_debug("Partition %i: Valid NTFS boot sector found\n", i + 1); - if(partition->type != PARTITION_TYPE_NTFS) { - ntfs_log_warning("Partition %i: Is NTFS but type is 0x%x; 0x%x was expected\n", i + 1, partition->type, PARTITION_TYPE_NTFS); - } - if (partition_count < NTFS_MAX_PARTITIONS) { - partition_starts[partition_count] = part_lba; - partition_count++; - } - } - } - - break; - - } - - } - - } - - // Else it is assumed this device has no master boot record - } else { - ntfs_log_debug("No Master Boot Record was found!\n"); - - // As a last-ditched effort, search the first 64 sectors of the device for stray NTFS partitions - for (i = 0; i < 64; i++) { - if (interface->readSectors(i, 1, §or)) { - if (sector.boot.oem_id == NTFS_OEM_ID) { - ntfs_log_debug("Valid NTFS boot sector found at sector %d!\n", i); - if (partition_count < NTFS_MAX_PARTITIONS) { - partition_starts[partition_count] = i; - partition_count++; - } - } - } - } - - } - - // Shutdown the device - /*interface->shutdown();*/ - - // Return the found partitions (if any) - if (partition_count > 0) { - *partitions = (sec_t*)ntfs_alloc(sizeof(sec_t) * partition_count); - if (*partitions) { - memcpy(*partitions, &partition_starts, sizeof(sec_t) * partition_count); - return partition_count; - } - } - - return 0; -} - -int ntfsMountAll (ntfs_md **mounts, u32 flags) -{ - const INTERFACE_ID *discs = ntfsGetDiscInterfaces(); - const INTERFACE_ID *disc = NULL; - ntfs_md mount_points[NTFS_MAX_MOUNTS]; - sec_t *partitions = NULL; - int mount_count = 0; - int partition_count = 0; - char name[128]; - int i, j, k; - - // Initialise ntfs-3g - ntfsInit(); - - // Find and mount all NTFS partitions on all known devices - for (i = 0; discs[i].name != NULL && discs[i].interface != NULL; i++) { - disc = &discs[i]; - partition_count = ntfsFindPartitions(disc->interface, &partitions); - if (partition_count > 0 && partitions) { - for (j = 0, k = 0; j < partition_count; j++) { - - // Find the next unused mount name - do { - sprintf(name, "%s%i", NTFS_MOUNT_PREFIX, k++); - if (k >= NTFS_MAX_MOUNTS) { - ntfs_free(partitions); - errno = EADDRNOTAVAIL; - return -1; - } - } while (ntfsGetDevice(name, false)); - - // Mount the partition - if (mount_count < NTFS_MAX_MOUNTS) { - if (ntfsMount(name, disc->interface, partitions[j], CACHE_DEFAULT_PAGE_SIZE, CACHE_DEFAULT_PAGE_COUNT, flags)) { - strcpy(mount_points[mount_count].name, name); - mount_points[mount_count].interface = disc->interface; - mount_points[mount_count].startSector = partitions[j]; - mount_count++; - } - } - - } - ntfs_free(partitions); - } - } - - // Return the mounts (if any) - if (mount_count > 0 && mounts) { - *mounts = (ntfs_md*)ntfs_alloc(sizeof(ntfs_md) * mount_count); - if (*mounts) { - memcpy(*mounts, &mount_points, sizeof(ntfs_md) * mount_count); - return mount_count; - } - } - - return 0; -} - -int ntfsMountDevice (const DISC_INTERFACE *interface, ntfs_md **mounts, u32 flags) -{ - const INTERFACE_ID *discs = ntfsGetDiscInterfaces(); - const INTERFACE_ID *disc = NULL; - ntfs_md mount_points[NTFS_MAX_MOUNTS]; - sec_t *partitions = NULL; - int mount_count = 0; - int partition_count = 0; - char name[128]; - int i, j, k; - - // Sanity check - if (!interface) { - errno = EINVAL; - return -1; - } - - // Initialise ntfs-3g - ntfsInit(); - - // Find the specified device then find and mount all NTFS partitions on it - for (i = 0; discs[i].name != NULL && discs[i].interface != NULL; i++) { - if (discs[i].interface == interface) { - disc = &discs[i]; - partition_count = ntfsFindPartitions(disc->interface, &partitions); - if (partition_count > 0 && partitions) { - for (j = 0, k = 0; j < partition_count; j++) { - - // Find the next unused mount name - do { - sprintf(name, "%s%i", NTFS_MOUNT_PREFIX, k++); - if (k >= NTFS_MAX_MOUNTS) { - ntfs_free(partitions); - errno = EADDRNOTAVAIL; - return -1; - } - } while (ntfsGetDevice(name, false)); - - // Mount the partition - if (mount_count < NTFS_MAX_MOUNTS) { - if (ntfsMount(name, disc->interface, partitions[j], CACHE_DEFAULT_PAGE_SIZE, CACHE_DEFAULT_PAGE_COUNT, flags)) { - strcpy(mount_points[mount_count].name, name); - mount_points[mount_count].interface = disc->interface; - mount_points[mount_count].startSector = partitions[j]; - mount_count++; - } - } - - } - ntfs_free(partitions); - } - break; - } - } - - // If we couldn't find the device then return with error status - if (!disc) { - errno = ENODEV; - return -1; - } - - // Return the mounts (if any) - if (mount_count > 0 && mounts) { - *mounts = (ntfs_md*)ntfs_alloc(sizeof(ntfs_md) * mount_count); - if (*mounts) { - memcpy(*mounts, &mount_points, sizeof(ntfs_md) * mount_count); - return mount_count; - } - } - - return 0; -} - -bool ntfsMount (const char *name, const DISC_INTERFACE *interface, sec_t startSector, u32 cachePageCount, u32 cachePageSize, u32 flags) -{ - ntfs_vd *vd = NULL; - gekko_fd *fd = NULL; - - // Sanity check - if (!name || !interface) { - errno = EINVAL; - return false; - } - - // Initialise ntfs-3g - ntfsInit(); - - // Check that the requested mount name is free - if (ntfsGetDevice(name, false)) { - errno = EADDRINUSE; - return false; - } - - // Check that we can at least read from this device - if (!(interface->features & FEATURE_MEDIUM_CANREAD)) { - errno = EPERM; - return false; - } - - // Allocate the volume descriptor - vd = (ntfs_vd*)ntfs_alloc(sizeof(ntfs_vd)); - if (!vd) { - errno = ENOMEM; - return false; - } - - // Setup the volume descriptor - vd->id = interface->ioType; - vd->flags = 0; - vd->uid = 0; - vd->gid = 0; - vd->fmask = 0; - vd->dmask = 0; - vd->atime = ((flags & NTFS_UPDATE_ACCESS_TIMES) ? ATIME_ENABLED : ATIME_DISABLED); - vd->showHiddenFiles = (flags & NTFS_SHOW_HIDDEN_FILES); - vd->showSystemFiles = (flags & NTFS_SHOW_SYSTEM_FILES); - - // Allocate the device driver descriptor - fd = (gekko_fd*)ntfs_alloc(sizeof(gekko_fd)); - if (!fd) { - ntfs_free(vd); - errno = ENOMEM; - return false; - } - - // Setup the device driver descriptor - fd->interface = interface; - fd->startSector = startSector; - fd->sectorSize = 0; - fd->sectorCount = 0; - fd->cachePageCount = cachePageCount; - fd->cachePageSize = cachePageSize; - - // Allocate the device driver - vd->dev = ntfs_device_alloc(name, 0, &ntfs_device_gekko_io_ops, fd); - if (!vd->dev) { - ntfs_free(fd); - ntfs_free(vd); - return false; - } - - // Build the mount flags - if (flags & NTFS_READ_ONLY) - vd->flags |= MS_RDONLY; - else - { - if (!(interface->features & FEATURE_MEDIUM_CANWRITE)) - vd->flags |= MS_RDONLY; - if ((interface->features & FEATURE_MEDIUM_CANREAD) && (interface->features & FEATURE_MEDIUM_CANWRITE)) - vd->flags |= MS_EXCLUSIVE; - } - if (flags & NTFS_RECOVER) - vd->flags |= MS_RECOVER; - if (flags & NTFS_IGNORE_HIBERFILE) - vd->flags |= MS_IGNORE_HIBERFILE; - - if (vd->flags & MS_RDONLY) - ntfs_log_debug("Mounting \"%s\" as read-only\n", name); - - // Mount the device - vd->vol = ntfs_device_mount(vd->dev, vd->flags); - if (!vd->vol) { - switch(ntfs_volume_error(errno)) { - case NTFS_VOLUME_NOT_NTFS: errno = EINVALPART; break; - case NTFS_VOLUME_CORRUPT: errno = EINVALPART; break; - case NTFS_VOLUME_HIBERNATED: errno = EHIBERNATED; break; - case NTFS_VOLUME_UNCLEAN_UNMOUNT: errno = EDIRTY; break; - default: errno = EINVAL; break; - } - ntfs_device_free(vd->dev); - ntfs_free(vd); - return false; - } - - if (flags & NTFS_IGNORE_CASE) - ntfs_set_ignore_case(vd->vol); - - // Initialise the volume descriptor - if (ntfsInitVolume(vd)) { - ntfs_umount(vd->vol, true); - ntfs_free(vd); - return false; - } - - // Add the device to the devoptab table - if (ntfsAddDevice(name, vd)) { - ntfsDeinitVolume(vd); - ntfs_umount(vd->vol, true); - ntfs_free(vd); - return false; - } - - return true; -} - -void ntfsUnmount (const char *name, bool force) -{ - ntfs_vd *vd = NULL; - - // Get the devices volume descriptor - vd = ntfsGetVolume(name); - if (!vd) - return; - - // Remove the device from the devoptab table - ntfsRemoveDevice(name); - - // Deinitialise the volume descriptor - ntfsDeinitVolume(vd); - - // Unmount the volume - ntfs_umount(vd->vol, force); - - // Free the volume descriptor - ntfs_free(vd); - - return; -} - -const char *ntfsGetVolumeName (const char *name) -{ - ntfs_vd *vd = NULL; - //ntfs_attr *na = NULL; - //ntfschar *ulabel = NULL; - //char *volumeName = NULL; - - // Sanity check - if (!name) { - errno = EINVAL; - return NULL; - } - - // Get the devices volume descriptor - vd = ntfsGetVolume(name); - if (!vd) { - errno = ENODEV; - return NULL; - } - return vd->vol->vol_name; -/* - - // If the volume name has already been cached then just use that - if (vd->name[0]) - return vd->name; - - // Lock - ntfsLock(vd); - - // Check if the volume name attribute exists - na = ntfs_attr_open(vd->vol->vol_ni, AT_VOLUME_NAME, NULL, 0); - if (!na) { - ntfsUnlock(vd); - errno = ENOENT; - return false; - } - - // Allocate a buffer to store the raw volume name - ulabel = ntfs_alloc(na->data_size * sizeof(ntfschar)); - if (!ulabel) { - ntfsUnlock(vd); - errno = ENOMEM; - return false; - } - - // Read the volume name - if (ntfs_attr_pread(na, 0, na->data_size, ulabel) != na->data_size) { - ntfs_free(ulabel); - ntfsUnlock(vd); - errno = EIO; - return false; - } - - // Convert the volume name to the current local - if (ntfsUnicodeToLocal(ulabel, na->data_size, &volumeName, 0) < 0) { - errno = EINVAL; - ntfs_free(ulabel); - ntfsUnlock(vd); - return false; - } - - // If the volume name was read then cache it (for future fetches) - if (volumeName) - strcpy(vd->name, volumeName); - - // Close the volume name attribute - if (na) - ntfs_attr_close(na); - - // Clean up - ntfs_free(volumeName); - ntfs_free(ulabel); - - // Unlock - ntfsUnlock(vd); - - return vd->name; -*/ -} - -bool ntfsSetVolumeName (const char *name, const char *volumeName) -{ - ntfs_vd *vd = NULL; - ntfs_attr *na = NULL; - ntfschar *ulabel = NULL; - int ulabel_len; - - // Sanity check - if (!name) { - errno = EINVAL; - return false; - } - - // Get the devices volume descriptor - vd = ntfsGetVolume(name); - if (!vd) { - errno = ENODEV; - return false; - } - - // Lock - ntfsLock(vd); - - // Convert the new volume name to unicode - ulabel_len = ntfsLocalToUnicode(volumeName, &ulabel) * sizeof(ntfschar); - if (ulabel_len < 0) { - ntfsUnlock(vd); - errno = EINVAL; - return false; - } - - // Check if the volume name attribute exists - na = ntfs_attr_open(vd->vol->vol_ni, AT_VOLUME_NAME, NULL, 0); - if (na) { - - // It does, resize it to match the length of the new volume name - if (ntfs_attr_truncate(na, ulabel_len)) { - ntfs_free(ulabel); - ntfsUnlock(vd); - return false; - } - - // Write the new volume name - if (ntfs_attr_pwrite(na, 0, ulabel_len, ulabel) != ulabel_len) { - ntfs_free(ulabel); - ntfsUnlock(vd); - return false; - } - - } else { - - // It doesn't, create it now - if (ntfs_attr_add(vd->vol->vol_ni, AT_VOLUME_NAME, NULL, 0, (u8*)ulabel, ulabel_len)) { - ntfs_free(ulabel); - ntfsUnlock(vd); - return false; - } - - } - - // Reset the volumes name cache (as it has now been changed) - vd->name[0] = '\0'; - - // Close the volume name attribute - if (na) - ntfs_attr_close(na); - - // Sync the volume node - if (ntfs_inode_sync(vd->vol->vol_ni)) { - ntfs_free(ulabel); - ntfsUnlock(vd); - return false; - } - - // Clean up - ntfs_free(ulabel); - - // Unlock - ntfsUnlock(vd); - - return true; -} - -const devoptab_t *ntfsGetDevOpTab (void) -{ - return &devops_ntfs; -} \ No newline at end of file diff --git a/source/libs/libntfs/ntfs.h b/source/libs/libntfs/ntfs.h deleted file mode 100644 index 5470331a..00000000 --- a/source/libs/libntfs/ntfs.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * ntfs.h - Simple functionality for startup, mounting and unmounting of NTFS-based devices. - * - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _LIBNTFS_H -#define _LIBNTFS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -/* NTFS errno values */ -#define ENOPART 3000 /* No partition was found */ -#define EINVALPART 3001 /* Specified partition is invalid or not supported */ -#define EDIRTY 3002 /* Volume is dirty and NTFS_RECOVER was not specified during mount */ -#define EHIBERNATED 3003 /* Volume is hibernated and NTFS_IGNORE_HIBERFILE was not specified during mount */ - -/* NTFS cache options */ -#define CACHE_DEFAULT_PAGE_COUNT 8 /* The default number of pages in the cache */ -#define CACHE_DEFAULT_PAGE_SIZE 128 /* The default number of sectors per cache page */ - -/* NTFS mount flags */ -#define NTFS_DEFAULT 0x00000000 /* Standard mount, expects a clean, non-hibernated volume */ -#define NTFS_SHOW_HIDDEN_FILES 0x00000001 /* Display hidden files when enumerating directories */ -#define NTFS_SHOW_SYSTEM_FILES 0x00000002 /* Display system files when enumerating directories */ -#define NTFS_UPDATE_ACCESS_TIMES 0x00000004 /* Update file and directory access times */ -#define NTFS_RECOVER 0x00000008 /* Reset $LogFile if dirty (i.e. from unclean disconnect) */ -#define NTFS_IGNORE_HIBERFILE 0x00000010 /* Mount even if volume is hibernated */ -#define NTFS_READ_ONLY 0x00000020 /* Mount in read only mode */ -#define NTFS_IGNORE_CASE 0x00000040 /* Ignore case sensitivity. Everything must be and will be provided in lowercase. */ -#define NTFS_SU NTFS_SHOW_HIDDEN_FILES | NTFS_SHOW_SYSTEM_FILES -#define NTFS_FORCE NTFS_RECOVER | NTFS_IGNORE_HIBERFILE - -/** - * ntfs_md - NTFS mount descriptor - */ -typedef struct _ntfs_md { - char name[32]; /* Mount name (can be accessed as "name:/") */ - const DISC_INTERFACE *interface; /* Block device containing the mounted partition */ - sec_t startSector; /* Local block address to first sector of partition */ -} ntfs_md; - -/** - * Find all NTFS partitions on a block device. - * - * @param INTERFACE The block device to search - * @param PARTITIONS (out) A pointer to receive the array of partition start sectors - * - * @return The number of entries in PARTITIONS or -1 if an error occurred (see errno) - * @note The caller is responsible for freeing PARTITIONS when finished with it - */ -extern int ntfsFindPartitions (const DISC_INTERFACE *interface, sec_t **partitions); - -/** - * Mount all NTFS partitions on all inserted block devices. - * - * @param MOUNTS (out) A pointer to receive the array of mount descriptors - * @param FLAGS Additional mounting flags. (see above) - * - * @return The number of entries in MOUNTS or -1 if an error occurred (see errno) - * @note The caller is responsible for freeing MOUNTS when finished with it - * @note All device caches are setup using default values (see above) - */ -extern int ntfsMountAll (ntfs_md **mounts, u32 flags); - -/** - * Mount all NTFS partitions on a block devices. - * - * @param INTERFACE The block device to mount. - * @param MOUNTS (out) A pointer to receive the array of mount descriptors - * @param FLAGS Additional mounting flags. (see above) - * - * @return The number of entries in MOUNTS or -1 if an error occurred (see errno) - * @note The caller is responsible for freeing MOUNTS when finished with it - * @note The device cache is setup using default values (see above) - */ -extern int ntfsMountDevice (const DISC_INTERFACE* interface, ntfs_md **mounts, u32 flags); - -/** - * Mount a NTFS partition from a specific sector on a block device. - * - * @param NAME The name to mount the device under (can then be accessed as "NAME:/") - * @param INTERFACE The block device to mount - * @param STARTSECTOR The sector the partition begins at (see @ntfsFindPartitions) - * @param CACHEPAGECOUNT The total number of pages in the device cache - * @param CACHEPAGESIZE The number of sectors per cache page - * @param FLAGS Additional mounting flags (see above) - * - * @return True if mount was successful, false if no partition was found or an error occurred (see errno) - * @note ntfsFindPartitions should be used first to locate the partitions start sector - */ -extern bool ntfsMount (const char *name, const DISC_INTERFACE *interface, sec_t startSector, u32 cachePageCount, u32 cachePageSize, u32 flags); - -/** - * Unmount a NTFS partition. - * - * @param NAME The name of mount used in ntfsMountSimple() and ntfsMount() - * @param FORCE If true unmount even if the device is busy (may lead to data lose) - */ -extern void ntfsUnmount (const char *name, bool force); - -/** - * Get the volume name of a mounted NTFS partition. - * - * @param NAME The name of mount (see @ntfsMountAll, @ntfsMountDevice, and @ntfsMount) - * - * @return The volumes name if successful or NULL if an error occurred (see errno) - */ -extern const char *ntfsGetVolumeName (const char *name); - -/** - * Set the volume name of a mounted NTFS partition. - * - * @param NAME The name of mount (see @ntfsMountAll, @ntfsMountDevice, and @ntfsMount) - * @param VOLUMENAME The new volume name - * - * @return True if mount was successful, false if an error occurred (see errno) - * @note The mount must be write-enabled else this will fail - */ -extern bool ntfsSetVolumeName (const char *name, const char *volumeName); - -typedef int (*_ntfs_frag_append_t)(void *ff, u32 offset, u32 sector, u32 count); -int _NTFS_get_fragments (const char *path, _ntfs_frag_append_t append_fragment, void *callback_data); - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBNTFS_H */ \ No newline at end of file diff --git a/source/libs/libntfs/ntfsdir.c b/source/libs/libntfs/ntfsdir.c deleted file mode 100644 index ad54b514..00000000 --- a/source/libs/libntfs/ntfsdir.c +++ /dev/null @@ -1,636 +0,0 @@ -/** - * ntfs_dir.c - devoptab directory routines for NTFS-based devices. - * - * Copyright (c) 2010 Dimok - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYS_STATVFS_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - -#include "ntfsinternal.h" -#include "ntfsdir.h" -#include "device.h" -#include - -#define STATE(x) ((ntfs_dir_state*)(x)->dirStruct) - -void ntfsCloseDir (ntfs_dir_state *dir) -{ - // Sanity check - if (!dir || !dir->vd) - return; - - // Free the directory entries (if any) - while (dir->first) { - ntfs_dir_entry *next = dir->first->next; - ntfs_free(dir->first->name); - ntfs_free(dir->first); - dir->first = next; - } - - // Close the directory (if open) - if (dir->ni) - ntfsCloseEntry(dir->vd, dir->ni); - - // Reset the directory state - dir->ni = NULL; - dir->first = NULL; - dir->current = NULL; - - return; -} - -int ntfs_stat_r (struct _reent *r, const char *path, struct stat *st) -{ - // Short circuit cases were we don't actually have to do anything - if (!st || !path) - return 0; - - ntfs_log_trace("path %s, st %p\n", path, st); - - ntfs_vd *vd = NULL; - ntfs_inode *ni = NULL; - - // Get the volume descriptor for this path - vd = ntfsGetVolume(path); - if (!vd) { - r->_errno = ENODEV; - return -1; - } - - if(strcmp(path, ".") == 0 || strcmp(path, "..") == 0) - { - memset(st, 0, sizeof(struct stat)); - st->st_mode = S_IFDIR; - return 0; - } - - // Lock - ntfsLock(vd); - - // Find the entry - ni = ntfsOpenEntry(vd, path); - if (!ni) { - r->_errno = errno; - ntfsUnlock(vd); - return -1; - } - - // Get the entry stats - int ret = ntfsStat(vd, ni, st); - if (ret) - r->_errno = errno; - - // Close the entry - ntfsCloseEntry(vd, ni); - - ntfsUnlock(vd); - - return 0; -} - -int ntfs_link_r (struct _reent *r, const char *existing, const char *newLink) -{ - ntfs_log_trace("existing %s, newLink %s\n", existing, newLink); - - ntfs_vd *vd = NULL; - ntfs_inode *ni = NULL; - - // Get the volume descriptor for this path - vd = ntfsGetVolume(existing); - if (!vd) { - r->_errno = ENODEV; - return -1; - } - - // Lock - ntfsLock(vd); - - // Create a symbolic link between the two paths - ni = ntfsCreate(vd, existing, S_IFLNK, newLink); - if (!ni) { - ntfsUnlock(vd); - r->_errno = errno; - return -1; - } - - // Close the symbolic link - ntfsCloseEntry(vd, ni); - - // Unlock - ntfsUnlock(vd); - - return 0; -} - -int ntfs_unlink_r (struct _reent *r, const char *name) -{ - ntfs_log_trace("name %s\n", name); - - // Unlink the entry - int ret = ntfsUnlink(ntfsGetVolume(name), name); - if (ret) - r->_errno = errno; - - return ret; -} - -int ntfs_chdir_r (struct _reent *r, const char *name) -{ - ntfs_log_trace("name %s\n", name); - - ntfs_vd *vd = NULL; - ntfs_inode *ni = NULL; - - // Get the volume descriptor for this path - vd = ntfsGetVolume(name); - if (!vd) { - r->_errno = ENODEV; - return -1; - } - - // Lock - ntfsLock(vd); - - // Find the directory - ni = ntfsOpenEntry(vd, name); - if (!ni) { - ntfsUnlock(vd); - r->_errno = ENOENT; - return -1; - } - - // Ensure that this directory is indeed a directory - if (!(ni->mrec->flags && MFT_RECORD_IS_DIRECTORY)) { - ntfsCloseEntry(vd, ni); - ntfsUnlock(vd); - r->_errno = ENOTDIR; - return -1; - } - - // Close the old current directory (if any) - if (vd->cwd_ni) - ntfsCloseEntry(vd, vd->cwd_ni); - - // Set the new current directory - vd->cwd_ni = ni; - - // Unlock - ntfsUnlock(vd); - - return 0; -} - -int ntfs_rename_r (struct _reent *r, const char *oldName, const char *newName) -{ - ntfs_log_trace("oldName %s, newName %s\n", oldName, newName); - - ntfs_vd *vd = NULL; - ntfs_inode *ni = NULL; - - // Get the volume descriptor for this path - vd = ntfsGetVolume(oldName); - if (!vd) { - r->_errno = ENODEV; - return -1; - } - - // Lock - ntfsLock(vd); - - // You cannot rename between devices - if(vd != ntfsGetVolume(newName)) { - ntfsUnlock(vd); - r->_errno = EXDEV; - return -1; - } - - // Check that there is no existing entry with the new name - ni = ntfsOpenEntry(vd, newName); - if (ni) { - ntfsCloseEntry(vd, ni); - ntfsUnlock(vd); - r->_errno = EEXIST; - return -1; - } - - // Link the old entry with the new one - if (ntfsLink(vd, oldName, newName)) { - ntfsUnlock(vd); - return -1; - } - - // Unlink the old entry - if (ntfsUnlink(vd, oldName)) { - if (ntfsUnlink(vd, newName)) { - ntfsUnlock(vd); - return -1; - } - ntfsUnlock(vd); - return -1; - } - - // Unlock - ntfsUnlock(vd); - - return 0; -} - -int ntfs_mkdir_r (struct _reent *r, const char *path, int mode) -{ - ntfs_log_trace("path %s, mode %i\n", path, mode); - - ntfs_vd *vd = NULL; - ntfs_inode *ni = NULL; - - // Get the volume descriptor for this path - vd = ntfsGetVolume(path); - if (!vd) { - r->_errno = ENODEV; - return -1; - } - - // Lock - ntfsLock(vd); - - // Create the directory - ni = ntfsCreate(vd, path, S_IFDIR, NULL); - if (!ni) { - ntfsUnlock(vd); - r->_errno = errno; - return -1; - } - - // Close the directory - ntfsCloseEntry(vd, ni); - - // Unlock - ntfsUnlock(vd); - - return 0; -} - -int ntfs_statvfs_r (struct _reent *r, const char *path, struct statvfs *buf) -{ - ntfs_log_trace("path %s, buf %p\n", path, buf); - - ntfs_vd *vd = NULL; - s64 size; - int delta_bits; - - // Get the volume descriptor for this path - vd = ntfsGetVolume(path); - if (!vd) { - r->_errno = ENODEV; - return -1; - } - - // Short circuit cases were we don't actually have to do anything - if (!buf) - return 0; - - // Lock - ntfsLock(vd); - - // Zero out the stat buffer - memset(buf, 0, sizeof(struct statvfs)); - - if(ntfs_volume_get_free_space(vd->vol) < 0) - { - ntfsUnlock(vd); - return -1; - } - - // File system block size - buf->f_bsize = vd->vol->cluster_size; - - // Fundamental file system block size - buf->f_frsize = vd->vol->cluster_size; - - // Total number of blocks on file system in units of f_frsize - buf->f_blocks = vd->vol->nr_clusters; - - // Free blocks available for all and for non-privileged processes - size = MAX(vd->vol->free_clusters, 0); - buf->f_bfree = buf->f_bavail = size; - - // Free inodes on the free space - delta_bits = vd->vol->cluster_size_bits - vd->vol->mft_record_size_bits; - if (delta_bits >= 0) - size <<= delta_bits; - else - size >>= -delta_bits; - - // Number of inodes at this point in time - buf->f_files = (vd->vol->mftbmp_na->allocated_size << 3) + size; - - // Free inodes available for all and for non-privileged processes - size += vd->vol->free_mft_records; - buf->f_ffree = buf->f_favail = MAX(size, 0); - - // File system id - buf->f_fsid = vd->id; - - // Bit mask of f_flag values. - buf->f_flag = (NVolReadOnly(vd->vol) ? ST_RDONLY : 0); - - // Maximum length of filenames - buf->f_namemax = NTFS_MAX_NAME_LEN; - - // Unlock - ntfsUnlock(vd); - - return 0; -} - -/** - * PRIVATE: Callback for directory walking - */ -int ntfs_readdir_filler (DIR_ITER *dirState, const ntfschar *name, const int name_len, const int name_type, - const s64 pos, const MFT_REF mref, const unsigned dt_type) -{ - ntfs_dir_state *dir = STATE(dirState); - ntfs_dir_entry *entry = NULL; - char *entry_name = NULL; - - // Sanity check - if (!dir || !dir->vd) { - errno = EINVAL; - return -1; - } - - // Ignore DOS file names - if (name_type == FILE_NAME_DOS) { - return 0; - } - - // Preliminary check that this entry can be enumerated (as described by the volume descriptor) - if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || dir->vd->showSystemFiles) { - - // Convert the entry name to our current local - if (ntfsUnicodeToLocal(name, name_len, &entry_name, 0) < 0) { - return -1; - } - - if(dir->first && dir->first->mref == FILE_root && - MREF(mref) == FILE_root && strcmp(entry_name, "..") == 0) - { - return 0; - } - - // If this is not the parent or self directory reference - if ((strcmp(entry_name, ".") != 0) && (strcmp(entry_name, "..") != 0)) { - - // Open the entry - ntfs_inode *ni = ntfs_pathname_to_inode(dir->vd->vol, dir->ni, entry_name); - if (!ni) - return -1; - - // Double check that this entry can be emuerated (as described by the volume descriptor) - if (((ni->flags & FILE_ATTR_HIDDEN) && !dir->vd->showHiddenFiles) || - ((ni->flags & FILE_ATTR_SYSTEM) && !dir->vd->showSystemFiles)) { - ntfs_inode_close(ni); - return 0; - } - - // Close the entry - ntfs_inode_close(ni); - - } - - // Allocate a new directory entry - entry = (ntfs_dir_entry *) ntfs_alloc(sizeof(ntfs_dir_entry)); - if (!entry) - return -1; - - // Setup the entry - entry->name = entry_name; - entry->next = NULL; - entry->mref = MREF(mref); - - // Link the entry to the directory - if (!dir->first) { - dir->first = entry; - } else { - ntfs_dir_entry *last = dir->first; - while (last->next) last = last->next; - last->next = entry; - } - - } - - return 0; -} - -DIR_ITER *ntfs_diropen_r (struct _reent *r, DIR_ITER *dirState, const char *path) -{ - ntfs_log_trace("dirState %p, path %s\n", dirState, path); - - ntfs_dir_state* dir = STATE(dirState); - s64 position = 0; - - // Get the volume descriptor for this path - dir->vd = ntfsGetVolume(path); - if (!dir->vd) { - r->_errno = ENODEV; - return NULL; - } - - // Lock - ntfsLock(dir->vd); - - // Find the directory - dir->ni = ntfsOpenEntry(dir->vd, path); - if (!dir->ni) { - ntfsUnlock(dir->vd); - r->_errno = ENOENT; - return NULL; - } - - // Ensure that this directory is indeed a directory - if (!(dir->ni->mrec->flags && MFT_RECORD_IS_DIRECTORY)) { - ntfsCloseEntry(dir->vd, dir->ni); - ntfsUnlock(dir->vd); - r->_errno = ENOTDIR; - return NULL; - } - - // Read the directory - dir->first = dir->current = NULL; - if (ntfs_readdir(dir->ni, &position, dirState, (ntfs_filldir_t)ntfs_readdir_filler)) { - ntfsCloseDir(dir); - ntfsUnlock(dir->vd); - r->_errno = errno; - return NULL; - } - - // Move to the first entry in the directory - dir->current = dir->first; - - // Update directory times - ntfsUpdateTimes(dir->vd, dir->ni, NTFS_UPDATE_ATIME); - - // Insert the directory into the double-linked FILO list of open directories - if (dir->vd->firstOpenDir) { - dir->nextOpenDir = dir->vd->firstOpenDir; - dir->vd->firstOpenDir->prevOpenDir = dir; - } else { - dir->nextOpenDir = NULL; - } - dir->prevOpenDir = NULL; - dir->vd->cwd_ni = dir->ni; - dir->vd->firstOpenDir = dir; - dir->vd->openDirCount++; - - // Unlock - ntfsUnlock(dir->vd); - - return dirState; -} - -int ntfs_dirreset_r (struct _reent *r, DIR_ITER *dirState) -{ - ntfs_log_trace("dirState %p\n", dirState); - - ntfs_dir_state* dir = STATE(dirState); - - // Sanity check - if (!dir || !dir->vd || !dir->ni) { - r->_errno = EBADF; - return -1; - } - - // Lock - ntfsLock(dir->vd); - - // Move to the first entry in the directory - dir->current = dir->first; - - // Update directory times - ntfsUpdateTimes(dir->vd, dir->ni, NTFS_UPDATE_ATIME); - - // Unlock - ntfsUnlock(dir->vd); - - return 0; -} - -int ntfs_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *filestat) -{ - ntfs_log_trace("dirState %p, filename %p, filestat %p\n", dirState, filename, filestat); - - ntfs_dir_state* dir = STATE(dirState); - ntfs_inode *ni = NULL; - - // Sanity check - if (!dir || !dir->vd || !dir->ni) { - r->_errno = EBADF; - return -1; - } - - // Lock - ntfsLock(dir->vd); - - // Check that there is a entry waiting to be fetched - if (!dir->current) { - ntfsUnlock(dir->vd); - r->_errno = ENOENT; - return -1; - } - - // Fetch the current entry - strcpy(filename, dir->current->name); - if(filestat != NULL) - { - if(strcmp(dir->current->name, ".") == 0 || strcmp(dir->current->name, "..") == 0) - { - memset(filestat, 0, sizeof(struct stat)); - filestat->st_mode = S_IFDIR; - } - else - { - ni = ntfsOpenEntry(dir->vd, dir->current->name); - if (ni) { - ntfsStat(dir->vd, ni, filestat); - ntfsCloseEntry(dir->vd, ni); - } - } - } - - // Move to the next entry in the directory - dir->current = dir->current->next; - - // Update directory times - ntfsUpdateTimes(dir->vd, dir->ni, NTFS_UPDATE_ATIME); - - // Unlock - ntfsUnlock(dir->vd); - - return 0; -} - -int ntfs_dirclose_r (struct _reent *r, DIR_ITER *dirState) -{ - ntfs_log_trace("dirState %p\n", dirState); - - ntfs_dir_state* dir = STATE(dirState); - - // Sanity check - if (!dir || !dir->vd) { - r->_errno = EBADF; - return -1; - } - - // Lock - ntfsLock(dir->vd); - - // Close the directory - ntfsCloseDir(dir); - - // Remove the directory from the double-linked FILO list of open directories - dir->vd->openDirCount--; - if (dir->nextOpenDir) - dir->nextOpenDir->prevOpenDir = dir->prevOpenDir; - if (dir->prevOpenDir) - dir->prevOpenDir->nextOpenDir = dir->nextOpenDir; - else - dir->vd->firstOpenDir = dir->nextOpenDir; - - // Unlock - ntfsUnlock(dir->vd); - - return 0; -} diff --git a/source/libs/libntfs/ntfsdir.h b/source/libs/libntfs/ntfsdir.h deleted file mode 100644 index 0550592f..00000000 --- a/source/libs/libntfs/ntfsdir.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * ntfs_dir.c - devoptab directory routines for NTFS-based devices. - * - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFSDIR_H -#define _NTFSDIR_H - -#include "ntfsinternal.h" -#include - -/** - * ntfs_dir_entry - Directory entry - */ -typedef struct _ntfs_dir_entry { - char *name; - u64 mref; - struct _ntfs_dir_entry *next; -} ntfs_dir_entry; - -/** - * ntfs_dir_state - Directory state - */ -typedef struct _ntfs_dir_state { - ntfs_vd *vd; /* Volume this directory belongs to */ - ntfs_inode *ni; /* Directory descriptor */ - ntfs_dir_entry *first; /* The first entry in the directory */ - ntfs_dir_entry *current; /* The current entry in the directory */ - struct _ntfs_dir_state *prevOpenDir; /* The previous entry in a double-linked FILO list of open directories */ - struct _ntfs_dir_state *nextOpenDir; /* The next entry in a double-linked FILO list of open directories */ -} ntfs_dir_state; - -/* Directory state routines */ -void ntfsCloseDir (ntfs_dir_state *file); - -/* Gekko devoptab directory routines for NTFS-based devices */ -extern int ntfs_stat_r (struct _reent *r, const char *path, struct stat *st); -extern int ntfs_link_r (struct _reent *r, const char *existing, const char *newLink); -extern int ntfs_unlink_r (struct _reent *r, const char *name); -extern int ntfs_chdir_r (struct _reent *r, const char *name); -extern int ntfs_rename_r (struct _reent *r, const char *oldName, const char *newName); -extern int ntfs_mkdir_r (struct _reent *r, const char *path, int mode); -extern int ntfs_statvfs_r (struct _reent *r, const char *path, struct statvfs *buf); - -/* Gekko devoptab directory walking routines for NTFS-based devices */ -extern DIR_ITER *ntfs_diropen_r (struct _reent *r, DIR_ITER *dirState, const char *path); -extern int ntfs_dirreset_r (struct _reent *r, DIR_ITER *dirState); -extern int ntfs_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *filestat); -extern int ntfs_dirclose_r (struct _reent *r, DIR_ITER *dirState); - -#endif /* _NTFSDIR_H */ - diff --git a/source/libs/libntfs/ntfsfile.c b/source/libs/libntfs/ntfsfile.c deleted file mode 100644 index 2b917aec..00000000 --- a/source/libs/libntfs/ntfsfile.c +++ /dev/null @@ -1,526 +0,0 @@ -/** - * ntfsfile.c - devoptab file routines for NTFS-based devices. - * - * Copyright (c) 2010 Dimok - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - -#include "ntfsinternal.h" -#include "ntfsfile.h" - -#define STATE(x) ((ntfs_file_state*)x) - -void ntfsCloseFile (ntfs_file_state *file) -{ - // Sanity check - if (!file || !file->vd) - return; - - // Special case fix ups for compressed and/or encrypted files - if (file->compressed) - ntfs_attr_pclose(file->data_na); -#ifdef HAVE_SETXATTR - if (file->encrypted) - ntfs_efs_fixup_attribute(NULL, file->data_na); -#endif - // Close the file data attribute (if open) - if (file->data_na) - ntfs_attr_close(file->data_na); - - // Sync the file (and its attributes) to disc - if(file->write) - { - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_ATIME | NTFS_UPDATE_CTIME); - ntfsSync(file->vd, file->ni); - } - - if (file->read) - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_ATIME); - - // Close the file (if open) - if (file->ni) - ntfsCloseEntry(file->vd, file->ni); - - // Reset the file state - file->ni = NULL; - file->data_na = NULL; - file->flags = 0; - file->read = false; - file->write = false; - file->append = false; - file->pos = 0; - file->len = 0; - - return; -} - -int ntfs_open_r (struct _reent *r, void *fileStruct, const char *path, int flags, int mode) -{ - ntfs_log_trace("fileStruct %p, path %s, flags %i, mode %i\n", fileStruct, path, flags, mode); - - ntfs_file_state* file = STATE(fileStruct); - - // Get the volume descriptor for this path - file->vd = ntfsGetVolume(path); - if (!file->vd) { - r->_errno = ENODEV; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Determine which mode the file is opened for - file->flags = flags; - if ((flags & 0x03) == O_RDONLY) { - file->read = true; - file->write = false; - file->append = false; - } else if ((flags & 0x03) == O_WRONLY) { - file->read = false; - file->write = true; - file->append = (flags & O_APPEND); - } else if ((flags & 0x03) == O_RDWR) { - file->read = true; - file->write = true; - file->append = (flags & O_APPEND); - } else { - r->_errno = EACCES; - ntfsUnlock(file->vd); - return -1; - } - - // Try and find the file and (if found) ensure that it is not a directory - file->ni = ntfsOpenEntry(file->vd, path); - if (file->ni && (file->ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)) { - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = EISDIR; - return -1; - } - - // Are we creating this file? - if ((flags & O_CREAT) && !file->ni) { - - // Create the file - file->ni = ntfsCreate(file->vd, path, S_IFREG, NULL); - if (!file->ni) { - ntfsUnlock(file->vd); - return -1; - } - - } - - // Sanity check, the file should be open by now - if (!file->ni) { - ntfsUnlock(file->vd); - r->_errno = ENOENT; - return -1; - } - - // Open the files data attribute - file->data_na = ntfs_attr_open(file->ni, AT_DATA, AT_UNNAMED, 0); - if(!file->data_na) { - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - return -1; - } - - // Determine if this files data is compressed and/or encrypted - file->compressed = NAttrCompressed(file->data_na) || (file->ni->flags & FILE_ATTR_COMPRESSED); - file->encrypted = NAttrEncrypted(file->data_na) || (file->ni->flags & FILE_ATTR_ENCRYPTED); - - // We cannot read/write encrypted files - if (file->encrypted) { - ntfs_attr_close(file->data_na); - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = EACCES; - return -1; - } - - // Make sure we aren't trying to write to a read-only file - if ((file->ni->flags & FILE_ATTR_READONLY) && file->write) { - ntfs_attr_close(file->data_na); - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = EROFS; - return -1; - } - - // Truncate the file if requested - if ((flags & O_TRUNC) && file->write) { - if (ntfs_attr_truncate(file->data_na, 0)) { - ntfs_attr_close(file->data_na); - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - } - - // Set the files current position and length - file->pos = 0; - file->len = file->data_na->data_size; - - ntfs_log_trace("file->len %d\n", file->len); - - // Update file times - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_ATIME); - - // Insert the file into the double-linked FILO list of open files - if (file->vd->firstOpenFile) { - file->nextOpenFile = file->vd->firstOpenFile; - file->vd->firstOpenFile->prevOpenFile = file; - } else { - file->nextOpenFile = NULL; - } - file->prevOpenFile = NULL; - file->vd->firstOpenFile = file; - file->vd->openFileCount++; - - // Unlock - ntfsUnlock(file->vd); - - return (int)fileStruct; -} - -int ntfs_close_r (struct _reent *r, int fd) -{ - ntfs_log_trace("fd %p\n", fd); - - ntfs_file_state* file = STATE(fd); - - // Sanity check - if (!file || !file->vd) { - r->_errno = EBADF; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Close the file - ntfsCloseFile(file); - - // Remove the file from the double-linked FILO list of open files - file->vd->openFileCount--; - if (file->nextOpenFile) - file->nextOpenFile->prevOpenFile = file->prevOpenFile; - if (file->prevOpenFile) - file->prevOpenFile->nextOpenFile = file->nextOpenFile; - else - file->vd->firstOpenFile = file->nextOpenFile; - - // Unlock - ntfsUnlock(file->vd); - - return 0; -} - -ssize_t ntfs_write_r (struct _reent *r, int fd, const char *ptr, size_t len) -{ - ntfs_log_trace("fd %p, ptr %p, len %Li\n", fd, ptr, len); - - ntfs_file_state* file = STATE(fd); - ssize_t written = 0; - off_t old_pos = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Short circuit cases where we don't actually have to do anything - if (!ptr || len <= 0) { - return 0; - } - - // Lock - ntfsLock(file->vd); - - // Check that we are allowed to write to this file - if (!file->write) { - ntfsUnlock(file->vd); - r->_errno = EACCES; - return -1; - } - - // If we are in append mode, backup the current position and move to the end of the file - if (file->append) { - old_pos = file->pos; - file->pos = file->len; - } - - // Write to the files data atrribute - while (len) { - ssize_t ret = ntfs_attr_pwrite(file->data_na, file->pos, len, ptr); - if (ret <= 0) { - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - len -= ret; - file->pos += ret; - written += ret; - } - - // If we are in append mode, restore the current position to were it was prior to this write - if (file->append) { - file->pos = old_pos; - } - - // Mark the file for archiving (if we actually wrote something) - if (written) - file->ni->flags |= FILE_ATTR_ARCHIVE; - - // Update the files data length - file->len = file->data_na->data_size; - - // Unlock - ntfsUnlock(file->vd); - - return written; -} - -ssize_t ntfs_read_r (struct _reent *r, int fd, char *ptr, size_t len) -{ - ntfs_log_trace("fd %p, ptr %p, len %Li\n", fd, ptr, len); - - ntfs_file_state* file = STATE(fd); - ssize_t read = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Short circuit cases where we don't actually have to do anything - if (!ptr || len <= 0) { - return 0; - } - - // Lock - ntfsLock(file->vd); - - // Check that we are allowed to read from this file - if (!file->read) { - ntfsUnlock(file->vd); - r->_errno = EACCES; - return -1; - } - - // Don't read past the end of file - if (file->pos + len > file->len) { - r->_errno = EOVERFLOW; - len = file->len - file->pos; - ntfs_log_trace("EOVERFLOW"); - } - - ntfs_log_trace("file->pos:%d, len:%d, file->len:%d \n", (u32)file->pos, (u32)len, (u32)file->len); - - // Read from the files data attribute - while (len) { - ssize_t ret = ntfs_attr_pread(file->data_na, file->pos, len, ptr); - if (ret <= 0 || ret > len) { - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - ptr += ret; - len -= ret; - file->pos += ret; - read += ret; - } - //ntfs_log_trace("file->pos: %d \n", (u32)file->pos); - // Update file times (if we actually read something) - - // Unlock - ntfsUnlock(file->vd); - - return read; -} - -off_t ntfs_seek_r (struct _reent *r, int fd, off_t pos, int dir) -{ - ntfs_log_trace("fd %p, pos %Li, dir %i\n", fd, pos, dir); - - ntfs_file_state* file = STATE(fd); - off_t position = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Set the files current position - switch(dir) { - case SEEK_SET: position = file->pos = MIN(MAX(pos, 0), file->len); break; - case SEEK_CUR: position = file->pos = MIN(MAX(file->pos + pos, 0), file->len); break; - case SEEK_END: position = file->pos = MIN(MAX(file->len + pos, 0), file->len); break; - } - - // Unlock - ntfsUnlock(file->vd); - - return position; -} -int ntfs_fstat_r (struct _reent *r, int fd, struct stat *st) -{ - ntfs_log_trace("fd %p\n", fd); - - ntfs_file_state* file = STATE(fd); - int ret = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Short circuit cases were we don't actually have to do anything - if (!st) - return 0; - - // Get the file stats - ret = ntfsStat(file->vd, file->ni, st); - if (ret) - r->_errno = errno; - - return ret; -} - -int ntfs_ftruncate_r (struct _reent *r, int fd, off_t len) -{ - ntfs_log_trace("fd %p, len %Li\n", fd, len); - - ntfs_file_state* file = STATE(fd); - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Check that we are allowed to write to this file - if (!file->write) { - ntfsUnlock(file->vd); - r->_errno = EACCES; - return -1; - } - - // For compressed files, only deleting and expanding contents are implemented - if (file->compressed && - len > 0 && - len < file->data_na->initialized_size) { - ntfsUnlock(file->vd); - r->_errno = EOPNOTSUPP; - return -1; - } - - // Resize the files data attribute, either by expanding or truncating - if (file->compressed && len > file->data_na->initialized_size) { - char zero = 0; - if (ntfs_attr_pwrite(file->data_na, len - 1, 1, &zero) <= 0) { - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - } else { - if (ntfs_attr_truncate(file->data_na, len)) { - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - } - - // Mark the file for archiving (if we actually changed something) - if (file->len != file->data_na->data_size) - file->ni->flags |= FILE_ATTR_ARCHIVE; - - // Update file times (if we actually changed something) - if (file->len != file->data_na->data_size) - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_AMCTIME); - - // Update the files data length - file->len = file->data_na->data_size; - - // Sync the file (and its attributes) to disc - ntfsSync(file->vd, file->ni); - - // Unlock - ntfsUnlock(file->vd); - - return 0; -} - -int ntfs_fsync_r (struct _reent *r, int fd) -{ - ntfs_log_trace("fd %p\n", fd); - - ntfs_file_state* file = STATE(fd); - int ret = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Sync the file (and its attributes) to disc - ret = ntfsSync(file->vd, file->ni); - if (ret) - r->_errno = errno; - - // Unlock - ntfsUnlock(file->vd); - - return ret; -} \ No newline at end of file diff --git a/source/libs/libntfs/ntfsfile.h b/source/libs/libntfs/ntfsfile.h deleted file mode 100644 index 8e5ffcc6..00000000 --- a/source/libs/libntfs/ntfsfile.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * ntfsfile.c - devoptab file routines for NTFS-based devices. - * - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFSFILE_H -#define _NTFSFILE_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "ntfsinternal.h" -#include - -/** - * ntfs_file_state - File state - */ -typedef struct _ntfs_file_state { - ntfs_vd *vd; /* Volume this file belongs to */ - ntfs_inode *ni; /* File descriptor */ - ntfs_attr *data_na; /* File data descriptor */ - int flags; /* Opening flags */ - bool read; /* True if allowed to read from file */ - bool write; /* True if allowed to write to file */ - bool append; /* True if allowed to append to file */ - bool compressed; /* True if file data is compressed */ - bool encrypted; /* True if file data is encryted */ - off_t pos; /* Current position within the file (in bytes) */ - u64 len; /* Total length of the file (in bytes) */ - struct _ntfs_file_state *prevOpenFile; /* The previous entry in a double-linked FILO list of open files */ - struct _ntfs_file_state *nextOpenFile; /* The next entry in a double-linked FILO list of open files */ -} ntfs_file_state; - -/* File state routines */ -void ntfsCloseFile (ntfs_file_state *file); - -/* Gekko devoptab file routines for NTFS-based devices */ -extern int ntfs_open_r (struct _reent *r, void *fileStruct, const char *path, int flags, int mode); -extern int ntfs_close_r (struct _reent *r, int fd); -extern ssize_t ntfs_write_r (struct _reent *r, int fd, const char *ptr, size_t len); -extern ssize_t ntfs_read_r (struct _reent *r, int fd, char *ptr, size_t len); -extern off_t ntfs_seek_r (struct _reent *r, int fd, off_t pos, int dir); -extern int ntfs_fstat_r (struct _reent *r, int fd, struct stat *st); -extern int ntfs_ftruncate_r (struct _reent *r, int fd, off_t len); -extern int ntfs_fsync_r (struct _reent *r, int fd); - -#endif /* _NTFSFILE_H */ - diff --git a/source/libs/libntfs/ntfsfile_frag.c b/source/libs/libntfs/ntfsfile_frag.c deleted file mode 100644 index 55823789..00000000 --- a/source/libs/libntfs/ntfsfile_frag.c +++ /dev/null @@ -1,579 +0,0 @@ -/** - * ntfsfile.c - devoptab file routines for NTFS-based devices. - * Copyright (c) 2010 Miigotu - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - -#include "ntfsinternal.h" -#include "ntfsfile.h" -#include "ntfs.h" - -#define STATE(x) ((ntfs_file_state*)x) - -// for easier comparision of ntfsfile.c against ntfsfile_frag.c -// everything is included but ifdef-ed out - -#if 0 - -void ntfsCloseFile (ntfs_file_state *file) -{ - // Sanity check - if (!file || !file->vd) - return; - - // Special case fix ups for compressed and/or encrypted files - if (file->compressed) - ntfs_attr_pclose(file->data_na); -#ifdef HAVE_SETXATTR - if (file->encrypted) - ntfs_efs_fixup_attribute(NULL, file->data_na); -#endif - // Close the file data attribute (if open) - if (file->data_na) - ntfs_attr_close(file->data_na); - - // Sync the file (and its attributes) to disc - if(file->write) - { - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_ATIME | NTFS_UPDATE_CTIME); - ntfsSync(file->vd, file->ni); - } - - if (file->read) - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_ATIME); - - // Close the file (if open) - if (file->ni) - ntfsCloseEntry(file->vd, file->ni); - - // Reset the file state - file->ni = NULL; - file->data_na = NULL; - file->flags = 0; - file->read = false; - file->write = false; - file->append = false; - file->pos = 0; - file->len = 0; - - return; -} - -int ntfs_open_r (struct _reent *r, void *fileStruct, const char *path, int flags, int mode) -{ - ntfs_log_trace("fileStruct %p, path %s, flags %i, mode %i\n", fileStruct, path, flags, mode); - - ntfs_file_state* file = STATE(fileStruct); - - // Get the volume descriptor for this path - file->vd = ntfsGetVolume(path); - if (!file->vd) { - r->_errno = ENODEV; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Determine which mode the file is opened for - file->flags = flags; - if ((flags & 0x03) == O_RDONLY) { - file->read = true; - file->write = false; - file->append = false; - } else if ((flags & 0x03) == O_WRONLY) { - file->read = false; - file->write = true; - file->append = (flags & O_APPEND); - } else if ((flags & 0x03) == O_RDWR) { - file->read = true; - file->write = true; - file->append = (flags & O_APPEND); - } else { - r->_errno = EACCES; - ntfsUnlock(file->vd); - return -1; - } - - // Try and find the file and (if found) ensure that it is not a directory - file->ni = ntfsOpenEntry(file->vd, path); - if (file->ni && (file->ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)) { - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = EISDIR; - return -1; - } - - // Are we creating this file? - if (flags & O_CREAT) { - - // The file SHOULD NOT already exist - if (file->ni) { - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = EEXIST; - return -1; - } - - // Create the file - file->ni = ntfsCreate(file->vd, path, S_IFREG, NULL); - if (!file->ni) { - ntfsUnlock(file->vd); - return -1; - } - - } - - // Sanity check, the file should be open by now - if (!file->ni) { - ntfsUnlock(file->vd); - r->_errno = ENOENT; - return -1; - } - - // Open the files data attribute - file->data_na = ntfs_attr_open(file->ni, AT_DATA, AT_UNNAMED, 0); - if(!file->data_na) { - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - return -1; - } - - // Determine if this files data is compressed and/or encrypted - file->compressed = NAttrCompressed(file->data_na) || (file->ni->flags & FILE_ATTR_COMPRESSED); - file->encrypted = NAttrEncrypted(file->data_na) || (file->ni->flags & FILE_ATTR_ENCRYPTED); - - // We cannot read/write encrypted files - if (file->encrypted) { - ntfs_attr_close(file->data_na); - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = EACCES; - return -1; - } - - // Make sure we aren't trying to write to a read-only file - if ((file->ni->flags & FILE_ATTR_READONLY) && file->write) { - ntfs_attr_close(file->data_na); - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = EROFS; - return -1; - } - - // Truncate the file if requested - if ((flags & O_TRUNC) && file->write) { - if (ntfs_attr_truncate(file->data_na, 0)) { - ntfs_attr_close(file->data_na); - ntfsCloseEntry(file->vd, file->ni); - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - } - - // Set the files current position and length - file->pos = 0; - file->len = file->data_na->data_size; - - ntfs_log_trace("file->len %d\n", file->len); - - // Update file times - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_ATIME); - - // Insert the file into the double-linked FILO list of open files - if (file->vd->firstOpenFile) { - file->nextOpenFile = file->vd->firstOpenFile; - file->vd->firstOpenFile->prevOpenFile = file; - } else { - file->nextOpenFile = NULL; - } - file->prevOpenFile = NULL; - file->vd->firstOpenFile = file; - file->vd->openFileCount++; - - // Unlock - ntfsUnlock(file->vd); - - return (int)fileStruct; -} - -int ntfs_close_r (struct _reent *r, int fd) -{ - ntfs_log_trace("fd %p\n", fd); - - ntfs_file_state* file = STATE(fd); - - // Sanity check - if (!file || !file->vd) { - r->_errno = EBADF; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Close the file - ntfsCloseFile(file); - - // Remove the file from the double-linked FILO list of open files - file->vd->openFileCount--; - if (file->nextOpenFile) - file->nextOpenFile->prevOpenFile = file->prevOpenFile; - if (file->prevOpenFile) - file->prevOpenFile->nextOpenFile = file->nextOpenFile; - else - file->vd->firstOpenFile = file->nextOpenFile; - - // Unlock - ntfsUnlock(file->vd); - - return 0; -} - -ssize_t ntfs_write_r (struct _reent *r, int fd, const char *ptr, size_t len) -{ - ntfs_log_trace("fd %p, ptr %p, len %Li\n", fd, ptr, len); - - ntfs_file_state* file = STATE(fd); - ssize_t written = 0; - off_t old_pos = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Short circuit cases where we don't actually have to do anything - if (!ptr || len <= 0) { - return 0; - } - - // Lock - ntfsLock(file->vd); - - // Check that we are allowed to write to this file - if (!file->write) { - ntfsUnlock(file->vd); - r->_errno = EACCES; - return -1; - } - - // If we are in append mode, backup the current position and move to the end of the file - if (file->append) { - old_pos = file->pos; - file->pos = file->len; - } - - // Write to the files data atrribute - while (len) { - ssize_t ret = ntfs_attr_pwrite(file->data_na, file->pos, len, ptr); - if (ret <= 0) { - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - len -= ret; - file->pos += ret; - written += ret; - } - - // If we are in append mode, restore the current position to were it was prior to this write - if (file->append) { - file->pos = old_pos; - } - - // Mark the file for archiving (if we actually wrote something) - if (written) - file->ni->flags |= FILE_ATTR_ARCHIVE; - - // Update the files data length - file->len = file->data_na->data_size; - - // Unlock - ntfsUnlock(file->vd); - - return written; -} - -#endif - -s64 ntfs_attr_getfragments(ntfs_attr *na, const s64 pos, s64 count, u64 offset, - _ntfs_frag_append_t append_fragment, void *callback_data); - -int _NTFS_get_fragments (const char *path, - _ntfs_frag_append_t append_fragment, void *callback_data) -{ - struct _reent r; - ntfs_file_state file_st, *file = &file_st; - ssize_t read = 0; - int ret_val = -11; - - // Open File - r._errno = 0; - int fd = ntfs_open_r(&r, file, path, O_RDONLY, 0); - if (fd != (int)file) return -12; - - - - - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - //r->_errno = EINVAL; - return -13; - } - /* - // Short circuit cases where we don't actually have to do anything - if (!ptr || len <= 0) { - return 0; - } - */ - - // Lock - ntfsLock(file->vd); - - /* - // Check that we are allowed to read from this file - if (!file->read) { - ntfsUnlock(file->vd); - r->_errno = EACCES; - return -1; - } - - // Don't read past the end of file - if (file->pos + len > file->len) { - r->_errno = EOVERFLOW; - len = file->len - file->pos; - ntfs_log_trace("EOVERFLOW"); - } - */ - - u64 offset = 0; - u64 len = file->len; - - // Read from the files data attribute - while (len) { - s64 ret = ntfs_attr_getfragments(file->data_na, file->pos, - len, offset, append_fragment, callback_data); - if (ret <= 0 || ret > len) { - ntfsUnlock(file->vd); - //r->_errno = errno; - ret_val = -14; - if (ret < 0) ret_val = ret; - goto out; - } - offset += ret; - len -= ret; - file->pos += ret; - read += ret; - } - - // set file size - append_fragment(callback_data, file->len >> 9, 0, 0); - // success - ret_val = 0; - - /* - //ntfs_log_trace("file->pos: %d \n", (u32)file->pos); - // Update file times (if we actually read something) - if (read) - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_ATIME); - */ - -out: - // Unlock - ntfsUnlock(file->vd); - // Close the file - ntfs_close_r (&r, fd); - - return ret_val; -} - -#if 0 - -off_t ntfs_seek_r (struct _reent *r, int fd, off_t pos, int dir) -{ - ntfs_log_trace("fd %p, pos %Li, dir %i\n", fd, pos, dir); - - ntfs_file_state* file = STATE(fd); - off_t position = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Set the files current position - switch(dir) { - case SEEK_SET: position = file->pos = MIN(MAX(pos, 0), file->len); break; - case SEEK_CUR: position = file->pos = MIN(MAX(file->pos + pos, 0), file->len); break; - case SEEK_END: position = file->pos = MIN(MAX(file->len + pos, 0), file->len); break; - } - - // Unlock - ntfsUnlock(file->vd); - - return position; -} -int ntfs_fstat_r (struct _reent *r, int fd, struct stat *st) -{ - ntfs_log_trace("fd %p\n", fd); - - ntfs_file_state* file = STATE(fd); - int ret = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Short circuit cases were we don't actually have to do anything - if (!st) - return 0; - - // Get the file stats - ret = ntfsStat(file->vd, file->ni, st); - if (ret) - r->_errno = errno; - - return ret; -} - -int ntfs_ftruncate_r (struct _reent *r, int fd, off_t len) -{ - ntfs_log_trace("fd %p, len %Li\n", fd, len); - - ntfs_file_state* file = STATE(fd); - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Check that we are allowed to write to this file - if (!file->write) { - ntfsUnlock(file->vd); - r->_errno = EACCES; - return -1; - } - - // For compressed files, only deleting and expanding contents are implemented - if (file->compressed && - len > 0 && - len < file->data_na->initialized_size) { - ntfsUnlock(file->vd); - r->_errno = EOPNOTSUPP; - return -1; - } - - // Resize the files data attribute, either by expanding or truncating - if (file->compressed && len > file->data_na->initialized_size) { - char zero = 0; - if (ntfs_attr_pwrite(file->data_na, len - 1, 1, &zero) <= 0) { - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - } else { - if (ntfs_attr_truncate(file->data_na, len)) { - ntfsUnlock(file->vd); - r->_errno = errno; - return -1; - } - } - - // Mark the file for archiving (if we actually changed something) - if (file->len != file->data_na->data_size) - file->ni->flags |= FILE_ATTR_ARCHIVE; - - // Update file times (if we actually changed something) - if (file->len != file->data_na->data_size) - ntfsUpdateTimes(file->vd, file->ni, NTFS_UPDATE_AMCTIME); - - // Update the files data length - file->len = file->data_na->data_size; - - // Sync the file (and its attributes) to disc - ntfsSync(file->vd, file->ni); - - // Unlock - ntfsUnlock(file->vd); - - return 0; -} - -int ntfs_fsync_r (struct _reent *r, int fd) -{ - ntfs_log_trace("fd %p\n", fd); - - ntfs_file_state* file = STATE(fd); - int ret = 0; - - // Sanity check - if (!file || !file->vd || !file->ni || !file->data_na) { - r->_errno = EINVAL; - return -1; - } - - // Lock - ntfsLock(file->vd); - - // Sync the file (and its attributes) to disc - ret = ntfsSync(file->vd, file->ni); - if (ret) - r->_errno = errno; - - // Unlock - ntfsUnlock(file->vd); - - return ret; -} - -#endif - diff --git a/source/libs/libntfs/ntfsfile_frag.h b/source/libs/libntfs/ntfsfile_frag.h new file mode 100644 index 00000000..889abb1a --- /dev/null +++ b/source/libs/libntfs/ntfsfile_frag.h @@ -0,0 +1,15 @@ +#ifndef NTFS_FRAG_H_ +#define NTFS_FRAG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int (*_ntfs_frag_append_t)(void *ff, u32 offset, u32 sector, u32 count); +int _NTFS_get_fragments (const char *path, _ntfs_frag_append_t append_fragment, void *callback_data); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/source/libs/libntfs/ntfsinternal.c b/source/libs/libntfs/ntfsinternal.c deleted file mode 100644 index fed15bce..00000000 --- a/source/libs/libntfs/ntfsinternal.c +++ /dev/null @@ -1,846 +0,0 @@ -/** - * ntfsinternal.h - Internal support routines for NTFS-based devices. - * - * Copyright (c) 2010 Dimok - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - -#include "ntfsinternal.h" -#include "ntfsdir.h" -#include "ntfsfile.h" - -#if defined(__wii__) -#include -#include -#include - -const INTERFACE_ID ntfs_disc_interfaces[] = { - { "sd", &__io_wiisd }, - { "usb", &__io_usbstorage }, - { "carda", &__io_gcsda }, - { "cardb", &__io_gcsdb }, - { NULL, NULL } -}; - -#elif defined(__gamecube__) -#include - -const INTERFACE_ID ntfs_disc_interfaces[] = { - { "carda", &__io_gcsda }, - { "cardb", &__io_gcsdb }, - { NULL, NULL } -}; - -#endif - -int ntfsAddDevice (const char *name, void *deviceData) -{ - const devoptab_t *devoptab_ntfs = ntfsGetDevOpTab(); - devoptab_t *dev = NULL; - char *devname = NULL; - int i; - - // Sanity check - if (!name || !deviceData || !devoptab_ntfs) { - errno = EINVAL; - return -1; - } - - // Allocate a devoptab for this device - dev = (devoptab_t *) ntfs_alloc(sizeof(devoptab_t) + strlen(name) + 1); - if (!dev) { - errno = ENOMEM; - return false; - } - - // Use the space allocated at the end of the devoptab for storing the device name - devname = (char*)(dev + 1); - strcpy(devname, name); - - // Setup the devoptab - memcpy(dev, devoptab_ntfs, sizeof(devoptab_t)); - dev->name = devname; - dev->deviceData = deviceData; - - // Add the device to the devoptab table (if there is a free slot) - for (i = 0; i < STD_MAX; i++) { - if (devoptab_list[i] == devoptab_list[0] && i != 0) { - devoptab_list[i] = dev; - return 0; - } - } - - // If we reach here then there are no free slots in the devoptab table for this device - errno = EADDRNOTAVAIL; - return -1; -} - -void ntfsRemoveDevice (const char *path) -{ - const devoptab_t *devoptab = NULL; - char name[128] = {0}; - int i; - - // Get the device name from the path - strncpy(name, path, 127); - strtok(name, ":/"); - - // Find and remove the specified device from the devoptab table - // NOTE: We do this manually due to a 'bug' in RemoveDevice - // which ignores names with suffixes and causes names - // like "ntfs" and "ntfs1" to be seen as equals - for (i = 0; i < STD_MAX; i++) { - devoptab = devoptab_list[i]; - if (devoptab && devoptab->name) { - if (strcmp(name, devoptab->name) == 0) { - devoptab_list[i] = devoptab_list[0]; - ntfs_free((devoptab_t*)devoptab); - break; - } - } - } - - return; -} - -const devoptab_t *ntfsGetDevice (const char *path, bool useDefaultDevice) -{ - const devoptab_t *devoptab = NULL; - char name[128] = {0}; - int i; - - // Get the device name from the path - strncpy(name, path, 127); - strtok(name, ":/"); - - // Search the devoptab table for the specified device name - // NOTE: We do this manually due to a 'bug' in GetDeviceOpTab - // which ignores names with suffixes and causes names - // like "ntfs" and "ntfs1" to be seen as equals - for (i = 0; i < STD_MAX; i++) { - devoptab = devoptab_list[i]; - if (devoptab && devoptab->name) { - if (strcmp(name, devoptab->name) == 0) { - return devoptab; - } - } - } - - // If we reach here then we couldn't find the device name, - // chances are that this path has no device name in it. - // Call GetDeviceOpTab to get our default device (chdir). - if (useDefaultDevice) - return GetDeviceOpTab(""); - - return NULL; -} - -const INTERFACE_ID *ntfsGetDiscInterfaces (void) -{ - // Get all know disc interfaces on the host system - return ntfs_disc_interfaces; -} - -ntfs_vd *ntfsGetVolume (const char *path) -{ - // Get the volume descriptor from the paths associated devoptab (if found) - const devoptab_t *devoptab_ntfs = ntfsGetDevOpTab(); - const devoptab_t *devoptab = ntfsGetDevice(path, true); - if (devoptab && devoptab_ntfs && (devoptab->open_r == devoptab_ntfs->open_r)) - return (ntfs_vd*)devoptab->deviceData; - - return NULL; -} - -int ntfsInitVolume (ntfs_vd *vd) -{ - // Sanity check - if (!vd) { - errno = ENODEV; - return -1; - } - - // Initialise the volume lock - LWP_MutexInit(&vd->lock, false); - - // Reset the volumes name cache - vd->name[0] = '\0'; - - // Reset the volumes current directory - vd->cwd_ni = NULL; - - // Reset open directory and file stats - vd->openDirCount = 0; - vd->openFileCount = 0; - vd->firstOpenDir = NULL; - vd->firstOpenFile = NULL; - - return 0; -} - -void ntfsDeinitVolume (ntfs_vd *vd) -{ - // Sanity check - if (!vd) { - errno = ENODEV; - return; - } - - // Lock - ntfsLock(vd); - - // Close any directories which are still open (lazy programmers!) - ntfs_dir_state *nextDir = vd->firstOpenDir; - while (nextDir) { - ntfs_log_warning("Cleaning up orphaned directory @ %p\n", nextDir); - ntfsCloseDir(nextDir); - nextDir = nextDir->nextOpenDir; - } - - // Close any files which are still open (lazy programmers!) - ntfs_file_state *nextFile = vd->firstOpenFile; - while (nextFile) { - ntfs_log_warning("Cleaning up orphaned file @ %p\n", nextFile); - ntfsCloseFile(nextFile); - nextFile = nextFile->nextOpenFile; - } - - // Reset open directory and file stats - vd->openDirCount = 0; - vd->openFileCount = 0; - vd->firstOpenDir = NULL; - vd->firstOpenFile = NULL; - - // Close the volumes current directory (if any) - //if (vd->cwd_ni) { - //ntfsCloseEntry(vd, vd->cwd_ni); - //vd->cwd_ni = NULL; - //} - - // Force the underlying device to sync - vd->dev->d_ops->sync(vd->dev); - - // Unlock - ntfsUnlock(vd); - - // Deinitialise the volume lock - LWP_MutexDestroy(vd->lock); - - return; -} - -ntfs_inode *ntfsOpenEntry (ntfs_vd *vd, const char *path) -{ - return ntfsParseEntry(vd, path, 1); -} - -ntfs_inode *ntfsParseEntry (ntfs_vd *vd, const char *path, int reparseLevel) -{ - ntfs_inode *ni = NULL; - char *target = NULL; - int attr_size; - - // Sanity check - if (!vd) { - errno = ENODEV; - return NULL; - } - - // Get the actual path of the entry - path = ntfsRealPath(path); - if (!path) { - errno = EINVAL; - return NULL; - } else if (path[0] == '\0') { - path = "."; - } - - // Find the entry, taking into account our current directory (if any) - if (path[0] != PATH_SEP) - ni = ntfs_pathname_to_inode(vd->vol, vd->cwd_ni, path++); - else - ni = ntfs_pathname_to_inode(vd->vol, NULL, path); - - // If the entry was found and it has reparse data then parse its true path; - // this resolves the true location of symbolic links and directory junctions - if (ni && (ni->flags & FILE_ATTR_REPARSE_POINT)) { - if (ntfs_possible_symlink(ni)) { - - // Sanity check, give up if we are parsing to deep - if (reparseLevel > NTFS_MAX_SYMLINK_DEPTH) { - ntfsCloseEntry(vd, ni); - errno = ELOOP; - return NULL; - } - - // Get the target path of this entry - target = ntfs_make_symlink(ni, path, &attr_size); - if (!target) { - ntfsCloseEntry(vd, ni); - return NULL; - } - - // Close the entry (we are no longer interested in it) - ntfsCloseEntry(vd, ni); - - // Parse the entries target - ni = ntfsParseEntry(vd, target, reparseLevel++); - - // Clean up - ntfs_free(target); - - } - } - - return ni; -} - -void ntfsCloseEntry (ntfs_vd *vd, ntfs_inode *ni) -{ - // Sanity check - if (!vd) { - errno = ENODEV; - return; - } - - // Lock - ntfsLock(vd); - - // Sync the entry (if it is dirty) - if (NInoDirty(ni)) - ntfsSync(vd, ni); - - // Close the entry - ntfs_inode_close(ni); - - // Unlock - ntfsUnlock(vd); - - return; -} - - -ntfs_inode *ntfsCreate (ntfs_vd *vd, const char *path, mode_t type, const char *target) -{ - ntfs_inode *dir_ni = NULL, *ni = NULL; - char *dir = NULL; - char *name = NULL; - ntfschar *uname = NULL, *utarget = NULL; - int uname_len, utarget_len; - - // Sanity check - if (!vd) { - errno = ENODEV; - return NULL; - } - - // You cannot link between devices - if(target) { - if(vd != ntfsGetVolume(target)) { - errno = EXDEV; - return NULL; - } - } - - // Get the actual paths of the entry - path = ntfsRealPath(path); - target = ntfsRealPath(target); - if (!path) { - errno = EINVAL; - return NULL; - } - - // Lock - ntfsLock(vd); - - // Get the unicode name for the entry and find its parent directory - // TODO: This looks horrible, clean it up - dir = strdup(path); - if (!dir) { - errno = EINVAL; - goto cleanup; - } - name = strrchr(dir, '/'); - if (name) - name++; - else - name = dir; - uname_len = ntfsLocalToUnicode(name, &uname); - if (uname_len < 0) { - errno = EINVAL; - goto cleanup; - } - name = strrchr(dir, '/'); - if(name) - { - name++; - name[0] = 0; - } - - // Open the entries parent directory - dir_ni = ntfsOpenEntry(vd, dir); - if (!dir_ni) { - goto cleanup; - } - - // Create the entry - switch (type) { - - // Symbolic link - case S_IFLNK: - if (!target) { - errno = EINVAL; - goto cleanup; - } - utarget_len = ntfsLocalToUnicode(target, &utarget); - if (utarget_len < 0) { - errno = EINVAL; - goto cleanup; - } - ni = ntfs_create_symlink(dir_ni, 0, uname, uname_len, utarget, utarget_len); - break; - - // Directory or file - case S_IFDIR: - case S_IFREG: - ni = ntfs_create(dir_ni, 0, uname, uname_len, type); - break; - - } - - // If the entry was created - if (ni) { - - // Mark the entry for archiving - ni->flags |= FILE_ATTR_ARCHIVE; - - // Mark the entry as dirty - NInoSetDirty(ni); - - // Sync the entry to disc - ntfsSync(vd, ni); - - // Update parent directories times - ntfsUpdateTimes(vd, dir_ni, NTFS_UPDATE_MCTIME); - - } - -cleanup: - - if(dir_ni) - ntfsCloseEntry(vd, dir_ni); - - if(utarget) - ntfs_free(utarget); - - if(uname) - ntfs_free(uname); - - if(dir) - ntfs_free(dir); - - // Unlock - ntfsUnlock(vd); - - return ni; -} - -int ntfsLink (ntfs_vd *vd, const char *old_path, const char *new_path) -{ - ntfs_inode *dir_ni = NULL, *ni = NULL; - char *dir = NULL; - char *name = NULL; - ntfschar *uname = NULL; - int uname_len; - int res = 0; - - // Sanity check - if (!vd) { - errno = ENODEV; - return -1; - } - - // You cannot link between devices - if(vd != ntfsGetVolume(new_path)) { - errno = EXDEV; - return -1; - } - - // Get the actual paths of the entry - old_path = ntfsRealPath(old_path); - new_path = ntfsRealPath(new_path); - if (!old_path || !new_path) { - errno = EINVAL; - return -1; - } - - // Lock - ntfsLock(vd); - - // Get the unicode name for the entry and find its parent directory - // TODO: This looks horrible, clean it up - dir = strdup(new_path); - if (!dir) { - errno = EINVAL; - goto cleanup; - } - name = strrchr(dir, '/'); - if (name) - name++; - else - name = dir; - uname_len = ntfsLocalToUnicode(name, &uname); - if (uname_len < 0) { - errno = EINVAL; - goto cleanup; - } - *name = 0; - - // Find the entry - ni = ntfsOpenEntry(vd, old_path); - if (!ni) { - errno = ENOENT; - res = -1; - goto cleanup; - } - - // Open the entries new parent directory - dir_ni = ntfsOpenEntry(vd, dir); - if (!dir_ni) { - errno = ENOENT; - res = -1; - goto cleanup; - } - - // Link the entry to its new parent - if (ntfs_link(ni, dir_ni, uname, uname_len)) { - res = -1; - goto cleanup; - } - - // Update entry times - ntfsUpdateTimes(vd, dir_ni, NTFS_UPDATE_MCTIME); - - // Sync the entry to disc - ntfsSync(vd, ni); - -cleanup: - - if(dir_ni) - ntfsCloseEntry(vd, dir_ni); - - if(ni) - ntfsCloseEntry(vd, ni); - - if(uname) - ntfs_free(uname); - - if(dir) - ntfs_free(dir); - - // Unlock - ntfsUnlock(vd); - - return res; -} - -int ntfsUnlink (ntfs_vd *vd, const char *path) -{ - ntfs_inode *dir_ni = NULL, *ni = NULL; - char *dir = NULL; - char *name = NULL; - ntfschar *uname = NULL; - int uname_len; - int res = 0; - - // Sanity check - if (!vd) { - errno = ENODEV; - return -1; - } - - // Get the actual path of the entry - path = ntfsRealPath(path); - if (!path) { - errno = EINVAL; - return -1; - } - - // Lock - ntfsLock(vd); - - // Get the unicode name for the entry and find its parent directory - // TODO: This looks horrible - dir = strdup(path); - if (!dir) { - errno = EINVAL; - goto cleanup; - } - name = strrchr(dir, '/'); - if (name) - name++; - else - name = dir; - uname_len = ntfsLocalToUnicode(name, &uname); - if (uname_len < 0) { - errno = EINVAL; - goto cleanup; - } - name = strrchr(dir, '/'); - if(name) - { - name++; - name[0] = 0; - } - - // Find the entry - ni = ntfsOpenEntry(vd, path); - if (!ni) { - errno = ENOENT; - res = -1; - goto cleanup; - } - - // Open the entries parent directory - dir_ni = ntfsOpenEntry(vd, dir); - if (!dir_ni) { - errno = ENOENT; - res = -1; - goto cleanup; - } - - // Unlink the entry from its parent - if (ntfs_delete(vd->vol, path, ni, dir_ni, uname, uname_len)) { - res = -1; - } - - // Force the underlying device to sync - vd->dev->d_ops->sync(vd->dev); - - // ntfs_delete() ALWAYS closes ni and dir_ni; so no need for us to anymore - dir_ni = ni = NULL; - -cleanup: - - if(dir_ni) - ntfsCloseEntry(vd, dir_ni); - - if(ni) - ntfsCloseEntry(vd, ni); - - if(uname) - ntfs_free(uname); - - if(dir) - ntfs_free(dir); - - // Unlock - ntfsUnlock(vd); - - return 0; -} - -int ntfsSync (ntfs_vd *vd, ntfs_inode *ni) -{ - int res = 0; - - // Sanity check - if (!vd) { - errno = ENODEV; - return -1; - } - - // Sanity check - if (!ni) { - errno = ENOENT; - return -1; - } - - // Lock - ntfsLock(vd); - - // Sync the entry - res = ntfs_inode_sync(ni); - - // Force the underlying device to sync - vd->dev->d_ops->sync(vd->dev); - - // Unlock - ntfsUnlock(vd); - - return res; - -} - -int ntfsStat (ntfs_vd *vd, ntfs_inode *ni, struct stat *st) -{ - ntfs_attr *na = NULL; - int res = 0; - - // Sanity check - if (!vd) { - errno = ENODEV; - return -1; - } - - // Sanity check - if (!ni) { - errno = ENOENT; - return -1; - } - - // Short circuit cases were we don't actually have to do anything - if (!st) - return 0; - - // Lock - ntfsLock(vd); - - // Zero out the stat buffer - memset(st, 0, sizeof(struct stat)); - - // Is this entry a directory - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - st->st_mode = S_IFDIR | (0777 & ~vd->dmask); - st->st_nlink = 1; - - // Open the directories index allocation table attribute - na = ntfs_attr_open(ni, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4); - if (na) { - st->st_size = na->data_size; - st->st_blocks = na->allocated_size >> 9; - ntfs_attr_close(na); - } - - // Else it must be a file - } else { - st->st_mode = S_IFREG | (0777 & ~vd->fmask); - st->st_size = ni->data_size; - st->st_blocks = (ni->allocated_size + 511) >> 9; - st->st_nlink = le16_to_cpu(ni->mrec->link_count); - } - - // Fill in the generic entry stats - st->st_dev = vd->id; - st->st_uid = vd->uid; - st->st_gid = vd->gid; - st->st_ino = ni->mft_no; - st->st_atime = ni->last_access_time; - st->st_ctime = ni->last_mft_change_time; - st->st_mtime = ni->last_data_change_time; - - // Update entry times - ntfsUpdateTimes(vd, ni, NTFS_UPDATE_ATIME); - - // Unlock - ntfsUnlock(vd); - - return res; -} - -void ntfsUpdateTimes (ntfs_vd *vd, ntfs_inode *ni, ntfs_time_update_flags mask) -{ - // Run the access time update strategy against the device driver settings first - if (vd && vd->atime == ATIME_DISABLED) - mask &= ~NTFS_UPDATE_ATIME; - - // Update entry times - if (ni && mask) - ntfs_inode_update_times(ni, mask); - - return; -} - -const char *ntfsRealPath (const char *path) -{ - // Sanity check - if (!path) - return NULL; - - // Move the path pointer to the start of the actual path - if (strchr(path, ':') != NULL) { - path = strchr(path, ':') + 1; - } - if (strchr(path, ':') != NULL) { - return NULL; - } - - return path; -} - -int ntfsUnicodeToLocal (const ntfschar *ins, const int ins_len, char **outs, int outs_len) -{ - int len = 0; - int i; - - // Sanity check - if (!ins || !ins_len || !outs) - return 0; - - // Convert the unicode string to our current local - len = ntfs_ucstombs(ins, ins_len, outs, outs_len); - if (len == -1 && errno == EILSEQ) { - - // The string could not be converted to the current local, - // do it manually by replacing non-ASCII characters with underscores - if (!*outs || outs_len >= ins_len) { - if (!*outs) { - *outs = (char *) ntfs_alloc(ins_len + 1); - if (!*outs) { - errno = ENOMEM; - return -1; - } - } - for (i = 0; i < ins_len; i++) { - ntfschar uc = le16_to_cpu(ins[i]); - if (uc > 0xff) - uc = (ntfschar)'_'; - *outs[i] = (char)uc; - } - *outs[ins_len] = (ntfschar)'\0'; - len = ins_len; - } - - } - - return len; -} - -int ntfsLocalToUnicode (const char *ins, ntfschar **outs) -{ - // Sanity check - if (!ins || !outs) - return 0; - - // Convert the local string to unicode - return ntfs_mbstoucs(ins, outs); -} diff --git a/source/libs/libntfs/ntfsinternal.h b/source/libs/libntfs/ntfsinternal.h deleted file mode 100644 index 11dfb8fd..00000000 --- a/source/libs/libntfs/ntfsinternal.h +++ /dev/null @@ -1,178 +0,0 @@ -/** - * ntfsinternal.h - Internal support routines for NTFS-based devices. - * - * Copyright (c) 2009 Rhys "Shareese" Koedijk - * Copyright (c) 2006 Michael "Chishm" Chisholm - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFSINTERNAL_H -#define _NTFSINTERNAL_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "types.h" -#include "compat.h" -#include "logging.h" -#include "layout.h" -#include "device.h" -#include "volume.h" -#include "dir.h" -#include "inode.h" -#include "attrib.h" -#include "reparse.h" -#include "security.h" -#include "efs.h" -#include "unistr.h" - -#include -#include -#include - -#define NTFS_MOUNT_PREFIX "ntfs" /* Device name prefix to use when auto-mounting */ -#define NTFS_MAX_PARTITIONS 32 /* Maximum number of partitions that can be found */ -#define NTFS_MAX_MOUNTS 10 /* Maximum number of mounts available at one time */ -#define NTFS_MAX_SYMLINK_DEPTH 10 /* Maximum search depth when resolving symbolic links */ - -#define NTFS_OEM_ID cpu_to_le64(0x202020205346544eULL) /* "NTFS " */ - -#define MBR_SIGNATURE cpu_to_le16(0xAA55) -#define EBR_SIGNATURE cpu_to_le16(0xAA55) - -#define PARTITION_STATUS_NONBOOTABLE 0x00 /* Non-bootable */ -#define PARTITION_STATUS_BOOTABLE 0x80 /* Bootable (active) */ - -#define PARTITION_TYPE_EMPTY 0x00 /* Empty */ -#define PARTITION_TYPE_DOS33_EXTENDED 0x05 /* DOS 3.3+ extended partition */ -#define PARTITION_TYPE_NTFS 0x07 /* Windows NT NTFS */ -#define PARTITION_TYPE_WIN95_EXTENDED 0x0F /* Windows 95 extended partition */ - -/* Forward declarations */ -struct _ntfs_file_state; -struct _ntfs_dir_state; - -/** - * PRIMARY_PARTITION - Block device partition record - */ -typedef struct _PARTITION_RECORD { - u8 status; /* Partition status; see above */ - u8 chs_start[3]; /* Cylinder-head-sector address to first block of partition */ - u8 type; /* Partition type; see above */ - u8 chs_end[3]; /* Cylinder-head-sector address to last block of partition */ - u32 lba_start; /* Local block address to first sector of partition */ - u32 block_count; /* Number of blocks in partition */ -} __attribute__((__packed__)) PARTITION_RECORD; - -/** - * MASTER_BOOT_RECORD - Block device master boot record - */ -typedef struct _MASTER_BOOT_RECORD { - u8 code_area[446]; /* Code area; normally empty */ - PARTITION_RECORD partitions[4]; /* 4 primary partitions */ - u16 signature; /* MBR signature; 0xAA55 */ -} __attribute__((__packed__)) MASTER_BOOT_RECORD; - -/** - * EXTENDED_PARTITION - Block device extended boot record - */ -typedef struct _EXTENDED_BOOT_RECORD { - u8 code_area[446]; /* Code area; normally empty */ - PARTITION_RECORD partition; /* Primary partition */ - PARTITION_RECORD next_ebr; /* Next extended boot record in the chain */ - u8 reserved[32]; /* Normally empty */ - u16 signature; /* EBR signature; 0xAA55 */ -} __attribute__((__packed__)) EXTENDED_BOOT_RECORD; - -/** - * INTERFACE_ID - Disc interface identifier - */ -typedef struct _INTERFACE_ID { - const char *name; /* Interface name */ - const DISC_INTERFACE *interface; /* Disc interface */ -} INTERFACE_ID; - -/** - * ntfs_atime_t - File access time update strategies - */ -typedef enum { - ATIME_ENABLED, /* Update access times */ - ATIME_DISABLED /* Don't update access times */ -} ntfs_atime_t; - -/** - * ntfs_vd - NTFS volume descriptor - */ -typedef struct _ntfs_vd { - struct ntfs_device *dev; /* NTFS device handle */ - ntfs_volume *vol; /* NTFS volume handle */ - mutex_t lock; /* Volume lock mutex */ - s64 id; /* Filesystem id */ - u32 flags; /* Mount flags */ - char name[128]; /* Volume name (cached) */ - u16 uid; /* User id for entry creation */ - u16 gid; /* Group id for entry creation */ - u16 fmask; /* Unix style permission mask for file creation */ - u16 dmask; /* Unix style permission mask for directory creation */ - ntfs_atime_t atime; /* Entry access time update strategy */ - bool showHiddenFiles; /* If true, show hidden files when enumerating directories */ - bool showSystemFiles; /* If true, show system files when enumerating directories */ - ntfs_inode *cwd_ni; /* Current directory */ - struct _ntfs_dir_state *firstOpenDir; /* The start of a FILO linked list of currently opened directories */ - struct _ntfs_file_state *firstOpenFile; /* The start of a FILO linked list of currently opened files */ - u16 openDirCount; /* The total number of directories currently open in this volume */ - u16 openFileCount; /* The total number of files currently open in this volume */ -} ntfs_vd; - -/* Lock volume */ -static inline void ntfsLock (ntfs_vd *vd) -{ - LWP_MutexLock(vd->lock); -} - -/* Unlock volume */ -static inline void ntfsUnlock (ntfs_vd *vd) -{ - LWP_MutexUnlock(vd->lock); -} - -/* Gekko device related routines */ -int ntfsAddDevice (const char *name, void *deviceData); -void ntfsRemoveDevice (const char *path); -const devoptab_t *ntfsGetDevice (const char *path, bool useDefaultDevice); -const devoptab_t *ntfsGetDevOpTab (void); -const INTERFACE_ID* ntfsGetDiscInterfaces (void); - -/* Miscellaneous helper/support routines */ -int ntfsInitVolume (ntfs_vd *vd); -void ntfsDeinitVolume (ntfs_vd *vd); -ntfs_vd *ntfsGetVolume (const char *path); -ntfs_inode *ntfsOpenEntry (ntfs_vd *vd, const char *path); -ntfs_inode *ntfsParseEntry (ntfs_vd *vd, const char *path, int reparseLevel); -void ntfsCloseEntry (ntfs_vd *vd, ntfs_inode *ni); -ntfs_inode *ntfsCreate (ntfs_vd *vd, const char *path, mode_t type, const char *target); -int ntfsLink (ntfs_vd *vd, const char *old_path, const char *new_path); -int ntfsUnlink (ntfs_vd *vd, const char *path); -int ntfsSync (ntfs_vd *vd, ntfs_inode *ni); -int ntfsStat (ntfs_vd *vd, ntfs_inode *ni, struct stat *st); -void ntfsUpdateTimes (ntfs_vd *vd, ntfs_inode *ni, ntfs_time_update_flags mask); - -const char *ntfsRealPath (const char *path); -int ntfsUnicodeToLocal (const ntfschar *ins, const int ins_len, char **outs, int outs_len); -int ntfsLocalToUnicode (const char *ins, ntfschar **outs); - -#endif /* _NTFSINTERNAL_H */ diff --git a/source/libs/libntfs/ntfstime.h b/source/libs/libntfs/ntfstime.h deleted file mode 100644 index 426269d7..00000000 --- a/source/libs/libntfs/ntfstime.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * ntfstime.h - NTFS time related functions. Originated from the Linux-NTFS project. - * - * Copyright (c) 2005 Anton Altaparmakov - * Copyright (c) 2005 Yura Pakhuchiy - * Copyright (c) 2010 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_NTFSTIME_H -#define _NTFS_NTFSTIME_H - -#ifdef HAVE_TIME_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_GETTIMEOFDAY -#include -#endif - -#include "types.h" - -/* - * There are four times more conversions of internal representation - * to ntfs representation than any other conversion, so the most - * efficient internal representation is ntfs representation - * (with low endianness) - */ -typedef sle64 ntfs_time; - -#define NTFS_TIME_OFFSET ((s64)(369 * 365 + 89) * 24 * 3600 * 10000000) - -/** - * ntfs2timespec - Convert an NTFS time to Unix time - * @ntfs_time: An NTFS time in 100ns units since 1601 - * - * NTFS stores times as the number of 100ns intervals since January 1st 1601 at - * 00:00 UTC. This system will not suffer from Y2K problems until ~57000AD. - * - * Return: A Unix time (number of seconds since 1970, and nanoseconds) - */ -static __inline__ struct timespec ntfs2timespec(ntfs_time ntfstime) -{ - struct timespec spec; - s64 cputime; - - cputime = sle64_to_cpu(ntfstime); - spec.tv_sec = (cputime - (NTFS_TIME_OFFSET)) / 10000000; - spec.tv_nsec = (cputime - (NTFS_TIME_OFFSET) - - (s64)spec.tv_sec*10000000)*100; - /* force zero nsec for overflowing dates */ - if ((spec.tv_nsec < 0) || (spec.tv_nsec > 999999999)) - spec.tv_nsec = 0; - return (spec); -} - -/** - * timespec2ntfs - Convert Linux time to NTFS time - * @utc_time: Linux time to convert to NTFS - * - * Convert the Linux time @utc_time to its corresponding NTFS time. - * - * Linux stores time in a long at present and measures it as the number of - * 1-second intervals since 1st January 1970, 00:00:00 UTC - * with a separated non-negative nanosecond value - * - * NTFS uses Microsoft's standard time format which is stored in a sle64 and is - * measured as the number of 100 nano-second intervals since 1st January 1601, - * 00:00:00 UTC. - * - * Return: An NTFS time (100ns units since Jan 1601) - */ -static __inline__ ntfs_time timespec2ntfs(struct timespec spec) -{ - s64 units; - - units = (s64)spec.tv_sec * 10000000 - + NTFS_TIME_OFFSET + spec.tv_nsec/100; - return (cpu_to_le64(units)); -} - -/* - * Return the current time in ntfs format - */ - -static __inline__ ntfs_time ntfs_current_time(void) -{ - struct timespec now; - -#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_SYS_CLOCK_GETTIME) - clock_gettime(CLOCK_REALTIME, &now); -#elif defined(HAVE_GETTIMEOFDAY) - struct timeval microseconds; - - gettimeofday(µseconds, (struct timezone*)NULL); - now.tv_sec = microseconds.tv_sec; - now.tv_nsec = microseconds.tv_usec*1000; -#else - now.tv_sec = time((time_t*)NULL); - now.tv_nsec = 0; -#endif - return (timespec2ntfs(now)); -} - -#endif /* _NTFS_NTFSTIME_H */ diff --git a/source/libs/libntfs/object_id.c b/source/libs/libntfs/object_id.c deleted file mode 100644 index 555dd137..00000000 --- a/source/libs/libntfs/object_id.c +++ /dev/null @@ -1,637 +0,0 @@ -/** - * object_id.c - Processing of object ids - * - * This module is part of ntfs-3g library - * - * Copyright (c) 2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef HAVE_SETXATTR -#include -#endif - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#endif - -#include "types.h" -#include "debug.h" -#include "attrib.h" -#include "inode.h" -#include "dir.h" -#include "volume.h" -#include "mft.h" -#include "index.h" -#include "lcnalloc.h" -#include "object_id.h" -#include "logging.h" -#include "misc.h" - -/* - * Endianness considerations - * - * According to RFC 4122, GUIDs should be printed with the most - * significant byte first, and the six fields be compared individually - * for ordering. RFC 4122 does not define the internal representation. - * - * Here we always copy disk images with no endianness change, - * and, for indexing, GUIDs are compared as if they were a sequence - * of four unsigned 32 bit integers. - * - * --------------------- begin from RFC 4122 ---------------------- - * Consider each field of the UUID to be an unsigned integer as shown - * in the table in section Section 4.1.2. Then, to compare a pair of - * UUIDs, arithmetically compare the corresponding fields from each - * UUID in order of significance and according to their data type. - * Two UUIDs are equal if and only if all the corresponding fields - * are equal. - * - * UUIDs, as defined in this document, can also be ordered - * lexicographically. For a pair of UUIDs, the first one follows the - * second if the most significant field in which the UUIDs differ is - * greater for the first UUID. The second precedes the first if the - * most significant field in which the UUIDs differ is greater for - * the second UUID. - * - * The fields are encoded as 16 octets, with the sizes and order of the - * fields defined above, and with each field encoded with the Most - * Significant Byte first (known as network byte order). Note that the - * field names, particularly for multiplexed fields, follow historical - * practice. - * - * 0 1 2 3 - * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | time_low | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | time_mid | time_hi_and_version | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * |clk_seq_hi_res | clk_seq_low | node (0-1) | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | node (2-5) | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * - * ---------------------- end from RFC 4122 ----------------------- - */ - -typedef struct { - GUID object_id; -} OBJECT_ID_INDEX_KEY; - -typedef struct { - le64 file_id; - GUID birth_volume_id; - GUID birth_object_id; - GUID domain_id; -} OBJECT_ID_INDEX_DATA; // known as OBJ_ID_INDEX_DATA - -struct OBJECT_ID_INDEX { /* index entry in $Extend/$ObjId */ - INDEX_ENTRY_HEADER header; - OBJECT_ID_INDEX_KEY key; - OBJECT_ID_INDEX_DATA data; -} ; - -static ntfschar objid_index_name[] = { const_cpu_to_le16('$'), - const_cpu_to_le16('O') }; -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Set the index for a new object id - * - * Returns 0 if success - * -1 if failure, explained by errno - */ - -static int set_object_id_index(ntfs_inode *ni, ntfs_index_context *xo, - const OBJECT_ID_ATTR *object_id) -{ - struct OBJECT_ID_INDEX indx; - u64 file_id_cpu; - le64 file_id; - le16 seqn; - - seqn = ni->mrec->sequence_number; - file_id_cpu = MK_MREF(ni->mft_no,le16_to_cpu(seqn)); - file_id = cpu_to_le64(file_id_cpu); - indx.header.data_offset = const_cpu_to_le16( - sizeof(INDEX_ENTRY_HEADER) - + sizeof(OBJECT_ID_INDEX_KEY)); - indx.header.data_length = const_cpu_to_le16( - sizeof(OBJECT_ID_INDEX_DATA)); - indx.header.reservedV = const_cpu_to_le32(0); - indx.header.length = const_cpu_to_le16( - sizeof(struct OBJECT_ID_INDEX)); - indx.header.key_length = const_cpu_to_le16( - sizeof(OBJECT_ID_INDEX_KEY)); - indx.header.flags = const_cpu_to_le16(0); - indx.header.reserved = const_cpu_to_le16(0); - - memcpy(&indx.key.object_id,object_id,sizeof(GUID)); - - indx.data.file_id = file_id; - memcpy(&indx.data.birth_volume_id, - &object_id->birth_volume_id,sizeof(GUID)); - memcpy(&indx.data.birth_object_id, - &object_id->birth_object_id,sizeof(GUID)); - memcpy(&indx.data.domain_id, - &object_id->domain_id,sizeof(GUID)); - ntfs_index_ctx_reinit(xo); - return (ntfs_ie_add(xo,(INDEX_ENTRY*)&indx)); -} - -#endif /* HAVE_SETXATTR */ - -/* - * Open the $Extend/$ObjId file and its index - * - * Return the index context if opened - * or NULL if an error occurred (errno tells why) - * - * The index has to be freed and inode closed when not needed any more. - */ - -static ntfs_index_context *open_object_id_index(ntfs_volume *vol) -{ - u64 inum; - ntfs_inode *ni; - ntfs_inode *dir_ni; - ntfs_index_context *xo; - - /* do not use path_name_to inode - could reopen root */ - dir_ni = ntfs_inode_open(vol, FILE_Extend); - ni = (ntfs_inode*)NULL; - if (dir_ni) { - inum = ntfs_inode_lookup_by_mbsname(dir_ni,"$ObjId"); - if (inum != (u64)-1) - ni = ntfs_inode_open(vol, inum); - ntfs_inode_close(dir_ni); - } - if (ni) { - xo = ntfs_index_ctx_get(ni, objid_index_name, 2); - if (!xo) { - ntfs_inode_close(ni); - } - } else - xo = (ntfs_index_context*)NULL; - return (xo); -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Merge object_id data stored in the index into - * a full object_id struct. - * - * returns 0 if merging successful - * -1 if no data could be merged. This is generally not an error - */ - -static int merge_index_data(ntfs_inode *ni, - const OBJECT_ID_ATTR *objectid_attr, - OBJECT_ID_ATTR *full_objectid) -{ - OBJECT_ID_INDEX_KEY key; - struct OBJECT_ID_INDEX *entry; - ntfs_index_context *xo; - ntfs_inode *xoni; - int res; - - res = -1; - xo = open_object_id_index(ni->vol); - if (xo) { - memcpy(&key.object_id,objectid_attr,sizeof(GUID)); - if (!ntfs_index_lookup(&key, - sizeof(OBJECT_ID_INDEX_KEY), xo)) { - entry = (struct OBJECT_ID_INDEX*)xo->entry; - /* make sure inode numbers match */ - if (entry - && (MREF(le64_to_cpu(entry->data.file_id)) - == ni->mft_no)) { - memcpy(&full_objectid->birth_volume_id, - &entry->data.birth_volume_id, - sizeof(GUID)); - memcpy(&full_objectid->birth_object_id, - &entry->data.birth_object_id, - sizeof(GUID)); - memcpy(&full_objectid->domain_id, - &entry->data.domain_id, - sizeof(GUID)); - res = 0; - } - } - xoni = xo->ni; - ntfs_index_ctx_put(xo); - ntfs_inode_close(xoni); - } - return (res); -} - -#endif /* HAVE_SETXATTR */ - -/* - * Remove an object id index entry if attribute present - * - * Returns the size of existing object id - * (the existing object_d is returned) - * -1 if failure, explained by errno - */ - -static int remove_object_id_index(ntfs_attr *na, ntfs_index_context *xo, - OBJECT_ID_ATTR *old_attr) -{ - OBJECT_ID_INDEX_KEY key; - struct OBJECT_ID_INDEX *entry; - s64 size; - int ret; - - ret = na->data_size; - if (ret) { - /* read the existing object id attribute */ - size = ntfs_attr_pread(na, 0, sizeof(GUID), old_attr); - if (size >= (s64)sizeof(GUID)) { - memcpy(&key.object_id, - &old_attr->object_id,sizeof(GUID)); - size = sizeof(GUID); - if (!ntfs_index_lookup(&key, - sizeof(OBJECT_ID_INDEX_KEY), xo)) { - entry = (struct OBJECT_ID_INDEX*)xo->entry; - memcpy(&old_attr->birth_volume_id, - &entry->data.birth_volume_id, - sizeof(GUID)); - memcpy(&old_attr->birth_object_id, - &entry->data.birth_object_id, - sizeof(GUID)); - memcpy(&old_attr->domain_id, - &entry->data.domain_id, - sizeof(GUID)); - size = sizeof(OBJECT_ID_ATTR); - if (ntfs_index_rm(xo)) - ret = -1; - } - } else { - ret = -1; - errno = ENODATA; - } - } - return (ret); -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Update the object id and index - * - * The object_id attribute should have been created and the - * non-duplication of the GUID should have been checked before. - * - * Returns 0 if success - * -1 if failure, explained by errno - * If could not remove the existing index, nothing is done, - * If could not write the new data, no index entry is inserted - * If failed to insert the index, data is removed - */ - -static int update_object_id(ntfs_inode *ni, ntfs_index_context *xo, - const OBJECT_ID_ATTR *value, size_t size) -{ - OBJECT_ID_ATTR old_attr; - ntfs_attr *na; - int oldsize; - int written; - int res; - - res = 0; - - na = ntfs_attr_open(ni, AT_OBJECT_ID, AT_UNNAMED, 0); - if (na) { - - /* remove the existing index entry */ - oldsize = remove_object_id_index(na,xo,&old_attr); - if (oldsize < 0) - res = -1; - else { - /* resize attribute */ - res = ntfs_attr_truncate(na, (s64)sizeof(GUID)); - /* write the object_id in attribute */ - if (!res && value) { - written = (int)ntfs_attr_pwrite(na, - (s64)0, (s64)sizeof(GUID), - &value->object_id); - if (written != (s64)sizeof(GUID)) { - ntfs_log_error("Failed to update " - "object id\n"); - errno = EIO; - res = -1; - } - } - /* write index part if provided */ - if (!res - && ((size < sizeof(OBJECT_ID_ATTR)) - || set_object_id_index(ni,xo,value))) { - /* - * If cannot index, try to remove the object - * id and log the error. There will be an - * inconsistency if removal fails. - */ - ntfs_attr_rm(na); - ntfs_log_error("Failed to index object id." - " Possible corruption.\n"); - } - } - ntfs_attr_close(na); - NInoSetDirty(ni); - } else - res = -1; - return (res); -} - -/* - * Add a (dummy) object id to an inode if it does not exist - * - * returns 0 if attribute was inserted (or already present) - * -1 if adding failed (explained by errno) - */ - -static int add_object_id(ntfs_inode *ni, int flags) -{ - int res; - u8 dummy; - - res = -1; /* default return */ - if (!ntfs_attr_exist(ni,AT_OBJECT_ID, AT_UNNAMED,0)) { - if (!(flags & XATTR_REPLACE)) { - /* - * no object id attribute : add one, - * apparently, this does not feed the new value in - * Note : NTFS version must be >= 3 - */ - if (ni->vol->major_ver >= 3) { - res = ntfs_attr_add(ni, AT_OBJECT_ID, - AT_UNNAMED, 0, &dummy, (s64)0); - NInoSetDirty(ni); - } else - errno = EOPNOTSUPP; - } else - errno = ENODATA; - } else { - if (flags & XATTR_CREATE) - errno = EEXIST; - else - res = 0; - } - return (res); -} - -#endif /* HAVE_SETXATTR */ - -/* - * Delete an object_id index entry - * - * Returns 0 if success - * -1 if failure, explained by errno - */ - -int ntfs_delete_object_id_index(ntfs_inode *ni) -{ - ntfs_index_context *xo; - ntfs_inode *xoni; - ntfs_attr *na; - OBJECT_ID_ATTR old_attr; - int res; - - res = 0; - na = ntfs_attr_open(ni, AT_OBJECT_ID, AT_UNNAMED, 0); - if (na) { - /* - * read the existing object id - * and un-index it - */ - xo = open_object_id_index(ni->vol); - if (xo) { - if (remove_object_id_index(na,xo,&old_attr) < 0) - res = -1; - xoni = xo->ni; - ntfs_index_entry_mark_dirty(xo); - NInoSetDirty(xoni); - ntfs_index_ctx_put(xo); - ntfs_inode_close(xoni); - } - ntfs_attr_close(na); - } - return (res); -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Get the ntfs object id into an extended attribute - * - * If present, the object_id from the attribute and the GUIDs - * from the index are returned (formatted as OBJECT_ID_ATTR) - * - * Returns the global size (can be 0, 16 or 64) - * and the buffer is updated if it is long enough - */ - -int ntfs_get_ntfs_object_id(ntfs_inode *ni, char *value, size_t size) -{ - OBJECT_ID_ATTR full_objectid; - OBJECT_ID_ATTR *objectid_attr; - s64 attr_size; - int full_size; - - full_size = 0; /* default to no data and some error to be defined */ - if (ni) { - objectid_attr = (OBJECT_ID_ATTR*)ntfs_attr_readall(ni, - AT_OBJECT_ID,(ntfschar*)NULL, 0, &attr_size); - if (objectid_attr) { - /* restrict to only GUID present in attr */ - if (attr_size == sizeof(GUID)) { - memcpy(&full_objectid.object_id, - objectid_attr,sizeof(GUID)); - full_size = sizeof(GUID); - /* get data from index, if any */ - if (!merge_index_data(ni, objectid_attr, - &full_objectid)) { - full_size = sizeof(OBJECT_ID_ATTR); - } - if (full_size <= (s64)size) { - if (value) - memcpy(value,&full_objectid, - full_size); - else - errno = EINVAL; - } - } else { - /* unexpected size, better return unsupported */ - errno = EOPNOTSUPP; - full_size = 0; - } - free(objectid_attr); - } else - errno = ENODATA; - } - return (full_size ? (int)full_size : -errno); -} - -/* - * Set the object id from an extended attribute - * - * If the size is 64, the attribute and index are set. - * else if the size is not less than 16 only the attribute is set. - * The object id index is set accordingly. - * - * Returns 0, or -1 if there is a problem - */ - -int ntfs_set_ntfs_object_id(ntfs_inode *ni, - const char *value, size_t size, int flags) -{ - OBJECT_ID_INDEX_KEY key; - ntfs_inode *xoni; - ntfs_index_context *xo; - int res; - - res = 0; - if (ni && value && (size >= sizeof(GUID))) { - xo = open_object_id_index(ni->vol); - if (xo) { - /* make sure the GUID was not used somewhere */ - memcpy(&key.object_id, value, sizeof(GUID)); - if (ntfs_index_lookup(&key, - sizeof(OBJECT_ID_INDEX_KEY), xo)) { - ntfs_index_ctx_reinit(xo); - res = add_object_id(ni, flags); - if (!res) { - /* update value and index */ - res = update_object_id(ni,xo, - (const OBJECT_ID_ATTR*)value, - size); - } - } else { - /* GUID is present elsewhere */ - res = -1; - errno = EEXIST; - } - xoni = xo->ni; - ntfs_index_entry_mark_dirty(xo); - NInoSetDirty(xoni); - ntfs_index_ctx_put(xo); - ntfs_inode_close(xoni); - } else { - res = -1; - } - } else { - errno = EINVAL; - res = -1; - } - return (res ? -1 : 0); -} - -/* - * Remove the object id - * - * Returns 0, or -1 if there is a problem - */ - -int ntfs_remove_ntfs_object_id(ntfs_inode *ni) -{ - int res; - int olderrno; - ntfs_attr *na; - ntfs_inode *xoni; - ntfs_index_context *xo; - int oldsize; - OBJECT_ID_ATTR old_attr; - - res = 0; - if (ni) { - /* - * open and delete the object id - */ - na = ntfs_attr_open(ni, AT_OBJECT_ID, - AT_UNNAMED,0); - if (na) { - /* first remove index (old object id needed) */ - xo = open_object_id_index(ni->vol); - if (xo) { - oldsize = remove_object_id_index(na,xo, - &old_attr); - if (oldsize < 0) { - res = -1; - } else { - /* now remove attribute */ - res = ntfs_attr_rm(na); - if (res - && (oldsize > (int)sizeof(GUID))) { - /* - * If we could not remove the - * attribute, try to restore the - * index and log the error. There - * will be an inconsistency if - * the reindexing fails. - */ - set_object_id_index(ni, xo, - &old_attr); - ntfs_log_error( - "Failed to remove object id." - " Possible corruption.\n"); - } - } - - xoni = xo->ni; - ntfs_index_entry_mark_dirty(xo); - NInoSetDirty(xoni); - ntfs_index_ctx_put(xo); - ntfs_inode_close(xoni); - } - olderrno = errno; - ntfs_attr_close(na); - /* avoid errno pollution */ - if (errno == ENOENT) - errno = olderrno; - } else { - errno = ENODATA; - res = -1; - } - NInoSetDirty(ni); - } else { - errno = EINVAL; - res = -1; - } - return (res ? -1 : 0); -} - -#endif /* HAVE_SETXATTR */ diff --git a/source/libs/libntfs/object_id.h b/source/libs/libntfs/object_id.h deleted file mode 100644 index 31af9fd8..00000000 --- a/source/libs/libntfs/object_id.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * Copyright (c) 2008 Jean-Pierre Andre - * - */ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef OBJECT_ID_H -#define OBJECT_ID_H - -int ntfs_get_ntfs_object_id(ntfs_inode *ni, char *value, size_t size); - -int ntfs_set_ntfs_object_id(ntfs_inode *ni, const char *value, - size_t size, int flags); -int ntfs_remove_ntfs_object_id(ntfs_inode *ni); - -int ntfs_delete_object_id_index(ntfs_inode *ni); - -#endif /* OBJECT_ID_H */ diff --git a/source/libs/libntfs/param.h b/source/libs/libntfs/param.h deleted file mode 100644 index f21bd653..00000000 --- a/source/libs/libntfs/param.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * param.h - Parameter values for ntfs-3g - * - * Copyright (c) 2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_PARAM_H -#define _NTFS_PARAM_H - -#define CACHE_INODE_SIZE 32 /* inode cache, zero or >= 3 and not too big */ -#define CACHE_NIDATA_SIZE 64 /* idata cache, zero or >= 3 and not too big */ -#define CACHE_LOOKUP_SIZE 64 /* lookup cache, zero or >= 3 and not too big */ -#define CACHE_SECURID_SIZE 16 /* securid cache, zero or >= 3 and not too big */ -#define CACHE_LEGACY_SIZE 8 /* legacy cache size, zero or >= 3 and not too big */ - -#define FORCE_FORMAT_v1x 0 /* Insert security data as in NTFS v1.x */ -#define OWNERFROMACL 1 /* Get the owner from ACL (not Windows owner) */ - - /* default security sub-authorities */ -enum { - DEFSECAUTH1 = -1153374643, /* 3141592653 */ - DEFSECAUTH2 = 589793238, - DEFSECAUTH3 = 462843383, - DEFSECBASE = 10000 -}; - -/* - * Parameters for compression - */ - - /* default option for compression */ -#define DEFAULT_COMPRESSION FALSE - /* (log2 of) number of clusters in a compression block for new files */ -#define STANDARD_COMPRESSION_UNIT 4 - /* maximum cluster size for allowing compression for new files */ -#define MAX_COMPRESSION_CLUSTER_SIZE 4096 - -/* - * Permission checking modes for high level and low level - * - * The choices for high and low lowel are independent, they have - * no effect on the library - * - * Stick to the recommended values unless you understand the consequences - * on protection and performances. Use of cacheing is good for - * performances, but bad on security. - * - * Possible values for high level : - * 1 : no cache, kernel control (recommended) - * 4 : no cache, file system control - * 7 : no cache, kernel control for ACLs - * - * Possible values for low level : - * 2 : no cache, kernel control - * 3 : use kernel/fuse cache, kernel control - * 5 : no cache, file system control (recommended) - * 8 : no cache, kernel control for ACLs - * - * Use of options 7 and 8 requires a patch to fuse - * When Posix ACLs are selected in the configure options, a value - * of 6 is added in the mount report. - */ - -#define HPERMSCONFIG 1 -#define LPERMSCONFIG 5 - -#endif /* defined _NTFS_PARAM_H */ diff --git a/source/libs/libntfs/reparse.c b/source/libs/libntfs/reparse.c deleted file mode 100644 index 0f6360e1..00000000 --- a/source/libs/libntfs/reparse.c +++ /dev/null @@ -1,1222 +0,0 @@ -/** - * reparse.c - Processing of reparse points - * - * This module is part of ntfs-3g library - * - * Copyright (c) 2008-2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef HAVE_SETXATTR -#include -#endif - -#ifdef HAVE_SYS_SYSMACROS_H -#include -#endif - -#include "types.h" -#include "debug.h" -#include "attrib.h" -#include "inode.h" -#include "dir.h" -#include "volume.h" -#include "mft.h" -#include "index.h" -#include "lcnalloc.h" -#include "logging.h" -#include "misc.h" -#include "reparse.h" - -/* the definitions in layout.h are wrong, we use names defined in - http://msdn.microsoft.com/en-us/library/aa365740(VS.85).aspx -*/ - -#define IO_REPARSE_TAG_DFS const_cpu_to_le32(0x8000000A) -#define IO_REPARSE_TAG_DFSR const_cpu_to_le32(0x80000012) -#define IO_REPARSE_TAG_HSM const_cpu_to_le32(0xC0000004) -#define IO_REPARSE_TAG_HSM2 const_cpu_to_le32(0x80000006) -#define IO_REPARSE_TAG_MOUNT_POINT const_cpu_to_le32(0xA0000003) -#define IO_REPARSE_TAG_SIS const_cpu_to_le32(0x80000007) -#define IO_REPARSE_TAG_SYMLINK const_cpu_to_le32(0xA000000C) - -struct MOUNT_POINT_REPARSE_DATA { /* reparse data for junctions */ - le16 subst_name_offset; - le16 subst_name_length; - le16 print_name_offset; - le16 print_name_length; - char path_buffer[0]; /* above data assume this is char array */ -} ; - -struct SYMLINK_REPARSE_DATA { /* reparse data for symlinks */ - le16 subst_name_offset; - le16 subst_name_length; - le16 print_name_offset; - le16 print_name_length; - le32 flags; /* 1 for full target, otherwise 0 */ - char path_buffer[0]; /* above data assume this is char array */ -} ; - -struct REPARSE_INDEX { /* index entry in $Extend/$Reparse */ - INDEX_ENTRY_HEADER header; - REPARSE_INDEX_KEY key; - le32 filling; -} ; - -static const ntfschar dir_junction_head[] = { - const_cpu_to_le16('\\'), - const_cpu_to_le16('?'), - const_cpu_to_le16('?'), - const_cpu_to_le16('\\') -} ; - -static const ntfschar vol_junction_head[] = { - const_cpu_to_le16('\\'), - const_cpu_to_le16('?'), - const_cpu_to_le16('?'), - const_cpu_to_le16('\\'), - const_cpu_to_le16('V'), - const_cpu_to_le16('o'), - const_cpu_to_le16('l'), - const_cpu_to_le16('u'), - const_cpu_to_le16('m'), - const_cpu_to_le16('e'), - const_cpu_to_le16('{'), -} ; - -static ntfschar reparse_index_name[] = { const_cpu_to_le16('$'), - const_cpu_to_le16('R') }; - -static const char mappingdir[] = ".NTFS-3G/"; - -/* - * Fix a file name with doubtful case in some directory index - * and return the name with the casing used in directory. - * - * Should only be used to translate paths stored with case insensitivity - * (such as directory junctions) when no case conflict is expected. - * If there some ambiguity, the name which collates first is returned. - * - * The name is converted to upper case and searched the usual way. - * The collation rules for file names are such that we should get the - * first candidate if any. - */ - -static u64 ntfs_fix_file_name(ntfs_inode *dir_ni, ntfschar *uname, - int uname_len) -{ - ntfs_volume *vol = dir_ni->vol; - ntfs_index_context *icx; - u64 mref; - le64 lemref; - int lkup; - int olderrno; - int i; - u32 cpuchar; - INDEX_ENTRY *entry; - FILE_NAME_ATTR *found; - struct { - FILE_NAME_ATTR attr; - ntfschar file_name[NTFS_MAX_NAME_LEN + 1]; - } find; - - mref = (u64)-1; /* default return (not found) */ - icx = ntfs_index_ctx_get(dir_ni, NTFS_INDEX_I30, 4); - if (icx) { - if (uname_len > NTFS_MAX_NAME_LEN) - uname_len = NTFS_MAX_NAME_LEN; - find.attr.file_name_length = uname_len; - for (i=0; iupcase_len) - && (le16_to_cpu(vol->upcase[cpuchar]) < cpuchar)) - find.attr.file_name[i] = vol->upcase[cpuchar]; - else - find.attr.file_name[i] = uname[i]; - } - olderrno = errno; - lkup = ntfs_index_lookup((char*)&find, uname_len, icx); - if (errno == ENOENT) - errno = olderrno; - /* - * We generally only get the first matching candidate, - * so we still have to check whether this is a real match - */ - if (icx->entry && (icx->entry->ie_flags & INDEX_ENTRY_END)) - /* get next entry if reaching end of block */ - entry = ntfs_index_next(icx->entry, icx); - else - entry = icx->entry; - if (entry) { - found = &entry->key.file_name; - if (lkup - && ntfs_names_are_equal(find.attr.file_name, - find.attr.file_name_length, - found->file_name, found->file_name_length, - IGNORE_CASE, - vol->upcase, vol->upcase_len)) - lkup = 0; - if (!lkup) { - /* - * name found : - * fix original name and return inode - */ - lemref = entry->indexed_file; - mref = le64_to_cpu(lemref); - for (i=0; ifile_name_length; i++) - uname[i] = found->file_name[i]; - } - } - ntfs_index_ctx_put(icx); - } - return (mref); -} - -/* - * Search for a directory junction or a symbolic link - * along the target path, with target defined as a full absolute path - * - * Returns the path translated to a Linux path - * or NULL if the path is not valid - */ - -static char *search_absolute(ntfs_volume *vol, ntfschar *path, - int count, BOOL isdir) -{ - ntfs_inode *ni; - u64 inum; - char *target; - int start; - int len; - - target = (char*)NULL; /* default return */ - ni = ntfs_inode_open(vol, (MFT_REF)FILE_root); - if (ni) { - start = 0; - do { - len = 0; - while (((start + len) < count) - && (path[start + len] != const_cpu_to_le16('\\'))) - len++; - inum = ntfs_fix_file_name(ni, &path[start], len); - ntfs_inode_close(ni); - ni = (ntfs_inode*)NULL; - if (inum != (u64)-1) { - inum = MREF(inum); - ni = ntfs_inode_open(vol, inum); - start += len; - if (start < count) - path[start++] = const_cpu_to_le16('/'); - } - } while (ni - && (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - && (start < count)); - if (ni - && (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY ? isdir : !isdir)) - if (ntfs_ucstombs(path, count, &target, 0) < 0) { - if (target) { - free(target); - target = (char*)NULL; - } - } - if (ni) - ntfs_inode_close(ni); - } - return (target); -} - -/* - * Search for a symbolic link along the target path, - * with the target defined as a relative path - * - * Note : the path used to access the current inode, may be - * different from the one implied in the target definition, - * when an inode has names in several directories. - * - * Returns the path translated to a Linux path - * or NULL if the path is not valid - */ - -static char *search_relative(ntfs_inode *ni, ntfschar *path, int count) -{ - char *target = (char*)NULL; - ntfs_inode *curni; - ntfs_inode *newni; - u64 inum; - int pos; - int lth; - BOOL ok; - int max = 32; /* safety */ - - pos = 0; - ok = TRUE; - curni = ntfs_dir_parent_inode(ni); - while (curni && ok && (pos < (count - 1)) && --max) { - if ((count >= (pos + 2)) - && (path[pos] == const_cpu_to_le16('.')) - && (path[pos+1] == const_cpu_to_le16('\\'))) { - path[1] = const_cpu_to_le16('/'); - pos += 2; - } else { - if ((count >= (pos + 3)) - && (path[pos] == const_cpu_to_le16('.')) - &&(path[pos+1] == const_cpu_to_le16('.')) - && (path[pos+2] == const_cpu_to_le16('\\'))) { - path[2] = const_cpu_to_le16('/'); - pos += 3; - newni = ntfs_dir_parent_inode(curni); - if (curni != ni) - ntfs_inode_close(curni); - curni = newni; - if (!curni) - ok = FALSE; - } else { - lth = 0; - while (((pos + lth) < count) - && (path[pos + lth] != const_cpu_to_le16('\\'))) - lth++; - if (lth > 0) - inum = ntfs_fix_file_name(curni,&path[pos],lth); - else - inum = (u64)-1; - if (!lth - || ((curni != ni) - && ntfs_inode_close(curni)) - || (inum == (u64)-1)) - ok = FALSE; - else { - curni = ntfs_inode_open(ni->vol, MREF(inum)); - if (!curni) - ok = FALSE; - else { - if (ok && ((pos + lth) < count)) { - path[pos + lth] = const_cpu_to_le16('/'); - pos += lth + 1; - } else { - pos += lth; - if ((ni->mrec->flags ^ curni->mrec->flags) - & MFT_RECORD_IS_DIRECTORY) - ok = FALSE; - if (ntfs_inode_close(curni)) - ok = FALSE; - } - } - } - } - } - } - - if (ok && (ntfs_ucstombs(path, count, &target, 0) < 0)) { - free(target); // needed ? - target = (char*)NULL; - } - return (target); -} - -/* - * Check whether a drive letter has been defined in .NTFS-3G - * - * Returns 1 if found, - * 0 if not found, - * -1 if there was an error (described by errno) - */ - -static int ntfs_drive_letter(ntfs_volume *vol, ntfschar letter) -{ - char defines[NTFS_MAX_NAME_LEN + 5]; - char *drive; - int ret; - int sz; - int olderrno; - ntfs_inode *ni; - - ret = -1; - drive = (char*)NULL; - sz = ntfs_ucstombs(&letter, 1, &drive, 0); - if (sz > 0) { - strcpy(defines,mappingdir); - if ((*drive >= 'a') && (*drive <= 'z')) - *drive += 'A' - 'a'; - strcat(defines,drive); - strcat(defines,":"); - olderrno = errno; - ni = ntfs_pathname_to_inode(vol, NULL, defines); - if (ni && !ntfs_inode_close(ni)) - ret = 1; - else - if (errno == ENOENT) { - ret = 0; - /* avoid errno pollution */ - errno = olderrno; - } - } - if (drive) - free(drive); - return (ret); -} - -/* - * Do some sanity checks on reparse data - * - * The only general check is about the size (at least the tag must - * be present) - * If the reparse data looks like a junction point or symbolic - * link, more checks can be done. - * - */ - -static BOOL valid_reparse_data(ntfs_inode *ni, - const REPARSE_POINT *reparse_attr, size_t size) -{ - BOOL ok; - unsigned int offs; - unsigned int lth; - const struct MOUNT_POINT_REPARSE_DATA *mount_point_data; - const struct SYMLINK_REPARSE_DATA *symlink_data; - - ok = ni && reparse_attr - && (size >= sizeof(REPARSE_POINT)) - && (((size_t)le16_to_cpu(reparse_attr->reparse_data_length) - + sizeof(REPARSE_POINT)) == size); - if (ok) { - switch (reparse_attr->reparse_tag) { - case IO_REPARSE_TAG_MOUNT_POINT : - mount_point_data = (const struct MOUNT_POINT_REPARSE_DATA*) - reparse_attr->reparse_data; - offs = le16_to_cpu(mount_point_data->subst_name_offset); - lth = le16_to_cpu(mount_point_data->subst_name_length); - /* consistency checks */ - if (!(ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - || ((size_t)((sizeof(REPARSE_POINT) - + sizeof(struct MOUNT_POINT_REPARSE_DATA) - + offs + lth)) > size)) - ok = FALSE; - break; - case IO_REPARSE_TAG_SYMLINK : - symlink_data = (const struct SYMLINK_REPARSE_DATA*) - reparse_attr->reparse_data; - offs = le16_to_cpu(symlink_data->subst_name_offset); - lth = le16_to_cpu(symlink_data->subst_name_length); - if ((size_t)((sizeof(REPARSE_POINT) - + sizeof(struct SYMLINK_REPARSE_DATA) - + offs + lth)) > size) - ok = FALSE; - break; - default : - break; - } - } - if (!ok) - errno = EINVAL; - return (ok); -} - -/* - * Check and translate the target of a junction point or - * a full absolute symbolic link. - * - * A full target definition begins with "\??\" or "\\?\" - * - * The fully defined target is redefined as a relative link, - * - either to the target if found on the same device. - * - or into the /.NTFS-3G directory for the user to define - * In the first situation, the target is translated to case-sensitive path. - * - * returns the target converted to a relative symlink - * or NULL if there were some problem, as described by errno - */ - -static char *ntfs_get_fulllink(ntfs_volume *vol, ntfschar *junction, - int count, const char *mnt_point, BOOL isdir) -{ - char *target; - char *fulltarget; - int sz; - char *q; - enum { DIR_JUNCTION, VOL_JUNCTION, NO_JUNCTION } kind; - - target = (char*)NULL; - fulltarget = (char*)NULL; - /* - * For a valid directory junction we want \??\x:\ - * where \ is an individual char and x a non-null char - */ - if ((count >= 7) - && !memcmp(junction,dir_junction_head,8) - && junction[4] - && (junction[5] == const_cpu_to_le16(':')) - && (junction[6] == const_cpu_to_le16('\\'))) - kind = DIR_JUNCTION; - else - /* - * For a valid volume junction we want \\?\Volume{ - * and a final \ (where \ is an individual char) - */ - if ((count >= 12) - && !memcmp(junction,vol_junction_head,22) - && (junction[count-1] == const_cpu_to_le16('\\'))) - kind = VOL_JUNCTION; - else - kind = NO_JUNCTION; - /* - * Directory junction with an explicit path and - * no specific definition for the drive letter : - * try to interpret as a target on the same volume - */ - if ((kind == DIR_JUNCTION) - && (count >= 7) - && junction[7] - && !ntfs_drive_letter(vol, junction[4])) { - target = search_absolute(vol,&junction[7],count - 7, isdir); - if (target) { - fulltarget = (char*)ntfs_malloc(strlen(mnt_point) - + strlen(target) + 2); - if (fulltarget) { - strcpy(fulltarget,mnt_point); - strcat(fulltarget,"/"); - strcat(fulltarget,target); - } - free(target); - } - } - /* - * Volume junctions or directory junctions with - * target not found on current volume : - * link to /.NTFS-3G/target which the user can - * define as a symbolic link to the real target - */ - if (((kind == DIR_JUNCTION) && !fulltarget) - || (kind == VOL_JUNCTION)) { - sz = ntfs_ucstombs(&junction[4], - (kind == VOL_JUNCTION ? count - 5 : count - 4), - &target, 0); - if ((sz > 0) && target) { - /* reverse slashes */ - for (q=target; *q; q++) - if (*q == '\\') - *q = '/'; - /* force uppercase drive letter */ - if ((target[1] == ':') - && (target[0] >= 'a') - && (target[0] <= 'z')) - target[0] += 'A' - 'a'; - fulltarget = (char*)ntfs_malloc(strlen(mnt_point) - + sizeof(mappingdir) + strlen(target) + 1); - if (fulltarget) { - strcpy(fulltarget,mnt_point); - strcat(fulltarget,"/"); - strcat(fulltarget,mappingdir); - strcat(fulltarget,target); - } - } - if (target) - free(target); - } - return (fulltarget); -} - -/* - * Check and translate the target of an absolute symbolic link. - * - * An absolute target definition begins with "\" or "x:\" - * - * The absolute target is redefined as a relative link, - * - either to the target if found on the same device. - * - or into the /.NTFS-3G directory for the user to define - * In the first situation, the target is translated to case-sensitive path. - * - * returns the target converted to a relative symlink - * or NULL if there were some problem, as described by errno - */ - -static char *ntfs_get_abslink(ntfs_volume *vol, ntfschar *junction, - int count, const char *mnt_point, BOOL isdir) -{ - char *target; - char *fulltarget; - int sz; - char *q; - enum { FULL_PATH, ABS_PATH, REJECTED_PATH } kind; - - target = (char*)NULL; - fulltarget = (char*)NULL; - /* - * For a full valid path we want x:\ - * where \ is an individual char and x a non-null char - */ - if ((count >= 3) - && junction[0] - && (junction[1] == const_cpu_to_le16(':')) - && (junction[2] == const_cpu_to_le16('\\'))) - kind = FULL_PATH; - else - /* - * For an absolute path we want an initial \ - */ - if ((count >= 0) - && (junction[0] == const_cpu_to_le16('\\'))) - kind = ABS_PATH; - else - kind = REJECTED_PATH; - /* - * Full path, with a drive letter and - * no specific definition for the drive letter : - * try to interpret as a target on the same volume. - * Do the same for an abs path with no drive letter. - */ - if (((kind == FULL_PATH) - && (count >= 3) - && junction[3] - && !ntfs_drive_letter(vol, junction[0])) - || (kind == ABS_PATH)) { - if (kind == ABS_PATH) - target = search_absolute(vol, &junction[1], - count - 1, isdir); - else - target = search_absolute(vol, &junction[3], - count - 3, isdir); - if (target) { - fulltarget = (char*)ntfs_malloc(strlen(mnt_point) - + strlen(target) + 2); - if (fulltarget) { - strcpy(fulltarget,mnt_point); - strcat(fulltarget,"/"); - strcat(fulltarget,target); - } - free(target); - } - } - /* - * full path with target not found on current volume : - * link to /.NTFS-3G/target which the user can - * define as a symbolic link to the real target - */ - if ((kind == FULL_PATH) && !fulltarget) { - sz = ntfs_ucstombs(&junction[0], - count,&target, 0); - if ((sz > 0) && target) { - /* reverse slashes */ - for (q=target; *q; q++) - if (*q == '\\') - *q = '/'; - /* force uppercase drive letter */ - if ((target[1] == ':') - && (target[0] >= 'a') - && (target[0] <= 'z')) - target[0] += 'A' - 'a'; - fulltarget = (char*)ntfs_malloc(strlen(mnt_point) - + sizeof(mappingdir) + strlen(target) + 1); - if (fulltarget) { - strcpy(fulltarget,mnt_point); - strcat(fulltarget,"/"); - strcat(fulltarget,mappingdir); - strcat(fulltarget,target); - } - } - if (target) - free(target); - } - return (fulltarget); -} - -/* - * Check and translate the target of a relative symbolic link. - * - * A relative target definition does not begin with "\" - * - * The original definition of relative target is kept, it is just - * translated to a case-sensitive path. - * - * returns the target converted to a relative symlink - * or NULL if there were some problem, as described by errno - */ - -static char *ntfs_get_rellink(ntfs_inode *ni, ntfschar *junction, int count) -{ - char *target; - - target = search_relative(ni,junction,count); - return (target); -} - -/* - * Get the target for a junction point or symbolic link - * Should only be called for files or directories with reparse data - * - * returns the target converted to a relative path, or NULL - * if some error occurred, as described by errno - * errno is EOPNOTSUPP if the reparse point is not a valid - * symbolic link or directory junction - */ - -char *ntfs_make_symlink(ntfs_inode *ni, const char *mnt_point, - int *pattr_size) -{ - s64 attr_size = 0; - char *target; - unsigned int offs; - unsigned int lth; - ntfs_volume *vol; - REPARSE_POINT *reparse_attr; - struct MOUNT_POINT_REPARSE_DATA *mount_point_data; - struct SYMLINK_REPARSE_DATA *symlink_data; - enum { FULL_TARGET, ABS_TARGET, REL_TARGET } kind; - ntfschar *p; - BOOL bad; - BOOL isdir; - - target = (char*)NULL; - bad = TRUE; - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - != const_cpu_to_le16(0); - vol = ni->vol; - reparse_attr = (REPARSE_POINT*)ntfs_attr_readall(ni, - AT_REPARSE_POINT,(ntfschar*)NULL, 0, &attr_size); - if (reparse_attr && attr_size - && valid_reparse_data(ni, reparse_attr, attr_size)) { - switch (reparse_attr->reparse_tag) { - case IO_REPARSE_TAG_MOUNT_POINT : - mount_point_data = (struct MOUNT_POINT_REPARSE_DATA*) - reparse_attr->reparse_data; - offs = le16_to_cpu(mount_point_data->subst_name_offset); - lth = le16_to_cpu(mount_point_data->subst_name_length); - /* reparse data consistency has been checked */ - target = ntfs_get_fulllink(vol, - (ntfschar*)&mount_point_data->path_buffer[offs], - lth/2, mnt_point, isdir); - if (target) - bad = FALSE; - break; - case IO_REPARSE_TAG_SYMLINK : - symlink_data = (struct SYMLINK_REPARSE_DATA*) - reparse_attr->reparse_data; - offs = le16_to_cpu(symlink_data->subst_name_offset); - lth = le16_to_cpu(symlink_data->subst_name_length); - p = (ntfschar*)&symlink_data->path_buffer[offs]; - /* - * Predetermine the kind of target, - * the called function has to make a full check - */ - if (*p++ == const_cpu_to_le16('\\')) { - if ((*p == const_cpu_to_le16('?')) - || (*p == const_cpu_to_le16('\\'))) - kind = FULL_TARGET; - else - kind = ABS_TARGET; - } else - if (*p == const_cpu_to_le16(':')) - kind = ABS_TARGET; - else - kind = REL_TARGET; - p--; - /* reparse data consistency has been checked */ - switch (kind) { - case FULL_TARGET : - if (!(symlink_data->flags - & const_cpu_to_le32(1))) { - target = ntfs_get_fulllink(vol, - p, lth/2, - mnt_point, isdir); - if (target) - bad = FALSE; - } - break; - case ABS_TARGET : - if (symlink_data->flags - & const_cpu_to_le32(1)) { - target = ntfs_get_abslink(vol, - p, lth/2, - mnt_point, isdir); - if (target) - bad = FALSE; - } - break; - case REL_TARGET : - if (symlink_data->flags - & const_cpu_to_le32(1)) { - target = ntfs_get_rellink(ni, - p, lth/2); - if (target) - bad = FALSE; - } - break; - } - break; - } - free(reparse_attr); - } - *pattr_size = attr_size; - if (bad) - errno = EOPNOTSUPP; - return (target); -} - -/* - * Check whether a reparse point looks like a junction point - * or a symbolic link. - * Should only be called for files or directories with reparse data - * - * The validity of the target is not checked. - */ - -BOOL ntfs_possible_symlink(ntfs_inode *ni) -{ - s64 attr_size = 0; - REPARSE_POINT *reparse_attr; - BOOL possible; - - possible = FALSE; - reparse_attr = (REPARSE_POINT*)ntfs_attr_readall(ni, - AT_REPARSE_POINT,(ntfschar*)NULL, 0, &attr_size); - if (reparse_attr && attr_size) { - switch (reparse_attr->reparse_tag) { - case IO_REPARSE_TAG_MOUNT_POINT : - case IO_REPARSE_TAG_SYMLINK : - possible = TRUE; - default : ; - } - free(reparse_attr); - } - return (possible); -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Set the index for new reparse data - * - * Returns 0 if success - * -1 if failure, explained by errno - */ - -static int set_reparse_index(ntfs_inode *ni, ntfs_index_context *xr, - le32 reparse_tag) -{ - struct REPARSE_INDEX indx; - u64 file_id_cpu; - le64 file_id; - le16 seqn; - - seqn = ni->mrec->sequence_number; - file_id_cpu = MK_MREF(ni->mft_no,le16_to_cpu(seqn)); - file_id = cpu_to_le64(file_id_cpu); - indx.header.data_offset = const_cpu_to_le16( - sizeof(INDEX_ENTRY_HEADER) - + sizeof(REPARSE_INDEX_KEY)); - indx.header.data_length = const_cpu_to_le16(0); - indx.header.reservedV = const_cpu_to_le32(0); - indx.header.length = const_cpu_to_le16( - sizeof(struct REPARSE_INDEX)); - indx.header.key_length = const_cpu_to_le16( - sizeof(REPARSE_INDEX_KEY)); - indx.header.flags = const_cpu_to_le16(0); - indx.header.reserved = const_cpu_to_le16(0); - indx.key.reparse_tag = reparse_tag; - /* danger on processors which require proper alignment ! */ - memcpy(&indx.key.file_id, &file_id, 8); - indx.filling = const_cpu_to_le32(0); - ntfs_index_ctx_reinit(xr); - return (ntfs_ie_add(xr,(INDEX_ENTRY*)&indx)); -} - -#endif /* HAVE_SETXATTR */ - -/* - * Remove a reparse data index entry if attribute present - * - * Returns the size of existing reparse data - * (the existing reparse tag is returned) - * -1 if failure, explained by errno - */ - -static int remove_reparse_index(ntfs_attr *na, ntfs_index_context *xr, - le32 *preparse_tag) -{ - REPARSE_INDEX_KEY key; - u64 file_id_cpu; - le64 file_id; - s64 size; - le16 seqn; - int ret; - - ret = na->data_size; - if (ret) { - /* read the existing reparse_tag */ - size = ntfs_attr_pread(na, 0, 4, preparse_tag); - if (size == 4) { - seqn = na->ni->mrec->sequence_number; - file_id_cpu = MK_MREF(na->ni->mft_no,le16_to_cpu(seqn)); - file_id = cpu_to_le64(file_id_cpu); - key.reparse_tag = *preparse_tag; - /* danger on processors which require proper alignment ! */ - memcpy(&key.file_id, &file_id, 8); - if (!ntfs_index_lookup(&key, sizeof(REPARSE_INDEX_KEY), xr) - && ntfs_index_rm(xr)) - ret = -1; - } else { - ret = -1; - errno = ENODATA; - } - } - return (ret); -} - -/* - * Open the $Extend/$Reparse file and its index - * - * Return the index context if opened - * or NULL if an error occurred (errno tells why) - * - * The index has to be freed and inode closed when not needed any more. - */ - -static ntfs_index_context *open_reparse_index(ntfs_volume *vol) -{ - u64 inum; - ntfs_inode *ni; - ntfs_inode *dir_ni; - ntfs_index_context *xr; - - /* do not use path_name_to inode - could reopen root */ - dir_ni = ntfs_inode_open(vol, FILE_Extend); - ni = (ntfs_inode*)NULL; - if (dir_ni) { - inum = ntfs_inode_lookup_by_mbsname(dir_ni,"$Reparse"); - if (inum != (u64)-1) - ni = ntfs_inode_open(vol, inum); - ntfs_inode_close(dir_ni); - } - if (ni) { - xr = ntfs_index_ctx_get(ni, reparse_index_name, 2); - if (!xr) { - ntfs_inode_close(ni); - } - } else - xr = (ntfs_index_context*)NULL; - return (xr); -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Update the reparse data and index - * - * The reparse data attribute should have been created, and - * an existing index is expected if there is an existing value. - * - * Returns 0 if success - * -1 if failure, explained by errno - * If could not remove the existing index, nothing is done, - * If could not write the new data, no index entry is inserted - * If failed to insert the index, data is removed - */ - -static int update_reparse_data(ntfs_inode *ni, ntfs_index_context *xr, - const char *value, size_t size) -{ - int res; - int written; - int oldsize; - ntfs_attr *na; - le32 reparse_tag; - - res = 0; - na = ntfs_attr_open(ni, AT_REPARSE_POINT, AT_UNNAMED, 0); - if (na) { - /* remove the existing reparse data */ - oldsize = remove_reparse_index(na,xr,&reparse_tag); - if (oldsize < 0) - res = -1; - else { - /* resize attribute */ - res = ntfs_attr_truncate(na, (s64)size); - /* overwrite value if any */ - if (!res && value) { - written = (int)ntfs_attr_pwrite(na, - (s64)0, (s64)size, value); - if (written != (s64)size) { - ntfs_log_error("Failed to update " - "reparse data\n"); - errno = EIO; - res = -1; - } - } - if (!res - && set_reparse_index(ni,xr, - ((const REPARSE_POINT*)value)->reparse_tag) - && (oldsize > 0)) { - /* - * If cannot index, try to remove the reparse - * data and log the error. There will be an - * inconsistency if removal fails. - */ - ntfs_attr_rm(na); - ntfs_log_error("Failed to index reparse data." - " Possible corruption.\n"); - } - } - ntfs_attr_close(na); - NInoSetDirty(ni); - } else - res = -1; - return (res); -} - -#endif /* HAVE_SETXATTR */ - -/* - * Delete a reparse index entry - * - * Returns 0 if success - * -1 if failure, explained by errno - */ - -int ntfs_delete_reparse_index(ntfs_inode *ni) -{ - ntfs_index_context *xr; - ntfs_inode *xrni; - ntfs_attr *na; - le32 reparse_tag; - int res; - - res = 0; - na = ntfs_attr_open(ni, AT_REPARSE_POINT, AT_UNNAMED, 0); - if (na) { - /* - * read the existing reparse data (the tag is enough) - * and un-index it - */ - xr = open_reparse_index(ni->vol); - if (xr) { - if (remove_reparse_index(na,xr,&reparse_tag) < 0) - res = -1; - xrni = xr->ni; - ntfs_index_entry_mark_dirty(xr); - NInoSetDirty(xrni); - ntfs_index_ctx_put(xr); - ntfs_inode_close(xrni); - } - ntfs_attr_close(na); - } - return (res); -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Get the ntfs reparse data into an extended attribute - * - * Returns the reparse data size - * and the buffer is updated if it is long enough - */ - -int ntfs_get_ntfs_reparse_data(ntfs_inode *ni, char *value, size_t size) -{ - REPARSE_POINT *reparse_attr; - s64 attr_size; - - attr_size = 0; /* default to no data and no error */ - if (ni) { - if (ni->flags & FILE_ATTR_REPARSE_POINT) { - reparse_attr = (REPARSE_POINT*)ntfs_attr_readall(ni, - AT_REPARSE_POINT,(ntfschar*)NULL, 0, &attr_size); - if (reparse_attr) { - if (attr_size <= (s64)size) { - if (value) - memcpy(value,reparse_attr, - attr_size); - else - errno = EINVAL; - } - free(reparse_attr); - } - } else - errno = ENODATA; - } - return (attr_size ? (int)attr_size : -errno); -} - -/* - * Set the reparse data from an extended attribute - * - * Warning : the new data is not checked - * - * Returns 0, or -1 if there is a problem - */ - -int ntfs_set_ntfs_reparse_data(ntfs_inode *ni, - const char *value, size_t size, int flags) -{ - int res; - u8 dummy; - ntfs_inode *xrni; - ntfs_index_context *xr; - - res = 0; - if (ni && valid_reparse_data(ni, (const REPARSE_POINT*)value, size)) { - xr = open_reparse_index(ni->vol); - if (xr) { - if (!ntfs_attr_exist(ni,AT_REPARSE_POINT, - AT_UNNAMED,0)) { - if (!(flags & XATTR_REPLACE)) { - /* - * no reparse data attribute : add one, - * apparently, this does not feed the new value in - * Note : NTFS version must be >= 3 - */ - if (ni->vol->major_ver >= 3) { - res = ntfs_attr_add(ni, - AT_REPARSE_POINT, - AT_UNNAMED,0,&dummy, - (s64)0); - if (!res) { - ni->flags |= - FILE_ATTR_REPARSE_POINT; - NInoFileNameSetDirty(ni); - } - NInoSetDirty(ni); - } else { - errno = EOPNOTSUPP; - res = -1; - } - } else { - errno = ENODATA; - res = -1; - } - } else { - if (flags & XATTR_CREATE) { - errno = EEXIST; - res = -1; - } - } - if (!res) { - /* update value and index */ - res = update_reparse_data(ni,xr,value,size); - } - xrni = xr->ni; - ntfs_index_entry_mark_dirty(xr); - NInoSetDirty(xrni); - ntfs_index_ctx_put(xr); - ntfs_inode_close(xrni); - } else { - res = -1; - } - } else { - errno = EINVAL; - res = -1; - } - return (res ? -1 : 0); -} - -/* - * Remove the reparse data - * - * Returns 0, or -1 if there is a problem - */ - -int ntfs_remove_ntfs_reparse_data(ntfs_inode *ni) -{ - int res; - int olderrno; - ntfs_attr *na; - ntfs_inode *xrni; - ntfs_index_context *xr; - le32 reparse_tag; - - res = 0; - if (ni) { - /* - * open and delete the reparse data - */ - na = ntfs_attr_open(ni, AT_REPARSE_POINT, - AT_UNNAMED,0); - if (na) { - /* first remove index (reparse data needed) */ - xr = open_reparse_index(ni->vol); - if (xr) { - if (remove_reparse_index(na,xr, - &reparse_tag) < 0) { - res = -1; - } else { - /* now remove attribute */ - res = ntfs_attr_rm(na); - if (!res) { - ni->flags &= - ~FILE_ATTR_REPARSE_POINT; - NInoFileNameSetDirty(ni); - } else { - /* - * If we could not remove the - * attribute, try to restore the - * index and log the error. There - * will be an inconsistency if - * the reindexing fails. - */ - set_reparse_index(ni, xr, - reparse_tag); - ntfs_log_error( - "Failed to remove reparse data." - " Possible corruption.\n"); - } - } - xrni = xr->ni; - ntfs_index_entry_mark_dirty(xr); - NInoSetDirty(xrni); - ntfs_index_ctx_put(xr); - ntfs_inode_close(xrni); - } - olderrno = errno; - ntfs_attr_close(na); - /* avoid errno pollution */ - if (errno == ENOENT) - errno = olderrno; - } else { - errno = ENODATA; - res = -1; - } - NInoSetDirty(ni); - } else { - errno = EINVAL; - res = -1; - } - return (res ? -1 : 0); -} - -#endif /* HAVE_SETXATTR */ diff --git a/source/libs/libntfs/reparse.h b/source/libs/libntfs/reparse.h deleted file mode 100644 index 35f4aa45..00000000 --- a/source/libs/libntfs/reparse.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright (c) 2008 Jean-Pierre Andre - * - */ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef REPARSE_H -#define REPARSE_H - -char *ntfs_make_symlink(ntfs_inode *ni, const char *mnt_point, - int *pattr_size); -BOOL ntfs_possible_symlink(ntfs_inode *ni); - -int ntfs_get_ntfs_reparse_data(ntfs_inode *ni, char *value, size_t size); - -int ntfs_set_ntfs_reparse_data(ntfs_inode *ni, const char *value, - size_t size, int flags); -int ntfs_remove_ntfs_reparse_data(ntfs_inode *ni); - -int ntfs_delete_reparse_index(ntfs_inode *ni); - -#endif /* REPARSE_H */ diff --git a/source/libs/libntfs/runlist.c b/source/libs/libntfs/runlist.c deleted file mode 100644 index cea24672..00000000 --- a/source/libs/libntfs/runlist.c +++ /dev/null @@ -1,2181 +0,0 @@ -/** - * runlist.c - Run list handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002-2005 Anton Altaparmakov - * Copyright (c) 2002-2005 Richard Russon - * Copyright (c) 2002-2008 Szabolcs Szakacsits - * Copyright (c) 2004 Yura Pakhuchiy - * Copyright (c) 2007-2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif - -#include "compat.h" -#include "types.h" -#include "volume.h" -#include "layout.h" -#include "debug.h" -#include "device.h" -#include "logging.h" -#include "misc.h" - -/** - * ntfs_rl_mm - runlist memmove - * @base: - * @dst: - * @src: - * @size: - * - * Description... - * - * Returns: - */ -static void ntfs_rl_mm(runlist_element *base, int dst, int src, int size) -{ - if ((dst != src) && (size > 0)) - memmove(base + dst, base + src, size * sizeof(*base)); -} - -/** - * ntfs_rl_mc - runlist memory copy - * @dstbase: - * @dst: - * @srcbase: - * @src: - * @size: - * - * Description... - * - * Returns: - */ -static void ntfs_rl_mc(runlist_element *dstbase, int dst, - runlist_element *srcbase, int src, int size) -{ - if (size > 0) - memcpy(dstbase + dst, srcbase + src, size * sizeof(*dstbase)); -} - -/** - * ntfs_rl_realloc - Reallocate memory for runlists - * @rl: original runlist - * @old_size: number of runlist elements in the original runlist @rl - * @new_size: number of runlist elements we need space for - * - * As the runlists grow, more memory will be required. To prevent large - * numbers of small reallocations of memory, this function returns a 4kiB block - * of memory. - * - * N.B. If the new allocation doesn't require a different number of 4kiB - * blocks in memory, the function will return the original pointer. - * - * On success, return a pointer to the newly allocated, or recycled, memory. - * On error, return NULL with errno set to the error code. - */ -static runlist_element *ntfs_rl_realloc(runlist_element *rl, int old_size, - int new_size) -{ - old_size = (old_size * sizeof(runlist_element) + 0xfff) & ~0xfff; - new_size = (new_size * sizeof(runlist_element) + 0xfff) & ~0xfff; - if (old_size == new_size) - return rl; - return realloc(rl, new_size); -} - -/* - * Extend a runlist by some entry count - * The runlist may have to be reallocated - * - * Returns the reallocated runlist - * or NULL if reallocation was not possible (with errno set) - * the runlist is left unchanged if the reallocation fails - */ - -runlist_element *ntfs_rl_extend(ntfs_attr *na, runlist_element *rl, - int more_entries) -{ - runlist_element *newrl; - int last; - int irl; - - if (na->rl && rl) { - irl = (int)(rl - na->rl); - last = irl; - while (na->rl[last].length) - last++; - newrl = ntfs_rl_realloc(na->rl,last+1,last+more_entries+1); - if (!newrl) { - errno = ENOMEM; - rl = (runlist_element*)NULL; - } else - na->rl = newrl; - rl = &newrl[irl]; - } else { - ntfs_log_error("Cannot extend unmapped runlist"); - errno = EIO; - rl = (runlist_element*)NULL; - } - return (rl); -} - -/** - * ntfs_rl_are_mergeable - test if two runlists can be joined together - * @dst: original runlist - * @src: new runlist to test for mergeability with @dst - * - * Test if two runlists can be joined together. For this, their VCNs and LCNs - * must be adjacent. - * - * Return: TRUE Success, the runlists can be merged. - * FALSE Failure, the runlists cannot be merged. - */ -static BOOL ntfs_rl_are_mergeable(runlist_element *dst, runlist_element *src) -{ - if (!dst || !src) { - ntfs_log_debug("Eeek. ntfs_rl_are_mergeable() invoked with NULL " - "pointer!\n"); - return FALSE; - } - - /* We can merge unmapped regions even if they are misaligned. */ - if ((dst->lcn == LCN_RL_NOT_MAPPED) && (src->lcn == LCN_RL_NOT_MAPPED)) - return TRUE; - /* If the runs are misaligned, we cannot merge them. */ - if ((dst->vcn + dst->length) != src->vcn) - return FALSE; - /* If both runs are non-sparse and contiguous, we can merge them. */ - if ((dst->lcn >= 0) && (src->lcn >= 0) && - ((dst->lcn + dst->length) == src->lcn)) - return TRUE; - /* If we are merging two holes, we can merge them. */ - if ((dst->lcn == LCN_HOLE) && (src->lcn == LCN_HOLE)) - return TRUE; - /* Cannot merge. */ - return FALSE; -} - -/** - * __ntfs_rl_merge - merge two runlists without testing if they can be merged - * @dst: original, destination runlist - * @src: new runlist to merge with @dst - * - * Merge the two runlists, writing into the destination runlist @dst. The - * caller must make sure the runlists can be merged or this will corrupt the - * destination runlist. - */ -static void __ntfs_rl_merge(runlist_element *dst, runlist_element *src) -{ - dst->length += src->length; -} - -/** - * ntfs_rl_append - append a runlist after a given element - * @dst: original runlist to be worked on - * @dsize: number of elements in @dst (including end marker) - * @src: runlist to be inserted into @dst - * @ssize: number of elements in @src (excluding end marker) - * @loc: append the new runlist @src after this element in @dst - * - * Append the runlist @src after element @loc in @dst. Merge the right end of - * the new runlist, if necessary. Adjust the size of the hole before the - * appended runlist. - * - * On success, return a pointer to the new, combined, runlist. Note, both - * runlists @dst and @src are deallocated before returning so you cannot use - * the pointers for anything any more. (Strictly speaking the returned runlist - * may be the same as @dst but this is irrelevant.) - * - * On error, return NULL, with errno set to the error code. Both runlists are - * left unmodified. - */ -static runlist_element *ntfs_rl_append(runlist_element *dst, int dsize, - runlist_element *src, int ssize, int loc) -{ - BOOL right = FALSE; /* Right end of @src needs merging */ - int marker; /* End of the inserted runs */ - - if (!dst || !src) { - ntfs_log_debug("Eeek. ntfs_rl_append() invoked with NULL " - "pointer!\n"); - errno = EINVAL; - return NULL; - } - - /* First, check if the right hand end needs merging. */ - if ((loc + 1) < dsize) - right = ntfs_rl_are_mergeable(src + ssize - 1, dst + loc + 1); - - /* Space required: @dst size + @src size, less one if we merged. */ - dst = ntfs_rl_realloc(dst, dsize, dsize + ssize - right); - if (!dst) - return NULL; - /* - * We are guaranteed to succeed from here so can start modifying the - * original runlists. - */ - - /* First, merge the right hand end, if necessary. */ - if (right) - __ntfs_rl_merge(src + ssize - 1, dst + loc + 1); - - /* marker - First run after the @src runs that have been inserted */ - marker = loc + ssize + 1; - - /* Move the tail of @dst out of the way, then copy in @src. */ - ntfs_rl_mm(dst, marker, loc + 1 + right, dsize - loc - 1 - right); - ntfs_rl_mc(dst, loc + 1, src, 0, ssize); - - /* Adjust the size of the preceding hole. */ - dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn; - - /* We may have changed the length of the file, so fix the end marker */ - if (dst[marker].lcn == LCN_ENOENT) - dst[marker].vcn = dst[marker-1].vcn + dst[marker-1].length; - - return dst; -} - -/** - * ntfs_rl_insert - insert a runlist into another - * @dst: original runlist to be worked on - * @dsize: number of elements in @dst (including end marker) - * @src: new runlist to be inserted - * @ssize: number of elements in @src (excluding end marker) - * @loc: insert the new runlist @src before this element in @dst - * - * Insert the runlist @src before element @loc in the runlist @dst. Merge the - * left end of the new runlist, if necessary. Adjust the size of the hole - * after the inserted runlist. - * - * On success, return a pointer to the new, combined, runlist. Note, both - * runlists @dst and @src are deallocated before returning so you cannot use - * the pointers for anything any more. (Strictly speaking the returned runlist - * may be the same as @dst but this is irrelevant.) - * - * On error, return NULL, with errno set to the error code. Both runlists are - * left unmodified. - */ -static runlist_element *ntfs_rl_insert(runlist_element *dst, int dsize, - runlist_element *src, int ssize, int loc) -{ - BOOL left = FALSE; /* Left end of @src needs merging */ - BOOL disc = FALSE; /* Discontinuity between @dst and @src */ - int marker; /* End of the inserted runs */ - - if (!dst || !src) { - ntfs_log_debug("Eeek. ntfs_rl_insert() invoked with NULL " - "pointer!\n"); - errno = EINVAL; - return NULL; - } - - /* disc => Discontinuity between the end of @dst and the start of @src. - * This means we might need to insert a "notmapped" run. - */ - if (loc == 0) - disc = (src[0].vcn > 0); - else { - s64 merged_length; - - left = ntfs_rl_are_mergeable(dst + loc - 1, src); - - merged_length = dst[loc - 1].length; - if (left) - merged_length += src->length; - - disc = (src[0].vcn > dst[loc - 1].vcn + merged_length); - } - - /* Space required: @dst size + @src size, less one if we merged, plus - * one if there was a discontinuity. - */ - dst = ntfs_rl_realloc(dst, dsize, dsize + ssize - left + disc); - if (!dst) - return NULL; - /* - * We are guaranteed to succeed from here so can start modifying the - * original runlist. - */ - - if (left) - __ntfs_rl_merge(dst + loc - 1, src); - - /* - * marker - First run after the @src runs that have been inserted - * Nominally: marker = @loc + @ssize (location + number of runs in @src) - * If "left", then the first run in @src has been merged with one in @dst. - * If "disc", then @dst and @src don't meet and we need an extra run to fill the gap. - */ - marker = loc + ssize - left + disc; - - /* Move the tail of @dst out of the way, then copy in @src. */ - ntfs_rl_mm(dst, marker, loc, dsize - loc); - ntfs_rl_mc(dst, loc + disc, src, left, ssize - left); - - /* Adjust the VCN of the first run after the insertion ... */ - dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length; - /* ... and the length. */ - if (dst[marker].lcn == LCN_HOLE || dst[marker].lcn == LCN_RL_NOT_MAPPED) - dst[marker].length = dst[marker + 1].vcn - dst[marker].vcn; - - /* Writing beyond the end of the file and there's a discontinuity. */ - if (disc) { - if (loc > 0) { - dst[loc].vcn = dst[loc - 1].vcn + dst[loc - 1].length; - dst[loc].length = dst[loc + 1].vcn - dst[loc].vcn; - } else { - dst[loc].vcn = 0; - dst[loc].length = dst[loc + 1].vcn; - } - dst[loc].lcn = LCN_RL_NOT_MAPPED; - } - return dst; -} - -/** - * ntfs_rl_replace - overwrite a runlist element with another runlist - * @dst: original runlist to be worked on - * @dsize: number of elements in @dst (including end marker) - * @src: new runlist to be inserted - * @ssize: number of elements in @src (excluding end marker) - * @loc: index in runlist @dst to overwrite with @src - * - * Replace the runlist element @dst at @loc with @src. Merge the left and - * right ends of the inserted runlist, if necessary. - * - * On success, return a pointer to the new, combined, runlist. Note, both - * runlists @dst and @src are deallocated before returning so you cannot use - * the pointers for anything any more. (Strictly speaking the returned runlist - * may be the same as @dst but this is irrelevant.) - * - * On error, return NULL, with errno set to the error code. Both runlists are - * left unmodified. - */ -static runlist_element *ntfs_rl_replace(runlist_element *dst, int dsize, - runlist_element *src, int ssize, - int loc) -{ - signed delta; - BOOL left = FALSE; /* Left end of @src needs merging */ - BOOL right = FALSE; /* Right end of @src needs merging */ - int tail; /* Start of tail of @dst */ - int marker; /* End of the inserted runs */ - - if (!dst || !src) { - ntfs_log_debug("Eeek. ntfs_rl_replace() invoked with NULL " - "pointer!\n"); - errno = EINVAL; - return NULL; - } - - /* First, see if the left and right ends need merging. */ - if ((loc + 1) < dsize) - right = ntfs_rl_are_mergeable(src + ssize - 1, dst + loc + 1); - if (loc > 0) - left = ntfs_rl_are_mergeable(dst + loc - 1, src); - - /* Allocate some space. We'll need less if the left, right, or both - * ends get merged. The -1 accounts for the run being replaced. - */ - delta = ssize - 1 - left - right; - if (delta > 0) { - dst = ntfs_rl_realloc(dst, dsize, dsize + delta); - if (!dst) - return NULL; - } - /* - * We are guaranteed to succeed from here so can start modifying the - * original runlists. - */ - - /* First, merge the left and right ends, if necessary. */ - if (right) - __ntfs_rl_merge(src + ssize - 1, dst + loc + 1); - if (left) - __ntfs_rl_merge(dst + loc - 1, src); - - /* - * tail - Offset of the tail of @dst - * Nominally: @tail = @loc + 1 (location, skipping the replaced run) - * If "right", then one of @dst's runs is already merged into @src. - */ - tail = loc + right + 1; - - /* - * marker - First run after the @src runs that have been inserted - * Nominally: @marker = @loc + @ssize (location + number of runs in @src) - * If "left", then the first run in @src has been merged with one in @dst. - */ - marker = loc + ssize - left; - - /* Move the tail of @dst out of the way, then copy in @src. */ - ntfs_rl_mm(dst, marker, tail, dsize - tail); - ntfs_rl_mc(dst, loc, src, left, ssize - left); - - /* We may have changed the length of the file, so fix the end marker */ - if (((dsize - tail) > 0) && (dst[marker].lcn == LCN_ENOENT)) - dst[marker].vcn = dst[marker - 1].vcn + dst[marker - 1].length; - - return dst; -} - -/** - * ntfs_rl_split - insert a runlist into the centre of a hole - * @dst: original runlist to be worked on - * @dsize: number of elements in @dst (including end marker) - * @src: new runlist to be inserted - * @ssize: number of elements in @src (excluding end marker) - * @loc: index in runlist @dst at which to split and insert @src - * - * Split the runlist @dst at @loc into two and insert @new in between the two - * fragments. No merging of runlists is necessary. Adjust the size of the - * holes either side. - * - * On success, return a pointer to the new, combined, runlist. Note, both - * runlists @dst and @src are deallocated before returning so you cannot use - * the pointers for anything any more. (Strictly speaking the returned runlist - * may be the same as @dst but this is irrelevant.) - * - * On error, return NULL, with errno set to the error code. Both runlists are - * left unmodified. - */ -static runlist_element *ntfs_rl_split(runlist_element *dst, int dsize, - runlist_element *src, int ssize, int loc) -{ - if (!dst || !src) { - ntfs_log_debug("Eeek. ntfs_rl_split() invoked with NULL pointer!\n"); - errno = EINVAL; - return NULL; - } - - /* Space required: @dst size + @src size + one new hole. */ - dst = ntfs_rl_realloc(dst, dsize, dsize + ssize + 1); - if (!dst) - return dst; - /* - * We are guaranteed to succeed from here so can start modifying the - * original runlists. - */ - - /* Move the tail of @dst out of the way, then copy in @src. */ - ntfs_rl_mm(dst, loc + 1 + ssize, loc, dsize - loc); - ntfs_rl_mc(dst, loc + 1, src, 0, ssize); - - /* Adjust the size of the holes either size of @src. */ - dst[loc].length = dst[loc+1].vcn - dst[loc].vcn; - dst[loc+ssize+1].vcn = dst[loc+ssize].vcn + dst[loc+ssize].length; - dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn; - - return dst; -} - - -/** - * ntfs_runlists_merge_i - see ntfs_runlists_merge - */ -static runlist_element *ntfs_runlists_merge_i(runlist_element *drl, - runlist_element *srl) -{ - int di, si; /* Current index into @[ds]rl. */ - int sstart; /* First index with lcn > LCN_RL_NOT_MAPPED. */ - int dins; /* Index into @drl at which to insert @srl. */ - int dend, send; /* Last index into @[ds]rl. */ - int dfinal, sfinal; /* The last index into @[ds]rl with - lcn >= LCN_HOLE. */ - int marker = 0; - VCN marker_vcn = 0; - - ntfs_log_debug("dst:\n"); - ntfs_debug_runlist_dump(drl); - ntfs_log_debug("src:\n"); - ntfs_debug_runlist_dump(srl); - - /* Check for silly calling... */ - if (!srl) - return drl; - - /* Check for the case where the first mapping is being done now. */ - if (!drl) { - drl = srl; - /* Complete the source runlist if necessary. */ - if (drl[0].vcn) { - /* Scan to the end of the source runlist. */ - for (dend = 0; drl[dend].length; dend++) - ; - dend++; - drl = ntfs_rl_realloc(drl, dend, dend + 1); - if (!drl) - return drl; - /* Insert start element at the front of the runlist. */ - ntfs_rl_mm(drl, 1, 0, dend); - drl[0].vcn = 0; - drl[0].lcn = LCN_RL_NOT_MAPPED; - drl[0].length = drl[1].vcn; - } - goto finished; - } - - si = di = 0; - - /* Skip any unmapped start element(s) in the source runlist. */ - while (srl[si].length && srl[si].lcn < (LCN)LCN_HOLE) - si++; - - /* Can't have an entirely unmapped source runlist. */ - if (!srl[si].length) { - errno = EINVAL; - ntfs_log_perror("%s: unmapped source runlist", __FUNCTION__); - return NULL; - } - - /* Record the starting points. */ - sstart = si; - - /* - * Skip forward in @drl until we reach the position where @srl needs to - * be inserted. If we reach the end of @drl, @srl just needs to be - * appended to @drl. - */ - for (; drl[di].length; di++) { - if (drl[di].vcn + drl[di].length > srl[sstart].vcn) - break; - } - dins = di; - - /* Sanity check for illegal overlaps. */ - if ((drl[di].vcn == srl[si].vcn) && (drl[di].lcn >= 0) && - (srl[si].lcn >= 0)) { - errno = ERANGE; - ntfs_log_perror("Run lists overlap. Cannot merge"); - return NULL; - } - - /* Scan to the end of both runlists in order to know their sizes. */ - for (send = si; srl[send].length; send++) - ; - for (dend = di; drl[dend].length; dend++) - ; - - if (srl[send].lcn == (LCN)LCN_ENOENT) - marker_vcn = srl[marker = send].vcn; - - /* Scan to the last element with lcn >= LCN_HOLE. */ - for (sfinal = send; sfinal >= 0 && srl[sfinal].lcn < LCN_HOLE; sfinal--) - ; - for (dfinal = dend; dfinal >= 0 && drl[dfinal].lcn < LCN_HOLE; dfinal--) - ; - - { - BOOL start; - BOOL finish; - int ds = dend + 1; /* Number of elements in drl & srl */ - int ss = sfinal - sstart + 1; - - start = ((drl[dins].lcn < LCN_RL_NOT_MAPPED) || /* End of file */ - (drl[dins].vcn == srl[sstart].vcn)); /* Start of hole */ - finish = ((drl[dins].lcn >= LCN_RL_NOT_MAPPED) && /* End of file */ - ((drl[dins].vcn + drl[dins].length) <= /* End of hole */ - (srl[send - 1].vcn + srl[send - 1].length))); - - /* Or we'll lose an end marker */ - if (finish && !drl[dins].length) - ss++; - if (marker && (drl[dins].vcn + drl[dins].length > srl[send - 1].vcn)) - finish = FALSE; - - ntfs_log_debug("dfinal = %i, dend = %i\n", dfinal, dend); - ntfs_log_debug("sstart = %i, sfinal = %i, send = %i\n", sstart, sfinal, send); - ntfs_log_debug("start = %i, finish = %i\n", start, finish); - ntfs_log_debug("ds = %i, ss = %i, dins = %i\n", ds, ss, dins); - - if (start) { - if (finish) - drl = ntfs_rl_replace(drl, ds, srl + sstart, ss, dins); - else - drl = ntfs_rl_insert(drl, ds, srl + sstart, ss, dins); - } else { - if (finish) - drl = ntfs_rl_append(drl, ds, srl + sstart, ss, dins); - else - drl = ntfs_rl_split(drl, ds, srl + sstart, ss, dins); - } - if (!drl) { - ntfs_log_perror("Merge failed"); - return drl; - } - free(srl); - if (marker) { - ntfs_log_debug("Triggering marker code.\n"); - for (ds = dend; drl[ds].length; ds++) - ; - /* We only need to care if @srl ended after @drl. */ - if (drl[ds].vcn <= marker_vcn) { - int slots = 0; - - if (drl[ds].vcn == marker_vcn) { - ntfs_log_debug("Old marker = %lli, replacing with " - "LCN_ENOENT.\n", - (long long)drl[ds].lcn); - drl[ds].lcn = (LCN)LCN_ENOENT; - goto finished; - } - /* - * We need to create an unmapped runlist element in - * @drl or extend an existing one before adding the - * ENOENT terminator. - */ - if (drl[ds].lcn == (LCN)LCN_ENOENT) { - ds--; - slots = 1; - } - if (drl[ds].lcn != (LCN)LCN_RL_NOT_MAPPED) { - /* Add an unmapped runlist element. */ - if (!slots) { - /* FIXME/TODO: We need to have the - * extra memory already! (AIA) - */ - drl = ntfs_rl_realloc(drl, ds, ds + 2); - if (!drl) - goto critical_error; - slots = 2; - } - ds++; - /* Need to set vcn if it isn't set already. */ - if (slots != 1) - drl[ds].vcn = drl[ds - 1].vcn + - drl[ds - 1].length; - drl[ds].lcn = (LCN)LCN_RL_NOT_MAPPED; - /* We now used up a slot. */ - slots--; - } - drl[ds].length = marker_vcn - drl[ds].vcn; - /* Finally add the ENOENT terminator. */ - ds++; - if (!slots) { - /* FIXME/TODO: We need to have the extra - * memory already! (AIA) - */ - drl = ntfs_rl_realloc(drl, ds, ds + 1); - if (!drl) - goto critical_error; - } - drl[ds].vcn = marker_vcn; - drl[ds].lcn = (LCN)LCN_ENOENT; - drl[ds].length = (s64)0; - } - } - } - -finished: - /* The merge was completed successfully. */ - ntfs_log_debug("Merged runlist:\n"); - ntfs_debug_runlist_dump(drl); - return drl; - -critical_error: - /* Critical error! We cannot afford to fail here. */ - ntfs_log_perror("libntfs: Critical error"); - ntfs_log_debug("Forcing segmentation fault!\n"); - marker_vcn = ((runlist*)NULL)->lcn; - return drl; -} - -/** - * ntfs_runlists_merge - merge two runlists into one - * @drl: original runlist to be worked on - * @srl: new runlist to be merged into @drl - * - * First we sanity check the two runlists @srl and @drl to make sure that they - * are sensible and can be merged. The runlist @srl must be either after the - * runlist @drl or completely within a hole (or unmapped region) in @drl. - * - * Merging of runlists is necessary in two cases: - * 1. When attribute lists are used and a further extent is being mapped. - * 2. When new clusters are allocated to fill a hole or extend a file. - * - * There are four possible ways @srl can be merged. It can: - * - be inserted at the beginning of a hole, - * - split the hole in two and be inserted between the two fragments, - * - be appended at the end of a hole, or it can - * - replace the whole hole. - * It can also be appended to the end of the runlist, which is just a variant - * of the insert case. - * - * On success, return a pointer to the new, combined, runlist. Note, both - * runlists @drl and @srl are deallocated before returning so you cannot use - * the pointers for anything any more. (Strictly speaking the returned runlist - * may be the same as @dst but this is irrelevant.) - * - * On error, return NULL, with errno set to the error code. Both runlists are - * left unmodified. The following error codes are defined: - * ENOMEM Not enough memory to allocate runlist array. - * EINVAL Invalid parameters were passed in. - * ERANGE The runlists overlap and cannot be merged. - */ -runlist_element *ntfs_runlists_merge(runlist_element *drl, - runlist_element *srl) -{ - runlist_element *rl; - - ntfs_log_enter("Entering\n"); - rl = ntfs_runlists_merge_i(drl, srl); - ntfs_log_leave("\n"); - return rl; -} - -/** - * ntfs_mapping_pairs_decompress - convert mapping pairs array to runlist - * @vol: ntfs volume on which the attribute resides - * @attr: attribute record whose mapping pairs array to decompress - * @old_rl: optional runlist in which to insert @attr's runlist - * - * Decompress the attribute @attr's mapping pairs array into a runlist. On - * success, return the decompressed runlist. - * - * If @old_rl is not NULL, decompressed runlist is inserted into the - * appropriate place in @old_rl and the resultant, combined runlist is - * returned. The original @old_rl is deallocated. - * - * On error, return NULL with errno set to the error code. @old_rl is left - * unmodified in that case. - * - * The following error codes are defined: - * ENOMEM Not enough memory to allocate runlist array. - * EIO Corrupt runlist. - * EINVAL Invalid parameters were passed in. - * ERANGE The two runlists overlap. - * - * FIXME: For now we take the conceptionally simplest approach of creating the - * new runlist disregarding the already existing one and then splicing the - * two into one, if that is possible (we check for overlap and discard the new - * runlist if overlap present before returning NULL, with errno = ERANGE). - */ -static runlist_element *ntfs_mapping_pairs_decompress_i(const ntfs_volume *vol, - const ATTR_RECORD *attr, runlist_element *old_rl) -{ - VCN vcn; /* Current vcn. */ - LCN lcn; /* Current lcn. */ - s64 deltaxcn; /* Change in [vl]cn. */ - runlist_element *rl; /* The output runlist. */ - const u8 *buf; /* Current position in mapping pairs array. */ - const u8 *attr_end; /* End of attribute. */ - int err, rlsize; /* Size of runlist buffer. */ - u16 rlpos; /* Current runlist position in units of - runlist_elements. */ - u8 b; /* Current byte offset in buf. */ - - ntfs_log_trace("Entering for attr 0x%x.\n", - (unsigned)le32_to_cpu(attr->type)); - /* Make sure attr exists and is non-resident. */ - if (!attr || !attr->non_resident || - sle64_to_cpu(attr->lowest_vcn) < (VCN)0) { - errno = EINVAL; - return NULL; - } - /* Start at vcn = lowest_vcn and lcn 0. */ - vcn = sle64_to_cpu(attr->lowest_vcn); - lcn = 0; - /* Get start of the mapping pairs array. */ - buf = (const u8*)attr + le16_to_cpu(attr->mapping_pairs_offset); - attr_end = (const u8*)attr + le32_to_cpu(attr->length); - if (buf < (const u8*)attr || buf > attr_end) { - ntfs_log_debug("Corrupt attribute.\n"); - errno = EIO; - return NULL; - } - /* Current position in runlist array. */ - rlpos = 0; - /* Allocate first 4kiB block and set current runlist size to 4kiB. */ - rlsize = 0x1000; - rl = ntfs_malloc(rlsize); - if (!rl) - return NULL; - /* Insert unmapped starting element if necessary. */ - if (vcn) { - rl->vcn = (VCN)0; - rl->lcn = (LCN)LCN_RL_NOT_MAPPED; - rl->length = vcn; - rlpos++; - } - while (buf < attr_end && *buf) { - /* - * Allocate more memory if needed, including space for the - * not-mapped and terminator elements. - */ - if ((int)((rlpos + 3) * sizeof(*old_rl)) > rlsize) { - runlist_element *rl2; - - rlsize += 0x1000; - rl2 = realloc(rl, rlsize); - if (!rl2) { - int eo = errno; - free(rl); - errno = eo; - return NULL; - } - rl = rl2; - } - /* Enter the current vcn into the current runlist element. */ - rl[rlpos].vcn = vcn; - /* - * Get the change in vcn, i.e. the run length in clusters. - * Doing it this way ensures that we signextend negative values. - * A negative run length doesn't make any sense, but hey, I - * didn't make up the NTFS specs and Windows NT4 treats the run - * length as a signed value so that's how it is... - */ - b = *buf & 0xf; - if (b) { - if (buf + b > attr_end) - goto io_error; - for (deltaxcn = (s8)buf[b--]; b; b--) - deltaxcn = (deltaxcn << 8) + buf[b]; - } else { /* The length entry is compulsory. */ - ntfs_log_debug("Missing length entry in mapping pairs " - "array.\n"); - deltaxcn = (s64)-1; - } - /* - * Assume a negative length to indicate data corruption and - * hence clean-up and return NULL. - */ - if (deltaxcn < 0) { - ntfs_log_debug("Invalid length in mapping pairs array.\n"); - goto err_out; - } - /* - * Enter the current run length into the current runlist - * element. - */ - rl[rlpos].length = deltaxcn; - /* Increment the current vcn by the current run length. */ - vcn += deltaxcn; - /* - * There might be no lcn change at all, as is the case for - * sparse clusters on NTFS 3.0+, in which case we set the lcn - * to LCN_HOLE. - */ - if (!(*buf & 0xf0)) - rl[rlpos].lcn = (LCN)LCN_HOLE; - else { - /* Get the lcn change which really can be negative. */ - u8 b2 = *buf & 0xf; - b = b2 + ((*buf >> 4) & 0xf); - if (buf + b > attr_end) - goto io_error; - for (deltaxcn = (s8)buf[b--]; b > b2; b--) - deltaxcn = (deltaxcn << 8) + buf[b]; - /* Change the current lcn to it's new value. */ - lcn += deltaxcn; -#ifdef DEBUG - /* - * On NTFS 1.2-, apparently can have lcn == -1 to - * indicate a hole. But we haven't verified ourselves - * whether it is really the lcn or the deltaxcn that is - * -1. So if either is found give us a message so we - * can investigate it further! - */ - if (vol->major_ver < 3) { - if (deltaxcn == (LCN)-1) - ntfs_log_debug("lcn delta == -1\n"); - if (lcn == (LCN)-1) - ntfs_log_debug("lcn == -1\n"); - } -#endif - /* Check lcn is not below -1. */ - if (lcn < (LCN)-1) { - ntfs_log_debug("Invalid LCN < -1 in mapping pairs " - "array.\n"); - goto err_out; - } - /* Enter the current lcn into the runlist element. */ - rl[rlpos].lcn = lcn; - } - /* Get to the next runlist element. */ - rlpos++; - /* Increment the buffer position to the next mapping pair. */ - buf += (*buf & 0xf) + ((*buf >> 4) & 0xf) + 1; - } - if (buf >= attr_end) - goto io_error; - /* - * If there is a highest_vcn specified, it must be equal to the final - * vcn in the runlist - 1, or something has gone badly wrong. - */ - deltaxcn = sle64_to_cpu(attr->highest_vcn); - if (deltaxcn && vcn - 1 != deltaxcn) { -mpa_err: - ntfs_log_debug("Corrupt mapping pairs array in non-resident " - "attribute.\n"); - goto err_out; - } - /* Setup not mapped runlist element if this is the base extent. */ - if (!attr->lowest_vcn) { - VCN max_cluster; - - max_cluster = ((sle64_to_cpu(attr->allocated_size) + - vol->cluster_size - 1) >> - vol->cluster_size_bits) - 1; - /* - * A highest_vcn of zero means this is a single extent - * attribute so simply terminate the runlist with LCN_ENOENT). - */ - if (deltaxcn) { - /* - * If there is a difference between the highest_vcn and - * the highest cluster, the runlist is either corrupt - * or, more likely, there are more extents following - * this one. - */ - if (deltaxcn < max_cluster) { - ntfs_log_debug("More extents to follow; deltaxcn = " - "0x%llx, max_cluster = 0x%llx\n", - (long long)deltaxcn, - (long long)max_cluster); - rl[rlpos].vcn = vcn; - vcn += rl[rlpos].length = max_cluster - deltaxcn; - rl[rlpos].lcn = (LCN)LCN_RL_NOT_MAPPED; - rlpos++; - } else if (deltaxcn > max_cluster) { - ntfs_log_debug("Corrupt attribute. deltaxcn = " - "0x%llx, max_cluster = 0x%llx\n", - (long long)deltaxcn, - (long long)max_cluster); - goto mpa_err; - } - } - rl[rlpos].lcn = (LCN)LCN_ENOENT; - } else /* Not the base extent. There may be more extents to follow. */ - rl[rlpos].lcn = (LCN)LCN_RL_NOT_MAPPED; - - /* Setup terminating runlist element. */ - rl[rlpos].vcn = vcn; - rl[rlpos].length = (s64)0; - /* If no existing runlist was specified, we are done. */ - if (!old_rl) { - ntfs_log_debug("Mapping pairs array successfully decompressed:\n"); - ntfs_debug_runlist_dump(rl); - return rl; - } - /* Now combine the new and old runlists checking for overlaps. */ - old_rl = ntfs_runlists_merge(old_rl, rl); - if (old_rl) - return old_rl; - err = errno; - free(rl); - ntfs_log_debug("Failed to merge runlists.\n"); - errno = err; - return NULL; -io_error: - ntfs_log_debug("Corrupt attribute.\n"); -err_out: - free(rl); - errno = EIO; - return NULL; -} - -runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol, - const ATTR_RECORD *attr, runlist_element *old_rl) -{ - runlist_element *rle; - - ntfs_log_enter("Entering\n"); - rle = ntfs_mapping_pairs_decompress_i(vol, attr, old_rl); - ntfs_log_leave("\n"); - return rle; -} - -/** - * ntfs_rl_vcn_to_lcn - convert a vcn into a lcn given a runlist - * @rl: runlist to use for conversion - * @vcn: vcn to convert - * - * Convert the virtual cluster number @vcn of an attribute into a logical - * cluster number (lcn) of a device using the runlist @rl to map vcns to their - * corresponding lcns. - * - * Since lcns must be >= 0, we use negative return values with special meaning: - * - * Return value Meaning / Description - * ================================================== - * -1 = LCN_HOLE Hole / not allocated on disk. - * -2 = LCN_RL_NOT_MAPPED This is part of the runlist which has not been - * inserted into the runlist yet. - * -3 = LCN_ENOENT There is no such vcn in the attribute. - * -4 = LCN_EINVAL Input parameter error. - */ -LCN ntfs_rl_vcn_to_lcn(const runlist_element *rl, const VCN vcn) -{ - int i; - - if (vcn < (VCN)0) - return (LCN)LCN_EINVAL; - /* - * If rl is NULL, assume that we have found an unmapped runlist. The - * caller can then attempt to map it and fail appropriately if - * necessary. - */ - if (!rl) - return (LCN)LCN_RL_NOT_MAPPED; - - /* Catch out of lower bounds vcn. */ - if (vcn < rl[0].vcn) - return (LCN)LCN_ENOENT; - - for (i = 0; rl[i].length; i++) { - if (vcn < rl[i+1].vcn) { - if (rl[i].lcn >= (LCN)0) - return rl[i].lcn + (vcn - rl[i].vcn); - return rl[i].lcn; - } - } - /* - * The terminator element is setup to the correct value, i.e. one of - * LCN_HOLE, LCN_RL_NOT_MAPPED, or LCN_ENOENT. - */ - if (rl[i].lcn < (LCN)0) - return rl[i].lcn; - /* Just in case... We could replace this with BUG() some day. */ - return (LCN)LCN_ENOENT; -} - -/** - * ntfs_rl_pread - gather read from disk - * @vol: ntfs volume to read from - * @rl: runlist specifying where to read the data from - * @pos: byte position within runlist @rl at which to begin the read - * @count: number of bytes to read - * @b: data buffer into which to read from disk - * - * This function will read @count bytes from the volume @vol to the data buffer - * @b gathering the data as specified by the runlist @rl. The read begins at - * offset @pos into the runlist @rl. - * - * On success, return the number of successfully read bytes. If this number is - * lower than @count this means that the read reached end of file or that an - * error was encountered during the read so that the read is partial. 0 means - * nothing was read (also return 0 when @count is 0). - * - * On error and nothing has been read, return -1 with errno set appropriately - * to the return code of ntfs_pread(), or to EINVAL in case of invalid - * arguments. - * - * NOTE: If we encounter EOF while reading we return EIO because we assume that - * the run list must point to valid locations within the ntfs volume. - */ -s64 ntfs_rl_pread(const ntfs_volume *vol, const runlist_element *rl, - const s64 pos, s64 count, void *b) -{ - s64 bytes_read, to_read, ofs, total; - int err = EIO; - - if (!vol || !rl || pos < 0 || count < 0) { - errno = EINVAL; - ntfs_log_perror("Failed to read runlist [vol: %p rl: %p " - "pos: %lld count: %lld]", vol, rl, - (long long)pos, (long long)count); - return -1; - } - if (!count) - return count; - /* Seek in @rl to the run containing @pos. */ - for (ofs = 0; rl->length && (ofs + (rl->length << - vol->cluster_size_bits) <= pos); rl++) - ofs += (rl->length << vol->cluster_size_bits); - /* Offset in the run at which to begin reading. */ - ofs = pos - ofs; - for (total = 0LL; count; rl++, ofs = 0) { - if (!rl->length) - goto rl_err_out; - if (rl->lcn < (LCN)0) { - if (rl->lcn != (LCN)LCN_HOLE) - goto rl_err_out; - /* It is a hole. Just fill buffer @b with zeroes. */ - to_read = min(count, (rl->length << - vol->cluster_size_bits) - ofs); - memset(b, 0, to_read); - /* Update counters and proceed with next run. */ - total += to_read; - count -= to_read; - b = (u8*)b + to_read; - continue; - } - /* It is a real lcn, read it from the volume. */ - to_read = min(count, (rl->length << vol->cluster_size_bits) - - ofs); -retry: - bytes_read = ntfs_pread(vol->dev, (rl->lcn << - vol->cluster_size_bits) + ofs, to_read, b); - /* If everything ok, update progress counters and continue. */ - if (bytes_read > 0) { - total += bytes_read; - count -= bytes_read; - b = (u8*)b + bytes_read; - continue; - } - /* If the syscall was interrupted, try again. */ - if (bytes_read == (s64)-1 && errno == EINTR) - goto retry; - if (bytes_read == (s64)-1) - err = errno; - goto rl_err_out; - } - /* Finally, return the number of bytes read. */ - return total; -rl_err_out: - if (total) - return total; - errno = err; - return -1; -} - -/** - * ntfs_rl_pwrite - scatter write to disk - * @vol: ntfs volume to write to - * @rl: runlist entry specifying where to write the data to - * @ofs: offset in file for runlist element indicated in @rl - * @pos: byte position from runlist beginning at which to begin the write - * @count: number of bytes to write - * @b: data buffer to write to disk - * - * This function will write @count bytes from data buffer @b to the volume @vol - * scattering the data as specified by the runlist @rl. The write begins at - * offset @pos into the runlist @rl. If a run is sparse then the related buffer - * data is ignored which means that the caller must ensure they are consistent. - * - * On success, return the number of successfully written bytes. If this number - * is lower than @count this means that the write has been interrupted in - * flight or that an error was encountered during the write so that the write - * is partial. 0 means nothing was written (also return 0 when @count is 0). - * - * On error and nothing has been written, return -1 with errno set - * appropriately to the return code of ntfs_pwrite(), or to to EINVAL in case - * of invalid arguments. - */ -s64 ntfs_rl_pwrite(const ntfs_volume *vol, const runlist_element *rl, - s64 ofs, const s64 pos, s64 count, void *b) -{ - s64 written, to_write, total = 0; - int err = EIO; - - if (!vol || !rl || pos < 0 || count < 0) { - errno = EINVAL; - ntfs_log_perror("Failed to write runlist [vol: %p rl: %p " - "pos: %lld count: %lld]", vol, rl, - (long long)pos, (long long)count); - goto errno_set; - } - if (!count) - goto out; - /* Seek in @rl to the run containing @pos. */ - while (rl->length && (ofs + (rl->length << - vol->cluster_size_bits) <= pos)) { - ofs += (rl->length << vol->cluster_size_bits); - rl++; - } - /* Offset in the run at which to begin writing. */ - ofs = pos - ofs; - for (total = 0LL; count; rl++, ofs = 0) { - if (!rl->length) - goto rl_err_out; - if (rl->lcn < (LCN)0) { - - if (rl->lcn != (LCN)LCN_HOLE) - goto rl_err_out; - - to_write = min(count, (rl->length << - vol->cluster_size_bits) - ofs); - - total += to_write; - count -= to_write; - b = (u8*)b + to_write; - continue; - } - /* It is a real lcn, write it to the volume. */ - to_write = min(count, (rl->length << vol->cluster_size_bits) - - ofs); -retry: - if (!NVolReadOnly(vol)) - written = ntfs_pwrite(vol->dev, (rl->lcn << - vol->cluster_size_bits) + ofs, - to_write, b); - else - written = to_write; - /* If everything ok, update progress counters and continue. */ - if (written > 0) { - total += written; - count -= written; - b = (u8*)b + written; - continue; - } - /* If the syscall was interrupted, try again. */ - if (written == (s64)-1 && errno == EINTR) - goto retry; - if (written == (s64)-1) - err = errno; - goto rl_err_out; - } -out: - return total; -rl_err_out: - if (total) - goto out; - errno = err; -errno_set: - total = -1; - goto out; -} - -/** - * ntfs_get_nr_significant_bytes - get number of bytes needed to store a number - * @n: number for which to get the number of bytes for - * - * Return the number of bytes required to store @n unambiguously as - * a signed number. - * - * This is used in the context of the mapping pairs array to determine how - * many bytes will be needed in the array to store a given logical cluster - * number (lcn) or a specific run length. - * - * Return the number of bytes written. This function cannot fail. - */ -int ntfs_get_nr_significant_bytes(const s64 n) -{ - u64 l; - int i; - - l = (n < 0 ? ~n : n); - i = 1; - if (l >= 128) { - l >>= 7; - do { - i++; - l >>= 8; - } while (l); - } - return i; -} - -/** - * ntfs_get_size_for_mapping_pairs - get bytes needed for mapping pairs array - * @vol: ntfs volume (needed for the ntfs version) - * @rl: runlist for which to determine the size of the mapping pairs - * @start_vcn: vcn at which to start the mapping pairs array - * - * Walk the runlist @rl and calculate the size in bytes of the mapping pairs - * array corresponding to the runlist @rl, starting at vcn @start_vcn. This - * for example allows us to allocate a buffer of the right size when building - * the mapping pairs array. - * - * If @rl is NULL, just return 1 (for the single terminator byte). - * - * Return the calculated size in bytes on success. On error, return -1 with - * errno set to the error code. The following error codes are defined: - * EINVAL - Run list contains unmapped elements. Make sure to only pass - * fully mapped runlists to this function. - * - @start_vcn is invalid. - * EIO - The runlist is corrupt. - */ -int ntfs_get_size_for_mapping_pairs(const ntfs_volume *vol, - const runlist_element *rl, const VCN start_vcn, int max_size) -{ - LCN prev_lcn; - int rls; - - if (start_vcn < 0) { - ntfs_log_trace("start_vcn %lld (should be >= 0)\n", - (long long) start_vcn); - errno = EINVAL; - goto errno_set; - } - if (!rl) { - if (start_vcn) { - ntfs_log_trace("rl NULL, start_vcn %lld (should be > 0)\n", - (long long) start_vcn); - errno = EINVAL; - goto errno_set; - } - rls = 1; - goto out; - } - /* Skip to runlist element containing @start_vcn. */ - while (rl->length && start_vcn >= rl[1].vcn) - rl++; - if ((!rl->length && start_vcn > rl->vcn) || start_vcn < rl->vcn) { - errno = EINVAL; - goto errno_set; - } - prev_lcn = 0; - /* Always need the terminating zero byte. */ - rls = 1; - /* Do the first partial run if present. */ - if (start_vcn > rl->vcn) { - s64 delta; - - /* We know rl->length != 0 already. */ - if (rl->length < 0 || rl->lcn < LCN_HOLE) - goto err_out; - delta = start_vcn - rl->vcn; - /* Header byte + length. */ - rls += 1 + ntfs_get_nr_significant_bytes(rl->length - delta); - /* - * If the logical cluster number (lcn) denotes a hole and we - * are on NTFS 3.0+, we don't store it at all, i.e. we need - * zero space. On earlier NTFS versions we just store the lcn. - * Note: this assumes that on NTFS 1.2-, holes are stored with - * an lcn of -1 and not a delta_lcn of -1 (unless both are -1). - */ - if (rl->lcn >= 0 || vol->major_ver < 3) { - prev_lcn = rl->lcn; - if (rl->lcn >= 0) - prev_lcn += delta; - /* Change in lcn. */ - rls += ntfs_get_nr_significant_bytes(prev_lcn); - } - /* Go to next runlist element. */ - rl++; - } - /* Do the full runs. */ - for (; rl->length && (rls <= max_size); rl++) { - if (rl->length < 0 || rl->lcn < LCN_HOLE) - goto err_out; - /* Header byte + length. */ - rls += 1 + ntfs_get_nr_significant_bytes(rl->length); - /* - * If the logical cluster number (lcn) denotes a hole and we - * are on NTFS 3.0+, we don't store it at all, i.e. we need - * zero space. On earlier NTFS versions we just store the lcn. - * Note: this assumes that on NTFS 1.2-, holes are stored with - * an lcn of -1 and not a delta_lcn of -1 (unless both are -1). - */ - if (rl->lcn >= 0 || vol->major_ver < 3) { - /* Change in lcn. */ - rls += ntfs_get_nr_significant_bytes(rl->lcn - - prev_lcn); - prev_lcn = rl->lcn; - } - } -out: - return rls; -err_out: - if (rl->lcn == LCN_RL_NOT_MAPPED) - errno = EINVAL; - else - errno = EIO; -errno_set: - rls = -1; - goto out; -} - -/** - * ntfs_write_significant_bytes - write the significant bytes of a number - * @dst: destination buffer to write to - * @dst_max: pointer to last byte of destination buffer for bounds checking - * @n: number whose significant bytes to write - * - * Store in @dst, the minimum bytes of the number @n which are required to - * identify @n unambiguously as a signed number, taking care not to exceed - * @dest_max, the maximum position within @dst to which we are allowed to - * write. - * - * This is used when building the mapping pairs array of a runlist to compress - * a given logical cluster number (lcn) or a specific run length to the minimum - * size possible. - * - * Return the number of bytes written on success. On error, i.e. the - * destination buffer @dst is too small, return -1 with errno set ENOSPC. - */ -int ntfs_write_significant_bytes(u8 *dst, const u8 *dst_max, const s64 n) -{ - s64 l = n; - int i; - s8 j; - - i = 0; - do { - if (dst > dst_max) - goto err_out; - *dst++ = l & 0xffLL; - l >>= 8; - i++; - } while (l != 0LL && l != -1LL); - j = (n >> 8 * (i - 1)) & 0xff; - /* If the sign bit is wrong, we need an extra byte. */ - if (n < 0LL && j >= 0) { - if (dst > dst_max) - goto err_out; - i++; - *dst = (u8)-1; - } else if (n > 0LL && j < 0) { - if (dst > dst_max) - goto err_out; - i++; - *dst = 0; - } - return i; -err_out: - errno = ENOSPC; - return -1; -} - -/** - * ntfs_mapping_pairs_build - build the mapping pairs array from a runlist - * @vol: ntfs volume (needed for the ntfs version) - * @dst: destination buffer to which to write the mapping pairs array - * @dst_len: size of destination buffer @dst in bytes - * @rl: runlist for which to build the mapping pairs array - * @start_vcn: vcn at which to start the mapping pairs array - * @stop_vcn: first vcn outside destination buffer on success or ENOSPC error - * - * Create the mapping pairs array from the runlist @rl, starting at vcn - * @start_vcn and save the array in @dst. @dst_len is the size of @dst in - * bytes and it should be at least equal to the value obtained by calling - * ntfs_get_size_for_mapping_pairs(). - * - * If @rl is NULL, just write a single terminator byte to @dst. - * - * On success or ENOSPC error, if @stop_vcn is not NULL, *@stop_vcn is set to - * the first vcn outside the destination buffer. Note that on error @dst has - * been filled with all the mapping pairs that will fit, thus it can be treated - * as partial success, in that a new attribute extent needs to be created or the - * next extent has to be used and the mapping pairs build has to be continued - * with @start_vcn set to *@stop_vcn. - * - * Return 0 on success. On error, return -1 with errno set to the error code. - * The following error codes are defined: - * EINVAL - Run list contains unmapped elements. Make sure to only pass - * fully mapped runlists to this function. - * - @start_vcn is invalid. - * EIO - The runlist is corrupt. - * ENOSPC - The destination buffer is too small. - */ -int ntfs_mapping_pairs_build(const ntfs_volume *vol, u8 *dst, - const int dst_len, const runlist_element *rl, - const VCN start_vcn, runlist_element const **stop_rl) -{ - LCN prev_lcn; - u8 *dst_max, *dst_next; - s8 len_len, lcn_len; - int ret = 0; - - if (start_vcn < 0) - goto val_err; - if (!rl) { - if (start_vcn) - goto val_err; - if (stop_rl) - *stop_rl = rl; - if (dst_len < 1) - goto nospc_err; - goto ok; - } - /* Skip to runlist element containing @start_vcn. */ - while (rl->length && start_vcn >= rl[1].vcn) - rl++; - if ((!rl->length && start_vcn > rl->vcn) || start_vcn < rl->vcn) - goto val_err; - /* - * @dst_max is used for bounds checking in - * ntfs_write_significant_bytes(). - */ - dst_max = dst + dst_len - 1; - prev_lcn = 0; - /* Do the first partial run if present. */ - if (start_vcn > rl->vcn) { - s64 delta; - - /* We know rl->length != 0 already. */ - if (rl->length < 0 || rl->lcn < LCN_HOLE) - goto err_out; - delta = start_vcn - rl->vcn; - /* Write length. */ - len_len = ntfs_write_significant_bytes(dst + 1, dst_max, - rl->length - delta); - if (len_len < 0) - goto size_err; - /* - * If the logical cluster number (lcn) denotes a hole and we - * are on NTFS 3.0+, we don't store it at all, i.e. we need - * zero space. On earlier NTFS versions we just write the lcn - * change. FIXME: Do we need to write the lcn change or just - * the lcn in that case? Not sure as I have never seen this - * case on NT4. - We assume that we just need to write the lcn - * change until someone tells us otherwise... (AIA) - */ - if (rl->lcn >= 0 || vol->major_ver < 3) { - prev_lcn = rl->lcn; - if (rl->lcn >= 0) - prev_lcn += delta; - /* Write change in lcn. */ - lcn_len = ntfs_write_significant_bytes(dst + 1 + - len_len, dst_max, prev_lcn); - if (lcn_len < 0) - goto size_err; - } else - lcn_len = 0; - dst_next = dst + len_len + lcn_len + 1; - if (dst_next > dst_max) - goto size_err; - /* Update header byte. */ - *dst = lcn_len << 4 | len_len; - /* Position at next mapping pairs array element. */ - dst = dst_next; - /* Go to next runlist element. */ - rl++; - } - /* Do the full runs. */ - for (; rl->length; rl++) { - if (rl->length < 0 || rl->lcn < LCN_HOLE) - goto err_out; - /* Write length. */ - len_len = ntfs_write_significant_bytes(dst + 1, dst_max, - rl->length); - if (len_len < 0) - goto size_err; - /* - * If the logical cluster number (lcn) denotes a hole and we - * are on NTFS 3.0+, we don't store it at all, i.e. we need - * zero space. On earlier NTFS versions we just write the lcn - * change. FIXME: Do we need to write the lcn change or just - * the lcn in that case? Not sure as I have never seen this - * case on NT4. - We assume that we just need to write the lcn - * change until someone tells us otherwise... (AIA) - */ - if (rl->lcn >= 0 || vol->major_ver < 3) { - /* Write change in lcn. */ - lcn_len = ntfs_write_significant_bytes(dst + 1 + - len_len, dst_max, rl->lcn - prev_lcn); - if (lcn_len < 0) - goto size_err; - prev_lcn = rl->lcn; - } else - lcn_len = 0; - dst_next = dst + len_len + lcn_len + 1; - if (dst_next > dst_max) - goto size_err; - /* Update header byte. */ - *dst = lcn_len << 4 | len_len; - /* Position at next mapping pairs array element. */ - dst += 1 + len_len + lcn_len; - } - /* Set stop vcn. */ - if (stop_rl) - *stop_rl = rl; -ok: - /* Add terminator byte. */ - *dst = 0; -out: - return ret; -size_err: - /* Set stop vcn. */ - if (stop_rl) - *stop_rl = rl; - /* Add terminator byte. */ - *dst = 0; -nospc_err: - errno = ENOSPC; - goto errno_set; -val_err: - errno = EINVAL; - goto errno_set; -err_out: - if (rl->lcn == LCN_RL_NOT_MAPPED) - errno = EINVAL; - else - errno = EIO; -errno_set: - ret = -1; - goto out; -} - -/** - * ntfs_rl_truncate - truncate a runlist starting at a specified vcn - * @arl: address of runlist to truncate - * @start_vcn: first vcn which should be cut off - * - * Truncate the runlist *@arl starting at vcn @start_vcn as well as the memory - * buffer holding the runlist. - * - * Return 0 on success and -1 on error with errno set to the error code. - * - * NOTE: @arl is the address of the runlist. We need the address so we can - * modify the pointer to the runlist with the new, reallocated memory buffer. - */ -int ntfs_rl_truncate(runlist **arl, const VCN start_vcn) -{ - runlist *rl; - BOOL is_end = FALSE; - - if (!arl || !*arl) { - errno = EINVAL; - if (!arl) - ntfs_log_perror("rl_truncate error: arl: %p", arl); - else - ntfs_log_perror("rl_truncate error:" - " arl: %p *arl: %p", arl, *arl); - return -1; - } - - rl = *arl; - - if (start_vcn < rl->vcn) { - errno = EINVAL; - ntfs_log_perror("Start_vcn lies outside front of runlist"); - return -1; - } - - /* Find the starting vcn in the run list. */ - while (rl->length) { - if (start_vcn < rl[1].vcn) - break; - rl++; - } - - if (!rl->length) { - errno = EIO; - ntfs_log_trace("Truncating already truncated runlist?\n"); - return -1; - } - - /* Truncate the run. */ - rl->length = start_vcn - rl->vcn; - - /* - * If a run was partially truncated, make the following runlist - * element a terminator instead of the truncated runlist - * element itself. - */ - if (rl->length) { - ++rl; - if (!rl->length) - is_end = TRUE; - rl->vcn = start_vcn; - rl->length = 0; - } - rl->lcn = (LCN)LCN_ENOENT; - /** - * Reallocate memory if necessary. - * FIXME: Below code is broken, because runlist allocations must be - * a multiply of 4096. The code caused crashes and corruptions. - */ -/* - if (!is_end) { - size_t new_size = (rl - *arl + 1) * sizeof(runlist_element); - rl = realloc(*arl, new_size); - if (rl) - *arl = rl; - } -*/ - return 0; -} - -/** - * ntfs_rl_sparse - check whether runlist have sparse regions or not. - * @rl: runlist to check - * - * Return 1 if have, 0 if not, -1 on error with errno set to the error code. - */ -int ntfs_rl_sparse(runlist *rl) -{ - runlist *rlc; - - if (!rl) { - errno = EINVAL; - ntfs_log_perror("%s: ", __FUNCTION__); - return -1; - } - - for (rlc = rl; rlc->length; rlc++) - if (rlc->lcn < 0) { - if (rlc->lcn != LCN_HOLE) { - errno = EINVAL; - ntfs_log_perror("%s: bad runlist", __FUNCTION__); - return -1; - } - return 1; - } - return 0; -} - -/** - * ntfs_rl_get_compressed_size - calculate length of non sparse regions - * @vol: ntfs volume (need for cluster size) - * @rl: runlist to calculate for - * - * Return compressed size or -1 on error with errno set to the error code. - */ -s64 ntfs_rl_get_compressed_size(ntfs_volume *vol, runlist *rl) -{ - runlist *rlc; - s64 ret = 0; - - if (!rl) { - errno = EINVAL; - ntfs_log_perror("%s: ", __FUNCTION__); - return -1; - } - - for (rlc = rl; rlc->length; rlc++) { - if (rlc->lcn < 0) { - if (rlc->lcn != LCN_HOLE) { - errno = EINVAL; - ntfs_log_perror("%s: bad runlist", __FUNCTION__); - return -1; - } - } else - ret += rlc->length; - } - return ret << vol->cluster_size_bits; -} - - -#ifdef NTFS_TEST -/** - * test_rl_helper - */ -#define MKRL(R,V,L,S) \ - (R)->vcn = V; \ - (R)->lcn = L; \ - (R)->length = S; -/* -} -*/ -/** - * test_rl_dump_runlist - Runlist test: Display the contents of a runlist - * @rl: - * - * Description... - * - * Returns: - */ -static void test_rl_dump_runlist(const runlist_element *rl) -{ - int abbr = 0; /* abbreviate long lists */ - int len = 0; - int i; - const char *lcn_str[5] = { "HOLE", "NOTMAP", "ENOENT", "XXXX" }; - - if (!rl) { - printf(" Run list not present.\n"); - return; - } - - if (abbr) - for (len = 0; rl[len].length; len++) ; - - printf(" VCN LCN len\n"); - for (i = 0; ; i++, rl++) { - LCN lcn = rl->lcn; - - if ((abbr) && (len > 20)) { - if (i == 4) - printf(" ...\n"); - if ((i > 3) && (i < (len - 3))) - continue; - } - - if (lcn < (LCN)0) { - int ind = -lcn - 1; - - if (ind > -LCN_ENOENT - 1) - ind = 3; - printf("%8lld %8s %8lld\n", - rl->vcn, lcn_str[ind], rl->length); - } else - printf("%8lld %8lld %8lld\n", - rl->vcn, rl->lcn, rl->length); - if (!rl->length) - break; - } - if ((abbr) && (len > 20)) - printf(" (%d entries)\n", len+1); - printf("\n"); -} - -/** - * test_rl_runlists_merge - Runlist test: Merge two runlists - * @drl: - * @srl: - * - * Description... - * - * Returns: - */ -static runlist_element * test_rl_runlists_merge(runlist_element *drl, runlist_element *srl) -{ - runlist_element *res = NULL; - - printf("dst:\n"); - test_rl_dump_runlist(drl); - printf("src:\n"); - test_rl_dump_runlist(srl); - - res = ntfs_runlists_merge(drl, srl); - - printf("res:\n"); - test_rl_dump_runlist(res); - - return res; -} - -/** - * test_rl_read_buffer - Runlist test: Read a file containing a runlist - * @file: - * @buf: - * @bufsize: - * - * Description... - * - * Returns: - */ -static int test_rl_read_buffer(const char *file, u8 *buf, int bufsize) -{ - FILE *fptr; - - fptr = fopen(file, "r"); - if (!fptr) { - printf("open %s\n", file); - return 0; - } - - if (fread(buf, bufsize, 1, fptr) == 99) { - printf("read %s\n", file); - return 0; - } - - fclose(fptr); - return 1; -} - -/** - * test_rl_pure_src - Runlist test: Complicate the simple tests a little - * @contig: - * @multi: - * @vcn: - * @len: - * - * Description... - * - * Returns: - */ -static runlist_element * test_rl_pure_src(BOOL contig, BOOL multi, int vcn, int len) -{ - runlist_element *result; - int fudge; - - if (contig) - fudge = 0; - else - fudge = 999; - - result = ntfs_malloc(4096); - if (!result) - return NULL; - - if (multi) { - MKRL(result+0, vcn + (0*len/4), fudge + vcn + 1000 + (0*len/4), len / 4) - MKRL(result+1, vcn + (1*len/4), fudge + vcn + 1000 + (1*len/4), len / 4) - MKRL(result+2, vcn + (2*len/4), fudge + vcn + 1000 + (2*len/4), len / 4) - MKRL(result+3, vcn + (3*len/4), fudge + vcn + 1000 + (3*len/4), len / 4) - MKRL(result+4, vcn + (4*len/4), LCN_RL_NOT_MAPPED, 0) - } else { - MKRL(result+0, vcn, fudge + vcn + 1000, len) - MKRL(result+1, vcn + len, LCN_RL_NOT_MAPPED, 0) - } - return result; -} - -/** - * test_rl_pure_test - Runlist test: Perform tests using simple runlists - * @test: - * @contig: - * @multi: - * @vcn: - * @len: - * @file: - * @size: - * - * Description... - * - * Returns: - */ -static void test_rl_pure_test(int test, BOOL contig, BOOL multi, int vcn, int len, runlist_element *file, int size) -{ - runlist_element *src; - runlist_element *dst; - runlist_element *res; - - src = test_rl_pure_src(contig, multi, vcn, len); - dst = ntfs_malloc(4096); - if (!src || !dst) { - printf("Test %2d ---------- FAILED! (no free memory?)\n", test); - return; - } - - memcpy(dst, file, size); - - printf("Test %2d ----------\n", test); - res = test_rl_runlists_merge(dst, src); - - free(res); -} - -/** - * test_rl_pure - Runlist test: Create tests using simple runlists - * @contig: - * @multi: - * - * Description... - * - * Returns: - */ -static void test_rl_pure(char *contig, char *multi) -{ - /* VCN, LCN, len */ - static runlist_element file1[] = { - { 0, -1, 100 }, /* HOLE */ - { 100, 1100, 100 }, /* DATA */ - { 200, -1, 100 }, /* HOLE */ - { 300, 1300, 100 }, /* DATA */ - { 400, -1, 100 }, /* HOLE */ - { 500, -3, 0 } /* NOENT */ - }; - static runlist_element file2[] = { - { 0, 1000, 100 }, /* DATA */ - { 100, -1, 100 }, /* HOLE */ - { 200, -3, 0 } /* NOENT */ - }; - static runlist_element file3[] = { - { 0, 1000, 100 }, /* DATA */ - { 100, -3, 0 } /* NOENT */ - }; - static runlist_element file4[] = { - { 0, -3, 0 } /* NOENT */ - }; - static runlist_element file5[] = { - { 0, -2, 100 }, /* NOTMAP */ - { 100, 1100, 100 }, /* DATA */ - { 200, -2, 100 }, /* NOTMAP */ - { 300, 1300, 100 }, /* DATA */ - { 400, -2, 100 }, /* NOTMAP */ - { 500, -3, 0 } /* NOENT */ - }; - static runlist_element file6[] = { - { 0, 1000, 100 }, /* DATA */ - { 100, -2, 100 }, /* NOTMAP */ - { 200, -3, 0 } /* NOENT */ - }; - BOOL c, m; - - if (strcmp(contig, "contig") == 0) - c = TRUE; - else if (strcmp(contig, "noncontig") == 0) - c = FALSE; - else { - printf("rl pure [contig|noncontig] [single|multi]\n"); - return; - } - if (strcmp(multi, "multi") == 0) - m = TRUE; - else if (strcmp(multi, "single") == 0) - m = FALSE; - else { - printf("rl pure [contig|noncontig] [single|multi]\n"); - return; - } - - test_rl_pure_test(1, c, m, 0, 40, file1, sizeof(file1)); - test_rl_pure_test(2, c, m, 40, 40, file1, sizeof(file1)); - test_rl_pure_test(3, c, m, 60, 40, file1, sizeof(file1)); - test_rl_pure_test(4, c, m, 0, 100, file1, sizeof(file1)); - test_rl_pure_test(5, c, m, 200, 40, file1, sizeof(file1)); - test_rl_pure_test(6, c, m, 240, 40, file1, sizeof(file1)); - test_rl_pure_test(7, c, m, 260, 40, file1, sizeof(file1)); - test_rl_pure_test(8, c, m, 200, 100, file1, sizeof(file1)); - test_rl_pure_test(9, c, m, 400, 40, file1, sizeof(file1)); - test_rl_pure_test(10, c, m, 440, 40, file1, sizeof(file1)); - test_rl_pure_test(11, c, m, 460, 40, file1, sizeof(file1)); - test_rl_pure_test(12, c, m, 400, 100, file1, sizeof(file1)); - test_rl_pure_test(13, c, m, 160, 100, file2, sizeof(file2)); - test_rl_pure_test(14, c, m, 100, 140, file2, sizeof(file2)); - test_rl_pure_test(15, c, m, 200, 40, file2, sizeof(file2)); - test_rl_pure_test(16, c, m, 240, 40, file2, sizeof(file2)); - test_rl_pure_test(17, c, m, 100, 40, file3, sizeof(file3)); - test_rl_pure_test(18, c, m, 140, 40, file3, sizeof(file3)); - test_rl_pure_test(19, c, m, 0, 40, file4, sizeof(file4)); - test_rl_pure_test(20, c, m, 40, 40, file4, sizeof(file4)); - test_rl_pure_test(21, c, m, 0, 40, file5, sizeof(file5)); - test_rl_pure_test(22, c, m, 40, 40, file5, sizeof(file5)); - test_rl_pure_test(23, c, m, 60, 40, file5, sizeof(file5)); - test_rl_pure_test(24, c, m, 0, 100, file5, sizeof(file5)); - test_rl_pure_test(25, c, m, 200, 40, file5, sizeof(file5)); - test_rl_pure_test(26, c, m, 240, 40, file5, sizeof(file5)); - test_rl_pure_test(27, c, m, 260, 40, file5, sizeof(file5)); - test_rl_pure_test(28, c, m, 200, 100, file5, sizeof(file5)); - test_rl_pure_test(29, c, m, 400, 40, file5, sizeof(file5)); - test_rl_pure_test(30, c, m, 440, 40, file5, sizeof(file5)); - test_rl_pure_test(31, c, m, 460, 40, file5, sizeof(file5)); - test_rl_pure_test(32, c, m, 400, 100, file5, sizeof(file5)); - test_rl_pure_test(33, c, m, 160, 100, file6, sizeof(file6)); - test_rl_pure_test(34, c, m, 100, 140, file6, sizeof(file6)); -} - -/** - * test_rl_zero - Runlist test: Merge a zero-length runlist - * - * Description... - * - * Returns: - */ -static void test_rl_zero(void) -{ - runlist_element *jim = NULL; - runlist_element *bob = NULL; - - bob = calloc(3, sizeof(runlist_element)); - if (!bob) - return; - - MKRL(bob+0, 10, 99, 5) - MKRL(bob+1, 15, LCN_RL_NOT_MAPPED, 0) - - jim = test_rl_runlists_merge(jim, bob); - if (!jim) - return; - - free(jim); -} - -/** - * test_rl_frag_combine - Runlist test: Perform tests using fragmented files - * @vol: - * @attr1: - * @attr2: - * @attr3: - * - * Description... - * - * Returns: - */ -static void test_rl_frag_combine(ntfs_volume *vol, ATTR_RECORD *attr1, ATTR_RECORD *attr2, ATTR_RECORD *attr3) -{ - runlist_element *run1; - runlist_element *run2; - runlist_element *run3; - - run1 = ntfs_mapping_pairs_decompress(vol, attr1, NULL); - if (!run1) - return; - - run2 = ntfs_mapping_pairs_decompress(vol, attr2, NULL); - if (!run2) - return; - - run1 = test_rl_runlists_merge(run1, run2); - - run3 = ntfs_mapping_pairs_decompress(vol, attr3, NULL); - if (!run3) - return; - - run1 = test_rl_runlists_merge(run1, run3); - - free(run1); -} - -/** - * test_rl_frag - Runlist test: Create tests using very fragmented files - * @test: - * - * Description... - * - * Returns: - */ -static void test_rl_frag(char *test) -{ - ntfs_volume vol; - ATTR_RECORD *attr1 = ntfs_malloc(1024); - ATTR_RECORD *attr2 = ntfs_malloc(1024); - ATTR_RECORD *attr3 = ntfs_malloc(1024); - - if (!attr1 || !attr2 || !attr3) - goto out; - - vol.sb = NULL; - vol.sector_size_bits = 9; - vol.cluster_size = 2048; - vol.cluster_size_bits = 11; - vol.major_ver = 3; - - if (!test_rl_read_buffer("runlist-data/attr1.bin", (u8*) attr1, 1024)) - goto out; - if (!test_rl_read_buffer("runlist-data/attr2.bin", (u8*) attr2, 1024)) - goto out; - if (!test_rl_read_buffer("runlist-data/attr3.bin", (u8*) attr3, 1024)) - goto out; - - if (strcmp(test, "123") == 0) test_rl_frag_combine(&vol, attr1, attr2, attr3); - else if (strcmp(test, "132") == 0) test_rl_frag_combine(&vol, attr1, attr3, attr2); - else if (strcmp(test, "213") == 0) test_rl_frag_combine(&vol, attr2, attr1, attr3); - else if (strcmp(test, "231") == 0) test_rl_frag_combine(&vol, attr2, attr3, attr1); - else if (strcmp(test, "312") == 0) test_rl_frag_combine(&vol, attr3, attr1, attr2); - else if (strcmp(test, "321") == 0) test_rl_frag_combine(&vol, attr3, attr2, attr1); - else - printf("Frag: No such test '%s'\n", test); - -out: - free(attr1); - free(attr2); - free(attr3); -} - -/** - * test_rl_main - Runlist test: Program start (main) - * @argc: - * @argv: - * - * Description... - * - * Returns: - */ -int test_rl_main(int argc, char *argv[]) -{ - if ((argc == 2) && (strcmp(argv[1], "zero") == 0)) test_rl_zero(); - else if ((argc == 3) && (strcmp(argv[1], "frag") == 0)) test_rl_frag(argv[2]); - else if ((argc == 4) && (strcmp(argv[1], "pure") == 0)) test_rl_pure(argv[2], argv[3]); - else - printf("rl [zero|frag|pure] {args}\n"); - - return 0; -} - -#endif - diff --git a/source/libs/libntfs/runlist.h b/source/libs/libntfs/runlist.h deleted file mode 100644 index 4b73af9f..00000000 --- a/source/libs/libntfs/runlist.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * runlist.h - Exports for runlist handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2002 Anton Altaparmakov - * Copyright (c) 2002 Richard Russon - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_RUNLIST_H -#define _NTFS_RUNLIST_H - -#include "types.h" - -/* Forward declarations */ -typedef struct _runlist_element runlist_element; -typedef runlist_element runlist; - -#include "attrib.h" -#include "volume.h" - -/** - * struct _runlist_element - in memory vcn to lcn mapping array element. - * @vcn: starting vcn of the current array element - * @lcn: starting lcn of the current array element - * @length: length in clusters of the current array element - * - * The last vcn (in fact the last vcn + 1) is reached when length == 0. - * - * When lcn == -1 this means that the count vcns starting at vcn are not - * physically allocated (i.e. this is a hole / data is sparse). - */ -struct _runlist_element {/* In memory vcn to lcn mapping structure element. */ - VCN vcn; /* vcn = Starting virtual cluster number. */ - LCN lcn; /* lcn = Starting logical cluster number. */ - s64 length; /* Run length in clusters. */ -}; - -extern runlist_element *ntfs_rl_extend(ntfs_attr *na, runlist_element *rl, - int more_entries); - -extern LCN ntfs_rl_vcn_to_lcn(const runlist_element *rl, const VCN vcn); - -extern s64 ntfs_rl_pread(const ntfs_volume *vol, const runlist_element *rl, - const s64 pos, s64 count, void *b); -extern s64 ntfs_rl_pwrite(const ntfs_volume *vol, const runlist_element *rl, - s64 ofs, const s64 pos, s64 count, void *b); - -extern runlist_element *ntfs_runlists_merge(runlist_element *drl, - runlist_element *srl); - -extern runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol, - const ATTR_RECORD *attr, runlist_element *old_rl); - -extern int ntfs_get_nr_significant_bytes(const s64 n); - -extern int ntfs_get_size_for_mapping_pairs(const ntfs_volume *vol, - const runlist_element *rl, const VCN start_vcn, int max_size); - -extern int ntfs_write_significant_bytes(u8 *dst, const u8 *dst_max, - const s64 n); - -extern int ntfs_mapping_pairs_build(const ntfs_volume *vol, u8 *dst, - const int dst_len, const runlist_element *rl, - const VCN start_vcn, runlist_element const **stop_rl); - -extern int ntfs_rl_truncate(runlist **arl, const VCN start_vcn); - -extern int ntfs_rl_sparse(runlist *rl); -extern s64 ntfs_rl_get_compressed_size(ntfs_volume *vol, runlist *rl); - -#ifdef NTFS_TEST -int test_rl_main(int argc, char *argv[]); -#endif - -#endif /* defined _NTFS_RUNLIST_H */ - diff --git a/source/libs/libntfs/security.c b/source/libs/libntfs/security.c deleted file mode 100644 index 138764ba..00000000 --- a/source/libs/libntfs/security.c +++ /dev/null @@ -1,5184 +0,0 @@ -/** - * security.c - Handling security/ACLs in NTFS. Originated from the Linux-NTFS project. - * - * Copyright (c) 2004 Anton Altaparmakov - * Copyright (c) 2005-2006 Szabolcs Szakacsits - * Copyright (c) 2006 Yura Pakhuchiy - * Copyright (c) 2007-2009 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_SETXATTR -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#include -#include -#include - -#include "param.h" -#include "types.h" -#include "layout.h" -#include "attrib.h" -#include "index.h" -#include "dir.h" -#include "bitmap.h" -#include "security.h" -#include "acls.h" -#include "cache.h" -#include "misc.h" - -/* - * JPA NTFS constants or structs - * should be moved to layout.h - */ - -#define ALIGN_SDS_BLOCK 0x40000 /* Alignment for a $SDS block */ -#define ALIGN_SDS_ENTRY 16 /* Alignment for a $SDS entry */ -#define STUFFSZ 0x4000 /* unitary stuffing size for $SDS */ -#define FIRST_SECURITY_ID 0x100 /* Lowest security id */ - - /* Mask for attributes which can be forced */ -#define FILE_ATTR_SETTABLE ( FILE_ATTR_READONLY \ - | FILE_ATTR_HIDDEN \ - | FILE_ATTR_SYSTEM \ - | FILE_ATTR_ARCHIVE \ - | FILE_ATTR_TEMPORARY \ - | FILE_ATTR_OFFLINE \ - | FILE_ATTR_NOT_CONTENT_INDEXED ) - -struct SII { /* this is an image of an $SII index entry */ - le16 offs; - le16 size; - le32 fill1; - le16 indexsz; - le16 indexksz; - le16 flags; - le16 fill2; - le32 keysecurid; - - /* did not find official description for the following */ - le32 hash; - le32 securid; - le32 dataoffsl; /* documented as badly aligned */ - le32 dataoffsh; - le32 datasize; -} ; - -struct SDH { /* this is an image of an $SDH index entry */ - le16 offs; - le16 size; - le32 fill1; - le16 indexsz; - le16 indexksz; - le16 flags; - le16 fill2; - le32 keyhash; - le32 keysecurid; - - /* did not find official description for the following */ - le32 hash; - le32 securid; - le32 dataoffsl; - le32 dataoffsh; - le32 datasize; - le32 fill3; - } ; - -/* - * A few useful constants - */ - -static ntfschar sii_stream[] = { const_cpu_to_le16('$'), - const_cpu_to_le16('S'), - const_cpu_to_le16('I'), - const_cpu_to_le16('I'), - const_cpu_to_le16(0) }; -static ntfschar sdh_stream[] = { const_cpu_to_le16('$'), - const_cpu_to_le16('S'), - const_cpu_to_le16('D'), - const_cpu_to_le16('H'), - const_cpu_to_le16(0) }; - -/* - * null SID (S-1-0-0) - */ - -extern const SID *nullsid; - -/* - * The zero GUID. - */ - -static const GUID __zero_guid = { const_cpu_to_le32(0), const_cpu_to_le16(0), - const_cpu_to_le16(0), { 0, 0, 0, 0, 0, 0, 0, 0 } }; -static const GUID *const zero_guid = &__zero_guid; - -/** - * ntfs_guid_is_zero - check if a GUID is zero - * @guid: [IN] guid to check - * - * Return TRUE if @guid is a valid pointer to a GUID and it is the zero GUID - * and FALSE otherwise. - */ -BOOL ntfs_guid_is_zero(const GUID *guid) -{ - return (memcmp(guid, zero_guid, sizeof(*zero_guid))); -} - -/** - * ntfs_guid_to_mbs - convert a GUID to a multi byte string - * @guid: [IN] guid to convert - * @guid_str: [OUT] string in which to return the GUID (optional) - * - * Convert the GUID pointed to by @guid to a multi byte string of the form - * "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX". Therefore, @guid_str (if not NULL) - * needs to be able to store at least 37 bytes. - * - * If @guid_str is not NULL it will contain the converted GUID on return. If - * it is NULL a string will be allocated and this will be returned. The caller - * is responsible for free()ing the string in that case. - * - * On success return the converted string and on failure return NULL with errno - * set to the error code. - */ -char *ntfs_guid_to_mbs(const GUID *guid, char *guid_str) -{ - char *_guid_str; - int res; - - if (!guid) { - errno = EINVAL; - return NULL; - } - _guid_str = guid_str; - if (!_guid_str) { - _guid_str = (char*)ntfs_malloc(37); - if (!_guid_str) - return _guid_str; - } - res = snprintf(_guid_str, 37, - "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - (unsigned int)le32_to_cpu(guid->data1), - le16_to_cpu(guid->data2), le16_to_cpu(guid->data3), - guid->data4[0], guid->data4[1], - guid->data4[2], guid->data4[3], guid->data4[4], - guid->data4[5], guid->data4[6], guid->data4[7]); - if (res == 36) - return _guid_str; - if (!guid_str) - free(_guid_str); - errno = EINVAL; - return NULL; -} - -/** - * ntfs_sid_to_mbs_size - determine maximum size for the string of a SID - * @sid: [IN] SID for which to determine the maximum string size - * - * Determine the maximum multi byte string size in bytes which is needed to - * store the standard textual representation of the SID pointed to by @sid. - * See ntfs_sid_to_mbs(), below. - * - * On success return the maximum number of bytes needed to store the multi byte - * string and on failure return -1 with errno set to the error code. - */ -int ntfs_sid_to_mbs_size(const SID *sid) -{ - int size, i; - - if (!ntfs_sid_is_valid(sid)) { - errno = EINVAL; - return -1; - } - /* Start with "S-". */ - size = 2; - /* - * Add the SID_REVISION. Hopefully the compiler will optimize this - * away as SID_REVISION is a constant. - */ - for (i = SID_REVISION; i > 0; i /= 10) - size++; - /* Add the "-". */ - size++; - /* - * Add the identifier authority. If it needs to be in decimal, the - * maximum is 2^32-1 = 4294967295 = 10 characters. If it needs to be - * in hexadecimal, then maximum is 0x665544332211 = 14 characters. - */ - if (!sid->identifier_authority.high_part) - size += 10; - else - size += 14; - /* - * Finally, add the sub authorities. For each we have a "-" followed - * by a decimal which can be up to 2^32-1 = 4294967295 = 10 characters. - */ - size += (1 + 10) * sid->sub_authority_count; - /* We need the zero byte at the end, too. */ - size++; - return size * sizeof(char); -} - -/** - * ntfs_sid_to_mbs - convert a SID to a multi byte string - * @sid: [IN] SID to convert - * @sid_str: [OUT] string in which to return the SID (optional) - * @sid_str_size: [IN] size in bytes of @sid_str - * - * Convert the SID pointed to by @sid to its standard textual representation. - * @sid_str (if not NULL) needs to be able to store at least - * ntfs_sid_to_mbs_size() bytes. @sid_str_size is the size in bytes of - * @sid_str if @sid_str is not NULL. - * - * The standard textual representation of the SID is of the form: - * S-R-I-S-S... - * Where: - * - The first "S" is the literal character 'S' identifying the following - * digits as a SID. - * - R is the revision level of the SID expressed as a sequence of digits - * in decimal. - * - I is the 48-bit identifier_authority, expressed as digits in decimal, - * if I < 2^32, or hexadecimal prefixed by "0x", if I >= 2^32. - * - S... is one or more sub_authority values, expressed as digits in - * decimal. - * - * If @sid_str is not NULL it will contain the converted SUID on return. If it - * is NULL a string will be allocated and this will be returned. The caller is - * responsible for free()ing the string in that case. - * - * On success return the converted string and on failure return NULL with errno - * set to the error code. - */ -char *ntfs_sid_to_mbs(const SID *sid, char *sid_str, size_t sid_str_size) -{ - u64 u; - le32 leauth; - char *s; - int i, j, cnt; - - /* - * No need to check @sid if !@sid_str since ntfs_sid_to_mbs_size() will - * check @sid, too. 8 is the minimum SID string size. - */ - if (sid_str && (sid_str_size < 8 || !ntfs_sid_is_valid(sid))) { - errno = EINVAL; - return NULL; - } - /* Allocate string if not provided. */ - if (!sid_str) { - cnt = ntfs_sid_to_mbs_size(sid); - if (cnt < 0) - return NULL; - s = (char*)ntfs_malloc(cnt); - if (!s) - return s; - sid_str = s; - /* So we know we allocated it. */ - sid_str_size = 0; - } else { - s = sid_str; - cnt = sid_str_size; - } - /* Start with "S-R-". */ - i = snprintf(s, cnt, "S-%hhu-", (unsigned char)sid->revision); - if (i < 0 || i >= cnt) - goto err_out; - s += i; - cnt -= i; - /* Add the identifier authority. */ - for (u = i = 0, j = 40; i < 6; i++, j -= 8) - u += (u64)sid->identifier_authority.value[i] << j; - if (!sid->identifier_authority.high_part) - i = snprintf(s, cnt, "%lu", (unsigned long)u); - else - i = snprintf(s, cnt, "0x%llx", (unsigned long long)u); - if (i < 0 || i >= cnt) - goto err_out; - s += i; - cnt -= i; - /* Finally, add the sub authorities. */ - for (j = 0; j < sid->sub_authority_count; j++) { - leauth = sid->sub_authority[j]; - i = snprintf(s, cnt, "-%u", (unsigned int) - le32_to_cpu(leauth)); - if (i < 0 || i >= cnt) - goto err_out; - s += i; - cnt -= i; - } - return sid_str; -err_out: - if (i >= cnt) - i = EMSGSIZE; - else - i = errno; - if (!sid_str_size) - free(sid_str); - errno = i; - return NULL; -} - -/** - * ntfs_generate_guid - generatates a random current guid. - * @guid: [OUT] pointer to a GUID struct to hold the generated guid. - * - * perhaps not a very good random number generator though... - */ -void ntfs_generate_guid(GUID *guid) -{ - unsigned int i; - u8 *p = (u8 *)guid; - - for (i = 0; i < sizeof(GUID); i++) { - p[i] = (u8)(random() & 0xFF); - if (i == 7) - p[7] = (p[7] & 0x0F) | 0x40; - if (i == 8) - p[8] = (p[8] & 0x3F) | 0x80; - } -} - -/** - * ntfs_security_hash - calculate the hash of a security descriptor - * @sd: self-relative security descriptor whose hash to calculate - * @length: size in bytes of the security descritor @sd - * - * Calculate the hash of the self-relative security descriptor @sd of length - * @length bytes. - * - * This hash is used in the $Secure system file as the primary key for the $SDH - * index and is also stored in the header of each security descriptor in the - * $SDS data stream as well as in the index data of both the $SII and $SDH - * indexes. In all three cases it forms part of the SDS_ENTRY_HEADER - * structure. - * - * Return the calculated security hash in little endian. - */ -le32 ntfs_security_hash(const SECURITY_DESCRIPTOR_RELATIVE *sd, const u32 len) -{ - const le32 *pos = (const le32*)sd; - const le32 *end = pos + (len >> 2); - u32 hash = 0; - - while (pos < end) { - hash = le32_to_cpup(pos) + ntfs_rol32(hash, 3); - pos++; - } - return cpu_to_le32(hash); -} - -/* - * Internal read - * copied and pasted from ntfs_fuse_read() and made independent - * of fuse context - */ - -static int ntfs_local_read(ntfs_inode *ni, - ntfschar *stream_name, int stream_name_len, - char *buf, size_t size, off_t offset) -{ - ntfs_attr *na = NULL; - int res, total = 0; - - na = ntfs_attr_open(ni, AT_DATA, stream_name, stream_name_len); - if (!na) { - res = -errno; - goto exit; - } - if ((size_t)offset < (size_t)na->data_size) { - if (offset + size > (size_t)na->data_size) - size = na->data_size - offset; - while (size) { - res = ntfs_attr_pread(na, offset, size, buf); - if ((off_t)res < (off_t)size) - ntfs_log_perror("ntfs_attr_pread partial read " - "(%lld : %lld <> %d)", - (long long)offset, - (long long)size, res); - if (res <= 0) { - res = -errno; - goto exit; - } - size -= res; - offset += res; - total += res; - } - } - res = total; -exit: - if (na) - ntfs_attr_close(na); - return res; -} - - -/* - * Internal write - * copied and pasted from ntfs_fuse_write() and made independent - * of fuse context - */ - -static int ntfs_local_write(ntfs_inode *ni, - ntfschar *stream_name, int stream_name_len, - char *buf, size_t size, off_t offset) -{ - ntfs_attr *na = NULL; - int res, total = 0; - - na = ntfs_attr_open(ni, AT_DATA, stream_name, stream_name_len); - if (!na) { - res = -errno; - goto exit; - } - while (size) { - res = ntfs_attr_pwrite(na, offset, size, buf); - if (res < (s64)size) - ntfs_log_perror("ntfs_attr_pwrite partial write (%lld: " - "%lld <> %d)", (long long)offset, - (long long)size, res); - if (res <= 0) { - res = -errno; - goto exit; - } - size -= res; - offset += res; - total += res; - } - res = total; -exit: - if (na) - ntfs_attr_close(na); - return res; -} - - -/* - * Get the first entry of current index block - * cut and pasted form ntfs_ie_get_first() in index.c - */ - -static INDEX_ENTRY *ntfs_ie_get_first(INDEX_HEADER *ih) -{ - return (INDEX_ENTRY*)((u8*)ih + le32_to_cpu(ih->entries_offset)); -} - -/* - * Stuff a 256KB block into $SDS before writing descriptors - * into the block. - * - * This prevents $SDS from being automatically declared as sparse - * when the second copy of the first security descriptor is written - * 256KB further ahead. - * - * Having $SDS declared as a sparse file is not wrong by itself - * and chkdsk leaves it as a sparse file. It does however complain - * and add a sparse flag (0x0200) into field file_attributes of - * STANDARD_INFORMATION of $Secure. This probably means that a - * sparse attribute (ATTR_IS_SPARSE) is only allowed in sparse - * files (FILE_ATTR_SPARSE_FILE). - * - * Windows normally does not convert to sparse attribute or sparse - * file. Stuffing is just a way to get to the same result. - */ - -static int entersecurity_stuff(ntfs_volume *vol, off_t offs) -{ - int res; - int written; - unsigned long total; - char *stuff; - - res = 0; - total = 0; - stuff = (char*)ntfs_malloc(STUFFSZ); - if (stuff) { - memset(stuff, 0, STUFFSZ); - do { - written = ntfs_local_write(vol->secure_ni, - STREAM_SDS, 4, stuff, STUFFSZ, offs); - if (written == STUFFSZ) { - total += STUFFSZ; - offs += STUFFSZ; - } else { - errno = ENOSPC; - res = -1; - } - } while (!res && (total < ALIGN_SDS_BLOCK)); - free(stuff); - } else { - errno = ENOMEM; - res = -1; - } - return (res); -} - -/* - * Enter a new security descriptor into $Secure (data only) - * it has to be written twice with an offset of 256KB - * - * Should only be called by entersecurityattr() to ensure consistency - * - * Returns zero if sucessful - */ - -static int entersecurity_data(ntfs_volume *vol, - const SECURITY_DESCRIPTOR_RELATIVE *attr, s64 attrsz, - le32 hash, le32 keyid, off_t offs, int gap) -{ - int res; - int written1; - int written2; - char *fullattr; - int fullsz; - SECURITY_DESCRIPTOR_HEADER *phsds; - - res = -1; - fullsz = attrsz + gap + sizeof(SECURITY_DESCRIPTOR_HEADER); - fullattr = (char*)ntfs_malloc(fullsz); - if (fullattr) { - /* - * Clear the gap from previous descriptor - * this could be useful for appending the second - * copy to the end of file. When creating a new - * 256K block, the gap is cleared while writing - * the first copy - */ - if (gap) - memset(fullattr,0,gap); - memcpy(&fullattr[gap + sizeof(SECURITY_DESCRIPTOR_HEADER)], - attr,attrsz); - phsds = (SECURITY_DESCRIPTOR_HEADER*)&fullattr[gap]; - phsds->hash = hash; - phsds->security_id = keyid; - phsds->offset = cpu_to_le64(offs); - phsds->length = cpu_to_le32(fullsz - gap); - written1 = ntfs_local_write(vol->secure_ni, - STREAM_SDS, 4, fullattr, fullsz, - offs - gap); - written2 = ntfs_local_write(vol->secure_ni, - STREAM_SDS, 4, fullattr, fullsz, - offs - gap + ALIGN_SDS_BLOCK); - if ((written1 == fullsz) - && (written2 == written1)) - res = 0; - else - errno = ENOSPC; - free(fullattr); - } else - errno = ENOMEM; - return (res); -} - -/* - * Enter a new security descriptor in $Secure (indexes only) - * - * Should only be called by entersecurityattr() to ensure consistency - * - * Returns zero if sucessful - */ - -static int entersecurity_indexes(ntfs_volume *vol, s64 attrsz, - le32 hash, le32 keyid, off_t offs) -{ - union { - struct { - le32 dataoffsl; - le32 dataoffsh; - } parts; - le64 all; - } realign; - int res; - ntfs_index_context *xsii; - ntfs_index_context *xsdh; - struct SII newsii; - struct SDH newsdh; - - res = -1; - /* enter a new $SII record */ - - xsii = vol->secure_xsii; - ntfs_index_ctx_reinit(xsii); - newsii.offs = const_cpu_to_le16(20); - newsii.size = const_cpu_to_le16(sizeof(struct SII) - 20); - newsii.fill1 = const_cpu_to_le32(0); - newsii.indexsz = const_cpu_to_le16(sizeof(struct SII)); - newsii.indexksz = const_cpu_to_le16(sizeof(SII_INDEX_KEY)); - newsii.flags = const_cpu_to_le16(0); - newsii.fill2 = const_cpu_to_le16(0); - newsii.keysecurid = keyid; - newsii.hash = hash; - newsii.securid = keyid; - realign.all = cpu_to_le64(offs); - newsii.dataoffsh = realign.parts.dataoffsh; - newsii.dataoffsl = realign.parts.dataoffsl; - newsii.datasize = cpu_to_le32(attrsz - + sizeof(SECURITY_DESCRIPTOR_HEADER)); - if (!ntfs_ie_add(xsii,(INDEX_ENTRY*)&newsii)) { - - /* enter a new $SDH record */ - - xsdh = vol->secure_xsdh; - ntfs_index_ctx_reinit(xsdh); - newsdh.offs = const_cpu_to_le16(24); - newsdh.size = const_cpu_to_le16( - sizeof(SECURITY_DESCRIPTOR_HEADER)); - newsdh.fill1 = const_cpu_to_le32(0); - newsdh.indexsz = const_cpu_to_le16( - sizeof(struct SDH)); - newsdh.indexksz = const_cpu_to_le16( - sizeof(SDH_INDEX_KEY)); - newsdh.flags = const_cpu_to_le16(0); - newsdh.fill2 = const_cpu_to_le16(0); - newsdh.keyhash = hash; - newsdh.keysecurid = keyid; - newsdh.hash = hash; - newsdh.securid = keyid; - newsdh.dataoffsh = realign.parts.dataoffsh; - newsdh.dataoffsl = realign.parts.dataoffsl; - newsdh.datasize = cpu_to_le32(attrsz - + sizeof(SECURITY_DESCRIPTOR_HEADER)); - /* special filler value, Windows generally */ - /* fills with 0x00490049, sometimes with zero */ - newsdh.fill3 = const_cpu_to_le32(0x00490049); - if (!ntfs_ie_add(xsdh,(INDEX_ENTRY*)&newsdh)) - res = 0; - } - return (res); -} - -/* - * Enter a new security descriptor in $Secure (data and indexes) - * Returns id of entry, or zero if there is a problem. - * (should not be called for NTFS version < 3.0) - * - * important : calls have to be serialized, however no locking is - * needed while fuse is not multithreaded - */ - -static le32 entersecurityattr(ntfs_volume *vol, - const SECURITY_DESCRIPTOR_RELATIVE *attr, s64 attrsz, - le32 hash) -{ - union { - struct { - le32 dataoffsl; - le32 dataoffsh; - } parts; - le64 all; - } realign; - le32 securid; - le32 keyid; - u32 newkey; - off_t offs; - int gap; - int size; - BOOL found; - struct SII *psii; - INDEX_ENTRY *entry; - INDEX_ENTRY *next; - ntfs_index_context *xsii; - int retries; - ntfs_attr *na; - int olderrno; - - /* find the first available securid beyond the last key */ - /* in $Secure:$SII. This also determines the first */ - /* available location in $Secure:$SDS, as this stream */ - /* is always appended to and the id's are allocated */ - /* in sequence */ - - securid = const_cpu_to_le32(0); - xsii = vol->secure_xsii; - ntfs_index_ctx_reinit(xsii); - offs = size = 0; - keyid = const_cpu_to_le32(-1); - olderrno = errno; - found = !ntfs_index_lookup((char*)&keyid, - sizeof(SII_INDEX_KEY), xsii); - if (!found && (errno != ENOENT)) { - ntfs_log_perror("Inconsistency in index $SII"); - psii = (struct SII*)NULL; - } else { - /* restore errno to avoid misinterpretation */ - errno = olderrno; - entry = xsii->entry; - psii = (struct SII*)xsii->entry; - } - if (psii) { - /* - * Get last entry in block, but must get first one - * one first, as we should already be beyond the - * last one. For some reason the search for the last - * entry sometimes does not return the last block... - * we assume this can only happen in root block - */ - if (xsii->is_in_root) - entry = ntfs_ie_get_first - ((INDEX_HEADER*)&xsii->ir->index); - else - entry = ntfs_ie_get_first - ((INDEX_HEADER*)&xsii->ib->index); - /* - * All index blocks should be at least half full - * so there always is a last entry but one, - * except when creating the first entry in index root. - * This was however found not to be true : chkdsk - * sometimes deletes all the (unused) keys in the last - * index block without rebalancing the tree. - * When this happens, a new search is restarted from - * the smallest key. - */ - keyid = const_cpu_to_le32(0); - retries = 0; - while (entry) { - next = ntfs_index_next(entry,xsii); - if (next) { - psii = (struct SII*)next; - /* save last key and */ - /* available position */ - keyid = psii->keysecurid; - realign.parts.dataoffsh - = psii->dataoffsh; - realign.parts.dataoffsl - = psii->dataoffsl; - offs = le64_to_cpu(realign.all); - size = le32_to_cpu(psii->datasize); - } - entry = next; - if (!entry && !keyid && !retries) { - /* search failed, retry from smallest key */ - ntfs_index_ctx_reinit(xsii); - found = !ntfs_index_lookup((char*)&keyid, - sizeof(SII_INDEX_KEY), xsii); - if (!found && (errno != ENOENT)) { - ntfs_log_perror("Index $SII is broken"); - } else { - /* restore errno */ - errno = olderrno; - entry = xsii->entry; - } - retries++; - } - } - } - if (!keyid) { - /* - * could not find any entry, before creating the first - * entry, make a double check by making sure size of $SII - * is less than needed for one entry - */ - securid = const_cpu_to_le32(0); - na = ntfs_attr_open(vol->secure_ni,AT_INDEX_ROOT,sii_stream,4); - if (na) { - if ((size_t)na->data_size < sizeof(struct SII)) { - ntfs_log_error("Creating the first security_id\n"); - securid = const_cpu_to_le32(FIRST_SECURITY_ID); - } - ntfs_attr_close(na); - } - if (!securid) { - ntfs_log_error("Error creating a security_id\n"); - errno = EIO; - } - } else { - newkey = le32_to_cpu(keyid) + 1; - securid = cpu_to_le32(newkey); - } - /* - * The security attr has to be written twice 256KB - * apart. This implies that offsets like - * 0x40000*odd_integer must be left available for - * the second copy. So align to next block when - * the last byte overflows on a wrong block. - */ - - if (securid) { - gap = (-size) & (ALIGN_SDS_ENTRY - 1); - offs += gap + size; - if ((offs + attrsz + sizeof(SECURITY_DESCRIPTOR_HEADER) - 1) - & ALIGN_SDS_BLOCK) { - offs = ((offs + attrsz - + sizeof(SECURITY_DESCRIPTOR_HEADER) - 1) - | (ALIGN_SDS_BLOCK - 1)) + 1; - } - if (!(offs & (ALIGN_SDS_BLOCK - 1))) - entersecurity_stuff(vol, offs); - /* - * now write the security attr to storage : - * first data, then SII, then SDH - * If failure occurs while writing SDS, data will never - * be accessed through indexes, and will be overwritten - * by the next allocated descriptor - * If failure occurs while writing SII, the id has not - * recorded and will be reallocated later - * If failure occurs while writing SDH, the space allocated - * in SDS or SII will not be reused, an inconsistency - * will persist with no significant consequence - */ - if (entersecurity_data(vol, attr, attrsz, hash, securid, offs, gap) - || entersecurity_indexes(vol, attrsz, hash, securid, offs)) - securid = const_cpu_to_le32(0); - } - /* inode now is dirty, synchronize it all */ - ntfs_index_entry_mark_dirty(vol->secure_xsii); - ntfs_index_ctx_reinit(vol->secure_xsii); - ntfs_index_entry_mark_dirty(vol->secure_xsdh); - ntfs_index_ctx_reinit(vol->secure_xsdh); - NInoSetDirty(vol->secure_ni); - if (ntfs_inode_sync(vol->secure_ni)) - ntfs_log_perror("Could not sync $Secure\n"); - return (securid); -} - -/* - * Find a matching security descriptor in $Secure, - * if none, allocate a new id and write the descriptor to storage - * Returns id of entry, or zero if there is a problem. - * - * important : calls have to be serialized, however no locking is - * needed while fuse is not multithreaded - */ - -static le32 setsecurityattr(ntfs_volume *vol, - const SECURITY_DESCRIPTOR_RELATIVE *attr, s64 attrsz) -{ - struct SDH *psdh; /* this is an image of index (le) */ - union { - struct { - le32 dataoffsl; - le32 dataoffsh; - } parts; - le64 all; - } realign; - BOOL found; - BOOL collision; - size_t size; - size_t rdsize; - s64 offs; - int res; - ntfs_index_context *xsdh; - char *oldattr; - SDH_INDEX_KEY key; - INDEX_ENTRY *entry; - le32 securid; - le32 hash; - int olderrno; - - hash = ntfs_security_hash(attr,attrsz); - oldattr = (char*)NULL; - securid = const_cpu_to_le32(0); - res = 0; - xsdh = vol->secure_xsdh; - if (vol->secure_ni && xsdh && !vol->secure_reentry++) { - ntfs_index_ctx_reinit(xsdh); - /* - * find the nearest key as (hash,0) - * (do not search for partial key : in case of collision, - * it could return a key which is not the first one which - * collides) - */ - key.hash = hash; - key.security_id = const_cpu_to_le32(0); - olderrno = errno; - found = !ntfs_index_lookup((char*)&key, - sizeof(SDH_INDEX_KEY), xsdh); - if (!found && (errno != ENOENT)) - ntfs_log_perror("Inconsistency in index $SDH"); - else { - /* restore errno to avoid misinterpretation */ - errno = olderrno; - entry = xsdh->entry; - found = FALSE; - /* - * lookup() may return a node with no data, - * if so get next - */ - if (entry->ie_flags & INDEX_ENTRY_END) - entry = ntfs_index_next(entry,xsdh); - do { - collision = FALSE; - psdh = (struct SDH*)entry; - if (psdh) - size = (size_t) le32_to_cpu(psdh->datasize) - - sizeof(SECURITY_DESCRIPTOR_HEADER); - else size = 0; - /* if hash is not the same, the key is not present */ - if (psdh && (size > 0) - && (psdh->keyhash == hash)) { - /* if hash is the same */ - /* check the whole record */ - realign.parts.dataoffsh = psdh->dataoffsh; - realign.parts.dataoffsl = psdh->dataoffsl; - offs = le64_to_cpu(realign.all) - + sizeof(SECURITY_DESCRIPTOR_HEADER); - oldattr = (char*)ntfs_malloc(size); - if (oldattr) { - rdsize = ntfs_local_read( - vol->secure_ni, - STREAM_SDS, 4, - oldattr, size, offs); - found = (rdsize == size) - && !memcmp(oldattr,attr,size); - free(oldattr); - /* if the records do not compare */ - /* (hash collision), try next one */ - if (!found) { - entry = ntfs_index_next( - entry,xsdh); - collision = TRUE; - } - } else - res = ENOMEM; - } - } while (collision && entry); - if (found) - securid = psdh->keysecurid; - else { - if (res) { - errno = res; - securid = const_cpu_to_le32(0); - } else { - /* - * no matching key : - * have to build a new one - */ - securid = entersecurityattr(vol, - attr, attrsz, hash); - } - } - } - } - if (--vol->secure_reentry) - ntfs_log_perror("Reentry error, check no multithreading\n"); - return (securid); -} - - -/* - * Update the security descriptor of a file - * Either as an attribute (complying with pre v3.x NTFS version) - * or, when possible, as an entry in $Secure (for NTFS v3.x) - * - * returns 0 if success - */ - -static int update_secur_descr(ntfs_volume *vol, - char *newattr, ntfs_inode *ni) -{ - int newattrsz; - int written; - int res; - ntfs_attr *na; - - newattrsz = ntfs_attr_size(newattr); - -#if !FORCE_FORMAT_v1x - if ((vol->major_ver < 3) || !vol->secure_ni) { -#endif - - /* update for NTFS format v1.x */ - - /* update the old security attribute */ - na = ntfs_attr_open(ni, AT_SECURITY_DESCRIPTOR, AT_UNNAMED, 0); - if (na) { - /* resize attribute */ - res = ntfs_attr_truncate(na, (s64) newattrsz); - /* overwrite value */ - if (!res) { - written = (int)ntfs_attr_pwrite(na, (s64) 0, - (s64) newattrsz, newattr); - if (written != newattrsz) { - ntfs_log_error("Failed to update " - "a v1.x security descriptor\n"); - errno = EIO; - res = -1; - } - } - - ntfs_attr_close(na); - /* if old security attribute was found, also */ - /* truncate standard information attribute to v1.x */ - /* this is needed when security data is wanted */ - /* as v1.x though volume is formatted for v3.x */ - na = ntfs_attr_open(ni, AT_STANDARD_INFORMATION, - AT_UNNAMED, 0); - if (na) { - clear_nino_flag(ni, v3_Extensions); - /* - * Truncating the record does not sweep extensions - * from copy in memory. Clear security_id to be safe - */ - ni->security_id = const_cpu_to_le32(0); - res = ntfs_attr_truncate(na, (s64)48); - ntfs_attr_close(na); - clear_nino_flag(ni, v3_Extensions); - } - } else { - /* - * insert the new security attribute if there - * were none - */ - res = ntfs_attr_add(ni, AT_SECURITY_DESCRIPTOR, - AT_UNNAMED, 0, (u8*)newattr, - (s64) newattrsz); - } -#if !FORCE_FORMAT_v1x - } else { - - /* update for NTFS format v3.x */ - - le32 securid; - - securid = setsecurityattr(vol, - (const SECURITY_DESCRIPTOR_RELATIVE*)newattr, - (s64)newattrsz); - if (securid) { - na = ntfs_attr_open(ni, AT_STANDARD_INFORMATION, - AT_UNNAMED, 0); - if (na) { - res = 0; - if (!test_nino_flag(ni, v3_Extensions)) { - /* expand standard information attribute to v3.x */ - res = ntfs_attr_truncate(na, - (s64)sizeof(STANDARD_INFORMATION)); - ni->owner_id = const_cpu_to_le32(0); - ni->quota_charged = const_cpu_to_le64(0); - ni->usn = const_cpu_to_le64(0); - ntfs_attr_remove(ni, - AT_SECURITY_DESCRIPTOR, - AT_UNNAMED, 0); - } - set_nino_flag(ni, v3_Extensions); - ni->security_id = securid; - ntfs_attr_close(na); - } else { - ntfs_log_error("Failed to update " - "standard informations\n"); - errno = EIO; - res = -1; - } - } else - res = -1; - } -#endif - - /* mark node as dirty */ - NInoSetDirty(ni); - return (res); -} - -/* - * Upgrade the security descriptor of a file - * This is intended to allow graceful upgrades for files which - * were created in previous versions, with a security attributes - * and no security id. - * - * It will allocate a security id and replace the individual - * security attribute by a reference to the global one - * - * Special files are not upgraded (currently / and files in - * directories /$*) - * - * Though most code is similar to update_secur_desc() it has - * been kept apart to facilitate the further processing of - * special cases or even to remove it if found dangerous. - * - * returns 0 if success, - * 1 if not upgradable. This is not an error. - * -1 if there is a problem - */ - -static int upgrade_secur_desc(ntfs_volume *vol, - const char *attr, ntfs_inode *ni) -{ - int attrsz; - int res; - le32 securid; - ntfs_attr *na; - - /* - * upgrade requires NTFS format v3.x - * also refuse upgrading for special files - * whose number is less than FILE_first_user - */ - - if ((vol->major_ver >= 3) - && (ni->mft_no >= FILE_first_user)) { - attrsz = ntfs_attr_size(attr); - securid = setsecurityattr(vol, - (const SECURITY_DESCRIPTOR_RELATIVE*)attr, - (s64)attrsz); - if (securid) { - na = ntfs_attr_open(ni, AT_STANDARD_INFORMATION, - AT_UNNAMED, 0); - if (na) { - res = 0; - /* expand standard information attribute to v3.x */ - res = ntfs_attr_truncate(na, - (s64)sizeof(STANDARD_INFORMATION)); - ni->owner_id = const_cpu_to_le32(0); - ni->quota_charged = const_cpu_to_le64(0); - ni->usn = const_cpu_to_le64(0); - ntfs_attr_remove(ni, AT_SECURITY_DESCRIPTOR, - AT_UNNAMED, 0); - set_nino_flag(ni, v3_Extensions); - ni->security_id = securid; - ntfs_attr_close(na); - } else { - ntfs_log_error("Failed to upgrade " - "standard informations\n"); - errno = EIO; - res = -1; - } - } else - res = -1; - /* mark node as dirty */ - NInoSetDirty(ni); - } else - res = 1; - - return (res); -} - -/* - * Optional simplified checking of group membership - * - * This only takes into account the groups defined in - * /etc/group at initialization time. - * It does not take into account the groups dynamically set by - * setgroups() nor the changes in /etc/group since initialization - * - * This optional method could be useful if standard checking - * leads to a performance concern. - * - * Should not be called for user root, however the group may be root - * - */ - -static BOOL staticgroupmember(struct SECURITY_CONTEXT *scx, uid_t uid, gid_t gid) -{ - BOOL ingroup; - int grcnt; - gid_t *groups; - struct MAPPING *user; - - ingroup = FALSE; - if (uid) { - user = scx->mapping[MAPUSERS]; - while (user && ((uid_t)user->xid != uid)) - user = user->next; - if (user) { - groups = user->groups; - grcnt = user->grcnt; - while ((--grcnt >= 0) && (groups[grcnt] != gid)) { } - ingroup = (grcnt >= 0); - } - } - return (ingroup); -} - - -/* - * Check whether current thread owner is member of file group - * - * Should not be called for user root, however the group may be root - * - * As indicated by Miklos Szeredi : - * - * The group list is available in - * - * /proc/$PID/task/$TID/status - * - * and fuse supplies TID in get_fuse_context()->pid. The only problem is - * finding out PID, for which I have no good solution, except to iterate - * through all processes. This is rather slow, but may be speeded up - * with caching and heuristics (for single threaded programs PID = TID). - * - * The following implementation gets the group list from - * /proc/$TID/task/$TID/status which apparently exists and - * contains the same data. - */ - -static BOOL groupmember(struct SECURITY_CONTEXT *scx, uid_t uid, gid_t gid) -{ - static char key[] = "\nGroups:"; - char buf[BUFSZ+1]; - char filename[64]; - enum { INKEY, INSEP, INNUM, INEND } state; - int fd; - char c; - int matched; - BOOL ismember; - int got; - char *p; - gid_t grp; - pid_t tid; - - if (scx->vol->secure_flags & (1 << SECURITY_STATICGRPS)) - ismember = staticgroupmember(scx, uid, gid); - else { - ismember = FALSE; /* default return */ - tid = scx->tid; - sprintf(filename,"/proc/%u/task/%u/status",tid,tid); - fd = open(filename,O_RDONLY); - if (fd >= 0) { - got = read(fd, buf, BUFSZ); - buf[got] = 0; - state = INKEY; - matched = 0; - p = buf; - grp = 0; - /* - * A simple automaton to process lines like - * Groups: 14 500 513 - */ - do { - c = *p++; - if (!c) { - /* refill buffer */ - got = read(fd, buf, BUFSZ); - buf[got] = 0; - p = buf; - c = *p++; /* 0 at end of file */ - } - switch (state) { - case INKEY : - if (key[matched] == c) { - if (!key[++matched]) - state = INSEP; - } else - if (key[0] == c) - matched = 1; - else - matched = 0; - break; - case INSEP : - if ((c >= '0') && (c <= '9')) { - grp = c - '0'; - state = INNUM; - } else - if ((c != ' ') && (c != '\t')) - state = INEND; - break; - case INNUM : - if ((c >= '0') && (c <= '9')) - grp = grp*10 + c - '0'; - else { - ismember = (grp == gid); - if ((c != ' ') && (c != '\t')) - state = INEND; - else - state = INSEP; - } - default : - break; - } - } while (!ismember && c && (state != INEND)); - close(fd); - if (!c) - ntfs_log_error("No group record found in %s\n",filename); - } else - ntfs_log_error("Could not open %s\n",filename); - } - return (ismember); -} - -/* - * Cacheing is done two-way : - * - from uid, gid and perm to securid (CACHED_SECURID) - * - from a securid to uid, gid and perm (CACHED_PERMISSIONS) - * - * CACHED_SECURID data is kept in a most-recent-first list - * which should not be too long to be efficient. Its optimal - * size is depends on usage and is hard to determine. - * - * CACHED_PERMISSIONS data is kept in a two-level indexed array. It - * is optimal at the expense of storage. Use of a most-recent-first - * list would save memory and provide similar performances for - * standard usage, but not for file servers with too many file - * owners - * - * CACHED_PERMISSIONS_LEGACY is a special case for CACHED_PERMISSIONS - * for legacy directories which were not allocated a security_id - * it is organized in a most-recent-first list. - * - * In main caches, data is never invalidated, as the meaning of - * a security_id only changes when user mapping is changed, which - * current implies remounting. However returned entries may be - * overwritten at next update, so data has to be copied elsewhere - * before another cache update is made. - * In legacy cache, data has to be invalidated when protection is - * changed. - * - * Though the same data may be found in both list, they - * must be kept separately : the interpretation of ACL - * in both direction are approximations which could be non - * reciprocal for some configuration of the user mapping data - * - * During the process of recompiling ntfs-3g from a tgz archive, - * security processing added 7.6% to the cpu time used by ntfs-3g - * and 30% if the cache is disabled. - */ - -static struct PERMISSIONS_CACHE *create_caches(struct SECURITY_CONTEXT *scx, - u32 securindex) -{ - struct PERMISSIONS_CACHE *cache; - unsigned int index1; - unsigned int i; - - cache = (struct PERMISSIONS_CACHE*)NULL; - /* create the first permissions blocks */ - index1 = securindex >> CACHE_PERMISSIONS_BITS; - cache = (struct PERMISSIONS_CACHE*) - ntfs_malloc(sizeof(struct PERMISSIONS_CACHE) - + index1*sizeof(struct CACHED_PERMISSIONS*)); - if (cache) { - cache->head.last = index1; - cache->head.p_reads = 0; - cache->head.p_hits = 0; - cache->head.p_writes = 0; - *scx->pseccache = cache; - for (i=0; i<=index1; i++) - cache->cachetable[i] - = (struct CACHED_PERMISSIONS*)NULL; - } - return (cache); -} - -/* - * Free memory used by caches - * The only purpose is to facilitate the detection of memory leaks - */ - -static void free_caches(struct SECURITY_CONTEXT *scx) -{ - unsigned int index1; - struct PERMISSIONS_CACHE *pseccache; - - pseccache = *scx->pseccache; - if (pseccache) { - for (index1=0; index1<=pseccache->head.last; index1++) - if (pseccache->cachetable[index1]) { -#if POSIXACLS - struct CACHED_PERMISSIONS *cacheentry; - unsigned int index2; - - for (index2=0; index2<(1<< CACHE_PERMISSIONS_BITS); index2++) { - cacheentry = &pseccache->cachetable[index1][index2]; - if (cacheentry->valid - && cacheentry->pxdesc) - free(cacheentry->pxdesc); - } -#endif - free(pseccache->cachetable[index1]); - } - free(pseccache); - } -} - -static int compare(const struct CACHED_SECURID *cached, - const struct CACHED_SECURID *item) -{ -#if POSIXACLS - size_t csize; - size_t isize; - - /* only compare data and sizes */ - csize = (cached->variable ? - sizeof(struct POSIX_ACL) - + (((struct POSIX_SECURITY*)cached->variable)->acccnt - + ((struct POSIX_SECURITY*)cached->variable)->defcnt) - *sizeof(struct POSIX_ACE) : - 0); - isize = (item->variable ? - sizeof(struct POSIX_ACL) - + (((struct POSIX_SECURITY*)item->variable)->acccnt - + ((struct POSIX_SECURITY*)item->variable)->defcnt) - *sizeof(struct POSIX_ACE) : - 0); - return ((cached->uid != item->uid) - || (cached->gid != item->gid) - || (cached->dmode != item->dmode) - || (csize != isize) - || (csize - && isize - && memcmp(&((struct POSIX_SECURITY*)cached->variable)->acl, - &((struct POSIX_SECURITY*)item->variable)->acl, csize))); -#else - return ((cached->uid != item->uid) - || (cached->gid != item->gid) - || (cached->dmode != item->dmode)); -#endif -} - -static int leg_compare(const struct CACHED_PERMISSIONS_LEGACY *cached, - const struct CACHED_PERMISSIONS_LEGACY *item) -{ - return (cached->mft_no != item->mft_no); -} - -/* - * Resize permission cache table - * do not call unless resizing is needed - * - * If allocation fails, the cache size is not updated - * Lack of memory is not considered as an error, the cache is left - * consistent and errno is not set. - */ - -static void resize_cache(struct SECURITY_CONTEXT *scx, - u32 securindex) -{ - struct PERMISSIONS_CACHE *oldcache; - struct PERMISSIONS_CACHE *newcache; - int newcnt; - int oldcnt; - unsigned int index1; - unsigned int i; - - oldcache = *scx->pseccache; - index1 = securindex >> CACHE_PERMISSIONS_BITS; - newcnt = index1 + 1; - if (newcnt <= ((CACHE_PERMISSIONS_SIZE - + (1 << CACHE_PERMISSIONS_BITS) - - 1) >> CACHE_PERMISSIONS_BITS)) { - /* expand cache beyond current end, do not use realloc() */ - /* to avoid losing data when there is no more memory */ - oldcnt = oldcache->head.last + 1; - newcache = (struct PERMISSIONS_CACHE*) - ntfs_malloc( - sizeof(struct PERMISSIONS_CACHE) - + (newcnt - 1)*sizeof(struct CACHED_PERMISSIONS*)); - if (newcache) { - memcpy(newcache,oldcache, - sizeof(struct PERMISSIONS_CACHE) - + (oldcnt - 1)*sizeof(struct CACHED_PERMISSIONS*)); - free(oldcache); - /* mark new entries as not valid */ - for (i=newcache->head.last+1; i<=index1; i++) - newcache->cachetable[i] - = (struct CACHED_PERMISSIONS*)NULL; - newcache->head.last = index1; - *scx->pseccache = newcache; - } - } -} - -/* - * Enter uid, gid and mode into cache, if possible - * - * returns the updated or created cache entry, - * or NULL if not possible (typically if there is no - * security id associated) - */ - -#if POSIXACLS -static struct CACHED_PERMISSIONS *enter_cache(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, uid_t uid, gid_t gid, - struct POSIX_SECURITY *pxdesc) -#else -static struct CACHED_PERMISSIONS *enter_cache(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, uid_t uid, gid_t gid, mode_t mode) -#endif -{ - struct CACHED_PERMISSIONS *cacheentry; - struct CACHED_PERMISSIONS *cacheblock; - struct PERMISSIONS_CACHE *pcache; - u32 securindex; -#if POSIXACLS - int pxsize; - struct POSIX_SECURITY *pxcached; -#endif - unsigned int index1; - unsigned int index2; - int i; - - /* cacheing is only possible if a security_id has been defined */ - if (test_nino_flag(ni, v3_Extensions) - && ni->security_id) { - /* - * Immediately test the most frequent situation - * where the entry exists - */ - securindex = le32_to_cpu(ni->security_id); - index1 = securindex >> CACHE_PERMISSIONS_BITS; - index2 = securindex & ((1 << CACHE_PERMISSIONS_BITS) - 1); - pcache = *scx->pseccache; - if (pcache - && (pcache->head.last >= index1) - && pcache->cachetable[index1]) { - cacheentry = &pcache->cachetable[index1][index2]; - cacheentry->uid = uid; - cacheentry->gid = gid; -#if POSIXACLS - if (cacheentry->valid && cacheentry->pxdesc) - free(cacheentry->pxdesc); - if (pxdesc) { - pxsize = sizeof(struct POSIX_SECURITY) - + (pxdesc->acccnt + pxdesc->defcnt)*sizeof(struct POSIX_ACE); - pxcached = (struct POSIX_SECURITY*)malloc(pxsize); - if (pxcached) { - memcpy(pxcached, pxdesc, pxsize); - cacheentry->pxdesc = pxcached; - } else { - cacheentry->valid = 0; - cacheentry = (struct CACHED_PERMISSIONS*)NULL; - } - cacheentry->mode = pxdesc->mode & 07777; - } else - cacheentry->pxdesc = (struct POSIX_SECURITY*)NULL; -#else - cacheentry->mode = mode & 07777; -#endif - cacheentry->inh_fileid = const_cpu_to_le32(0); - cacheentry->inh_dirid = const_cpu_to_le32(0); - cacheentry->valid = 1; - pcache->head.p_writes++; - } else { - if (!pcache) { - /* create the first cache block */ - pcache = create_caches(scx, securindex); - } else { - if (index1 > pcache->head.last) { - resize_cache(scx, securindex); - pcache = *scx->pseccache; - } - } - /* allocate block, if cache table was allocated */ - if (pcache && (index1 <= pcache->head.last)) { - cacheblock = (struct CACHED_PERMISSIONS*) - malloc(sizeof(struct CACHED_PERMISSIONS) - << CACHE_PERMISSIONS_BITS); - pcache->cachetable[index1] = cacheblock; - for (i=0; i<(1 << CACHE_PERMISSIONS_BITS); i++) - cacheblock[i].valid = 0; - cacheentry = &cacheblock[index2]; - if (cacheentry) { - cacheentry->uid = uid; - cacheentry->gid = gid; -#if POSIXACLS - if (pxdesc) { - pxsize = sizeof(struct POSIX_SECURITY) - + (pxdesc->acccnt + pxdesc->defcnt)*sizeof(struct POSIX_ACE); - pxcached = (struct POSIX_SECURITY*)malloc(pxsize); - if (pxcached) { - memcpy(pxcached, pxdesc, pxsize); - cacheentry->pxdesc = pxcached; - } else { - cacheentry->valid = 0; - cacheentry = (struct CACHED_PERMISSIONS*)NULL; - } - cacheentry->mode = pxdesc->mode & 07777; - } else - cacheentry->pxdesc = (struct POSIX_SECURITY*)NULL; -#else - cacheentry->mode = mode & 07777; -#endif - cacheentry->inh_fileid = const_cpu_to_le32(0); - cacheentry->inh_dirid = const_cpu_to_le32(0); - cacheentry->valid = 1; - pcache->head.p_writes++; - } - } else - cacheentry = (struct CACHED_PERMISSIONS*)NULL; - } - } else { - cacheentry = (struct CACHED_PERMISSIONS*)NULL; -#if CACHE_LEGACY_SIZE - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - struct CACHED_PERMISSIONS_LEGACY wanted; - struct CACHED_PERMISSIONS_LEGACY *legacy; - - wanted.perm.uid = uid; - wanted.perm.gid = gid; -#if POSIXACLS - wanted.perm.mode = pxdesc->mode & 07777; - wanted.perm.inh_fileid = const_cpu_to_le32(0); - wanted.perm.inh_dirid = const_cpu_to_le32(0); - wanted.mft_no = ni->mft_no; - wanted.variable = (void*)pxdesc; - wanted.varsize = sizeof(struct POSIX_SECURITY) - + (pxdesc->acccnt + pxdesc->defcnt)*sizeof(struct POSIX_ACE); -#else - wanted.perm.mode = mode & 07777; - wanted.perm.inh_fileid = const_cpu_to_le32(0); - wanted.perm.inh_dirid = const_cpu_to_le32(0); - wanted.mft_no = ni->mft_no; - wanted.variable = (void*)NULL; - wanted.varsize = 0; -#endif - legacy = (struct CACHED_PERMISSIONS_LEGACY*)ntfs_enter_cache( - scx->vol->legacy_cache, GENERIC(&wanted), - (cache_compare)leg_compare); - if (legacy) { - cacheentry = &legacy->perm; -#if POSIXACLS - /* - * give direct access to the cached pxdesc - * in the permissions structure - */ - cacheentry->pxdesc = legacy->variable; -#endif - } - } -#endif - } - return (cacheentry); -} - -/* - * Fetch owner, group and permission of a file, if cached - * - * Beware : do not use the returned entry after a cache update : - * the cache may be relocated making the returned entry meaningless - * - * returns the cache entry, or NULL if not available - */ - -static struct CACHED_PERMISSIONS *fetch_cache(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni) -{ - struct CACHED_PERMISSIONS *cacheentry; - struct PERMISSIONS_CACHE *pcache; - u32 securindex; - unsigned int index1; - unsigned int index2; - - /* cacheing is only possible if a security_id has been defined */ - cacheentry = (struct CACHED_PERMISSIONS*)NULL; - if (test_nino_flag(ni, v3_Extensions) - && (ni->security_id)) { - securindex = le32_to_cpu(ni->security_id); - index1 = securindex >> CACHE_PERMISSIONS_BITS; - index2 = securindex & ((1 << CACHE_PERMISSIONS_BITS) - 1); - pcache = *scx->pseccache; - if (pcache - && (pcache->head.last >= index1) - && pcache->cachetable[index1]) { - cacheentry = &pcache->cachetable[index1][index2]; - /* reject if entry is not valid */ - if (!cacheentry->valid) - cacheentry = (struct CACHED_PERMISSIONS*)NULL; - else - pcache->head.p_hits++; - if (pcache) - pcache->head.p_reads++; - } - } -#if CACHE_LEGACY_SIZE - else { - cacheentry = (struct CACHED_PERMISSIONS*)NULL; - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - struct CACHED_PERMISSIONS_LEGACY wanted; - struct CACHED_PERMISSIONS_LEGACY *legacy; - - wanted.mft_no = ni->mft_no; - wanted.variable = (void*)NULL; - wanted.varsize = 0; - legacy = (struct CACHED_PERMISSIONS_LEGACY*)ntfs_fetch_cache( - scx->vol->legacy_cache, GENERIC(&wanted), - (cache_compare)leg_compare); - if (legacy) cacheentry = &legacy->perm; - } - } -#endif -#if POSIXACLS - if (cacheentry && !cacheentry->pxdesc) { - ntfs_log_error("No Posix descriptor in cache\n"); - cacheentry = (struct CACHED_PERMISSIONS*)NULL; - } -#endif - return (cacheentry); -} - -/* - * Retrieve a security attribute from $Secure - */ - -static char *retrievesecurityattr(ntfs_volume *vol, SII_INDEX_KEY id) -{ - struct SII *psii; - union { - struct { - le32 dataoffsl; - le32 dataoffsh; - } parts; - le64 all; - } realign; - int found; - size_t size; - size_t rdsize; - s64 offs; - ntfs_inode *ni; - ntfs_index_context *xsii; - char *securattr; - - securattr = (char*)NULL; - ni = vol->secure_ni; - xsii = vol->secure_xsii; - if (ni && xsii) { - ntfs_index_ctx_reinit(xsii); - found = - !ntfs_index_lookup((char*)&id, - sizeof(SII_INDEX_KEY), xsii); - if (found) { - psii = (struct SII*)xsii->entry; - size = - (size_t) le32_to_cpu(psii->datasize) - - sizeof(SECURITY_DESCRIPTOR_HEADER); - /* work around bad alignment problem */ - realign.parts.dataoffsh = psii->dataoffsh; - realign.parts.dataoffsl = psii->dataoffsl; - offs = le64_to_cpu(realign.all) - + sizeof(SECURITY_DESCRIPTOR_HEADER); - - securattr = (char*)ntfs_malloc(size); - if (securattr) { - rdsize = ntfs_local_read( - ni, STREAM_SDS, 4, - securattr, size, offs); - if ((rdsize != size) - || !ntfs_valid_descr(securattr, - rdsize)) { - /* error to be logged by caller */ - free(securattr); - securattr = (char*)NULL; - } - } - } else - if (errno != ENOENT) - ntfs_log_perror("Inconsistency in index $SII"); - } - if (!securattr) { - ntfs_log_error("Failed to retrieve a security descriptor\n"); - errno = EIO; - } - return (securattr); -} - -/* - * Get the security descriptor associated to a file - * - * Either : - * - read the security descriptor attribute (v1.x format) - * - or find the descriptor in $Secure:$SDS (v3.x format) - * - * in both case, sanity checks are done on the attribute and - * the descriptor can be assumed safe - * - * The returned descriptor is dynamically allocated and has to be freed - */ - -static char *getsecurityattr(ntfs_volume *vol, ntfs_inode *ni) -{ - SII_INDEX_KEY securid; - char *securattr; - s64 readallsz; - - /* - * Warning : in some situations, after fixing by chkdsk, - * v3_Extensions are marked present (long standard informations) - * with a default security descriptor inserted in an - * attribute - */ - if (test_nino_flag(ni, v3_Extensions) - && vol->secure_ni && ni->security_id) { - /* get v3.x descriptor in $Secure */ - securid.security_id = ni->security_id; - securattr = retrievesecurityattr(vol,securid); - if (!securattr) - ntfs_log_error("Bad security descriptor for 0x%lx\n", - (long)le32_to_cpu(ni->security_id)); - } else { - /* get v1.x security attribute */ - readallsz = 0; - securattr = ntfs_attr_readall(ni, AT_SECURITY_DESCRIPTOR, - AT_UNNAMED, 0, &readallsz); - if (securattr && !ntfs_valid_descr(securattr, readallsz)) { - ntfs_log_error("Bad security descriptor for inode %lld\n", - (long long)ni->mft_no); - free(securattr); - securattr = (char*)NULL; - } - } - if (!securattr) { - /* - * in some situations, there is no security - * descriptor, and chkdsk does not detect or fix - * anything. This could be a normal situation. - * When this happens, simulate a descriptor with - * minimum rights, so that a real descriptor can - * be created by chown or chmod - */ - ntfs_log_error("No security descriptor found for inode %lld\n", - (long long)ni->mft_no); - securattr = ntfs_build_descr(0, 0, adminsid, adminsid); - } - return (securattr); -} - -#if POSIXACLS - -/* - * Determine which access types to a file are allowed - * according to the relation of current process to the file - * - * Do not call if default_permissions is set - */ - -static int access_check_posix(struct SECURITY_CONTEXT *scx, - struct POSIX_SECURITY *pxdesc, mode_t request, - uid_t uid, gid_t gid) -{ - struct POSIX_ACE *pxace; - int userperms; - int groupperms; - int mask; - BOOL somegroup; - BOOL needgroups; - mode_t perms; - int i; - - perms = pxdesc->mode; - /* owner and root access */ - if (!scx->uid || (uid == scx->uid)) { - if (!scx->uid) { - /* root access if owner or other execution */ - if (perms & 0101) - perms = 07777; - else { - /* root access if some group execution */ - groupperms = 0; - mask = 7; - for (i=pxdesc->acccnt-1; i>=0 ; i--) { - pxace = &pxdesc->acl.ace[i]; - switch (pxace->tag) { - case POSIX_ACL_USER_OBJ : - case POSIX_ACL_GROUP_OBJ : - case POSIX_ACL_GROUP : - groupperms |= pxace->perms; - break; - case POSIX_ACL_MASK : - mask = pxace->perms & 7; - break; - default : - break; - } - } - perms = (groupperms & mask & 1) | 6; - } - } else - perms &= 07700; - } else { - /* - * analyze designated users, get mask - * and identify whether we need to check - * the group memberships. The groups are - * not needed when all groups have the - * same permissions as other for the - * requested modes. - */ - userperms = -1; - groupperms = -1; - needgroups = FALSE; - mask = 7; - for (i=pxdesc->acccnt-1; i>=0 ; i--) { - pxace = &pxdesc->acl.ace[i]; - switch (pxace->tag) { - case POSIX_ACL_USER : - if ((uid_t)pxace->id == scx->uid) - userperms = pxace->perms; - break; - case POSIX_ACL_MASK : - mask = pxace->perms & 7; - break; - case POSIX_ACL_GROUP_OBJ : - case POSIX_ACL_GROUP : - if (((pxace->perms & mask) ^ perms) - & (request >> 6) & 7) - needgroups = TRUE; - break; - default : - break; - } - } - /* designated users */ - if (userperms >= 0) - perms = (perms & 07000) + (userperms & mask); - else if (!needgroups) - perms &= 07007; - else { - /* owning group */ - if (!(~(perms >> 3) & request & mask) - && ((gid == scx->gid) - || groupmember(scx, scx->uid, gid))) - perms &= 07070; - else { - /* other groups */ - groupperms = -1; - somegroup = FALSE; - for (i=pxdesc->acccnt-1; i>=0 ; i--) { - pxace = &pxdesc->acl.ace[i]; - if ((pxace->tag == POSIX_ACL_GROUP) - && groupmember(scx, uid, pxace->id)) { - if (!(~pxace->perms & request & mask)) - groupperms = pxace->perms; - somegroup = TRUE; - } - } - if (groupperms >= 0) - perms = (perms & 07000) + (groupperms & mask); - else - if (somegroup) - perms = 0; - else - perms &= 07007; - } - } - } - return (perms); -} - -/* - * Get permissions to access a file - * Takes into account the relation of user to file (owner, group, ...) - * Do no use as mode of the file - * Do no call if default_permissions is set - * - * returns -1 if there is a problem - */ - -static int ntfs_get_perm(struct SECURITY_CONTEXT *scx, - ntfs_inode * ni, mode_t request) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const struct CACHED_PERMISSIONS *cached; - char *securattr; - const SID *usid; /* owner of file/directory */ - const SID *gsid; /* group of file/directory */ - uid_t uid; - gid_t gid; - int perm; - BOOL isdir; - struct POSIX_SECURITY *pxdesc; - - if (!scx->mapping[MAPUSERS]) - perm = 07777; - else { - /* check whether available in cache */ - cached = fetch_cache(scx,ni); - if (cached) { - uid = cached->uid; - gid = cached->gid; - perm = access_check_posix(scx,cached->pxdesc,request,uid,gid); - } else { - perm = 0; /* default to no permission */ - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - != const_cpu_to_le16(0); - securattr = getsecurityattr(scx->vol, ni); - if (securattr) { - phead = (const SECURITY_DESCRIPTOR_RELATIVE*) - securattr; - gsid = (const SID*)& - securattr[le32_to_cpu(phead->group)]; - gid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); -#if OWNERFROMACL - usid = ntfs_acl_owner(securattr); - pxdesc = ntfs_build_permissions_posix(scx->mapping,securattr, - usid, gsid, isdir); - if (pxdesc) - perm = pxdesc->mode & 07777; - else - perm = -1; - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#else - usid = (const SID*)& - securattr[le32_to_cpu(phead->owner)]; - pxdesc = ntfs_build_permissions_posix(scx,securattr, - usid, gsid, isdir); - if (pxdesc) - perm = pxdesc->mode & 07777; - else - perm = -1; - if (!perm && ntfs_same_sid(usid, adminsid)) { - uid = find_tenant(scx, securattr); - if (uid) - perm = 0700; - } else - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#endif - /* - * Create a security id if there were none - * and upgrade option is selected - */ - if (!test_nino_flag(ni, v3_Extensions) - && (perm >= 0) - && (scx->vol->secure_flags - & (1 << SECURITY_ADDSECURIDS))) { - upgrade_secur_desc(scx->vol, - securattr, ni); - /* - * fetch owner and group for cacheing - * if there is a securid - */ - } - if (test_nino_flag(ni, v3_Extensions) - && (perm >= 0)) { - enter_cache(scx, ni, uid, - gid, pxdesc); - } - if (pxdesc) { - perm = access_check_posix(scx,pxdesc,request,uid,gid); - free(pxdesc); - } - free(securattr); - } else { - perm = -1; - uid = gid = 0; - } - } - } - return (perm); -} - -/* - * Get a Posix ACL - * - * returns size or -errno if there is a problem - * if size was too small, no copy is done and errno is not set, - * the caller is expected to issue a new call - */ - -int ntfs_get_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - const char *name, char *value, size_t size) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - struct POSIX_SECURITY *pxdesc; - const struct CACHED_PERMISSIONS *cached; - char *securattr; - const SID *usid; /* owner of file/directory */ - const SID *gsid; /* group of file/directory */ - uid_t uid; - gid_t gid; - int perm; - BOOL isdir; - size_t outsize; - - outsize = 0; /* default to error */ - if (!scx->mapping[MAPUSERS]) - errno = ENOTSUP; - else { - /* check whether available in cache */ - cached = fetch_cache(scx,ni); - if (cached) - pxdesc = cached->pxdesc; - else { - securattr = getsecurityattr(scx->vol, ni); - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - != const_cpu_to_le16(0); - if (securattr) { - phead = - (const SECURITY_DESCRIPTOR_RELATIVE*) - securattr; - gsid = (const SID*)& - securattr[le32_to_cpu(phead->group)]; -#if OWNERFROMACL - usid = ntfs_acl_owner(securattr); -#else - usid = (const SID*)& - securattr[le32_to_cpu(phead->owner)]; -#endif - pxdesc = ntfs_build_permissions_posix(scx->mapping,securattr, - usid, gsid, isdir); - - /* - * fetch owner and group for cacheing - */ - if (pxdesc) { - perm = pxdesc->mode & 07777; - /* - * Create a security id if there were none - * and upgrade option is selected - */ - if (!test_nino_flag(ni, v3_Extensions) - && (scx->vol->secure_flags - & (1 << SECURITY_ADDSECURIDS))) { - upgrade_secur_desc(scx->vol, - securattr, ni); - } -#if OWNERFROMACL - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#else - if (!perm && ntfs_same_sid(usid, adminsid)) { - uid = find_tenant(scx, - securattr); - if (uid) - perm = 0700; - } else - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#endif - gid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); - if (pxdesc->tagsset & POSIX_ACL_EXTENSIONS) - enter_cache(scx, ni, uid, - gid, pxdesc); - } - free(securattr); - } else - pxdesc = (struct POSIX_SECURITY*)NULL; - } - - if (pxdesc) { - if (ntfs_valid_posix(pxdesc)) { - if (!strcmp(name,"system.posix_acl_default")) { - if (ni->mrec->flags - & MFT_RECORD_IS_DIRECTORY) - outsize = sizeof(struct POSIX_ACL) - + pxdesc->defcnt*sizeof(struct POSIX_ACE); - else { - /* - * getting default ACL from plain file : - * return EACCES if size > 0 as - * indicated in the man, but return ok - * if size == 0, so that ls does not - * display an error - */ - if (size > 0) { - outsize = 0; - errno = EACCES; - } else - outsize = sizeof(struct POSIX_ACL); - } - if (outsize && (outsize <= size)) { - memcpy(value,&pxdesc->acl,sizeof(struct POSIX_ACL)); - memcpy(&value[sizeof(struct POSIX_ACL)], - &pxdesc->acl.ace[pxdesc->firstdef], - outsize-sizeof(struct POSIX_ACL)); - } - } else { - outsize = sizeof(struct POSIX_ACL) - + pxdesc->acccnt*sizeof(struct POSIX_ACE); - if (outsize <= size) - memcpy(value,&pxdesc->acl,outsize); - } - } else { - outsize = 0; - errno = EIO; - ntfs_log_error("Invalid Posix ACL built\n"); - } - if (!cached) - free(pxdesc); - } else - outsize = 0; - } - return (outsize ? (int)outsize : -errno); -} - -#else /* POSIXACLS */ - - -/* - * Get permissions to access a file - * Takes into account the relation of user to file (owner, group, ...) - * Do no use as mode of the file - * - * returns -1 if there is a problem - */ - -static int ntfs_get_perm(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, mode_t request) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const struct CACHED_PERMISSIONS *cached; - char *securattr; - const SID *usid; /* owner of file/directory */ - const SID *gsid; /* group of file/directory */ - BOOL isdir; - uid_t uid; - gid_t gid; - int perm; - - if (!scx->mapping[MAPUSERS] || (!scx->uid && !(request & S_IEXEC))) - perm = 07777; - else { - /* check whether available in cache */ - cached = fetch_cache(scx,ni); - if (cached) { - perm = cached->mode; - uid = cached->uid; - gid = cached->gid; - } else { - perm = 0; /* default to no permission */ - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - != const_cpu_to_le16(0); - securattr = getsecurityattr(scx->vol, ni); - if (securattr) { - phead = (const SECURITY_DESCRIPTOR_RELATIVE*) - securattr; - gsid = (const SID*)& - securattr[le32_to_cpu(phead->group)]; - gid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); -#if OWNERFROMACL - usid = ntfs_acl_owner(securattr); - perm = ntfs_build_permissions(securattr, - usid, gsid, isdir); - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#else - usid = (const SID*)& - securattr[le32_to_cpu(phead->owner)]; - perm = ntfs_build_permissions(securattr, - usid, gsid, isdir); - if (!perm && ntfs_same_sid(usid, adminsid)) { - uid = find_tenant(scx, securattr); - if (uid) - perm = 0700; - } else - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#endif - /* - * Create a security id if there were none - * and upgrade option is selected - */ - if (!test_nino_flag(ni, v3_Extensions) - && (perm >= 0) - && (scx->vol->secure_flags - & (1 << SECURITY_ADDSECURIDS))) { - upgrade_secur_desc(scx->vol, - securattr, ni); - /* - * fetch owner and group for cacheing - * if there is a securid - */ - } - if (test_nino_flag(ni, v3_Extensions) - && (perm >= 0)) { - enter_cache(scx, ni, uid, - gid, perm); - } - free(securattr); - } else { - perm = -1; - uid = gid = 0; - } - } - if (perm >= 0) { - if (!scx->uid) { - /* root access and execution */ - if (perm & 0111) - perm = 07777; - else - perm = 0; - } else - if (uid == scx->uid) - perm &= 07700; - else - /* - * avoid checking group membership - * when the requested perms for group - * are the same as perms for other - */ - if ((gid == scx->gid) - || ((((perm >> 3) ^ perm) - & (request >> 6) & 7) - && groupmember(scx, scx->uid, gid))) - perm &= 07070; - else - perm &= 07007; - } - } - return (perm); -} - -#endif /* POSIXACLS */ - -/* - * Get an NTFS ACL - * - * Returns size or -errno if there is a problem - * if size was too small, no copy is done and errno is not set, - * the caller is expected to issue a new call - */ - -int ntfs_get_ntfs_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - char *value, size_t size) -{ - char *securattr; - size_t outsize; - - outsize = 0; /* default to no data and no error */ - securattr = getsecurityattr(scx->vol, ni); - if (securattr) { - outsize = ntfs_attr_size(securattr); - if (outsize <= size) { - memcpy(value,securattr,outsize); - } - free(securattr); - } - return (outsize ? (int)outsize : -errno); -} - -/* - * Get owner, group and permissions in an stat structure - * returns permissions, or -1 if there is a problem - */ - -int ntfs_get_owner_mode(struct SECURITY_CONTEXT *scx, - ntfs_inode * ni, struct stat *stbuf) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - char *securattr; - const SID *usid; /* owner of file/directory */ - const SID *gsid; /* group of file/directory */ - const struct CACHED_PERMISSIONS *cached; - int perm; - BOOL isdir; -#if POSIXACLS - struct POSIX_SECURITY *pxdesc; -#endif - - if (!scx->mapping[MAPUSERS]) - perm = 07777; - else { - /* check whether available in cache */ - cached = fetch_cache(scx,ni); - if (cached) { - perm = cached->mode; - stbuf->st_uid = cached->uid; - stbuf->st_gid = cached->gid; - stbuf->st_mode = (stbuf->st_mode & ~07777) + perm; - } else { - perm = -1; /* default to error */ - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - != const_cpu_to_le16(0); - securattr = getsecurityattr(scx->vol, ni); - if (securattr) { - phead = - (const SECURITY_DESCRIPTOR_RELATIVE*) - securattr; - gsid = (const SID*)& - securattr[le32_to_cpu(phead->group)]; -#if OWNERFROMACL - usid = ntfs_acl_owner(securattr); -#else - usid = (const SID*)& - securattr[le32_to_cpu(phead->owner)]; -#endif -#if POSIXACLS - pxdesc = ntfs_build_permissions_posix(scx->mapping, securattr, - usid, gsid, isdir); - if (pxdesc) - perm = pxdesc->mode & 07777; - else - perm = -1; -#else - perm = ntfs_build_permissions(securattr, - usid, gsid, isdir); -#endif - /* - * fetch owner and group for cacheing - */ - if (perm >= 0) { - /* - * Create a security id if there were none - * and upgrade option is selected - */ - if (!test_nino_flag(ni, v3_Extensions) - && (scx->vol->secure_flags - & (1 << SECURITY_ADDSECURIDS))) { - upgrade_secur_desc(scx->vol, - securattr, ni); - } -#if OWNERFROMACL - stbuf->st_uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#else - if (!perm && ntfs_same_sid(usid, adminsid)) { - stbuf->st_uid = - find_tenant(scx, - securattr); - if (stbuf->st_uid) - perm = 0700; - } else - stbuf->st_uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#endif - stbuf->st_gid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); - stbuf->st_mode = - (stbuf->st_mode & ~07777) + perm; -#if POSIXACLS - enter_cache(scx, ni, stbuf->st_uid, - stbuf->st_gid, pxdesc); - free(pxdesc); -#else - enter_cache(scx, ni, stbuf->st_uid, - stbuf->st_gid, perm); -#endif - } - free(securattr); - } - } - } - return (perm); -} - -#if POSIXACLS - -/* - * Get the base for a Posix inheritance and - * build an inherited Posix descriptor - */ - -static struct POSIX_SECURITY *inherit_posix(struct SECURITY_CONTEXT *scx, - ntfs_inode *dir_ni, mode_t mode, BOOL isdir) -{ - const struct CACHED_PERMISSIONS *cached; - const SECURITY_DESCRIPTOR_RELATIVE *phead; - struct POSIX_SECURITY *pxdesc; - struct POSIX_SECURITY *pydesc; - char *securattr; - const SID *usid; - const SID *gsid; - uid_t uid; - gid_t gid; - - pydesc = (struct POSIX_SECURITY*)NULL; - /* check whether parent directory is available in cache */ - cached = fetch_cache(scx,dir_ni); - if (cached) { - uid = cached->uid; - gid = cached->gid; - pxdesc = cached->pxdesc; - if (pxdesc) { - pydesc = ntfs_build_inherited_posix(pxdesc,mode, - scx->umask,isdir); - } - } else { - securattr = getsecurityattr(scx->vol, dir_ni); - if (securattr) { - phead = (const SECURITY_DESCRIPTOR_RELATIVE*) - securattr; - gsid = (const SID*)& - securattr[le32_to_cpu(phead->group)]; - gid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); -#if OWNERFROMACL - usid = ntfs_acl_owner(securattr); - pxdesc = ntfs_build_permissions_posix(scx->mapping,securattr, - usid, gsid, TRUE); - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#else - usid = (const SID*)& - securattr[le32_to_cpu(phead->owner)]; - pxdesc = ntfs_build_permissions_posix(scx->mapping,securattr, - usid, gsid, TRUE); - if (pxdesc && ntfs_same_sid(usid, adminsid)) { - uid = find_tenant(scx, securattr); - } else - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); -#endif - if (pxdesc) { - /* - * Create a security id if there were none - * and upgrade option is selected - */ - if (!test_nino_flag(dir_ni, v3_Extensions) - && (scx->vol->secure_flags - & (1 << SECURITY_ADDSECURIDS))) { - upgrade_secur_desc(scx->vol, - securattr, dir_ni); - /* - * fetch owner and group for cacheing - * if there is a securid - */ - } - if (test_nino_flag(dir_ni, v3_Extensions)) { - enter_cache(scx, dir_ni, uid, - gid, pxdesc); - } - pydesc = ntfs_build_inherited_posix(pxdesc, - mode, scx->umask, isdir); - free(pxdesc); - } - free(securattr); - } - } - return (pydesc); -} - -/* - * Allocate a security_id for a file being created - * - * Returns zero if not possible (NTFS v3.x required) - */ - -le32 ntfs_alloc_securid(struct SECURITY_CONTEXT *scx, - uid_t uid, gid_t gid, ntfs_inode *dir_ni, - mode_t mode, BOOL isdir) -{ -#if !FORCE_FORMAT_v1x - const struct CACHED_SECURID *cached; - struct CACHED_SECURID wanted; - struct POSIX_SECURITY *pxdesc; - char *newattr; - int newattrsz; - const SID *usid; - const SID *gsid; - BIGSID defusid; - BIGSID defgsid; - le32 securid; -#endif - - securid = const_cpu_to_le32(0); - -#if !FORCE_FORMAT_v1x - - pxdesc = inherit_posix(scx, dir_ni, mode, isdir); - if (pxdesc) { - /* check whether target securid is known in cache */ - - wanted.uid = uid; - wanted.gid = gid; - wanted.dmode = pxdesc->mode & mode & 07777; - if (isdir) wanted.dmode |= 0x10000; - wanted.variable = (void*)pxdesc; - wanted.varsize = sizeof(struct POSIX_SECURITY) - + (pxdesc->acccnt + pxdesc->defcnt)*sizeof(struct POSIX_ACE); - cached = (const struct CACHED_SECURID*)ntfs_fetch_cache( - scx->vol->securid_cache, GENERIC(&wanted), - (cache_compare)compare); - /* quite simple, if we are lucky */ - if (cached) - securid = cached->securid; - - /* not in cache : make sure we can create ids */ - - if (!cached && (scx->vol->major_ver >= 3)) { - usid = ntfs_find_usid(scx->mapping[MAPUSERS],uid,(SID*)&defusid); - gsid = ntfs_find_gsid(scx->mapping[MAPGROUPS],gid,(SID*)&defgsid); - if (!usid || !gsid) { - ntfs_log_error("File created by an unmapped user/group %d/%d\n", - (int)uid, (int)gid); - usid = gsid = adminsid; - } - newattr = ntfs_build_descr_posix(scx->mapping, pxdesc, - isdir, usid, gsid); - if (newattr) { - newattrsz = ntfs_attr_size(newattr); - securid = setsecurityattr(scx->vol, - (const SECURITY_DESCRIPTOR_RELATIVE*)newattr, - newattrsz); - if (securid) { - /* update cache, for subsequent use */ - wanted.securid = securid; - ntfs_enter_cache(scx->vol->securid_cache, - GENERIC(&wanted), - (cache_compare)compare); - } - free(newattr); - } else { - /* - * could not build new security attribute - * errno set by ntfs_build_descr() - */ - } - } - free(pxdesc); - } -#endif - return (securid); -} - -/* - * Apply Posix inheritance to a newly created file - * (for NTFS 1.x only : no securid) - */ - -int ntfs_set_inherited_posix(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, uid_t uid, gid_t gid, - ntfs_inode *dir_ni, mode_t mode) -{ - struct POSIX_SECURITY *pxdesc; - char *newattr; - const SID *usid; - const SID *gsid; - BIGSID defusid; - BIGSID defgsid; - BOOL isdir; - int res; - - res = -1; - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) != const_cpu_to_le16(0); - pxdesc = inherit_posix(scx, dir_ni, mode, isdir); - if (pxdesc) { - usid = ntfs_find_usid(scx->mapping[MAPUSERS],uid,(SID*)&defusid); - gsid = ntfs_find_gsid(scx->mapping[MAPGROUPS],gid,(SID*)&defgsid); - if (!usid || !gsid) { - ntfs_log_error("File created by an unmapped user/group %d/%d\n", - (int)uid, (int)gid); - usid = gsid = adminsid; - } - newattr = ntfs_build_descr_posix(scx->mapping, pxdesc, - isdir, usid, gsid); - if (newattr) { - /* Adjust Windows read-only flag */ - res = update_secur_descr(scx->vol, newattr, ni); - if (!res && !isdir) { - if (mode & S_IWUSR) - ni->flags &= ~FILE_ATTR_READONLY; - else - ni->flags |= FILE_ATTR_READONLY; - } -#if CACHE_LEGACY_SIZE - /* also invalidate legacy cache */ - if (isdir && !ni->security_id) { - struct CACHED_PERMISSIONS_LEGACY legacy; - - legacy.mft_no = ni->mft_no; - legacy.variable = pxdesc; - legacy.varsize = sizeof(struct POSIX_SECURITY) - + (pxdesc->acccnt + pxdesc->defcnt)*sizeof(struct POSIX_ACE); - ntfs_invalidate_cache(scx->vol->legacy_cache, - GENERIC(&legacy), - (cache_compare)leg_compare,0); - } -#endif - free(newattr); - - } else { - /* - * could not build new security attribute - * errno set by ntfs_build_descr() - */ - } - } - return (res); -} - -#else - -le32 ntfs_alloc_securid(struct SECURITY_CONTEXT *scx, - uid_t uid, gid_t gid, mode_t mode, BOOL isdir) -{ -#if !FORCE_FORMAT_v1x - const struct CACHED_SECURID *cached; - struct CACHED_SECURID wanted; - char *newattr; - int newattrsz; - const SID *usid; - const SID *gsid; - BIGSID defusid; - BIGSID defgsid; - le32 securid; -#endif - - securid = const_cpu_to_le32(0); - -#if !FORCE_FORMAT_v1x - /* check whether target securid is known in cache */ - - wanted.uid = uid; - wanted.gid = gid; - wanted.dmode = mode & 07777; - if (isdir) wanted.dmode |= 0x10000; - wanted.variable = (void*)NULL; - wanted.varsize = 0; - cached = (const struct CACHED_SECURID*)ntfs_fetch_cache( - scx->vol->securid_cache, GENERIC(&wanted), - (cache_compare)compare); - /* quite simple, if we are lucky */ - if (cached) - securid = cached->securid; - - /* not in cache : make sure we can create ids */ - - if (!cached && (scx->vol->major_ver >= 3)) { - usid = ntfs_find_usid(scx->mapping[MAPUSERS],uid,(SID*)&defusid); - gsid = ntfs_find_gsid(scx->mapping[MAPGROUPS],gid,(SID*)&defgsid); - if (!usid || !gsid) { - ntfs_log_error("File created by an unmapped user/group %d/%d\n", - (int)uid, (int)gid); - usid = gsid = adminsid; - } - newattr = ntfs_build_descr(mode, isdir, usid, gsid); - if (newattr) { - newattrsz = ntfs_attr_size(newattr); - securid = setsecurityattr(scx->vol, - (const SECURITY_DESCRIPTOR_RELATIVE*)newattr, - newattrsz); - if (securid) { - /* update cache, for subsequent use */ - wanted.securid = securid; - ntfs_enter_cache(scx->vol->securid_cache, - GENERIC(&wanted), - (cache_compare)compare); - } - free(newattr); - } else { - /* - * could not build new security attribute - * errno set by ntfs_build_descr() - */ - } - } -#endif - return (securid); -} - -#endif - -/* - * Update ownership and mode of a file, reusing an existing - * security descriptor when possible - * - * Returns zero if successful - */ - -#if POSIXACLS -int ntfs_set_owner_mode(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - uid_t uid, gid_t gid, mode_t mode, - struct POSIX_SECURITY *pxdesc) -#else -int ntfs_set_owner_mode(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - uid_t uid, gid_t gid, mode_t mode) -#endif -{ - int res; - const struct CACHED_SECURID *cached; - struct CACHED_SECURID wanted; - char *newattr; - const SID *usid; - const SID *gsid; - BIGSID defusid; - BIGSID defgsid; - BOOL isdir; - - res = 0; - - /* check whether target securid is known in cache */ - - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) != const_cpu_to_le16(0); - wanted.uid = uid; - wanted.gid = gid; - wanted.dmode = mode & 07777; - if (isdir) wanted.dmode |= 0x10000; -#if POSIXACLS - wanted.variable = (void*)pxdesc; - if (pxdesc) - wanted.varsize = sizeof(struct POSIX_SECURITY) - + (pxdesc->acccnt + pxdesc->defcnt)*sizeof(struct POSIX_ACE); - else - wanted.varsize = 0; -#else - wanted.variable = (void*)NULL; - wanted.varsize = 0; -#endif - if (test_nino_flag(ni, v3_Extensions)) { - cached = (const struct CACHED_SECURID*)ntfs_fetch_cache( - scx->vol->securid_cache, GENERIC(&wanted), - (cache_compare)compare); - /* quite simple, if we are lucky */ - if (cached) { - ni->security_id = cached->securid; - NInoSetDirty(ni); - } - } else cached = (struct CACHED_SECURID*)NULL; - - if (!cached) { - /* - * Do not use usid and gsid from former attributes, - * but recompute them to get repeatable results - * which can be kept in cache. - */ - usid = ntfs_find_usid(scx->mapping[MAPUSERS],uid,(SID*)&defusid); - gsid = ntfs_find_gsid(scx->mapping[MAPGROUPS],gid,(SID*)&defgsid); - if (!usid || !gsid) { - ntfs_log_error("File made owned by an unmapped user/group %d/%d\n", - uid, gid); - usid = gsid = adminsid; - } -#if POSIXACLS - if (pxdesc) - newattr = ntfs_build_descr_posix(scx->mapping, pxdesc, - isdir, usid, gsid); - else - newattr = ntfs_build_descr(mode, - isdir, usid, gsid); -#else - newattr = ntfs_build_descr(mode, - isdir, usid, gsid); -#endif - if (newattr) { - res = update_secur_descr(scx->vol, newattr, ni); - if (!res) { - /* adjust Windows read-only flag */ - if (!isdir) { - if (mode & S_IWUSR) - ni->flags &= ~FILE_ATTR_READONLY; - else - ni->flags |= FILE_ATTR_READONLY; - NInoFileNameSetDirty(ni); - } - /* update cache, for subsequent use */ - if (test_nino_flag(ni, v3_Extensions)) { - wanted.securid = ni->security_id; - ntfs_enter_cache(scx->vol->securid_cache, - GENERIC(&wanted), - (cache_compare)compare); - } -#if CACHE_LEGACY_SIZE - /* also invalidate legacy cache */ - if (isdir && !ni->security_id) { - struct CACHED_PERMISSIONS_LEGACY legacy; - - legacy.mft_no = ni->mft_no; -#if POSIXACLS - legacy.variable = wanted.variable; - legacy.varsize = wanted.varsize; -#else - legacy.variable = (void*)NULL; - legacy.varsize = 0; -#endif - ntfs_invalidate_cache(scx->vol->legacy_cache, - GENERIC(&legacy), - (cache_compare)leg_compare,0); - } -#endif - } - free(newattr); - } else { - /* - * could not build new security attribute - * errno set by ntfs_build_descr() - */ - res = -1; - } - } - return (res); -} - -/* - * Check whether user has ownership rights on a file - * - * Returns TRUE if allowed - * if not, errno tells why - */ - -BOOL ntfs_allowed_as_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni) -{ - const struct CACHED_PERMISSIONS *cached; - char *oldattr; - const SID *usid; - uid_t processuid; - uid_t uid; - BOOL gotowner; - int allowed; - - processuid = scx->uid; -/* TODO : use CAP_FOWNER process capability */ - /* - * Always allow for root - * Also always allow if no mapping has been defined - */ - if (!scx->mapping[MAPUSERS] || !processuid) - allowed = TRUE; - else { - gotowner = FALSE; /* default */ - /* get the owner, either from cache or from old attribute */ - cached = fetch_cache(scx, ni); - if (cached) { - uid = cached->uid; - gotowner = TRUE; - } else { - oldattr = getsecurityattr(scx->vol, ni); - if (oldattr) { -#if OWNERFROMACL - usid = ntfs_acl_owner(oldattr); -#else - const SECURITY_DESCRIPTOR_RELATIVE *phead; - - phead = (const SECURITY_DESCRIPTOR_RELATIVE*) - oldattr; - usid = (const SID*)&oldattr - [le32_to_cpu(phead->owner)]; -#endif - uid = ntfs_find_user(scx->mapping[MAPUSERS], - usid); - gotowner = TRUE; - free(oldattr); - } - } - allowed = FALSE; - if (gotowner) { -/* TODO : use CAP_FOWNER process capability */ - if (!processuid || (processuid == uid)) - allowed = TRUE; - else - errno = EPERM; - } - } - return (allowed); -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -#if POSIXACLS - -/* - * Set a new access or default Posix ACL to a file - * (or remove ACL if no input data) - * Validity of input data is checked after merging - * - * Returns 0, or -1 if there is a problem which errno describes - */ - -int ntfs_set_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - const char *name, const char *value, size_t size, - int flags) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const struct CACHED_PERMISSIONS *cached; - char *oldattr; - uid_t processuid; - const SID *usid; - const SID *gsid; - uid_t uid; - uid_t gid; - int res; - mode_t mode; - BOOL isdir; - BOOL deflt; - BOOL exist; - int count; - struct POSIX_SECURITY *oldpxdesc; - struct POSIX_SECURITY *newpxdesc; - - /* get the current pxsec, either from cache or from old attribute */ - res = -1; - deflt = !strcmp(name,"system.posix_acl_default"); - if (size) - count = (size - sizeof(struct POSIX_ACL)) / sizeof(struct POSIX_ACE); - else - count = 0; - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) != const_cpu_to_le16(0); - newpxdesc = (struct POSIX_SECURITY*)NULL; - if ((!value - || (((const struct POSIX_ACL*)value)->version == POSIX_VERSION)) - && (!deflt || isdir || (!size && !value))) { - cached = fetch_cache(scx, ni); - if (cached) { - uid = cached->uid; - gid = cached->gid; - oldpxdesc = cached->pxdesc; - if (oldpxdesc) { - mode = oldpxdesc->mode; - newpxdesc = ntfs_replace_acl(oldpxdesc, - (const struct POSIX_ACL*)value,count,deflt); - } - } else { - oldattr = getsecurityattr(scx->vol, ni); - if (oldattr) { - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)oldattr; -#if OWNERFROMACL - usid = ntfs_acl_owner(oldattr); -#else - usid = (const SID*)&oldattr[le32_to_cpu(phead->owner)]; -#endif - gsid = (const SID*)&oldattr[le32_to_cpu(phead->group)]; - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); - gid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); - oldpxdesc = ntfs_build_permissions_posix(scx->mapping, - oldattr, usid, gsid, isdir); - if (oldpxdesc) { - if (deflt) - exist = oldpxdesc->defcnt > 0; - else - exist = oldpxdesc->acccnt > 3; - if ((exist && (flags & XATTR_CREATE)) - || (!exist && (flags & XATTR_REPLACE))) { - errno = (exist ? EEXIST : ENODATA); - } else { - mode = oldpxdesc->mode; - newpxdesc = ntfs_replace_acl(oldpxdesc, - (const struct POSIX_ACL*)value,count,deflt); - } - free(oldpxdesc); - } - free(oldattr); - } - } - } else - errno = EINVAL; - - if (newpxdesc) { - processuid = scx->uid; -/* TODO : use CAP_FOWNER process capability */ - if (!processuid || (uid == processuid)) { - /* - * clear setgid if file group does - * not match process group - */ - if (processuid && (gid != scx->gid) - && !groupmember(scx, scx->uid, gid)) { - newpxdesc->mode &= ~S_ISGID; - } - res = ntfs_set_owner_mode(scx, ni, uid, gid, - newpxdesc->mode, newpxdesc); - } else - errno = EPERM; - free(newpxdesc); - } - return (res ? -1 : 0); -} - -/* - * Remove a default Posix ACL from a file - * - * Returns 0, or -1 if there is a problem which errno describes - */ - -int ntfs_remove_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - const char *name) -{ - return (ntfs_set_posix_acl(scx, ni, name, - (const char*)NULL, 0, 0)); -} - -#endif - -/* - * Set a new NTFS ACL to a file - * - * Returns 0, or -1 if there is a problem - */ - -int ntfs_set_ntfs_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - const char *value, size_t size, int flags) -{ - char *attr; - int res; - - res = -1; - if ((size > 0) - && !(flags & XATTR_CREATE) - && ntfs_valid_descr(value,size) - && (ntfs_attr_size(value) == size)) { - /* need copying in order to write */ - attr = (char*)ntfs_malloc(size); - if (attr) { - memcpy(attr,value,size); - res = update_secur_descr(scx->vol, attr, ni); - /* - * No need to invalidate standard caches : - * the relation between a securid and - * the associated protection is unchanged, - * only the relation between a file and - * its securid and protection is changed. - */ -#if CACHE_LEGACY_SIZE - /* - * we must however invalidate the legacy - * cache, which is based on inode numbers. - * For safety, invalidate even if updating - * failed. - */ - if ((ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - && !ni->security_id) { - struct CACHED_PERMISSIONS_LEGACY legacy; - - legacy.mft_no = ni->mft_no; - legacy.variable = (char*)NULL; - legacy.varsize = 0; - ntfs_invalidate_cache(scx->vol->legacy_cache, - GENERIC(&legacy), - (cache_compare)leg_compare,0); - } -#endif - free(attr); - } else - errno = ENOMEM; - } else - errno = EINVAL; - return (res ? -1 : 0); -} - -#endif /* HAVE_SETXATTR */ - -/* - * Set new permissions to a file - * Checks user mapping has been defined before request for setting - * - * rejected if request is not originated by owner or root - * - * returns 0 on success - * -1 on failure, with errno = EIO - */ - -int ntfs_set_mode(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, mode_t mode) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const struct CACHED_PERMISSIONS *cached; - char *oldattr; - const SID *usid; - const SID *gsid; - uid_t processuid; - uid_t uid; - uid_t gid; - int res; -#if POSIXACLS - BOOL isdir; - int pxsize; - const struct POSIX_SECURITY *oldpxdesc; - struct POSIX_SECURITY *newpxdesc = (struct POSIX_SECURITY*)NULL; -#endif - - /* get the current owner, either from cache or from old attribute */ - res = 0; - cached = fetch_cache(scx, ni); - if (cached) { - uid = cached->uid; - gid = cached->gid; -#if POSIXACLS - oldpxdesc = cached->pxdesc; - if (oldpxdesc) { - /* must copy before merging */ - pxsize = sizeof(struct POSIX_SECURITY) - + (oldpxdesc->acccnt + oldpxdesc->defcnt)*sizeof(struct POSIX_ACE); - newpxdesc = (struct POSIX_SECURITY*)malloc(pxsize); - if (newpxdesc) { - memcpy(newpxdesc, oldpxdesc, pxsize); - if (ntfs_merge_mode_posix(newpxdesc, mode)) - res = -1; - } else - res = -1; - } else - newpxdesc = (struct POSIX_SECURITY*)NULL; -#endif - } else { - oldattr = getsecurityattr(scx->vol, ni); - if (oldattr) { - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)oldattr; -#if OWNERFROMACL - usid = ntfs_acl_owner(oldattr); -#else - usid = (const SID*)&oldattr[le32_to_cpu(phead->owner)]; -#endif - gsid = (const SID*)&oldattr[le32_to_cpu(phead->group)]; - uid = ntfs_find_user(scx->mapping[MAPUSERS],usid); - gid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); -#if POSIXACLS - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) != const_cpu_to_le16(0); - newpxdesc = ntfs_build_permissions_posix(scx->mapping, - oldattr, usid, gsid, isdir); - if (!newpxdesc || ntfs_merge_mode_posix(newpxdesc, mode)) - res = -1; -#endif - free(oldattr); - } else - res = -1; - } - - if (!res) { - processuid = scx->uid; -/* TODO : use CAP_FOWNER process capability */ - if (!processuid || (uid == processuid)) { - /* - * clear setgid if file group does - * not match process group - */ - if (processuid && (gid != scx->gid) - && !groupmember(scx, scx->uid, gid)) - mode &= ~S_ISGID; -#if POSIXACLS - if (newpxdesc) { - newpxdesc->mode = mode; - res = ntfs_set_owner_mode(scx, ni, uid, gid, - mode, newpxdesc); - } else - res = ntfs_set_owner_mode(scx, ni, uid, gid, - mode, newpxdesc); -#else - res = ntfs_set_owner_mode(scx, ni, uid, gid, mode); -#endif - } else { - errno = EPERM; - res = -1; /* neither owner nor root */ - } - } else { - /* - * Should not happen : a default descriptor is generated - * by getsecurityattr() when there are none - */ - ntfs_log_error("File has no security descriptor\n"); - res = -1; - errno = EIO; - } -#if POSIXACLS - if (newpxdesc) free(newpxdesc); -#endif - return (res ? -1 : 0); -} - -/* - * Create a default security descriptor for files whose descriptor - * cannot be inherited - */ - -int ntfs_sd_add_everyone(ntfs_inode *ni) -{ - /* JPA SECURITY_DESCRIPTOR_ATTR *sd; */ - SECURITY_DESCRIPTOR_RELATIVE *sd; - ACL *acl; - ACCESS_ALLOWED_ACE *ace; - SID *sid; - int ret, sd_len; - - /* Create SECURITY_DESCRIPTOR attribute (everyone has full access). */ - /* - * Calculate security descriptor length. We have 2 sub-authorities in - * owner and group SIDs, but structure SID contain only one, so add - * 4 bytes to every SID. - */ - sd_len = sizeof(SECURITY_DESCRIPTOR_ATTR) + 2 * (sizeof(SID) + 4) + - sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE); - sd = (SECURITY_DESCRIPTOR_RELATIVE*)ntfs_calloc(sd_len); - if (!sd) - return -1; - - sd->revision = SECURITY_DESCRIPTOR_REVISION; - sd->control = SE_DACL_PRESENT | SE_SELF_RELATIVE; - - sid = (SID*)((u8*)sd + sizeof(SECURITY_DESCRIPTOR_ATTR)); - sid->revision = SID_REVISION; - sid->sub_authority_count = 2; - sid->sub_authority[0] = const_cpu_to_le32(SECURITY_BUILTIN_DOMAIN_RID); - sid->sub_authority[1] = const_cpu_to_le32(DOMAIN_ALIAS_RID_ADMINS); - sid->identifier_authority.value[5] = 5; - sd->owner = cpu_to_le32((u8*)sid - (u8*)sd); - - sid = (SID*)((u8*)sid + sizeof(SID) + 4); - sid->revision = SID_REVISION; - sid->sub_authority_count = 2; - sid->sub_authority[0] = const_cpu_to_le32(SECURITY_BUILTIN_DOMAIN_RID); - sid->sub_authority[1] = const_cpu_to_le32(DOMAIN_ALIAS_RID_ADMINS); - sid->identifier_authority.value[5] = 5; - sd->group = cpu_to_le32((u8*)sid - (u8*)sd); - - acl = (ACL*)((u8*)sid + sizeof(SID) + 4); - acl->revision = ACL_REVISION; - acl->size = const_cpu_to_le16(sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE)); - acl->ace_count = const_cpu_to_le16(1); - sd->dacl = cpu_to_le32((u8*)acl - (u8*)sd); - - ace = (ACCESS_ALLOWED_ACE*)((u8*)acl + sizeof(ACL)); - ace->type = ACCESS_ALLOWED_ACE_TYPE; - ace->flags = OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE; - ace->size = const_cpu_to_le16(sizeof(ACCESS_ALLOWED_ACE)); - ace->mask = const_cpu_to_le32(0x1f01ff); /* FIXME */ - ace->sid.revision = SID_REVISION; - ace->sid.sub_authority_count = 1; - ace->sid.sub_authority[0] = const_cpu_to_le32(0); - ace->sid.identifier_authority.value[5] = 1; - - ret = ntfs_attr_add(ni, AT_SECURITY_DESCRIPTOR, AT_UNNAMED, 0, (u8*)sd, - sd_len); - if (ret) - ntfs_log_perror("Failed to add initial SECURITY_DESCRIPTOR"); - - free(sd); - return ret; -} - -/* - * Check whether user can access a file in a specific way - * - * Returns 1 if access is allowed, including user is root or no - * user mapping defined - * 2 if sticky and accesstype is S_IWRITE + S_IEXEC + S_ISVTX - * 0 and sets errno if there is a problem or if access - * is not allowed - * - * This is used for Posix ACL and checking creation of DOS file names - */ - -int ntfs_allowed_access(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, - int accesstype) /* access type required (S_Ixxx values) */ -{ - int perm; - int res; - int allow; - struct stat stbuf; - - /* - * Always allow for root unless execution is requested. - * (was checked by fuse until kernel 2.6.29) - * Also always allow if no mapping has been defined - */ - if (!scx->mapping[MAPUSERS] - || (!scx->uid - && (!(accesstype & S_IEXEC) - || (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)))) - allow = 1; - else { - perm = ntfs_get_perm(scx, ni, accesstype); - if (perm >= 0) { - res = EACCES; - switch (accesstype) { - case S_IEXEC: - allow = (perm & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0; - break; - case S_IWRITE: - allow = (perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0; - break; - case S_IWRITE + S_IEXEC: - allow = ((perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0) - && ((perm & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0); - break; - case S_IREAD: - allow = (perm & (S_IRUSR | S_IRGRP | S_IROTH)) != 0; - break; - case S_IREAD + S_IEXEC: - allow = ((perm & (S_IRUSR | S_IRGRP | S_IROTH)) != 0) - && ((perm & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0); - break; - case S_IREAD + S_IWRITE: - allow = ((perm & (S_IRUSR | S_IRGRP | S_IROTH)) != 0) - && ((perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0); - break; - case S_IWRITE + S_IEXEC + S_ISVTX: - if (perm & S_ISVTX) { - if ((ntfs_get_owner_mode(scx,ni,&stbuf) >= 0) - && (stbuf.st_uid == scx->uid)) - allow = 1; - else - allow = 2; - } else - allow = ((perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0) - && ((perm & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0); - break; - case S_IREAD + S_IWRITE + S_IEXEC: - allow = ((perm & (S_IRUSR | S_IRGRP | S_IROTH)) != 0) - && ((perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0) - && ((perm & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0); - break; - default : - res = EINVAL; - allow = 0; - break; - } - if (!allow) - errno = res; - } else - allow = 0; - } - return (allow); -} - -#if 0 /* not needed any more */ - -/* - * Check whether user can access the parent directory - * of a file in a specific way - * - * Returns true if access is allowed, including user is root and - * no user mapping defined - * - * Sets errno if there is a problem or if not allowed - * - * This is used for Posix ACL and checking creation of DOS file names - */ - -BOOL old_ntfs_allowed_dir_access(struct SECURITY_CONTEXT *scx, - const char *path, int accesstype) -{ - int allow; - char *dirpath; - char *name; - ntfs_inode *ni; - ntfs_inode *dir_ni; - struct stat stbuf; - - allow = 0; - dirpath = strdup(path); - if (dirpath) { - /* the root of file system is seen as a parent of itself */ - /* is that correct ? */ - name = strrchr(dirpath, '/'); - *name = 0; - dir_ni = ntfs_pathname_to_inode(scx->vol, NULL, dirpath); - if (dir_ni) { - allow = ntfs_allowed_access(scx, - dir_ni, accesstype); - ntfs_inode_close(dir_ni); - /* - * for an not-owned sticky directory, have to - * check whether file itself is owned - */ - if ((accesstype == (S_IWRITE + S_IEXEC + S_ISVTX)) - && (allow == 2)) { - ni = ntfs_pathname_to_inode(scx->vol, NULL, - path); - allow = FALSE; - if (ni) { - allow = (ntfs_get_owner_mode(scx,ni,&stbuf) >= 0) - && (stbuf.st_uid == scx->uid); - ntfs_inode_close(ni); - } - } - } - free(dirpath); - } - return (allow); /* errno is set if not allowed */ -} - -#endif - -/* - * Define a new owner/group to a file - * - * returns zero if successful - */ - -int ntfs_set_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - uid_t uid, gid_t gid) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const struct CACHED_PERMISSIONS *cached; - char *oldattr; - const SID *usid; - const SID *gsid; - uid_t fileuid; - uid_t filegid; - mode_t mode; - int perm; - BOOL isdir; - int res; -#if POSIXACLS - struct POSIX_SECURITY *pxdesc; - BOOL pxdescbuilt = FALSE; -#endif - - res = 0; - /* get the current owner and mode from cache or security attributes */ - oldattr = (char*)NULL; - cached = fetch_cache(scx,ni); - if (cached) { - fileuid = cached->uid; - filegid = cached->gid; - mode = cached->mode; -#if POSIXACLS - pxdesc = cached->pxdesc; - if (!pxdesc) - res = -1; -#endif - } else { - fileuid = 0; - filegid = 0; - mode = 0; - oldattr = getsecurityattr(scx->vol, ni); - if (oldattr) { - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - != const_cpu_to_le16(0); - phead = (const SECURITY_DESCRIPTOR_RELATIVE*) - oldattr; - gsid = (const SID*) - &oldattr[le32_to_cpu(phead->group)]; -#if OWNERFROMACL - usid = ntfs_acl_owner(oldattr); -#else - usid = (const SID*) - &oldattr[le32_to_cpu(phead->owner)]; -#endif -#if POSIXACLS - pxdesc = ntfs_build_permissions_posix(scx->mapping, oldattr, - usid, gsid, isdir); - if (pxdesc) { - pxdescbuilt = TRUE; - fileuid = ntfs_find_user(scx->mapping[MAPUSERS],usid); - filegid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); - mode = perm = pxdesc->mode; - } else - res = -1; -#else - mode = perm = ntfs_build_permissions(oldattr, - usid, gsid, isdir); - if (perm >= 0) { - fileuid = ntfs_find_user(scx->mapping[MAPUSERS],usid); - filegid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); - } else - res = -1; -#endif - free(oldattr); - } else - res = -1; - } - if (!res) { - /* check requested by root */ - /* or chgrp requested by owner to an owned group */ - if (!scx->uid - || ((((int)uid < 0) || (uid == fileuid)) - && ((gid == scx->gid) || groupmember(scx, scx->uid, gid)) - && (fileuid == scx->uid))) { - /* replace by the new usid and gsid */ - /* or reuse old gid and sid for cacheing */ - if ((int)uid < 0) - uid = fileuid; - if ((int)gid < 0) - gid = filegid; - /* clear setuid and setgid if owner has changed */ - /* unless request originated by root */ - if (uid && (fileuid != uid)) - mode &= 01777; -#if POSIXACLS - res = ntfs_set_owner_mode(scx, ni, uid, gid, - mode, pxdesc); -#else - res = ntfs_set_owner_mode(scx, ni, uid, gid, mode); -#endif - } else { - res = -1; /* neither owner nor root */ - errno = EPERM; - } -#if POSIXACLS - if (pxdescbuilt) - free(pxdesc); -#endif - } else { - /* - * Should not happen : a default descriptor is generated - * by getsecurityattr() when there are none - */ - ntfs_log_error("File has no security descriptor\n"); - res = -1; - errno = EIO; - } - return (res ? -1 : 0); -} - -/* - * Define new owner/group and mode to a file - * - * returns zero if successful - */ - -int ntfs_set_ownmod(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - uid_t uid, gid_t gid, const mode_t mode) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - const struct CACHED_PERMISSIONS *cached; - char *oldattr; - const SID *usid; - const SID *gsid; - uid_t fileuid; - uid_t filegid; - BOOL isdir; - int res; -#if POSIXACLS - const struct POSIX_SECURITY *oldpxdesc; - struct POSIX_SECURITY *newpxdesc = (struct POSIX_SECURITY*)NULL; - int pxsize; -#endif - - res = 0; - /* get the current owner and mode from cache or security attributes */ - oldattr = (char*)NULL; - cached = fetch_cache(scx,ni); - if (cached) { - fileuid = cached->uid; - filegid = cached->gid; -#if POSIXACLS - oldpxdesc = cached->pxdesc; - if (oldpxdesc) { - /* must copy before merging */ - pxsize = sizeof(struct POSIX_SECURITY) - + (oldpxdesc->acccnt + oldpxdesc->defcnt)*sizeof(struct POSIX_ACE); - newpxdesc = (struct POSIX_SECURITY*)malloc(pxsize); - if (newpxdesc) { - memcpy(newpxdesc, oldpxdesc, pxsize); - if (ntfs_merge_mode_posix(newpxdesc, mode)) - res = -1; - } else - res = -1; - } -#endif - } else { - fileuid = 0; - filegid = 0; - oldattr = getsecurityattr(scx->vol, ni); - if (oldattr) { - isdir = (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - != const_cpu_to_le16(0); - phead = (const SECURITY_DESCRIPTOR_RELATIVE*) - oldattr; - gsid = (const SID*) - &oldattr[le32_to_cpu(phead->group)]; -#if OWNERFROMACL - usid = ntfs_acl_owner(oldattr); -#else - usid = (const SID*) - &oldattr[le32_to_cpu(phead->owner)]; -#endif -#if POSIXACLS - newpxdesc = ntfs_build_permissions_posix(scx->mapping, oldattr, - usid, gsid, isdir); - if (!newpxdesc || ntfs_merge_mode_posix(newpxdesc, mode)) - res = -1; - else { - fileuid = ntfs_find_user(scx->mapping[MAPUSERS],usid); - filegid = ntfs_find_group(scx->mapping[MAPGROUPS],gsid); - } -#endif - free(oldattr); - } else - res = -1; - } - if (!res) { - /* check requested by root */ - /* or chgrp requested by owner to an owned group */ - if (!scx->uid - || ((((int)uid < 0) || (uid == fileuid)) - && ((gid == scx->gid) || groupmember(scx, scx->uid, gid)) - && (fileuid == scx->uid))) { - /* replace by the new usid and gsid */ - /* or reuse old gid and sid for cacheing */ - if ((int)uid < 0) - uid = fileuid; - if ((int)gid < 0) - gid = filegid; -#if POSIXACLS - res = ntfs_set_owner_mode(scx, ni, uid, gid, - mode, newpxdesc); -#else - res = ntfs_set_owner_mode(scx, ni, uid, gid, mode); -#endif - } else { - res = -1; /* neither owner nor root */ - errno = EPERM; - } - } else { - /* - * Should not happen : a default descriptor is generated - * by getsecurityattr() when there are none - */ - ntfs_log_error("File has no security descriptor\n"); - res = -1; - errno = EIO; - } -#if POSIXACLS - free(newpxdesc); -#endif - return (res ? -1 : 0); -} - -/* - * Build a security id for a descriptor inherited from - * parent directory the Windows way - */ - -static le32 build_inherited_id(struct SECURITY_CONTEXT *scx, - const char *parentattr, BOOL fordir) -{ - const SECURITY_DESCRIPTOR_RELATIVE *pphead; - const ACL *ppacl; - const SID *usid; - const SID *gsid; - BIGSID defusid; - BIGSID defgsid; - int offpacl; - int offowner; - int offgroup; - SECURITY_DESCRIPTOR_RELATIVE *pnhead; - ACL *pnacl; - int parentattrsz; - char *newattr; - int newattrsz; - int aclsz; - int usidsz; - int gsidsz; - int pos; - le32 securid; - - parentattrsz = ntfs_attr_size(parentattr); - pphead = (const SECURITY_DESCRIPTOR_RELATIVE*)parentattr; - if (scx->mapping[MAPUSERS]) { - usid = ntfs_find_usid(scx->mapping[MAPUSERS], scx->uid, (SID*)&defusid); - gsid = ntfs_find_gsid(scx->mapping[MAPGROUPS], scx->gid, (SID*)&defgsid); - if (!usid) - usid = adminsid; - if (!gsid) - gsid = adminsid; - } else { - /* - * If there is no user mapping, we have to copy owner - * and group from parent directory. - * Windows never has to do that, because it can always - * rely on a user mapping - */ - offowner = le32_to_cpu(pphead->owner); - usid = (const SID*)&parentattr[offowner]; - offgroup = le32_to_cpu(pphead->group); - gsid = (const SID*)&parentattr[offgroup]; - } - /* - * new attribute is smaller than parent's - * except for differences in SIDs which appear in - * owner, group and possible grants and denials in - * generic creator-owner and creator-group ACEs. - * For directories, an ACE may be duplicated for - * access and inheritance, so we double the count. - */ - usidsz = ntfs_sid_size(usid); - gsidsz = ntfs_sid_size(gsid); - newattrsz = parentattrsz + 3*usidsz + 3*gsidsz; - if (fordir) - newattrsz *= 2; - newattr = (char*)ntfs_malloc(newattrsz); - if (newattr) { - pnhead = (SECURITY_DESCRIPTOR_RELATIVE*)newattr; - pnhead->revision = SECURITY_DESCRIPTOR_REVISION; - pnhead->alignment = 0; - pnhead->control = SE_SELF_RELATIVE; - pos = sizeof(SECURITY_DESCRIPTOR_RELATIVE); - /* - * locate and inherit DACL - * do not test SE_DACL_PRESENT (wrong for "DR Watson") - */ - pnhead->dacl = const_cpu_to_le32(0); - if (pphead->dacl) { - offpacl = le32_to_cpu(pphead->dacl); - ppacl = (const ACL*)&parentattr[offpacl]; - pnacl = (ACL*)&newattr[pos]; - aclsz = ntfs_inherit_acl(ppacl, pnacl, usid, gsid, fordir); - if (aclsz) { - pnhead->dacl = cpu_to_le32(pos); - pos += aclsz; - pnhead->control |= SE_DACL_PRESENT; - } - } - /* - * locate and inherit SACL - */ - pnhead->sacl = const_cpu_to_le32(0); - if (pphead->sacl) { - offpacl = le32_to_cpu(pphead->sacl); - ppacl = (const ACL*)&parentattr[offpacl]; - pnacl = (ACL*)&newattr[pos]; - aclsz = ntfs_inherit_acl(ppacl, pnacl, usid, gsid, fordir); - if (aclsz) { - pnhead->sacl = cpu_to_le32(pos); - pos += aclsz; - pnhead->control |= SE_SACL_PRESENT; - } - } - /* - * inherit or redefine owner - */ - memcpy(&newattr[pos],usid,usidsz); - pnhead->owner = cpu_to_le32(pos); - pos += usidsz; - /* - * inherit or redefine group - */ - memcpy(&newattr[pos],gsid,gsidsz); - pnhead->group = cpu_to_le32(pos); - pos += usidsz; - securid = setsecurityattr(scx->vol, - (SECURITY_DESCRIPTOR_RELATIVE*)newattr, pos); - free(newattr); - } else - securid = const_cpu_to_le32(0); - return (securid); -} - -/* - * Get an inherited security id - * - * For Windows compatibility, the normal initial permission setting - * may be inherited from the parent directory instead of being - * defined by the creation arguments. - * - * The following creates an inherited id for that purpose. - * - * Note : the owner and group of parent directory are also - * inherited (which is not the case on Windows) if no user mapping - * is defined. - * - * Returns the inherited id, or zero if not possible (eg on NTFS 1.x) - */ - -le32 ntfs_inherited_id(struct SECURITY_CONTEXT *scx, - ntfs_inode *dir_ni, BOOL fordir) -{ - struct CACHED_PERMISSIONS *cached; - char *parentattr; - le32 securid; - - securid = const_cpu_to_le32(0); - cached = (struct CACHED_PERMISSIONS*)NULL; - /* - * Try to get inherited id from cache - */ - if (test_nino_flag(dir_ni, v3_Extensions) - && dir_ni->security_id) { - cached = fetch_cache(scx, dir_ni); - if (cached) - securid = (fordir ? cached->inh_dirid - : cached->inh_fileid); - } - /* - * Not cached or not available in cache, compute it all - * Note : if parent directory has no id, it is not cacheable - */ - if (!securid) { - parentattr = getsecurityattr(scx->vol, dir_ni); - if (parentattr) { - securid = build_inherited_id(scx, - parentattr, fordir); - free(parentattr); - /* - * Store the result into cache for further use - */ - if (securid) { - cached = fetch_cache(scx, dir_ni); - if (cached) { - if (fordir) - cached->inh_dirid = securid; - else - cached->inh_fileid = securid; - } - } - } - } - return (securid); -} - -/* - * Link a group to a member of group - * - * Returns 0 if OK, -1 (and errno set) if error - */ - -static int link_single_group(struct MAPPING *usermapping, struct passwd *user, - gid_t gid) -{ - struct group *group; - char **grmem; - int grcnt; - gid_t *groups; - int res; - - res = 0; - group = getgrgid(gid); - if (group && group->gr_mem) { - grcnt = usermapping->grcnt; - groups = usermapping->groups; - grmem = group->gr_mem; - while (*grmem && strcmp(user->pw_name, *grmem)) - grmem++; - if (*grmem) { - if (!grcnt) - groups = (gid_t*)malloc(sizeof(gid_t)); - else - groups = (gid_t*)realloc(groups, - (grcnt+1)*sizeof(gid_t)); - if (groups) - groups[grcnt++] = gid; - else { - res = -1; - errno = ENOMEM; - } - } - usermapping->grcnt = grcnt; - usermapping->groups = groups; - } - return (res); -} - - -/* - * Statically link group to users - * This is based on groups defined in /etc/group and does not take - * the groups dynamically set by setgroups() nor any changes in - * /etc/group into account - * - * Only mapped groups and root group are linked to mapped users - * - * Returns 0 if OK, -1 (and errno set) if error - * - */ - -static int link_group_members(struct SECURITY_CONTEXT *scx) -{ - struct MAPPING *usermapping; - struct MAPPING *groupmapping; - struct passwd *user; - int res; - - res = 0; - for (usermapping=scx->mapping[MAPUSERS]; usermapping && !res; - usermapping=usermapping->next) { - usermapping->grcnt = 0; - usermapping->groups = (gid_t*)NULL; - user = getpwuid(usermapping->xid); - if (user && user->pw_name) { - for (groupmapping=scx->mapping[MAPGROUPS]; - groupmapping && !res; - groupmapping=groupmapping->next) { - if (link_single_group(usermapping, user, - groupmapping->xid)) - res = -1; - } - if (!res && link_single_group(usermapping, - user, (gid_t)0)) - res = -1; - } - } - return (res); -} - -/* - * Apply default single user mapping - * returns zero if successful - */ - -static int ntfs_do_default_mapping(struct SECURITY_CONTEXT *scx, - uid_t uid, gid_t gid, const SID *usid) -{ - struct MAPPING *usermapping; - struct MAPPING *groupmapping; - SID *sid; - int sidsz; - int res; - - res = -1; - sidsz = ntfs_sid_size(usid); - sid = (SID*)ntfs_malloc(sidsz); - if (sid) { - memcpy(sid,usid,sidsz); - usermapping = (struct MAPPING*)ntfs_malloc(sizeof(struct MAPPING)); - if (usermapping) { - groupmapping = (struct MAPPING*)ntfs_malloc(sizeof(struct MAPPING)); - if (groupmapping) { - usermapping->sid = sid; - usermapping->xid = uid; - usermapping->next = (struct MAPPING*)NULL; - groupmapping->sid = sid; - groupmapping->xid = gid; - groupmapping->next = (struct MAPPING*)NULL; - scx->mapping[MAPUSERS] = usermapping; - scx->mapping[MAPGROUPS] = groupmapping; - res = 0; - } - } - } - return (res); -} - -/* - * Make sure there are no ambiguous mapping - * Ambiguous mapping may lead to undesired configurations and - * we had rather be safe until the consequences are understood - */ - -#if 0 /* not activated for now */ - -static BOOL check_mapping(const struct MAPPING *usermapping, - const struct MAPPING *groupmapping) -{ - const struct MAPPING *mapping1; - const struct MAPPING *mapping2; - BOOL ambiguous; - - ambiguous = FALSE; - for (mapping1=usermapping; mapping1; mapping1=mapping1->next) - for (mapping2=mapping1->next; mapping2; mapping1=mapping2->next) - if (ntfs_same_sid(mapping1->sid,mapping2->sid)) { - if (mapping1->xid != mapping2->xid) - ambiguous = TRUE; - } else { - if (mapping1->xid == mapping2->xid) - ambiguous = TRUE; - } - for (mapping1=groupmapping; mapping1; mapping1=mapping1->next) - for (mapping2=mapping1->next; mapping2; mapping1=mapping2->next) - if (ntfs_same_sid(mapping1->sid,mapping2->sid)) { - if (mapping1->xid != mapping2->xid) - ambiguous = TRUE; - } else { - if (mapping1->xid == mapping2->xid) - ambiguous = TRUE; - } - return (ambiguous); -} - -#endif - -#if 0 /* not used any more */ - -/* - * Try and apply default single user mapping - * returns zero if successful - */ - -static int ntfs_default_mapping(struct SECURITY_CONTEXT *scx) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - ntfs_inode *ni; - char *securattr; - const SID *usid; - int res; - - res = -1; - ni = ntfs_pathname_to_inode(scx->vol, NULL, "/."); - if (ni) { - securattr = getsecurityattr(scx->vol, ni); - if (securattr) { - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)securattr; - usid = (SID*)&securattr[le32_to_cpu(phead->owner)]; - if (ntfs_is_user_sid(usid)) - res = ntfs_do_default_mapping(scx, - scx->uid, scx->gid, usid); - free(securattr); - } - ntfs_inode_close(ni); - } - return (res); -} - -#endif - -/* - * Basic read from a user mapping file on another volume - */ - -static int basicread(void *fileid, char *buf, size_t size, off_t offs __attribute__((unused))) -{ - return (read(*(int*)fileid, buf, size)); -} - - -/* - * Read from a user mapping file on current NTFS partition - */ - -static int localread(void *fileid, char *buf, size_t size, off_t offs) -{ - return (ntfs_local_read((ntfs_inode*)fileid, - AT_UNNAMED, 0, buf, size, offs)); -} - -/* - * Build the user mapping - * - according to a mapping file if defined (or default present), - * - or try default single user mapping if possible - * - * The mapping is specific to a mounted device - * No locking done, mounting assumed non multithreaded - * - * returns zero if mapping is successful - * (failure should not be interpreted as an error) - */ - -int ntfs_build_mapping(struct SECURITY_CONTEXT *scx, const char *usermap_path, - BOOL allowdef) -{ - struct MAPLIST *item; - struct MAPLIST *firstitem; - struct MAPPING *usermapping; - struct MAPPING *groupmapping; - ntfs_inode *ni; - int fd; - static struct { - u8 revision; - u8 levels; - be16 highbase; - be32 lowbase; - le32 level1; - le32 level2; - le32 level3; - le32 level4; - le32 level5; - } defmap = { - 1, 5, const_cpu_to_be16(0), const_cpu_to_be32(5), - const_cpu_to_le32(21), - const_cpu_to_le32(DEFSECAUTH1), const_cpu_to_le32(DEFSECAUTH2), - const_cpu_to_le32(DEFSECAUTH3), const_cpu_to_le32(DEFSECBASE) - } ; - - /* be sure not to map anything until done */ - scx->mapping[MAPUSERS] = (struct MAPPING*)NULL; - scx->mapping[MAPGROUPS] = (struct MAPPING*)NULL; - - if (!usermap_path) usermap_path = MAPPINGFILE; - if (usermap_path[0] == '/') { - fd = open(usermap_path,O_RDONLY); - if (fd > 0) { - firstitem = ntfs_read_mapping(basicread, (void*)&fd); - close(fd); - } else - firstitem = (struct MAPLIST*)NULL; - } else { - ni = ntfs_pathname_to_inode(scx->vol, NULL, usermap_path); - if (ni) { - firstitem = ntfs_read_mapping(localread, ni); - ntfs_inode_close(ni); - } else - firstitem = (struct MAPLIST*)NULL; - } - - - if (firstitem) { - usermapping = ntfs_do_user_mapping(firstitem); - groupmapping = ntfs_do_group_mapping(firstitem); - if (usermapping && groupmapping) { - scx->mapping[MAPUSERS] = usermapping; - scx->mapping[MAPGROUPS] = groupmapping; - } else - ntfs_log_error("There were no valid user or no valid group\n"); - /* now we can free the memory copy of input text */ - /* and rely on internal representation */ - while (firstitem) { - item = firstitem->next; - free(firstitem); - firstitem = item; - } - } else { - /* no mapping file, try a default mapping */ - if (allowdef) { - if (!ntfs_do_default_mapping(scx, - 0, 0, (const SID*)&defmap)) - ntfs_log_info("Using default user mapping\n"); - } - } - return (!scx->mapping[MAPUSERS] || link_group_members(scx)); -} - -#ifdef HAVE_SETXATTR /* extended attributes interface required */ - -/* - * Get the ntfs attribute into an extended attribute - * The attribute is returned according to cpu endianness - */ - -int ntfs_get_ntfs_attrib(ntfs_inode *ni, char *value, size_t size) -{ - u32 attrib; - size_t outsize; - - outsize = 0; /* default to no data and no error */ - if (ni) { - attrib = le32_to_cpu(ni->flags); - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - attrib |= const_le32_to_cpu(FILE_ATTR_DIRECTORY); - else - attrib &= ~const_le32_to_cpu(FILE_ATTR_DIRECTORY); - if (!attrib) - attrib |= const_le32_to_cpu(FILE_ATTR_NORMAL); - outsize = sizeof(FILE_ATTR_FLAGS); - if (size >= outsize) { - if (value) - memcpy(value,&attrib,outsize); - else - errno = EINVAL; - } - } - return (outsize ? (int)outsize : -errno); -} - -/* - * Return the ntfs attribute into an extended attribute - * The attribute is expected according to cpu endianness - * - * Returns 0, or -1 if there is a problem - */ - -int ntfs_set_ntfs_attrib(ntfs_inode *ni, - const char *value, size_t size, int flags) -{ - u32 attrib; - le32 settable; - ATTR_FLAGS dirflags; - int res; - - res = -1; - if (ni && value && (size >= sizeof(FILE_ATTR_FLAGS))) { - if (!(flags & XATTR_CREATE)) { - /* copy to avoid alignment problems */ - memcpy(&attrib,value,sizeof(FILE_ATTR_FLAGS)); - settable = FILE_ATTR_SETTABLE; - res = 0; - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - /* - * Accept changing compression for a directory - * and set index root accordingly - */ - settable |= FILE_ATTR_COMPRESSED; - if ((ni->flags ^ cpu_to_le32(attrib)) - & FILE_ATTR_COMPRESSED) { - if (ni->flags & FILE_ATTR_COMPRESSED) - dirflags = const_cpu_to_le16(0); - else - dirflags = ATTR_IS_COMPRESSED; - res = ntfs_attr_set_flags(ni, - AT_INDEX_ROOT, - NTFS_INDEX_I30, 4, - dirflags, - ATTR_COMPRESSION_MASK); - } - } - if (!res) { - ni->flags = (ni->flags & ~settable) - | (cpu_to_le32(attrib) & settable); - NInoFileNameSetDirty(ni); - NInoSetDirty(ni); - } - } else - errno = EEXIST; - } else - errno = EINVAL; - return (res ? -1 : 0); -} - -#endif /* HAVE_SETXATTR */ - -/* - * Open $Secure once for all - * returns zero if it succeeds - * non-zero if it fails. This is not an error (on NTFS v1.x) - */ - - -int ntfs_open_secure(ntfs_volume *vol) -{ - ntfs_inode *ni; - int res; - - res = -1; - vol->secure_ni = (ntfs_inode*)NULL; - vol->secure_xsii = (ntfs_index_context*)NULL; - vol->secure_xsdh = (ntfs_index_context*)NULL; - if (vol->major_ver >= 3) { - /* make sure this is a genuine $Secure inode 9 */ - ni = ntfs_pathname_to_inode(vol, NULL, "$Secure"); - if (ni && (ni->mft_no == 9)) { - vol->secure_reentry = 0; - vol->secure_xsii = ntfs_index_ctx_get(ni, - sii_stream, 4); - vol->secure_xsdh = ntfs_index_ctx_get(ni, - sdh_stream, 4); - if (ni && vol->secure_xsii && vol->secure_xsdh) { - vol->secure_ni = ni; - res = 0; - } - } - } - return (res); -} - -/* - * Final cleaning - * Allocated memory is freed to facilitate the detection of memory leaks - */ - -void ntfs_close_secure(struct SECURITY_CONTEXT *scx) -{ - ntfs_volume *vol; - - vol = scx->vol; - if (vol->secure_ni) { - ntfs_index_ctx_put(vol->secure_xsii); - ntfs_index_ctx_put(vol->secure_xsdh); - ntfs_inode_close(vol->secure_ni); - - } - ntfs_free_mapping(scx->mapping); - free_caches(scx); -} - -/* - * API for direct access to security descriptors - * based on Win32 API - */ - - -/* - * Selective feeding of a security descriptor into user buffer - * - * Returns TRUE if successful - */ - -static BOOL feedsecurityattr(const char *attr, u32 selection, - char *buf, u32 buflen, u32 *psize) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - SECURITY_DESCRIPTOR_RELATIVE *pnhead; - const ACL *pdacl; - const ACL *psacl; - const SID *pusid; - const SID *pgsid; - unsigned int offdacl; - unsigned int offsacl; - unsigned int offowner; - unsigned int offgroup; - unsigned int daclsz; - unsigned int saclsz; - unsigned int usidsz; - unsigned int gsidsz; - unsigned int size; /* size of requested attributes */ - BOOL ok; - unsigned int pos; - unsigned int avail; - le16 control; - - avail = 0; - control = SE_SELF_RELATIVE; - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)attr; - size = sizeof(SECURITY_DESCRIPTOR_RELATIVE); - - /* locate DACL if requested and available */ - if (phead->dacl && (selection & DACL_SECURITY_INFORMATION)) { - offdacl = le32_to_cpu(phead->dacl); - pdacl = (const ACL*)&attr[offdacl]; - daclsz = le16_to_cpu(pdacl->size); - size += daclsz; - avail |= DACL_SECURITY_INFORMATION; - } else - offdacl = daclsz = 0; - - /* locate owner if requested and available */ - offowner = le32_to_cpu(phead->owner); - if (offowner && (selection & OWNER_SECURITY_INFORMATION)) { - /* find end of USID */ - pusid = (const SID*)&attr[offowner]; - usidsz = ntfs_sid_size(pusid); - size += usidsz; - avail |= OWNER_SECURITY_INFORMATION; - } else - offowner = usidsz = 0; - - /* locate group if requested and available */ - offgroup = le32_to_cpu(phead->group); - if (offgroup && (selection & GROUP_SECURITY_INFORMATION)) { - /* find end of GSID */ - pgsid = (const SID*)&attr[offgroup]; - gsidsz = ntfs_sid_size(pgsid); - size += gsidsz; - avail |= GROUP_SECURITY_INFORMATION; - } else - offgroup = gsidsz = 0; - - /* locate SACL if requested and available */ - if (phead->sacl && (selection & SACL_SECURITY_INFORMATION)) { - /* find end of SACL */ - offsacl = le32_to_cpu(phead->sacl); - psacl = (const ACL*)&attr[offsacl]; - saclsz = le16_to_cpu(psacl->size); - size += saclsz; - avail |= SACL_SECURITY_INFORMATION; - } else - offsacl = saclsz = 0; - - /* - * Check having enough size in destination buffer - * (required size is returned nevertheless so that - * the request can be reissued with adequate size) - */ - if (size > buflen) { - *psize = size; - errno = EINVAL; - ok = FALSE; - } else { - if (selection & OWNER_SECURITY_INFORMATION) - control |= phead->control & SE_OWNER_DEFAULTED; - if (selection & GROUP_SECURITY_INFORMATION) - control |= phead->control & SE_GROUP_DEFAULTED; - if (selection & DACL_SECURITY_INFORMATION) - control |= phead->control - & (SE_DACL_PRESENT - | SE_DACL_DEFAULTED - | SE_DACL_AUTO_INHERITED - | SE_DACL_PROTECTED); - if (selection & SACL_SECURITY_INFORMATION) - control |= phead->control - & (SE_SACL_PRESENT - | SE_SACL_DEFAULTED - | SE_SACL_AUTO_INHERITED - | SE_SACL_PROTECTED); - /* - * copy header and feed new flags, even if no detailed data - */ - memcpy(buf,attr,sizeof(SECURITY_DESCRIPTOR_RELATIVE)); - pnhead = (SECURITY_DESCRIPTOR_RELATIVE*)buf; - pnhead->control = control; - pos = sizeof(SECURITY_DESCRIPTOR_RELATIVE); - - /* copy DACL if requested and available */ - if (selection & avail & DACL_SECURITY_INFORMATION) { - pnhead->dacl = cpu_to_le32(pos); - memcpy(&buf[pos],&attr[offdacl],daclsz); - pos += daclsz; - } else - pnhead->dacl = const_cpu_to_le32(0); - - /* copy SACL if requested and available */ - if (selection & avail & SACL_SECURITY_INFORMATION) { - pnhead->sacl = cpu_to_le32(pos); - memcpy(&buf[pos],&attr[offsacl],saclsz); - pos += saclsz; - } else - pnhead->sacl = const_cpu_to_le32(0); - - /* copy owner if requested and available */ - if (selection & avail & OWNER_SECURITY_INFORMATION) { - pnhead->owner = cpu_to_le32(pos); - memcpy(&buf[pos],&attr[offowner],usidsz); - pos += usidsz; - } else - pnhead->owner = const_cpu_to_le32(0); - - /* copy group if requested and available */ - if (selection & avail & GROUP_SECURITY_INFORMATION) { - pnhead->group = cpu_to_le32(pos); - memcpy(&buf[pos],&attr[offgroup],gsidsz); - pos += gsidsz; - } else - pnhead->group = const_cpu_to_le32(0); - if (pos != size) - ntfs_log_error("Error in security descriptor size\n"); - *psize = size; - ok = TRUE; - } - - return (ok); -} - -/* - * Merge a new security descriptor into the old one - * and assign to designated file - * - * Returns TRUE if successful - */ - -static BOOL mergesecurityattr(ntfs_volume *vol, const char *oldattr, - const char *newattr, u32 selection, ntfs_inode *ni) -{ - const SECURITY_DESCRIPTOR_RELATIVE *oldhead; - const SECURITY_DESCRIPTOR_RELATIVE *newhead; - SECURITY_DESCRIPTOR_RELATIVE *targhead; - const ACL *pdacl; - const ACL *psacl; - const SID *powner; - const SID *pgroup; - int offdacl; - int offsacl; - int offowner; - int offgroup; - unsigned int size; - le16 control; - char *target; - int pos; - int oldattrsz; - int newattrsz; - BOOL ok; - - ok = FALSE; /* default return */ - oldhead = (const SECURITY_DESCRIPTOR_RELATIVE*)oldattr; - newhead = (const SECURITY_DESCRIPTOR_RELATIVE*)newattr; - oldattrsz = ntfs_attr_size(oldattr); - newattrsz = ntfs_attr_size(newattr); - target = (char*)ntfs_malloc(oldattrsz + newattrsz); - if (target) { - targhead = (SECURITY_DESCRIPTOR_RELATIVE*)target; - pos = sizeof(SECURITY_DESCRIPTOR_RELATIVE); - control = SE_SELF_RELATIVE; - /* - * copy new DACL if selected - * or keep old DACL if any - */ - if ((selection & DACL_SECURITY_INFORMATION) ? - newhead->dacl : oldhead->dacl) { - if (selection & DACL_SECURITY_INFORMATION) { - offdacl = le32_to_cpu(newhead->dacl); - pdacl = (const ACL*)&newattr[offdacl]; - } else { - offdacl = le32_to_cpu(oldhead->dacl); - pdacl = (const ACL*)&oldattr[offdacl]; - } - size = le16_to_cpu(pdacl->size); - memcpy(&target[pos], pdacl, size); - targhead->dacl = cpu_to_le32(pos); - pos += size; - } else - targhead->dacl = const_cpu_to_le32(0); - if (selection & DACL_SECURITY_INFORMATION) { - control |= newhead->control - & (SE_DACL_PRESENT - | SE_DACL_DEFAULTED - | SE_DACL_PROTECTED); - if (newhead->control & SE_DACL_AUTO_INHERIT_REQ) - control |= SE_DACL_AUTO_INHERITED; - } else - control |= oldhead->control - & (SE_DACL_PRESENT - | SE_DACL_DEFAULTED - | SE_DACL_AUTO_INHERITED - | SE_DACL_PROTECTED); - /* - * copy new SACL if selected - * or keep old SACL if any - */ - if ((selection & SACL_SECURITY_INFORMATION) ? - newhead->sacl : oldhead->sacl) { - if (selection & SACL_SECURITY_INFORMATION) { - offsacl = le32_to_cpu(newhead->sacl); - psacl = (const ACL*)&newattr[offsacl]; - } else { - offsacl = le32_to_cpu(oldhead->sacl); - psacl = (const ACL*)&oldattr[offsacl]; - } - size = le16_to_cpu(psacl->size); - memcpy(&target[pos], psacl, size); - targhead->sacl = cpu_to_le32(pos); - pos += size; - } else - targhead->sacl = const_cpu_to_le32(0); - if (selection & SACL_SECURITY_INFORMATION) { - control |= newhead->control - & (SE_SACL_PRESENT - | SE_SACL_DEFAULTED - | SE_SACL_PROTECTED); - if (newhead->control & SE_SACL_AUTO_INHERIT_REQ) - control |= SE_SACL_AUTO_INHERITED; - } else - control |= oldhead->control - & (SE_SACL_PRESENT - | SE_SACL_DEFAULTED - | SE_SACL_AUTO_INHERITED - | SE_SACL_PROTECTED); - /* - * copy new OWNER if selected - * or keep old OWNER if any - */ - if ((selection & OWNER_SECURITY_INFORMATION) ? - newhead->owner : oldhead->owner) { - if (selection & OWNER_SECURITY_INFORMATION) { - offowner = le32_to_cpu(newhead->owner); - powner = (const SID*)&newattr[offowner]; - } else { - offowner = le32_to_cpu(oldhead->owner); - powner = (const SID*)&oldattr[offowner]; - } - size = ntfs_sid_size(powner); - memcpy(&target[pos], powner, size); - targhead->owner = cpu_to_le32(pos); - pos += size; - } else - targhead->owner = const_cpu_to_le32(0); - if (selection & OWNER_SECURITY_INFORMATION) - control |= newhead->control & SE_OWNER_DEFAULTED; - else - control |= oldhead->control & SE_OWNER_DEFAULTED; - /* - * copy new GROUP if selected - * or keep old GROUP if any - */ - if ((selection & GROUP_SECURITY_INFORMATION) ? - newhead->group : oldhead->group) { - if (selection & GROUP_SECURITY_INFORMATION) { - offgroup = le32_to_cpu(newhead->group); - pgroup = (const SID*)&newattr[offgroup]; - control |= newhead->control - & SE_GROUP_DEFAULTED; - } else { - offgroup = le32_to_cpu(oldhead->group); - pgroup = (const SID*)&oldattr[offgroup]; - control |= oldhead->control - & SE_GROUP_DEFAULTED; - } - size = ntfs_sid_size(pgroup); - memcpy(&target[pos], pgroup, size); - targhead->group = cpu_to_le32(pos); - pos += size; - } else - targhead->group = const_cpu_to_le32(0); - if (selection & GROUP_SECURITY_INFORMATION) - control |= newhead->control & SE_GROUP_DEFAULTED; - else - control |= oldhead->control & SE_GROUP_DEFAULTED; - targhead->revision = SECURITY_DESCRIPTOR_REVISION; - targhead->alignment = 0; - targhead->control = control; - ok = !update_secur_descr(vol, target, ni); - free(target); - } - return (ok); -} - -/* - * Return the security descriptor of a file - * This is intended to be similar to GetFileSecurity() from Win32 - * in order to facilitate the development of portable tools - * - * returns zero if unsuccessful (following Win32 conventions) - * -1 if no securid - * the securid if any - * - * The Win32 API is : - * - * BOOL WINAPI GetFileSecurity( - * __in LPCTSTR lpFileName, - * __in SECURITY_INFORMATION RequestedInformation, - * __out_opt PSECURITY_DESCRIPTOR pSecurityDescriptor, - * __in DWORD nLength, - * __out LPDWORD lpnLengthNeeded - * ); - * - */ - -int ntfs_get_file_security(struct SECURITY_API *scapi, - const char *path, u32 selection, - char *buf, u32 buflen, u32 *psize) -{ - ntfs_inode *ni; - char *attr; - int res; - - res = 0; /* default return */ - if (scapi && (scapi->magic == MAGIC_API)) { - ni = ntfs_pathname_to_inode(scapi->security.vol, NULL, path); - if (ni) { - attr = getsecurityattr(scapi->security.vol, ni); - if (attr) { - if (feedsecurityattr(attr,selection, - buf,buflen,psize)) { - if (test_nino_flag(ni, v3_Extensions) - && ni->security_id) - res = le32_to_cpu( - ni->security_id); - else - res = -1; - } - free(attr); - } - ntfs_inode_close(ni); - } else - errno = ENOENT; - if (!res) *psize = 0; - } else - errno = EINVAL; /* do not clear *psize */ - return (res); -} - - -/* - * Set the security descriptor of a file or directory - * This is intended to be similar to SetFileSecurity() from Win32 - * in order to facilitate the development of portable tools - * - * returns zero if unsuccessful (following Win32 conventions) - * -1 if no securid - * the securid if any - * - * The Win32 API is : - * - * BOOL WINAPI SetFileSecurity( - * __in LPCTSTR lpFileName, - * __in SECURITY_INFORMATION SecurityInformation, - * __in PSECURITY_DESCRIPTOR pSecurityDescriptor - * ); - */ - -int ntfs_set_file_security(struct SECURITY_API *scapi, - const char *path, u32 selection, const char *attr) -{ - const SECURITY_DESCRIPTOR_RELATIVE *phead; - ntfs_inode *ni; - int attrsz; - BOOL missing; - char *oldattr; - int res; - - res = 0; /* default return */ - if (scapi && (scapi->magic == MAGIC_API) && attr) { - phead = (const SECURITY_DESCRIPTOR_RELATIVE*)attr; - attrsz = ntfs_attr_size(attr); - /* if selected, owner and group must be present or defaulted */ - missing = ((selection & OWNER_SECURITY_INFORMATION) - && !phead->owner - && !(phead->control & SE_OWNER_DEFAULTED)) - || ((selection & GROUP_SECURITY_INFORMATION) - && !phead->group - && !(phead->control & SE_GROUP_DEFAULTED)); - if (!missing - && (phead->control & SE_SELF_RELATIVE) - && ntfs_valid_descr(attr, attrsz)) { - ni = ntfs_pathname_to_inode(scapi->security.vol, - NULL, path); - if (ni) { - oldattr = getsecurityattr(scapi->security.vol, - ni); - if (oldattr) { - if (mergesecurityattr( - scapi->security.vol, - oldattr, attr, - selection, ni)) { - if (test_nino_flag(ni, - v3_Extensions)) - res = le32_to_cpu( - ni->security_id); - else - res = -1; - } - free(oldattr); - } - ntfs_inode_close(ni); - } - } else - errno = EINVAL; - } else - errno = EINVAL; - return (res); -} - - -/* - * Return the attributes of a file - * This is intended to be similar to GetFileAttributes() from Win32 - * in order to facilitate the development of portable tools - * - * returns -1 if unsuccessful (Win32 : INVALID_FILE_ATTRIBUTES) - * - * The Win32 API is : - * - * DWORD WINAPI GetFileAttributes( - * __in LPCTSTR lpFileName - * ); - */ - -int ntfs_get_file_attributes(struct SECURITY_API *scapi, const char *path) -{ - ntfs_inode *ni; - s32 attrib; - - attrib = -1; /* default return */ - if (scapi && (scapi->magic == MAGIC_API) && path) { - ni = ntfs_pathname_to_inode(scapi->security.vol, NULL, path); - if (ni) { - attrib = le32_to_cpu(ni->flags); - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) - attrib |= const_le32_to_cpu(FILE_ATTR_DIRECTORY); - else - attrib &= ~const_le32_to_cpu(FILE_ATTR_DIRECTORY); - if (!attrib) - attrib |= const_le32_to_cpu(FILE_ATTR_NORMAL); - - ntfs_inode_close(ni); - } else - errno = ENOENT; - } else - errno = EINVAL; /* do not clear *psize */ - return (attrib); -} - - -/* - * Set attributes to a file or directory - * This is intended to be similar to SetFileAttributes() from Win32 - * in order to facilitate the development of portable tools - * - * Only a few flags can be set (same list as Win32) - * - * returns zero if unsuccessful (following Win32 conventions) - * nonzero if successful - * - * The Win32 API is : - * - * BOOL WINAPI SetFileAttributes( - * __in LPCTSTR lpFileName, - * __in DWORD dwFileAttributes - * ); - */ - -BOOL ntfs_set_file_attributes(struct SECURITY_API *scapi, - const char *path, s32 attrib) -{ - ntfs_inode *ni; - le32 settable; - ATTR_FLAGS dirflags; - int res; - - res = 0; /* default return */ - if (scapi && (scapi->magic == MAGIC_API) && path) { - ni = ntfs_pathname_to_inode(scapi->security.vol, NULL, path); - if (ni) { - settable = FILE_ATTR_SETTABLE; - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - /* - * Accept changing compression for a directory - * and set index root accordingly - */ - settable |= FILE_ATTR_COMPRESSED; - if ((ni->flags ^ cpu_to_le32(attrib)) - & FILE_ATTR_COMPRESSED) { - if (ni->flags & FILE_ATTR_COMPRESSED) - dirflags = const_cpu_to_le16(0); - else - dirflags = ATTR_IS_COMPRESSED; - res = ntfs_attr_set_flags(ni, - AT_INDEX_ROOT, - NTFS_INDEX_I30, 4, - dirflags, - ATTR_COMPRESSION_MASK); - } - } - if (!res) { - ni->flags = (ni->flags & ~settable) - | (cpu_to_le32(attrib) & settable); - NInoSetDirty(ni); - } - if (!ntfs_inode_close(ni)) - res = -1; - } else - errno = ENOENT; - } - return (res); -} - - -BOOL ntfs_read_directory(struct SECURITY_API *scapi, - const char *path, ntfs_filldir_t callback, void *context) -{ - ntfs_inode *ni; - BOOL ok; - s64 pos; - - ok = FALSE; /* default return */ - if (scapi && (scapi->magic == MAGIC_API) && callback) { - ni = ntfs_pathname_to_inode(scapi->security.vol, NULL, path); - if (ni) { - if (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) { - pos = 0; - ntfs_readdir(ni,&pos,context,callback); - ok = !ntfs_inode_close(ni); - } else { - ntfs_inode_close(ni); - errno = ENOTDIR; - } - } else - errno = ENOENT; - } else - errno = EINVAL; /* do not clear *psize */ - return (ok); -} - -/* - * read $SDS (for auditing security data) - * - * Returns the number or read bytes, or -1 if there is an error - */ - -int ntfs_read_sds(struct SECURITY_API *scapi, - char *buf, u32 size, u32 offset) -{ - int got; - - got = -1; /* default return */ - if (scapi && (scapi->magic == MAGIC_API)) { - if (scapi->security.vol->secure_ni) - got = ntfs_local_read(scapi->security.vol->secure_ni, - STREAM_SDS, 4, buf, size, offset); - else - errno = EOPNOTSUPP; - } else - errno = EINVAL; - return (got); -} - -/* - * read $SII (for auditing security data) - * - * Returns next entry, or NULL if there is an error - */ - -INDEX_ENTRY *ntfs_read_sii(struct SECURITY_API *scapi, - INDEX_ENTRY *entry) -{ - SII_INDEX_KEY key; - INDEX_ENTRY *ret; - BOOL found; - ntfs_index_context *xsii; - - ret = (INDEX_ENTRY*)NULL; /* default return */ - if (scapi && (scapi->magic == MAGIC_API)) { - xsii = scapi->security.vol->secure_xsii; - if (xsii) { - if (!entry) { - key.security_id = const_cpu_to_le32(0); - found = !ntfs_index_lookup((char*)&key, - sizeof(SII_INDEX_KEY), xsii); - /* not supposed to find */ - if (!found && (errno == ENOENT)) - ret = xsii->entry; - } else - ret = ntfs_index_next(entry,xsii); - if (!ret) - errno = ENODATA; - } else - errno = EOPNOTSUPP; - } else - errno = EINVAL; - return (ret); -} - -/* - * read $SDH (for auditing security data) - * - * Returns next entry, or NULL if there is an error - */ - -INDEX_ENTRY *ntfs_read_sdh(struct SECURITY_API *scapi, - INDEX_ENTRY *entry) -{ - SDH_INDEX_KEY key; - INDEX_ENTRY *ret; - BOOL found; - ntfs_index_context *xsdh; - - ret = (INDEX_ENTRY*)NULL; /* default return */ - if (scapi && (scapi->magic == MAGIC_API)) { - xsdh = scapi->security.vol->secure_xsdh; - if (xsdh) { - if (!entry) { - key.hash = const_cpu_to_le32(0); - key.security_id = const_cpu_to_le32(0); - found = !ntfs_index_lookup((char*)&key, - sizeof(SDH_INDEX_KEY), xsdh); - /* not supposed to find */ - if (!found && (errno == ENOENT)) - ret = xsdh->entry; - } else - ret = ntfs_index_next(entry,xsdh); - if (!ret) - errno = ENODATA; - } else errno = ENOTSUP; - } else - errno = EINVAL; - return (ret); -} - -/* - * Get the mapped user SID - * A buffer of 40 bytes has to be supplied - * - * returns the size of the SID, or zero and errno set if not found - */ - -int ntfs_get_usid(struct SECURITY_API *scapi, uid_t uid, char *buf) -{ - const SID *usid; - BIGSID defusid; - int size; - - size = 0; - if (scapi && (scapi->magic == MAGIC_API)) { - usid = ntfs_find_usid(scapi->security.mapping[MAPUSERS], uid, (SID*)&defusid); - if (usid) { - size = ntfs_sid_size(usid); - memcpy(buf,usid,size); - } else - errno = ENODATA; - } else - errno = EINVAL; - return (size); -} - -/* - * Get the mapped group SID - * A buffer of 40 bytes has to be supplied - * - * returns the size of the SID, or zero and errno set if not found - */ - -int ntfs_get_gsid(struct SECURITY_API *scapi, gid_t gid, char *buf) -{ - const SID *gsid; - BIGSID defgsid; - int size; - - size = 0; - if (scapi && (scapi->magic == MAGIC_API)) { - gsid = ntfs_find_gsid(scapi->security.mapping[MAPGROUPS], gid, (SID*)&defgsid); - if (gsid) { - size = ntfs_sid_size(gsid); - memcpy(buf,gsid,size); - } else - errno = ENODATA; - } else - errno = EINVAL; - return (size); -} - -/* - * Get the user mapped to a SID - * - * returns the uid, or -1 if not found - */ - -int ntfs_get_user(struct SECURITY_API *scapi, const SID *usid) -{ - int uid; - - uid = -1; - if (scapi && (scapi->magic == MAGIC_API) && ntfs_valid_sid(usid)) { - if (ntfs_same_sid(usid,adminsid)) - uid = 0; - else { - uid = ntfs_find_user(scapi->security.mapping[MAPUSERS], usid); - if (!uid) { - uid = -1; - errno = ENODATA; - } - } - } else - errno = EINVAL; - return (uid); -} - -/* - * Get the group mapped to a SID - * - * returns the uid, or -1 if not found - */ - -int ntfs_get_group(struct SECURITY_API *scapi, const SID *gsid) -{ - int gid; - - gid = -1; - if (scapi && (scapi->magic == MAGIC_API) && ntfs_valid_sid(gsid)) { - if (ntfs_same_sid(gsid,adminsid)) - gid = 0; - else { - gid = ntfs_find_group(scapi->security.mapping[MAPGROUPS], gsid); - if (!gid) { - gid = -1; - errno = ENODATA; - } - } - } else - errno = EINVAL; - return (gid); -} - -/* - * Initializations before calling ntfs_get_file_security() - * ntfs_set_file_security() and ntfs_read_directory() - * - * Only allowed for root - * - * Returns an (obscured) struct SECURITY_API* needed for further calls - * NULL if not root (EPERM) or device is mounted (EBUSY) - */ - -struct SECURITY_API *ntfs_initialize_file_security(const char *device, - int flags) -{ - ntfs_volume *vol; - unsigned long mntflag; - int mnt; - struct SECURITY_API *scapi; - struct SECURITY_CONTEXT *scx; - - scapi = (struct SECURITY_API*)NULL; - mnt = ntfs_check_if_mounted(device, &mntflag); - if (!mnt && !(mntflag & NTFS_MF_MOUNTED) && !getuid()) { - vol = ntfs_mount(device, flags); - if (vol) { - scapi = (struct SECURITY_API*) - ntfs_malloc(sizeof(struct SECURITY_API)); - if (!ntfs_volume_get_free_space(vol) - && scapi) { - scapi->magic = MAGIC_API; - scapi->seccache = (struct PERMISSIONS_CACHE*)NULL; - scx = &scapi->security; - scx->vol = vol; - scx->uid = getuid(); - scx->gid = getgid(); - scx->pseccache = &scapi->seccache; - scx->vol->secure_flags = 0; - /* accept no mapping and no $Secure */ - ntfs_build_mapping(scx,(const char*)NULL,TRUE); - ntfs_open_secure(vol); - } else { - if (scapi) - free(scapi); - else - errno = ENOMEM; - mnt = ntfs_umount(vol,FALSE); - scapi = (struct SECURITY_API*)NULL; - } - } - } else - if (getuid()) - errno = EPERM; - else - errno = EBUSY; - return (scapi); -} - -/* - * Leaving after ntfs_initialize_file_security() - * - * Returns FALSE if FAILED - */ - -BOOL ntfs_leave_file_security(struct SECURITY_API *scapi) -{ - int ok; - ntfs_volume *vol; - - ok = FALSE; - if (scapi && (scapi->magic == MAGIC_API) && scapi->security.vol) { - vol = scapi->security.vol; - ntfs_close_secure(&scapi->security); - free(scapi); - if (!ntfs_umount(vol, 0)) - ok = TRUE; - } - return (ok); -} - diff --git a/source/libs/libntfs/security.h b/source/libs/libntfs/security.h deleted file mode 100644 index 83d7c0e1..00000000 --- a/source/libs/libntfs/security.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - * security.h - Exports for handling security/ACLs in NTFS. - * Originated from the Linux-NTFS project. - * - * Copyright (c) 2004 Anton Altaparmakov - * Copyright (c) 2005-2006 Szabolcs Szakacsits - * Copyright (c) 2007-2008 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_SECURITY_H -#define _NTFS_SECURITY_H - -#include "types.h" -#include "layout.h" -#include "inode.h" -#include "dir.h" - -#ifndef POSIXACLS -#define POSIXACLS 0 -#endif - -typedef u16 be16; -typedef u32 be32; - -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define const_cpu_to_be16(x) ((((x) & 255L) << 8) + (((x) >> 8) & 255L)) -#define const_cpu_to_be32(x) ((((x) & 255L) << 24) + (((x) & 0xff00L) << 8) \ - + (((x) >> 8) & 0xff00L) + (((x) >> 24) & 255L)) -#else -#define const_cpu_to_be16(x) (x) -#define const_cpu_to_be32(x) (x) -#endif - -/* - * item in the mapping list - */ - -struct MAPPING { - struct MAPPING *next; - int xid; /* linux id : uid or gid */ - SID *sid; /* Windows id : usid or gsid */ - int grcnt; /* group count (for users only) */ - gid_t *groups; /* groups which the user is member of */ -}; - -/* - * Entry in the permissions cache - * Note : this cache is not organized as a generic cache - */ - -struct CACHED_PERMISSIONS { - uid_t uid; - gid_t gid; - le32 inh_fileid; - le32 inh_dirid; -#if POSIXACLS - struct POSIX_SECURITY *pxdesc; - unsigned int pxdescsize:16; -#endif - unsigned int mode:12; - unsigned int valid:1; -} ; - -/* - * Entry in the permissions cache for directories with no security_id - */ - -struct CACHED_PERMISSIONS_LEGACY { - struct CACHED_PERMISSIONS_LEGACY *next; - struct CACHED_PERMISSIONS_LEGACY *previous; - void *variable; - size_t varsize; - /* above fields must match "struct CACHED_GENERIC" */ - u64 mft_no; - struct CACHED_PERMISSIONS perm; -} ; - -/* - * Entry in the securid cache - */ - -struct CACHED_SECURID { - struct CACHED_SECURID *next; - struct CACHED_SECURID *previous; - void *variable; - size_t varsize; - /* above fields must match "struct CACHED_GENERIC" */ - uid_t uid; - gid_t gid; - unsigned int dmode; - le32 securid; -} ; - -/* - * Header of the security cache - * (has no cache structure by itself) - */ - -struct CACHED_PERMISSIONS_HEADER { - unsigned int last; - /* statistics for permissions */ - unsigned long p_writes; - unsigned long p_reads; - unsigned long p_hits; -} ; - -/* - * The whole permissions cache - */ - -struct PERMISSIONS_CACHE { - struct CACHED_PERMISSIONS_HEADER head; - struct CACHED_PERMISSIONS *cachetable[1]; /* array of variable size */ -} ; - -/* - * Security flags values - */ - -enum { - SECURITY_DEFAULT, /* rely on fuse for permissions checking */ - SECURITY_RAW, /* force same ownership/permissions on files */ - SECURITY_ADDSECURIDS, /* upgrade old security descriptors */ - SECURITY_STATICGRPS, /* use static groups for access control */ - SECURITY_WANTED /* a security related option was present */ -} ; - -/* - * Security context, needed by most security functions - */ - -enum { MAPUSERS, MAPGROUPS, MAPCOUNT } ; - -struct SECURITY_CONTEXT { - ntfs_volume *vol; - struct MAPPING *mapping[MAPCOUNT]; - struct PERMISSIONS_CACHE **pseccache; - uid_t uid; /* uid of user requesting (not the mounter) */ - gid_t gid; /* gid of user requesting (not the mounter) */ - pid_t tid; /* thread id of thread requesting */ - mode_t umask; /* umask of requesting thread */ - } ; - -#if POSIXACLS - -/* - * Posix ACL structures - */ - -struct POSIX_ACE { - u16 tag; - u16 perms; - s32 id; -} __attribute__((__packed__)); - -struct POSIX_ACL { - u8 version; - u8 flags; - u16 filler; - struct POSIX_ACE ace[0]; -} __attribute__((__packed__)); - -struct POSIX_SECURITY { - mode_t mode; - int acccnt; - int defcnt; - int firstdef; - u16 tagsset; - struct POSIX_ACL acl; -} ; - -/* - * Posix tags, cpu-endian 16 bits - */ - -enum { - POSIX_ACL_USER_OBJ = 1, - POSIX_ACL_USER = 2, - POSIX_ACL_GROUP_OBJ = 4, - POSIX_ACL_GROUP = 8, - POSIX_ACL_MASK = 16, - POSIX_ACL_OTHER = 32, - POSIX_ACL_SPECIAL = 64 /* internal use only */ -} ; - -#define POSIX_ACL_EXTENSIONS (POSIX_ACL_USER | POSIX_ACL_GROUP | POSIX_ACL_MASK) - -/* - * Posix permissions, cpu-endian 16 bits - */ - -enum { - POSIX_PERM_X = 1, - POSIX_PERM_W = 2, - POSIX_PERM_R = 4, - POSIX_PERM_DENIAL = 64 /* internal use only */ -} ; - -#define POSIX_VERSION 2 - -#endif - -extern BOOL ntfs_guid_is_zero(const GUID *guid); -extern char *ntfs_guid_to_mbs(const GUID *guid, char *guid_str); - -/** - * ntfs_sid_is_valid - determine if a SID is valid - * @sid: SID for which to determine if it is valid - * - * Determine if the SID pointed to by @sid is valid. - * - * Return TRUE if it is valid and FALSE otherwise. - */ -static __inline__ BOOL ntfs_sid_is_valid(const SID *sid) -{ - if (!sid || sid->revision != SID_REVISION || - sid->sub_authority_count > SID_MAX_SUB_AUTHORITIES) - return FALSE; - return TRUE; -} - -extern int ntfs_sid_to_mbs_size(const SID *sid); -extern char *ntfs_sid_to_mbs(const SID *sid, char *sid_str, - size_t sid_str_size); -extern void ntfs_generate_guid(GUID *guid); -extern int ntfs_sd_add_everyone(ntfs_inode *ni); - -extern le32 ntfs_security_hash(const SECURITY_DESCRIPTOR_RELATIVE *sd, - const u32 len); - -int ntfs_build_mapping(struct SECURITY_CONTEXT *scx, const char *usermap_path, - BOOL allowdef); -int ntfs_get_owner_mode(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, struct stat*); -int ntfs_set_mode(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, mode_t mode); -BOOL ntfs_allowed_as_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni); -int ntfs_allowed_access(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, int accesstype); -BOOL old_ntfs_allowed_dir_access(struct SECURITY_CONTEXT *scx, - const char *path, int accesstype); - -#if POSIXACLS -le32 ntfs_alloc_securid(struct SECURITY_CONTEXT *scx, - uid_t uid, gid_t gid, ntfs_inode *dir_ni, - mode_t mode, BOOL isdir); -#else -le32 ntfs_alloc_securid(struct SECURITY_CONTEXT *scx, - uid_t uid, gid_t gid, mode_t mode, BOOL isdir); -#endif -int ntfs_set_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - uid_t uid, gid_t gid); -int ntfs_set_ownmod(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, uid_t uid, gid_t gid, mode_t mode); -#if POSIXACLS -int ntfs_set_owner_mode(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, uid_t uid, gid_t gid, - mode_t mode, struct POSIX_SECURITY *pxdesc); -#else -int ntfs_set_owner_mode(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, uid_t uid, gid_t gid, mode_t mode); -#endif -le32 ntfs_inherited_id(struct SECURITY_CONTEXT *scx, - ntfs_inode *dir_ni, BOOL fordir); -int ntfs_open_secure(ntfs_volume *vol); -void ntfs_close_secure(struct SECURITY_CONTEXT *scx); - -#if POSIXACLS - -int ntfs_set_inherited_posix(struct SECURITY_CONTEXT *scx, - ntfs_inode *ni, uid_t uid, gid_t gid, - ntfs_inode *dir_ni, mode_t mode); -int ntfs_get_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - const char *name, char *value, size_t size); -int ntfs_set_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - const char *name, const char *value, size_t size, - int flags); -int ntfs_remove_posix_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - const char *name); -#endif - -int ntfs_get_ntfs_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - char *value, size_t size); -int ntfs_set_ntfs_acl(struct SECURITY_CONTEXT *scx, ntfs_inode *ni, - const char *value, size_t size, int flags); - -int ntfs_get_ntfs_attrib(ntfs_inode *ni, char *value, size_t size); -int ntfs_set_ntfs_attrib(ntfs_inode *ni, - const char *value, size_t size, int flags); - - -/* - * Security API for direct access to security descriptors - * based on Win32 API - */ - -#define MAGIC_API 0x09042009 - -struct SECURITY_API { - u32 magic; - struct SECURITY_CONTEXT security; - struct PERMISSIONS_CACHE *seccache; -} ; - -/* - * The following constants are used in interfacing external programs. - * They are not to be stored on disk and must be defined in their - * native cpu representation. - * When disk representation (le) is needed, use SE_DACL_PRESENT, etc. - */ -enum { OWNER_SECURITY_INFORMATION = 1, - GROUP_SECURITY_INFORMATION = 2, - DACL_SECURITY_INFORMATION = 4, - SACL_SECURITY_INFORMATION = 8 -} ; - -int ntfs_get_file_security(struct SECURITY_API *scapi, - const char *path, u32 selection, - char *buf, u32 buflen, u32 *psize); -int ntfs_set_file_security(struct SECURITY_API *scapi, - const char *path, u32 selection, const char *attr); -int ntfs_get_file_attributes(struct SECURITY_API *scapi, - const char *path); -BOOL ntfs_set_file_attributes(struct SECURITY_API *scapi, - const char *path, s32 attrib); -BOOL ntfs_read_directory(struct SECURITY_API *scapi, - const char *path, ntfs_filldir_t callback, void *context); -int ntfs_read_sds(struct SECURITY_API *scapi, - char *buf, u32 size, u32 offset); -INDEX_ENTRY *ntfs_read_sii(struct SECURITY_API *scapi, - INDEX_ENTRY *entry); -INDEX_ENTRY *ntfs_read_sdh(struct SECURITY_API *scapi, - INDEX_ENTRY *entry); -struct SECURITY_API *ntfs_initialize_file_security(const char *device, - int flags); -BOOL ntfs_leave_file_security(struct SECURITY_API *scx); - -int ntfs_get_usid(struct SECURITY_API *scapi, uid_t uid, char *buf); -int ntfs_get_gsid(struct SECURITY_API *scapi, gid_t gid, char *buf); -int ntfs_get_user(struct SECURITY_API *scapi, const SID *usid); -int ntfs_get_group(struct SECURITY_API *scapi, const SID *gsid); - -#endif /* defined _NTFS_SECURITY_H */ diff --git a/source/libs/libntfs/support.h b/source/libs/libntfs/support.h deleted file mode 100644 index 6af4761e..00000000 --- a/source/libs/libntfs/support.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * support.h - Useful definitions and macros. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_SUPPORT_H -#define _NTFS_SUPPORT_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -/* - * Our mailing list. Use this define to prevent typos in email address. - */ -#define NTFS_DEV_LIST "ntfs-3g-devel@lists.sf.net" - -/* - * Generic macro to convert pointers to values for comparison purposes. - */ -#ifndef p2n -#define p2n(p) ((ptrdiff_t)((ptrdiff_t*)(p))) -#endif - -/* - * The classic min and max macros. - */ -#ifndef min -#define min(a,b) ((a) <= (b) ? (a) : (b)) -#endif - -#ifndef max -#define max(a,b) ((a) >= (b) ? (a) : (b)) -#endif - -/* - * Useful macro for determining the offset of a struct member. - */ -#ifndef offsetof -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif - -/* - * Simple bit operation macros. NOTE: These are NOT atomic. - */ -#define test_bit(bit, var) ((var) & (1 << (bit))) -#define set_bit(bit, var) (var) |= 1 << (bit) -#define clear_bit(bit, var) (var) &= ~(1 << (bit)) - -#define test_and_set_bit(bit, var) \ -({ \ - const BOOL old_state = test_bit(bit, var); \ - set_bit(bit, var); \ - old_state; \ -}) - -#define test_and_clear_bit(bit, var) \ -({ \ - const BOOL old_state = test_bit(bit, var); \ - clear_bit(bit, var); \ - old_state; \ -}) - -#endif /* defined _NTFS_SUPPORT_H */ - diff --git a/source/libs/libntfs/types.h b/source/libs/libntfs/types.h deleted file mode 100644 index 7b13469d..00000000 --- a/source/libs/libntfs/types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * types.h - Misc type definitions not related to on-disk structure. - * Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_TYPES_H -#define _NTFS_TYPES_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#if HAVE_STDINT_H || !HAVE_CONFIG_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef GEKKO -#include -#include "compat.h" -#else /* GEKKO */ - -typedef uint8_t u8; /* Unsigned types of an exact size */ -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; - -typedef int8_t s8; /* Signed types of an exact size */ -typedef int16_t s16; -typedef int32_t s32; -typedef int64_t s64; - -#endif /* GEKKO */ - -typedef u16 le16; -typedef u32 le32; -typedef u64 le64; - -/* - * Declare sle{16,32,64} to be unsigned because we do not want sign extension - * on BE architectures. - */ -typedef u16 sle16; -typedef u32 sle32; -typedef u64 sle64; - -typedef u16 ntfschar; /* 2-byte Unicode character type. */ -#define UCHAR_T_SIZE_BITS 1 - -/* - * Clusters are signed 64-bit values on NTFS volumes. We define two types, LCN - * and VCN, to allow for type checking and better code readability. - */ -typedef s64 VCN; -typedef sle64 leVCN; -typedef s64 LCN; -typedef sle64 leLCN; - -/* - * The NTFS journal $LogFile uses log sequence numbers which are signed 64-bit - * values. We define our own type LSN, to allow for type checking and better - * code readability. - */ -typedef s64 LSN; -typedef sle64 leLSN; - -/* - * Cygwin has a collision between our BOOL and 's - * As long as this file will be included after were fine. - */ -#ifndef GEKKO -#ifndef _WINDEF_H -/** - * enum BOOL - These are just to make the code more readable... - */ -typedef enum { -#ifndef FALSE - FALSE = 0, -#endif -#ifndef NO - NO = 0, -#endif -#ifndef ZERO - ZERO = 0, -#endif -#ifndef TRUE - TRUE = 1, -#endif -#ifndef YES - YES = 1, -#endif -#ifndef ONE - ONE = 1, -#endif -} BOOL; -#endif /* defined _WINDEF_H */ -#endif /* defined GEKKO */ - -/** - * enum IGNORE_CASE_BOOL - - */ -typedef enum { - CASE_SENSITIVE = 0, - IGNORE_CASE = 1, -} IGNORE_CASE_BOOL; - -#define STATUS_OK (0) -#define STATUS_ERROR (-1) -#define STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT (-2) -#define STATUS_KEEP_SEARCHING (-3) -#define STATUS_NOT_FOUND (-4) - -#endif /* defined _NTFS_TYPES_H */ - diff --git a/source/libs/libntfs/unistr.c b/source/libs/libntfs/unistr.c deleted file mode 100644 index eb72f0ff..00000000 --- a/source/libs/libntfs/unistr.c +++ /dev/null @@ -1,1438 +0,0 @@ -/** - * unistr.c - Unicode string handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * Copyright (c) 2002-2009 Szabolcs Szakacsits - * Copyright (c) 2008-2009 Jean-Pierre Andre - * Copyright (c) 2008 Bernhard Kaindl - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_WCHAR_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_LOCALE_H -#include -#endif - -#if defined(__APPLE__) || defined(__DARWIN__) -#ifdef ENABLE_NFCONV -#include -#endif /* ENABLE_NFCONV */ -#endif /* defined(__APPLE__) || defined(__DARWIN__) */ - -#include "compat.h" -#include "attrib.h" -#include "types.h" -#include "unistr.h" -#include "debug.h" -#include "logging.h" -#include "misc.h" - -#define NOREVBOM 0 /* JPA rejecting U+FFFE and U+FFFF, open to debate */ - -/* - * IMPORTANT - * ========= - * - * All these routines assume that the Unicode characters are in little endian - * encoding inside the strings!!! - */ - -static int use_utf8 = 1; /* use UTF-8 encoding for file names */ - -#if defined(__APPLE__) || defined(__DARWIN__) -#ifdef ENABLE_NFCONV -/** - * This variable controls whether or not automatic normalization form conversion - * should be performed when translating NTFS unicode file names to UTF-8. - * Defaults to on, but can be controlled from the outside using the function - * int ntfs_macosx_normalize_filenames(int normalize); - */ -static int nfconvert_utf8 = 1; -#endif /* ENABLE_NFCONV */ -#endif /* defined(__APPLE__) || defined(__DARWIN__) */ - -/* - * This is used by the name collation functions to quickly determine what - * characters are (in)valid. - */ -#if 0 -static const u8 legal_ansi_char_array[0x40] = { - 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, - - 0x17, 0x07, 0x18, 0x17, 0x17, 0x17, 0x17, 0x17, - 0x17, 0x17, 0x18, 0x16, 0x16, 0x17, 0x07, 0x00, - - 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, - 0x17, 0x17, 0x04, 0x16, 0x18, 0x16, 0x18, 0x18, -}; -#endif - -/** - * ntfs_names_are_equal - compare two Unicode names for equality - * @s1: name to compare to @s2 - * @s1_len: length in Unicode characters of @s1 - * @s2: name to compare to @s1 - * @s2_len: length in Unicode characters of @s2 - * @ic: ignore case bool - * @upcase: upcase table (only if @ic == IGNORE_CASE) - * @upcase_size: length in Unicode characters of @upcase (if present) - * - * Compare the names @s1 and @s2 and return TRUE (1) if the names are - * identical, or FALSE (0) if they are not identical. If @ic is IGNORE_CASE, - * the @upcase table is used to perform a case insensitive comparison. - */ -BOOL ntfs_names_are_equal(const ntfschar *s1, size_t s1_len, - const ntfschar *s2, size_t s2_len, - const IGNORE_CASE_BOOL ic, - const ntfschar *upcase, const u32 upcase_size) -{ - if (s1_len != s2_len) - return FALSE; - if (!s1_len) - return TRUE; - if (ic == CASE_SENSITIVE) - return ntfs_ucsncmp(s1, s2, s1_len) ? FALSE: TRUE; - return ntfs_ucsncasecmp(s1, s2, s1_len, upcase, upcase_size) ? FALSE: - TRUE; -} - -/* - * ntfs_names_full_collate() fully collate two Unicode names - * - * @name1: first Unicode name to compare - * @name1_len: length of first Unicode name to compare - * @name2: second Unicode name to compare - * @name2_len: length of second Unicode name to compare - * @ic: either CASE_SENSITIVE or IGNORE_CASE - * @upcase: upcase table (ignored if @ic is CASE_SENSITIVE) - * @upcase_len: upcase table size (ignored if @ic is CASE_SENSITIVE) - * - * -1 if the first name collates before the second one, - * 0 if the names match, - * 1 if the second name collates before the first one, or - * - */ -int ntfs_names_full_collate(const ntfschar *name1, const u32 name1_len, - const ntfschar *name2, const u32 name2_len, - const IGNORE_CASE_BOOL ic, const ntfschar *upcase, - const u32 upcase_len) -{ - u32 cnt; - u16 c1, c2; - u16 u1, u2; - -#ifdef DEBUG - if (!name1 || !name2 || (ic && (!upcase || !upcase_len))) { - ntfs_log_debug("ntfs_names_collate received NULL pointer!\n"); - exit(1); - } -#endif - cnt = min(name1_len, name2_len); - if (cnt > 0) { - if (ic == CASE_SENSITIVE) { - do { - c1 = le16_to_cpu(*name1); - name1++; - c2 = le16_to_cpu(*name2); - name2++; - } while (--cnt && (c1 == c2)); - u1 = c1; - u2 = c2; - if (u1 < upcase_len) - u1 = le16_to_cpu(upcase[u1]); - if (u2 < upcase_len) - u2 = le16_to_cpu(upcase[u2]); - if ((u1 == u2) && cnt) - do { - u1 = le16_to_cpu(*name1); - name1++; - u2 = le16_to_cpu(*name2); - name2++; - if (u1 < upcase_len) - u1 = le16_to_cpu(upcase[u1]); - if (u2 < upcase_len) - u2 = le16_to_cpu(upcase[u2]); - } while ((u1 == u2) && --cnt); - if (u1 < u2) - return -1; - if (u1 > u2) - return 1; - if (name1_len < name2_len) - return -1; - if (name1_len > name2_len) - return 1; - if (c1 < c2) - return -1; - if (c1 > c2) - return 1; - } else { - do { - u1 = c1 = le16_to_cpu(*name1); - name1++; - u2 = c2 = le16_to_cpu(*name2); - name2++; - if (u1 < upcase_len) - u1 = le16_to_cpu(upcase[u1]); - if (u2 < upcase_len) - u2 = le16_to_cpu(upcase[u2]); - } while ((u1 == u2) && --cnt); - if (u1 < u2) - return -1; - if (u1 > u2) - return 1; - if (name1_len < name2_len) - return -1; - if (name1_len > name2_len) - return 1; - } - } else { - if (name1_len < name2_len) - return -1; - if (name1_len > name2_len) - return 1; - } - return 0; -} - -/** - * ntfs_ucsncmp - compare two little endian Unicode strings - * @s1: first string - * @s2: second string - * @n: maximum unicode characters to compare - * - * Compare the first @n characters of the Unicode strings @s1 and @s2, - * The strings in little endian format and appropriate le16_to_cpu() - * conversion is performed on non-little endian machines. - * - * The function returns an integer less than, equal to, or greater than zero - * if @s1 (or the first @n Unicode characters thereof) is found, respectively, - * to be less than, to match, or be greater than @s2. - */ -int ntfs_ucsncmp(const ntfschar *s1, const ntfschar *s2, size_t n) -{ - ntfschar c1, c2; - size_t i; - -#ifdef DEBUG - if (!s1 || !s2) { - ntfs_log_debug("ntfs_wcsncmp() received NULL pointer!\n"); - exit(1); - } -#endif - for (i = 0; i < n; ++i) { - c1 = le16_to_cpu(s1[i]); - c2 = le16_to_cpu(s2[i]); - if (c1 < c2) - return -1; - if (c1 > c2) - return 1; - if (!c1) - break; - } - return 0; -} - -/** - * ntfs_ucsncasecmp - compare two little endian Unicode strings, ignoring case - * @s1: first string - * @s2: second string - * @n: maximum unicode characters to compare - * @upcase: upcase table - * @upcase_size: upcase table size in Unicode characters - * - * Compare the first @n characters of the Unicode strings @s1 and @s2, - * ignoring case. The strings in little endian format and appropriate - * le16_to_cpu() conversion is performed on non-little endian machines. - * - * Each character is uppercased using the @upcase table before the comparison. - * - * The function returns an integer less than, equal to, or greater than zero - * if @s1 (or the first @n Unicode characters thereof) is found, respectively, - * to be less than, to match, or be greater than @s2. - */ -int ntfs_ucsncasecmp(const ntfschar *s1, const ntfschar *s2, size_t n, - const ntfschar *upcase, const u32 upcase_size) -{ - u16 c1, c2; - size_t i; - -#ifdef DEBUG - if (!s1 || !s2 || !upcase) { - ntfs_log_debug("ntfs_wcsncasecmp() received NULL pointer!\n"); - exit(1); - } -#endif - for (i = 0; i < n; ++i) { - if ((c1 = le16_to_cpu(s1[i])) < upcase_size) - c1 = le16_to_cpu(upcase[c1]); - if ((c2 = le16_to_cpu(s2[i])) < upcase_size) - c2 = le16_to_cpu(upcase[c2]); - if (c1 < c2) - return -1; - if (c1 > c2) - return 1; - if (!c1) - break; - } - return 0; -} - -/** - * ntfs_ucsnlen - determine the length of a little endian Unicode string - * @s: pointer to Unicode string - * @maxlen: maximum length of string @s - * - * Return the number of Unicode characters in the little endian Unicode - * string @s up to a maximum of maxlen Unicode characters, not including - * the terminating (ntfschar)'\0'. If there is no (ntfschar)'\0' between @s - * and @s + @maxlen, @maxlen is returned. - * - * This function never looks beyond @s + @maxlen. - */ -u32 ntfs_ucsnlen(const ntfschar *s, u32 maxlen) -{ - u32 i; - - for (i = 0; i < maxlen; i++) { - if (!le16_to_cpu(s[i])) - break; - } - return i; -} - -/** - * ntfs_ucsndup - duplicate little endian Unicode string - * @s: pointer to Unicode string - * @maxlen: maximum length of string @s - * - * Return a pointer to a new little endian Unicode string which is a duplicate - * of the string s. Memory for the new string is obtained with ntfs_malloc(3), - * and can be freed with free(3). - * - * A maximum of @maxlen Unicode characters are copied and a terminating - * (ntfschar)'\0' little endian Unicode character is added. - * - * This function never looks beyond @s + @maxlen. - * - * Return a pointer to the new little endian Unicode string on success and NULL - * on failure with errno set to the error code. - */ -ntfschar *ntfs_ucsndup(const ntfschar *s, u32 maxlen) -{ - ntfschar *dst; - u32 len; - - len = ntfs_ucsnlen(s, maxlen); - dst = ntfs_malloc((len + 1) * sizeof(ntfschar)); - if (dst) { - memcpy(dst, s, len * sizeof(ntfschar)); - dst[len] = cpu_to_le16(L'\0'); - } - return dst; -} - -/** - * ntfs_name_upcase - Map an Unicode name to its uppercase equivalent - * @name: - * @name_len: - * @upcase: - * @upcase_len: - * - * Description... - * - * Returns: - */ -void ntfs_name_upcase(ntfschar *name, u32 name_len, const ntfschar *upcase, - const u32 upcase_len) -{ - u32 i; - u16 u; - - for (i = 0; i < name_len; i++) - if ((u = le16_to_cpu(name[i])) < upcase_len) - name[i] = upcase[u]; -} - -/** - * ntfs_name_locase - Map a Unicode name to its lowercase equivalent - */ -void ntfs_name_locase(ntfschar *name, u32 name_len, const ntfschar *locase, - const u32 locase_len) -{ - u32 i; - u16 u; - - if (locase) - for (i = 0; i < name_len; i++) - if ((u = le16_to_cpu(name[i])) < locase_len) - name[i] = locase[u]; -} - -/** - * ntfs_file_value_upcase - Convert a filename to upper case - * @file_name_attr: - * @upcase: - * @upcase_len: - * - * Description... - * - * Returns: - */ -void ntfs_file_value_upcase(FILE_NAME_ATTR *file_name_attr, - const ntfschar *upcase, const u32 upcase_len) -{ - ntfs_name_upcase((ntfschar*)&file_name_attr->file_name, - file_name_attr->file_name_length, upcase, upcase_len); -} - -/* - NTFS uses Unicode (UTF-16LE [NTFS-3G uses UCS-2LE, which is enough - for now]) for path names, but the Unicode code points need to be - converted before a path can be accessed under NTFS. For 7 bit ASCII/ANSI, - glibc does this even without a locale in a hard-coded fashion as that - appears to be is easy because the low 7-bit ASCII range appears to be - available in all charsets but it does not convert anything if - there was some error with the locale setup or none set up like - when mount is called during early boot where he (by policy) do - not use locales (and may be not available if /usr is not yet mounted), - so this patch fixes the resulting issues for systems which use - UTF-8 and for others, specifying the locale in fstab brings them - the encoding which they want. - - If no locale is defined or there was a problem with setting one - up and whenever nl_langinfo(CODESET) returns a sting starting with - "ANSI", use an internal UCS-2LE <-> UTF-8 codeset converter to fix - the bug where NTFS-3G does not show any path names which include - international characters!!! (and also fails on creating them) as result. - - Author: Bernhard Kaindl - Jean-Pierre Andre made it compliant with RFC3629/RFC2781. -*/ - -/* - * Return the amount of 8-bit elements in UTF-8 needed (without the terminating - * null) to store a given UTF-16LE string. - * - * Return -1 with errno set if string has invalid byte sequence or too long. - */ -static int utf16_to_utf8_size(const ntfschar *ins, const int ins_len, int outs_len) -{ - int i, ret = -1; - int count = 0; - BOOL surrog; - - surrog = FALSE; - for (i = 0; i < ins_len && ins[i]; i++) { - unsigned short c = le16_to_cpu(ins[i]); - if (surrog) { - if ((c >= 0xdc00) && (c < 0xe000)) { - surrog = FALSE; - count += 4; - } else - goto fail; - } else - if (c < 0x80) - count++; - else if (c < 0x800) - count += 2; - else if (c < 0xd800) - count += 3; - else if (c < 0xdc00) - surrog = TRUE; -#if NOREVBOM - else if ((c >= 0xe000) && (c < 0xfffe)) -#else - else if (c >= 0xe000) -#endif - count += 3; - else - goto fail; - if (count > outs_len) { - errno = ENAMETOOLONG; - goto out; - } - } - if (surrog) - goto fail; - - ret = count; -out: - return ret; -fail: - errno = EILSEQ; - goto out; -} - -/* - * ntfs_utf16_to_utf8 - convert a little endian UTF16LE string to an UTF-8 string - * @ins: input utf16 string buffer - * @ins_len: length of input string in utf16 characters - * @outs: on return contains the (allocated) output multibyte string - * @outs_len: length of output buffer in bytes - * - * Return -1 with errno set if string has invalid byte sequence or too long. - */ -static int ntfs_utf16_to_utf8(const ntfschar *ins, const int ins_len, - char **outs, int outs_len) -{ -#if defined(__APPLE__) || defined(__DARWIN__) -#ifdef ENABLE_NFCONV - char *original_outs_value = *outs; - int original_outs_len = outs_len; -#endif /* ENABLE_NFCONV */ -#endif /* defined(__APPLE__) || defined(__DARWIN__) */ - - char *t; - int i, size, ret = -1; - int halfpair; - - halfpair = 0; - if (!*outs) - outs_len = PATH_MAX; - - size = utf16_to_utf8_size(ins, ins_len, outs_len); - - if (size < 0) - goto out; - - if (!*outs) { - outs_len = size + 1; - *outs = ntfs_malloc(outs_len); - if (!*outs) - goto out; - } - - t = *outs; - - for (i = 0; i < ins_len && ins[i]; i++) { - unsigned short c = le16_to_cpu(ins[i]); - /* size not double-checked */ - if (halfpair) { - if ((c >= 0xdc00) && (c < 0xe000)) { - *t++ = 0xf0 + (((halfpair + 64) >> 8) & 7); - *t++ = 0x80 + (((halfpair + 64) >> 2) & 63); - *t++ = 0x80 + ((c >> 6) & 15) + ((halfpair & 3) << 4); - *t++ = 0x80 + (c & 63); - halfpair = 0; - } else - goto fail; - } else if (c < 0x80) { - *t++ = c; - } else { - if (c < 0x800) { - *t++ = (0xc0 | ((c >> 6) & 0x3f)); - *t++ = 0x80 | (c & 0x3f); - } else if (c < 0xd800) { - *t++ = 0xe0 | (c >> 12); - *t++ = 0x80 | ((c >> 6) & 0x3f); - *t++ = 0x80 | (c & 0x3f); - } else if (c < 0xdc00) - halfpair = c; - else if (c >= 0xe000) { - *t++ = 0xe0 | (c >> 12); - *t++ = 0x80 | ((c >> 6) & 0x3f); - *t++ = 0x80 | (c & 0x3f); - } else - goto fail; - } - } - *t = '\0'; - -#if defined(__APPLE__) || defined(__DARWIN__) -#ifdef ENABLE_NFCONV - if(nfconvert_utf8 && (t - *outs) > 0) { - char *new_outs = NULL; - int new_outs_len = ntfs_macosx_normalize_utf8(*outs, &new_outs, 0); // Normalize to decomposed form - if(new_outs_len >= 0 && new_outs != NULL) { - if(original_outs_value != *outs) { - // We have allocated outs ourselves. - free(*outs); - *outs = new_outs; - t = *outs + new_outs_len; - } - else { - // We need to copy new_outs into the fixed outs buffer. - memset(*outs, 0, original_outs_len); - strncpy(*outs, new_outs, original_outs_len-1); - t = *outs + original_outs_len; - free(new_outs); - } - } - else { - ntfs_log_error("Failed to normalize NTFS string to UTF-8 NFD: %s\n", *outs); - ntfs_log_error(" new_outs=0x%p\n", new_outs); - ntfs_log_error(" new_outs_len=%d\n", new_outs_len); - } - } -#endif /* ENABLE_NFCONV */ -#endif /* defined(__APPLE__) || defined(__DARWIN__) */ - - ret = t - *outs; -out: - return ret; -fail: - errno = EILSEQ; - goto out; -} - -/* - * Return the amount of 16-bit elements in UTF-16LE needed - * (without the terminating null) to store given UTF-8 string. - * - * Return -1 with errno set if it's longer than PATH_MAX or string is invalid. - * - * Note: This does not check whether the input sequence is a valid utf8 string, - * and should be used only in context where such check is made! - */ -static int utf8_to_utf16_size(const char *s) -{ - int ret = -1; - unsigned int byte; - size_t count = 0; - - while ((byte = *((const unsigned char *)s++))) { - if (++count >= PATH_MAX) - goto fail; - if (byte >= 0xc0) { - if (byte >= 0xF5) { - errno = EILSEQ; - goto out; - } - if (!*s) - break; - if (byte >= 0xC0) - s++; - if (!*s) - break; - if (byte >= 0xE0) - s++; - if (!*s) - break; - if (byte >= 0xF0) { - s++; - if (++count >= PATH_MAX) - goto fail; - } - } - } - ret = count; -out: - return ret; -fail: - errno = ENAMETOOLONG; - goto out; -} -/* - * This converts one UTF-8 sequence to cpu-endian Unicode value - * within range U+0 .. U+10ffff and excluding U+D800 .. U+DFFF - * - * Return the number of used utf8 bytes or -1 with errno set - * if sequence is invalid. - */ -static int utf8_to_unicode(u32 *wc, const char *s) -{ - unsigned int byte = *((const unsigned char *)s); - - /* single byte */ - if (byte == 0) { - *wc = (u32) 0; - return 0; - } else if (byte < 0x80) { - *wc = (u32) byte; - return 1; - /* double byte */ - } else if (byte < 0xc2) { - goto fail; - } else if (byte < 0xE0) { - if ((s[1] & 0xC0) == 0x80) { - *wc = ((u32)(byte & 0x1F) << 6) - | ((u32)(s[1] & 0x3F)); - return 2; - } else - goto fail; - /* three-byte */ - } else if (byte < 0xF0) { - if (((s[1] & 0xC0) == 0x80) && ((s[2] & 0xC0) == 0x80)) { - *wc = ((u32)(byte & 0x0F) << 12) - | ((u32)(s[1] & 0x3F) << 6) - | ((u32)(s[2] & 0x3F)); - /* Check valid ranges */ -#if NOREVBOM - if (((*wc >= 0x800) && (*wc <= 0xD7FF)) - || ((*wc >= 0xe000) && (*wc <= 0xFFFD))) - return 3; -#else - if (((*wc >= 0x800) && (*wc <= 0xD7FF)) - || ((*wc >= 0xe000) && (*wc <= 0xFFFF))) - return 3; -#endif - } - goto fail; - /* four-byte */ - } else if (byte < 0xF5) { - if (((s[1] & 0xC0) == 0x80) && ((s[2] & 0xC0) == 0x80) - && ((s[3] & 0xC0) == 0x80)) { - *wc = ((u32)(byte & 0x07) << 18) - | ((u32)(s[1] & 0x3F) << 12) - | ((u32)(s[2] & 0x3F) << 6) - | ((u32)(s[3] & 0x3F)); - /* Check valid ranges */ - if ((*wc <= 0x10ffff) && (*wc >= 0x10000)) - return 4; - } - goto fail; - } -fail: - errno = EILSEQ; - return -1; -} - -/** - * ntfs_utf8_to_utf16 - convert a UTF-8 string to a UTF-16LE string - * @ins: input multibyte string buffer - * @outs: on return contains the (allocated) output utf16 string - * @outs_len: length of output buffer in utf16 characters - * - * Return -1 with errno set. - */ -static int ntfs_utf8_to_utf16(const char *ins, ntfschar **outs) -{ -#if defined(__APPLE__) || defined(__DARWIN__) -#ifdef ENABLE_NFCONV - char *new_ins = NULL; - if(nfconvert_utf8) { - int new_ins_len; - new_ins_len = ntfs_macosx_normalize_utf8(ins, &new_ins, 1); // Normalize to composed form - if(new_ins_len >= 0) - ins = new_ins; - else - ntfs_log_error("Failed to normalize NTFS string to UTF-8 NFC: %s\n", ins); - } -#endif /* ENABLE_NFCONV */ -#endif /* defined(__APPLE__) || defined(__DARWIN__) */ - const char *t = ins; - u32 wc; - BOOL allocated; - ntfschar *outpos; - int shorts, ret = -1; - - shorts = utf8_to_utf16_size(ins); - if (shorts < 0) - goto fail; - - allocated = FALSE; - if (!*outs) { - *outs = ntfs_malloc((shorts + 1) * sizeof(ntfschar)); - if (!*outs) - goto fail; - allocated = TRUE; - } - - outpos = *outs; - - while(1) { - int m = utf8_to_unicode(&wc, t); - if (m <= 0) { - if (m < 0) { - /* do not leave space allocated if failed */ - if (allocated) { - free(*outs); - *outs = (ntfschar*)NULL; - } - goto fail; - } - *outpos++ = const_cpu_to_le16(0); - break; - } - if (wc < 0x10000) - *outpos++ = cpu_to_le16(wc); - else { - wc -= 0x10000; - *outpos++ = cpu_to_le16((wc >> 10) + 0xd800); - *outpos++ = cpu_to_le16((wc & 0x3ff) + 0xdc00); - } - t += m; - } - - ret = --outpos - *outs; -fail: -#if defined(__APPLE__) || defined(__DARWIN__) -#ifdef ENABLE_NFCONV - if(new_ins != NULL) - free(new_ins); -#endif /* ENABLE_NFCONV */ -#endif /* defined(__APPLE__) || defined(__DARWIN__) */ - return ret; -} - -/** - * ntfs_ucstombs - convert a little endian Unicode string to a multibyte string - * @ins: input Unicode string buffer - * @ins_len: length of input string in Unicode characters - * @outs: on return contains the (allocated) output multibyte string - * @outs_len: length of output buffer in bytes - * - * Convert the input little endian, 2-byte Unicode string @ins, of length - * @ins_len into the multibyte string format dictated by the current locale. - * - * If *@outs is NULL, the function allocates the string and the caller is - * responsible for calling free(*@outs); when finished with it. - * - * On success the function returns the number of bytes written to the output - * string *@outs (>= 0), not counting the terminating NULL byte. If the output - * string buffer was allocated, *@outs is set to it. - * - * On error, -1 is returned, and errno is set to the error code. The following - * error codes can be expected: - * EINVAL Invalid arguments (e.g. @ins or @outs is NULL). - * EILSEQ The input string cannot be represented as a multibyte - * sequence according to the current locale. - * ENAMETOOLONG Destination buffer is too small for input string. - * ENOMEM Not enough memory to allocate destination buffer. - */ -int ntfs_ucstombs(const ntfschar *ins, const int ins_len, char **outs, - int outs_len) -{ - char *mbs; - int mbs_len; -#ifdef MB_CUR_MAX - wchar_t wc; - int i, o; - int cnt = 0; -#ifdef HAVE_MBSINIT - mbstate_t mbstate; -#endif -#endif /* MB_CUR_MAX */ - - if (!ins || !outs) { - errno = EINVAL; - return -1; - } - mbs = *outs; - mbs_len = outs_len; - if (mbs && !mbs_len) { - errno = ENAMETOOLONG; - return -1; - } - if (use_utf8) - return ntfs_utf16_to_utf8(ins, ins_len, outs, outs_len); -#ifdef MB_CUR_MAX - if (!mbs) { - mbs_len = (ins_len + 1) * MB_CUR_MAX; - mbs = ntfs_malloc(mbs_len); - if (!mbs) - return -1; - } -#ifdef HAVE_MBSINIT - memset(&mbstate, 0, sizeof(mbstate)); -#else - wctomb(NULL, 0); -#endif - for (i = o = 0; i < ins_len; i++) { - /* Reallocate memory if necessary or abort. */ - if ((int)(o + MB_CUR_MAX) > mbs_len) { - char *tc; - if (mbs == *outs) { - errno = ENAMETOOLONG; - return -1; - } - tc = ntfs_malloc((mbs_len + 64) & ~63); - if (!tc) - goto err_out; - memcpy(tc, mbs, mbs_len); - mbs_len = (mbs_len + 64) & ~63; - free(mbs); - mbs = tc; - } - /* Convert the LE Unicode character to a CPU wide character. */ - wc = (wchar_t)le16_to_cpu(ins[i]); - if (!wc) - break; - /* Convert the CPU endian wide character to multibyte. */ -#ifdef HAVE_MBSINIT - cnt = wcrtomb(mbs + o, wc, &mbstate); -#else - cnt = wctomb(mbs + o, wc); -#endif - if (cnt == -1) - goto err_out; - if (cnt <= 0) { - ntfs_log_debug("Eeek. cnt <= 0, cnt = %i\n", cnt); - errno = EINVAL; - goto err_out; - } - o += cnt; - } -#ifdef HAVE_MBSINIT - /* Make sure we are back in the initial state. */ - if (!mbsinit(&mbstate)) { - ntfs_log_debug("Eeek. mbstate not in initial state!\n"); - errno = EILSEQ; - goto err_out; - } -#endif - /* Now write the NULL character. */ - mbs[o] = '\0'; - if (*outs != mbs) - *outs = mbs; - return o; -err_out: - if (mbs != *outs) { - int eo = errno; - free(mbs); - errno = eo; - } -#else /* MB_CUR_MAX */ - errno = EILSEQ; -#endif /* MB_CUR_MAX */ - return -1; -} - -/** - * ntfs_mbstoucs - convert a multibyte string to a little endian Unicode string - * @ins: input multibyte string buffer - * @outs: on return contains the (allocated) output Unicode string - * - * Convert the input multibyte string @ins, from the current locale into the - * corresponding little endian, 2-byte Unicode string. - * - * The function allocates the string and the caller is responsible for calling - * free(*@outs); when finished with it. - * - * On success the function returns the number of Unicode characters written to - * the output string *@outs (>= 0), not counting the terminating Unicode NULL - * character. - * - * On error, -1 is returned, and errno is set to the error code. The following - * error codes can be expected: - * EINVAL Invalid arguments (e.g. @ins or @outs is NULL). - * EILSEQ The input string cannot be represented as a Unicode - * string according to the current locale. - * ENAMETOOLONG Destination buffer is too small for input string. - * ENOMEM Not enough memory to allocate destination buffer. - */ -int ntfs_mbstoucs(const char *ins, ntfschar **outs) -{ -#ifdef MB_CUR_MAX - ntfschar *ucs; - const char *s; - wchar_t wc; - int i, o, cnt, ins_len, ucs_len, ins_size; -#ifdef HAVE_MBSINIT - mbstate_t mbstate; -#endif -#endif /* MB_CUR_MAX */ - - if (!ins || !outs) { - errno = EINVAL; - return -1; - } - - if (use_utf8) - return ntfs_utf8_to_utf16(ins, outs); - -#ifdef MB_CUR_MAX - /* Determine the size of the multi-byte string in bytes. */ - ins_size = strlen(ins); - /* Determine the length of the multi-byte string. */ - s = ins; -#if defined(HAVE_MBSINIT) - memset(&mbstate, 0, sizeof(mbstate)); - ins_len = mbsrtowcs(NULL, (const char **)&s, 0, &mbstate); -#ifdef __CYGWIN32__ - if (!ins_len && *ins) { - /* Older Cygwin had broken mbsrtowcs() implementation. */ - ins_len = strlen(ins); - } -#endif -#elif !defined(DJGPP) - ins_len = mbstowcs(NULL, s, 0); -#else - /* Eeek!!! DJGPP has broken mbstowcs() implementation!!! */ - ins_len = strlen(ins); -#endif - if (ins_len == -1) - return ins_len; -#ifdef HAVE_MBSINIT - if ((s != ins) || !mbsinit(&mbstate)) { -#else - if (s != ins) { -#endif - errno = EILSEQ; - return -1; - } - /* Add the NULL terminator. */ - ins_len++; - ucs_len = ins_len; - ucs = ntfs_malloc(ucs_len * sizeof(ntfschar)); - if (!ucs) - return -1; -#ifdef HAVE_MBSINIT - memset(&mbstate, 0, sizeof(mbstate)); -#else - mbtowc(NULL, NULL, 0); -#endif - for (i = o = cnt = 0; i < ins_size; i += cnt, o++) { - /* Reallocate memory if necessary. */ - if (o >= ucs_len) { - ntfschar *tc; - ucs_len = (ucs_len * sizeof(ntfschar) + 64) & ~63; - tc = realloc(ucs, ucs_len); - if (!tc) - goto err_out; - ucs = tc; - ucs_len /= sizeof(ntfschar); - } - /* Convert the multibyte character to a wide character. */ -#ifdef HAVE_MBSINIT - cnt = mbrtowc(&wc, ins + i, ins_size - i, &mbstate); -#else - cnt = mbtowc(&wc, ins + i, ins_size - i); -#endif - if (!cnt) - break; - if (cnt == -1) - goto err_out; - if (cnt < -1) { - ntfs_log_trace("Eeek. cnt = %i\n", cnt); - errno = EINVAL; - goto err_out; - } - /* Make sure we are not overflowing the NTFS Unicode set. */ - if ((unsigned long)wc >= (unsigned long)(1 << - (8 * sizeof(ntfschar)))) { - errno = EILSEQ; - goto err_out; - } - /* Convert the CPU wide character to a LE Unicode character. */ - ucs[o] = cpu_to_le16(wc); - } -#ifdef HAVE_MBSINIT - /* Make sure we are back in the initial state. */ - if (!mbsinit(&mbstate)) { - ntfs_log_trace("Eeek. mbstate not in initial state!\n"); - errno = EILSEQ; - goto err_out; - } -#endif - /* Now write the NULL character. */ - ucs[o] = cpu_to_le16(L'\0'); - *outs = ucs; - return o; -err_out: - free(ucs); -#else /* MB_CUR_MAX */ - errno = EILSEQ; -#endif /* MB_CUR_MAX */ - return -1; -} - -/* - * Turn a UTF8 name uppercase - * - * Returns an allocated uppercase name which has to be freed by caller - * or NULL if there is an error (described by errno) - */ - -char *ntfs_uppercase_mbs(const char *low, - const ntfschar *upcase, u32 upcase_size) -{ - int size; - char *upp; - u32 wc; - int n; - const char *s; - char *t; - - size = strlen(low); - upp = (char*)ntfs_malloc(3*size + 1); - if (upp) { - s = low; - t = upp; - do { - n = utf8_to_unicode(&wc, s); - if (n > 0) { - if (wc < upcase_size) - wc = le16_to_cpu(upcase[wc]); - if (wc < 0x80) - *t++ = wc; - else if (wc < 0x800) { - *t++ = (0xc0 | ((wc >> 6) & 0x3f)); - *t++ = 0x80 | (wc & 0x3f); - } else if (wc < 0x10000) { - *t++ = 0xe0 | (wc >> 12); - *t++ = 0x80 | ((wc >> 6) & 0x3f); - *t++ = 0x80 | (wc & 0x3f); - } else { - *t++ = 0xf0 | ((wc >> 18) & 7); - *t++ = 0x80 | ((wc >> 12) & 63); - *t++ = 0x80 | ((wc >> 6) & 0x3f); - *t++ = 0x80 | (wc & 0x3f); - } - s += n; - } - } while (n > 0); - if (n < 0) { - free(upp); - upp = (char*)NULL; - errno = EILSEQ; - } - *t = 0; - } - return (upp); -} - -/** - * ntfs_upcase_table_build - build the default upcase table for NTFS - * @uc: destination buffer where to store the built table - * @uc_len: size of destination buffer in bytes - * - * ntfs_upcase_table_build() builds the default upcase table for NTFS and - * stores it in the caller supplied buffer @uc of size @uc_len. - * - * Note, @uc_len must be at least 128kiB in size or bad things will happen! - */ -void ntfs_upcase_table_build(ntfschar *uc, u32 uc_len) -{ - static int uc_run_table[][3] = { /* Start, End, Add */ - {0x0061, 0x007B, -32}, {0x0451, 0x045D, -80}, {0x1F70, 0x1F72, 74}, - {0x00E0, 0x00F7, -32}, {0x045E, 0x0460, -80}, {0x1F72, 0x1F76, 86}, - {0x00F8, 0x00FF, -32}, {0x0561, 0x0587, -48}, {0x1F76, 0x1F78, 100}, - {0x0256, 0x0258, -205}, {0x1F00, 0x1F08, 8}, {0x1F78, 0x1F7A, 128}, - {0x028A, 0x028C, -217}, {0x1F10, 0x1F16, 8}, {0x1F7A, 0x1F7C, 112}, - {0x03AC, 0x03AD, -38}, {0x1F20, 0x1F28, 8}, {0x1F7C, 0x1F7E, 126}, - {0x03AD, 0x03B0, -37}, {0x1F30, 0x1F38, 8}, {0x1FB0, 0x1FB2, 8}, - {0x03B1, 0x03C2, -32}, {0x1F40, 0x1F46, 8}, {0x1FD0, 0x1FD2, 8}, - {0x03C2, 0x03C3, -31}, {0x1F51, 0x1F52, 8}, {0x1FE0, 0x1FE2, 8}, - {0x03C3, 0x03CC, -32}, {0x1F53, 0x1F54, 8}, {0x1FE5, 0x1FE6, 7}, - {0x03CC, 0x03CD, -64}, {0x1F55, 0x1F56, 8}, {0x2170, 0x2180, -16}, - {0x03CD, 0x03CF, -63}, {0x1F57, 0x1F58, 8}, {0x24D0, 0x24EA, -26}, - {0x0430, 0x0450, -32}, {0x1F60, 0x1F68, 8}, {0xFF41, 0xFF5B, -32}, - {0} - }; - static int uc_dup_table[][2] = { /* Start, End */ - {0x0100, 0x012F}, {0x01A0, 0x01A6}, {0x03E2, 0x03EF}, {0x04CB, 0x04CC}, - {0x0132, 0x0137}, {0x01B3, 0x01B7}, {0x0460, 0x0481}, {0x04D0, 0x04EB}, - {0x0139, 0x0149}, {0x01CD, 0x01DD}, {0x0490, 0x04BF}, {0x04EE, 0x04F5}, - {0x014A, 0x0178}, {0x01DE, 0x01EF}, {0x04BF, 0x04BF}, {0x04F8, 0x04F9}, - {0x0179, 0x017E}, {0x01F4, 0x01F5}, {0x04C1, 0x04C4}, {0x1E00, 0x1E95}, - {0x018B, 0x018B}, {0x01FA, 0x0218}, {0x04C7, 0x04C8}, {0x1EA0, 0x1EF9}, - {0} - }; - static int uc_byte_table[][2] = { /* Offset, Value */ - {0x00FF, 0x0178}, {0x01AD, 0x01AC}, {0x01F3, 0x01F1}, {0x0269, 0x0196}, - {0x0183, 0x0182}, {0x01B0, 0x01AF}, {0x0253, 0x0181}, {0x026F, 0x019C}, - {0x0185, 0x0184}, {0x01B9, 0x01B8}, {0x0254, 0x0186}, {0x0272, 0x019D}, - {0x0188, 0x0187}, {0x01BD, 0x01BC}, {0x0259, 0x018F}, {0x0275, 0x019F}, - {0x018C, 0x018B}, {0x01C6, 0x01C4}, {0x025B, 0x0190}, {0x0283, 0x01A9}, - {0x0192, 0x0191}, {0x01C9, 0x01C7}, {0x0260, 0x0193}, {0x0288, 0x01AE}, - {0x0199, 0x0198}, {0x01CC, 0x01CA}, {0x0263, 0x0194}, {0x0292, 0x01B7}, - {0x01A8, 0x01A7}, {0x01DD, 0x018E}, {0x0268, 0x0197}, - {0} - }; - int i, r; - int k, off; - - memset((char*)uc, 0, uc_len); - uc_len >>= 1; - if (uc_len > 65536) - uc_len = 65536; - for (i = 0; (u32)i < uc_len; i++) - uc[i] = cpu_to_le16(i); - for (r = 0; uc_run_table[r][0]; r++) { - off = uc_run_table[r][2]; - for (i = uc_run_table[r][0]; i < uc_run_table[r][1]; i++) - uc[i] = cpu_to_le16(i + off); - } - for (r = 0; uc_dup_table[r][0]; r++) - for (i = uc_dup_table[r][0]; i < uc_dup_table[r][1]; i += 2) - uc[i + 1] = cpu_to_le16(i); - for (r = 0; uc_byte_table[r][0]; r++) { - k = uc_byte_table[r][1]; - uc[uc_byte_table[r][0]] = cpu_to_le16(k); - } -} - -/* - * Build a table for converting to lower case - * - * This is only meaningful when there is a single lower case - * character leading to an upper case one, and currently the - * only exception is the greek letter sigma which has a single - * upper case glyph (code U+03A3), but two lower case glyphs - * (code U+03C3 and U+03C2, the latter to be used at the end - * of a word). In the following implementation the upper case - * sigma will be lowercased as U+03C3. - */ - -ntfschar *ntfs_locase_table_build(const ntfschar *uc, u32 uc_cnt) -{ - ntfschar *lc; - u32 upp; - u32 i; - - lc = (ntfschar*)ntfs_malloc(uc_cnt*sizeof(ntfschar)); - if (lc) { - for (i=0; i NTFS_MAX_NAME_LEN) { - free(ucs); - errno = ENAMETOOLONG; - return NULL; - } - if (!ucs || !*len) { - ucs = AT_UNNAMED; - *len = 0; - } - return ucs; -} - -/** - * ntfs_ucsfree - free memory allocated by ntfs_str2ucs() - * @ucs input string to be freed - * - * Free memory at @ucs and which was allocated by ntfs_str2ucs. - * - * Return value: none. - */ -void ntfs_ucsfree(ntfschar *ucs) -{ - if (ucs && (ucs != AT_UNNAMED)) - free(ucs); -} - -/* - * Check whether a name contains no chars forbidden - * for DOS or Win32 use - * - * If there is a bad char, errno is set to EINVAL - */ - -BOOL ntfs_forbidden_chars(const ntfschar *name, int len) -{ - BOOL forbidden; - int ch; - int i; - u32 mainset = (1L << ('\"' - 0x20)) - | (1L << ('*' - 0x20)) - | (1L << ('/' - 0x20)) - | (1L << (':' - 0x20)) - | (1L << ('<' - 0x20)) - | (1L << ('>' - 0x20)) - | (1L << ('?' - 0x20)); - - forbidden = (len == 0) - || (le16_to_cpu(name[len-1]) == ' ') - || (le16_to_cpu(name[len-1]) == '.'); - for (i=0; i= vol->upcase_len) - || ((shortname[i] != longname[i]) - && (shortname[i] != vol->upcase[ch]))) - collapsible = FALSE; - } - return (collapsible); -} - -/* - * Define the character encoding to be used. - * Use UTF-8 unless specified otherwise. - */ - -int ntfs_set_char_encoding(const char *locale) -{ - use_utf8 = 0; - if (!locale || strstr(locale,"utf8") || strstr(locale,"UTF8") - || strstr(locale,"utf-8") || strstr(locale,"UTF-8")) - use_utf8 = 1; - else - if (setlocale(LC_ALL, locale)) - use_utf8 = 0; - else { - ntfs_log_error("Invalid locale, encoding to UTF-8\n"); - use_utf8 = 1; - } - return 0; /* always successful */ -} - -#if defined(__APPLE__) || defined(__DARWIN__) - -int ntfs_macosx_normalize_filenames(int normalize) { -#ifdef ENABLE_NFCONV - if(normalize == 0 || normalize == 1) { - nfconvert_utf8 = normalize; - return 0; - } - else - return -1; -#else - return -1; -#endif /* ENABLE_NFCONV */ -} - -int ntfs_macosx_normalize_utf8(const char *utf8_string, char **target, - int composed) { -#ifdef ENABLE_NFCONV - /* For this code to compile, the CoreFoundation framework must be fed to the linker. */ - CFStringRef cfSourceString; - CFMutableStringRef cfMutableString; - CFRange rangeToProcess; - CFIndex requiredBufferLength; - char *result = NULL; - int resultLength = -1; - - /* Convert the UTF-8 string to a CFString. */ - cfSourceString = CFStringCreateWithCString(kCFAllocatorDefault, utf8_string, kCFStringEncodingUTF8); - if(cfSourceString == NULL) { - ntfs_log_error("CFStringCreateWithCString failed!\n"); - return -2; - } - - /* Create a mutable string from cfSourceString that we are free to modify. */ - cfMutableString = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, cfSourceString); - CFRelease(cfSourceString); /* End-of-life. */ - if(cfMutableString == NULL) { - ntfs_log_error("CFStringCreateMutableCopy failed!\n"); - return -3; - } - - /* Normalize the mutable string to the desired normalization form. */ - CFStringNormalize(cfMutableString, (composed != 0 ? kCFStringNormalizationFormC : kCFStringNormalizationFormD)); - - /* Store the resulting string in a '\0'-terminated UTF-8 encoded char* buffer. */ - rangeToProcess = CFRangeMake(0, CFStringGetLength(cfMutableString)); - if(CFStringGetBytes(cfMutableString, rangeToProcess, kCFStringEncodingUTF8, 0, false, NULL, 0, &requiredBufferLength) > 0) { - resultLength = sizeof(char)*(requiredBufferLength + 1); - result = ntfs_calloc(resultLength); - - if(result != NULL) { - if(CFStringGetBytes(cfMutableString, rangeToProcess, kCFStringEncodingUTF8, - 0, false, (UInt8*)result, resultLength-1, &requiredBufferLength) <= 0) { - ntfs_log_error("Could not perform UTF-8 conversion of normalized CFMutableString.\n"); - free(result); - result = NULL; - } - } - else - ntfs_log_error("Could not perform a ntfs_calloc of %d bytes for char *result.\n", resultLength); - } - else - ntfs_log_error("Could not perform check for required length of UTF-8 conversion of normalized CFMutableString.\n"); - - - CFRelease(cfMutableString); - - if(result != NULL) { - *target = result; - return resultLength - 1; - } - else - return -1; -#else - return -1; -#endif /* ENABLE_NFCONV */ -} -#endif /* defined(__APPLE__) || defined(__DARWIN__) */ diff --git a/source/libs/libntfs/unistr.h b/source/libs/libntfs/unistr.h deleted file mode 100644 index 639c5033..00000000 --- a/source/libs/libntfs/unistr.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * unistr.h - Exports for Unicode string handling. Originated from the Linux-NTFS - * project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_UNISTR_H -#define _NTFS_UNISTR_H - -#include "types.h" -#include "layout.h" - -extern BOOL ntfs_names_are_equal(const ntfschar *s1, size_t s1_len, - const ntfschar *s2, size_t s2_len, const IGNORE_CASE_BOOL ic, - const ntfschar *upcase, const u32 upcase_size); - -extern int ntfs_names_full_collate(const ntfschar *name1, const u32 name1_len, - const ntfschar *name2, const u32 name2_len, - const IGNORE_CASE_BOOL ic, - const ntfschar *upcase, const u32 upcase_len); - -extern int ntfs_ucsncmp(const ntfschar *s1, const ntfschar *s2, size_t n); - -extern int ntfs_ucsncasecmp(const ntfschar *s1, const ntfschar *s2, size_t n, - const ntfschar *upcase, const u32 upcase_size); - -extern u32 ntfs_ucsnlen(const ntfschar *s, u32 maxlen); - -extern ntfschar *ntfs_ucsndup(const ntfschar *s, u32 maxlen); - -extern void ntfs_name_upcase(ntfschar *name, u32 name_len, - const ntfschar *upcase, const u32 upcase_len); - -extern void ntfs_name_locase(ntfschar *name, u32 name_len, - const ntfschar *locase, const u32 locase_len); - -extern void ntfs_file_value_upcase(FILE_NAME_ATTR *file_name_attr, - const ntfschar *upcase, const u32 upcase_len); - -extern int ntfs_ucstombs(const ntfschar *ins, const int ins_len, char **outs, - int outs_len); -extern int ntfs_mbstoucs(const char *ins, ntfschar **outs); - -extern char *ntfs_uppercase_mbs(const char *low, - const ntfschar *upcase, u32 upcase_len); - -extern void ntfs_upcase_table_build(ntfschar *uc, u32 uc_len); -extern ntfschar *ntfs_locase_table_build(const ntfschar *uc, u32 uc_cnt); - -extern ntfschar *ntfs_str2ucs(const char *s, int *len); - -extern void ntfs_ucsfree(ntfschar *ucs); - -extern BOOL ntfs_forbidden_chars(const ntfschar *name, int len); -extern BOOL ntfs_collapsible_chars(ntfs_volume *vol, - const ntfschar *shortname, int shortlen, - const ntfschar *longname, int longlen); - -extern int ntfs_set_char_encoding(const char *locale); - -#if defined(__APPLE__) || defined(__DARWIN__) -/** - * Mac OS X only. - * - * Sets file name Unicode normalization form conversion on or off. - * normalize=0 : Off - * normalize=1 : On - * If set to on, all filenames returned by ntfs-3g will be converted to the NFD - * normalization form, while all filenames recieved by ntfs-3g will be converted to the NFC - * normalization form. Since Windows and most other OS:es use the NFC form while Mac OS X - * mostly uses NFD, this conversion increases compatibility between Mac applications and - * NTFS-3G. - * - * @param normalize decides whether or not the string functions will do automatic filename - * normalization when converting to and from UTF-8. 0 means normalization is disabled, - * 1 means it is enabled. - * @return -1 if the argument was invalid or an error occurred, 0 if all went well. - */ -extern int ntfs_macosx_normalize_filenames(int normalize); - -/** - * Mac OS X only. - * - * Normalizes the input string "utf8_string" to one of the normalization forms NFD or NFC. - * The parameter "composed" decides whether output should be in composed, NFC, form - * (composed == 1) or decomposed, NFD, form (composed == 0). - * Input is assumed to be properly UTF-8 encoded and null-terminated. Output will be a newly - * ntfs_calloc'ed string encoded in UTF-8. It is the callers responsibility to free(...) the - * allocated string when it's no longer needed. - * - * @param utf8_string the input string, which may be in any normalization form. - * @param target a pointer where the resulting string will be stored. - * @param composed decides which composition form to normalize the input string to. 0 means - * composed form (NFC), 1 means decomposed form (NFD). - * @return -1 if the normalization failed for some reason, otherwise the length of the - * normalized string stored in target. - */ -extern int ntfs_macosx_normalize_utf8(const char *utf8_string, char **target, int composed); -#endif /* defined(__APPLE__) || defined(__DARWIN__) */ - -#endif /* defined _NTFS_UNISTR_H */ - diff --git a/source/libs/libntfs/volume.c b/source/libs/libntfs/volume.c deleted file mode 100644 index 629ec92c..00000000 --- a/source/libs/libntfs/volume.c +++ /dev/null @@ -1,1723 +0,0 @@ -/** - * volume.c - NTFS volume handling code. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2006 Anton Altaparmakov - * Copyright (c) 2002-2009 Szabolcs Szakacsits - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2010 Jean-Pierre Andre - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif -#ifdef HAVE_LOCALE_H -#include -#endif - -#include "compat.h" -#include "volume.h" -#include "attrib.h" -#include "mft.h" -#include "bootsect.h" -#include "device.h" -#include "debug.h" -#include "inode.h" -#include "runlist.h" -#include "logfile.h" -#include "dir.h" -#include "logging.h" -#include "cache.h" -#include "misc.h" - -const char *ntfs_home = -"Ntfs-3g news, support and information: http://ntfs-3g.org\n"; - -static const char *invalid_ntfs_msg = -"The device '%s' doesn't seem to have a valid NTFS.\n" -"Maybe the wrong device is used? Or the whole disk instead of a\n" -"partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?\n"; - -static const char *corrupt_volume_msg = -"NTFS is either inconsistent, or there is a hardware fault, or it's a\n" -"SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows\n" -"then reboot into Windows twice. The usage of the /f parameter is very\n" -"important! If the device is a SoftRAID/FakeRAID then first activate\n" -"it and mount a different device under the /dev/mapper/ directory, (e.g.\n" -"/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation\n" -"for more details.\n"; - -static const char *hibernated_volume_msg = -"The NTFS partition is hibernated. Please resume and shutdown Windows\n" -"properly, or mount the volume read-only with the 'ro' mount option, or\n" -"mount the volume read-write with the 'remove_hiberfile' mount option.\n" -"For example type on the command line:\n" -"\n" -" mount -t ntfs-3g -o remove_hiberfile %s %s\n" -"\n"; - -static const char *unclean_journal_msg = -"Write access is denied because the disk wasn't safely powered\n" -"off and the 'norecover' mount option was specified.\n"; - -static const char *opened_volume_msg = -"Mount is denied because the NTFS volume is already exclusively opened.\n" -"The volume may be already mounted, or another software may use it which\n" -"could be identified for example by the help of the 'fuser' command.\n"; - -static const char *fakeraid_msg = -"Either the device is missing or it's powered down, or you have\n" -"SoftRAID hardware and must use an activated, different device under\n" -"/dev/mapper/, (e.g. /dev/mapper/nvidia_eahaabcc1) to mount NTFS.\n" -"Please see the 'dmraid' documentation for help.\n"; - -static const char *access_denied_msg = -"Please check '%s' and the ntfs-3g binary permissions,\n" -"and the mounting user ID. More explanation is provided at\n" -"http://ntfs-3g.org/support.html#unprivileged\n"; - -/** - * ntfs_volume_alloc - Create an NTFS volume object and initialise it - * - * Description... - * - * Returns: - */ -ntfs_volume *ntfs_volume_alloc(void) -{ - return ntfs_calloc(sizeof(ntfs_volume)); -} - -static void ntfs_attr_free(ntfs_attr **na) -{ - if (na && *na) { - ntfs_attr_close(*na); - *na = NULL; - } -} - -static int ntfs_inode_free(ntfs_inode **ni) -{ - int ret = -1; - - if (ni && *ni) { - ret = ntfs_inode_close(*ni); - *ni = NULL; - } - - return ret; -} - -static void ntfs_error_set(int *err) -{ - if (!*err) - *err = errno; -} - -/** - * __ntfs_volume_release - Destroy an NTFS volume object - * @v: - * - * Description... - * - * Returns: - */ -static int __ntfs_volume_release(ntfs_volume *v) -{ - int err = 0; - - if (ntfs_inode_free(&v->vol_ni)) - ntfs_error_set(&err); - /* - * FIXME: Inodes must be synced before closing - * attributes, otherwise unmount could fail. - */ - if (v->lcnbmp_ni && NInoDirty(v->lcnbmp_ni)) - ntfs_inode_sync(v->lcnbmp_ni); - ntfs_attr_free(&v->lcnbmp_na); - if (ntfs_inode_free(&v->lcnbmp_ni)) - ntfs_error_set(&err); - - if (v->mft_ni && NInoDirty(v->mft_ni)) - ntfs_inode_sync(v->mft_ni); - ntfs_attr_free(&v->mftbmp_na); - ntfs_attr_free(&v->mft_na); - if (ntfs_inode_free(&v->mft_ni)) - ntfs_error_set(&err); - - if (v->mftmirr_ni && NInoDirty(v->mftmirr_ni)) - ntfs_inode_sync(v->mftmirr_ni); - ntfs_attr_free(&v->mftmirr_na); - if (ntfs_inode_free(&v->mftmirr_ni)) - ntfs_error_set(&err); - - if (v->dev) { - struct ntfs_device *dev = v->dev; - - if (dev->d_ops->sync(dev)) - ntfs_error_set(&err); - if (dev->d_ops->close(dev)) - ntfs_error_set(&err); - } - - ntfs_free_lru_caches(v); - free(v->vol_name); - free(v->upcase); - if (v->locase) free(v->locase); - free(v->attrdef); - free(v); - - errno = err; - return errno ? -1 : 0; -} - -static void ntfs_attr_setup_flag(ntfs_inode *ni) -{ - STANDARD_INFORMATION *si; - - si = ntfs_attr_readall(ni, AT_STANDARD_INFORMATION, AT_UNNAMED, 0, NULL); - if (si) { - ni->flags = si->file_attributes; - free(si); - } -} - -/** - * ntfs_mft_load - load the $MFT and setup the ntfs volume with it - * @vol: ntfs volume whose $MFT to load - * - * Load $MFT from @vol and setup @vol with it. After calling this function the - * volume @vol is ready for use by all read access functions provided by the - * ntfs library. - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -static int ntfs_mft_load(ntfs_volume *vol) -{ - VCN next_vcn, last_vcn, highest_vcn; - s64 l; - MFT_RECORD *mb = NULL; - ntfs_attr_search_ctx *ctx = NULL; - ATTR_RECORD *a; - int eo; - - /* Manually setup an ntfs_inode. */ - vol->mft_ni = ntfs_inode_allocate(vol); - mb = ntfs_malloc(vol->mft_record_size); - if (!vol->mft_ni || !mb) { - ntfs_log_perror("Error allocating memory for $MFT"); - goto error_exit; - } - vol->mft_ni->mft_no = 0; - vol->mft_ni->mrec = mb; - /* Can't use any of the higher level functions yet! */ - l = ntfs_mst_pread(vol->dev, vol->mft_lcn << vol->cluster_size_bits, 1, - vol->mft_record_size, mb); - if (l != 1) { - if (l != -1) - errno = EIO; - ntfs_log_perror("Error reading $MFT"); - goto error_exit; - } - - if (ntfs_mft_record_check(vol, 0, mb)) - goto error_exit; - - ctx = ntfs_attr_get_search_ctx(vol->mft_ni, NULL); - if (!ctx) - goto error_exit; - - /* Find the $ATTRIBUTE_LIST attribute in $MFT if present. */ - if (ntfs_attr_lookup(AT_ATTRIBUTE_LIST, AT_UNNAMED, 0, 0, 0, NULL, 0, - ctx)) { - if (errno != ENOENT) { - ntfs_log_error("$MFT has corrupt attribute list.\n"); - goto io_error_exit; - } - goto mft_has_no_attr_list; - } - NInoSetAttrList(vol->mft_ni); - l = ntfs_get_attribute_value_length(ctx->attr); - if (l <= 0 || l > 0x40000) { - ntfs_log_error("$MFT/$ATTR_LIST invalid length (%lld).\n", - (long long)l); - goto io_error_exit; - } - vol->mft_ni->attr_list_size = l; - vol->mft_ni->attr_list = ntfs_malloc(l); - if (!vol->mft_ni->attr_list) - goto error_exit; - - l = ntfs_get_attribute_value(vol, ctx->attr, vol->mft_ni->attr_list); - if (!l) { - ntfs_log_error("Failed to get value of $MFT/$ATTR_LIST.\n"); - goto io_error_exit; - } - if (l != vol->mft_ni->attr_list_size) { - ntfs_log_error("Partial read of $MFT/$ATTR_LIST (%lld != " - "%u).\n", (long long)l, - vol->mft_ni->attr_list_size); - goto io_error_exit; - } - -mft_has_no_attr_list: - - ntfs_attr_setup_flag(vol->mft_ni); - - /* We now have a fully setup ntfs inode for $MFT in vol->mft_ni. */ - - /* Get an ntfs attribute for $MFT/$DATA and set it up, too. */ - vol->mft_na = ntfs_attr_open(vol->mft_ni, AT_DATA, AT_UNNAMED, 0); - if (!vol->mft_na) { - ntfs_log_perror("Failed to open ntfs attribute"); - goto error_exit; - } - /* Read all extents from the $DATA attribute in $MFT. */ - ntfs_attr_reinit_search_ctx(ctx); - last_vcn = vol->mft_na->allocated_size >> vol->cluster_size_bits; - highest_vcn = next_vcn = 0; - a = NULL; - while (!ntfs_attr_lookup(AT_DATA, AT_UNNAMED, 0, 0, next_vcn, NULL, 0, - ctx)) { - runlist_element *nrl; - - a = ctx->attr; - /* $MFT must be non-resident. */ - if (!a->non_resident) { - ntfs_log_error("$MFT must be non-resident.\n"); - goto io_error_exit; - } - /* $MFT must be uncompressed and unencrypted. */ - if (a->flags & ATTR_COMPRESSION_MASK || - a->flags & ATTR_IS_ENCRYPTED) { - ntfs_log_error("$MFT must be uncompressed and " - "unencrypted.\n"); - goto io_error_exit; - } - /* - * Decompress the mapping pairs array of this extent and merge - * the result into the existing runlist. No need for locking - * as we have exclusive access to the inode at this time and we - * are a mount in progress task, too. - */ - nrl = ntfs_mapping_pairs_decompress(vol, a, vol->mft_na->rl); - if (!nrl) { - ntfs_log_perror("ntfs_mapping_pairs_decompress() failed"); - goto error_exit; - } - vol->mft_na->rl = nrl; - - /* Get the lowest vcn for the next extent. */ - highest_vcn = sle64_to_cpu(a->highest_vcn); - next_vcn = highest_vcn + 1; - - /* Only one extent or error, which we catch below. */ - if (next_vcn <= 0) - break; - - /* Avoid endless loops due to corruption. */ - if (next_vcn < sle64_to_cpu(a->lowest_vcn)) { - ntfs_log_error("$MFT has corrupt attribute list.\n"); - goto io_error_exit; - } - } - if (!a) { - ntfs_log_error("$MFT/$DATA attribute not found.\n"); - goto io_error_exit; - } - if (highest_vcn && highest_vcn != last_vcn - 1) { - ntfs_log_error("Failed to load runlist for $MFT/$DATA.\n"); - ntfs_log_error("highest_vcn = 0x%llx, last_vcn - 1 = 0x%llx\n", - (long long)highest_vcn, (long long)last_vcn - 1); - goto io_error_exit; - } - /* Done with the $Mft mft record. */ - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - /* - * The volume is now setup so we can use all read access functions. - */ - vol->mftbmp_na = ntfs_attr_open(vol->mft_ni, AT_BITMAP, AT_UNNAMED, 0); - if (!vol->mftbmp_na) { - ntfs_log_perror("Failed to open $MFT/$BITMAP"); - goto error_exit; - } - return 0; -io_error_exit: - errno = EIO; -error_exit: - eo = errno; - if (ctx) - ntfs_attr_put_search_ctx(ctx); - if (vol->mft_na) { - ntfs_attr_close(vol->mft_na); - vol->mft_na = NULL; - } - if (vol->mft_ni) { - ntfs_inode_close(vol->mft_ni); - vol->mft_ni = NULL; - } - errno = eo; - return -1; -} - -/** - * ntfs_mftmirr_load - load the $MFTMirr and setup the ntfs volume with it - * @vol: ntfs volume whose $MFTMirr to load - * - * Load $MFTMirr from @vol and setup @vol with it. After calling this function - * the volume @vol is ready for use by all write access functions provided by - * the ntfs library (assuming ntfs_mft_load() has been called successfully - * beforehand). - * - * Return 0 on success and -1 on error with errno set to the error code. - */ -static int ntfs_mftmirr_load(ntfs_volume *vol) -{ - int err; - - vol->mftmirr_ni = ntfs_inode_open(vol, FILE_MFTMirr); - if (!vol->mftmirr_ni) { - ntfs_log_perror("Failed to open inode $MFTMirr"); - return -1; - } - - vol->mftmirr_na = ntfs_attr_open(vol->mftmirr_ni, AT_DATA, AT_UNNAMED, 0); - if (!vol->mftmirr_na) { - ntfs_log_perror("Failed to open $MFTMirr/$DATA"); - goto error_exit; - } - - if (ntfs_attr_map_runlist(vol->mftmirr_na, 0) < 0) { - ntfs_log_perror("Failed to map runlist of $MFTMirr/$DATA"); - goto error_exit; - } - - return 0; - -error_exit: - err = errno; - if (vol->mftmirr_na) { - ntfs_attr_close(vol->mftmirr_na); - vol->mftmirr_na = NULL; - } - ntfs_inode_close(vol->mftmirr_ni); - vol->mftmirr_ni = NULL; - errno = err; - return -1; -} - -/** - * ntfs_volume_startup - allocate and setup an ntfs volume - * @dev: device to open - * @flags: optional mount flags - * - * Load, verify, and parse bootsector; load and setup $MFT and $MFTMirr. After - * calling this function, the volume is setup sufficiently to call all read - * and write access functions provided by the library. - * - * Return the allocated volume structure on success and NULL on error with - * errno set to the error code. - */ -ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long flags) -{ - LCN mft_zone_size, mft_lcn; - s64 br; - ntfs_volume *vol; - NTFS_BOOT_SECTOR *bs; - int eo; - - if (!dev || !dev->d_ops || !dev->d_name) { - errno = EINVAL; - ntfs_log_perror("%s: dev = %p", __FUNCTION__, dev); - return NULL; - } - - bs = ntfs_malloc(sizeof(NTFS_BOOT_SECTOR)); - if (!bs) - return NULL; - - /* Allocate the volume structure. */ - vol = ntfs_volume_alloc(); - if (!vol) - goto error_exit; - - /* Create the default upcase table. */ - vol->upcase_len = 65536; - vol->upcase = ntfs_malloc(vol->upcase_len * sizeof(ntfschar)); - if (!vol->upcase) - goto error_exit; - - ntfs_upcase_table_build(vol->upcase, - vol->upcase_len * sizeof(ntfschar)); - /* Default with no locase table and case sensitive file names */ - vol->locase = (ntfschar*)NULL; - NVolSetCaseSensitive(vol); - - /* by default, all files are shown and not marked hidden */ - NVolSetShowSysFiles(vol); - NVolSetShowHidFiles(vol); - NVolClearHideDotFiles(vol); - if (flags & MS_RDONLY) - NVolSetReadOnly(vol); - - /* ...->open needs bracketing to compile with glibc 2.7 */ - if ((dev->d_ops->open)(dev, NVolReadOnly(vol) ? O_RDONLY: O_RDWR)) { - ntfs_log_perror("Error opening '%s'", dev->d_name); - goto error_exit; - } - /* Attach the device to the volume. */ - vol->dev = dev; - - /* Now read the bootsector. */ - br = ntfs_pread(dev, 0, sizeof(NTFS_BOOT_SECTOR), bs); - if (br != sizeof(NTFS_BOOT_SECTOR)) { - if (br != -1) - errno = EINVAL; - if (!br) - ntfs_log_error("Failed to read bootsector (size=0)\n"); - else - ntfs_log_perror("Error reading bootsector"); - goto error_exit; - } - if (!ntfs_boot_sector_is_ntfs(bs)) { - errno = EINVAL; - goto error_exit; - } - if (ntfs_boot_sector_parse(vol, bs) < 0) - goto error_exit; - - free(bs); - bs = NULL; - /* Now set the device block size to the sector size. */ - if (ntfs_device_block_size_set(vol->dev, vol->sector_size)) - ntfs_log_debug("Failed to set the device block size to the " - "sector size. This may affect performance " - "but should be harmless otherwise. Error: " - "%s\n", strerror(errno)); - - /* We now initialize the cluster allocator. */ - vol->full_zones = 0; - mft_zone_size = vol->nr_clusters >> 3; /* 12.5% */ - - /* Setup the mft zone. */ - vol->mft_zone_start = vol->mft_zone_pos = vol->mft_lcn; - ntfs_log_debug("mft_zone_pos = 0x%llx\n", (long long)vol->mft_zone_pos); - - /* - * Calculate the mft_lcn for an unmodified NTFS volume (see mkntfs - * source) and if the actual mft_lcn is in the expected place or even - * further to the front of the volume, extend the mft_zone to cover the - * beginning of the volume as well. This is in order to protect the - * area reserved for the mft bitmap as well within the mft_zone itself. - * On non-standard volumes we don't protect it as the overhead would be - * higher than the speed increase we would get by doing it. - */ - mft_lcn = (8192 + 2 * vol->cluster_size - 1) / vol->cluster_size; - if (mft_lcn * vol->cluster_size < 16 * 1024) - mft_lcn = (16 * 1024 + vol->cluster_size - 1) / - vol->cluster_size; - if (vol->mft_zone_start <= mft_lcn) - vol->mft_zone_start = 0; - ntfs_log_debug("mft_zone_start = 0x%llx\n", (long long)vol->mft_zone_start); - - /* - * Need to cap the mft zone on non-standard volumes so that it does - * not point outside the boundaries of the volume. We do this by - * halving the zone size until we are inside the volume. - */ - vol->mft_zone_end = vol->mft_lcn + mft_zone_size; - while (vol->mft_zone_end >= vol->nr_clusters) { - mft_zone_size >>= 1; - vol->mft_zone_end = vol->mft_lcn + mft_zone_size; - } - ntfs_log_debug("mft_zone_end = 0x%llx\n", (long long)vol->mft_zone_end); - - /* - * Set the current position within each data zone to the start of the - * respective zone. - */ - vol->data1_zone_pos = vol->mft_zone_end; - ntfs_log_debug("data1_zone_pos = %lld\n", (long long)vol->data1_zone_pos); - vol->data2_zone_pos = 0; - ntfs_log_debug("data2_zone_pos = %lld\n", (long long)vol->data2_zone_pos); - - /* Set the mft data allocation position to mft record 24. */ - vol->mft_data_pos = 24; - - /* - * The cluster allocator is now fully operational. - */ - - /* Need to setup $MFT so we can use the library read functions. */ - if (ntfs_mft_load(vol) < 0) { - ntfs_log_perror("Failed to load $MFT"); - goto error_exit; - } - - /* Need to setup $MFTMirr so we can use the write functions, too. */ - if (ntfs_mftmirr_load(vol) < 0) { - ntfs_log_perror("Failed to load $MFTMirr"); - goto error_exit; - } - return vol; -error_exit: - eo = errno; - free(bs); - if (vol) - __ntfs_volume_release(vol); - errno = eo; - return NULL; -} - -/** - * ntfs_volume_check_logfile - check logfile on target volume - * @vol: volume on which to check logfile - * - * Return 0 on success and -1 on error with errno set error code. - */ -static int ntfs_volume_check_logfile(ntfs_volume *vol) -{ - ntfs_inode *ni; - ntfs_attr *na = NULL; - RESTART_PAGE_HEADER *rp = NULL; - int err = 0; - - ni = ntfs_inode_open(vol, FILE_LogFile); - if (!ni) { - ntfs_log_perror("Failed to open inode FILE_LogFile"); - errno = EIO; - return -1; - } - - na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); - if (!na) { - ntfs_log_perror("Failed to open $FILE_LogFile/$DATA"); - err = EIO; - goto out; - } - - if (!ntfs_check_logfile(na, &rp) || !ntfs_is_logfile_clean(na, rp)) - err = EOPNOTSUPP; - free(rp); - ntfs_attr_close(na); -out: - if (ntfs_inode_close(ni)) - ntfs_error_set(&err); - if (err) { - errno = err; - return -1; - } - return 0; -} - -/** - * ntfs_hiberfile_open - Find and open '/hiberfil.sys' - * @vol: An ntfs volume obtained from ntfs_mount - * - * Return: inode Success, hiberfil.sys is valid - * NULL hiberfil.sys doesn't exist or some other error occurred - */ -static ntfs_inode *ntfs_hiberfile_open(ntfs_volume *vol) -{ - u64 inode; - ntfs_inode *ni_root; - ntfs_inode *ni_hibr = NULL; - ntfschar *unicode = NULL; - int unicode_len; - const char *hiberfile = "hiberfil.sys"; - - if (!vol) { - errno = EINVAL; - return NULL; - } - - ni_root = ntfs_inode_open(vol, FILE_root); - if (!ni_root) { - ntfs_log_debug("Couldn't open the root directory.\n"); - return NULL; - } - - unicode_len = ntfs_mbstoucs(hiberfile, &unicode); - if (unicode_len < 0) { - ntfs_log_perror("Couldn't convert 'hiberfil.sys' to Unicode"); - goto out; - } - - inode = ntfs_inode_lookup_by_name(ni_root, unicode, unicode_len); - if (inode == (u64)-1) { - ntfs_log_debug("Couldn't find file '%s'.\n", hiberfile); - goto out; - } - - inode = MREF(inode); - ni_hibr = ntfs_inode_open(vol, inode); - if (!ni_hibr) { - ntfs_log_debug("Couldn't open inode %lld.\n", (long long)inode); - goto out; - } -out: - if (ntfs_inode_close(ni_root)) { - ntfs_inode_close(ni_hibr); - ni_hibr = NULL; - } - free(unicode); - return ni_hibr; -} - - -#define NTFS_HIBERFILE_HEADER_SIZE 4096 - -/** - * ntfs_volume_check_hiberfile - check hiberfil.sys whether Windows is - * hibernated on the target volume - * @vol: volume on which to check hiberfil.sys - * - * Return: 0 if Windows isn't hibernated for sure - * -1 otherwise and errno is set to the appropriate value - */ -int ntfs_volume_check_hiberfile(ntfs_volume *vol, int verbose) -{ - ntfs_inode *ni; - ntfs_attr *na = NULL; - int bytes_read, err; - char *buf = NULL; - - ni = ntfs_hiberfile_open(vol); - if (!ni) { - if (errno == ENOENT) - return 0; - return -1; - } - - buf = ntfs_malloc(NTFS_HIBERFILE_HEADER_SIZE); - if (!buf) - goto out; - - na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); - if (!na) { - ntfs_log_perror("Failed to open hiberfil.sys data attribute"); - goto out; - } - - bytes_read = ntfs_attr_pread(na, 0, NTFS_HIBERFILE_HEADER_SIZE, buf); - if (bytes_read == -1) { - ntfs_log_perror("Failed to read hiberfil.sys"); - goto out; - } - if (bytes_read < NTFS_HIBERFILE_HEADER_SIZE) { - if (verbose) - ntfs_log_error("Hibernated non-system partition, " - "refused to mount.\n"); - errno = EPERM; - goto out; - } - if (memcmp(buf, "hibr", 4) == 0) { - if (verbose) - ntfs_log_error("Windows is hibernated, refused to mount.\n"); - errno = EPERM; - goto out; - } - /* All right, all header bytes are zero */ - errno = 0; -out: - if (na) - ntfs_attr_close(na); - free(buf); - err = errno; - if (ntfs_inode_close(ni)) - ntfs_error_set(&err); - errno = err; - return errno ? -1 : 0; -} - -/* - * Make sure a LOGGED_UTILITY_STREAM attribute named "$TXF_DATA" - * on the root directory is resident. - * When it is non-resident, the partition cannot be mounted on Vista - * (see http://support.microsoft.com/kb/974729) - * - * We take care to avoid this situation, however this can be a - * consequence of having used an older version (including older - * Windows version), so we had better fix it. - * - * Returns 0 if unneeded or successful - * -1 if there was an error, explained by errno - */ - -static int fix_txf_data(ntfs_volume *vol) -{ - void *txf_data; - s64 txf_data_size; - ntfs_inode *ni; - ntfs_attr *na; - int res; - - res = 0; - ntfs_log_debug("Loading root directory\n"); - ni = ntfs_inode_open(vol, FILE_root); - if (!ni) { - ntfs_log_perror("Failed to open root directory"); - res = -1; - } else { - /* Get the $TXF_DATA attribute */ - na = ntfs_attr_open(ni, AT_LOGGED_UTILITY_STREAM, TXF_DATA, 9); - if (na) { - if (NAttrNonResident(na)) { - /* - * Fix the attribute by truncating, then - * rewriting it. - */ - ntfs_log_debug("Making $TXF_DATA resident\n"); - txf_data = ntfs_attr_readall(ni, - AT_LOGGED_UTILITY_STREAM, - TXF_DATA, 9, &txf_data_size); - if (txf_data) { - if (ntfs_attr_truncate(na, 0) - || (ntfs_attr_pwrite(na, 0, - txf_data_size, txf_data) - != txf_data_size)) - res = -1; - free(txf_data); - } - if (res) - ntfs_log_error("Failed to make $TXF_DATA resident\n"); - else - ntfs_log_error("$TXF_DATA made resident\n"); - } - ntfs_attr_close(na); - } - if (ntfs_inode_close(ni)) { - ntfs_log_perror("Failed to close root"); - res = -1; - } - } - return (res); -} - -/** - * ntfs_device_mount - open ntfs volume - * @dev: device to open - * @flags: optional mount flags - * - * This function mounts an ntfs volume. @dev should describe the device which - * to mount as the ntfs volume. - * - * @flags is an optional second parameter. The same flags are used as for - * the mount system call (man 2 mount). Currently only the following flag - * is implemented: - * MS_RDONLY - mount volume read-only - * - * The function opens the device @dev and verifies that it contains a valid - * bootsector. Then, it allocates an ntfs_volume structure and initializes - * some of the values inside the structure from the information stored in the - * bootsector. It proceeds to load the necessary system files and completes - * setting up the structure. - * - * Return the allocated volume structure on success and NULL on error with - * errno set to the error code. - */ -ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags) -{ - s64 l; - ntfs_volume *vol; - u8 *m = NULL, *m2 = NULL; - ntfs_attr_search_ctx *ctx = NULL; - ntfs_inode *ni; - ntfs_attr *na; - ATTR_RECORD *a; - VOLUME_INFORMATION *vinf; - ntfschar *vname; - int i, j, eo; - u32 u; - - vol = ntfs_volume_startup(dev, flags); - if (!vol) - return NULL; - - /* Load data from $MFT and $MFTMirr and compare the contents. */ - m = ntfs_malloc(vol->mftmirr_size << vol->mft_record_size_bits); - m2 = ntfs_malloc(vol->mftmirr_size << vol->mft_record_size_bits); - if (!m || !m2) - goto error_exit; - - l = ntfs_attr_mst_pread(vol->mft_na, 0, vol->mftmirr_size, - vol->mft_record_size, m); - if (l != vol->mftmirr_size) { - if (l == -1) - ntfs_log_perror("Failed to read $MFT"); - else { - ntfs_log_error("Failed to read $MFT, unexpected length " - "(%lld != %d).\n", (long long)l, - vol->mftmirr_size); - errno = EIO; - } - goto error_exit; - } - l = ntfs_attr_mst_pread(vol->mftmirr_na, 0, vol->mftmirr_size, - vol->mft_record_size, m2); - if (l != vol->mftmirr_size) { - if (l == -1) { - ntfs_log_perror("Failed to read $MFTMirr"); - goto error_exit; - } - vol->mftmirr_size = l; - } - ntfs_log_debug("Comparing $MFTMirr to $MFT...\n"); - for (i = 0; i < vol->mftmirr_size; ++i) { - MFT_RECORD *mrec, *mrec2; - const char *ESTR[12] = { "$MFT", "$MFTMirr", "$LogFile", - "$Volume", "$AttrDef", "root directory", "$Bitmap", - "$Boot", "$BadClus", "$Secure", "$UpCase", "$Extend" }; - const char *s; - - if (i < 12) - s = ESTR[i]; - else if (i < 16) - s = "system file"; - else - s = "mft record"; - - mrec = (MFT_RECORD*)(m + i * vol->mft_record_size); - if (mrec->flags & MFT_RECORD_IN_USE) { - if (ntfs_is_baad_recordp(mrec)) { - ntfs_log_error("$MFT error: Incomplete multi " - "sector transfer detected in " - "'%s'.\n", s); - goto io_error_exit; - } - if (!ntfs_is_mft_recordp(mrec)) { - ntfs_log_error("$MFT error: Invalid mft " - "record for '%s'.\n", s); - goto io_error_exit; - } - } - mrec2 = (MFT_RECORD*)(m2 + i * vol->mft_record_size); - if (mrec2->flags & MFT_RECORD_IN_USE) { - if (ntfs_is_baad_recordp(mrec2)) { - ntfs_log_error("$MFTMirr error: Incomplete " - "multi sector transfer " - "detected in '%s'.\n", s); - goto io_error_exit; - } - if (!ntfs_is_mft_recordp(mrec2)) { - ntfs_log_error("$MFTMirr error: Invalid mft " - "record for '%s'.\n", s); - goto io_error_exit; - } - } - if (memcmp(mrec, mrec2, ntfs_mft_record_get_data_size(mrec))) { - ntfs_log_error("$MFTMirr does not match $MFT (record " - "%d).\n", i); - goto io_error_exit; - } - } - - free(m2); - free(m); - m = m2 = NULL; - - /* Now load the bitmap from $Bitmap. */ - ntfs_log_debug("Loading $Bitmap...\n"); - vol->lcnbmp_ni = ntfs_inode_open(vol, FILE_Bitmap); - if (!vol->lcnbmp_ni) { - ntfs_log_perror("Failed to open inode FILE_Bitmap"); - goto error_exit; - } - - vol->lcnbmp_na = ntfs_attr_open(vol->lcnbmp_ni, AT_DATA, AT_UNNAMED, 0); - if (!vol->lcnbmp_na) { - ntfs_log_perror("Failed to open ntfs attribute"); - goto error_exit; - } - - if (vol->lcnbmp_na->data_size > vol->lcnbmp_na->allocated_size) { - ntfs_log_error("Corrupt cluster map size (%lld > %lld)\n", - (long long)vol->lcnbmp_na->data_size, - (long long)vol->lcnbmp_na->allocated_size); - goto io_error_exit; - } - - /* Now load the upcase table from $UpCase. */ - ntfs_log_debug("Loading $UpCase...\n"); - ni = ntfs_inode_open(vol, FILE_UpCase); - if (!ni) { - ntfs_log_perror("Failed to open inode FILE_UpCase"); - goto error_exit; - } - /* Get an ntfs attribute for $UpCase/$DATA. */ - na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); - if (!na) { - ntfs_log_perror("Failed to open ntfs attribute"); - goto error_exit; - } - /* - * Note: Normally, the upcase table has a length equal to 65536 - * 2-byte Unicode characters but allow for different cases, so no - * checks done. Just check we don't overflow 32-bits worth of Unicode - * characters. - */ - if (na->data_size & ~0x1ffffffffULL) { - ntfs_log_error("Error: Upcase table is too big (max 32-bit " - "allowed).\n"); - errno = EINVAL; - goto error_exit; - } - if (vol->upcase_len != na->data_size >> 1) { - vol->upcase_len = na->data_size >> 1; - /* Throw away default table. */ - free(vol->upcase); - vol->upcase = ntfs_malloc(na->data_size); - if (!vol->upcase) - goto error_exit; - } - /* Read in the $DATA attribute value into the buffer. */ - l = ntfs_attr_pread(na, 0, na->data_size, vol->upcase); - if (l != na->data_size) { - ntfs_log_error("Failed to read $UpCase, unexpected length " - "(%lld != %lld).\n", (long long)l, - (long long)na->data_size); - errno = EIO; - goto error_exit; - } - /* Done with the $UpCase mft record. */ - ntfs_attr_close(na); - if (ntfs_inode_close(ni)) { - ntfs_log_perror("Failed to close $UpCase"); - goto error_exit; - } - - /* - * Now load $Volume and set the version information and flags in the - * vol structure accordingly. - */ - ntfs_log_debug("Loading $Volume...\n"); - vol->vol_ni = ntfs_inode_open(vol, FILE_Volume); - if (!vol->vol_ni) { - ntfs_log_perror("Failed to open inode FILE_Volume"); - goto error_exit; - } - /* Get a search context for the $Volume/$VOLUME_INFORMATION lookup. */ - ctx = ntfs_attr_get_search_ctx(vol->vol_ni, NULL); - if (!ctx) - goto error_exit; - - /* Find the $VOLUME_INFORMATION attribute. */ - if (ntfs_attr_lookup(AT_VOLUME_INFORMATION, AT_UNNAMED, 0, 0, 0, NULL, - 0, ctx)) { - ntfs_log_perror("$VOLUME_INFORMATION attribute not found in " - "$Volume"); - goto error_exit; - } - a = ctx->attr; - /* Has to be resident. */ - if (a->non_resident) { - ntfs_log_error("Attribute $VOLUME_INFORMATION must be " - "resident but it isn't.\n"); - errno = EIO; - goto error_exit; - } - /* Get a pointer to the value of the attribute. */ - vinf = (VOLUME_INFORMATION*)(le16_to_cpu(a->value_offset) + (char*)a); - /* Sanity checks. */ - if ((char*)vinf + le32_to_cpu(a->value_length) > (char*)ctx->mrec + - le32_to_cpu(ctx->mrec->bytes_in_use) || - le16_to_cpu(a->value_offset) + le32_to_cpu( - a->value_length) > le32_to_cpu(a->length)) { - ntfs_log_error("$VOLUME_INFORMATION in $Volume is corrupt.\n"); - errno = EIO; - goto error_exit; - } - /* Setup vol from the volume information attribute value. */ - vol->major_ver = vinf->major_ver; - vol->minor_ver = vinf->minor_ver; - /* Do not use le16_to_cpu() macro here as our VOLUME_FLAGS are - defined using cpu_to_le16() macro and hence are consistent. */ - vol->flags = vinf->flags; - /* - * Reinitialize the search context for the $Volume/$VOLUME_NAME lookup. - */ - ntfs_attr_reinit_search_ctx(ctx); - if (ntfs_attr_lookup(AT_VOLUME_NAME, AT_UNNAMED, 0, 0, 0, NULL, 0, - ctx)) { - if (errno != ENOENT) { - ntfs_log_perror("Failed to lookup of $VOLUME_NAME in " - "$Volume failed"); - goto error_exit; - } - /* - * Attribute not present. This has been seen in the field. - * Treat this the same way as if the attribute was present but - * had zero length. - */ - vol->vol_name = ntfs_malloc(1); - if (!vol->vol_name) - goto error_exit; - vol->vol_name[0] = '\0'; - } else { - a = ctx->attr; - /* Has to be resident. */ - if (a->non_resident) { - ntfs_log_error("$VOLUME_NAME must be resident.\n"); - errno = EIO; - goto error_exit; - } - /* Get a pointer to the value of the attribute. */ - vname = (ntfschar*)(le16_to_cpu(a->value_offset) + (char*)a); - u = le32_to_cpu(a->value_length) / 2; - /* - * Convert Unicode volume name to current locale multibyte - * format. - */ - vol->vol_name = NULL; - if (ntfs_ucstombs(vname, u, &vol->vol_name, 0) == -1) { - ntfs_log_perror("Volume name could not be converted " - "to current locale"); - ntfs_log_debug("Forcing name into ASCII by replacing " - "non-ASCII characters with underscores.\n"); - vol->vol_name = ntfs_malloc(u + 1); - if (!vol->vol_name) - goto error_exit; - - for (j = 0; j < (s32)u; j++) { - u16 uc = le16_to_cpu(vname[j]); - if (uc > 0xff) - uc = (u16)'_'; - vol->vol_name[j] = (char)uc; - } - vol->vol_name[u] = '\0'; - } - } - ntfs_attr_put_search_ctx(ctx); - ctx = NULL; - /* Now load the attribute definitions from $AttrDef. */ - ntfs_log_debug("Loading $AttrDef...\n"); - ni = ntfs_inode_open(vol, FILE_AttrDef); - if (!ni) { - ntfs_log_perror("Failed to open $AttrDef"); - goto error_exit; - } - /* Get an ntfs attribute for $AttrDef/$DATA. */ - na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); - if (!na) { - ntfs_log_perror("Failed to open ntfs attribute"); - goto error_exit; - } - /* Check we don't overflow 32-bits. */ - if (na->data_size > 0xffffffffLL) { - ntfs_log_error("Attribute definition table is too big (max " - "32-bit allowed).\n"); - errno = EINVAL; - goto error_exit; - } - vol->attrdef_len = na->data_size; - vol->attrdef = ntfs_malloc(na->data_size); - if (!vol->attrdef) - goto error_exit; - /* Read in the $DATA attribute value into the buffer. */ - l = ntfs_attr_pread(na, 0, na->data_size, vol->attrdef); - if (l != na->data_size) { - ntfs_log_error("Failed to read $AttrDef, unexpected length " - "(%lld != %lld).\n", (long long)l, - (long long)na->data_size); - errno = EIO; - goto error_exit; - } - /* Done with the $AttrDef mft record. */ - ntfs_attr_close(na); - if (ntfs_inode_close(ni)) { - ntfs_log_perror("Failed to close $AttrDef"); - goto error_exit; - } - /* - * Check for dirty logfile and hibernated Windows. - * We care only about read-write mounts. - */ - if (!(flags & MS_RDONLY)) { - if (!(flags & MS_IGNORE_HIBERFILE) && - ntfs_volume_check_hiberfile(vol, 1) < 0) - goto error_exit; - if (ntfs_volume_check_logfile(vol) < 0) { - if (!(flags & MS_RECOVER)) - goto error_exit; - ntfs_log_info("The file system wasn't safely " - "closed on Windows. Fixing.\n"); - if (ntfs_logfile_reset(vol)) - goto error_exit; - } - } - /* make $TXF_DATA resident if present on the root directory */ - if (!NVolReadOnly(vol) && fix_txf_data(vol)) - goto error_exit; - - return vol; -io_error_exit: - errno = EIO; -error_exit: - eo = errno; - if (ctx) - ntfs_attr_put_search_ctx(ctx); - free(m); - free(m2); - __ntfs_volume_release(vol); - errno = eo; - return NULL; -} - -/* - * Set appropriate flags for showing NTFS metafiles - * or files marked as hidden. - * Not set in ntfs_mount() to avoid breaking existing tools. - */ - -int ntfs_set_shown_files(ntfs_volume *vol, - BOOL show_sys_files, BOOL show_hid_files, - BOOL hide_dot_files) -{ - int res; - - res = -1; - if (vol) { - NVolClearShowSysFiles(vol); - NVolClearShowHidFiles(vol); - NVolClearHideDotFiles(vol); - if (show_sys_files) - NVolSetShowSysFiles(vol); - if (show_hid_files) - NVolSetShowHidFiles(vol); - if (hide_dot_files) - NVolSetHideDotFiles(vol); - res = 0; - } - if (res) - ntfs_log_error("Failed to set file visibility\n"); - return (res); -} - -/* - * Set ignore case mode - */ - -int ntfs_set_ignore_case(ntfs_volume *vol) -{ - int res; - - res = -1; - if (vol && vol->upcase) { - vol->locase = ntfs_locase_table_build(vol->upcase, - vol->upcase_len); - if (vol->locase) { - NVolClearCaseSensitive(vol); - res = 0; - } - } - if (res) - ntfs_log_error("Failed to set ignore_case mode\n"); - return (res); -} - -/** - * ntfs_mount - open ntfs volume - * @name: name of device/file to open - * @flags: optional mount flags - * - * This function mounts an ntfs volume. @name should contain the name of the - * device/file to mount as the ntfs volume. - * - * @flags is an optional second parameter. The same flags are used as for - * the mount system call (man 2 mount). Currently only the following flags - * is implemented: - * MS_RDONLY - mount volume read-only - * - * The function opens the device or file @name and verifies that it contains a - * valid bootsector. Then, it allocates an ntfs_volume structure and initializes - * some of the values inside the structure from the information stored in the - * bootsector. It proceeds to load the necessary system files and completes - * setting up the structure. - * - * Return the allocated volume structure on success and NULL on error with - * errno set to the error code. - * - * Note, that a copy is made of @name, and hence it can be discarded as - * soon as the function returns. - */ -ntfs_volume *ntfs_mount(const char *name __attribute__((unused)), - unsigned long flags __attribute__((unused))) -{ -#ifndef NO_NTFS_DEVICE_DEFAULT_IO_OPS - struct ntfs_device *dev; - ntfs_volume *vol; - - /* Allocate an ntfs_device structure. */ - dev = ntfs_device_alloc(name, 0, &ntfs_device_default_io_ops, NULL); - if (!dev) - return NULL; - /* Call ntfs_device_mount() to do the actual mount. */ - vol = ntfs_device_mount(dev, flags); - if (!vol) { - int eo = errno; - ntfs_device_free(dev); - errno = eo; - } else - ntfs_create_lru_caches(vol); - return vol; -#else - /* - * ntfs_mount() makes no sense if NO_NTFS_DEVICE_DEFAULT_IO_OPS is - * defined as there are no device operations available in libntfs in - * this case. - */ - errno = EOPNOTSUPP; - return NULL; -#endif -} - -/** - * ntfs_umount - close ntfs volume - * @vol: address of ntfs_volume structure of volume to close - * @force: if true force close the volume even if it is busy - * - * Deallocate all structures (including @vol itself) associated with the ntfs - * volume @vol. - * - * Return 0 on success. On error return -1 with errno set appropriately - * (most likely to one of EAGAIN, EBUSY or EINVAL). The EAGAIN error means that - * an operation is in progress and if you try the close later the operation - * might be completed and the close succeed. - * - * If @force is true (i.e. not zero) this function will close the volume even - * if this means that data might be lost. - * - * @vol must have previously been returned by a call to ntfs_mount(). - * - * @vol itself is deallocated and should no longer be dereferenced after this - * function returns success. If it returns an error then nothing has been done - * so it is safe to continue using @vol. - */ -int ntfs_umount(ntfs_volume *vol, const BOOL force __attribute__((unused))) -{ - struct ntfs_device *dev; - int ret; - - if (!vol) { - errno = EINVAL; - return -1; - } - dev = vol->dev; - ret = __ntfs_volume_release(vol); - ntfs_device_free(dev); - return ret; -} - -#ifdef HAVE_MNTENT_H - -#ifndef HAVE_REALPATH -/** - * realpath - If there is no realpath on the system - */ -static char *realpath(const char *path, char *resolved_path) -{ - strncpy(resolved_path, path, PATH_MAX); - resolved_path[PATH_MAX] = '\0'; - return resolved_path; -} -#endif - -/** - * ntfs_mntent_check - desc - * - * If you are wanting to use this, you actually wanted to use - * ntfs_check_if_mounted(), you just didn't realize. (-: - * - * See description of ntfs_check_if_mounted(), below. - */ -static int ntfs_mntent_check(const char *file, unsigned long *mnt_flags) -{ - struct mntent *mnt; - char *real_file = NULL, *real_fsname = NULL; - FILE *f; - int err = 0; - - real_file = ntfs_malloc(PATH_MAX + 1); - if (!real_file) - return -1; - real_fsname = ntfs_malloc(PATH_MAX + 1); - if (!real_fsname) { - err = errno; - goto exit; - } - if (!realpath(file, real_file)) { - err = errno; - goto exit; - } - if (!(f = setmntent(MOUNTED, "r"))) { - err = errno; - goto exit; - } - while ((mnt = getmntent(f))) { - if (!realpath(mnt->mnt_fsname, real_fsname)) - continue; - if (!strcmp(real_file, real_fsname)) - break; - } - endmntent(f); - if (!mnt) - goto exit; - *mnt_flags = NTFS_MF_MOUNTED; - if (!strcmp(mnt->mnt_dir, "/")) - *mnt_flags |= NTFS_MF_ISROOT; -#ifdef HAVE_HASMNTOPT - if (hasmntopt(mnt, "ro") && !hasmntopt(mnt, "rw")) - *mnt_flags |= NTFS_MF_READONLY; -#endif -exit: - free(real_file); - free(real_fsname); - if (err) { - errno = err; - return -1; - } - return 0; -} -#endif /* HAVE_MNTENT_H */ - -/** - * ntfs_check_if_mounted - check if an ntfs volume is currently mounted - * @file: device file to check - * @mnt_flags: pointer into which to return the ntfs mount flags (see volume.h) - * - * If the running system does not support the {set,get,end}mntent() calls, - * just return 0 and set *@mnt_flags to zero. - * - * When the system does support the calls, ntfs_check_if_mounted() first tries - * to find the device @file in /etc/mtab (or wherever this is kept on the - * running system). If it is not found, assume the device is not mounted and - * return 0 and set *@mnt_flags to zero. - * - * If the device @file is found, set the NTFS_MF_MOUNTED flags in *@mnt_flags. - * - * Further if @file is mounted as the file system root ("/"), set the flag - * NTFS_MF_ISROOT in *@mnt_flags. - * - * Finally, check if the file system is mounted read-only, and if so set the - * NTFS_MF_READONLY flag in *@mnt_flags. - * - * On success return 0 with *@mnt_flags set to the ntfs mount flags. - * - * On error return -1 with errno set to the error code. - */ -int ntfs_check_if_mounted(const char *file __attribute__((unused)), - unsigned long *mnt_flags) -{ - *mnt_flags = 0; -#ifdef HAVE_MNTENT_H - return ntfs_mntent_check(file, mnt_flags); -#else - return 0; -#endif -} - -/** - * ntfs_version_is_supported - check if NTFS version is supported. - * @vol: ntfs volume whose version we're interested in. - * - * The function checks if the NTFS volume version is known or not. - * Version 1.1 and 1.2 are used by Windows NT3.x and NT4. - * Version 2.x is used by Windows 2000 Betas. - * Version 3.0 is used by Windows 2000. - * Version 3.1 is used by Windows XP, Windows Server 2003 and Longhorn. - * - * Return 0 if NTFS version is supported otherwise -1 with errno set. - * - * The following error codes are defined: - * EOPNOTSUPP - Unknown NTFS version - * EINVAL - Invalid argument - */ -int ntfs_version_is_supported(ntfs_volume *vol) -{ - u8 major, minor; - - if (!vol) { - errno = EINVAL; - return -1; - } - - major = vol->major_ver; - minor = vol->minor_ver; - - if (NTFS_V1_1(major, minor) || NTFS_V1_2(major, minor)) - return 0; - - if (NTFS_V2_X(major, minor)) - return 0; - - if (NTFS_V3_0(major, minor) || NTFS_V3_1(major, minor)) - return 0; - - errno = EOPNOTSUPP; - return -1; -} - -/** - * ntfs_logfile_reset - "empty" $LogFile data attribute value - * @vol: ntfs volume whose $LogFile we intend to reset. - * - * Fill the value of the $LogFile data attribute, i.e. the contents of - * the file, with 0xff's, thus marking the journal as empty. - * - * FIXME(?): We might need to zero the LSN field of every single mft - * record as well. (But, first try without doing that and see what - * happens, since chkdsk might pickup the pieces and do it for us...) - * - * On success return 0. - * - * On error return -1 with errno set to the error code. - */ -int ntfs_logfile_reset(ntfs_volume *vol) -{ - ntfs_inode *ni; - ntfs_attr *na; - int eo; - - if (!vol) { - errno = EINVAL; - return -1; - } - - ni = ntfs_inode_open(vol, FILE_LogFile); - if (!ni) { - ntfs_log_perror("Failed to open inode FILE_LogFile"); - return -1; - } - - na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); - if (!na) { - eo = errno; - ntfs_log_perror("Failed to open $FILE_LogFile/$DATA"); - goto error_exit; - } - - if (ntfs_empty_logfile(na)) { - eo = errno; - ntfs_attr_close(na); - goto error_exit; - } - - ntfs_attr_close(na); - return ntfs_inode_close(ni); - -error_exit: - ntfs_inode_close(ni); - errno = eo; - return -1; -} - -/** - * ntfs_volume_write_flags - set the flags of an ntfs volume - * @vol: ntfs volume where we set the volume flags - * @flags: new flags - * - * Set the on-disk volume flags in the mft record of $Volume and - * on volume @vol to @flags. - * - * Return 0 if successful and -1 if not with errno set to the error code. - */ -int ntfs_volume_write_flags(ntfs_volume *vol, const le16 flags) -{ - ATTR_RECORD *a; - VOLUME_INFORMATION *c; - ntfs_attr_search_ctx *ctx; - int ret = -1; /* failure */ - - if (!vol || !vol->vol_ni) { - errno = EINVAL; - return -1; - } - /* Get a pointer to the volume information attribute. */ - ctx = ntfs_attr_get_search_ctx(vol->vol_ni, NULL); - if (!ctx) - return -1; - - if (ntfs_attr_lookup(AT_VOLUME_INFORMATION, AT_UNNAMED, 0, 0, 0, NULL, - 0, ctx)) { - ntfs_log_error("Attribute $VOLUME_INFORMATION was not found " - "in $Volume!\n"); - goto err_out; - } - a = ctx->attr; - /* Sanity check. */ - if (a->non_resident) { - ntfs_log_error("Attribute $VOLUME_INFORMATION must be resident " - "but it isn't.\n"); - errno = EIO; - goto err_out; - } - /* Get a pointer to the value of the attribute. */ - c = (VOLUME_INFORMATION*)(le16_to_cpu(a->value_offset) + (char*)a); - /* Sanity checks. */ - if ((char*)c + le32_to_cpu(a->value_length) > (char*)ctx->mrec + - le32_to_cpu(ctx->mrec->bytes_in_use) || - le16_to_cpu(a->value_offset) + - le32_to_cpu(a->value_length) > le32_to_cpu(a->length)) { - ntfs_log_error("Attribute $VOLUME_INFORMATION in $Volume is " - "corrupt!\n"); - errno = EIO; - goto err_out; - } - /* Set the volume flags. */ - vol->flags = c->flags = flags & VOLUME_FLAGS_MASK; - /* Write them to disk. */ - ntfs_inode_mark_dirty(vol->vol_ni); - if (ntfs_inode_sync(vol->vol_ni)) - goto err_out; - - ret = 0; /* success */ -err_out: - ntfs_attr_put_search_ctx(ctx); - return ret; -} - -int ntfs_volume_error(int err) -{ - int ret; - - switch (err) { - case 0: - ret = NTFS_VOLUME_OK; - break; - case EINVAL: - ret = NTFS_VOLUME_NOT_NTFS; - break; - case EIO: - ret = NTFS_VOLUME_CORRUPT; - break; - case EPERM: - ret = NTFS_VOLUME_HIBERNATED; - break; - case EOPNOTSUPP: - ret = NTFS_VOLUME_UNCLEAN_UNMOUNT; - break; - case EBUSY: - ret = NTFS_VOLUME_LOCKED; - break; - case ENXIO: - ret = NTFS_VOLUME_RAID; - break; - case EACCES: - ret = NTFS_VOLUME_NO_PRIVILEGE; - break; - default: - ret = NTFS_VOLUME_UNKNOWN_REASON; - break; - } - return ret; -} - - -void ntfs_mount_error(const char *volume, const char *mntpoint, int err) -{ - switch (err) { - case NTFS_VOLUME_NOT_NTFS: - ntfs_log_error(invalid_ntfs_msg, volume); - break; - case NTFS_VOLUME_CORRUPT: - ntfs_log_error("%s", corrupt_volume_msg); - break; - case NTFS_VOLUME_HIBERNATED: - ntfs_log_error(hibernated_volume_msg, volume, mntpoint); - break; - case NTFS_VOLUME_UNCLEAN_UNMOUNT: - ntfs_log_error("%s", unclean_journal_msg); - break; - case NTFS_VOLUME_LOCKED: - ntfs_log_error("%s", opened_volume_msg); - break; - case NTFS_VOLUME_RAID: - ntfs_log_error("%s", fakeraid_msg); - break; - case NTFS_VOLUME_NO_PRIVILEGE: - ntfs_log_error(access_denied_msg, volume); - break; - } -} - -int ntfs_set_locale(void) -{ - const char *locale; - - locale = setlocale(LC_ALL, ""); - if (!locale) { - locale = setlocale(LC_ALL, NULL); - ntfs_log_error("Couldn't set local environment, using default " - "'%s'.\n", locale); - return 1; - } - return 0; -} - -/* - * Feed the counts of free clusters and free mft records - */ - -int ntfs_volume_get_free_space(ntfs_volume *vol) -{ - ntfs_attr *na; - int ret; - - ret = -1; /* default return */ - vol->free_clusters = ntfs_attr_get_free_bits(vol->lcnbmp_na); - if (vol->free_clusters < 0) { - ntfs_log_perror("Failed to read NTFS $Bitmap"); - } else { - na = vol->mftbmp_na; - vol->free_mft_records = ntfs_attr_get_free_bits(na); - - if (vol->free_mft_records >= 0) - vol->free_mft_records += (na->allocated_size - na->data_size) << 3; - - if (vol->free_mft_records < 0) - ntfs_log_perror("Failed to calculate free MFT records"); - else - ret = 0; - } - return (ret); -} diff --git a/source/libs/libntfs/volume.h b/source/libs/libntfs/volume.h deleted file mode 100644 index 79193c53..00000000 --- a/source/libs/libntfs/volume.h +++ /dev/null @@ -1,303 +0,0 @@ -/* - * volume.h - Exports for NTFS volume handling. Originated from the Linux-NTFS project. - * - * Copyright (c) 2000-2004 Anton Altaparmakov - * Copyright (c) 2004-2005 Richard Russon - * Copyright (c) 2005-2006 Yura Pakhuchiy - * Copyright (c) 2005-2009 Szabolcs Szakacsits - * - * This program/include file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program/include file is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the NTFS-3G - * distribution in the file COPYING); if not, write to the Free Software - * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _NTFS_VOLUME_H -#define _NTFS_VOLUME_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDIO_H -#include -#endif -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_MOUNT_H -#include -#endif -#ifdef HAVE_MNTENT_H -#include -#endif - -/* - * Under Cygwin, DJGPP and FreeBSD we do not have MS_RDONLY, - * so we define them ourselves. - */ -#ifndef MS_RDONLY -#define MS_RDONLY 1 -#endif - -#define MS_EXCLUSIVE 0x08000000 - -#ifndef MS_RECOVER -#define MS_RECOVER 0x10000000 -#endif - -#define MS_IGNORE_HIBERFILE 0x20000000 - -/* Forward declaration */ -typedef struct _ntfs_volume ntfs_volume; - -#include "param.h" -#include "types.h" -#include "support.h" -#include "device.h" -#include "inode.h" -#include "attrib.h" -#include "index.h" - -/** - * enum ntfs_mount_flags - - * - * Flags returned by the ntfs_check_if_mounted() function. - */ -typedef enum { - NTFS_MF_MOUNTED = 1, /* Device is mounted. */ - NTFS_MF_ISROOT = 2, /* Device is mounted as system root. */ - NTFS_MF_READONLY = 4, /* Device is mounted read-only. */ -} ntfs_mount_flags; - -extern int ntfs_check_if_mounted(const char *file, unsigned long *mnt_flags); - -typedef enum { - NTFS_VOLUME_OK = 0, - NTFS_VOLUME_SYNTAX_ERROR = 11, - NTFS_VOLUME_NOT_NTFS = 12, - NTFS_VOLUME_CORRUPT = 13, - NTFS_VOLUME_HIBERNATED = 14, - NTFS_VOLUME_UNCLEAN_UNMOUNT = 15, - NTFS_VOLUME_LOCKED = 16, - NTFS_VOLUME_RAID = 17, - NTFS_VOLUME_UNKNOWN_REASON = 18, - NTFS_VOLUME_NO_PRIVILEGE = 19, - NTFS_VOLUME_OUT_OF_MEMORY = 20, - NTFS_VOLUME_FUSE_ERROR = 21, - NTFS_VOLUME_INSECURE = 22 -} ntfs_volume_status; - -/** - * enum ntfs_volume_state_bits - - * - * Defined bits for the state field in the ntfs_volume structure. - */ -typedef enum { - NV_ReadOnly, /* 1: Volume is read-only. */ - NV_CaseSensitive, /* 1: Volume is mounted case-sensitive. */ - NV_LogFileEmpty, /* 1: $logFile journal is empty. */ - NV_ShowSysFiles, /* 1: Show NTFS metafiles. */ - NV_ShowHidFiles, /* 1: Show files marked hidden. */ - NV_HideDotFiles, /* 1: Set hidden flag on dot files */ - NV_Compression, /* 1: allow compression */ -} ntfs_volume_state_bits; - -#define test_nvol_flag(nv, flag) test_bit(NV_##flag, (nv)->state) -#define set_nvol_flag(nv, flag) set_bit(NV_##flag, (nv)->state) -#define clear_nvol_flag(nv, flag) clear_bit(NV_##flag, (nv)->state) - -#define NVolReadOnly(nv) test_nvol_flag(nv, ReadOnly) -#define NVolSetReadOnly(nv) set_nvol_flag(nv, ReadOnly) -#define NVolClearReadOnly(nv) clear_nvol_flag(nv, ReadOnly) - -#define NVolCaseSensitive(nv) test_nvol_flag(nv, CaseSensitive) -#define NVolSetCaseSensitive(nv) set_nvol_flag(nv, CaseSensitive) -#define NVolClearCaseSensitive(nv) clear_nvol_flag(nv, CaseSensitive) - -#define NVolLogFileEmpty(nv) test_nvol_flag(nv, LogFileEmpty) -#define NVolSetLogFileEmpty(nv) set_nvol_flag(nv, LogFileEmpty) -#define NVolClearLogFileEmpty(nv) clear_nvol_flag(nv, LogFileEmpty) - -#define NVolShowSysFiles(nv) test_nvol_flag(nv, ShowSysFiles) -#define NVolSetShowSysFiles(nv) set_nvol_flag(nv, ShowSysFiles) -#define NVolClearShowSysFiles(nv) clear_nvol_flag(nv, ShowSysFiles) - -#define NVolShowHidFiles(nv) test_nvol_flag(nv, ShowHidFiles) -#define NVolSetShowHidFiles(nv) set_nvol_flag(nv, ShowHidFiles) -#define NVolClearShowHidFiles(nv) clear_nvol_flag(nv, ShowHidFiles) - -#define NVolHideDotFiles(nv) test_nvol_flag(nv, HideDotFiles) -#define NVolSetHideDotFiles(nv) set_nvol_flag(nv, HideDotFiles) -#define NVolClearHideDotFiles(nv) clear_nvol_flag(nv, HideDotFiles) - -#define NVolCompression(nv) test_nvol_flag(nv, Compression) -#define NVolSetCompression(nv) set_nvol_flag(nv, Compression) -#define NVolClearCompression(nv) clear_nvol_flag(nv, Compression) - -/* - * NTFS version 1.1 and 1.2 are used by Windows NT4. - * NTFS version 2.x is used by Windows 2000 Beta - * NTFS version 3.0 is used by Windows 2000. - * NTFS version 3.1 is used by Windows XP, 2003 and Vista. - */ - -#define NTFS_V1_1(major, minor) ((major) == 1 && (minor) == 1) -#define NTFS_V1_2(major, minor) ((major) == 1 && (minor) == 2) -#define NTFS_V2_X(major, minor) ((major) == 2) -#define NTFS_V3_0(major, minor) ((major) == 3 && (minor) == 0) -#define NTFS_V3_1(major, minor) ((major) == 3 && (minor) == 1) - -#define NTFS_BUF_SIZE 8192 - -/** - * struct _ntfs_volume - structure describing an open volume in memory. - */ -struct _ntfs_volume { - union { - struct ntfs_device *dev; /* NTFS device associated with - the volume. */ - void *sb; /* For kernel porting compatibility. */ - }; - char *vol_name; /* Name of the volume. */ - unsigned long state; /* NTFS specific flags describing this volume. - See ntfs_volume_state_bits above. */ - - ntfs_inode *vol_ni; /* ntfs_inode structure for FILE_Volume. */ - u8 major_ver; /* Ntfs major version of volume. */ - u8 minor_ver; /* Ntfs minor version of volume. */ - le16 flags; /* Bit array of VOLUME_* flags. */ - - u16 sector_size; /* Byte size of a sector. */ - u8 sector_size_bits; /* Log(2) of the byte size of a sector. */ - u32 cluster_size; /* Byte size of a cluster. */ - u32 mft_record_size; /* Byte size of a mft record. */ - u32 indx_record_size; /* Byte size of a INDX record. */ - u8 cluster_size_bits; /* Log(2) of the byte size of a cluster. */ - u8 mft_record_size_bits;/* Log(2) of the byte size of a mft record. */ - u8 indx_record_size_bits;/* Log(2) of the byte size of a INDX record. */ - - /* Variables used by the cluster and mft allocators. */ - u8 mft_zone_multiplier; /* Initial mft zone multiplier. */ - u8 full_zones; /* cluster zones which are full */ - s64 mft_data_pos; /* Mft record number at which to allocate the - next mft record. */ - LCN mft_zone_start; /* First cluster of the mft zone. */ - LCN mft_zone_end; /* First cluster beyond the mft zone. */ - LCN mft_zone_pos; /* Current position in the mft zone. */ - LCN data1_zone_pos; /* Current position in the first data zone. */ - LCN data2_zone_pos; /* Current position in the second data zone. */ - - s64 nr_clusters; /* Volume size in clusters, hence also the - number of bits in lcn_bitmap. */ - ntfs_inode *lcnbmp_ni; /* ntfs_inode structure for FILE_Bitmap. */ - ntfs_attr *lcnbmp_na; /* ntfs_attr structure for the data attribute - of FILE_Bitmap. Each bit represents a - cluster on the volume, bit 0 representing - lcn 0 and so on. A set bit means that the - cluster and vice versa. */ - - LCN mft_lcn; /* Logical cluster number of the data attribute - for FILE_MFT. */ - ntfs_inode *mft_ni; /* ntfs_inode structure for FILE_MFT. */ - ntfs_attr *mft_na; /* ntfs_attr structure for the data attribute - of FILE_MFT. */ - ntfs_attr *mftbmp_na; /* ntfs_attr structure for the bitmap attribute - of FILE_MFT. Each bit represents an mft - record in the $DATA attribute, bit 0 - representing mft record 0 and so on. A set - bit means that the mft record is in use and - vice versa. */ - - ntfs_inode *secure_ni; /* ntfs_inode structure for FILE $Secure */ - ntfs_index_context *secure_xsii; /* index for using $Secure:$SII */ - ntfs_index_context *secure_xsdh; /* index for using $Secure:$SDH */ - int secure_reentry; /* check for non-rentries */ - unsigned int secure_flags; /* flags, see security.h for values */ - - int mftmirr_size; /* Size of the FILE_MFTMirr in mft records. */ - LCN mftmirr_lcn; /* Logical cluster number of the data attribute - for FILE_MFTMirr. */ - ntfs_inode *mftmirr_ni; /* ntfs_inode structure for FILE_MFTMirr. */ - ntfs_attr *mftmirr_na; /* ntfs_attr structure for the data attribute - of FILE_MFTMirr. */ - - ntfschar *upcase; /* Upper case equivalents of all 65536 2-byte - Unicode characters. Obtained from - FILE_UpCase. */ - u32 upcase_len; /* Length in Unicode characters of the upcase - table. */ - ntfschar *locase; /* Lower case equivalents of all 65536 2-byte - Unicode characters. Only if option - case_ignore is set. */ - - ATTR_DEF *attrdef; /* Attribute definitions. Obtained from - FILE_AttrDef. */ - s32 attrdef_len; /* Size of the attribute definition table in - bytes. */ - - s64 free_clusters; /* Track the number of free clusters which - greatly improves statfs() performance */ - s64 free_mft_records; /* Same for free mft records (see above) */ - BOOL efs_raw; /* volume is mounted for raw access to - efs-encrypted files */ - -#if CACHE_INODE_SIZE - struct CACHE_HEADER *xinode_cache; -#endif -#if CACHE_NIDATA_SIZE - struct CACHE_HEADER *nidata_cache; -#endif -#if CACHE_LOOKUP_SIZE - struct CACHE_HEADER *lookup_cache; -#endif -#if CACHE_SECURID_SIZE - struct CACHE_HEADER *securid_cache; -#endif -#if CACHE_LEGACY_SIZE - struct CACHE_HEADER *legacy_cache; -#endif - -}; - -extern const char *ntfs_home; - -extern ntfs_volume *ntfs_volume_alloc(void); - -extern ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, - unsigned long flags); - -extern ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, - unsigned long flags); - -extern ntfs_volume *ntfs_mount(const char *name, unsigned long flags); -extern int ntfs_umount(ntfs_volume *vol, const BOOL force); - -extern int ntfs_version_is_supported(ntfs_volume *vol); -extern int ntfs_volume_check_hiberfile(ntfs_volume *vol, int verbose); -extern int ntfs_logfile_reset(ntfs_volume *vol); - -extern int ntfs_volume_write_flags(ntfs_volume *vol, const le16 flags); - -extern int ntfs_volume_error(int err); -extern void ntfs_mount_error(const char *vol, const char *mntpoint, int err); - -extern int ntfs_volume_get_free_space(ntfs_volume *vol); - -extern int ntfs_set_shown_files(ntfs_volume *vol, - BOOL show_sys_files, BOOL show_hid_files, BOOL hide_dot_files); -extern int ntfs_set_locale(void); -extern int ntfs_set_ignore_case(ntfs_volume *vol); - -#endif /* defined _NTFS_VOLUME_H */ - diff --git a/source/libwiigui/OptionList.cpp b/source/libwiigui/OptionList.cpp index d9362983..0afaece1 100644 --- a/source/libwiigui/OptionList.cpp +++ b/source/libwiigui/OptionList.cpp @@ -112,6 +112,7 @@ void OptionList::Resize(int size) { name.resize(size); value.resize(size); + listChanged = true; } void OptionList::RemoveOption(int i) @@ -121,6 +122,7 @@ void OptionList::RemoveOption(int i) name.erase(name.begin()+i); value.erase(value.begin()+i); + listChanged = true; } void OptionList::ClearList() @@ -129,4 +131,5 @@ void OptionList::ClearList() value.clear(); std::vector().swap(name); std::vector().swap(value); + listChanged = true; } diff --git a/source/libwiigui/gui_customoptionbrowser.cpp b/source/libwiigui/gui_customoptionbrowser.cpp index e228fa2b..331bca49 100644 --- a/source/libwiigui/gui_customoptionbrowser.cpp +++ b/source/libwiigui/gui_customoptionbrowser.cpp @@ -105,17 +105,17 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, OptionList * l, con for (int i = 0; i < PAGESIZE; i++) { - optionTxt[i] = new GuiText((wchar_t *) NULL, 20, Theme.settingstext); + optionTxt[i] = new GuiText((wchar_t *) NULL, 20, thColor("r=0 g=0 b=0 a=255 - settings text color")); optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); optionTxt[i]->SetPosition(24, 0); optionTxt[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2 + 24), DOTTED); optionBg[i] = new GuiImage(bgOptionsEntry); - optionVal[i] = new GuiText((wchar_t *) NULL, 20, Theme.settingstext); + optionVal[i] = new GuiText((wchar_t *) NULL, 20, thColor("r=0 g=0 b=0 a=255 - settings text color")); optionVal[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); - optionValOver[i] = new GuiText((wchar_t *) NULL, 20, Theme.settingstext); + optionValOver[i] = new GuiText((wchar_t *) NULL, 20, thColor("r=0 g=0 b=0 a=255 - settings text color")); optionValOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); optionBtn[i] = new GuiButton(width - 28, GAMESELECTSIZE); diff --git a/source/libwiigui/gui_gamebrowser.cpp b/source/libwiigui/gui_gamebrowser.cpp index b8cb48cd..95112b71 100644 --- a/source/libwiigui/gui_gamebrowser.cpp +++ b/source/libwiigui/gui_gamebrowser.cpp @@ -31,7 +31,7 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, int selectedGame) { width = w; height = h; - pagesize = Theme.pagesize; + pagesize = thInt("9 - game list browser page size"); scrollbaron = (gameList.size() > pagesize) ? 1 : 0; selectable = true; listOffset = selectedGame - (selectedGame % pagesize); @@ -121,12 +121,12 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, int selectedGame) for (int i = 0; i < pagesize; i++) { - gameTxt[i] = new GuiText(GameTitles.GetTitle(gameList[i]), 20, Theme.gametext); + gameTxt[i] = new GuiText(GameTitles.GetTitle(gameList[i]), 20, thColor("r=0 g=0 b=0 a=255 - game browser list text color")); gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); gameTxt[i]->SetPosition(24, 0); gameTxt[i]->SetMaxWidth(maxTextWidth, DOTTED); - gameTxtOver[i] = new GuiText(GameTitles.GetTitle(gameList[i]), 20, Theme.gametext); + gameTxtOver[i] = new GuiText(GameTitles.GetTitle(gameList[i]), 20, thColor("r=0 g=0 b=0 a=255 - game browser list text color over")); gameTxtOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); gameTxtOver[i]->SetPosition(24, 0); gameTxtOver[i]->SetMaxWidth(maxTextWidth, SCROLL_HORIZONTAL); diff --git a/source/libwiigui/gui_gamecarousel.cpp b/source/libwiigui/gui_gamecarousel.cpp index b2435b32..1ab4f42b 100644 --- a/source/libwiigui/gui_gamecarousel.cpp +++ b/source/libwiigui/gui_gamecarousel.cpp @@ -102,7 +102,7 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, const char *themePath, const u8 * btnRight->SetTrigger(trigPlus); btnRight->SetEffectGrow(); - gamename = new GuiText(" ", 18, Theme.info); + gamename = new GuiText(" ", 18, thColor("r=55 g=190 b=237 a=255 - carousel game name text color")); gamename->SetParent(this); gamename->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); gamename->SetPosition(0, 330); diff --git a/source/libwiigui/gui_gamegrid.cpp b/source/libwiigui/gui_gamegrid.cpp index ad31688f..73793830 100644 --- a/source/libwiigui/gui_gamegrid.cpp +++ b/source/libwiigui/gui_gamegrid.cpp @@ -207,6 +207,8 @@ GuiGameGrid::GuiGameGrid(int w, int h, const char *themePath, const u8 *imagebg, { width = w; height = h; + theme_posX = thInt("0 - game grid layout pos x"); + theme_posY = thInt("20 - game grid layout pos y"); selectable = true; focus = 1; // allow focus @@ -385,8 +387,8 @@ void GuiGameGrid::Draw() for (int i = 0; i < pagesize - rows; i++) { - game[i]->SetPosition(Pos[i][wsi][0] * f1 + Pos[i + rows][wsi][0] * f2 + Theme.gamegrid_x, Pos[i][wsi][1] - * f1 + Pos[i + rows][wsi][1] * f2 + Theme.gamegrid_y); + game[i]->SetPosition(Pos[i][wsi][0] * f1 + Pos[i + rows][wsi][0] * f2 + theme_posX, Pos[i][wsi][1] + * f1 + Pos[i + rows][wsi][1] * f2 + theme_posY); game[i]->SetSkew(Skew[i][0] * f1 + Skew[i + rows][0] * f2, Skew[i][1] * f1 + Skew[i + rows][1] * f2, Skew[i][2] * f1 + Skew[i + rows][2] * f2, Skew[i][3] * f1 + Skew[i + rows][3] * f2, Skew[i][4] * f1 @@ -404,8 +406,8 @@ void GuiGameGrid::Draw() int (*Skew)[8] = VALUE4ROWS( rows, Skew1, Skew2, Skew3 ); for (int i = rows; i < pagesize; i++) { - game[i]->SetPosition(Pos[i][wsi][0] * f1 + Pos[i - rows][wsi][0] * f2 + Theme.gamegrid_x, Pos[i][wsi][1] - * f1 + Pos[i - rows][wsi][1] * f2 + Theme.gamegrid_y); + game[i]->SetPosition(Pos[i][wsi][0] * f1 + Pos[i - rows][wsi][0] * f2 + theme_posX, Pos[i][wsi][1] + * f1 + Pos[i - rows][wsi][1] * f2 + theme_posY); game[i]->SetSkew(Skew[i][0] * f1 + Skew[i - rows][0] * f2, Skew[i][1] * f1 + Skew[i - rows][1] * f2, Skew[i][2] * f1 + Skew[i - rows][2] * f2, Skew[i][3] * f1 + Skew[i - rows][3] * f2, Skew[i][4] * f1 @@ -762,8 +764,9 @@ void GuiGameGrid::Reload(int Rows, int ListOffset) // Tooltip //------------------------ if (gameIndex[i] != -1) - titleTT[i] = new GuiTooltip(GameTitles.GetTitle(gameList[gameIndex[i]]), Theme.tooltipAlpha); - else titleTT[i] = new GuiTooltip(NULL, Theme.tooltipAlpha); + titleTT[i] = new GuiTooltip(GameTitles.GetTitle(gameList[gameIndex[i]]), thInt("255 - tooltip alpha")); + else + titleTT[i] = new GuiTooltip(NULL, thInt("255 - tooltip alpha")); //------------------------ // ImageData @@ -797,7 +800,7 @@ void GuiGameGrid::Reload(int Rows, int ListOffset) game[i]->SetParent(this); game[i]->SetImage(coverImg[i]); game[i]->SetAlignment(ALIGN_TOP, ALIGN_LEFT); - game[i]->SetPosition(Pos[i][wsi][0] + Theme.gamegrid_x, Pos[i][wsi][1] + Theme.gamegrid_y); + game[i]->SetPosition(Pos[i][wsi][0] + theme_posX, Pos[i][wsi][1] + theme_posY); game[i]->SetSkew(&Skew[i][0]); game[i]->SetTrigger(trigA); game[i]->SetSoundOver(btnSoundOver); diff --git a/source/libwiigui/gui_gamegrid.h b/source/libwiigui/gui_gamegrid.h index c6ea4d99..092233d8 100644 --- a/source/libwiigui/gui_gamegrid.h +++ b/source/libwiigui/gui_gamegrid.h @@ -30,6 +30,8 @@ class GuiGameGrid: public GuiElement int rows; int goLeft; int goRight; + int theme_posX; + int theme_posY; int * gameIndex; std::vector game; diff --git a/source/main.cpp b/source/main.cpp index 6cf53549..830780cf 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) printf("\tLoading language...%s\n", Settings.LoadLanguage(Settings.language_path, CONSOLE_DEFAULT) ? "done" : "failed"); printf("\tLoading game settings...%s\n", GameSettings.Load(Settings.ConfigPath) ? "done" : "failed"); printf("\tLoading game statistics...%s\n", GameStatistics.Load(Settings.ConfigPath) ? "done" : "failed"); - printf("\tLoading theme...%s\n", Theme.Load(Settings.theme_path) ? "done" : "failed (using default)"); + printf("\tLoading theme...%s\n", Theme::Load(Settings.theme_path) ? "done" : "failed (using default)"); printf("\tLoading font system...%s\n", SetupDefaultFont(Settings.theme_path) ? "done" : "failed (using default)"); VIDEO_SetWidescreen(Settings.widescreen); diff --git a/source/menu.cpp b/source/menu.cpp index 1557187e..ae22fe5c 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -114,7 +114,7 @@ static void * UpdateGUI(void *arg) } mainWindow->Draw(); - if (Settings.tooltips == ON && Theme.show_tooltip != 0 && mainWindow->GetState() != STATE_DISABLED) mainWindow->DrawTooltip(); + if (Settings.tooltips == ON && Theme::ShowTooltips && mainWindow->GetState() != STATE_DISABLED) mainWindow->DrawTooltip(); for (i = 3; i >= 0; i--) { diff --git a/source/menu/GameBrowseMenu.cpp b/source/menu/GameBrowseMenu.cpp index e1bcbd49..0e8de255 100644 --- a/source/menu/GameBrowseMenu.cpp +++ b/source/menu/GameBrowseMenu.cpp @@ -123,70 +123,75 @@ GameBrowseMenu::GameBrowseMenu() sprintf(spaceinfo, "%.2fGB %s %.2fGB %s", freespace, tr( "of" ), (freespace + used), tr( "free" )); } } - usedSpaceTxt = new GuiText(spaceinfo, 18, Theme.info); - usedSpaceTxt->SetAlignment(Theme.hddinfo_align, ALIGN_TOP); - usedSpaceTxt->SetPosition(Theme.hddinfo_x, Theme.hddinfo_y); + usedSpaceTxt = new GuiText(spaceinfo, 18, thColor("r=55 g=190 b=237 a=255 - hdd info color")); + usedSpaceTxt->SetAlignment(thAlign("center - hdd info align ver"), thAlign("top - hdd info align hor")); + usedSpaceTxt->SetPosition(thInt("0 - hdd info pos x"), thInt("400 - hdd info pos y")); - gamecntTxt = new GuiText((char *) NULL, 18, Theme.info); + gamecntTxt = new GuiText((char *) NULL, 18, thColor("r=55 g=190 b=237 a=255 - game count color")); gamecntBtn = new GuiButton(100, 18); - gamecntBtn->SetAlignment(Theme.gamecount_align, ALIGN_TOP); - gamecntBtn->SetPosition(Theme.gamecount_x, Theme.gamecount_y); + gamecntBtn->SetAlignment(thAlign("center - game count align ver"), thAlign("top - game count align hor")); + gamecntBtn->SetPosition(thInt("0 - game count pos x"), thInt("420 - game count pos y")); gamecntBtn->SetLabel(gamecntTxt); gamecntBtn->SetEffectGrow(); gamecntBtn->SetTrigger(trigA); installBtnTT = new GuiTooltip(tr( "Install a game" )); if (Settings.wsprompt) installBtnTT->SetWidescreen(Settings.widescreen); - installBtnTT->SetAlpha(Theme.tooltipAlpha); + installBtnTT->SetAlpha(thInt("255 - tooltip alpha")); installBtnImg = new GuiImage(btnInstall); installBtnImgOver = new GuiImage(btnInstallOver); installBtnImg->SetWidescreen(Settings.widescreen); installBtnImgOver->SetWidescreen(Settings.widescreen); - installBtn = new GuiButton(installBtnImg, installBtnImgOver, ALIGN_LEFT, ALIGN_TOP, Theme.install_x, Theme.install_y, + installBtn = new GuiButton(installBtnImg, installBtnImgOver, ALIGN_LEFT, ALIGN_TOP, + thInt("16 - install btn pos x"), thInt("355 - install btn pos y"), trigA, btnSoundOver, btnSoundClick2, 1, installBtnTT, 24, -30, 0, 5); settingsBtnTT = new GuiTooltip(tr( "Settings" )); if (Settings.wsprompt) settingsBtnTT->SetWidescreen(Settings.widescreen); - settingsBtnTT->SetAlpha(Theme.tooltipAlpha); + settingsBtnTT->SetAlpha(thInt("255 - tooltip alpha")); settingsBtnImg = new GuiImage(btnSettings); settingsBtnImg->SetWidescreen(Settings.widescreen); settingsBtnImgOver = new GuiImage(btnSettingsOver); settingsBtnImgOver->SetWidescreen(Settings.widescreen); - settingsBtn = new GuiButton(settingsBtnImg, settingsBtnImgOver, 0, 3, Theme.setting_x, Theme.setting_y, trigA, - btnSoundOver, btnSoundClick2, 1, settingsBtnTT, 65, -30, 0, 5); + settingsBtn = new GuiButton(settingsBtnImg, settingsBtnImgOver, 0, 3, + thInt("64 - settings btn pos x"), thInt("371 - settings btn pos y"), + trigA, btnSoundOver, btnSoundClick2, 1, settingsBtnTT, 65, -30, 0, 5); homeBtnTT = new GuiTooltip(tr( "Back to HBC or Wii Menu" )); if (Settings.wsprompt) homeBtnTT->SetWidescreen(Settings.widescreen); - settingsBtnTT->SetAlpha(Theme.tooltipAlpha); + settingsBtnTT->SetAlpha(thInt("255 - tooltip alpha")); homeBtnImg = new GuiImage(btnhome); homeBtnImg->SetWidescreen(Settings.widescreen); homeBtnImgOver = new GuiImage(btnhomeOver); homeBtnImgOver->SetWidescreen(Settings.widescreen); - homeBtn = new GuiButton(homeBtnImg, homeBtnImgOver, 0, 3, Theme.home_x, Theme.home_y, trigA, btnSoundOver, btnSoundClick2, - 1, homeBtnTT, 15, -30, 1, 5); + homeBtn = new GuiButton(homeBtnImg, homeBtnImgOver, 0, 3, + thInt("489 - home menu btn pos x"), thInt("371 - home menu btn pos x"), + trigA, btnSoundOver, btnSoundClick2, 1, homeBtnTT, 15, -30, 1, 5); homeBtn->RemoveSoundClick(); homeBtn->SetTrigger(trigHome); poweroffBtnTT = new GuiTooltip(tr( "Power off the Wii" )); if (Settings.wsprompt) poweroffBtnTT->SetWidescreen(Settings.widescreen); - poweroffBtnTT->SetAlpha(Theme.tooltipAlpha); + poweroffBtnTT->SetAlpha(thInt("255 - tooltip alpha")); poweroffBtnImg = new GuiImage(btnpwroff); poweroffBtnImgOver = new GuiImage(btnpwroffOver); poweroffBtnImg->SetWidescreen(Settings.widescreen); poweroffBtnImgOver->SetWidescreen(Settings.widescreen); - poweroffBtn = new GuiButton(poweroffBtnImg, poweroffBtnImgOver, 0, 3, Theme.power_x, Theme.power_y, trigA, - btnSoundOver, btnSoundClick2, 1, poweroffBtnTT, -10, -30, 1, 5); + poweroffBtn = new GuiButton(poweroffBtnImg, poweroffBtnImgOver, 0, 3, + thInt("576 - power off btn pos x"), thInt("355 - power off btn pos y"), + trigA, btnSoundOver, btnSoundClick2, 1, poweroffBtnTT, -10, -30, 1, 5); sdcardBtnTT = new GuiTooltip(tr( "Reload SD" )); if (Settings.wsprompt) sdcardBtnTT->SetWidescreen(Settings.widescreen); - sdcardBtnTT->SetAlpha(Theme.tooltipAlpha); + sdcardBtnTT->SetAlpha(thInt("255 - tooltip alpha")); sdcardImg = new GuiImage(btnsdcard); sdcardImgOver = new GuiImage(btnsdcardOver); sdcardImg->SetWidescreen(Settings.widescreen); sdcardImgOver->SetWidescreen(Settings.widescreen); - sdcardBtn = new GuiButton(sdcardImg, sdcardImgOver, 0, 3, Theme.sdcard_x, Theme.sdcard_y, trigA, btnSoundOver, - btnSoundClick2, 1, sdcardBtnTT, 15, -30, 0, 5); + sdcardBtn = new GuiButton(sdcardImg, sdcardImgOver, 0, 3, + thInt("160 - sd card btn pos x"), thInt("395 - sd card btn pos y"), + trigA, btnSoundOver, btnSoundClick2, 1, sdcardBtnTT, 15, -30, 0, 5); gameInfo = new GuiButton(0, 0); gameInfo->SetTrigger(trig2); @@ -194,71 +199,69 @@ GameBrowseMenu::GameBrowseMenu() favoriteBtnTT = new GuiTooltip(tr( "Display favorites only" )); if (Settings.wsprompt) favoriteBtnTT->SetWidescreen(Settings.widescreen); - favoriteBtnTT->SetAlpha(Theme.tooltipAlpha); + favoriteBtnTT->SetAlpha(thInt("255 - tooltip alpha")); favoriteBtnImg = new GuiImage(imgfavIcon); favoriteBtnImg->SetWidescreen(Settings.widescreen); favoriteBtnImg_g = new GuiImage(imgfavIcon_gray); favoriteBtnImg_g->SetWidescreen(Settings.widescreen); - favoriteBtn = new GuiButton(favoriteBtnImg_g, favoriteBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_favorite_x, - Theme.gamelist_favorite_y, trigA, btnSoundOver, btnSoundClick2, 1, favoriteBtnTT, -15, 52, 0, 3); + favoriteBtn = new GuiButton(favoriteBtnImg_g, favoriteBtnImg_g, ALIGN_LEFT, ALIGN_TOP, + 0, 0, + trigA, btnSoundOver, btnSoundClick2, 1, favoriteBtnTT, -15, 52, 0, 3); searchBtnTT = new GuiTooltip(tr( "Set Search-Filter" )); if (Settings.wsprompt) searchBtnTT->SetWidescreen(Settings.widescreen); - searchBtnTT->SetAlpha(Theme.tooltipAlpha); + searchBtnTT->SetAlpha(thInt("255 - tooltip alpha")); searchBtnImg = new GuiImage(imgsearchIcon); searchBtnImg->SetWidescreen(Settings.widescreen); searchBtnImg_g = new GuiImage(imgsearchIcon_gray); searchBtnImg_g->SetWidescreen(Settings.widescreen); - searchBtn = new GuiButton(searchBtnImg_g, searchBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_search_x, - Theme.gamelist_search_y, trigA, btnSoundOver, btnSoundClick2, 1, searchBtnTT, -15, 52, 0, 3); + searchBtn = new GuiButton(searchBtnImg_g, searchBtnImg_g, ALIGN_LEFT, ALIGN_TOP, + 0, 0, + trigA, btnSoundOver, btnSoundClick2, 1, searchBtnTT, -15, 52, 0, 3); sortBtnTT = new GuiTooltip(" "); if (Settings.wsprompt) sortBtnTT->SetWidescreen(Settings.widescreen); - sortBtnTT->SetAlpha(Theme.tooltipAlpha); + sortBtnTT->SetAlpha(thInt("255 - tooltip alpha")); sortBtnImg = new GuiImage(imgabcIcon); sortBtnImg->SetWidescreen(Settings.widescreen); - sortBtn = new GuiButton(sortBtnImg, sortBtnImg, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_abc_x, Theme.gamelist_abc_y, trigA, btnSoundOver, btnSoundClick2, 1, sortBtnTT, -15, 52, 0, 3); + sortBtn = new GuiButton(sortBtnImg, sortBtnImg, ALIGN_LEFT, ALIGN_TOP, 0, 0, trigA, btnSoundOver, btnSoundClick2, 1, sortBtnTT, -15, 52, 0, 3); listBtnTT = new GuiTooltip(tr( "Display as a list" )); if (Settings.wsprompt) listBtnTT->SetWidescreen(Settings.widescreen); - listBtnTT->SetAlpha(Theme.tooltipAlpha); + listBtnTT->SetAlpha(thInt("255 - tooltip alpha")); listBtnImg = new GuiImage(imgarrangeList); listBtnImg->SetWidescreen(Settings.widescreen); listBtnImg_g = new GuiImage(imgarrangeList_gray); listBtnImg_g->SetWidescreen(Settings.widescreen); - listBtn = new GuiButton(listBtnImg_g, listBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_list_x, - Theme.gamelist_list_y, trigA, btnSoundOver, btnSoundClick2, 1, listBtnTT, 15, 52, 1, 3); + listBtn = new GuiButton(listBtnImg_g, listBtnImg_g, ALIGN_LEFT, ALIGN_TOP, 0, 0, trigA, btnSoundOver, btnSoundClick2, 1, listBtnTT, 15, 52, 1, 3); gridBtnTT = new GuiTooltip(tr( "Display as a grid" )); if (Settings.wsprompt) gridBtnTT->SetWidescreen(Settings.widescreen); - gridBtnTT->SetAlpha(Theme.tooltipAlpha); + gridBtnTT->SetAlpha(thInt("255 - tooltip alpha")); gridBtnImg = new GuiImage(imgarrangeGrid); gridBtnImg->SetWidescreen(Settings.widescreen); gridBtnImg_g = new GuiImage(imgarrangeGrid_gray); gridBtnImg_g->SetWidescreen(Settings.widescreen); - gridBtn = new GuiButton(gridBtnImg_g, gridBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_grid_x, - Theme.gamelist_grid_y, trigA, btnSoundOver, btnSoundClick2, 1, gridBtnTT, 15, 52, 1, 3); + gridBtn = new GuiButton(gridBtnImg_g, gridBtnImg_g, ALIGN_LEFT, ALIGN_TOP, 0, 0, trigA, btnSoundOver, btnSoundClick2, 1, gridBtnTT, 15, 52, 1, 3); carouselBtnTT = new GuiTooltip(tr( "Display as a carousel" )); if (Settings.wsprompt) carouselBtnTT->SetWidescreen(Settings.widescreen); - carouselBtnTT->SetAlpha(Theme.tooltipAlpha); + carouselBtnTT->SetAlpha(thInt("255 - tooltip alpha")); carouselBtnImg = new GuiImage(imgarrangeCarousel); carouselBtnImg->SetWidescreen(Settings.widescreen); carouselBtnImg_g = new GuiImage(imgarrangeCarousel_gray); carouselBtnImg_g->SetWidescreen(Settings.widescreen); - carouselBtn = new GuiButton(carouselBtnImg_g, carouselBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_carousel_x, - Theme.gamelist_carousel_y, trigA, btnSoundOver, btnSoundClick2, 1, carouselBtnTT, 15, 52, 1, 3); + carouselBtn = new GuiButton(carouselBtnImg_g, carouselBtnImg_g, ALIGN_LEFT, ALIGN_TOP, 0, 0, trigA, btnSoundOver, btnSoundClick2, 1, carouselBtnTT, 15, 52, 1, 3); lockBtnTT = new GuiTooltip(NULL); if (Settings.wsprompt) lockBtnTT->SetWidescreen(Settings.widescreen); - lockBtnTT->SetAlpha(Theme.tooltipAlpha); + lockBtnTT->SetAlpha(thInt("255 - tooltip alpha")); lockBtnImg = new GuiImage(imgLock); lockBtnImg->SetWidescreen(Settings.widescreen); lockBtnImg_g = new GuiImage(imgLock_gray); lockBtnImg_g->SetWidescreen(Settings.widescreen); - lockBtn = new GuiButton(lockBtnImg_g, lockBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_lock_x, - Theme.gamelist_lock_y, trigA, btnSoundOver, btnSoundClick2, 1, lockBtnTT, 15, 52, 1, 3); + lockBtn = new GuiButton(lockBtnImg_g, lockBtnImg_g, ALIGN_LEFT, ALIGN_TOP, 0, 0, trigA, btnSoundOver, btnSoundClick2, 1, lockBtnTT, 15, 52, 1, 3); unlockBtnImg = new GuiImage(imgUnlock); unlockBtnImg->SetWidescreen(Settings.widescreen); @@ -267,46 +270,47 @@ GameBrowseMenu::GameBrowseMenu() dvdBtnTT = new GuiTooltip(tr( "Mount DVD drive" )); if (Settings.wsprompt) dvdBtnTT->SetWidescreen(Settings.widescreen); - dvdBtnTT->SetAlpha(Theme.tooltipAlpha); + dvdBtnTT->SetAlpha(thInt("255 - tooltip alpha")); dvdBtnImg = new GuiImage(imgdvd); dvdBtnImg->SetWidescreen(Settings.widescreen); dvdBtnImg_g = new GuiImage(imgdvd_gray); dvdBtnImg_g->SetWidescreen(Settings.widescreen); - dvdBtn = new GuiButton(dvdBtnImg_g, dvdBtnImg_g, ALIGN_LEFT, ALIGN_TOP, Theme.gamelist_dvd_x, Theme.gamelist_dvd_y, + dvdBtn = new GuiButton(dvdBtnImg_g, dvdBtnImg_g, ALIGN_LEFT, ALIGN_TOP, 0, 0, trigA, btnSoundOver, btnSoundClick2, 1, dvdBtnTT, 15, 52, 1, 3); homebrewBtnTT = new GuiTooltip(tr( "Homebrew Launcher" )); if (Settings.wsprompt) homebrewBtnTT->SetWidescreen(Settings.widescreen); - homebrewBtnTT->SetAlpha(Theme.tooltipAlpha); + homebrewBtnTT->SetAlpha(thInt("255 - tooltip alpha")); homebrewImg = new GuiImage(homebrewImgData); homebrewImgOver = new GuiImage(homebrewImgDataOver); homebrewImg->SetWidescreen(Settings.widescreen); homebrewImgOver->SetWidescreen(Settings.widescreen); - homebrewBtn = new GuiButton(homebrewImg, homebrewImgOver, ALIGN_LEFT, ALIGN_TOP, Theme.homebrew_x, Theme.homebrew_y, + homebrewBtn = new GuiButton(homebrewImg, homebrewImgOver, ALIGN_LEFT, ALIGN_TOP, thInt("410 - HBC btn pos x"), thInt("405 - HBC btn pos y"), trigA, btnSoundOver, btnSoundClick2, 1, homebrewBtnTT, 15, -30, 1, 5); //Downloading Covers DownloadBtnTT = new GuiTooltip(tr( "Click to Download Covers" )); if (Settings.wsprompt) DownloadBtnTT->SetWidescreen(Settings.widescreen); - DownloadBtnTT->SetAlpha(Theme.tooltipAlpha); + DownloadBtnTT->SetAlpha(thInt("255 - tooltip alpha")); DownloadBtn = new GuiButton (0, 0); DownloadBtn->SetAlignment(ALIGN_LEFT, ALIGN_TOP); - DownloadBtn->SetPosition(Theme.covers_x, Theme.covers_y); + DownloadBtn->SetPosition(thInt("26 - cover/download btn pos x"), thInt("58 - cover/download btn pos y")); IDBtnTT = new GuiTooltip(tr( "Click to change game ID" )); if (Settings.wsprompt) IDBtnTT->SetWidescreen(Settings.widescreen); - IDBtnTT->SetAlpha(Theme.tooltipAlpha); + IDBtnTT->SetAlpha(thInt("255 - tooltip alpha")); idBtn = new GuiButton(60, 23); idBtn->SetAlignment(ALIGN_LEFT, ALIGN_TOP); - idBtn->SetPosition(Theme.id_x, Theme.id_y); + idBtn->SetPosition(thInt("68 - gameID btn pos x"), thInt("305 - gameID btn pos y")); - clockTimeBack = new GuiText("88:88", 40, (GXColor) {Theme.clock.r, Theme.clock.g, Theme.clock.b, Theme.clock.a / 6}); - clockTimeBack->SetAlignment(Theme.clock_align, ALIGN_TOP); - clockTimeBack->SetPosition(Theme.clock_x, Theme.clock_y); + GXColor clockColor = thColor("r=138 g=138 b=138 a=240 - clock color"); + clockTimeBack = new GuiText("88:88", 40, (GXColor) {clockColor.r, clockColor.g, clockColor.b, clockColor.a / 6}); + clockTimeBack->SetAlignment(thAlign("left - clock align ver"), thAlign("top - clock align hor")); + clockTimeBack->SetPosition(thInt("275 - clock pos x"), thInt("275 - clock pos y")); clockTimeBack->SetFont(clock_ttf, clock_ttf_size); - clockTime = new GuiText("", 40, Theme.clock); - clockTime->SetAlignment(Theme.clock_align, ALIGN_TOP); - clockTime->SetPosition(Theme.clock_x, Theme.clock_y); + clockTime = new GuiText("", 40, clockColor); + clockTime->SetAlignment(thAlign("left - clock align ver"), thAlign("top - clock align hor")); + clockTime->SetPosition(thInt("275 - clock pos x"), thInt("275 - clock pos y")); clockTime->SetFont(clock_ttf, clock_ttf_size); ToolBar.push_back(favoriteBtn); @@ -580,17 +584,25 @@ void GameBrowseMenu::ReloadBrowser() carouselBtn->SetImage(carouselBtnImg_g); carouselBtn->SetImageOver(carouselBtnImg_g); - favoriteBtn->SetPosition(Theme.gamelist_favorite_x, Theme.gamelist_favorite_y); - searchBtn->SetPosition(Theme.gamelist_search_x, Theme.gamelist_search_y); - sortBtn->SetPosition(Theme.gamelist_abc_x, Theme.gamelist_abc_y); - listBtn->SetPosition(Theme.gamelist_list_x, Theme.gamelist_list_y); - gridBtn->SetPosition(Theme.gamelist_grid_x, Theme.gamelist_grid_y); - carouselBtn->SetPosition(Theme.gamelist_carousel_x, Theme.gamelist_carousel_y); - lockBtn->SetPosition(Theme.gamelist_lock_x, Theme.gamelist_lock_y); - dvdBtn->SetPosition(Theme.gamelist_dvd_x, Theme.gamelist_dvd_y); + favoriteBtn->SetPosition(Settings.widescreen ? thInt("288 - list layout favorite btn pos x widescreen") : thInt("260 - list layout favorite btn pos x"), + thInt("13 - list layout favorite btn pos y")); + searchBtn->SetPosition(Settings.widescreen ? thInt("320 - list layout search btn pos x widescreen") : thInt("300 - list layout search btn pos x"), + thInt("13 - list layout search btn pos x")); + sortBtn->SetPosition(Settings.widescreen ? thInt("352 - list layout abc/sort btn pos x widescreen") : thInt("340 - list layout abc/sort btn pos x"), + thInt("13 - list layout abc/sort btn pos y")); + listBtn->SetPosition(Settings.widescreen ? thInt("384 - list layout list btn pos x widescreen") : thInt("380 - list layout list btn pos x"), + thInt("13 - list layout list btn pos y")); + gridBtn->SetPosition(Settings.widescreen ? thInt("416 - list layout grid btn pos x widescreen") : thInt("420 - list layout grid btn pos x"), + thInt("13 - list layout grid btn pos y")); + carouselBtn->SetPosition(Settings.widescreen ? thInt("448 - list layout carousel btn pos x widescreen") : thInt("460 - list layout carousel btn pos x"), + thInt("13 - list layout carousel btn pos y")); + lockBtn->SetPosition(Settings.widescreen ? thInt("480 - list layout lock btn pos x widescreen") : thInt("500 - list layout lock btn pos x"), + thInt("13 - list layout lock btn pos y")); + dvdBtn->SetPosition(Settings.widescreen ? thInt("512 - list layout dvd btn pos x widescreen") : thInt("540 - list layout dvd btn pos x"), + thInt("13 - list layout dvd btn pos y")); - gameBrowser = new GuiGameBrowser(Theme.gamelist_w, Theme.gamelist_h, lastSelectedGame); - gameBrowser->SetPosition(Theme.gamelist_x, Theme.gamelist_y); + gameBrowser = new GuiGameBrowser(thInt("396 - game list layout width"), thInt("280 - game list layout height"), lastSelectedGame); + gameBrowser->SetPosition(thInt("200 - game list layout pos x"), thInt("49 - game list layout pos y")); gameBrowser->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE); } else if (Settings.gameDisplay == GRID_MODE) @@ -605,17 +617,25 @@ void GameBrowseMenu::ReloadBrowser() carouselBtn->SetImage(carouselBtnImg_g); carouselBtn->SetImageOver(carouselBtnImg_g); - favoriteBtn->SetPosition(Theme.gamegrid_favorite_x, Theme.gamegrid_favorite_y); - searchBtn->SetPosition(Theme.gamegrid_search_x, Theme.gamegrid_search_y); - sortBtn->SetPosition(Theme.gamegrid_abc_x, Theme.gamegrid_abc_y); - listBtn->SetPosition(Theme.gamegrid_list_x, Theme.gamegrid_list_y); - gridBtn->SetPosition(Theme.gamegrid_grid_x, Theme.gamegrid_grid_y); - carouselBtn->SetPosition(Theme.gamegrid_carousel_x, Theme.gamegrid_carousel_y); - lockBtn->SetPosition(Theme.gamegrid_lock_x, Theme.gamegrid_lock_y); - dvdBtn->SetPosition(Theme.gamegrid_dvd_x, Theme.gamegrid_dvd_y); + favoriteBtn->SetPosition(Settings.widescreen ? thInt("224 - grid layout favorite btn pos x widescreen") : thInt("200 - grid layout favorite btn pos x"), + thInt("13 - grid layout favorite btn pos y")); + searchBtn->SetPosition(Settings.widescreen ? thInt("256 - grid layout search btn pos x widescreen") : thInt("240 - grid layout search btn pos x"), + thInt("13 - grid layout search btn pos x")); + sortBtn->SetPosition(Settings.widescreen ? thInt("288 - grid layout abc/sort btn pos x widescreen") : thInt("280 - grid layout abc/sort btn pos x"), + thInt("13 - grid layout abc/sort btn pos y")); + listBtn->SetPosition(Settings.widescreen ? thInt("320 - grid layout list btn pos x widescreen") : thInt("320 - grid layout list btn pos x"), + thInt("13 - grid layout list btn pos y")); + gridBtn->SetPosition(Settings.widescreen ? thInt("352 - grid layout grid btn pos x widescreen") : thInt("360 - grid layout grid btn pos x"), + thInt("13 - grid layout grid btn pos y")); + carouselBtn->SetPosition(Settings.widescreen ? thInt("384 - grid layout carousel btn pos x widescreen") : thInt("400 - grid layout carousel btn pos x"), + thInt("13 - grid layout carousel btn pos y")); + lockBtn->SetPosition(Settings.widescreen ? thInt("416 - grid layout lock btn pos x widescreen") : thInt("440 - grid layout lock btn pos x"), + thInt("13 - grid layout lock btn pos y")); + dvdBtn->SetPosition(Settings.widescreen ? thInt("448 - grid layout dvd btn pos x widescreen") : thInt("480 - grid layout dvd btn pos x"), + thInt("13 - grid layout dvd btn pos y")); - gameGrid = new GuiGameGrid(Theme.gamegrid_w, Theme.gamegrid_h, Settings.theme_path, bg_options_png, lastSelectedGame); - gameGrid->SetPosition(Theme.gamegrid_x, Theme.gamegrid_y); + gameGrid = new GuiGameGrid(thInt("640 - game grid layout width"), thInt("400 - game grid layout height"), Settings.theme_path, bg_options_png, lastSelectedGame); + gameGrid->SetPosition(thInt("0 - game grid layout pos x"), thInt("20 - game grid layout pos y")); gameGrid->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE); } else if (Settings.gameDisplay == CAROUSEL_MODE) @@ -630,24 +650,32 @@ void GameBrowseMenu::ReloadBrowser() gridBtn->SetImage(gridBtnImg_g); gridBtn->SetImageOver(gridBtnImg_g); - favoriteBtn->SetPosition(Theme.gamecarousel_favorite_x, Theme.gamecarousel_favorite_y); - searchBtn->SetPosition(Theme.gamecarousel_search_x, Theme.gamecarousel_favorite_y); - sortBtn->SetPosition(Theme.gamecarousel_abc_x, Theme.gamecarousel_abc_y); - listBtn->SetPosition(Theme.gamecarousel_list_x, Theme.gamecarousel_list_y); - gridBtn->SetPosition(Theme.gamecarousel_grid_x, Theme.gamecarousel_grid_y); - carouselBtn->SetPosition(Theme.gamecarousel_carousel_x, Theme.gamecarousel_carousel_y); - lockBtn->SetPosition(Theme.gamecarousel_lock_x, Theme.gamecarousel_lock_y); - dvdBtn->SetPosition(Theme.gamecarousel_dvd_x, Theme.gamecarousel_dvd_y); + favoriteBtn->SetPosition(Settings.widescreen ? thInt("224 - carousel layout favorite btn pos x widescreen") : thInt("200 - carousel layout favorite btn pos x"), + thInt("13 - carousel layout favorite btn pos y")); + searchBtn->SetPosition(Settings.widescreen ? thInt("256 - carousel layout search btn pos x widescreen") : thInt("240 - carousel layout search btn pos x"), + thInt("13 - carousel layout search btn pos x")); + sortBtn->SetPosition(Settings.widescreen ? thInt("288 - carousel layout abc/sort btn pos x widescreen") : thInt("280 - carousel layout abc/sort btn pos x"), + thInt("13 - carousel layout abc/sort btn pos y")); + listBtn->SetPosition(Settings.widescreen ? thInt("320 - carousel layout list btn pos x widescreen") : thInt("320 - carousel layout list btn pos x"), + thInt("13 - carousel layout list btn pos y")); + gridBtn->SetPosition(Settings.widescreen ? thInt("352 - carousel layout grid btn pos x widescreen") : thInt("360 - carousel layout grid btn pos x"), + thInt("13 - carousel layout grid btn pos y")); + carouselBtn->SetPosition(Settings.widescreen ? thInt("384 - carousel layout carousel btn pos x widescreen") : thInt("400 - carousel layout carousel btn pos x"), + thInt("13 - carousel layout carousel btn pos y")); + lockBtn->SetPosition(Settings.widescreen ? thInt("416 - carousel layout lock btn pos x widescreen") : thInt("440 - carousel layout lock btn pos x"), + thInt("13 - carousel layout lock btn pos y")); + dvdBtn->SetPosition(Settings.widescreen ? thInt("448 - carousel layout dvd btn pos x widescreen") : thInt("480 - carousel layout dvd btn pos x"), + thInt("13 - carousel layout dvd btn pos y")); - gameCarousel = new GuiGameCarousel(640, 400, Settings.theme_path, bg_options_png, lastSelectedGame); - gameCarousel->SetPosition(Theme.gamecarousel_x, Theme.gamecarousel_y); + gameCarousel = new GuiGameCarousel(thInt("640 - game carousel layout width"), thInt("400 - game carousel layout height"), Settings.theme_path, bg_options_png, lastSelectedGame); + gameCarousel->SetPosition(thInt("0 - game carousel layout pos x"), thInt("-20 - game carousel layout pos y")); gameCarousel->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE); } - if (Theme.show_hddinfo == -1 || Theme.show_hddinfo == 1) //force show hdd info + if (thInt("1 - show hdd info: 1 for on and 0 for off") == 1) //force show hdd info Append(usedSpaceTxt); - if (Theme.show_gamecount == -1 || Theme.show_gamecount == 1) //force show game cnt info + if (thInt("1 - show game count: 1 for on and 0 for off") == 1) //force show game cnt info Append(gamecntBtn); Append(sdcardBtn); Append(poweroffBtn); @@ -1137,6 +1165,7 @@ void GameBrowseMenu::UpdateGameInfoText(const u8 * gameId) Remove(GameRegionTxt); delete GameRegionTxt; GameRegionTxt = NULL; + idBtn->SetLabel(NULL); return; } @@ -1179,7 +1208,7 @@ void GameBrowseMenu::UpdateGameInfoText(const u8 * gameId) { Remove(GameIDTxt); delete GameIDTxt; - GameIDTxt = new GuiText(IDfull, 22, Theme.info); + GameIDTxt = new GuiText(IDfull, 22, thColor("r=55 g=190 b=237 a=255 - game id text color")); GameIDTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP); idBtn->SetEffect(EFFECT_FADE, 20); idBtn->SetLabel(GameIDTxt); @@ -1190,9 +1219,9 @@ void GameBrowseMenu::UpdateGameInfoText(const u8 * gameId) { Remove(GameRegionTxt); delete GameRegionTxt; - GameRegionTxt = new GuiText(gameregion, 22, Theme.info); + GameRegionTxt = new GuiText(gameregion, 22, thColor("r=55 g=190 b=237 a=255 - region info text color")); GameRegionTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP); - GameRegionTxt->SetPosition(Theme.region_x, Theme.region_y); + GameRegionTxt->SetPosition(thInt("68 - region info text pos x"), thInt("30 - region info text pos x")); GameRegionTxt->SetEffect(EFFECT_FADE, 20); Append(GameRegionTxt); } diff --git a/source/menu/menu_partition_selection.cpp b/source/menu/menu_partition_selection.cpp index dffb96b1..f2c2ea8a 100644 --- a/source/menu/menu_partition_selection.cpp +++ b/source/menu/menu_partition_selection.cpp @@ -61,14 +61,16 @@ int SelectPartitionMenu() GuiImage poweroffBtnImgOver(&btnpwroffOver); poweroffBtnImg.SetWidescreen(Settings.widescreen); poweroffBtnImgOver.SetWidescreen(Settings.widescreen); - GuiButton poweroffBtn(&poweroffBtnImg, &poweroffBtnImgOver, 0, 3, Theme.power_x, Theme.power_y, &trigA, - btnSoundOver, btnSoundClick2, 1); + GuiButton poweroffBtn(&poweroffBtnImg, &poweroffBtnImgOver, 0, 3, + thInt("576 - power off btn pos x"), thInt("355 - power off btn pos y"), + &trigA, btnSoundOver, btnSoundClick2, 1); GuiImage exitBtnImg(&btnhome); GuiImage exitBtnImgOver(&btnhomeOver); exitBtnImg.SetWidescreen(Settings.widescreen); exitBtnImgOver.SetWidescreen(Settings.widescreen); - GuiButton exitBtn(&exitBtnImg, &exitBtnImgOver, 0, 3, Theme.home_x, Theme.home_y, &trigA, btnSoundOver, btnSoundClick2, - 1); + GuiButton exitBtn(&exitBtnImg, &exitBtnImgOver, 0, 3, + thInt("489 - home menu btn pos x"), thInt("371 - home menu btn pos x"), + &trigA, btnSoundOver, btnSoundClick2, 1); exitBtn.SetTrigger(&trigHome); GuiCustomOptionBrowser optionBrowser(396, 280, &options, "bg_options_settings.png"); diff --git a/source/prompts/DiscBrowser.cpp b/source/prompts/DiscBrowser.cpp index 8e22361e..3cf7f7c3 100644 --- a/source/prompts/DiscBrowser.cpp +++ b/source/prompts/DiscBrowser.cpp @@ -129,7 +129,7 @@ int DiscBrowse(const char * GameID, char * alternatedname, int alternatedname_si settingsbackgroundbtn.SetPosition(0, 0); settingsbackgroundbtn.SetImage(&settingsbackground); - GuiText cancelBtnTxt(tr( "Back" ), 22, Theme.prompttext); + GuiText cancelBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage cancelBtnImg(&btnOutline); if (Settings.wsprompt == ON) diff --git a/source/prompts/GameWindow.cpp b/source/prompts/GameWindow.cpp index 9bd8ff4f..6fb3e92c 100644 --- a/source/prompts/GameWindow.cpp +++ b/source/prompts/GameWindow.cpp @@ -59,7 +59,7 @@ GameWindow::GameWindow(int Selected) nameBtnTT = new GuiTooltip(tr( "Rename Game on WBFS" )); if (Settings.wsprompt) nameBtnTT->SetWidescreen(Settings.widescreen); - nameTxt = new GuiText("", 22, Theme.prompttext); + nameTxt = new GuiText("", 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); if (Settings.wsprompt) nameTxt->SetWidescreen(Settings.widescreen); nameTxt->SetMaxWidth(350, SCROLL_HORIZONTAL); nameBtn = new GuiButton(120, 50); @@ -76,7 +76,7 @@ GameWindow::GameWindow(int Selected) nameBtn->SetEffectGrow(); } - sizeTxt = new GuiText((char*) NULL, 22, Theme.prompttext); + sizeTxt = new GuiText((char*) NULL, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); sizeTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP); sizeTxt->SetPosition(-60, 70); @@ -91,7 +91,7 @@ GameWindow::GameWindow(int Selected) diskImg2->SetAngle(0); diskImg2->SetBeta(180); - playcntTxt = new GuiText((char*) NULL, 18, Theme.info); + playcntTxt = new GuiText((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); playcntTxt->SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); playcntTxt->SetPosition(-115, 45); @@ -104,7 +104,7 @@ GameWindow::GameWindow(int Selected) gameBtn->SetTrigger(trigA); gameBtn->SetState(STATE_SELECTED); - backBtnTxt = new GuiText(tr( "Back" ), 22, Theme.prompttext); + backBtnTxt = new GuiText(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); backBtnImg = new GuiImage(btnOutline); if (Settings.wsprompt) { @@ -125,7 +125,7 @@ GameWindow::GameWindow(int Selected) backBtn->SetPosition(0, -40); } - settingsBtnTxt = new GuiText(tr( "Settings" ), 22, Theme.prompttext); + settingsBtnTxt = new GuiText(tr( "Settings" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); settingsBtnImg = new GuiImage(btnOutline); if (Settings.wsprompt) { @@ -542,11 +542,16 @@ int GameWindow::MainLoop() else if (btnRight->GetState() == STATE_CLICKED) //next game { - if(Settings.xflip == XFLIP_YES || Settings.xflip == XFLIP_SYSMENU) + if(Settings.xflip == XFLIP_YES) { gameSelected = (gameSelected - 1 + gameList.size()) % gameList.size(); ChangeGame(LEFT); } + else if(Settings.xflip == XFLIP_SYSMENU) + { + gameSelected = (gameSelected + 1) % gameList.size(); + ChangeGame(LEFT); + } else { gameSelected = (gameSelected + 1) % gameList.size(); @@ -556,13 +561,18 @@ int GameWindow::MainLoop() btnRight->ResetState(); } - else if (btnLeft->GetState() == STATE_CLICKED) //next game + else if (btnLeft->GetState() == STATE_CLICKED) //previous game { - if(Settings.xflip == XFLIP_YES || Settings.xflip == XFLIP_SYSMENU) + if(Settings.xflip == XFLIP_YES) { gameSelected = (gameSelected + 1) % gameList.size(); ChangeGame(RIGHT); } + else if(Settings.xflip == XFLIP_SYSMENU) + { + gameSelected = (gameSelected - 1 + gameList.size()) % gameList.size(); + ChangeGame(RIGHT); + } else { gameSelected = (gameSelected - 1 + gameList.size()) % gameList.size(); diff --git a/source/prompts/ProgressWindow.cpp b/source/prompts/ProgressWindow.cpp index aba25ddc..c7869cdb 100644 --- a/source/prompts/ProgressWindow.cpp +++ b/source/prompts/ProgressWindow.cpp @@ -161,11 +161,11 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2 progressbarImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); progressbarImg.SetPosition(25, 40); - GuiText titleTxt(title, 26, Theme.prompttext); + GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 60); - GuiText msg1Txt(msg1, 22, Theme.prompttext); + GuiText msg1Txt(msg1, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg1Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); if (msg2) msg1Txt.SetPosition(0, 100); @@ -173,28 +173,28 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2 msg1Txt.SetPosition(0, 120); msg1Txt.SetMaxWidth(430, DOTTED); - GuiText msg2Txt(msg2, 22, Theme.prompttext); + GuiText msg2Txt(msg2, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); msg2Txt.SetPosition(0, 125); msg2Txt.SetMaxWidth(430, DOTTED); - GuiText prsTxt("%", 22, Theme.prompttext); + GuiText prsTxt("%", 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); prsTxt.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE); prsTxt.SetPosition(-188, 40); - GuiText timeTxt((char*) NULL, 22, Theme.prompttext); + GuiText timeTxt((char*) NULL, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); timeTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM); timeTxt.SetPosition(280, -50); - GuiText sizeTxt((char*) NULL, 22, Theme.prompttext); + GuiText sizeTxt((char*) NULL, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); sizeTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM); sizeTxt.SetPosition(50, -50); - GuiText speedTxt((char*) NULL, 22, Theme.prompttext); + GuiText speedTxt((char*) NULL, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); speedTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM); speedTxt.SetPosition(50, -74); - GuiText prTxt((char*) NULL, 26, Theme.prompttext); + GuiText prTxt((char*) NULL, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); prTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); prTxt.SetPosition(200, 40); @@ -216,7 +216,7 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2 sizeTxt.SetFontSize(20); } - GuiText cancelTxt(tr( "Cancel" ), 22, Theme.prompttext); + GuiText cancelTxt(tr( "Cancel" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage cancelImg(&btnOutline); if (Settings.wsprompt) { diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index 40e47f95..0bafeff4 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -74,7 +74,7 @@ int OnScreenNumpad(char * var, u32 maxlen) GuiTrigger trigB; trigB.SetSimpleTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); - GuiText okBtnTxt(tr( "OK" ), 22, Theme.prompttext); + GuiText okBtnTxt(tr( "OK" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage okBtnImg(&btnOutline); if (Settings.wsprompt) { @@ -83,7 +83,7 @@ int OnScreenNumpad(char * var, u32 maxlen) } GuiButton okBtn(&okBtnImg, &okBtnImg, 0, 4, 5, -15, &trigA, btnSoundOver, btnSoundClick2, 1); okBtn.SetLabel(&okBtnTxt); - GuiText cancelBtnTxt(tr( "Cancel" ), 22, Theme.prompttext); + GuiText cancelBtnTxt(tr( "Cancel" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage cancelBtnImg(&btnOutline); if (Settings.wsprompt) { @@ -147,7 +147,7 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) GuiTrigger trigB; trigB.SetSimpleTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); - GuiText okBtnTxt(tr( "OK" ), 22, Theme.prompttext); + GuiText okBtnTxt(tr( "OK" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage okBtnImg(&btnOutline); if (Settings.wsprompt) { @@ -156,7 +156,7 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) } GuiButton okBtn(&okBtnImg, &okBtnImg, 0, 4, 5, 15, &trigA, btnSoundOver, btnSoundClick2, 1); okBtn.SetLabel(&okBtnTxt); - GuiText cancelBtnTxt(tr( "Cancel" ), 22, Theme.prompttext); + GuiText cancelBtnTxt(tr( "Cancel" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage cancelBtnImg(&btnOutline); if (Settings.wsprompt) { @@ -518,15 +518,15 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons dialogBoxImg.SetWidescreen(Settings.widescreen); } - GuiText titleTxt(title, 26, Theme.prompttext); + GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 55); - GuiText msgTxt(msg, 22, Theme.prompttext); + GuiText msgTxt(msg, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); msgTxt.SetPosition(0, -40); msgTxt.SetMaxWidth(430); - GuiText btn1Txt(btn1Label, 22, Theme.prompttext); + GuiText btn1Txt(btn1Label, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt) { @@ -538,7 +538,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons btn1.SetLabel(&btn1Txt); btn1.SetState(STATE_SELECTED); - GuiText btn2Txt(btn2Label, 22, Theme.prompttext); + GuiText btn2Txt(btn2Label, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn2Img(&btnOutline); if (Settings.wsprompt) { @@ -549,7 +549,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons btn2.SetLabel(&btn2Txt); if (!btn3Label && !btn4Label) btn2.SetTrigger(&trigB); - GuiText btn3Txt(btn3Label, 22, Theme.prompttext); + GuiText btn3Txt(btn3Label, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn3Img(&btnOutline); if (Settings.wsprompt) { @@ -560,7 +560,7 @@ int WindowPrompt(const char *title, const char *msg, const char *btn1Label, cons btn3.SetLabel(&btn3Txt); if (!btn4Label) btn3.SetTrigger(&trigB); - GuiText btn4Txt(btn4Label, 22, Theme.prompttext); + GuiText btn4Txt(btn4Label, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn4Img(&btnOutline); if (Settings.wsprompt) { @@ -1097,15 +1097,15 @@ int DiscWait(const char *title, const char *msg, const char *btn1Label, const ch dialogBoxImg.SetWidescreen(Settings.widescreen); } - GuiText titleTxt(title, 26, Theme.prompttext); + GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 60); - GuiText msgTxt(msg, 22, Theme.prompttext); + GuiText msgTxt(msg, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); msgTxt.SetPosition(0, -40); msgTxt.SetMaxWidth(430); - GuiText btn1Txt(btn1Label, 22, Theme.prompttext); + GuiText btn1Txt(btn1Label, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt) { @@ -1129,7 +1129,7 @@ int DiscWait(const char *title, const char *msg, const char *btn1Label, const ch btn1.SetTrigger(&trigB); btn1.SetState(STATE_SELECTED); - GuiText btn2Txt(btn2Label, 22, Theme.prompttext); + GuiText btn2Txt(btn2Label, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn2Img(&btnOutline); if (Settings.wsprompt) { @@ -1155,7 +1155,7 @@ int DiscWait(const char *title, const char *msg, const char *btn1Label, const ch } } - GuiText timerTxt((char*) NULL, 26, Theme.prompttext); + GuiText timerTxt((char*) NULL, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); timerTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); timerTxt.SetPosition(0, 160); @@ -1246,7 +1246,7 @@ int FormatingPartition(const char *title, partitionEntry *entry) dialogBoxImg.SetWidescreen(Settings.widescreen); } - GuiText titleTxt(title, 26, Theme.prompttext); + GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 60); @@ -1317,16 +1317,16 @@ bool NetworkInitPrompt() dialogBoxImg.SetWidescreen(Settings.widescreen); } - GuiText titleTxt(tr( "Initializing Network" ), 26, Theme.prompttext); + GuiText titleTxt(tr( "Initializing Network" ), 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 60); char msg[20] = " "; - GuiText msgTxt(msg, 22, Theme.prompttext); + GuiText msgTxt(msg, 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); msgTxt.SetPosition(0, -40); - GuiText btn1Txt(tr( "Cancel" ), 22, Theme.prompttext); + GuiText btn1Txt(tr( "Cancel" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt) { @@ -1411,20 +1411,20 @@ int CodeDownload(const char *id) char title[50]; sprintf(title, "%s", tr( "Code Download" )); - GuiText titleTxt(title, 26, Theme.prompttext); + GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 50); char msg[50]; sprintf(msg, "%s", tr( "Initializing Network" )); - GuiText msgTxt(msg, 26, Theme.prompttext); + GuiText msgTxt(msg, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); msgTxt.SetPosition(0, 140); char msg2[50] = " "; - GuiText msg2Txt(msg2, 26, Theme.prompttext); + GuiText msg2Txt(msg2, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); msg2Txt.SetPosition(0, 50); - GuiText btn1Txt(tr( "Cancel" ), 22, Theme.prompttext); + GuiText btn1Txt(tr( "Cancel" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt) { @@ -1613,28 +1613,28 @@ int HBCWindowPrompt(const char *name, const char *coder, const char *version, co whiteBoxImg.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); whiteBoxImg.SetSkew(0, 0, 0, 0, 0, -120, 0, -120); - GuiText nameTxt(name, 30, Theme.prompttext); + GuiText nameTxt(name, 30, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); nameTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); nameTxt.SetPosition(0, -15); nameTxt.SetMaxWidth(430, SCROLL_HORIZONTAL); - GuiText coderTxt(fmt(tr( "Coded by: %s" ), coder), 16, Theme.prompttext); + GuiText coderTxt(fmt(tr( "Coded by: %s" ), coder), 16, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); coderTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); coderTxt.SetPosition(180, 30); coderTxt.SetMaxWidth(280); - GuiText versionTxt(fmt(tr( "Version: %s" ), version), 16, Theme.prompttext); + GuiText versionTxt(fmt(tr( "Version: %s" ), version), 16, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); versionTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); versionTxt.SetPosition(40, 65); versionTxt.SetMaxWidth(430); - GuiText release_dateTxt(release_date, 16, Theme.prompttext); + GuiText release_dateTxt(release_date, 16, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); release_dateTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); release_dateTxt.SetPosition(40, 85); release_dateTxt.SetMaxWidth(430); int pagesize = 6; - Text long_descriptionTxt(long_description, 20, Theme.prompttext); + Text long_descriptionTxt(long_description, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); long_descriptionTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); long_descriptionTxt.SetPosition(46, 117); long_descriptionTxt.SetMaxWidth(360); @@ -1650,11 +1650,11 @@ int HBCWindowPrompt(const char *name, const char *coder, const char *version, co if (filesize > 1048576.0) snprintf(filesizeCH, sizeof(filesizeCH), "%0.2f MB", filesize / 1048576.0); - GuiText filesizeTxt(filesizeCH, 16, Theme.prompttext); + GuiText filesizeTxt(filesizeCH, 16, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); filesizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP); filesizeTxt.SetPosition(-40, 12); - GuiText btn1Txt(tr( "Load" ), 22, Theme.prompttext); + GuiText btn1Txt(tr( "Load" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt) { @@ -1666,7 +1666,7 @@ int HBCWindowPrompt(const char *name, const char *coder, const char *version, co btn1.SetLabel(&btn1Txt); btn1.SetState(STATE_SELECTED); - GuiText btn2Txt(tr( "Back" ), 22, Theme.prompttext); + GuiText btn2Txt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn2Img(&btnOutline); if (Settings.wsprompt) { diff --git a/source/prompts/TitleBrowser.cpp b/source/prompts/TitleBrowser.cpp index a02e70bb..f7c8b327 100644 --- a/source/prompts/TitleBrowser.cpp +++ b/source/prompts/TitleBrowser.cpp @@ -138,7 +138,7 @@ bool TitleSelector(char output[]) GuiTrigger trigB; trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); - GuiText cancelBtnTxt(tr( "Back" ), 22, Theme.prompttext); + GuiText cancelBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage cancelBtnImg(&btnOutline); if (Settings.wsprompt) @@ -365,7 +365,7 @@ int TitleBrowser() settingsbackgroundbtn.SetPosition(0, 0); settingsbackgroundbtn.SetImage(&settingsbackground); - GuiText cancelBtnTxt(tr( "Back" ), 22, Theme.prompttext); + GuiText cancelBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage cancelBtnImg(&btnOutline); if (Settings.wsprompt) diff --git a/source/prompts/filebrowser.cpp b/source/prompts/filebrowser.cpp index b309c810..f1d12c8f 100644 --- a/source/prompts/filebrowser.cpp +++ b/source/prompts/filebrowser.cpp @@ -341,7 +341,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*= usbBtn.SetTrigger(&trigA); usbBtn.SetEffectGrow(); - GuiText okBtnTxt(tr( "OK" ), 22, Theme.prompttext); + GuiText okBtnTxt(tr( "OK" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage okBtnImg(&btnOutline); if (Settings.wsprompt) { diff --git a/source/settings/CSettings.cpp b/source/settings/CSettings.cpp index 059736a6..0870de5b 100644 --- a/source/settings/CSettings.cpp +++ b/source/settings/CSettings.cpp @@ -104,11 +104,10 @@ void CSettings::SetDefault() marknewtitles = 1; FatInstallToDir = 0; InstallPartitions = ONLY_GAME_PARTITION; - fullcopy = 0; beta_upgrades = 0; widescreen = (CONF_GetAspectRatio() == CONF_ASPECT_16_9); - Theme.SetDefault(); //! We need to move this later + Theme::SetDefault(); //! We need to move this later } bool CSettings::Load() @@ -212,8 +211,7 @@ bool CSettings::Save() fprintf(file, "partition = %d\n ", partition); fprintf(file, "marknewtitles = %d\n ", marknewtitles); fprintf(file, "FatInstallToDir = %d\n ", FatInstallToDir); - fprintf(file, "InstallPartitions = %d\n ", InstallPartitions); - fprintf(file, "fullcopy = %d\n ", fullcopy); + fprintf(file, "InstallPartitions = %08X\n ", InstallPartitions); fprintf(file, "beta_upgrades = %d\n ", beta_upgrades); fprintf(file, "returnTo = %s\n ", returnTo); fclose(file); @@ -418,11 +416,6 @@ bool CSettings::SetSetting(char *name, char *value) if (sscanf(value, "%d", &i) == 1) patchcountrystrings = i; return true; } - else if (strcmp(name, "fullcopy") == 0) - { - if (sscanf(value, "%d", &i) == 1) fullcopy = i; - return true; - } else if (strcmp(name, "discart") == 0) { if (sscanf(value, "%d", &i) == 1) discart = i; @@ -450,7 +443,7 @@ bool CSettings::SetSetting(char *name, char *value) } else if (strcmp(name, "InstallPartitions") == 0) { - if (sscanf(value, "%u", &i) == 1) InstallPartitions = i; + InstallPartitions = strtoul(value, 0, 16); return true; } else if (strcmp(name, "covers_path") == 0) @@ -675,10 +668,10 @@ static inline const char * GetLangCode(const char * langpath) else if(strcasestr(langpath, "dutch")) return "NL"; - else if(strcasestr(langpath, "s_chinese")) + else if(strcasestr(langpath, "schinese")) return "ZHCN"; - else if(strcasestr(langpath, "t_chinese")) + else if(strcasestr(langpath, "tchinese")) return "ZHTW"; else if(strcasestr(langpath, "korean")) @@ -748,11 +741,11 @@ bool CSettings::LoadLanguage(const char *path, int language) } else if (language == S_CHINESE) { - snprintf(filepath, sizeof(filepath), "%s/s_chinese.lang", langpath); + snprintf(filepath, sizeof(filepath), "%s/schinese.lang", langpath); } else if (language == T_CHINESE) { - snprintf(filepath, sizeof(filepath), "%s/t_chinese.lang", langpath); + snprintf(filepath, sizeof(filepath), "%s/tchinese.lang", langpath); } else if (language == KOREAN) { diff --git a/source/settings/CSettings.h b/source/settings/CSettings.h index 6a979085..2031ebf4 100644 --- a/source/settings/CSettings.h +++ b/source/settings/CSettings.h @@ -107,7 +107,6 @@ class CSettings short marknewtitles; short FatInstallToDir; u32 InstallPartitions; - short fullcopy; short beta_upgrades; char returnTo[20]; protected: diff --git a/source/settings/SettingsPrompts.cpp b/source/settings/SettingsPrompts.cpp index 24a9c6a8..51f3cec8 100644 --- a/source/settings/SettingsPrompts.cpp +++ b/source/settings/SettingsPrompts.cpp @@ -89,7 +89,6 @@ int MenuLanguageSelect() { int cnt = 0; int ret = 0, choice = 0; - int scrollon; int returnhere = 0; GuiImageData btnOutline(Resources::GetFile("button_dialogue_box.png"), Resources::GetFileSize("button_dialogue_box.png")); @@ -128,7 +127,7 @@ int MenuLanguageSelect() oggmenubackground.SetAlignment( ALIGN_LEFT, ALIGN_TOP ); oggmenubackground.SetPosition( 0, 0 ); - GuiText backBtnTxt( tr( "Back" ) , 22, Theme.prompttext ); + GuiText backBtnTxt( tr( "Back" ) , 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); backBtnTxt.SetMaxWidth( btnOutline.GetWidth() - 30 ); GuiImage backBtnImg( &btnOutline ); if ( Settings.wsprompt == ON ) @@ -147,7 +146,7 @@ int MenuLanguageSelect() backBtn.SetTrigger( &trigB ); backBtn.SetEffectGrow(); - GuiText defaultBtnTxt( tr( "Default" ) , 22, Theme.prompttext ); + GuiText defaultBtnTxt( tr( "Default" ) , 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); defaultBtnTxt.SetMaxWidth( btnOutline.GetWidth() - 30 ); GuiImage defaultBtnImg( &btnOutline ); if ( Settings.wsprompt == ON ) @@ -165,7 +164,7 @@ int MenuLanguageSelect() defaultBtn.SetTrigger( &trigA ); defaultBtn.SetEffectGrow(); - GuiText updateBtnTxt( tr( "Update Files" ) , 22, Theme.prompttext ); + GuiText updateBtnTxt( tr( "Update Files" ) , 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); updateBtnTxt.SetMaxWidth( btnOutline.GetWidth() - 30 ); GuiImage updateBtnImg( &btnOutline ); if ( Settings.wsprompt == ON ) @@ -196,15 +195,6 @@ int MenuLanguageSelect() } - if ( cnt < 9 ) - { - scrollon = 0; - } - else - { - scrollon = 1; - } - GuiCustomOptionBrowser optionBrowser4( 396, 280, &options2, "bg_options_settings.png"); optionBrowser4.SetPosition( 0, 90 ); optionBrowser4.SetAlignment( ALIGN_CENTRE, ALIGN_TOP ); @@ -226,6 +216,8 @@ int MenuLanguageSelect() while ( !returnhere ) { + usleep(100); + if ( shutdown == 1 ) Sys_Shutdown(); else if ( reset == 1 ) @@ -345,3 +337,209 @@ int MenuLanguageSelect() return returnhere; } + +/**************************************************************************** + * MenuThemeSelect + ***************************************************************************/ +int MenuThemeSelect() +{ + char themepath[250]; + int cnt = 0; + int ret = 0, choice = 0; + int returnVal = 0; + + snprintf(themepath, sizeof(themepath), Settings.theme_path); + + char * ptr = strrchr(themepath, '/'); + if(ptr && *ptr != '\0') ptr[1] = '\0'; + + GuiImageData btnOutline(Resources::GetFile("button_dialogue_box.png"), Resources::GetFileSize("button_dialogue_box.png")); + GuiImageData settingsbg(Resources::GetFile("settings_background.png"), Resources::GetFileSize("settings_background.png")); + + GuiTrigger trigA; + trigA.SetSimpleTrigger( -1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A ); + GuiTrigger trigB; + trigB.SetButtonOnlyTrigger( -1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B ); + + GuiText titleTxt(themepath, 24, ( GXColor ) {0, 0, 0, 255} ); + titleTxt.SetAlignment( ALIGN_CENTRE, ALIGN_MIDDLE ); + titleTxt.SetPosition( 0, 0 ); + GuiButton pathBtn( 300, 50 ); + pathBtn.SetAlignment( ALIGN_CENTRE, ALIGN_TOP ); + pathBtn.SetPosition( 0, 28 ); + pathBtn.SetLabel( &titleTxt ); + pathBtn.SetSoundOver( btnSoundOver ); + pathBtn.SetSoundClick( btnSoundClick2 ); + pathBtn.SetTrigger( &trigA ); + pathBtn.SetEffectGrow(); + + GuiImage backgroundImg( &settingsbg ); + backgroundImg.SetAlignment( ALIGN_LEFT, ALIGN_TOP ); + backgroundImg.SetPosition( 0, 0 ); + + GuiText backBtnTxt( tr( "Back" ) , 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); + backBtnTxt.SetMaxWidth( btnOutline.GetWidth() - 30 ); + GuiImage backBtnImg( &btnOutline ); + if ( Settings.wsprompt == ON ) + { + backBtnTxt.SetWidescreen( Settings.widescreen ); + backBtnImg.SetWidescreen( Settings.widescreen ); + } + GuiButton backBtn( btnOutline.GetWidth(), btnOutline.GetHeight() ); + backBtn.SetAlignment( ALIGN_CENTRE, ALIGN_TOP ); + backBtn.SetPosition( -190, 400 ); + backBtn.SetLabel( &backBtnTxt ); + backBtn.SetImage( &backBtnImg ); + backBtn.SetSoundOver( btnSoundOver ); + backBtn.SetSoundClick( btnSoundClick2 ); + backBtn.SetTrigger( &trigA ); + backBtn.SetTrigger( &trigB ); + backBtn.SetEffectGrow(); + + GuiText defaultBtnTxt( tr( "Default" ) , 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); + defaultBtnTxt.SetMaxWidth( btnOutline.GetWidth() - 30 ); + GuiImage defaultBtnImg( &btnOutline ); + if ( Settings.wsprompt == ON ) + { + defaultBtnTxt.SetWidescreen( Settings.widescreen ); + defaultBtnImg.SetWidescreen( Settings.widescreen ); + } + GuiButton defaultBtn( btnOutline.GetWidth(), btnOutline.GetHeight() ); + defaultBtn.SetAlignment( ALIGN_CENTRE, ALIGN_TOP ); + defaultBtn.SetPosition( 190, 400 ); + defaultBtn.SetLabel( &defaultBtnTxt ); + defaultBtn.SetImage( &defaultBtnImg ); + defaultBtn.SetSoundOver( btnSoundOver ); + defaultBtn.SetSoundClick( btnSoundClick2 ); + defaultBtn.SetTrigger( &trigA ); + defaultBtn.SetEffectGrow(); + + DirList * Dir = new DirList(themepath, ".them"); + OptionList options2; + + for ( cnt = 0; cnt < Dir->GetFilecount(); cnt++ ) + { + char filename[64]; + strlcpy( filename, Dir->GetFilename( cnt ), sizeof( filename ) ); + char *dot = strchr( filename, '.' ); + if ( dot ) *dot = '\0'; + options2.SetName( cnt, "%s", filename ); + options2.SetValue( cnt, NULL ); + + } + + GuiCustomOptionBrowser optionBrowser4( 396, 280, &options2, "bg_options_settings.png"); + optionBrowser4.SetPosition( 0, 90 ); + optionBrowser4.SetAlignment( ALIGN_CENTRE, ALIGN_TOP ); + + HaltGui(); + GuiWindow w( screenwidth, screenheight ); + w.Append( &backgroundImg ); + w.Append( &pathBtn ); + w.Append( &backBtn ); + w.Append( &optionBrowser4 ); + mainWindow->Append( &w ); + + w.SetEffect( EFFECT_FADE, 20 ); + ResumeGui(); + + while ( w.GetEffect() > 0 ) usleep(100); + + while (returnVal == 0) + { + usleep(100); + + if (shutdown) + Sys_Shutdown(); + else if (reset) + Sys_Reboot(); + + else if ( backBtn.GetState() == STATE_CLICKED ) + break; + + else if ( defaultBtn.GetState() == STATE_CLICKED ) + { + choice = WindowPrompt( tr( "Loading default theme." ), 0, tr( "OK" ), tr( "Cancel" ) ); + if ( choice == 1 ) + { + snprintf(Settings.theme_path, sizeof(Settings.theme_path), "%stheme/", Settings.ConfigPath); + Theme::SetDefault(); + Settings.Save(); + returnVal = 1; + } + defaultBtn.ResetState(); + } + + else if ( pathBtn.GetState() == STATE_CLICKED ) + { + w.Remove( &optionBrowser4 ); + w.Remove( &backBtn ); + w.Remove( &pathBtn ); + w.Remove( &defaultBtn ); + int result = OnScreenKeyboard( themepath, sizeof(themepath), 0 ); + w.Append( &optionBrowser4 ); + w.Append( &pathBtn ); + w.Append( &backBtn ); + w.Append( &defaultBtn ); + if (result == 1) + { + if (themepath[strlen(themepath)-1] != '/') + strcat(themepath, "/"); + + HaltGui(); + delete Dir; + Dir = new DirList(themepath, ".them"); + options2.ClearList(); + for ( cnt = 0; cnt < Dir->GetFilecount(); cnt++ ) + { + char filename[64]; + strlcpy( filename, Dir->GetFilename( cnt ), sizeof( filename ) ); + char *dot = strchr( filename, '.' ); + if ( dot ) *dot = '\0'; + options2.SetName( cnt, "%s", filename ); + options2.SetValue( cnt, NULL ); + } + titleTxt.SetText(themepath); + ResumeGui(); + WindowPrompt( tr( "Theme path is changed." ), 0, tr( "OK" ) ); + } + pathBtn.ResetState(); + } + + ret = optionBrowser4.GetClickedOption(); + + if (ret >= 0 && ret < Dir->GetFilecount()) + { + choice = WindowPrompt( tr( "Do you want to load this theme?" ), Dir->GetFilename(ret), tr( "Yes" ), tr( "Cancel" ) ); + if ( choice == 1 ) + { + snprintf(Settings.theme_path, sizeof( Settings.theme_path ), "%s", Dir->GetFilepath(ret)); + if ( !CheckFile( Settings.theme_path ) ) + { + WindowPrompt( tr( "File not found." ), tr( "Loading default theme." ), tr( "OK" ) ); + Theme::SetDefault(); + } + else + { + Theme::Load(Settings.theme_path); + } + Settings.Save(); + returnVal = 1; + break; + } + optionBrowser4.SetFocus( 1 ); + } + } + + w.SetEffect( EFFECT_FADE, -20 ); + while ( w.GetEffect() > 0 ) usleep(100); + + HaltGui(); + mainWindow->Remove( &w ); + ResumeGui(); + + delete Dir; + + return returnVal; +} + diff --git a/source/settings/SettingsPrompts.h b/source/settings/SettingsPrompts.h index d16a12ac..d1c13e49 100644 --- a/source/settings/SettingsPrompts.h +++ b/source/settings/SettingsPrompts.h @@ -10,5 +10,6 @@ bool MenuBackgroundMusic(); int MenuLanguageSelect(); +int MenuThemeSelect(); #endif diff --git a/source/settings/menus/CustomPathsSM.cpp b/source/settings/menus/CustomPathsSM.cpp index d8ffa0c0..2e57ecbe 100644 --- a/source/settings/menus/CustomPathsSM.cpp +++ b/source/settings/menus/CustomPathsSM.cpp @@ -23,6 +23,7 @@ ***************************************************************************/ #include #include "CustomPathsSM.hpp" +#include "settings/SettingsPrompts.h" #include "settings/CSettings.h" #include "prompts/PromptWindows.h" #include "language/gettext.h" @@ -132,12 +133,19 @@ int CustomPathsSM::GetMenuInternal() else if (ret == ++Idx) { titleTxt->SetText(tr( "Theme Path" )); - int result = ChangePath(Settings.theme_path, sizeof(Settings.theme_path)); - if (result == 1) + HaltGui(); + GuiWindow * parent = (GuiWindow *) parentElement; + if(parent) parent->SetState(STATE_DISABLED); + this->SetState(STATE_DEFAULT); + this->Remove(optionBrowser); + ResumeGui(); + int res = MenuThemeSelect(); + if(parent) parent->SetState(STATE_DEFAULT); + this->Append(optionBrowser); + if (res == 1) { HaltGui(); mainWindow->Remove(bgImg); - Theme.Load(Settings.theme_path); if(pointer[0]) delete pointer[0]; if(pointer[1]) delete pointer[1]; if(pointer[2]) delete pointer[2]; diff --git a/source/settings/menus/FlyingButtonsMenu.cpp b/source/settings/menus/FlyingButtonsMenu.cpp index 46b8c53e..9e5573e4 100644 --- a/source/settings/menus/FlyingButtonsMenu.cpp +++ b/source/settings/menus/FlyingButtonsMenu.cpp @@ -80,7 +80,7 @@ FlyingButtonsMenu::FlyingButtonsMenu(const char * menu_title) homeBtn->SetTrigger(trigHome); Append(homeBtn); - backBtnTxt = new GuiText(tr( "Back" ), 22, Theme.prompttext); + backBtnTxt = new GuiText(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); backBtnTxt->SetMaxWidth(btnOutline->GetWidth() - 30); backBtnImg = new GuiImage(btnOutline); if (Settings.wsprompt == ON) diff --git a/source/settings/menus/GameLoadSM.cpp b/source/settings/menus/GameLoadSM.cpp index 67602132..cd39c4f7 100644 --- a/source/settings/menus/GameLoadSM.cpp +++ b/source/settings/menus/GameLoadSM.cpp @@ -86,13 +86,6 @@ static const char * Error002Text[3] = trNOOP( "Anti" ) }; -static const char * InstPartitionsText[3] = -{ - trNOOP( "Game partition" ), - trNOOP( "All partitions" ), - trNOOP( "Remove update" ) -}; - static inline bool IsValidPartition(int fs_type, int cios) { if (IosLoader::IsWaninkokoIOS() && NandTitles.VersionOf(TITLE_ID(1, cios)) < 18) @@ -121,7 +114,6 @@ GameLoadSM::GameLoadSM() Options->SetName(Idx++, "%s", tr( "Quick Boot" )); Options->SetName(Idx++, "%s", tr( "Error 002 fix" )); Options->SetName(Idx++, "%s", tr( "Install partitions" )); - Options->SetName(Idx++, "%s", tr( "Install 1:1 Copy" )); Options->SetName(Idx++, "%s", tr( "Return To" )); SetOptionValues(); @@ -189,18 +181,20 @@ void GameLoadSM::SetOptionValues() Options->SetValue(Idx++, "%s", tr( Error002Text[Settings.error002] )); //! Settings: Install partitions - Options->SetValue(Idx++, "%s", tr( InstPartitionsText[Settings.InstallPartitions] )); - - //! Settings: Install 1:1 Copy - Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.fullcopy] )); + if(Settings.InstallPartitions == ONLY_GAME_PARTITION) + Options->SetValue(Idx++, "%s", tr("Game partition")); + else if(Settings.InstallPartitions == ALL_PARTITIONS) + Options->SetValue(Idx++, "%s", tr("All partitions")); + else if(Settings.InstallPartitions == REMOVE_UPDATE_PARTITION) + Options->SetValue(Idx++, "%s", tr("Remove update")); //! Settings: Return To const char* TitleName = NULL; int haveTitle = NandTitles.FindU32(Settings.returnTo); if (haveTitle >= 0) TitleName = NandTitles.NameFromIndex(haveTitle); - Options->SetValue(Idx++, "%s", TitleName ? TitleName : strlen(Settings.returnTo) > 0 ? - Settings.returnTo : tr( OnOffText[0] )); + TitleName = TitleName ? TitleName : strlen(Settings.returnTo) > 0 ? Settings.returnTo : tr(OnOffText[0]); + Options->SetValue(Idx++, "%s", TitleName); } int GameLoadSM::GetMenuInternal() @@ -302,13 +296,19 @@ int GameLoadSM::GetMenuInternal() //! Settings: Install partitions else if (ret == ++Idx) { - if (++Settings.InstallPartitions >= 3) Settings.InstallPartitions = 0; - } - - //! Settings: Install 1:1 Copy - else if (ret == ++Idx) - { - if (++Settings.fullcopy >= MAX_ON_OFF) Settings.fullcopy = 0; + switch(Settings.InstallPartitions) + { + case ONLY_GAME_PARTITION: + Settings.InstallPartitions = ALL_PARTITIONS; + break; + case ALL_PARTITIONS: + Settings.InstallPartitions = REMOVE_UPDATE_PARTITION; + break; + default: + case REMOVE_UPDATE_PARTITION: + Settings.InstallPartitions = ONLY_GAME_PARTITION; + break; + } } //! Settings: Return To diff --git a/source/settings/menus/IndGameLoadSM.cpp b/source/settings/menus/IndGameLoadSM.cpp index 70c132aa..9a6848ca 100644 --- a/source/settings/menus/IndGameLoadSM.cpp +++ b/source/settings/menus/IndGameLoadSM.cpp @@ -105,7 +105,7 @@ IndGameLoadSM::IndGameLoadSM(const char * GameID) trigA = new GuiTrigger(); trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - saveBtnTxt = new GuiText(tr( "Save" ), 22, Theme.prompttext); + saveBtnTxt = new GuiText(tr( "Save" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); saveBtnTxt->SetMaxWidth(btnOutline->GetWidth() - 30); saveBtnImg = new GuiImage (btnOutline); if (Settings.wsprompt == ON) diff --git a/source/settings/menus/SettingsMenu.cpp b/source/settings/menus/SettingsMenu.cpp index 3297654e..fa7b40dc 100644 --- a/source/settings/menus/SettingsMenu.cpp +++ b/source/settings/menus/SettingsMenu.cpp @@ -31,7 +31,6 @@ SettingsMenu::SettingsMenu(const char * title, OptionList * opts, int returnTo) { Options = opts; returnToMenu = returnTo; - backBtn = NULL; trigA = NULL; trigB = NULL; backBtnTxt = NULL; diff --git a/source/system/IosLoader.cpp b/source/system/IosLoader.cpp index dafad527..6d886ee1 100644 --- a/source/system/IosLoader.cpp +++ b/source/system/IosLoader.cpp @@ -117,13 +117,13 @@ s32 IosLoader::ReloadIosSafe(s32 ios) if(IsHermesIOS(ios)) { s32 iosRev = NandTitles.VersionOf(TITLE_ID(1, ios)); - if(iosRev != 4 && iosRev != 5 && iosRev != 65535) + if((iosRev < 4 || iosRev > 6) && iosRev != 65535) return -11; } else if(IsWaninkokoIOS(ios)) { s32 iosRev = NandTitles.VersionOf(TITLE_ID(1, ios)); - if(iosRev < 9 || iosRev > 30) //let's see if Waninkoko actually gets to 30 + if((iosRev < 9 || iosRev > 30) && iosRev != 65535) //let's see if Waninkoko actually gets to 30 return -22; } else diff --git a/source/themes/CTheme.cpp b/source/themes/CTheme.cpp index 9fcd8015..1914c343 100644 --- a/source/themes/CTheme.cpp +++ b/source/themes/CTheme.cpp @@ -29,359 +29,61 @@ #include "CTheme.h" #include "libwiigui/gui.h" -CTheme Theme; +bool Theme::ShowTooltips = true; -typedef struct _TextMap -{ - const char * name; - int id; -} TextMap; - -const TextMap map_alignment[] = -{ - { "left", ALIGN_LEFT }, - { "right", ALIGN_RIGHT }, - { "center", ALIGN_CENTRE }, - { "top", ALIGN_TOP }, - { "bottom", ALIGN_BOTTOM }, - { "middle", ALIGN_MIDDLE }, - { NULL, -1 } -}; - -static u32 wCOORDS_FLAGS[2] = { 0, 0 }; // space for 64 coords - this is enough, also for the future -#define GET_wCOORD_FLAG(i) (wCOORDS_FLAGS[i/32] & (1UL << (i%32))) -#define SET_wCOORD_FLAG(i) (wCOORDS_FLAGS[i/32] |= (1UL << (i%32))) - -#define CFG_COORDS2(name) \ - if ((wcoords_idx++, 1) && !GET_wCOORD_FLAG(wcoords_idx) && \ - strcmp(cfg_name, #name "_coords") == 0) { \ - short x,y; \ - if (sscanf(value, "%hd,%hd", &x, &y) == 2) { \ - name##_x = x; \ - name##_y = y; \ - } \ - return true; \ - } \ - else if (WideScreen && \ - strcmp(cfg_name, "w" #name "_coords") == 0) { \ - short x,y; \ - if (sscanf(value, "%hd,%hd", &x, &y) == 2) { \ - name##_x = x; \ - name##_y = y; \ - SET_wCOORD_FLAG(wcoords_idx); \ - } \ - return true; \ - } - -#define CFG_COORDS4(name) \ - if ((wcoords_idx++, 1) && !GET_wCOORD_FLAG(wcoords_idx) && \ - strcmp(cfg_name, #name "_coords") == 0) { \ - short x,y,w,h; \ - if (sscanf(value, "%hd,%hd,%hd,%hd", &x, &y, &w, &h) == 4) { \ - name##_x = x; \ - name##_y = y; \ - name##_w = w; \ - name##_h = h; \ - } \ - return true; \ - } \ - else if (WideScreen && strcmp(cfg_name, "w" #name "_coords") == 0) \ - { \ - short x,y,w,h; \ - if (sscanf(value, "%hd,%hd,%hd,%hd", &x, &y, &w, &h) == 4) \ - { \ - name##_x = x; \ - name##_y = y; \ - name##_w = w; \ - name##_h = h; \ - SET_wCOORD_FLAG(wcoords_idx); \ - } \ - return true; \ - } - -#define CFG_COLOR(name) \ - if (strcmp(cfg_name, #name "_color") == 0) { \ - short r,g,b,a; \ - int c = sscanf(value, "%hd,%hd,%hd,%hd", &r, &g, &b, &a); \ - if(c >= 3) { \ - name.r = r; \ - name.g = g; \ - name.b = b; \ - if(c >= 4) \ - name.a = a; \ - } \ - return true; \ - } - -#define CFG_VAL(name) \ - if (strcmp(cfg_name, #name) == 0) { \ - short v; \ - if (sscanf(value, "%hd", &v) == 1) { \ - name = v; \ - } \ - return true; \ - } - -#define CFG_ALIGN(varname) \ - for(int i = 0; map_alignment[i].name != NULL; ++i) \ - { \ - if(strcasestr(map_alignment[i].name, value) != NULL) \ - { \ - varname##_align = map_alignment[i].id; \ - break; \ - } \ - return true; \ - } - -CTheme::CTheme() -{ - WideScreen = (CONF_GetAspectRatio() == CONF_ASPECT_16_9); - SetDefault(); -} - -CTheme::~CTheme() +void Theme::SetDefault() { + Theme::ShowTooltips = true; + ThemeCleanUp(); Resources::Clear(); } -void CTheme::SetDefault() +bool Theme::Load(const char * theme_file_path) { - Resources::Clear(); + bool result = LoadTheme(theme_file_path); + if(!result) + return result; - gamelist_x = 200; - gamelist_y = 49;//40; - gamelist_w = 396; - gamelist_h = 280; - gamegrid_w = 640; - gamegrid_h = 400; - gamegrid_x = 0; - gamegrid_y = 20; - gamecarousel_w = 640; - gamecarousel_h = 400; - gamecarousel_x = 0; - gamecarousel_y = -20; - covers_x = 26; - covers_y = 58; - show_id = 1; - id_x = 68; - id_y = 305; - show_region = 1; - region_x = 68; - region_y = 30; - sdcard_x = 160; - sdcard_y = 395; - homebrew_x = 410; - homebrew_y = 405; - power_x = 576; - power_y = 355; - home_x = 489;//215; - home_y = 371; - setting_x = 64;//-210 - setting_y = 371; - install_x = 16;//-280 - install_y = 355; - clock = (GXColor) {138, 138, 138, 240}; - clock_align = ALIGN_LEFT; - clock_x = 275; - clock_y = 335;//330; - info = ( GXColor ) {55, 190, 237, 255}; - show_hddinfo = 1; - hddinfo_align = ALIGN_CENTRE; - hddinfo_x = 0; - hddinfo_y = 400; - show_gamecount = 1; //default - gamecount_align = ALIGN_CENTRE; - gamecount_x = 0; - gamecount_y = 420; - show_tooltip = 1; //1 means use settings, 0 means force turn off - tooltipAlpha = 255; - prompttext = (GXColor) {0, 0, 0, 255}; - settingstext = (GXColor) {0, 0, 0, 255}; - gametext = (GXColor) {0, 0, 0, 255}; - pagesize = 9; - gamelist_favorite_x = WideScreen ? 288 : 260; - gamelist_favorite_y = 13; - gamelist_search_x = WideScreen ? 320 : 300; - gamelist_search_y = 13; - gamelist_abc_x = WideScreen ? 352 : 340; - gamelist_abc_y = 13; - gamelist_list_x = WideScreen ? 384 : 380; - gamelist_list_y = 13; - gamelist_grid_x = WideScreen ? 416 : 420; - gamelist_grid_y = 13; - gamelist_carousel_x = WideScreen ? 448 : 460; - gamelist_carousel_y = 13; - gamelist_lock_x = WideScreen ? 480 : 500; - gamelist_lock_y = 13; - gamelist_dvd_x = WideScreen ? 512 : 540; - gamelist_dvd_y = 13; - gamegrid_favorite_x = WideScreen ? 224 : 200; - gamegrid_favorite_y = 13; - gamegrid_search_x = WideScreen ? 256 : 240; - gamegrid_search_y = 13; - gamegrid_abc_x = WideScreen ? 288 : 280; - gamegrid_abc_y = 13; - gamegrid_list_x = WideScreen ? 320 : 320; - gamegrid_list_y = 13; - gamegrid_grid_x = WideScreen ? 352 : 360; - gamegrid_grid_y = 13; - gamegrid_carousel_x = WideScreen ? 384 : 400; - gamegrid_carousel_y = 13; - gamegrid_lock_x = WideScreen ? 416 : 440; - gamegrid_lock_y = 13; - gamegrid_dvd_x = WideScreen ? 448 : 480; - gamegrid_dvd_y = 13; - gamecarousel_favorite_x = WideScreen ? 224 : 200; - gamecarousel_favorite_y = 13; - gamecarousel_search_x = WideScreen ? 256 : 240; - gamecarousel_search_y = 13; - gamecarousel_abc_x = WideScreen ? 288 : 280; - gamecarousel_abc_y = 13; - gamecarousel_list_x = WideScreen ? 320 : 320; - gamecarousel_list_y = 13; - gamecarousel_grid_x = WideScreen ? 352 : 360; - gamecarousel_grid_y = 13; - gamecarousel_carousel_x = WideScreen ? 384 : 400; - gamecarousel_carousel_y = 13; - gamecarousel_lock_x = WideScreen ? 416 : 440; - gamecarousel_lock_y = 13; - gamecarousel_dvd_x = WideScreen ? 448 : 480; - gamecarousel_dvd_y = 13; -} + Theme::ShowTooltips = (thInt("1 - Enable tooltips: 0 for off and 1 for on") != 0); -bool CTheme::SetSetting(char *name, char *value) -{ - char * cfg_name = name; - int wcoords_idx = -1; + char theme_path[300]; + snprintf(theme_path, sizeof(theme_path), theme_file_path); - CFG_COORDS4( gamelist ) - CFG_COORDS4( gamegrid ) - CFG_COORDS4( gamecarousel ) + char * ptr = strrchr(theme_path, '/'); + if(ptr) *ptr = '\0'; - CFG_COORDS2( covers ) + FILE * file = fopen(theme_file_path, "rb"); + if(!file) + return false; - CFG_VAL( show_id ) - CFG_COORDS2( id ) - - CFG_VAL( show_region ) - CFG_COORDS2( region ) - - CFG_COORDS2( sdcard ) - CFG_COORDS2( homebrew ) - CFG_COORDS2( power ) - CFG_COORDS2( home ) - CFG_COORDS2( setting ) - CFG_COORDS2( install ) - - CFG_COORDS2( clock ) - CFG_ALIGN( clock ) - CFG_COLOR( clock ) - - CFG_COLOR( info ) - CFG_VAL( show_hddinfo ) - CFG_ALIGN( hddinfo ) - CFG_COORDS2( hddinfo ) - - CFG_VAL( show_gamecount ) - CFG_ALIGN( gamecount ) - CFG_COORDS2( gamecount ) - - CFG_VAL( show_tooltip ) - CFG_VAL( tooltipAlpha ) - - CFG_COLOR( prompttext ) - CFG_COLOR( settingstext ) - CFG_COLOR( gametext ) - - CFG_VAL( pagesize ) - - CFG_COORDS2( gamelist_favorite ) - CFG_COORDS2( gamegrid_favorite ) - CFG_COORDS2( gamecarousel_favorite ) - - CFG_COORDS2( gamelist_search ) - CFG_COORDS2( gamegrid_search ) - CFG_COORDS2( gamecarousel_search ) - - CFG_COORDS2( gamelist_abc ) - CFG_COORDS2( gamegrid_abc ) - CFG_COORDS2( gamecarousel_abc ) - - CFG_COORDS2( gamelist_list ) - CFG_COORDS2( gamegrid_list ) - CFG_COORDS2( gamecarousel_list ) - - CFG_COORDS2( gamelist_grid ) - CFG_COORDS2( gamegrid_grid ) - CFG_COORDS2( gamecarousel_grid ) - - CFG_COORDS2( gamelist_carousel ) - CFG_COORDS2( gamegrid_carousel ) - CFG_COORDS2( gamecarousel_carousel ) - - CFG_COORDS2( gamelist_lock ) - CFG_COORDS2( gamegrid_lock ) - CFG_COORDS2( gamecarousel_lock ) - - CFG_COORDS2( gamelist_dvd ) - CFG_COORDS2( gamegrid_dvd ) - CFG_COORDS2( gamecarousel_dvd ) - - return false; -} - -bool CTheme::Load(const char * theme_path) -{ - char filepath[300]; - snprintf(filepath, sizeof(filepath), "%sGXtheme.cfg", theme_path); - - char line[1024]; - wCOORDS_FLAGS[0] = 0; - wCOORDS_FLAGS[1] = 0; - - FILE * file = fopen(filepath, "r"); - if (!file) return false; + char line[300]; + char * Foldername = NULL; while (fgets(line, sizeof(line), file)) { - if (line[0] == '#') continue; + char * ptr = strcasestr(line, "Image-Folder:"); + if(!ptr) + continue; - this->ParseLine(line); + ptr += strlen("Image-Folder:"); + + while(*ptr != '\0' && *ptr == ' ') ptr++; + + Foldername = ptr; + + while(*ptr != '\\' && *ptr != '"' && *ptr != '\0') ptr++; + + *ptr = '\0'; + break; } + fclose(file); + if(!Foldername) + return result; + + snprintf(theme_path, sizeof(theme_path), "%s/%s", theme_path, Foldername); Resources::LoadFiles(theme_path); - return true; -} - -void CTheme::ParseLine(char *line) -{ - char temp[1024], name[1024], value[1024]; - - strncpy(temp, line, sizeof(temp)); - - char * eq = strchr(temp, '='); - - if (!eq) return; - - *eq = 0; - - this->TrimLine(name, temp, sizeof(name)); - this->TrimLine(value, eq + 1, sizeof(value)); - - this->SetSetting(name, value); -} - -void CTheme::TrimLine(char *dest, char *src, int size) -{ - int len; - while (*src == ' ') - src++; - len = strlen(src); - while (len > 0 && strchr(" \r\n", src[len - 1])) - len--; - if (len >= size) len = size - 1; - strncpy(dest, src, len); - dest[len] = 0; + return result; } diff --git a/source/themes/CTheme.h b/source/themes/CTheme.h index 48441e7b..86a3c48b 100644 --- a/source/themes/CTheme.h +++ b/source/themes/CTheme.h @@ -1,179 +1,21 @@ -#ifndef _CTHEME_H_ -#define _CTHEME_H_ +#ifndef _THEME_H_ +#define _THEME_H_ #include #include #include #include "Resources.h" +#include "gettheme.h" -class CTheme +class Theme { public: - //!Constructor - CTheme(); - //!Destructor - ~CTheme(); //!Set Default - void SetDefault(); + static void SetDefault(); //!Load - bool Load(const char * path); - - /** Variables **/ - short gamelist_x; - short gamelist_y; - short gamelist_w; - short gamelist_h; - - short gamegrid_x; - short gamegrid_y; - short gamegrid_w; - short gamegrid_h; - - short gamecarousel_x; - short gamecarousel_y; - short gamecarousel_w; - short gamecarousel_h; - - short covers_x; - short covers_y; - - short show_id; - - short id_x; - short id_y; - - short show_region; - - short region_x; - short region_y; - - short sdcard_x; - short sdcard_y; - - short homebrew_x; - short homebrew_y; - - short power_x; - short power_y; - - short home_x; - short home_y; - - short setting_x; - short setting_y; - - short install_x; - short install_y; - - GXColor clock; - short clock_align; - short clock_x; - short clock_y; - - GXColor info; - short show_hddinfo; - short hddinfo_align; - short hddinfo_x; - short hddinfo_y; - - short show_gamecount; - short gamecount_align; - short gamecount_x; - short gamecount_y; - - short show_tooltip; - int tooltipAlpha; - - GXColor prompttext; - - GXColor settingstext; - - GXColor gametext; - - short pagesize; - - short gamelist_favorite_x; - short gamelist_favorite_y; - - short gamelist_search_x; - short gamelist_search_y; - - short gamelist_abc_x; - short gamelist_abc_y; - - short gamelist_list_x; - short gamelist_list_y; - - short gamelist_grid_x; - short gamelist_grid_y; - - short gamelist_carousel_x; - short gamelist_carousel_y; - - short gamelist_dvd_x; - short gamelist_dvd_y; - - short gamelist_lock_x; - short gamelist_lock_y; - - short gamegrid_favorite_x; - short gamegrid_favorite_y; - - short gamegrid_search_x; - short gamegrid_search_y; - - short gamegrid_abc_x; - short gamegrid_abc_y; - - short gamegrid_list_x; - short gamegrid_list_y; - - short gamegrid_grid_x; - short gamegrid_grid_y; - - short gamegrid_carousel_x; - short gamegrid_carousel_y; - - short gamegrid_dvd_x; - short gamegrid_dvd_y; - - short gamegrid_lock_x; - short gamegrid_lock_y; - - short gamecarousel_favorite_x; - short gamecarousel_favorite_y; - - short gamecarousel_search_x; - short gamecarousel_search_y; - - short gamecarousel_abc_x; - short gamecarousel_abc_y; - - short gamecarousel_list_x; - short gamecarousel_list_y; - - short gamecarousel_grid_x; - short gamecarousel_grid_y; - - short gamecarousel_carousel_x; - short gamecarousel_carousel_y; - - short gamecarousel_dvd_x; - short gamecarousel_dvd_y; - - short gamecarousel_lock_x; - short gamecarousel_lock_y; - - protected: - bool SetSetting(char *name, char *value); - //!Find the config file in the default paths - bool FindConfig(); - - void ParseLine(char *line); - void TrimLine(char *dest, char *src, int size); - bool WideScreen; + static bool Load(const char * path); + //!Enable tooltips: special case treaded because it is called every frame + static bool ShowTooltips; }; -extern CTheme Theme; - #endif diff --git a/source/themes/Theme_Downloader.cpp b/source/themes/Theme_Downloader.cpp index ad1a0030..20a3e0cd 100644 --- a/source/themes/Theme_Downloader.cpp +++ b/source/themes/Theme_Downloader.cpp @@ -156,25 +156,25 @@ static int Theme_Prompt(const char *title, const char *author, GuiImageData *thu GuiTrigger trigB; trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); - GuiText titleTxt(tr( "Theme Title:" ), 18, Theme.prompttext); + GuiText titleTxt(tr( "Theme Title:" ), 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); titleTxt.SetPosition(230, 30); - GuiText titleTxt2(title, 18, Theme.prompttext); + GuiText titleTxt2(title, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt2.SetAlignment(ALIGN_LEFT, ALIGN_TOP); titleTxt2.SetPosition(230, 50); titleTxt2.SetMaxWidth(dialogBox.GetWidth() - 220, WRAP); - GuiText authorTxt(tr( "Author:" ), 18, Theme.prompttext); + GuiText authorTxt(tr( "Author:" ), 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); authorTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); authorTxt.SetPosition(230, 100); - GuiText authorTxt2(author, 18, Theme.prompttext); + GuiText authorTxt2(author, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); authorTxt2.SetAlignment(ALIGN_LEFT, ALIGN_TOP); authorTxt2.SetPosition(230, 120); authorTxt2.SetMaxWidth(dialogBox.GetWidth() - 220, DOTTED); - GuiText downloadBtnTxt(tr( "Download" ), 22, Theme.prompttext); + GuiText downloadBtnTxt(tr( "Download" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); downloadBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage downloadBtnImg(&btnOutline); if (Settings.wsprompt) @@ -187,7 +187,7 @@ static int Theme_Prompt(const char *title, const char *author, GuiImageData *thu downloadBtn.SetLabel(&downloadBtnTxt); downloadBtn.SetScale(0.9); - GuiText backBtnTxt(tr( "Back" ), 22, Theme.prompttext); + GuiText backBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage backBtnImg(&btnOutline); if (Settings.wsprompt) @@ -341,7 +341,7 @@ int Theme_Downloader() MainButton[2]->SetPosition(90, 230); MainButton[3]->SetPosition(340, 230); - GuiText backBtnTxt(tr( "Back" ), 22, Theme.prompttext); + GuiText backBtnTxt(tr( "Back" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); backBtnTxt.SetMaxWidth(btnOutline.GetWidth() - 30); GuiImage backBtnImg(&btnOutline); if (Settings.wsprompt) diff --git a/source/themes/gettheme.c b/source/themes/gettheme.c new file mode 100644 index 00000000..2fe870a6 --- /dev/null +++ b/source/themes/gettheme.c @@ -0,0 +1,273 @@ +#include +#include +#include +#include +#include + +enum +{ + ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTRE, ALIGN_TOP, ALIGN_BOTTOM, ALIGN_MIDDLE +}; + +typedef struct _MSG +{ + u32 id; + char* msgstr; + struct _MSG *next; +} MSG; +static MSG *baseMSG=0; + + +#define HASHWORDBITS 32 + +/* Defines the so called `hashpjw' function by P.J. Weinberger + [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, + 1986, 1987 Bell Telephone Laboratories, Inc.] */ +static inline u32 hash_string (const char *str_param) +{ + u32 hval, g; + const char *str = str_param; + + /* Compute the hash value for the given string. */ + hval = 0; + while (*str != '\0') + { + hval <<= 4; + hval += (u8) *str++; + g = hval & ((u32) 0xf << (HASHWORDBITS - 4)); + if (g != 0) + { + hval ^= g >> (HASHWORDBITS - 8); + hval ^= g; + } + } + return hval; +} + + +static MSG *findMSG(u32 id) +{ + MSG *msg; + for(msg=baseMSG; msg; msg=msg->next) + { + if(msg->id == id) + return msg; + } + return NULL; +} + +static MSG *setMSG(const char *msgid, const char *msgstr) +{ + u32 id = hash_string(msgid); + MSG *msg = findMSG(id); + if(!msg) + { + msg = (MSG *)malloc(sizeof(MSG)); + msg->id = id; + msg->msgstr = NULL; + msg->next = baseMSG; + baseMSG = msg; + } + if(msg) + { + if(msgstr) + { + if(msg->msgstr) free(msg->msgstr); + msg->msgstr = strdup(msgstr); + } + return msg; + } + return NULL; +} + +static inline void ClearPrefixes(char * msg) +{ + if(!msg) + return; + + const char * ptr = msg; + + int i = 0; + + while(ptr[0] != '\0') + { + if(ptr[0] == '\\' && (ptr[1] == '\\' || ptr[1] == '"')) + { + ++ptr; + } + + msg[i] = ptr[0]; + + ++i; + ++ptr; + } + + msg[i] = '\0'; +} + +void ThemeCleanUp(void) +{ + while(baseMSG) + { + MSG *nextMsg =baseMSG->next; + free(baseMSG->msgstr); + free(baseMSG); + baseMSG = nextMsg; + } +} + +bool LoadTheme(const char* themeFile) +{ + FILE *f; + char line[200]; + char *lastID=NULL; + + ThemeCleanUp(); + f = fopen(themeFile, "r"); + if(!f) + return false; + + while (fgets(line, sizeof(line), f)) + { + // lines starting with # are comments + if (line[0] == '#') + continue; + else if (strncmp(line, "msgid \"", 7) == 0) + { + char *msgid, *end; + if(lastID) { free(lastID); lastID=NULL;} + msgid = &line[7]; + end = strrchr(msgid, '"'); + if(end && end-msgid>1) + { + *end = 0; + ClearPrefixes(msgid); + lastID = strdup(msgid); + } + } + else if (strncmp(line, "msgstr \"", 8) == 0) + { + char *msgstr, *end; + + if(lastID == NULL) + continue; + + msgstr = &line[8]; + end = strrchr(msgstr, '"'); + if(end && end-msgstr>1) + { + *end = 0; + ClearPrefixes(msgstr); + setMSG(lastID, msgstr); + } + free(lastID); + lastID=NULL; + } + } + + fclose(f); + return true; +} + +int getThemeInt(const char *msgid) +{ + MSG *msg = findMSG(hash_string(msgid)); + if(msg) return atoi(msg->msgstr); + return atoi(msgid); +} + +int getThemeAlignment(const char *msgid) +{ + MSG *msg = findMSG(hash_string(msgid)); + + const char * string = msgid; + if(msg) + string = msg->msgstr; + + while(*string == ' ') string++; + + if(strncasecmp(string, "left", strlen("left")) == 0) + return ALIGN_LEFT; + + else if(strncasecmp(string, "right", strlen("right")) == 0) + return ALIGN_RIGHT; + + else if(strncasecmp(string, "center", strlen("center")) == 0) + return ALIGN_CENTRE; + + else if(strncasecmp(string, "top", strlen("top")) == 0) + return ALIGN_TOP; + + else if(strncasecmp(string, "bottom", strlen("bottom")) == 0) + return ALIGN_BOTTOM; + + else if(strncasecmp(string, "middle", strlen("middle")) == 0) + return ALIGN_MIDDLE; + + return -1; +} + +GXColor getThemeColor(const char *msgid) +{ + MSG *msg = findMSG(hash_string(msgid)); + + const char * string = msgid; + if(msg) + string = msg->msgstr; + + GXColor color = (GXColor) {0, 0, 0, 0}; + + while(*string == ' ') string++; + + while(*string != '\0') + { + if(*string == 'r') + { + string++; + while(*string == ' ' || *string == '=' || *string == ',') string++; + + if(*string == '\0') + break; + + color.r = atoi(string) & 0xFF; + } + else if(*string == 'g') + { + string++; + while(*string == ' ' || *string == '=' || *string == ',') string++; + + if(*string == '\0') + break; + + color.g = atoi(string) & 0xFF; + } + else if(*string == 'b') + { + string++; + while(*string == ' ' || *string == '=' || *string == ',') string++; + + if(*string == '\0') + break; + + color.b = atoi(string) & 0xFF; + } + else if(*string == 'a') + { + string++; + while(*string == ' ' || *string == '=' || *string == ',') string++; + + if(*string == '\0') + break; + + color.a = atoi(string) & 0xFF; + } + else if(*string == '-') + { + break; + } + + ++string; + } + + return color; +} diff --git a/source/themes/gettheme.h b/source/themes/gettheme.h new file mode 100644 index 00000000..ada1154b --- /dev/null +++ b/source/themes/gettheme.h @@ -0,0 +1,25 @@ +#ifndef GETTHEME_H_ +#define GETTHEME_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +int getThemeInt(const char *msgid); +int getThemeAlignment(const char *msgid); +GXColor getThemeColor(const char *msgid); +bool LoadTheme(const char* themeFile); +void ThemeCleanUp(void); + +#define thInt(s) getThemeInt(s) +#define thAlign(s) getThemeAlignment(s) +#define thColor(s) getThemeColor(s) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/source/usbloader/frag.c b/source/usbloader/frag.c index a92b3f31..988467d8 100644 --- a/source/usbloader/frag.c +++ b/source/usbloader/frag.c @@ -4,8 +4,9 @@ #include #include -#include "libs/libntfs/ntfs.h" #include "libs/libwbfs/libwbfs.h" +#include "libs/libfat/fatfile_frag.h" +#include "libs/libntfs/ntfsfile_frag.h" #include "libs/libext2fs/ext2_frag.h" #include "usbloader/wbfs.h" @@ -20,8 +21,6 @@ extern sec_t fs_ntfs_sec; extern sec_t fs_ext_sec; -int _FAT_get_fragments (const char *path, _frag_append_t append_fragment, void *callback_data); - static FragList *frag_list = NULL; void frag_init(FragList *ff, int maxnum) diff --git a/source/usbloader/frag.h b/source/usbloader/frag.h index b28daea1..d3c48bd2 100644 --- a/source/usbloader/frag.h +++ b/source/usbloader/frag.h @@ -1,4 +1,5 @@ - +#ifndef _FRAG_H_ +#define _FRAG_H_ // worst case wbfs fragmentation scenario: // 9GB (dual layer) / 2mb (wbfs sector size) = 4608 #define MAX_FRAG 20000 @@ -9,7 +10,7 @@ extern "C" { #endif -#include "libs/libwbfs/libwbfs.h" +#include "gctypes.h" typedef struct { @@ -26,10 +27,6 @@ typedef struct Fragment frag[MAX_FRAG]; } FragList; -typedef int (*frag_append_t)(void *ff, u32 offset, u32 sector, u32 count); - -int _FAT_get_fragments (const char *path, _frag_append_t append_fragment, void *callback_data); - void frag_init(FragList *ff, int maxnum); void frag_dump(FragList *ff); int frag_append(FragList *ff, u32 offset, u32 sector, u32 count); @@ -39,8 +36,7 @@ int frag_concat(FragList *ff, FragList *src); // in case a sparse block is requested, // the returned poffset might not be equal to requested offset // the difference should be filled with 0 -int frag_get(FragList *ff, u32 offset, u32 count, - u32 *poffset, u32 *psector, u32 *pcount); +int frag_get(FragList *ff, u32 offset, u32 count, u32 *poffset, u32 *psector, u32 *pcount); int frag_remap(FragList *ff, FragList *log, FragList *phy); @@ -51,3 +47,5 @@ int set_frag_list(u8 *id); #ifdef __cplusplus } #endif + +#endif diff --git a/source/usbloader/wbfs/wbfs_fat.cpp b/source/usbloader/wbfs/wbfs_fat.cpp index 5cd9b391..9686b8fb 100644 --- a/source/usbloader/wbfs/wbfs_fat.cpp +++ b/source/usbloader/wbfs/wbfs_fat.cpp @@ -167,16 +167,11 @@ s32 Wbfs_Fat::AddGame(void) part = CreatePart(header.id, path); if (!part) return -1; /* Add game to device */ - partition_selector_t part_sel = ALL_PARTITIONS; - int copy_1_1 = Settings.fullcopy; - part_sel = (partition_selector_t) Settings.InstallPartitions; - if (copy_1_1) - { - part_sel = ALL_PARTITIONS; - } + partition_selector_t part_sel = (partition_selector_t) Settings.InstallPartitions; + wbfs_t *old_hdd = hdd; hdd = part; // used by spinner - ret = wbfs_add_disc(part, __ReadDVD, NULL, ProgressCallback, part_sel, copy_1_1); + ret = wbfs_add_disc(hdd, __ReadDVD, NULL, ProgressCallback, part_sel, 0); hdd = old_hdd; wbfs_trim(part); ClosePart(part); @@ -305,15 +300,7 @@ f32 Wbfs_Fat::EstimateGameSize() if (!part) return -1; wii_sec_sz = part->wii_sec_sz; - partition_selector_t part_sel; - if (Settings.fullcopy) - { - part_sel = ALL_PARTITIONS; - } - else - { - part_sel = (partition_selector_t) Settings.InstallPartitions; - } + partition_selector_t part_sel = (partition_selector_t) Settings.InstallPartitions; return wbfs_estimate_disc(part, __ReadDVD, NULL, part_sel); } diff --git a/source/usbloader/wbfs/wbfs_ntfs.cpp b/source/usbloader/wbfs/wbfs_ntfs.cpp index 7ba0beef..456a7f09 100644 --- a/source/usbloader/wbfs/wbfs_ntfs.cpp +++ b/source/usbloader/wbfs/wbfs_ntfs.cpp @@ -1,6 +1,6 @@ #include "wbfs_ntfs.h" #include "fatmounter.h" -#include "libs/libntfs/ntfs.h" +#include "libs/libntfs/ntfsfile_frag.h" s32 Wbfs_Ntfs::Open() { diff --git a/source/usbloader/wbfs/wbfs_wbfs.cpp b/source/usbloader/wbfs/wbfs_wbfs.cpp index 9b53fa5b..27c98aec 100644 --- a/source/usbloader/wbfs/wbfs_wbfs.cpp +++ b/source/usbloader/wbfs/wbfs_wbfs.cpp @@ -93,21 +93,10 @@ s32 Wbfs_Wbfs::AddGame() /* No device open */ if (!hdd) return -1; + partition_selector_t part_sel = (partition_selector_t) Settings.InstallPartitions; + /* Add game to device */ - partition_selector_t part_sel; - int copy_1_1 = 0; - - if (Settings.fullcopy) - { - part_sel = ALL_PARTITIONS; - copy_1_1 = 1; - } - else - { - part_sel = (partition_selector_t) Settings.InstallPartitions; - } - - ret = wbfs_add_disc(hdd, __ReadDVD, NULL, ProgressCallback, part_sel, copy_1_1); + ret = wbfs_add_disc(hdd, __ReadDVD, NULL, ProgressCallback, part_sel, 0); if (ret < 0) return ret; return 0; @@ -174,14 +163,6 @@ s32 Wbfs_Wbfs::ReIDGame(u8 *discid, const void *newID) f32 Wbfs_Wbfs::EstimateGameSize() { - partition_selector_t part_sel = ONLY_GAME_PARTITION; - if (Settings.fullcopy) - { - part_sel = ALL_PARTITIONS; - } - else - { - part_sel = (partition_selector_t) Settings.InstallPartitions; - } + partition_selector_t part_sel = (partition_selector_t) Settings.InstallPartitions; return wbfs_estimate_disc(hdd, __ReadDVD, NULL, part_sel); } diff --git a/source/utils/encrypt.c b/source/utils/encrypt.c index 52fbf5f7..53cadbe1 100644 --- a/source/utils/encrypt.c +++ b/source/utils/encrypt.c @@ -32,7 +32,7 @@ const char * sid = "USBLoaderGX"; void EncryptString(const char *src, char *dst) { - int i; + unsigned int i; char tmp[3]; dst[0] = 0; @@ -45,7 +45,7 @@ void EncryptString(const char *src, char *dst) void DecryptString(const char *src, char *dst) { - int i; + unsigned int i; for (i = 0; i < strlen(src); i += 2) { char c = (src[i] >= 'a' ? (src[i] - 'a') + 10 : (src[i] - '0')) << 4; diff --git a/source/wad/wad.cpp b/source/wad/wad.cpp index 509fe7cb..c0389df1 100644 --- a/source/wad/wad.cpp +++ b/source/wad/wad.cpp @@ -131,7 +131,7 @@ s32 Wad_Install(FILE *fp) dialogBoxImg.SetWidescreen(Settings.widescreen); } - GuiText btn1Txt(tr( "OK" ), 22, Theme.prompttext); + GuiText btn1Txt(tr( "OK" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt) { @@ -164,33 +164,33 @@ s32 Wad_Install(FILE *fp) char title[50]; sprintf(title, "%s", tr( "Installing wad" )); - GuiText titleTxt(title, 26, Theme.prompttext); + GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 40); char msg[50]; sprintf(msg, " "); // sprintf(msg, "%s", tr("Initializing Network")); - GuiText msg1Txt((char*) NULL, 20, Theme.prompttext); + GuiText msg1Txt((char*) NULL, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg1Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg1Txt.SetPosition(50, 75); // char msg2[50] = " "; - GuiText msg2Txt((char*) NULL, 20, Theme.prompttext); + GuiText msg2Txt((char*) NULL, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg2Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg2Txt.SetPosition(50, 98); - GuiText msg3Txt((char*) NULL, 20, Theme.prompttext); + GuiText msg3Txt((char*) NULL, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg3Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg3Txt.SetPosition(50, 121); - GuiText msg4Txt((char*) NULL, 20, Theme.prompttext); + GuiText msg4Txt((char*) NULL, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg4Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg4Txt.SetPosition(50, 144); - GuiText msg5Txt((char*) NULL, 20, Theme.prompttext); + GuiText msg5Txt((char*) NULL, 20, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg5Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg5Txt.SetPosition(50, 167); - GuiText prTxt((char*) NULL, 26, Theme.prompttext); + GuiText prTxt((char*) NULL, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); prTxt.SetPosition(0, 50); @@ -445,7 +445,7 @@ s32 Wad_Uninstall(FILE *fp) dialogBoxImg.SetWidescreen(Settings.widescreen); } - GuiText btn1Txt(tr( "OK" ), 22, Theme.prompttext); + GuiText btn1Txt(tr( "OK" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); GuiImage btn1Img(&btnOutline); if (Settings.wsprompt) { @@ -458,27 +458,27 @@ s32 Wad_Uninstall(FILE *fp) char title[50]; sprintf(title, "%s", tr( "Uninstalling wad" )); - GuiText titleTxt(title, 26, Theme.prompttext); + GuiText titleTxt(title, 26, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(0, 40); - GuiText msg1Txt((char*) NULL, 18, Theme.prompttext); + GuiText msg1Txt((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg1Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg1Txt.SetPosition(50, 75); - GuiText msg2Txt((char*) NULL, 18, Theme.prompttext); + GuiText msg2Txt((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg2Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg2Txt.SetPosition(50, 98); - GuiText msg3Txt((char*) NULL, 18, Theme.prompttext); + GuiText msg3Txt((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg3Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg3Txt.SetPosition(50, 121); - GuiText msg4Txt((char*) NULL, 18, Theme.prompttext); + GuiText msg4Txt((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg4Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg4Txt.SetPosition(50, 144); - GuiText msg5Txt((char*) NULL, 18, Theme.prompttext); + GuiText msg5Txt((char*) NULL, 18, thColor("r=0 g=0 b=0 a=255 - prompt windows text color")); msg5Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); msg5Txt.SetPosition(50, 167);