]> wimlib.net Git - wimlib/commitdiff
Honor WIM_HDR_FLAG_READONLY
authorEric Biggers <ebiggers3@gmail.com>
Wed, 22 May 2013 00:37:37 +0000 (19:37 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 22 May 2013 00:37:37 +0000 (19:37 -0500)
include/wimlib.h
src/util.c
src/wim.c

index c1c00e42dc66d70104128d6e4c441b1cc2c313dd..b7a21cf443ecb078c0b7694cfd7bc6164f828b89 100644 (file)
@@ -1022,6 +1022,7 @@ enum wimlib_error_code {
        WIMLIB_ERR_VOLUME_LACKS_FEATURES,
        WIMLIB_ERR_WRITE,
        WIMLIB_ERR_XML,
        WIMLIB_ERR_VOLUME_LACKS_FEATURES,
        WIMLIB_ERR_WRITE,
        WIMLIB_ERR_XML,
+       WIMLIB_ERR_WIM_IS_MARKED_READONLY,
 };
 
 
 };
 
 
index 6b93e2a93bab0daf16e0c20c990fa871d7b005c7..87dd3c50f8585d92bb984040185d36d7f7353348 100644 (file)
@@ -389,6 +389,8 @@ static const tchar *error_strings[] = {
                = T("The requested operation is unsupported"),
        [WIMLIB_ERR_VOLUME_LACKS_FEATURES]
                = T("The volume did not support a feature necessary to complete the operation"),
                = T("The requested operation is unsupported"),
        [WIMLIB_ERR_VOLUME_LACKS_FEATURES]
                = T("The volume did not support a feature necessary to complete the operation"),
+       [WIMLIB_ERR_WIM_IS_MARKED_READONLY]
+               = T("The WIM is marked as read-only"),
        [WIMLIB_ERR_WRITE]
                = T("Failed to write data to a file"),
        [WIMLIB_ERR_XML]
        [WIMLIB_ERR_WRITE]
                = T("Failed to write data to a file"),
        [WIMLIB_ERR_XML]
index 9e73c7617a9b16b7e4b376338058ff0dc0c10b44..4a8e6a8be828c8a5282a0993ea96daf4a0f8293e 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -676,12 +676,15 @@ int
 can_modify_wim(WIMStruct *wim)
 {
        if (wim->hdr.total_parts != 1) {
 can_modify_wim(WIMStruct *wim)
 {
        if (wim->hdr.total_parts != 1) {
-               if (wim->filename)
-                       ERROR("Cannot modify \"%"TS"\": is a split WIM!", wim->filename);
-               else
-                       ERROR("Cannot modify a split WIM!");
+               ERROR("Cannot modify \"%"TS"\": is part of a spanned set",
+                     wim->filename);
                return WIMLIB_ERR_SPLIT_UNSUPPORTED;
        }
                return WIMLIB_ERR_SPLIT_UNSUPPORTED;
        }
+       if (wim->hdr.flags & WIM_HDR_FLAG_READONLY) {
+               ERROR("Cannot modify \"%"TS"\": is marked read-only",
+                     wim->filename);
+               return WIMLIB_ERR_WIM_IS_MARKED_READONLY;
+       }
        return 0;
 }
 
        return 0;
 }