Bug 1508898 - Prepare the Linux sandbox's socketcall/ipc-call dispatch table for reformatting. r=gcp
authorJed Davis <jld@mozilla.com>
Wed, 21 Nov 2018 11:05:31 +0000
changeset 503939 023c546c01cd2d3c4d382ab5e9245a48f138e934
parent 503938 a615ca514a068ad4f4340b167358dcdeffbb26f1
child 503940 929c91b8afc67ab6b89df4f242dcfbb5fbf21019
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp
bugs1508898
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508898 - Prepare the Linux sandbox's socketcall/ipc-call dispatch table for reformatting. r=gcp The tables in SandboxFilterUtil.cpp should remain vertically aligned, but clang-format would disagree. This patch excludes that region from reformatting, and applies the other changes that clang-format would make there. Differential Revision: https://phabricator.services.mozilla.com/D12499
security/sandbox/linux/SandboxFilterUtil.cpp
--- a/security/sandbox/linux/SandboxFilterUtil.cpp
+++ b/security/sandbox/linux/SandboxFilterUtil.cpp
@@ -58,64 +58,66 @@ SandboxPolicyBase::EvaluateSyscall(int a
         if (thisCase) {
           acc.reset(new Caser<int>(acc->Case(i, *thisCase)));
         }
       }
       return acc->Default(InvalidSyscall());
     }
 #endif // ANDROID
 #endif // __NR_socketcall
-#define DISPATCH_SOCKETCALL(sysnum, socketnum)                       \
-    case sysnum:                                                     \
-      return EvaluateSocketCall(socketnum, true).valueOr(InvalidSyscall())
+// clang-format off
+#define DISPATCH_SOCKETCALL(sysnum, socketnum) \
+  case sysnum:                                 \
+    return EvaluateSocketCall(socketnum, true).valueOr(InvalidSyscall())
 #ifdef __NR_socket
       DISPATCH_SOCKETCALL(__NR_socket,      SYS_SOCKET);
       DISPATCH_SOCKETCALL(__NR_bind,        SYS_BIND);
       DISPATCH_SOCKETCALL(__NR_connect,     SYS_CONNECT);
       DISPATCH_SOCKETCALL(__NR_listen,      SYS_LISTEN);
 #ifdef __NR_accept
       DISPATCH_SOCKETCALL(__NR_accept,      SYS_ACCEPT);
 #endif
       DISPATCH_SOCKETCALL(__NR_getsockname, SYS_GETSOCKNAME);
       DISPATCH_SOCKETCALL(__NR_getpeername, SYS_GETPEERNAME);
       DISPATCH_SOCKETCALL(__NR_socketpair,  SYS_SOCKETPAIR);
 #ifdef __NR_send
       DISPATCH_SOCKETCALL(__NR_send,        SYS_SEND);
       DISPATCH_SOCKETCALL(__NR_recv,        SYS_RECV);
-#endif // __NR_send
+#endif  // __NR_send
       DISPATCH_SOCKETCALL(__NR_sendto,      SYS_SENDTO);
       DISPATCH_SOCKETCALL(__NR_recvfrom,    SYS_RECVFROM);
       DISPATCH_SOCKETCALL(__NR_shutdown,    SYS_SHUTDOWN);
       DISPATCH_SOCKETCALL(__NR_setsockopt,  SYS_SETSOCKOPT);
       DISPATCH_SOCKETCALL(__NR_getsockopt,  SYS_GETSOCKOPT);
       DISPATCH_SOCKETCALL(__NR_sendmsg,     SYS_SENDMSG);
       DISPATCH_SOCKETCALL(__NR_recvmsg,     SYS_RECVMSG);
       DISPATCH_SOCKETCALL(__NR_accept4,     SYS_ACCEPT4);
       DISPATCH_SOCKETCALL(__NR_recvmmsg,    SYS_RECVMMSG);
       DISPATCH_SOCKETCALL(__NR_sendmmsg,    SYS_SENDMMSG);
-#endif // __NR_socket
+#endif  // __NR_socket
 #undef DISPATCH_SOCKETCALL
 #ifndef __NR_socketcall
 #ifndef ANDROID
-#define DISPATCH_SYSVCALL(sysnum, ipcnum)         \
-    case sysnum:                                  \
-      return EvaluateIpcCall(ipcnum).valueOr(InvalidSyscall())
+#define DISPATCH_SYSVCALL(sysnum, ipcnum) \
+  case sysnum:                            \
+    return EvaluateIpcCall(ipcnum).valueOr(InvalidSyscall())
       DISPATCH_SYSVCALL(__NR_semop,       SEMOP);
       DISPATCH_SYSVCALL(__NR_semget,      SEMGET);
       DISPATCH_SYSVCALL(__NR_semctl,      SEMCTL);
       DISPATCH_SYSVCALL(__NR_semtimedop,  SEMTIMEDOP);
       DISPATCH_SYSVCALL(__NR_msgsnd,      MSGSND);
       DISPATCH_SYSVCALL(__NR_msgrcv,      MSGRCV);
       DISPATCH_SYSVCALL(__NR_msgget,      MSGGET);
       DISPATCH_SYSVCALL(__NR_msgctl,      MSGCTL);
       DISPATCH_SYSVCALL(__NR_shmat,       SHMAT);
       DISPATCH_SYSVCALL(__NR_shmdt,       SHMDT);
       DISPATCH_SYSVCALL(__NR_shmget,      SHMGET);
       DISPATCH_SYSVCALL(__NR_shmctl,      SHMCTL);
 #undef DISPATCH_SYSVCALL
-#endif // ANDROID
-#endif // __NR_socketcall
+#endif  // ANDROID
+#endif  // __NR_socketcall
+// clang-format on
   default:
     return InvalidSyscall();
   }
 }
 
 }