Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

visudo + sudoedit = ♥?

Aberta
#167 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
c
Domínio
cli, security

Direção de pesquisa

Start by reading the visudo and sudoedit entry points and how visudo invokes an editor; the issue does not name source files or tests. Work out how permission checks and syntax validation interact before estimating an implementation. Done means visudo can support editing sudoers files as the invoking user while retaining syntax validation, including a clear response when required permissions are missing.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

I'd like a way to edit my sudoers file (or one of its includes) in a way that combines the best of sudoedit and visudo:

  • Runs the editor as myself, like sudoedit
  • Ensures I got the syntax right, like visudo

This might be doable today using something like sudo SUDO_EDITOR=my-wrapper visudo, where my-wrapper is a script that copies the given temp file over to a user-writeable one, runs sudoedit on that as SUDO_USER, and copies the modified file back over to original the temp file.

However, I think it would be much nicer if this functionality was available built-in.

In terms of the user interface, I would think it makes most sense to just enhance visudo to detect if it is being run by a user without write access to the given file(s) (i.e. typically a non-root user). If so, rather than invoking the editor directly, it would run sudoedit; perhaps after first checking via sudo -l that the required permissions exist (in order to give a better error message if not).

If this makes sense, I'd be happy to have a go at implementing this.

Linguagem predominante
C
Estrelas
1.7k
Forks
306
Merge médio
1d 8h
PRs com merge (30d)
24

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de sudo-project/sudo

Todas as issues de sudo-project/sudo

Issues semelhantes

Mais issues de C

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.