| File: | obj-scan-build/trans/fsysServer.c |
| Location: | line 581, column 2 |
| Description: | Value stored to 'msgh_simple' is never read |
| 1 | /* Module fsys */ |
| 2 | |
| 3 | #ifndef _GNU_SOURCE1 |
| 4 | #define _GNU_SOURCE1 1 |
| 5 | #endif |
| 6 | |
| 7 | #define EXPORT_BOOLEAN |
| 8 | #include <mach/boolean.h> |
| 9 | #include <mach/kern_return.h> |
| 10 | #include <mach/message.h> |
| 11 | #include <mach/mig_errors.h> |
| 12 | #include <mach/mig_support.h> |
| 13 | |
| 14 | #ifndef mig_internalstatic |
| 15 | #define mig_internalstatic static |
| 16 | #endif |
| 17 | |
| 18 | #ifndef mig_external |
| 19 | #define mig_external |
| 20 | #endif |
| 21 | |
| 22 | #ifndef TypeCheck1 |
| 23 | #define TypeCheck1 1 |
| 24 | #endif |
| 25 | |
| 26 | #ifndef UseExternRCSId1 |
| 27 | #define UseExternRCSId1 1 |
| 28 | #endif |
| 29 | |
| 30 | #define BAD_TYPECHECK(type, check)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check); _t.w != _c.w; }) ({\ |
| 31 | union { mach_msg_type_t t; unsigned32_t w; } _t, _c;\ |
| 32 | _t.t = *(type); _c.t = *(check); _t.w != _c.w; }) |
| 33 | #define msgh_request_portmsgh_local_port msgh_local_port |
| 34 | #define MACH_MSGH_BITS_REQUEST(bits)(((bits) & 0x0000ff00) >> 8) MACH_MSGH_BITS_LOCAL(bits)(((bits) & 0x0000ff00) >> 8) |
| 35 | #define msgh_reply_portmsgh_remote_port msgh_remote_port |
| 36 | #define MACH_MSGH_BITS_REPLY(bits)((bits) & 0x000000ff) MACH_MSGH_BITS_REMOTE(bits)((bits) & 0x000000ff) |
| 37 | |
| 38 | #include <mach/std_types.h> |
| 39 | #include <mach/mach_types.h> |
| 40 | #include <device/device_types.h> |
| 41 | #include <device/net_status.h> |
| 42 | #include <sys/types.h> |
| 43 | #include <sys/stat.h> |
| 44 | #include <sys/statfs.h> |
| 45 | #include <sys/resource.h> |
| 46 | #include <sys/utsname.h> |
| 47 | #include <hurd/hurd_types.h> |
| 48 | |
| 49 | /* Routine fsys_startup */ |
| 50 | mig_internalstatic void _Xfsys_startup |
| 51 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 52 | { |
| 53 | typedef struct { |
| 54 | mach_msg_header_t Head; |
| 55 | mach_msg_type_t openflagsType; |
| 56 | int openflags; |
| 57 | mach_msg_type_t control_portType; |
| 58 | mach_port_t control_port; |
| 59 | } Request; |
| 60 | |
| 61 | typedef struct { |
| 62 | mach_msg_header_t Head; |
| 63 | mach_msg_type_t RetCodeType; |
| 64 | kern_return_t RetCode; |
| 65 | mach_msg_type_t realnodeType; |
| 66 | mach_port_t realnode; |
| 67 | } Reply; |
| 68 | |
| 69 | Request *In0P = (Request *) InHeadP; |
| 70 | Reply *OutP = (Reply *) OutHeadP; |
| 71 | mig_external kern_return_t S_fsys_startup |
| 72 | (mach_port_t bootstrap, int openflags, mach_port_t control_port, mach_port_t *realnode, mach_msg_type_name_t *realnodePoly); |
| 73 | |
| 74 | boolean_t msgh_simple; |
| 75 | const mach_msg_type_t openflagsCheck = { |
| 76 | /* msgt_name = */ 2, |
| 77 | /* msgt_size = */ 32, |
| 78 | /* msgt_number = */ 1, |
| 79 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 80 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 81 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 82 | /* msgt_unused = */ 0 |
| 83 | }; |
| 84 | |
| 85 | const mach_msg_type_t control_portCheck = { |
| 86 | /* msgt_name = */ 17, |
| 87 | /* msgt_size = */ 32, |
| 88 | /* msgt_number = */ 1, |
| 89 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 90 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 91 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 92 | /* msgt_unused = */ 0 |
| 93 | }; |
| 94 | |
| 95 | const mach_msg_type_t realnodeType = { |
| 96 | /* msgt_name = */ -1, |
| 97 | /* msgt_size = */ 32, |
| 98 | /* msgt_number = */ 1, |
| 99 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 100 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 101 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 102 | /* msgt_unused = */ 0 |
| 103 | }; |
| 104 | |
| 105 | mach_msg_type_name_t realnodePoly; |
| 106 | |
| 107 | #if TypeCheck1 |
| 108 | if ((In0P->Head.msgh_size != 40) || |
| 109 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 110 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 111 | #endif /* TypeCheck */ |
| 112 | |
| 113 | #if TypeCheck1 |
| 114 | if (BAD_TYPECHECK(&In0P->openflagsType, &openflagsCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->openflagsType); _c.t = *(&openflagsCheck ); _t.w != _c.w; })) |
| 115 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 116 | #endif /* TypeCheck */ |
| 117 | |
| 118 | #if TypeCheck1 |
| 119 | if (BAD_TYPECHECK(&In0P->control_portType, &control_portCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->control_portType); _c.t = *(&control_portCheck ); _t.w != _c.w; })) |
| 120 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 121 | #endif /* TypeCheck */ |
| 122 | |
| 123 | OutP->RetCode = S_fsys_startup(In0P->Head.msgh_request_portmsgh_local_port, In0P->openflags, In0P->control_port, &OutP->realnode, &realnodePoly); |
| 124 | if (OutP->RetCode != KERN_SUCCESS0) |
| 125 | return; |
| 126 | |
| 127 | msgh_simple = TRUE((boolean_t) 1); |
| 128 | OutP->Head.msgh_size = 40; |
| 129 | |
| 130 | OutP->realnodeType = realnodeType; |
| 131 | |
| 132 | if (MACH_MSG_TYPE_PORT_ANY(realnodePoly)(((realnodePoly) >= 16) && ((realnodePoly) <= 21 ))) |
| 133 | msgh_simple = FALSE((boolean_t) 0); |
| 134 | |
| 135 | OutP->realnodeType.msgt_name = realnodePoly; |
| 136 | |
| 137 | if (!msgh_simple) |
| 138 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 139 | } |
| 140 | |
| 141 | /* Routine fsys_goaway */ |
| 142 | mig_internalstatic void _Xfsys_goaway |
| 143 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 144 | { |
| 145 | typedef struct { |
| 146 | mach_msg_header_t Head; |
| 147 | mach_msg_type_t flagsType; |
| 148 | int flags; |
| 149 | } Request; |
| 150 | |
| 151 | typedef struct { |
| 152 | mach_msg_header_t Head; |
| 153 | mach_msg_type_t RetCodeType; |
| 154 | kern_return_t RetCode; |
| 155 | } Reply; |
| 156 | |
| 157 | Request *In0P = (Request *) InHeadP; |
| 158 | Reply *OutP = (Reply *) OutHeadP; |
| 159 | mig_external kern_return_t S_fsys_goaway |
| 160 | (fsys_t fsys, int flags); |
| 161 | |
| 162 | const mach_msg_type_t flagsCheck = { |
| 163 | /* msgt_name = */ 2, |
| 164 | /* msgt_size = */ 32, |
| 165 | /* msgt_number = */ 1, |
| 166 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 167 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 168 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 169 | /* msgt_unused = */ 0 |
| 170 | }; |
| 171 | |
| 172 | #if TypeCheck1 |
| 173 | if ((In0P->Head.msgh_size != 32) || |
| 174 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 175 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 176 | #endif /* TypeCheck */ |
| 177 | |
| 178 | #if TypeCheck1 |
| 179 | if (BAD_TYPECHECK(&In0P->flagsType, &flagsCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->flagsType); _c.t = *(&flagsCheck); _t.w != _c.w; })) |
| 180 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 181 | #endif /* TypeCheck */ |
| 182 | |
| 183 | OutP->RetCode = S_fsys_goaway(In0P->Head.msgh_request_portmsgh_local_port, In0P->flags); |
| 184 | } |
| 185 | |
| 186 | /* Routine fsys_getroot */ |
| 187 | mig_internalstatic void _Xfsys_getroot |
| 188 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 189 | { |
| 190 | typedef struct { |
| 191 | mach_msg_header_t Head; |
| 192 | mach_msg_type_t dotdot_nodeType; |
| 193 | mach_port_t dotdot_node; |
| 194 | mach_msg_type_long_t gen_uidsType; |
| 195 | uid_t gen_uids[512]; |
| 196 | mach_msg_type_long_t gen_gidsType; |
| 197 | uid_t gen_gids[512]; |
| 198 | mach_msg_type_t flagsType; |
| 199 | int flags; |
| 200 | } Request; |
| 201 | |
| 202 | typedef struct { |
| 203 | mach_msg_header_t Head; |
| 204 | mach_msg_type_t RetCodeType; |
| 205 | kern_return_t RetCode; |
| 206 | mach_msg_type_t do_retryType; |
| 207 | retry_type do_retry; |
| 208 | mach_msg_type_t retry_nameType; |
| 209 | string_t retry_name; |
| 210 | mach_msg_type_t fileType; |
| 211 | mach_port_t file; |
| 212 | } Reply; |
| 213 | |
| 214 | Request *In0P = (Request *) InHeadP; |
| 215 | Request *In1P; |
| 216 | Request *In2P; |
| 217 | Reply *OutP = (Reply *) OutHeadP; |
| 218 | mig_external kern_return_t S_fsys_getroot |
| 219 | (fsys_t fsys, mach_port_t dotdot_node, idarray_t gen_uids, mach_msg_type_number_t gen_uidsCnt, idarray_t gen_gids, mach_msg_type_number_t gen_gidsCnt, int flags, retry_type *do_retry, string_t retry_name, mach_port_t *file, mach_msg_type_name_t *filePoly); |
| 220 | |
| 221 | boolean_t msgh_simple; |
| 222 | unsigned int msgh_size; |
| 223 | unsigned int msgh_size_delta; |
| 224 | |
| 225 | const mach_msg_type_t dotdot_nodeCheck = { |
| 226 | /* msgt_name = */ 17, |
| 227 | /* msgt_size = */ 32, |
| 228 | /* msgt_number = */ 1, |
| 229 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 230 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 231 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 232 | /* msgt_unused = */ 0 |
| 233 | }; |
| 234 | |
| 235 | const mach_msg_type_t flagsCheck = { |
| 236 | /* msgt_name = */ 2, |
| 237 | /* msgt_size = */ 32, |
| 238 | /* msgt_number = */ 1, |
| 239 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 240 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 241 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 242 | /* msgt_unused = */ 0 |
| 243 | }; |
| 244 | |
| 245 | const mach_msg_type_t do_retryType = { |
| 246 | /* msgt_name = */ 2, |
| 247 | /* msgt_size = */ 32, |
| 248 | /* msgt_number = */ 1, |
| 249 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 250 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 251 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 252 | /* msgt_unused = */ 0 |
| 253 | }; |
| 254 | |
| 255 | const mach_msg_type_t retry_nameType = { |
| 256 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 257 | /* msgt_size = */ 8, |
| 258 | /* msgt_number = */ 1024, |
| 259 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 260 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 261 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 262 | /* msgt_unused = */ 0 |
| 263 | }; |
| 264 | |
| 265 | const mach_msg_type_t fileType = { |
| 266 | /* msgt_name = */ -1, |
| 267 | /* msgt_size = */ 32, |
| 268 | /* msgt_number = */ 1, |
| 269 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 270 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 271 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 272 | /* msgt_unused = */ 0 |
| 273 | }; |
| 274 | |
| 275 | mach_msg_type_name_t filePoly; |
| 276 | |
| 277 | #if TypeCheck1 |
| 278 | msgh_size = In0P->Head.msgh_size; |
| 279 | if ((msgh_size < 64) || |
| 280 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 281 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 282 | #endif /* TypeCheck */ |
| 283 | |
| 284 | #if TypeCheck1 |
| 285 | if (BAD_TYPECHECK(&In0P->dotdot_nodeType, &dotdot_nodeCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->dotdot_nodeType); _c.t = *(&dotdot_nodeCheck ); _t.w != _c.w; })) |
| 286 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 287 | #endif /* TypeCheck */ |
| 288 | |
| 289 | #if TypeCheck1 |
| 290 | if ((In0P->gen_uidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
| 291 | (In0P->gen_uidsType.msgtl_name != 2) || |
| 292 | (In0P->gen_uidsType.msgtl_size != 32)) |
| 293 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 294 | #endif /* TypeCheck */ |
| 295 | |
| 296 | msgh_size_delta = (In0P->gen_uidsType.msgtl_header.msgt_inline) ? 4 * In0P->gen_uidsType.msgtl_number : sizeof(uid_t *); |
| 297 | #if TypeCheck1 |
| 298 | if (msgh_size < 64 + msgh_size_delta) |
| 299 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 300 | msgh_size -= msgh_size_delta; |
| 301 | #endif /* TypeCheck */ |
| 302 | |
| 303 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
| 304 | |
| 305 | #if TypeCheck1 |
| 306 | if ((In1P->gen_gidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
| 307 | (In1P->gen_gidsType.msgtl_name != 2) || |
| 308 | (In1P->gen_gidsType.msgtl_size != 32)) |
| 309 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 310 | #endif /* TypeCheck */ |
| 311 | |
| 312 | msgh_size_delta = (In1P->gen_gidsType.msgtl_header.msgt_inline) ? 4 * In1P->gen_gidsType.msgtl_number : sizeof(uid_t *); |
| 313 | #if TypeCheck1 |
| 314 | if (msgh_size != 64 + msgh_size_delta) |
| 315 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 316 | #endif /* TypeCheck */ |
| 317 | |
| 318 | In2P = (Request *) ((char *) In1P + msgh_size_delta - 2048); |
| 319 | |
| 320 | #if TypeCheck1 |
| 321 | if (BAD_TYPECHECK(&In2P->flagsType, &flagsCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In2P->flagsType); _c.t = *(&flagsCheck); _t.w != _c.w; })) |
| 322 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 323 | #endif /* TypeCheck */ |
| 324 | |
| 325 | OutP->RetCode = S_fsys_getroot(In0P->Head.msgh_request_portmsgh_local_port, In0P->dotdot_node, (In0P->gen_uidsType.msgtl_header.msgt_inline) ? In0P->gen_uids : *((uid_t **)In0P->gen_uids), In0P->gen_uidsType.msgtl_number, (In1P->gen_gidsType.msgtl_header.msgt_inline) ? In1P->gen_gids : *((uid_t **)In1P->gen_gids), In1P->gen_gidsType.msgtl_number, In2P->flags, &OutP->do_retry, OutP->retry_name, &OutP->file, &filePoly); |
| 326 | if (OutP->RetCode == KERN_SUCCESS0) |
| 327 | if (!In1P->gen_gidsType.msgtl_header.msgt_inline) |
| 328 | __mig_deallocate(* (vm_offset_t *) In1P->gen_gids, 4 * In1P->gen_gidsType.msgtl_number); |
| 329 | if (OutP->RetCode == KERN_SUCCESS0) |
| 330 | if (!In0P->gen_uidsType.msgtl_header.msgt_inline) |
| 331 | __mig_deallocate(* (vm_offset_t *) In0P->gen_uids, 4 * In0P->gen_uidsType.msgtl_number); |
| 332 | if (OutP->RetCode != KERN_SUCCESS0) |
| 333 | return; |
| 334 | |
| 335 | msgh_simple = TRUE((boolean_t) 1); |
| 336 | OutP->Head.msgh_size = 1076; |
| 337 | |
| 338 | OutP->do_retryType = do_retryType; |
| 339 | |
| 340 | OutP->retry_nameType = retry_nameType; |
| 341 | |
| 342 | OutP->fileType = fileType; |
| 343 | |
| 344 | if (MACH_MSG_TYPE_PORT_ANY(filePoly)(((filePoly) >= 16) && ((filePoly) <= 21))) |
| 345 | msgh_simple = FALSE((boolean_t) 0); |
| 346 | |
| 347 | OutP->fileType.msgt_name = filePoly; |
| 348 | |
| 349 | if (!msgh_simple) |
| 350 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 351 | } |
| 352 | |
| 353 | /* Routine fsys_getfile */ |
| 354 | mig_internalstatic void _Xfsys_getfile |
| 355 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 356 | { |
| 357 | typedef struct { |
| 358 | mach_msg_header_t Head; |
| 359 | mach_msg_type_long_t gen_uidsType; |
| 360 | uid_t gen_uids[512]; |
| 361 | mach_msg_type_long_t gen_gidsType; |
| 362 | uid_t gen_gids[512]; |
| 363 | mach_msg_type_long_t filehandleType; |
| 364 | char filehandle[2048]; |
| 365 | } Request; |
| 366 | |
| 367 | typedef struct { |
| 368 | mach_msg_header_t Head; |
| 369 | mach_msg_type_t RetCodeType; |
| 370 | kern_return_t RetCode; |
| 371 | mach_msg_type_t fileType; |
| 372 | mach_port_t file; |
| 373 | } Reply; |
| 374 | |
| 375 | Request *In0P = (Request *) InHeadP; |
| 376 | Request *In1P; |
| 377 | Request *In2P; |
| 378 | Reply *OutP = (Reply *) OutHeadP; |
| 379 | mig_external kern_return_t S_fsys_getfile |
| 380 | (fsys_t fsys, idarray_t gen_uids, mach_msg_type_number_t gen_uidsCnt, idarray_t gen_gids, mach_msg_type_number_t gen_gidsCnt, data_t filehandle, mach_msg_type_number_t filehandleCnt, mach_port_t *file, mach_msg_type_name_t *filePoly); |
| 381 | |
| 382 | boolean_t msgh_simple; |
| 383 | unsigned int msgh_size; |
| 384 | unsigned int msgh_size_delta; |
| 385 | |
| 386 | const mach_msg_type_t fileType = { |
| 387 | /* msgt_name = */ -1, |
| 388 | /* msgt_size = */ 32, |
| 389 | /* msgt_number = */ 1, |
| 390 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 391 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 392 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 393 | /* msgt_unused = */ 0 |
| 394 | }; |
| 395 | |
| 396 | mach_msg_type_name_t filePoly; |
| 397 | |
| 398 | #if TypeCheck1 |
| 399 | msgh_size = In0P->Head.msgh_size; |
| 400 | msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U); |
| 401 | if ((msgh_size < 60)) |
| 402 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 403 | #endif /* TypeCheck */ |
| 404 | |
| 405 | #if TypeCheck1 |
| 406 | if ((In0P->gen_uidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
| 407 | (In0P->gen_uidsType.msgtl_name != 2) || |
| 408 | (In0P->gen_uidsType.msgtl_size != 32)) |
| 409 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 410 | #endif /* TypeCheck */ |
| 411 | |
| 412 | msgh_size_delta = (In0P->gen_uidsType.msgtl_header.msgt_inline) ? 4 * In0P->gen_uidsType.msgtl_number : sizeof(uid_t *); |
| 413 | #if TypeCheck1 |
| 414 | if (msgh_size < 60 + msgh_size_delta) |
| 415 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 416 | msgh_size -= msgh_size_delta; |
| 417 | #endif /* TypeCheck */ |
| 418 | |
| 419 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
| 420 | |
| 421 | #if TypeCheck1 |
| 422 | if ((In1P->gen_gidsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
| 423 | (In1P->gen_gidsType.msgtl_name != 2) || |
| 424 | (In1P->gen_gidsType.msgtl_size != 32)) |
| 425 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 426 | #endif /* TypeCheck */ |
| 427 | |
| 428 | msgh_size_delta = (In1P->gen_gidsType.msgtl_header.msgt_inline) ? 4 * In1P->gen_gidsType.msgtl_number : sizeof(uid_t *); |
| 429 | #if TypeCheck1 |
| 430 | if (msgh_size < 60 + msgh_size_delta) |
| 431 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 432 | msgh_size -= msgh_size_delta; |
| 433 | #endif /* TypeCheck */ |
| 434 | |
| 435 | In2P = (Request *) ((char *) In1P + msgh_size_delta - 2048); |
| 436 | |
| 437 | #if TypeCheck1 |
| 438 | if ((In2P->filehandleType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
| 439 | (In2P->filehandleType.msgtl_name != 8) || |
| 440 | (In2P->filehandleType.msgtl_size != 8)) |
| 441 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 442 | #endif /* TypeCheck */ |
| 443 | |
| 444 | #if TypeCheck1 |
| 445 | if (msgh_size != 60 + ((In2P->filehandleType.msgtl_header.msgt_inline) ? (In2P->filehandleType.msgtl_number + 3) & ~3 : sizeof(char *))) |
| 446 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 447 | #endif /* TypeCheck */ |
| 448 | |
| 449 | OutP->RetCode = S_fsys_getfile(In0P->Head.msgh_request_portmsgh_local_port, (In0P->gen_uidsType.msgtl_header.msgt_inline) ? In0P->gen_uids : *((uid_t **)In0P->gen_uids), In0P->gen_uidsType.msgtl_number, (In1P->gen_gidsType.msgtl_header.msgt_inline) ? In1P->gen_gids : *((uid_t **)In1P->gen_gids), In1P->gen_gidsType.msgtl_number, (In2P->filehandleType.msgtl_header.msgt_inline) ? In2P->filehandle : *((char **)In2P->filehandle), In2P->filehandleType.msgtl_number, &OutP->file, &filePoly); |
| 450 | if (OutP->RetCode == KERN_SUCCESS0) |
| 451 | if (!In2P->filehandleType.msgtl_header.msgt_inline) |
| 452 | __mig_deallocate(* (vm_offset_t *) In2P->filehandle, In2P->filehandleType.msgtl_number); |
| 453 | if (OutP->RetCode == KERN_SUCCESS0) |
| 454 | if (!In1P->gen_gidsType.msgtl_header.msgt_inline) |
| 455 | __mig_deallocate(* (vm_offset_t *) In1P->gen_gids, 4 * In1P->gen_gidsType.msgtl_number); |
| 456 | if (OutP->RetCode == KERN_SUCCESS0) |
| 457 | if (!In0P->gen_uidsType.msgtl_header.msgt_inline) |
| 458 | __mig_deallocate(* (vm_offset_t *) In0P->gen_uids, 4 * In0P->gen_uidsType.msgtl_number); |
| 459 | if (OutP->RetCode != KERN_SUCCESS0) |
| 460 | return; |
| 461 | |
| 462 | msgh_simple = TRUE((boolean_t) 1); |
| 463 | OutP->Head.msgh_size = 40; |
| 464 | |
| 465 | OutP->fileType = fileType; |
| 466 | |
| 467 | if (MACH_MSG_TYPE_PORT_ANY(filePoly)(((filePoly) >= 16) && ((filePoly) <= 21))) |
| 468 | msgh_simple = FALSE((boolean_t) 0); |
| 469 | |
| 470 | OutP->fileType.msgt_name = filePoly; |
| 471 | |
| 472 | if (!msgh_simple) |
| 473 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 474 | } |
| 475 | |
| 476 | /* Routine fsys_syncfs */ |
| 477 | mig_internalstatic void _Xfsys_syncfs |
| 478 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 479 | { |
| 480 | typedef struct { |
| 481 | mach_msg_header_t Head; |
| 482 | mach_msg_type_t waitType; |
| 483 | int wait; |
| 484 | mach_msg_type_t do_childrenType; |
| 485 | int do_children; |
| 486 | } Request; |
| 487 | |
| 488 | typedef struct { |
| 489 | mach_msg_header_t Head; |
| 490 | mach_msg_type_t RetCodeType; |
| 491 | kern_return_t RetCode; |
| 492 | } Reply; |
| 493 | |
| 494 | Request *In0P = (Request *) InHeadP; |
| 495 | Reply *OutP = (Reply *) OutHeadP; |
| 496 | mig_external kern_return_t S_fsys_syncfs |
| 497 | (fsys_t fsys, int wait, int do_children); |
| 498 | |
| 499 | const mach_msg_type_t waitCheck = { |
| 500 | /* msgt_name = */ 2, |
| 501 | /* msgt_size = */ 32, |
| 502 | /* msgt_number = */ 1, |
| 503 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 504 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 505 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 506 | /* msgt_unused = */ 0 |
| 507 | }; |
| 508 | |
| 509 | const mach_msg_type_t do_childrenCheck = { |
| 510 | /* msgt_name = */ 2, |
| 511 | /* msgt_size = */ 32, |
| 512 | /* msgt_number = */ 1, |
| 513 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 514 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 515 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 516 | /* msgt_unused = */ 0 |
| 517 | }; |
| 518 | |
| 519 | #if TypeCheck1 |
| 520 | if ((In0P->Head.msgh_size != 40) || |
| 521 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 522 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 523 | #endif /* TypeCheck */ |
| 524 | |
| 525 | #if TypeCheck1 |
| 526 | if (BAD_TYPECHECK(&In0P->waitType, &waitCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->waitType); _c.t = *(&waitCheck); _t.w != _c.w; })) |
| 527 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 528 | #endif /* TypeCheck */ |
| 529 | |
| 530 | #if TypeCheck1 |
| 531 | if (BAD_TYPECHECK(&In0P->do_childrenType, &do_childrenCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->do_childrenType); _c.t = *(&do_childrenCheck ); _t.w != _c.w; })) |
| 532 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 533 | #endif /* TypeCheck */ |
| 534 | |
| 535 | OutP->RetCode = S_fsys_syncfs(In0P->Head.msgh_request_portmsgh_local_port, In0P->wait, In0P->do_children); |
| 536 | } |
| 537 | |
| 538 | /* Routine fsys_set_options */ |
| 539 | mig_internalstatic void _Xfsys_set_options |
| 540 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 541 | { |
| 542 | typedef struct { |
| 543 | mach_msg_header_t Head; |
| 544 | mach_msg_type_long_t optionsType; |
| 545 | char options[2048]; |
| 546 | mach_msg_type_t do_childrenType; |
| 547 | int do_children; |
| 548 | } Request; |
| 549 | |
| 550 | typedef struct { |
| 551 | mach_msg_header_t Head; |
| 552 | mach_msg_type_t RetCodeType; |
| 553 | kern_return_t RetCode; |
| 554 | } Reply; |
| 555 | |
| 556 | Request *In0P = (Request *) InHeadP; |
| 557 | Request *In1P; |
| 558 | Reply *OutP = (Reply *) OutHeadP; |
| 559 | mig_external kern_return_t S_fsys_set_options |
| 560 | (fsys_t fsys, data_t options, mach_msg_type_number_t optionsCnt, int do_children); |
| 561 | |
| 562 | #if TypeCheck1 |
| 563 | boolean_t msgh_simple; |
| 564 | #endif /* TypeCheck */ |
| 565 | |
| 566 | unsigned int msgh_size; |
| 567 | unsigned int msgh_size_delta; |
| 568 | |
| 569 | const mach_msg_type_t do_childrenCheck = { |
| 570 | /* msgt_name = */ 2, |
| 571 | /* msgt_size = */ 32, |
| 572 | /* msgt_number = */ 1, |
| 573 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 574 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 575 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 576 | /* msgt_unused = */ 0 |
| 577 | }; |
| 578 | |
| 579 | #if TypeCheck1 |
| 580 | msgh_size = In0P->Head.msgh_size; |
| 581 | msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U); |
Value stored to 'msgh_simple' is never read | |
| 582 | if ((msgh_size < 44)) |
| 583 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 584 | #endif /* TypeCheck */ |
| 585 | |
| 586 | #if TypeCheck1 |
| 587 | if ((In0P->optionsType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
| 588 | (In0P->optionsType.msgtl_name != 8) || |
| 589 | (In0P->optionsType.msgtl_size != 8)) |
| 590 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 591 | #endif /* TypeCheck */ |
| 592 | |
| 593 | msgh_size_delta = (In0P->optionsType.msgtl_header.msgt_inline) ? (In0P->optionsType.msgtl_number + 3) & ~3 : sizeof(char *); |
| 594 | #if TypeCheck1 |
| 595 | if (msgh_size != 44 + msgh_size_delta) |
| 596 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 597 | #endif /* TypeCheck */ |
| 598 | |
| 599 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
| 600 | |
| 601 | #if TypeCheck1 |
| 602 | if (BAD_TYPECHECK(&In1P->do_childrenType, &do_childrenCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In1P->do_childrenType); _c.t = *(&do_childrenCheck ); _t.w != _c.w; })) |
| 603 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 604 | #endif /* TypeCheck */ |
| 605 | |
| 606 | OutP->RetCode = S_fsys_set_options(In0P->Head.msgh_request_portmsgh_local_port, (In0P->optionsType.msgtl_header.msgt_inline) ? In0P->options : *((char **)In0P->options), In0P->optionsType.msgtl_number, In1P->do_children); |
| 607 | if (OutP->RetCode == KERN_SUCCESS0) |
| 608 | if (!In0P->optionsType.msgtl_header.msgt_inline) |
| 609 | __mig_deallocate(* (vm_offset_t *) In0P->options, In0P->optionsType.msgtl_number); |
| 610 | } |
| 611 | |
| 612 | /* Routine fsys_getpriv */ |
| 613 | mig_internalstatic void _Xfsys_getpriv |
| 614 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 615 | { |
| 616 | typedef struct { |
| 617 | mach_msg_header_t Head; |
| 618 | } Request; |
| 619 | |
| 620 | typedef struct { |
| 621 | mach_msg_header_t Head; |
| 622 | mach_msg_type_t RetCodeType; |
| 623 | kern_return_t RetCode; |
| 624 | mach_msg_type_t host_privType; |
| 625 | mach_port_t host_priv; |
| 626 | mach_msg_type_t device_masterType; |
| 627 | mach_port_t device_master; |
| 628 | mach_msg_type_t fstaskType; |
| 629 | mach_port_t fstask; |
| 630 | } Reply; |
| 631 | |
| 632 | Request *In0P = (Request *) InHeadP; |
| 633 | Reply *OutP = (Reply *) OutHeadP; |
| 634 | mig_external kern_return_t S_fsys_getpriv |
| 635 | (fsys_t fsys, mach_port_t *host_priv, mach_msg_type_name_t *host_privPoly, mach_port_t *device_master, mach_msg_type_name_t *device_masterPoly, mach_port_t *fstask, mach_msg_type_name_t *fstaskPoly); |
| 636 | |
| 637 | boolean_t msgh_simple; |
| 638 | const mach_msg_type_t host_privType = { |
| 639 | /* msgt_name = */ -1, |
| 640 | /* msgt_size = */ 32, |
| 641 | /* msgt_number = */ 1, |
| 642 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 643 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 644 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 645 | /* msgt_unused = */ 0 |
| 646 | }; |
| 647 | |
| 648 | const mach_msg_type_t device_masterType = { |
| 649 | /* msgt_name = */ -1, |
| 650 | /* msgt_size = */ 32, |
| 651 | /* msgt_number = */ 1, |
| 652 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 653 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 654 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 655 | /* msgt_unused = */ 0 |
| 656 | }; |
| 657 | |
| 658 | const mach_msg_type_t fstaskType = { |
| 659 | /* msgt_name = */ -1, |
| 660 | /* msgt_size = */ 32, |
| 661 | /* msgt_number = */ 1, |
| 662 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 663 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 664 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 665 | /* msgt_unused = */ 0 |
| 666 | }; |
| 667 | |
| 668 | mach_msg_type_name_t host_privPoly; |
| 669 | mach_msg_type_name_t device_masterPoly; |
| 670 | mach_msg_type_name_t fstaskPoly; |
| 671 | |
| 672 | #if TypeCheck1 |
| 673 | if ((In0P->Head.msgh_size != 24) || |
| 674 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 675 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 676 | #endif /* TypeCheck */ |
| 677 | |
| 678 | OutP->RetCode = S_fsys_getpriv(In0P->Head.msgh_request_portmsgh_local_port, &OutP->host_priv, &host_privPoly, &OutP->device_master, &device_masterPoly, &OutP->fstask, &fstaskPoly); |
| 679 | if (OutP->RetCode != KERN_SUCCESS0) |
| 680 | return; |
| 681 | |
| 682 | msgh_simple = TRUE((boolean_t) 1); |
| 683 | OutP->Head.msgh_size = 56; |
| 684 | |
| 685 | OutP->host_privType = host_privType; |
| 686 | |
| 687 | if (MACH_MSG_TYPE_PORT_ANY(host_privPoly)(((host_privPoly) >= 16) && ((host_privPoly) <= 21))) |
| 688 | msgh_simple = FALSE((boolean_t) 0); |
| 689 | |
| 690 | OutP->host_privType.msgt_name = host_privPoly; |
| 691 | |
| 692 | OutP->device_masterType = device_masterType; |
| 693 | |
| 694 | if (MACH_MSG_TYPE_PORT_ANY(device_masterPoly)(((device_masterPoly) >= 16) && ((device_masterPoly ) <= 21))) |
| 695 | msgh_simple = FALSE((boolean_t) 0); |
| 696 | |
| 697 | OutP->device_masterType.msgt_name = device_masterPoly; |
| 698 | |
| 699 | OutP->fstaskType = fstaskType; |
| 700 | |
| 701 | if (MACH_MSG_TYPE_PORT_ANY(fstaskPoly)(((fstaskPoly) >= 16) && ((fstaskPoly) <= 21))) |
| 702 | msgh_simple = FALSE((boolean_t) 0); |
| 703 | |
| 704 | OutP->fstaskType.msgt_name = fstaskPoly; |
| 705 | |
| 706 | if (!msgh_simple) |
| 707 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 708 | } |
| 709 | |
| 710 | /* Routine fsys_init */ |
| 711 | mig_internalstatic void _Xfsys_init |
| 712 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 713 | { |
| 714 | typedef struct { |
| 715 | mach_msg_header_t Head; |
| 716 | mach_msg_type_t proc_serverType; |
| 717 | mach_port_t proc_server; |
| 718 | mach_msg_type_t auth_handleType; |
| 719 | auth_t auth_handle; |
| 720 | } Request; |
| 721 | |
| 722 | typedef struct { |
| 723 | mach_msg_header_t Head; |
| 724 | mach_msg_type_t RetCodeType; |
| 725 | kern_return_t RetCode; |
| 726 | } Reply; |
| 727 | |
| 728 | Request *In0P = (Request *) InHeadP; |
| 729 | Reply *OutP = (Reply *) OutHeadP; |
| 730 | mig_external kern_return_t S_fsys_init |
| 731 | (fsys_t fsys, mach_port_t reply_port, mach_msg_type_name_t reply_portPoly, mach_port_t proc_server, auth_t auth_handle); |
| 732 | |
| 733 | const mach_msg_type_t proc_serverCheck = { |
| 734 | /* msgt_name = */ 17, |
| 735 | /* msgt_size = */ 32, |
| 736 | /* msgt_number = */ 1, |
| 737 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 738 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 739 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 740 | /* msgt_unused = */ 0 |
| 741 | }; |
| 742 | |
| 743 | const mach_msg_type_t auth_handleCheck = { |
| 744 | /* msgt_name = */ 17, |
| 745 | /* msgt_size = */ 32, |
| 746 | /* msgt_number = */ 1, |
| 747 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 748 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 749 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 750 | /* msgt_unused = */ 0 |
| 751 | }; |
| 752 | |
| 753 | #if TypeCheck1 |
| 754 | if ((In0P->Head.msgh_size != 40) || |
| 755 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 756 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 757 | #endif /* TypeCheck */ |
| 758 | |
| 759 | #if TypeCheck1 |
| 760 | if (BAD_TYPECHECK(&In0P->proc_serverType, &proc_serverCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->proc_serverType); _c.t = *(&proc_serverCheck ); _t.w != _c.w; })) |
| 761 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 762 | #endif /* TypeCheck */ |
| 763 | |
| 764 | #if TypeCheck1 |
| 765 | if (BAD_TYPECHECK(&In0P->auth_handleType, &auth_handleCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->auth_handleType); _c.t = *(&auth_handleCheck ); _t.w != _c.w; })) |
| 766 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 767 | #endif /* TypeCheck */ |
| 768 | |
| 769 | OutP->RetCode = S_fsys_init(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->proc_server, In0P->auth_handle); |
| 770 | } |
| 771 | |
| 772 | /* Routine fsys_forward */ |
| 773 | mig_internalstatic void _Xfsys_forward |
| 774 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 775 | { |
| 776 | typedef struct { |
| 777 | mach_msg_header_t Head; |
| 778 | mach_msg_type_t requestorType; |
| 779 | mach_port_t requestor; |
| 780 | mach_msg_type_long_t argvType; |
| 781 | char argv[2048]; |
| 782 | } Request; |
| 783 | |
| 784 | typedef struct { |
| 785 | mach_msg_header_t Head; |
| 786 | mach_msg_type_t RetCodeType; |
| 787 | kern_return_t RetCode; |
| 788 | } Reply; |
| 789 | |
| 790 | Request *In0P = (Request *) InHeadP; |
| 791 | Reply *OutP = (Reply *) OutHeadP; |
| 792 | mig_external kern_return_t S_fsys_forward |
| 793 | (mach_port_t server, mach_port_t requestor, data_t argv, mach_msg_type_number_t argvCnt); |
| 794 | |
| 795 | unsigned int msgh_size; |
| 796 | |
| 797 | const mach_msg_type_t requestorCheck = { |
| 798 | /* msgt_name = */ 17, |
| 799 | /* msgt_size = */ 32, |
| 800 | /* msgt_number = */ 1, |
| 801 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 802 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 803 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 804 | /* msgt_unused = */ 0 |
| 805 | }; |
| 806 | |
| 807 | #if TypeCheck1 |
| 808 | msgh_size = In0P->Head.msgh_size; |
| 809 | if ((msgh_size < 44) || |
| 810 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 811 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 812 | #endif /* TypeCheck */ |
| 813 | |
| 814 | #if TypeCheck1 |
| 815 | if (BAD_TYPECHECK(&In0P->requestorType, &requestorCheck)({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->requestorType); _c.t = *(&requestorCheck ); _t.w != _c.w; })) |
| 816 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 817 | #endif /* TypeCheck */ |
| 818 | |
| 819 | #if TypeCheck1 |
| 820 | if ((In0P->argvType.msgtl_header.msgt_longform != TRUE((boolean_t) 1)) || |
| 821 | (In0P->argvType.msgtl_name != 8) || |
| 822 | (In0P->argvType.msgtl_size != 8)) |
| 823 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 824 | #endif /* TypeCheck */ |
| 825 | |
| 826 | #if TypeCheck1 |
| 827 | if (msgh_size != 44 + ((In0P->argvType.msgtl_header.msgt_inline) ? (In0P->argvType.msgtl_number + 3) & ~3 : sizeof(char *))) |
| 828 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 829 | #endif /* TypeCheck */ |
| 830 | |
| 831 | OutP->RetCode = S_fsys_forward(In0P->Head.msgh_request_portmsgh_local_port, In0P->requestor, (In0P->argvType.msgtl_header.msgt_inline) ? In0P->argv : *((char **)In0P->argv), In0P->argvType.msgtl_number); |
| 832 | if (OutP->RetCode == KERN_SUCCESS0) |
| 833 | if (!In0P->argvType.msgtl_header.msgt_inline) |
| 834 | __mig_deallocate(* (vm_offset_t *) In0P->argv, In0P->argvType.msgtl_number); |
| 835 | } |
| 836 | |
| 837 | /* Routine fsys_get_options */ |
| 838 | mig_internalstatic void _Xfsys_get_options |
| 839 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 840 | { |
| 841 | typedef struct { |
| 842 | mach_msg_header_t Head; |
| 843 | } Request; |
| 844 | |
| 845 | typedef struct { |
| 846 | mach_msg_header_t Head; |
| 847 | mach_msg_type_t RetCodeType; |
| 848 | kern_return_t RetCode; |
| 849 | mach_msg_type_long_t optionsType; |
| 850 | char options[2048]; |
| 851 | } Reply; |
| 852 | |
| 853 | Request *In0P = (Request *) InHeadP; |
| 854 | Reply *OutP = (Reply *) OutHeadP; |
| 855 | mig_external kern_return_t S_fsys_get_options |
| 856 | (fsys_t server, data_t *options, mach_msg_type_number_t *optionsCnt); |
| 857 | |
| 858 | boolean_t msgh_simple; |
| 859 | const mach_msg_type_long_t optionsType = { |
| 860 | { |
| 861 | /* msgt_name = */ 0, |
| 862 | /* msgt_size = */ 0, |
| 863 | /* msgt_number = */ 0, |
| 864 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 865 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 866 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 867 | /* msgt_unused = */ 0 |
| 868 | }, |
| 869 | /* msgtl_name = */ 8, |
| 870 | /* msgtl_size = */ 8, |
| 871 | /* msgtl_number = */ 2048, |
| 872 | }; |
| 873 | |
| 874 | mach_msg_type_number_t optionsCnt; |
| 875 | |
| 876 | char *optionsP; |
| 877 | |
| 878 | #if TypeCheck1 |
| 879 | if ((In0P->Head.msgh_size != 24) || |
| 880 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 881 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 882 | #endif /* TypeCheck */ |
| 883 | |
| 884 | optionsP = OutP->options; |
| 885 | optionsCnt = 2048; |
| 886 | |
| 887 | OutP->RetCode = S_fsys_get_options(In0P->Head.msgh_request_portmsgh_local_port, &optionsP, &optionsCnt); |
| 888 | if (OutP->RetCode != KERN_SUCCESS0) |
| 889 | return; |
| 890 | |
| 891 | msgh_simple = TRUE((boolean_t) 1); |
| 892 | |
| 893 | OutP->optionsType = optionsType; |
| 894 | if (optionsP != OutP->options) { |
| 895 | OutP->optionsType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 896 | OutP->optionsType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
| 897 | *((char **)OutP->options) = optionsP; |
| 898 | msgh_simple = FALSE((boolean_t) 0); |
| 899 | } |
| 900 | |
| 901 | OutP->optionsType.msgtl_number = optionsCnt; |
| 902 | OutP->Head.msgh_size = 44 + ((OutP->optionsType.msgtl_header.msgt_inline) ? (optionsCnt + 3) & ~3 : sizeof(char *)); |
| 903 | |
| 904 | if (!msgh_simple) |
| 905 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 906 | } |
| 907 | |
| 908 | /* Routine fsys_get_children */ |
| 909 | mig_internalstatic void _Xfsys_get_children |
| 910 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 911 | { |
| 912 | typedef struct { |
| 913 | mach_msg_header_t Head; |
| 914 | } Request; |
| 915 | |
| 916 | typedef struct { |
| 917 | mach_msg_header_t Head; |
| 918 | mach_msg_type_t RetCodeType; |
| 919 | kern_return_t RetCode; |
| 920 | mach_msg_type_long_t childrenType; |
| 921 | char children[2048]; |
| 922 | } Reply; |
| 923 | |
| 924 | Request *In0P = (Request *) InHeadP; |
| 925 | Reply *OutP = (Reply *) OutHeadP; |
| 926 | mig_external kern_return_t S_fsys_get_children |
| 927 | (fsys_t server, data_t *children, mach_msg_type_number_t *childrenCnt); |
| 928 | |
| 929 | boolean_t msgh_simple; |
| 930 | const mach_msg_type_long_t childrenType = { |
| 931 | { |
| 932 | /* msgt_name = */ 0, |
| 933 | /* msgt_size = */ 0, |
| 934 | /* msgt_number = */ 0, |
| 935 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 936 | /* msgt_longform = */ TRUE((boolean_t) 1), |
| 937 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 938 | /* msgt_unused = */ 0 |
| 939 | }, |
| 940 | /* msgtl_name = */ 8, |
| 941 | /* msgtl_size = */ 8, |
| 942 | /* msgtl_number = */ 2048, |
| 943 | }; |
| 944 | |
| 945 | mach_msg_type_number_t childrenCnt; |
| 946 | |
| 947 | char *childrenP; |
| 948 | |
| 949 | #if TypeCheck1 |
| 950 | if ((In0P->Head.msgh_size != 24) || |
| 951 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 952 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 953 | #endif /* TypeCheck */ |
| 954 | |
| 955 | childrenP = OutP->children; |
| 956 | childrenCnt = 2048; |
| 957 | |
| 958 | OutP->RetCode = S_fsys_get_children(In0P->Head.msgh_request_portmsgh_local_port, &childrenP, &childrenCnt); |
| 959 | if (OutP->RetCode != KERN_SUCCESS0) |
| 960 | return; |
| 961 | |
| 962 | msgh_simple = TRUE((boolean_t) 1); |
| 963 | |
| 964 | OutP->childrenType = childrenType; |
| 965 | if (childrenP != OutP->children) { |
| 966 | OutP->childrenType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
| 967 | *((char **)OutP->children) = childrenP; |
| 968 | msgh_simple = FALSE((boolean_t) 0); |
| 969 | } |
| 970 | |
| 971 | OutP->childrenType.msgtl_number = childrenCnt; |
| 972 | OutP->Head.msgh_size = 44 + ((OutP->childrenType.msgtl_header.msgt_inline) ? (childrenCnt + 3) & ~3 : sizeof(char *)); |
| 973 | |
| 974 | if (!msgh_simple) |
| 975 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
| 976 | } |
| 977 | |
| 978 | /* Routine fsys_get_source */ |
| 979 | mig_internalstatic void _Xfsys_get_source |
| 980 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 981 | { |
| 982 | typedef struct { |
| 983 | mach_msg_header_t Head; |
| 984 | } Request; |
| 985 | |
| 986 | typedef struct { |
| 987 | mach_msg_header_t Head; |
| 988 | mach_msg_type_t RetCodeType; |
| 989 | kern_return_t RetCode; |
| 990 | mach_msg_type_t sourceType; |
| 991 | string_t source; |
| 992 | } Reply; |
| 993 | |
| 994 | Request *In0P = (Request *) InHeadP; |
| 995 | Reply *OutP = (Reply *) OutHeadP; |
| 996 | mig_external kern_return_t S_fsys_get_source |
| 997 | (fsys_t server, string_t source); |
| 998 | |
| 999 | const mach_msg_type_t sourceType = { |
| 1000 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
| 1001 | /* msgt_size = */ 8, |
| 1002 | /* msgt_number = */ 1024, |
| 1003 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1004 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1005 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1006 | /* msgt_unused = */ 0 |
| 1007 | }; |
| 1008 | |
| 1009 | #if TypeCheck1 |
| 1010 | if ((In0P->Head.msgh_size != 24) || |
| 1011 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U)) |
| 1012 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
| 1013 | #endif /* TypeCheck */ |
| 1014 | |
| 1015 | OutP->RetCode = S_fsys_get_source(In0P->Head.msgh_request_portmsgh_local_port, OutP->source); |
| 1016 | if (OutP->RetCode != KERN_SUCCESS0) |
| 1017 | return; |
| 1018 | |
| 1019 | OutP->Head.msgh_size = 1060; |
| 1020 | |
| 1021 | OutP->sourceType = sourceType; |
| 1022 | } |
| 1023 | |
| 1024 | static mig_routine_t fsys_server_routines[] = { |
| 1025 | _Xfsys_startup, |
| 1026 | _Xfsys_goaway, |
| 1027 | _Xfsys_getroot, |
| 1028 | _Xfsys_getfile, |
| 1029 | _Xfsys_syncfs, |
| 1030 | _Xfsys_set_options, |
| 1031 | _Xfsys_getpriv, |
| 1032 | _Xfsys_init, |
| 1033 | _Xfsys_forward, |
| 1034 | _Xfsys_get_options, |
| 1035 | _Xfsys_get_children, |
| 1036 | _Xfsys_get_source, |
| 1037 | }; |
| 1038 | |
| 1039 | mig_external boolean_t fsys_server |
| 1040 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
| 1041 | { |
| 1042 | mach_msg_header_t *InP = InHeadP; |
| 1043 | mig_reply_header_t *OutP = (mig_reply_header_t *) OutHeadP; |
| 1044 | |
| 1045 | const mach_msg_type_t RetCodeType = { |
| 1046 | /* msgt_name = */ MACH_MSG_TYPE_INTEGER_322, |
| 1047 | /* msgt_size = */ 32, |
| 1048 | /* msgt_number = */ 1, |
| 1049 | /* msgt_inline = */ TRUE((boolean_t) 1), |
| 1050 | /* msgt_longform = */ FALSE((boolean_t) 0), |
| 1051 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
| 1052 | /* msgt_unused = */ 0 |
| 1053 | }; |
| 1054 | |
| 1055 | mig_routine_t routine; |
| 1056 | |
| 1057 | OutP->Head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InP->msgh_bits), 0)((((InP->msgh_bits) & 0x000000ff)) | ((0) << 8)); |
| 1058 | OutP->Head.msgh_size = sizeof *OutP; |
| 1059 | OutP->Head.msgh_remote_port = InP->msgh_reply_portmsgh_remote_port; |
| 1060 | OutP->Head.msgh_local_port = MACH_PORT_NULL((mach_port_t) 0); |
| 1061 | OutP->Head.msgh_seqno = 0; |
| 1062 | OutP->Head.msgh_id = InP->msgh_id + 100; |
| 1063 | |
| 1064 | OutP->RetCodeType = RetCodeType; |
| 1065 | |
| 1066 | if ((InP->msgh_id > 22011) || (InP->msgh_id < 22000) || |
| 1067 | ((routine = fsys_server_routines[InP->msgh_id - 22000]) == 0)) { |
| 1068 | OutP->RetCode = MIG_BAD_ID-303; |
| 1069 | return FALSE((boolean_t) 0); |
| 1070 | } |
| 1071 | (*routine) (InP, &OutP->Head); |
| 1072 | return TRUE((boolean_t) 1); |
| 1073 | } |
| 1074 | |
| 1075 | mig_external mig_routine_t fsys_server_routine |
| 1076 | (const mach_msg_header_t *InHeadP) |
| 1077 | { |
| 1078 | int msgh_id; |
| 1079 | |
| 1080 | msgh_id = InHeadP->msgh_id - 22000; |
| 1081 | |
| 1082 | if ((msgh_id > 11) || (msgh_id < 0)) |
| 1083 | return 0; |
| 1084 | |
| 1085 | return fsys_server_routines[msgh_id]; |
| 1086 | } |
| 1087 |