Comments, function renaming
authorEric Biggers <ebiggers3@gmail.com>
Sun, 26 Aug 2012 18:38:43 +0000 (13:38 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 26 Aug 2012 18:38:43 +0000 (13:38 -0500)
src/ntfs-3g_security.c
src/ntfs-apply.c

index a596b28cd8f966bac47bbd0872e6ad28e14278c8..de26d28b1a3214d683576a0b9c43c110964fd8dc 100644 (file)
@@ -4828,8 +4828,7 @@ static BOOL _ntfs_valid_descr(const char *securattr, unsigned int attrsz)
  *
  * Returns nonzero on success
  */
-int _ntfs_set_file_security(ntfs_inode *ni, u32 selection,
-                           const char *attr)
+int ntfs_inode_set_security(ntfs_inode *ni, u32 selection, const char *attr)
 {
        const SECURITY_DESCRIPTOR_RELATIVE *phead;
        int attrsz;
@@ -4996,7 +4995,7 @@ int ntfs_inode_get_attributes(ntfs_inode *ni)
  *
  * Returns nonzero on success
  */
-int _ntfs_set_file_attributes(ntfs_inode *ni, s32 attrib)
+int ntfs_inode_set_attributes(ntfs_inode *ni, s32 attrib)
 {
        le32 settable = FILE_ATTR_SETTABLE;
        ATTR_FLAGS dirflags;
index 0ca1951d153f0493bccae8a7fb2e88a7c04abea1..c4e09fe5e32712151c6092e5101bc1fdd082fb91 100644 (file)
@@ -49,9 +49,9 @@ struct ntfs_apply_args {
        WIMStruct *w;
 };
 
-extern int _ntfs_set_file_security(ntfs_inode *ni, u32 selection,
+extern int ntfs_inode_set_security(ntfs_inode *ni, u32 selection,
                                   const char *attr);
-extern int _ntfs_set_file_attributes(ntfs_inode *ni, s32 attrib);
+extern int ntfs_inode_set_attributes(ntfs_inode *ni, s32 attrib);
 
 /* 
  * Extracts a WIM resource to a NTFS attribute.
@@ -85,7 +85,7 @@ extract_wim_resource_to_ntfs_attr(const struct lookup_table_entry *lte,
        sha1_final(hash, &ctx);
        if (!hashes_equal(hash, lte->hash)) {
                ERROR("Invalid checksum on a WIM resource "
-                     "(detected when extracting to NTFS stream file)");
+                     "(detected when extracting to NTFS stream)");
                ERROR("The following WIM resource is invalid:");
                print_lookup_table_entry(lte);
                return WIMLIB_ERR_INVALID_RESOURCE_HASH;
@@ -191,7 +191,7 @@ apply_file_attributes_and_security_data(ntfs_inode *ni,
 {
        DEBUG("Setting NTFS file attributes on `%s' to %#"PRIx32,
              dentry->full_path_utf8, dentry->attributes);
-       if (!_ntfs_set_file_attributes(ni, dentry->attributes)) {
+       if (!ntfs_inode_set_attributes(ni, dentry->attributes)) {
                ERROR("Failed to set NTFS file attributes on `%s'",
                       dentry->full_path_utf8);
                return WIMLIB_ERR_NTFS_3G;
@@ -209,7 +209,7 @@ apply_file_attributes_and_security_data(ntfs_inode *ni,
                                DACL_SECURITY_INFORMATION  |
                                SACL_SECURITY_INFORMATION;
                                
-               if (!_ntfs_set_file_security(ni, selection,
+               if (!ntfs_inode_set_security(ni, selection,
                                             sd->descriptors[dentry->security_id]))
                {
                        ERROR_WITH_ERRNO("Failed to set security data on `%s'",
@@ -356,6 +356,8 @@ static int do_wim_apply_dentry_ntfs(struct dentry *dentry, ntfs_inode *dir_ni,
        } else {
                struct dentry *other;
 
+               /* Apply hard-linked directory in same directory with DOS name
+                * (if there is one) before this dentry */
                ret = preapply_dentry_with_dos_name(dentry, &dir_ni, w);
                if (ret != 0)
                        return ret;
@@ -365,6 +367,9 @@ static int do_wim_apply_dentry_ntfs(struct dentry *dentry, ntfs_inode *dir_ni,
                list_for_each_entry(other, &dentry->link_group_list,
                                    link_group_list) {
                        if (other->extracted_file) {
+                               /* Already extracted another dentry in the hard
+                                * link group.  We can make a hard link instead
+                                * of extracting the file data. */
                                ret = wim_apply_hardlink_ntfs(dentry, other,
                                                              dir_ni, &ni);
                                is_hardlink = true;
@@ -374,7 +379,7 @@ static int do_wim_apply_dentry_ntfs(struct dentry *dentry, ntfs_inode *dir_ni,
                                        goto out_set_dos_name;
                        }
                }
-               /* Can't make a hard link */
+               /* Can't make a hard link; extract the file itself */
                FREE(dentry->extracted_file);
                dentry->extracted_file = STRDUP(dentry->full_path_utf8);
                if (!dentry->extracted_file) {