| 3586 | } |
| 3587 | |
| 3588 | staticfn int |
| 3589 | optfn_role( |
| 3590 | int optidx, |
| 3591 | int req, |
| 3592 | boolean negated, |
| 3593 | char *opts, |
| 3594 | char *op) |
| 3595 | { |
| 3596 | if (req == do_init) { |
| 3597 | return optn_ok; |
| 3598 | } |
| 3599 | if (req == do_set) { |
| 3600 | /* role:string */ |
| 3601 | if (!parse_role_opt(optidx, negated, allopt[optidx].name, opts, &op)) |
| 3602 | return optn_silenterr; |
| 3603 | |
| 3604 | if (*op != '!') { |
| 3605 | if ((flags.initrole = str2role(op)) == ROLE_NONE) { |
| 3606 | config_error_add("Unknown %s '%s'", allopt[optidx].name, op); |
| 3607 | return optn_err; |
| 3608 | } |
| 3609 | nmcpy(svp.pl_character, op, PL_NSIZ); /* Backwards compat */ |
| 3610 | saveoptstr(optidx, rolestring(flags.initrole, roles, name.m)); |
| 3611 | } |
| 3612 | return optn_ok; |
| 3613 | } |
| 3614 | if (req == get_val) { |
| 3615 | Sprintf(opts, "%s", rolestring(flags.initrole, roles, name.m)); |
| 3616 | return optn_ok; |
| 3617 | } |
| 3618 | if (req == get_cnf_val) { |
| 3619 | op = get_cnf_role_opt(optidx); |
| 3620 | Strcpy(opts, op ? op : "none"); |
| 3621 | return optn_ok; |
| 3622 | } |
| 3623 | return optn_ok; |
| 3624 | } |
| 3625 | |
| 3626 | staticfn int |
| 3627 | optfn_runmode( |
nothing calls this directly
no test coverage detected