| 513 | } |
| 514 | |
| 515 | int |
| 516 | ink_fileperm_parse(const char *perms) |
| 517 | { |
| 518 | if (perms && strlen(perms) == 9) { |
| 519 | int re = 0; |
| 520 | const char *c = perms; |
| 521 | if (*c == 'r') { |
| 522 | re |= S_IRUSR; |
| 523 | } |
| 524 | c++; |
| 525 | if (*c == 'w') { |
| 526 | re |= S_IWUSR; |
| 527 | } |
| 528 | c++; |
| 529 | if (*c == 'x') { |
| 530 | re |= S_IXUSR; |
| 531 | } |
| 532 | c++; |
| 533 | if (*c == 'r') { |
| 534 | re |= S_IRGRP; |
| 535 | } |
| 536 | c++; |
| 537 | if (*c == 'w') { |
| 538 | re |= S_IWGRP; |
| 539 | } |
| 540 | c++; |
| 541 | if (*c == 'x') { |
| 542 | re |= S_IXGRP; |
| 543 | } |
| 544 | c++; |
| 545 | if (*c == 'r') { |
| 546 | re |= S_IROTH; |
| 547 | } |
| 548 | c++; |
| 549 | if (*c == 'w') { |
| 550 | re |= S_IWOTH; |
| 551 | } |
| 552 | c++; |
| 553 | if (*c == 'x') { |
| 554 | re |= S_IXOTH; |
| 555 | } |
| 556 | return re; |
| 557 | } |
| 558 | return -1; |
| 559 | } |
no outgoing calls
no test coverage detected