•  
      request #23041 Use an absolute path when calling `gitolite access`
    Infos
    #23041
    Thomas Gerbet (tgerbet)
    2021-09-18 11:25
    2021-09-17 16:27
    24592
    Details
    Use an absolute path when calling `gitolite access`

    Currently AccessControlVerifier calls gitolite access without specifying an absolute path.

        private function canWriteAccordingToGitolite(PFUser $user, GitRepository $repository, $reference)
        {
            $repository_name = escapeshellarg(PathJoinUtil::unixPathJoin([$repository->getProject()->getUnixName(), $repository->getFullName()]));
            $user_name       = escapeshellarg($user->getUserName());
            $reference       = escapeshellarg($reference);
    
            try {
                $this->system_command->exec("sudo -u gitolite /usr/bin/gitolite access -q $repository_name $user_name 'W' $reference");
            } catch (\System_Command_CommandException $ex) {
                return false;
            }
    
            return true;
        }
    

    We call gitolite access through sudo which means that we have no control on what's being used for real. System administrators might have customized the secure_path setting which could lead to behaviors we do not expect. We should remove the incertitude and use an absolute path when calling the gitolite CLI.

    SCM/Git
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Closed
    2021-09-18
    Attachments
    Empty
    References

    Follow-ups

    User avatar

    Integrated into Tuleap 13.0.99.7


    • Status changed from Under review to Closed
    • Connected artifacts
    • Close date set to 2021-09-18
    User avatar
    Thomas Gerbet (tgerbet)2021-09-17 16:28

    Patch under review: gerrit #24002.


    • Status changed from Under implementation to Under review
    • Assigned to changed from None to Thomas Gerbet (tgerbet)