]> wimlib.net Git - wimlib/commitdiff
ntfs-3g_apply.c: open $Secure
authorEric Biggers <ebiggers3@gmail.com>
Fri, 29 Jul 2016 21:43:57 +0000 (14:43 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 29 Jul 2016 22:12:43 +0000 (15:12 -0700)
NEWS
src/ntfs-3g_apply.c

diff --git a/NEWS b/NEWS
index 4eac4fd74a33d7563fd706fa902172dfc9e85137..2d21c49e78ba2e4ca50b01f794d6407de047d5c7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,9 @@ Version 1.10.0-BETA:
 
        Reduced memory usage slightly.
 
+       When a WIM image is applied in NTFS-3G mode, security descriptors are
+       now created in NTFS v3.0 format when supported by the volume.
+
        Workarounds for bugs in libntfs-3g version 2013.1.13 and earlier have
        been removed.  Users are advised to upgrade to a later version of
        libntfs-3g.
index 486f889063e2bb290315e756f9b47fa24c3666f3..b8b612967ed40e522d12b3cb400bd4b363bce2e0 100644 (file)
@@ -914,6 +914,16 @@ ntfs_3g_extract(struct list_head *dentry_list, struct apply_ctx *_ctx)
        }
        ctx->vol = vol;
 
+       /* Opening $Secure is required to set security descriptors in NTFS v3.0
+        * format, where security descriptors are stored in a per-volume index
+        * rather than being fully specified for each file.  */
+       if (ntfs_open_secure(vol) && vol->major_ver >= 3) {
+               ERROR_WITH_ERRNO("Unable to open security descriptor index of "
+                                "NTFS volume \"%s\"", ctx->common.target);
+               ret = WIMLIB_ERR_NTFS_3G;
+               goto out_unmount;
+       }
+
        /* Create all inodes and aliases, including short names, and set
         * metadata (attributes, security descriptors, and timestamps).  */
 
@@ -948,6 +958,17 @@ ntfs_3g_extract(struct list_head *dentry_list, struct apply_ctx *_ctx)
         * ntfs_set_ntfs_dos_name() does, but we handle this elsewhere).  */
 
 out_unmount:
+       if (vol->secure_ni) {
+               ntfs_index_ctx_put(vol->secure_xsii);
+               ntfs_index_ctx_put(vol->secure_xsdh);
+               if (ntfs_inode_close(vol->secure_ni) && !ret) {
+                       ERROR_WITH_ERRNO("Failed to close security descriptor "
+                                        "index of NTFS volume \"%s\"",
+                                        ctx->common.target);
+                       ret = WIMLIB_ERR_NTFS_3G;
+               }
+               vol->secure_ni = NULL;
+       }
        if (ntfs_umount(ctx->vol, FALSE) && !ret) {
                ERROR_WITH_ERRNO("Failed to unmount \"%s\" with NTFS-3G",
                                 ctx->common.target);