Эх сурвалжийг харах

fix(susfs-revert-patches): fix fdinfo.c revert perl command escaping

The revert used s/// delimiters with \/ to escape forward slashes
in the comment block (/* */). But \\ in the replacement produces a
literal backslash, making the following / the end of the replacement.
Switch to s{}{} delimiters so /* and */ need no escaping at all.
TheWildJames 1 сар өмнө
parent
commit
54bad67cb6

+ 3 - 3
.github/actions/susfs-revert-patches/action.yml

@@ -25,7 +25,7 @@ runs:
         fi
         if [ "${{ inputs.sublevel }}" -le "117" ]; then
           echo "Reverting fdinfo.c Android 12 5.10 Fake Patch"
-          perl -i -pe 's/^(\\s+if \\(inode\\) \\{)/$1\n\t\t\\/\\*\n\t\t * IN_ALL_EVENTS represents all of the mask bits\n\t\t * that we expose to userspace.  There is at\n\t\t * least one bit (FS_EVENT_ON_CHILD) which is\n\t\t * used only internally to the kernel.\n\t\t * \\/\n\t\tu32 mask = mark->mask & IN_ALL_EVENTS;/m' fs/notify/fdinfo.c
+          perl -i -pe 's{^(\s+if \(inode\) \{)}{$1\n\t\t/*\n\t\t * IN_ALL_EVENTS represents all of the mask bits\n\t\t * that we expose to userspace.  There is at\n\t\t * least one bit (FS_EVENT_ON_CHILD) which is\n\t\t * used only internally to the kernel.\n\t\t */\n\t\tu32 mask = mark->mask & IN_ALL_EVENTS;}m' fs/notify/fdinfo.c
           perl -i -pe 's/\\binotify_mark_user_mask\\(mark\\)/mask, mark->ignored_mask/g' fs/notify/fdinfo.c
           perl -i -pe 's/ignored_mask:0/ignored_mask:%x/g' fs/notify/fdinfo.c
         fi
@@ -37,7 +37,7 @@ runs:
       run: |
         if [ "${{ inputs.sublevel }}" -le "107" ]; then
           echo "Reverting fdinfo.c Android 13 5.10 Fake Patch"
-          perl -i -pe 's/^(\\s+if \\(inode\\) \\{)/$1\n\t\t\\/\\*\n\t\t * IN_ALL_EVENTS represents all of the mask bits\n\t\t * that we expose to userspace.  There is at\n\t\t * least one bit (FS_EVENT_ON_CHILD) which is\n\t\t * used only internally to the kernel.\n\t\t * \\/\n\t\tu32 mask = mark->mask & IN_ALL_EVENTS;/m' fs/notify/fdinfo.c
+          perl -i -pe 's{^(\s+if \(inode\) \{)}{$1\n\t\t/*\n\t\t * IN_ALL_EVENTS represents all of the mask bits\n\t\t * that we expose to userspace.  There is at\n\t\t * least one bit (FS_EVENT_ON_CHILD) which is\n\t\t * used only internally to the kernel.\n\t\t */\n\t\tu32 mask = mark->mask & IN_ALL_EVENTS;}m' fs/notify/fdinfo.c
           perl -i -pe 's/\\binotify_mark_user_mask\\(mark\\)/mask, mark->ignored_mask/g' fs/notify/fdinfo.c
           perl -i -pe 's/ignored_mask:0/ignored_mask:%x/g' fs/notify/fdinfo.c
         fi
@@ -53,7 +53,7 @@ runs:
           echo "Reverting open.c Android 13 5.15 Fake Patch"
           sed -i '/#include <linux\/mnt_idmapping.h>$/d' fs/open.c
           echo "Reverting fdinfo.c Android 13 5.15 Fake Patch"
-          perl -i -pe 's/^(\\s+if \\(inode\\) \\{)/$1\n\t\t\\/\\*\n\t\t * IN_ALL_EVENTS represents all of the mask bits\n\t\t * that we expose to userspace.  There is at\n\t\t * least one bit (FS_EVENT_ON_CHILD) which is\n\t\t * used only internally to the kernel.\n\t\t * \\/\n\t\tu32 mask = mark->mask & IN_ALL_EVENTS;/m' fs/notify/fdinfo.c
+          perl -i -pe 's{^(\s+if \(inode\) \{)}{$1\n\t\t/*\n\t\t * IN_ALL_EVENTS represents all of the mask bits\n\t\t * that we expose to userspace.  There is at\n\t\t * least one bit (FS_EVENT_ON_CHILD) which is\n\t\t * used only internally to the kernel.\n\t\t */\n\t\tu32 mask = mark->mask & IN_ALL_EVENTS;}m' fs/notify/fdinfo.c
           perl -i -pe 's/\\binotify_mark_user_mask\\(mark\\)/mask, mark->ignored_mask/g' fs/notify/fdinfo.c
           perl -i -pe 's/ignored_mask:0/ignored_mask:%x/g' fs/notify/fdinfo.c
           sed -i 's|i_uid_into_mnt(i_user_ns(&fi->inode), &fi->inode).val|i_uid_into_mnt(\\&init_user_ns, \\&fi->inode).val|g' fs/susfs.c