[
https://issues.apache.org/jira/browse/VCL-897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andy Kurth updated VCL-897:
---------------------------
Description:
The {{grant_root_access}} subroutines in {{Linux.pm}} and {{Windows.pm}} accept
a hash reference argument which must contain a _username_ key. The username is
the only piece of information {{grant_root_access}} needs.
{{grant_root_access}} is also currently using a _root\_access_ key. It makes
no sense to call this subroutine and then have it check if it should have been
called in the first place. The caller should be responsible for this.
The hash reference argument was presumably a result of copying and pasting the
arguments accepted by its caller, the {{create_user}} subroutine which requires
the other pieces of information contained in the hash reference.
There is no point of passing information to {{grant_root_access}} which it
doesn't need. It would be better programming style to pass it a simple string
containing the username.
was:
The {{grant_root_access}} subroutines in {{Linux.pm}} and {{Windows.pm}} accept
a hash reference argument which must contain a _username_ key. The username is
the only piece of information {{grant_root_access}} needs. The hash reference
argument was presumably a result of copying and pasting the arguments accepted
by its caller, the {{create_user}} subroutine which requires the other pieces
of information contained in the hash reference.
There is no point of passing information to {{grant_root_access}} which it
doesn't need. It would be better programming style to pass it a simple string
containing the username.
> Simplify arguments accepted by grant_root_access subroutines
> ------------------------------------------------------------
>
> Key: VCL-897
> URL: https://issues.apache.org/jira/browse/VCL-897
> Project: VCL
> Issue Type: Improvement
> Components: vcld (backend)
> Reporter: Andy Kurth
> Assignee: Andy Kurth
> Fix For: 2.5
>
>
> The {{grant_root_access}} subroutines in {{Linux.pm}} and {{Windows.pm}}
> accept a hash reference argument which must contain a _username_ key. The
> username is the only piece of information {{grant_root_access}} needs.
> {{grant_root_access}} is also currently using a _root\_access_ key. It makes
> no sense to call this subroutine and then have it check if it should have
> been called in the first place. The caller should be responsible for this.
> The hash reference argument was presumably a result of copying and pasting
> the arguments accepted by its caller, the {{create_user}} subroutine which
> requires the other pieces of information contained in the hash reference.
> There is no point of passing information to {{grant_root_access}} which it
> doesn't need. It would be better programming style to pass it a simple
> string containing the username.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)