[
{ /* connect to another path (/cool.sock -> /tmp/demo.sock) */
"match": [
{ "connect": { "addr": { "family": "unix", "path": "/cool.sock" }, "fd": { "set": "fd" } } }
],
"call": [
{ "socket": { "family": "unix", "type": "stream", "flags": 0, "protocol": 0 }, "ret": "new_fd" },
{ "connect": { "fd": { "get": "new_fd" }, "addr": { "family": "unix", "path": "/tmp/demo.sock" } }, "ret": "y" }
],
"fd": { "src": { "set": "fd" }, "new": { "set": "new_fd" }, "close_on_exec": false },
"return": { "value": 0, "error": 0 }
},
{ /* Inject permission denied error */
"match": [
{ "connect": { "addr": { "family": "unix", "path": "/error.sock" } } }
],
"return": { "value": 0, "error": -1 }
},
{ /* Continue all the other connect syscall */
"match": [
{ "connect": {} }
],
"return": { "continue": true }
}
]