Commit Graph

788 Commits (48f652e0e1ff5fc830a5fd8f7f3221945005bc20)

Author SHA1 Message Date
aia21 f6adc3fc78 - mkntfs: Create more Vista like volumes. We now match the security
descriptor attributes (but not yet the security descriptors stored in
  $Secure).  (Anton)
- libntfs: Rewrite ntfs_upcase_table_build() to generate a Vista
  compatible upcase table ($UpCase).  (Anton)
- mkntfs: Remove own generation of upcase table, i.e. delete
  ntfsprogs/upcase.[ch] and use ntfs_upcase_table_build() supplied by
  libntfs.  (Anton)
2006-12-19 16:31:52 +00:00
yura 3c668b7d03 - O_EXCL already handled by MNT_NOT_EXCLUSIVE at more early stage
- fix comments
2006-12-15 17:00:02 +00:00
aia21 1fa522a0a1 - libntfs: Add support for FreeBSD 5.0+ sector aligned access
requirements.  (Max Khon)

With some modifications from me...
2006-12-15 15:21:27 +00:00
aia21 1a4fb3431c - mkntfs: Generate a random DCE compliant UUID for the created volume
and include --with-uuid[=PFX] and --without-uuid options.  (Anton)
- configure.ac: Set language to C.  (Anton)
- mkntfs: Always set default cluster size to 4096 bytes regardless of
  volume size.  This is what Windows Vista does and it makes perfect
  sense from a performance point of view.  (Anton)
2006-12-13 00:11:50 +00:00
yura 10b22550cd more sparse fixes
left only endianness and this stupid problems with s64
2006-12-12 19:00:00 +00:00
yura 7b60afcc2f fix sparse errors. and first steps towards endianness checking 2006-12-12 15:02:25 +00:00
yura 2b611a1461 fix clusters per index block calculation (Szaka) 2006-12-11 03:16:22 +00:00
yura 19089b08bd one place with mount option description 2006-12-11 03:03:30 +00:00
yura 03fabce6eb o fix magicNTFS defenition
o remove NTFS_SB_MAGIC because it is unusefull
o rename magicNTFS -> NTFS_SB_MAGIC
o make bootsect.c use NTFS_SB_MAGIC instead of hardcoded value
2006-12-11 03:02:23 +00:00
aia21 43b61b82e7 If pread/pwrite are not supported by the OS, set the device pread()/pwrite()
pointers to NULL so we automatically use seek() + read()/write() from now on.
2006-12-10 19:38:02 +00:00
aia21 f73d77d568 - Implement ntfs_pread() and ntfs_pwrite() in terms of device
operations pread() and pwrite() respectively and fall back to using
  seek() + read()/write() if no pread()/pwrite() device operation is
  supplied or the OS does not support the pread()/pwrite() system call.
  Adapt unix_io pread()/pwrite() device operations to use pread()/
  pwrite() system call and adapt win32_io device operations to not
  supply pread()/pwrite().  (Csaba Henk, Anton)
2006-12-09 14:01:12 +00:00
yura c475778b47 Turn ntfs_pathname_to_inode() into ntfs_pathname_to_inode_num() which
returns ntfs inode number instead of opened inode itself.
Reimplement ntfs_pathname_to_inode() as wrapper to new API.
2006-12-06 18:50:13 +00:00
aia21 5302d23f7b - Empty the journal at mount time. (Anton)
- Set the volume dirty bit at mount time (if it is not set already and
  clear it again at umount time but only if it was not set to start
  with.  (Anton)
2006-11-28 10:09:56 +00:00
yura f738f39bdf oops, introduced stupiedness during one of recent cleanups 2006-11-25 21:35:39 +00:00
yura f12f4aefb7 ntfs_log_error("Failed.\n") is evil. TODO: Implement ntfs_log_errortrace 2006-11-25 21:10:35 +00:00
yura 8df298aec2 Introduce MNT_NTFS_NOT_EXCLUSIVE mount option that tells libntfs do
not open volume exclusively. Useful if libntfs user cares about this
himself, eg. FUSE with blkdev option.
2006-11-25 17:37:37 +00:00
yura 668780d84d bot more verbose debug 2006-11-25 14:28:47 +00:00
yura 18c8f75c7b make ntfs_attr_rm to always close attribute (both on success and failure) 2006-11-22 18:28:13 +00:00
yura c14589175f apply latest fixes from ntfs-3g to enddianess
now everything should work on BE machines!
2006-11-20 17:44:36 +00:00
yura 0da86b6723 port from ntfs-3g fixes to error cases in index code 2006-11-20 17:30:13 +00:00
yura a604622314 Windows cares only about first 4 records in $MFTMirr and ignores
everything beyond them. Update libntfs behaviour to be like in
windows. Leave @mftmirr_size for case if will want to change something in the
future.
2006-11-20 16:21:57 +00:00
yura ef66794423 cleanups 2006-11-20 15:59:14 +00:00
yura f7fe727b09 80 chars lines long fixes 2006-11-19 20:19:18 +00:00
yura b33658bc61 cleanups 2006-11-17 22:51:29 +00:00
yura 7d1016fe97 Treat filenames in POSIX namespace as case insensitive in case of case insensitive mounts. 2006-11-15 23:15:17 +00:00
yura cb27c9f616 * Rename MS_{RDONLY,NOATIME} to NTFS_MNT_{RDONLY,NOATIME}.

							
						
2006-11-12 22:46:50 +00:00
yura 28f24fbc2c revert factoring out ntfs_attr_fill_hole(), agree that it should be refactored,
but passing all args as pointers and changing them there (especially
update_from that changes only inside new function, but rollback depends on it
in pwrite)
2006-11-10 16:07:45 +00:00
yura f2e1ff96d2 Spent really a lot of time applying various "optimizations" from ntfs-3g and
finally figured out that ntfs-3g is faster than ntfsmount only because of
3 reasons:
1) turned on noatime option by default
2) ntfs-3g builds without debug output by default
3) the only real optimization: almost always add resident attributes.
However by accident patch in ntfs-3g for 3) breaks several code paths (why
I am not surprised?), thus I rewrote whole ntfs_attr_add() logic.
2006-11-09 21:19:11 +00:00
aia21 025f07a269 Make a little nicer. 2006-11-07 10:37:25 +00:00
yura d556675a29 Fix typo and build with disabled error handling 2006-11-06 17:11:02 +00:00
uvman 76fc32ed87 Fix a memleak. (Szaka) 2006-11-01 22:37:31 +00:00
uvman be6b5ce977 Factor ntfs_attr_fill_hole() out of ntfs_attr_pwrite(). (Szaka) 2006-11-01 20:20:18 +00:00
uvman 1598a68d67 Fix compilation on environments that one can not assign to "va_list args" (e.g. Debian Alpha). Do so by removing the unused log_reason code. Originally, Szaka asked FlatCap for it but never used it. I've asked Szaka if he is going to use it but he did not reply. I got an implicit answer in the form of ntfs-3g commit. Therefore, commit an updated version of the patch I've sent the Debian package maintainer. 2006-11-01 14:05:09 +00:00
uvman 7d585a0327 Change callers of malloc() to ntfs_malloc() (Szaka). Fix compilition (Yuval). 2006-11-01 13:30:40 +00:00
uvman 483522ec1f Introduce misc.c - Proud home of functions with no other home, starting with ntfs_[mc]alloc. (Szaka) 2006-11-01 12:31:11 +00:00
uvman f6d6db57db Fix wrong error logic that would lead to segfault when malloc fails. 2006-10-30 19:40:56 +00:00
uvman 3e3196133c Avoid a memory leak on the error code path. 2006-10-30 13:43:09 +00:00
uvman 22108e36a1 More big-endiness fixes. (zhanglinbao, Yuval) 2006-10-30 13:29:45 +00:00
uvman 036e748cb9 I was assuming memmove() would copy byte by byte if it detects a smaller than word gap. Anton pointed out that it doesn't, glibc sources confirm, the C99 standard claims otherwise. Revert the compress.c patch as implementation is more important than specification. 2006-10-29 08:59:21 +00:00
uvman 561cb42743 Move ntfs_index_entry_mark_dirty() from index.h to index.c. (Szaka) 2006-10-29 00:55:45 +00:00
uvman fe1405393f Change ntfs_collate()'s signature to size_t's. Move ntfs_is_collation_rule_supported to the .c file and rewrite it to be shorter. 2006-10-29 00:01:17 +00:00
uvman 87d87073c7 The periodic 'int is not neccessarily 32bit' fixes. 2006-10-28 23:45:22 +00:00
uvman 5c4b9c1056 C99 declarations before code fixes. 2006-10-28 23:40:11 +00:00
uvman f51136ac9d Forgot to advance the dest buffer (shame on me) 2006-10-28 23:35:56 +00:00
uvman c59a3aedbd memmove() already deals with overlap, is optimized, is ANSI C and only takes one line to call. 2006-10-28 23:15:44 +00:00
uvman 8fd26af3fb Fix memleak. Remove dead code. 2006-10-28 23:08:24 +00:00
uvman 08db1a719b Aid basic static code checkers to see that ctx can not be null in this code path. 2006-10-28 23:06:49 +00:00
yura ab3519cbcd Always instantiate holes 2006-10-27 14:18:02 +00:00
yura b1583bdce6 Fix several memleaks 2006-10-27 14:15:32 +00:00
uvman ff55ecb513 Whitespace cleanup 2006-10-27 12:24:29 +00:00
aia21 880529ee5a Revert part of 1.71: Gratuituous API/ABI change. 2006-10-27 09:05:56 +00:00
uvman bd1837335b trace output updates. (Szaka, Yuval) 2006-10-26 20:45:28 +00:00
uvman ca2fb9a467 Remove inline keywords from static non-one-liners of '.c' files. 2006-10-26 19:10:05 +00:00
uvman fc7553ad2b [Inconstant,Damaged] metadata -> Inconsistent metadata 2006-10-25 18:57:15 +00:00
uvman c55aea3ad4 Use le32 conversion macros for u32 variables of INDEX_HEADER. (zhanglinbao2000, Yuval) 2006-10-25 16:49:00 +00:00
uvman 480fdb14d5 One more errno save/restore. 2006-10-22 01:11:48 +00:00
uvman 7b6f7e98d4 Remove saving and restoring errno around logging calls as these will not change errno anyway. Remove save/restore only if the saved value will not be used. 2006-10-22 00:23:29 +00:00
aia21 49559ce57c fix a silly bug. 2006-10-20 19:53:50 +00:00
uvman cc12bccc05 Allow reusing ntfs_device after close. 2006-10-18 14:44:23 +00:00
aia21 0c86fccdc9 Fix GUID to string conversion to follow documentation (details: it is not
little endian at all, it is a binary sequence)...

See remarks section at:

http://windowssdk.msdn.microsoft.com/en-us/library/96ff78dc.aspx
2006-10-10 10:29:11 +00:00
uvman 8cfa94abc3 Remove code that was already marked as broken and commented out. 2006-09-25 17:03:48 +00:00
uvman a117a21941 Comment documentation fixes. 2006-09-25 16:58:38 +00:00
yura d15ed62ae4 a bit of cleanups 2006-08-14 03:52:56 +00:00
yura a00ee02388 had not noticed lack of externs :( 2006-08-03 04:30:41 +00:00
yura 70aef8d69c Prevent index root to be moved out from base mft record 2006-08-02 03:57:40 +00:00
yura 08689c171e Merge index code from ntfs-3g. Clean it a bit and fix adding index allocation when index root in the base mft record. 2006-08-02 03:55:41 +00:00
yura 9d0f9aec4c Add new API ntfs_attr_exist() that checks whether attribute with selected type and name already present in inode. (Szaka) 2006-08-02 03:12:34 +00:00
yura 47a2ca1154 80 chars per line cleanup 2006-08-02 01:33:54 +00:00
yura 2338377ec3 bit move verbose in ntfs_delete() 2006-07-28 23:15:35 +00:00
yura bb5991cb36 Set vol->mft_ni->flags. (Szaka) 2006-07-27 18:44:08 +00:00
yura d5ce628f10 commit some fix to runlsi handling code from ntfs-3g
Rich/Anton can you please review it?
2006-07-27 18:12:23 +00:00
aia21 0873318cbb Yura uses ntfs_attr_lookup() in a way it never was anticipated to work so my
fix broke his way of working.  This is a middle ground where both should work.
This still leaves a bug in collation of attribute list entries though which
needs to be investigated and fixed...
2006-07-27 08:38:17 +00:00
aia21 179966fb0c Fix long standing stupendously stupid bug in libntfs/attrib.c::
ntfs_external_attr_find() and also port a bugfix from the advanced
ntfs kernel driver to the same function.  (Anton)
2006-07-23 21:43:08 +00:00
yura a3a318a8b4 forgot "cvs delete" 2006-07-22 19:39:59 +00:00
uvman ae37e54d8c Avoid a double-free error. ntfs_empty_logfile() has no reason to close na/ni anyway, and is only called from ntfs_logfile_reset() which already closes them, so these lines can be safely removed. 2006-07-21 23:16:09 +00:00
uvman a1a13da74a Commit mft extensions right away. Don't wait for a clean unmount, or you may face data loss. 2006-07-21 23:03:59 +00:00
uvman 9efb57918f Fix a logic error that made 'ls -ls' show the wrong file size for compressed and sparse files. 2006-07-21 22:04:44 +00:00
yura 0d94460169 be bit more verbose 2006-07-17 11:55:29 +00:00
yura 28a2b1f2b0 prepare to Szaka's code merge: remove not working Rich's index code 2006-07-17 11:49:52 +00:00
yura 2d137b6900 create SD in __ntfs_create 2006-07-13 16:01:52 +00:00
yura 035df31eae move ROUND_{UP,DOWN} to support.h, make second parameter to be order in which
we should power 2 (to prevent incorrect use)
2006-07-13 02:49:07 +00:00
yura 345247a596 ntfs_link(): prevent creating of recursive directary structure.
FUSE incorrectly handles case insensitive filesystems: when I try to rename
"/Dir" to "/DIR", ntfsmount receive rename("/Dir", "/DIR/Dir") call.
This patch do not fix rename, but prevent fs corruption. I will mail Miklos
about this problem.
2006-06-03 22:09:24 +00:00
yura 6b0018def4 Fix bug with renaming directories with names in DOS and WIN32 namespaces. 2006-06-03 21:37:27 +00:00
cha0smaster d3b82fa6cd fix VCN size in index.c 2006-04-06 17:00:33 +00:00
szaka 134319ae80 libntfs: add and ntfs_inode_badclus_bad() and convert all copy-pastes
to use them
2006-04-05 02:53:40 +00:00
szaka 813933e1bc libntfs: add ntfs_mft_usn_dec() and convert all copy-pastes to use them 2006-04-05 02:49:24 +00:00
szaka be823c7a1e libntfs: add ntfs_str2ucs and ntfs_freeucs function, and convert
copy-pastes to use them
2006-04-05 02:45:55 +00:00
antona cf631e3398 Fix comparison of $MFT and $MFTMirr to not bail out when there are
unused, invalid mft records which are the same in both $MFT and
$MFTMirr.  Ported from kernel driver 2.1.27 release and aplied both
to libntfs/volume.c mount related code and to ntfsprogs/ntfsfix.c's
fixup code.  (Anton)
2006-03-27 22:43:09 +00:00
szaka ddc558f1ec libntfs: add ntfs_index_root_get() which reads the index root of an attribute 2006-03-27 21:14:56 +00:00
szaka 9b801db7c8 libntfs: add ntfs_attr_readall() which reads the entire data from an attribute 2006-03-27 20:01:36 +00:00
cha0smaster f424e61b96 Fix bug in ntfs_attr_pwrite() when we sometimes lose current run in the runlist. 2006-03-04 13:56:34 +00:00
cha0smaster 01309e4ec9 formatting 2006-03-04 00:06:49 +00:00
antona 63982b15fd Fix compilation on FreeBSD. (Christophe) 2006-02-24 15:49:59 +00:00
antona 49fd93718c Cope with attribute list attribute having invalid flags. Windows
copes with this and even chkdsk does not detect or fix this so we
have to cope with it, too.  Thanks to a Pawel for reporting the
problem.  (Anton)
2006-02-24 09:20:10 +00:00
cha0smaster b0f4e5099e ntfs_create: add for any case check 2006-02-23 00:29:04 +00:00
antona 45c9aa137e - Deal with missing syslog function by making code conditional on
presence of syslog.h header file (DOS/djgpp).  (Christophe)
- Avoid clash with existing constants (OSX).  (Christophe)
2006-02-22 14:20:08 +00:00
cha0smaster 6497828e53 While fixing allocated/compressed size I lost correct data size value by accident. 2006-02-21 18:57:34 +00:00
cha0smaster 241c7585a6 Fix runlist setting and incorrect file sizes in the index. 2006-02-21 04:40:20 +00:00
cha0smaster 559d28d2ee cleanup 2006-02-21 03:40:24 +00:00
cha0smaster 9bcf003f26 ntfs_attr_pwrite: Fix very serious bug, when sometimes not whole mapped runlist was passsed to ntfs_attr_update_mapping_pairs. 2006-02-20 00:48:35 +00:00