xfs
[Top] [All Lists]

[PATCH 3/4] xfs_repair: Improve warning for invalid attributes

To: xfs@xxxxxxxxxxx, david@xxxxxxxxxxxxx
Subject: [PATCH 3/4] xfs_repair: Improve warning for invalid attributes
From: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Date: Fri, 23 Oct 2015 21:17:07 +0200
Cc: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1445627828-14661-1-git-send-email-agruenba@xxxxxxxxxx>
References: <1445627828-14661-1-git-send-email-agruenba@xxxxxxxxxx>
Include the attribute name in the warning as a printf parameter instead of
hardcoding it for three different cases.

Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
---
 po/de.po             | 18 +++---------------
 po/pl.po             | 14 +++-----------
 repair/attr_repair.c | 16 +++++-----------
 3 files changed, 11 insertions(+), 37 deletions(-)

diff --git a/po/de.po b/po/de.po
index fc62525..e605c22 100644
--- a/po/de.po
+++ b/po/de.po
@@ -13543,21 +13543,9 @@ msgstr ""
 msgid "done\n"
 msgstr "erledigt\n"
 
-#: .././repair/attr_repair.c:106
-msgid ""
-"entry contains illegal value in attribute named SGI_ACL_FILE or "
-"SGI_ACL_DEFAULT\n"
-msgstr ""
-"Eintrag enthÃlt unerlaubten Wert im Attribut mit Namen SGI_ACL_FILE\n"
-"oder SGI_ACL_DEFAULT\n"
-
-#: .././repair/attr_repair.c:128
-msgid "entry contains illegal value in attribute named SGI_MAC_LABEL\n"
-msgstr "Eintrag enthÃlt unerlaubten Wert im Attribut mit Namen SGI_MAC_LABEL\n"
-
-#: .././repair/attr_repair.c:134
-msgid "entry contains illegal value in attribute named SGI_CAP_FILE\n"
-msgstr "Eintrag enthÃlt unerlaubten Wert im Attribut mit Namen SGI_CAP_FILE\n"
+#: .././repair/attr_repair.c:200
+msgid "entry contains illegal value in attribute named %.*s\n"
+msgstr "Eintrag enthÃlt unerlaubten Wert im Attribut mit Namen %.*s\n"
 
 #: .././repair/attr_repair.c:173
 #, c-format
diff --git a/po/pl.po b/po/pl.po
index a950f77..46402f6 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -9078,17 +9078,9 @@ msgstr ""
 msgid "No memory for ACL check!\n"
 msgstr "Brak pamiÄci na sprawdzenie ACL!\n"
 
-#: .././repair/attr_repair.c:763
-msgid "entry contains illegal value in attribute named SGI_ACL_FILE or 
SGI_ACL_DEFAULT\n"
-msgstr "wpis zawiera niedozwolonÄ wartoÅÄ w atrybucie SGI_ACL_FILE lub 
SGI_ACL_DEFAULT\n"
-
-#: .././repair/attr_repair.c:789
-msgid "entry contains illegal value in attribute named SGI_MAC_LABEL\n"
-msgstr "wpis zawiera niedozwolonÄ wartoÅÄ w atrybucie SGI_MAC_LABEL\n"
-
-#: .././repair/attr_repair.c:795
-msgid "entry contains illegal value in attribute named SGI_CAP_FILE\n"
-msgstr "wpis zawiera niedozwolonÄ wartoÅÄ w atrybucie SGI_CAP_FILE\n"
+#: .././repair/attr_repair.c:200
+msgid "entry contains illegal value in attribute named %.*s\n"
+msgstr "wpis zawiera niedozwolonÄ wartoÅÄ w atrybucie %.*s\n"
 
 #: .././repair/attr_repair.c:835
 #, c-format
diff --git a/repair/attr_repair.c b/repair/attr_repair.c
index da2800d..e03f360 100644
--- a/repair/attr_repair.c
+++ b/repair/attr_repair.c
@@ -166,12 +166,8 @@ valuecheck(
                } else
                        valuep = value;
 
-               if (xfs_acl_valid(mp, valuep) != 0) {
+               if (xfs_acl_valid(mp, valuep) != 0)
                        clearit = 1;
-                       do_warn(
-       _("entry contains illegal value in attribute named SGI_ACL_FILE "
-         "or SGI_ACL_DEFAULT\n"));
-               }
 
                if (valuep != value)
                        free(valuep);
@@ -194,17 +190,15 @@ valuecheck(
                         * else clearit = 1;
                         */
                        clearit = 1;
-                       do_warn(
-       _("entry contains illegal value in attribute named SGI_MAC_LABEL\n"));
                }
        } else if (strncmp(namevalue, SGI_CAP_FILE, SGI_CAP_FILE_SIZE) == 0) {
-               if ( valuelen != sizeof(xfs_cap_set_t)) {
+               if ( valuelen != sizeof(xfs_cap_set_t))
                        clearit = 1;
-                       do_warn(
-       _("entry contains illegal value in attribute named SGI_CAP_FILE\n"));
-               }
        }
 
+       if (clearit)
+               do_warn(_("entry contains illegal value in attribute named 
%.*s\n"),
+                       namelen, namevalue);
        return(clearit);
 }
 
-- 
2.5.0

<Prev in Thread] Current Thread [Next in Thread>