Hello community,
here is the log from the commit of package ntfs-3g
checked in at Fri Mar 21 04:12:30 CET 2008.
--------
--- ntfs-3g/ntfs-3g.changes 2008-03-04 01:46:45.000000000 +0100
+++ ntfs-3g/ntfs-3g.changes 2008-03-19 18:28:38.925963000 +0100
@@ -1,0 +2,12 @@
+Wed Mar 19 18:10:39 CET 2008 - bk@suse.de
+
+- Update to 1.2310:
+ - Fix: CHKDSK reported inconsistencies as data and allocation size
+ of some special purpose resident unnamed $DATA attribute in the
+ index and inode FILE_NAME attributes could be incorrect.
+ - Fix: unprivileged mount failed if user had rights for everything
+ except the FUSE device file.
+ - Fix: the 'dev' and 'suid' mount options weren't useable before
+ - Change from ENOTEMPTY to EEXIST on rmdir of non-empty directories
+
+-------------------------------------------------------------------
Old:
----
ntfs-3g-1.2216.tar.bz2
ntfs-fix-devsuid.patch
ntfs-nametoolong.patch
New:
----
ntfs-3g-1.2310.tar.bz2
ntfs-3g-permssions.patch
ntfs-3g-unixmapping.patch
ntfs-3g-utf8-fallback.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ntfs-3g.spec ++++++
--- /var/tmp/diff_new_pack.U13581/_old 2008-03-21 04:08:16.000000000 +0100
+++ /var/tmp/diff_new_pack.U13581/_new 2008-03-21 04:08:16.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package ntfs-3g (Version 1.2216)
+# spec file for package ntfs-3g (Version 1.2310)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,14 +12,16 @@
Name: ntfs-3g
Summary: Linux NTFS-3G userspace filesystem with full write support
-Version: 1.2216
-Release: 6
+Version: 1.2310
+Release: 1
License: GPL v2 or later
Group: System/Base
Source0: %{name}-%{version}.tar.bz2
Patch0: ntfs-3g-warnings.patch
-Patch1: ntfs-nametoolong.patch
-Patch2: ntfs-fix-devsuid.patch
+Patch2: ntfs-3g-utf8-fallback.patch
+%define use_permission_branch 0
+Patch3: ntfs-3g-permssions.patch
+Patch4: ntfs-3g-unixmapping.patch
Url: http://www.ntfs-3g.org
BuildRequires: ntfsprogs
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -69,8 +71,11 @@
%prep
%setup -q
%patch
-%patch1
%patch2
+%if %use_permission_branch
+%patch3 -p1
+%patch4 -p1
+%endif
%build
#
@@ -115,6 +120,15 @@
%exclude /usr/share/doc/ntfs-3g/README
%changelog
+* Wed Mar 19 2008 bk@suse.de
+- Update to 1.2310:
+ - Fix: CHKDSK reported inconsistencies as data and allocation size
+ of some special purpose resident unnamed $DATA attribute in the
+ index and inode FILE_NAME attributes could be incorrect.
+ - Fix: unprivileged mount failed if user had rights for everything
+ except the FUSE device file.
+ - Fix: the 'dev' and 'suid' mount options weren't useable before
+ - Change from ENOTEMPTY to EEXIST on rmdir of non-empty directories
* Mon Mar 03 2008 bk@suse.de
- Add a fix for a crash of the driver with a specific long filename
- Fix support for -odev and -osuid when mounting using /bin/ntfs-3g
++++++ ntfs-3g-1.2216.tar.bz2 -> ntfs-3g-1.2310.tar.bz2 ++++++
++++ 1637 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/configure.ac new/ntfs-3g-1.2310/configure.ac
--- old/ntfs-3g-1.2216/configure.ac 2008-02-16 18:12:44.000000000 +0100
+++ new/ntfs-3g-1.2310/configure.ac 2008-03-09 14:32:07.000000000 +0100
@@ -3,8 +3,8 @@
# compilation.
#
# Copyright (c) 2000-2006 Anton Altaparmakov
-# Copyright (c) 2005-2007 Szabolcs Szakacsits
-# Copyright (C) 2007 Alon Bar-Lev
+# Copyright (c) 2005-2008 Szabolcs Szakacsits
+# Copyright (C) 2007-2008 Alon Bar-Lev
#
# 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
@@ -23,8 +23,8 @@
# Autoconf
AC_PREREQ([2.59])
-AC_INIT([ntfs-3g],[1.2216],[ntfs-3g-devel@lists.sf.net])
-LIBNTFS_3G_VERSION=23
+AC_INIT([ntfs-3g],[1.2310],[ntfs-3g-devel@lists.sf.net])
+LIBNTFS_3G_VERSION=24
AC_CONFIG_SRCDIR([src/ntfs-3g.c])
# Environment
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/COPYING new/ntfs-3g-1.2310/COPYING
--- old/ntfs-3g-1.2216/COPYING 2008-02-16 18:14:32.000000000 +0100
+++ new/ntfs-3g-1.2310/COPYING 1970-01-01 01:00:00.000000000 +0100
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C) <year> <name of author>
-
- 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; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/COPYING.LIB new/ntfs-3g-1.2310/COPYING.LIB
--- old/ntfs-3g-1.2216/COPYING.LIB 1970-01-01 01:00:00.000000000 +0100
+++ new/ntfs-3g-1.2310/COPYING.LIB 2008-03-08 21:29:20.000000000 +0100
@@ -0,0 +1,482 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/include/ntfs-3g/unistr.h new/ntfs-3g-1.2310/include/ntfs-3g/unistr.h
--- old/ntfs-3g-1.2216/include/ntfs-3g/unistr.h 2006-10-30 23:32:46.000000000 +0100
+++ new/ntfs-3g-1.2310/include/ntfs-3g/unistr.h 2008-03-08 20:18:19.000000000 +0100
@@ -57,7 +57,7 @@
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, int outs_len);
+extern int ntfs_mbstoucs(const char *ins, ntfschar **outs);
extern void ntfs_upcase_table_build(ntfschar *uc, u32 uc_len);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/libfuse-lite/fuse_lowlevel.c new/ntfs-3g-1.2310/libfuse-lite/fuse_lowlevel.c
--- old/ntfs-3g-1.2216/libfuse-lite/fuse_lowlevel.c 2008-01-23 23:01:02.000000000 +0100
+++ new/ntfs-3g-1.2310/libfuse-lite/fuse_lowlevel.c 2008-03-09 14:16:25.000000000 +0100
@@ -1305,16 +1305,3 @@
return fuse_lowlevel_new_common(args, op, op_size, userdata);
}
-
-struct fuse_ll_compat_conf {
- unsigned max_read;
- int set_max_read;
-};
-
-static const struct fuse_opt fuse_ll_opts_compat[] = {
- { "max_read=", offsetof(struct fuse_ll_compat_conf, set_max_read), 1 },
- { "max_read=%u", offsetof(struct fuse_ll_compat_conf, max_read), 0 },
- FUSE_OPT_KEY("max_read=", FUSE_OPT_KEY_KEEP),
- FUSE_OPT_END
-};
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/libfuse-lite/fusermount.c new/ntfs-3g-1.2310/libfuse-lite/fusermount.c
--- old/ntfs-3g-1.2216/libfuse-lite/fusermount.c 2008-02-16 18:05:37.000000000 +0100
+++ new/ntfs-3g-1.2310/libfuse-lite/fusermount.c 2008-03-09 14:11:25.000000000 +0100
@@ -276,7 +276,7 @@
*flag = mount_flags[i].flag;
if (!mount_flags[i].safe && getuid() != 0) {
*flag = 0;
- fprintf(stderr, "%s: unsafe option %s ignored\n",
+ fprintf(stderr, "%s: unsafe option '%s' ignored\n",
progname, opt);
}
return 1;
@@ -588,7 +588,13 @@
static int try_open(const char *dev, char **devp)
{
- int fd = open(dev, O_RDWR);
+ int fd;
+
+ if (restore_privs())
+ return -1;
+ fd = open(dev, O_RDWR);
+ if (drop_privs())
+ return -1;
if (fd != -1) {
*devp = strdup(dev);
if (*devp == NULL) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/libfuse-lite/mount.c new/ntfs-3g-1.2310/libfuse-lite/mount.c
--- old/ntfs-3g-1.2216/libfuse-lite/mount.c 2008-02-16 15:25:23.000000000 +0100
+++ new/ntfs-3g-1.2310/libfuse-lite/mount.c 2008-03-09 14:11:25.000000000 +0100
@@ -214,7 +214,8 @@
char *mnt_opts = NULL;
memset(&mo, 0, sizeof(mo));
- mo.flags = MS_NOSUID | MS_NODEV;
+ if (getuid())
+ mo.flags = MS_NOSUID | MS_NODEV;
if (args &&
fuse_opt_parse(args, &mo, fuse_mount_opts, fuse_mount_opt_proc) == -1)
@@ -231,6 +232,10 @@
res = -1;
if (get_mnt_flag_opts(&mnt_opts, mo.flags) == -1)
goto out;
+ if (!(mo.flags & MS_NODEV) && fuse_opt_add_opt(&mnt_opts, "dev") == -1)
+ goto out;
+ if (!(mo.flags & MS_NOSUID) && fuse_opt_add_opt(&mnt_opts, "suid") == -1)
+ goto out;
if (mo.kernel_opts && fuse_opt_add_opt(&mnt_opts, mo.kernel_opts) == -1)
goto out;
if (mo.mtab_opts && fuse_opt_add_opt(&mnt_opts, mo.mtab_opts) == -1)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/libntfs-3g/attrib.c new/ntfs-3g-1.2310/libntfs-3g/attrib.c
--- old/ntfs-3g-1.2216/libntfs-3g/attrib.c 2007-11-15 08:33:39.000000000 +0100
+++ new/ntfs-3g-1.2310/libntfs-3g/attrib.c 2008-03-08 13:04:23.000000000 +0100
@@ -2726,6 +2726,10 @@
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;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/libntfs-3g/dir.c new/ntfs-3g-1.2310/libntfs-3g/dir.c
--- old/ntfs-3g-1.2216/libntfs-3g/dir.c 2008-02-02 13:15:31.000000000 +0100
+++ new/ntfs-3g-1.2310/libntfs-3g/dir.c 2008-03-09 14:08:17.000000000 +0100
@@ -446,9 +446,8 @@
}
}
- unicode = ntfs_calloc(MAX_PATH);
ascii = strdup(pathname);
- if (!unicode || !ascii) {
+ if (!ascii) {
ntfs_log_debug("Out of memory.\n");
err = ENOMEM;
goto close;
@@ -466,7 +465,7 @@
q++;
}
- len = ntfs_mbstoucs(p, &unicode, MAX_PATH);
+ len = ntfs_mbstoucs(p, &unicode);
if (len < 0) {
ntfs_log_debug("Couldn't convert name to Unicode: %s.\n", p);
err = errno;
@@ -499,6 +498,9 @@
goto close;
}
+ free(unicode);
+ unicode = NULL;
+
p = q;
while (p && *p && *p == PATH_SEP)
p++;
@@ -1203,6 +1205,8 @@
fn->last_data_change_time = utc2ntfs(ni->last_data_change_time);
fn->last_mft_change_time = utc2ntfs(ni->last_mft_change_time);
fn->last_access_time = utc2ntfs(ni->last_access_time);
+ 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)) {
@@ -1309,7 +1313,7 @@
/* 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 = EEXIST;
+ errno = ENOTEMPTY;
ntfs_log_debug("Directory is not empty\n");
ret = -1;
}
@@ -1324,7 +1328,7 @@
int ret;
ret = ntfs_check_empty_dir(ni);
- if (!ret || errno != EEXIST)
+ if (!ret || errno != ENOTEMPTY)
return ret;
/*
* Directory is non-empty, so we can unlink only if there is more than
@@ -1332,7 +1336,7 @@
*/
if ((link_count == 1) ||
(link_count == 2 && fn->file_name_type == FILE_NAME_DOS)) {
- errno = EEXIST;
+ errno = ENOTEMPTY;
ntfs_log_debug("Non-empty directory without hard links\n");
goto no_hardlink;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/libntfs-3g/unistr.c new/ntfs-3g-1.2310/libntfs-3g/unistr.c
--- old/ntfs-3g-1.2216/libntfs-3g/unistr.c 2006-10-30 23:32:47.000000000 +0100
+++ new/ntfs-3g-1.2310/libntfs-3g/unistr.c 2008-03-08 20:18:19.000000000 +0100
@@ -491,17 +491,16 @@
* 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
- * @outs_len: length of output buffer in Unicode characters
*
* Convert the input multibyte string @ins, from the current locale into the
* corresponding little endian, 2-byte Unicode string.
*
- * If *@outs is NULL, the function allocates the string and the caller is
- * responsible for calling free(*@outs); when finished with it.
+ * 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. If the output string buffer was allocated, *@outs is set to it.
+ * character.
*
* On error, -1 is returned, and errno is set to the error code. The following
* error codes can be expected:
@@ -511,7 +510,7 @@
* 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, int outs_len)
+int ntfs_mbstoucs(const char *ins, ntfschar **outs)
{
ntfschar *ucs;
const char *s;
@@ -525,12 +524,7 @@
errno = EINVAL;
return -1;
}
- ucs = *outs;
- ucs_len = outs_len;
- if (ucs && !ucs_len) {
- errno = ENAMETOOLONG;
- return -1;
- }
+
/* Determine the size of the multi-byte string in bytes. */
ins_size = strlen(ins);
/* Determine the length of the multi-byte string. */
@@ -562,31 +556,21 @@
}
/* Add the NULL terminator. */
ins_len++;
- if (!ucs) {
- ucs_len = ins_len;
- ucs = ntfs_malloc(ucs_len * sizeof(ntfschar));
- if (!ucs)
- return -1;
- }
+ 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 or abort. */
+ /* Reallocate memory if necessary. */
if (o >= ucs_len) {
ntfschar *tc;
- if (ucs == *outs) {
- errno = ENAMETOOLONG;
- return -1;
- }
- /*
- * We will never get here but hey, it's only a bit of
- * extra code...
- */
ucs_len = (ucs_len * sizeof(ntfschar) + 64) & ~63;
- tc = (ntfschar*)realloc(ucs, ucs_len);
+ tc = realloc(ucs, ucs_len);
if (!tc)
goto err_out;
ucs = tc;
@@ -626,15 +610,10 @@
#endif
/* Now write the NULL character. */
ucs[o] = cpu_to_le16(L'\0');
- if (*outs != ucs)
- *outs = ucs;
+ *outs = ucs;
return o;
err_out:
- if (ucs != *outs) {
- int eo = errno;
- free(ucs);
- errno = eo;
- }
+ free(ucs);
return -1;
}
@@ -725,7 +704,7 @@
{
ntfschar *ucs = NULL;
- if (s && ((*len = ntfs_mbstoucs(s, &ucs, 0)) == -1)) {
+ if (s && ((*len = ntfs_mbstoucs(s, &ucs)) == -1)) {
ntfs_log_perror("Couldn't convert '%s' to Unicode", s);
return NULL;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/libntfs-3g/volume.c new/ntfs-3g-1.2310/libntfs-3g/volume.c
--- old/ntfs-3g-1.2216/libntfs-3g/volume.c 2008-02-03 17:35:25.000000000 +0100
+++ new/ntfs-3g-1.2310/libntfs-3g/volume.c 2008-03-08 21:21:12.000000000 +0100
@@ -426,10 +426,6 @@
ntfs_volume *vol;
NTFS_BOOT_SECTOR *bs;
int eo;
-#ifdef DEBUG
- const char *OK = "OK\n";
- const char *FAILED = "FAILED\n";
-#endif
if (!dev || !dev->d_ops || !dev->d_name) {
errno = EINVAL;
@@ -460,7 +456,7 @@
/* ...->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 partition device");
+ ntfs_log_perror("Error opening '%s'", dev->d_name);
goto error_exit;
}
/* Attach the device to the volume. */
@@ -469,7 +465,6 @@
/* Now read the bootsector. */
br = ntfs_pread(dev, 0, sizeof(NTFS_BOOT_SECTOR), bs);
if (br != sizeof(NTFS_BOOT_SECTOR)) {
- ntfs_log_debug(FAILED);
if (br != -1)
errno = EINVAL;
if (!br)
@@ -637,7 +632,7 @@
return NULL;
}
- unicode_len = ntfs_mbstoucs(hiberfile, &unicode, 0);
+ unicode_len = ntfs_mbstoucs(hiberfile, &unicode);
if (unicode_len < 0) {
ntfs_log_perror("Couldn't convert 'hiberfil.sys' to Unicode");
goto out;
@@ -755,10 +750,6 @@
ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
{
s64 l;
-#ifdef DEBUG
- const char *OK = "OK\n";
- const char *FAILED = "FAILED\n";
-#endif
ntfs_volume *vol;
u8 *m = NULL, *m2 = NULL;
ntfs_attr_search_ctx *ctx = NULL;
@@ -802,7 +793,7 @@
}
vol->mftmirr_size = l;
}
- ntfs_log_debug("Comparing $MFTMirr to $MFT... ");
+ 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",
@@ -820,14 +811,12 @@
mrec = (MFT_RECORD*)(m + i * vol->mft_record_size);
if (mrec->flags & MFT_RECORD_IN_USE) {
if (ntfs_is_baad_recordp(mrec)) {
- ntfs_log_debug("FAILED\n");
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_debug("FAILED\n");
ntfs_log_error("$MFT error: Invalid mft "
"record for '%s'.\n", s);
goto io_error_exit;
@@ -836,62 +825,53 @@
mrec2 = (MFT_RECORD*)(m2 + i * vol->mft_record_size);
if (mrec2->flags & MFT_RECORD_IN_USE) {
if (ntfs_is_baad_recordp(mrec2)) {
- ntfs_log_debug("FAILED\n");
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_debug("FAILED\n");
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_debug(FAILED);
ntfs_log_error("$MFTMirr does not match $MFT (record "
"%d).\n", i);
goto io_error_exit;
}
}
- ntfs_log_debug(OK);
free(m2);
free(m);
m = m2 = NULL;
/* Now load the bitmap from $Bitmap. */
- ntfs_log_debug("Loading $Bitmap... ");
+ ntfs_log_debug("Loading $Bitmap...\n");
vol->lcnbmp_ni = ntfs_inode_open(vol, FILE_Bitmap);
if (!vol->lcnbmp_ni) {
- ntfs_log_debug(FAILED);
- ntfs_log_perror("Failed to open inode");
+ ntfs_log_perror("Failed to open inode FILE_Bitmap");
goto error_exit;
}
/* Get an ntfs attribute for $Bitmap/$DATA. */
vol->lcnbmp_na = ntfs_attr_open(vol->lcnbmp_ni, AT_DATA, AT_UNNAMED, 0);
if (!vol->lcnbmp_na) {
- ntfs_log_debug(FAILED);
ntfs_log_perror("Failed to open ntfs attribute");
goto error_exit;
}
/* Done with the $Bitmap mft record. */
- ntfs_log_debug(OK);
/* Now load the upcase table from $UpCase. */
- ntfs_log_debug("Loading $UpCase... ");
+ ntfs_log_debug("Loading $UpCase...\n");
ni = ntfs_inode_open(vol, FILE_UpCase);
if (!ni) {
- ntfs_log_debug(FAILED);
- ntfs_log_perror("Failed to open inode");
+ 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_debug(FAILED);
ntfs_log_perror("Failed to open ntfs attribute");
goto error_exit;
}
@@ -902,7 +882,6 @@
* characters.
*/
if (na->data_size & ~0x1ffffffffULL) {
- ntfs_log_debug(FAILED);
ntfs_log_error("Error: Upcase table is too big (max 32-bit "
"allowed).\n");
errno = EINVAL;
@@ -913,15 +892,12 @@
/* Throw away default table. */
free(vol->upcase);
vol->upcase = ntfs_malloc(na->data_size);
- if (!vol->upcase) {
- ntfs_log_debug(FAILED);
+ 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_debug(FAILED);
ntfs_log_error("Failed to read $UpCase, unexpected length "
"(%lld != %lld).\n", (long long)l,
(long long)na->data_size);
@@ -929,7 +905,6 @@
goto error_exit;
}
/* Done with the $UpCase mft record. */
- ntfs_log_debug(OK);
ntfs_attr_close(na);
if (ntfs_inode_close(ni)) {
ntfs_log_perror("Failed to close $UpCase");
@@ -940,11 +915,10 @@
* Now load $Volume and set the version information and flags in the
* vol structure accordingly.
*/
- ntfs_log_debug("Loading $Volume... ");
+ ntfs_log_debug("Loading $Volume...\n");
vol->vol_ni = ntfs_inode_open(vol, FILE_Volume);
if (!vol->vol_ni) {
- ntfs_log_debug(FAILED);
- ntfs_log_perror("Failed to open inode");
+ ntfs_log_perror("Failed to open inode FILE_Volume");
goto error_exit;
}
/* Get a search context for the $Volume/$VOLUME_INFORMATION lookup. */
@@ -955,7 +929,6 @@
/* Find the $VOLUME_INFORMATION attribute. */
if (ntfs_attr_lookup(AT_VOLUME_INFORMATION, AT_UNNAMED, 0, 0, 0, NULL,
0, ctx)) {
- ntfs_log_debug(FAILED);
ntfs_log_perror("$VOLUME_INFORMATION attribute not found in "
"$Volume");
goto error_exit;
@@ -963,7 +936,6 @@
a = ctx->attr;
/* Has to be resident. */
if (a->non_resident) {
- ntfs_log_debug(FAILED);
ntfs_log_error("Attribute $VOLUME_INFORMATION must be "
"resident but it isn't.\n");
errno = EIO;
@@ -976,7 +948,6 @@
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_debug(FAILED);
ntfs_log_error("$VOLUME_INFORMATION in $Volume is corrupt.\n");
errno = EIO;
goto error_exit;
@@ -994,7 +965,6 @@
if (ntfs_attr_lookup(AT_VOLUME_NAME, AT_UNNAMED, 0, 0, 0, NULL, 0,
ctx)) {
if (errno != ENOENT) {
- ntfs_log_debug(FAILED);
ntfs_log_perror("Failed to lookup of $VOLUME_NAME in "
"$Volume failed");
goto error_exit;
@@ -1005,16 +975,13 @@
* had zero length.
*/
vol->vol_name = ntfs_malloc(1);
- if (!vol->vol_name) {
- ntfs_log_debug(FAILED);
+ 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_debug(FAILED);
ntfs_log_error("$VOLUME_NAME must be resident.\n");
errno = EIO;
goto error_exit;
@@ -1033,10 +1000,9 @@
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) {
- ntfs_log_debug(FAILED);
+ if (!vol->vol_name)
goto error_exit;
- }
+
for (j = 0; j < (s32)u; j++) {
ntfschar uc = le16_to_cpu(vname[j]);
if (uc > 0xff)
@@ -1046,27 +1012,23 @@
vol->vol_name[u] = '\0';
}
}
- ntfs_log_debug(OK);
ntfs_attr_put_search_ctx(ctx);
ctx = NULL;
/* Now load the attribute definitions from $AttrDef. */
- ntfs_log_debug("Loading $AttrDef... ");
+ ntfs_log_debug("Loading $AttrDef...\n");
ni = ntfs_inode_open(vol, FILE_AttrDef);
if (!ni) {
- ntfs_log_debug(FAILED);
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_debug(FAILED);
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_debug(FAILED);
ntfs_log_error("Attribute definition table is too big (max "
"32-bit allowed).\n");
errno = EINVAL;
@@ -1074,14 +1036,11 @@
}
vol->attrdef_len = na->data_size;
vol->attrdef = ntfs_malloc(na->data_size);
- if (!vol->attrdef) {
- ntfs_log_debug(FAILED);
+ 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_debug(FAILED);
ntfs_log_error("Failed to read $AttrDef, unexpected length "
"(%lld != %lld).\n", (long long)l,
(long long)na->data_size);
@@ -1089,7 +1048,6 @@
goto error_exit;
}
/* Done with the $AttrDef mft record. */
- ntfs_log_debug(OK);
ntfs_attr_close(na);
if (ntfs_inode_close(ni)) {
ntfs_log_perror("Failed to close $AttrDef");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/src/ntfs-3g.c new/ntfs-3g-1.2310/src/ntfs-3g.c
--- old/ntfs-3g-1.2216/src/ntfs-3g.c 2008-02-16 18:05:38.000000000 +0100
+++ new/ntfs-3g-1.2310/src/ntfs-3g.c 2008-03-09 14:29:29.000000000 +0100
@@ -321,7 +321,7 @@
*path = strsep(&stream_name_mbs, ":");
if (stream_name_mbs) {
*stream_name = NULL;
- res = ntfs_mbstoucs(stream_name_mbs, stream_name, 0);
+ res = ntfs_mbstoucs(stream_name_mbs, stream_name);
if (res < 0)
return -errno;
return res;
@@ -827,7 +827,7 @@
/* Generate unicode filename. */
name = strrchr(path, '/');
name++;
- uname_len = ntfs_mbstoucs(name, &uname, 0);
+ uname_len = ntfs_mbstoucs(name, &uname);
if (uname_len < 0) {
res = -errno;
goto exit;
@@ -847,7 +847,7 @@
dev);
break;
case S_IFLNK:
- utarget_len = ntfs_mbstoucs(target, &utarget, 0);
+ utarget_len = ntfs_mbstoucs(target, &utarget);
if (utarget_len < 0) {
res = -errno;
goto exit;
@@ -985,7 +985,7 @@
/* Generate unicode filename. */
name = strrchr(path, '/');
name++;
- uname_len = ntfs_mbstoucs(name, &uname, 0);
+ uname_len = ntfs_mbstoucs(name, &uname);
if (uname_len < 0) {
res = -errno;
goto exit;
@@ -1039,7 +1039,7 @@
/* Generate unicode filename. */
name = strrchr(path, '/');
name++;
- uname_len = ntfs_mbstoucs(name, &uname, 0);
+ uname_len = ntfs_mbstoucs(name, &uname);
if (uname_len < 0) {
res = -errno;
goto exit;
@@ -1456,7 +1456,7 @@
ni = ntfs_pathname_to_inode(vol, NULL, path);
if (!ni)
return -errno;
- lename_len = ntfs_mbstoucs(name + nf_ns_xattr_preffix_len, &lename, 0);
+ lename_len = ntfs_mbstoucs(name + nf_ns_xattr_preffix_len, &lename);
if (lename_len == -1) {
res = -errno;
goto exit;
@@ -1504,7 +1504,7 @@
ni = ntfs_pathname_to_inode(vol, NULL, path);
if (!ni)
return -errno;
- lename_len = ntfs_mbstoucs(name + nf_ns_xattr_preffix_len, &lename, 0);
+ lename_len = ntfs_mbstoucs(name + nf_ns_xattr_preffix_len, &lename);
if (lename_len == -1) {
res = -errno;
goto exit;
@@ -1562,7 +1562,7 @@
ni = ntfs_pathname_to_inode(vol, NULL, path);
if (!ni)
return -errno;
- lename_len = ntfs_mbstoucs(name + nf_ns_xattr_preffix_len, &lename, 0);
+ lename_len = ntfs_mbstoucs(name + nf_ns_xattr_preffix_len, &lename);
if (lename_len == -1) {
res = -errno;
goto exit;
@@ -2172,10 +2172,6 @@
struct fuse *fh = NULL;
struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
- /* Libfuse can't always find fusermount, so let's help it. */
- if (setenv("PATH", ":/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin", 0))
- ntfs_log_perror("WARNING: Failed to set $PATH\n");
-
ctx->fc = try_fuse_mount(parsed_options);
if (!ctx->fc)
return NULL;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ntfs-3g-1.2216/src/utils.c new/ntfs-3g-1.2310/src/utils.c
--- old/ntfs-3g-1.2216/src/utils.c 2008-02-16 15:25:23.000000000 +0100
+++ new/ntfs-3g-1.2310/src/utils.c 2008-03-08 21:21:13.000000000 +0100
@@ -90,7 +90,7 @@
"to mount NTFS. Please see the 'dmraid' documentation for help.\n";
static const char *access_denied_msg =
-"Please check the volume and the ntfs-3g binary permissions,\n"
+"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-3g-permssions.patch ++++++
++++ 7365 lines (skipped)
++++++ ntfs-3g-unixmapping.patch ++++++
# This maps Linux uids and gids to SIDs which can be defined in
<Volume>/.NTFS-3G/UserMapping
For information how this works, please see:
http://pagesperso-orange.fr/b.andre/security.html
For this patch to work, <Volume>/.NTFS-3G/UserMapping must exist
and must contain at least one valid uid or gid entry (for now,
will be fixed).
The default uid/gid <-> SID mapping used in this patch is:
S-1-5-21-<$UID>-0-0-1024
S-1-5-21-<$GID>-0-0-1025
With a line like this, that can be changed, e.g. this
is the same as the default mapping:
::S-1-5-21-0-0-0-1024
-----------^
This column get the uid/gid, in this example.
Constraint: The last field must contain an even number >1000.
Author: Bernhard Kaindl
--- ntfs-3g-1.2216SC.2/libntfs-3g/security.c 2008-03-05 20:46:52.000000000 +0100
+++ ntfs-3g-1.2216SC.2.unixmapping/libntfs-3g/security.c 2008-03-11 01:30:24.000000000 +0100
@@ -262,6 +262,36 @@
static const SID *ownersid = (const SID*)ownersidbytes;
+/*
+ * SID template for on-demand anonymous Unix user use
+ */
+static char unix_usidbytes[] = {
+ 1, /* revision */
+ 5, /* auth count */
+ 0, 0, 0, 0, 0, 5, /* base */
+ 21, 0, 0, 0, /* 1st level */
+ 0, 0, 0, 0, /* 2nd level */
+ 0, 0, 0, 0, /* 3rd level */
+ 0, 0, 0, 0, /* 4th level */
+ 0, 3, 0, 0 /* 5th level */
+};
+static SID *unix_usid;
+
+/*
+ * SID template for on-demand anonymous Unix group use
+ */
+static char unix_gsidbytes[] = {
+ 1, /* revision */
+ 5, /* auth count */
+ 0, 0, 0, 0, 0, 5, /* base */
+ 21, 0, 0, 0, /* 1st level */
+ 0, 0, 0, 0, /* 2nd level */
+ 0, 0, 0, 0, /* 3rd level */
+ 0, 0, 0, 0, /* 4th level */
+ 1, 3, 0, 0 /* 5th level */
+};
+static SID *unix_gsid;
+
/**
* ntfs_guid_is_zero - check if a GUID is zero
* @guid: [IN] guid to check
@@ -1514,6 +1524,11 @@
p = scx->usermapping;
while (p && !same_sid(usid, p->sid))
p = p->next;
+ if (!p) {
+ unix_usid->sub_authority[1] = usid->sub_authority[1];
+ if (same_sid(unix_usid, usid))
+ return le32_to_cpu(unix_usid->sub_authority[1]);
+ }
return (p ? p->xid : 0);
}
@@ -1531,6 +1546,11 @@
p = scx->groupmapping;
while (p && !same_sid(gsid, p->sid))
p = p->next;
+ if (!p) {
+ unix_gsid->sub_authority[1] = gsid->sub_authority[1];
+ if (same_sid(unix_gsid, gsid))
+ return le32_to_cpu(unix_gsid->sub_authority[1]);
+ }
return (p ? p->xid : 0);
}
@@ -1551,6 +1571,10 @@
while (p && ((uid_t)p->xid != uid))
p = p->next;
sid = (p ? p->sid : (const SID*)NULL);
+ if (!sid) {
+ unix_usid->sub_authority[1] = cpu_to_le32(uid);
+ sid = unix_usid;
+ }
}
return (sid);
}
@@ -1572,6 +1596,10 @@
while (p && ((gid_t)p->xid != gid))
p = p->next;
sid = (p ? p->sid : (const SID*)NULL);
+ if (!sid) {
+ unix_gsid->sub_authority[1] = cpu_to_le32(gid);
+ sid = unix_gsid;
+ }
}
return (sid);
}
@@ -4041,6 +4069,26 @@
}
/*
+ * Get the unix mapping template entry
+ * parses the passed sidstr and uses it to setting up a unix-only mapping
+ */
+
+static inline BOOL ntfs_get_unixmapping(const char *sidstr)
+{
+ unix_usid = encodesid(sidstr);
+ unix_gsid = encodesid(sidstr);
+ if (unix_gsid->sub_authority_count >= 2
+ && unix_gsid->sub_authority[unix_gsid->sub_authority_count-1] > 1000
+ && !(unix_gsid->sub_authority[unix_gsid->sub_authority_count-1] & 1)) {
+ unix_gsid->sub_authority[unix_gsid->sub_authority_count-1]++;
+ return TRUE;
+ }
+ free(unix_usid);
+ free(unix_gsid);
+ return FALSE;
+}
+
+/*
* Build the group mapping list
* group identification may be given in symbolic or numeric format
*
@@ -4060,6 +4108,7 @@
struct MAPPING *mapping;
struct group *grp;
BOOL uidpresent;
+ BOOL gidpresent;
BOOL ok;
int step;
SID *sid;
@@ -4070,6 +4119,12 @@
for (step=1; step<=2; step++) {
for (item = firstitem; item; item = item->next) {
uidpresent = (item->uidstr[0] != '\0');
+ gidpresent = (item->gidstr[0] != '\0');
+ if (!uidpresent && !gidpresent && !unix_usid) {
+ if (!ntfs_get_unixmapping(item->sidstr))
+ unix_usid = NULL;
+ continue;
+ }
ok = (step == 1 ? !uidpresent : uidpresent);
if ((item->gidstr[0] >= '0')
&& (item->gidstr[0] <= '9'))
@@ -4100,6 +4156,10 @@
}
}
}
+ if (!unix_usid) {
+ unix_usid = (SID*)unix_usidbytes;
+ unix_gsid = (SID*)unix_gsidbytes;
+ }
return (firstmapping);
}
++++++ ntfs-3g-utf8-fallback.patch ++++++
- bk@suse.de:
#
# 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
#
--- include/ntfs-3g/unistr.h
+++ include/ntfs-3g/unistr.h
@@ -26,6 +26,8 @@
#include "types.h"
#include "layout.h"
+extern int use_utf8;
+
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);
--- libntfs-3g/unistr.c
+++ libntfs-3g/unistr.c
@@ -47,6 +47,8 @@
#include "logging.h"
#include "misc.h"
+int use_utf8;
+
/*
* IMPORTANT
* =========
@@ -373,6 +375,85 @@ int ntfs_file_values_compare(const FILE_
err_val, ic, upcase, upcase_len);
}
+/* Return the amount of 16-bit elements in UTF-16LE needed (without
+ * the terminating null to store given UTF-8 string and -1 if it does
+ * noy fit into PATH_MAX
+ * TODO: Extend this with a function to suppport UTF-16LE.
+*/
+static int ucs2_to_utf8_size(const ntfschar *ins, const int ins_len, int outs_len)
+{
+ int i;
+ int count = 0;
+
+ for (i = 0; i < ins_len && ins[i]; i++) {
+ unsigned short c = le16_to_cpu(ins[i]);
+ if (c < 0x80)
+ count++;
+ else
+ count += (c & 0xf800) ? 3 : 2;
+ if (count > outs_len)
+ goto fail;
+ }
+ return count;
+fail:
+ return -1;
+}
+
+/*
+ * ntfs_ucs_to_utf8 - convert a little endian Unicode string to an UTF-8 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
+ * TODO: Replace this with a function which converts from UTF-16LE because
+ * NTFS uses UTF-16LE. UTF-16 supports more rare/unusual characters than UCS-2
+ */
+int ntfs_ucs_to_utf8(const ntfschar *ins, const int ins_len, char **outs, int outs_len)
+{
+ char *t, *end;
+ int i, size;
+
+ if (!*outs)
+ outs_len = PATH_MAX;
+
+ size = ucs2_to_utf8_size(ins, ins_len, outs_len);
+
+ if (size < 0) {
+ errno = ENAMETOOLONG;
+ goto fail;
+ }
+ if (!*outs)
+ *outs = ntfs_malloc((outs_len = size + 1));
+
+ t = *outs;
+ end = t + outs_len;
+
+ for (i = 0; i < ins_len && ins[i]; i++) {
+ unsigned short c = le16_to_cpu(ins[i]);
+ if (c < 0x80) {
+ *t++ = c;
+ if (t == end)
+ goto fail;
+ } else {
+ if (c & 0xf800) {
+ if (t+3 >= end)
+ goto fail;
+ *t++ = 0xe0 | (c >> 12);
+ *t++ = 0x80 | ((c >> 6) & 0x3f);
+ } else {
+ if (t+2 >= end)
+ goto fail;
+ *t++ = (0xc0 | ((c >> 6) & 0x3f));
+ }
+ *t++ = 0x80 | (c & 0x3f);
+ }
+ }
+ *t = '\0';
+ return t - *outs;
+fail:
+ return -1;
+}
+
/**
* ntfs_ucstombs - convert a little endian Unicode string to a multibyte string
* @ins: input Unicode string buffer
@@ -397,6 +478,8 @@ int ntfs_file_values_compare(const FILE_
* sequence according to the current locale.
* ENAMETOOLONG Destination buffer is too small for input string.
* ENOMEM Not enough memory to allocate destination buffer.
+ * TODO: Replace this with a function which converts from UTF-16LE because
+ * NTFS uses UTF-16LE. UTF-16 supports more rare/unusual characters than UCS-2
*/
int ntfs_ucstombs(const ntfschar *ins, const int ins_len, char **outs,
int outs_len)
@@ -419,12 +502,15 @@ int ntfs_ucstombs(const ntfschar *ins, c
errno = ENAMETOOLONG;
return -1;
}
+ if (use_utf8)
+ return ntfs_ucs_to_utf8(ins, ins_len, outs, outs_len);
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
@@ -487,6 +573,107 @@ err_out:
return -1;
}
+/* Return the amount of 16-bit elements in UTF-16LE needed (without
+ * the terminating null to store given UTF-8 string and -1 if it does
+ * noy fit into PATH_MAX
+ * TODO: Extend this with a function to suppport UTF-16LE.
+*/
+static int utf8_to_ucs2_size(const char *s)
+{
+ unsigned int byte;
+ size_t count = 0;
+
+ while ((byte = *((unsigned char *)s++))) {
+ if (++count >= PATH_MAX || byte >= 0xF0)
+ goto fail;
+ if (!*s) break;
+ if (byte >= 0xC0) s++;
+ if (!*s) break;
+ if (byte >= 0xE0) s++;
+ }
+ return count;
+fail:
+ return -1;
+}
+/* This converts one UTF-8 sequence to cpu-endian UCS-2
+ * TODO: Replace this with a function which converts to UTF-16LE because
+ * NTFS uses UTF-16LE. UTF-16 supports more rare/unusual characters than UCS-2
+*/
+static int utf8toucs2(wchar_t *wc, const char *s)
+{
+ unsigned int byte = *((unsigned char *)s);
+
+ if (byte == 0) {
+ *wc = (wchar_t) 0;
+ return 0;
+ } else if (byte < 0xC0) {
+ *wc = (wchar_t) byte;
+ return 1;
+ } else if (byte < 0xE0) {
+ if(strlen(s) < 2)
+ goto fail;
+ if ((s[1] & 0xC0) == 0x80) {
+ *wc = (wchar_t) (((byte & 0x1F) << 6) | (s[1] & 0x3F));
+ return 2;
+ } else
+ goto fail;
+ } else if (byte < 0xF0) {
+ if(strlen(s) < 3)
+ goto fail;
+ if (((s[1] & 0xC0) == 0x80) && ((s[2] & 0xC0) == 0x80)) {
+ *wc = (wchar_t) (((byte & 0x0F) << 12)
+ | ((s[1] & 0x3F) << 6) | (s[2] & 0x3F));
+ /* Surrogates range */
+ if((*wc >= 0xD800 && *wc <= 0xDFFF) ||
+ (*wc == 0xFFFE || *wc == 0xFFFF))
+ goto fail;
+ return 3;
+ }
+ }
+fail:
+ return -1;
+}
+
+/**
+ * ntfs_utf8_to_ucs - convert a UTF-8 string to a UCS-2LE Unicode string
+ * @ins: input multibyte string buffer
+ * @outs: on return contains the (allocated) output Unicode string
+ * @outs_len: length of output buffer in Unicode characters
+ * TODO: Replace this with a function which converts to UTF-16LE because
+ * NTFS uses UTF-16LE. UTF-16 supports more rare/unusual characters than UCS-2
+ */
+int ntfs_utf8_to_ucs(const char *ins, ntfschar **outs)
+{
+ const char *t = ins;
+ wchar_t wc;
+ ntfschar *outpos;
+ int shorts = utf8_to_ucs2_size(ins);
+
+ if (shorts < 0) {
+ errno = EILSEQ;
+ goto fail;
+ }
+ if (!*outs)
+ *outs = ntfs_malloc((shorts+1) * sizeof(ntfschar));
+
+ outpos = *outs;
+
+ while(1) {
+ int m = utf8toucs2(&wc, t);
+ if (m < 0) {
+ errno = EILSEQ;
+ goto fail;
+ }
+ *outpos++ = cpu_to_le16(wc);
+ if (m == 0)
+ break;
+ t += m;
+ }
+ return --outpos - *outs;
+fail:
+ return -1;
+}
+
/**
* ntfs_mbstoucs - convert a multibyte string to a little endian Unicode string
* @ins: input multibyte string buffer
@@ -509,6 +696,8 @@ err_out:
* string according to the current locale.
* ENAMETOOLONG Destination buffer is too small for input string.
* ENOMEM Not enough memory to allocate destination buffer.
+ * TODO: Replace this with a function which converts to UTF-16LE because
+ * NTFS uses UTF-16LE. UTF-16 supports more rare/unusual characters than UCS-2
*/
int ntfs_mbstoucs(const char *ins, ntfschar **outs)
{
@@ -524,6 +713,8 @@ int ntfs_mbstoucs(const char *ins, ntfsc
errno = EINVAL;
return -1;
}
+ if (use_utf8)
+ return ntfs_utf8_to_ucs(ins, outs);
/* Determine the size of the multi-byte string in bytes. */
ins_size = strlen(ins);
--- src/ntfs-3g.c
+++ src/ntfs-3g.c
@@ -69,6 +69,7 @@
#include
#include
#include
+#include
#ifdef HAVE_SETXATTR
#include
@@ -2224,6 +2225,15 @@ static void setup_logging(char *parsed_o
ntfs_log_info("Mount options: %s\n", parsed_options);
}
+void check_codeset() {
+ char *codeset = nl_langinfo(CODESET);
+ if (!codeset || !strncmp(codeset, "ANSI", 4)) {
+ ntfs_log_info("Locale invalid or has ANSI codeset: "
+ "Using UTF-8 for international characters.\n");
+ use_utf8 = 1;
+ }
+}
+
int main(int argc, char *argv[])
{
char *parsed_options = NULL;
@@ -2260,6 +2270,8 @@ int main(int argc, char *argv[])
err = NTFS_VOLUME_SYNTAX_ERROR;
goto err_out;
}
+
+ check_codeset();
#if defined(linux) || defined(__uClinux__)
fstype = get_fuse_fstype();
++++++ ntfs-3g-warnings.patch ++++++
--- /var/tmp/diff_new_pack.U13581/_old 2008-03-21 04:08:17.000000000 +0100
+++ /var/tmp/diff_new_pack.U13581/_new 2008-03-21 04:08:17.000000000 +0100
@@ -11,35 +11,6 @@
fchdir(currdir_fd);
close(currdir_fd);
}
-# Unused:
---- libfuse-lite/fuse_lowlevel.c 2008/02/18 15:57:00 1.1
-+++ libfuse-lite/fuse_lowlevel.c 2008/02/18 15:58:54
-@@ -1296,25 +1296,3 @@
- out:
- return NULL;
- }
--
--
--struct fuse_session *fuse_lowlevel_new(struct fuse_args *args,
-- const struct fuse_lowlevel_ops *op,
-- size_t op_size, void *userdata)
--{
-- return fuse_lowlevel_new_common(args, op, op_size, userdata);
--}
--
--
--struct fuse_ll_compat_conf {
-- unsigned max_read;
-- int set_max_read;
--};
--
--static const struct fuse_opt fuse_ll_opts_compat[] = {
-- { "max_read=", offsetof(struct fuse_ll_compat_conf, set_max_read), 1 },
-- { "max_read=%u", offsetof(struct fuse_ll_compat_conf, max_read), 0 },
-- FUSE_OPT_KEY("max_read=", FUSE_OPT_KEY_KEEP),
-- FUSE_OPT_END
--};
--
attrib.c:144: error: passing argument 1 of 'ntfs_log_redirect' discards qualifiers from pointer target type
--- include/ntfs-3g/logging.h 2008/02/18 18:09:34 1.1
+++ include/ntfs-3g/logging.h 2008/02/18 18:10:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org