Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Feature Request - Notify Prompt - Willing to create PR

Open
#365 7 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
c
Domain
cli, security

Research direction

The proof of concept points to src/tgetpass.c, in tgetpass just before the prompt is written. First read how prompt handling and sudoers defaults are defined and validated, including their visudo editing path; the issue does not identify those entry points. Done means a scoped, safe configuration design and implementation that notifies when sudo waits for a password, with behavior and security expectations defined.

Written by the indexing model from the issue text.

Description

I often have multiple terminals open with each terminal running some pipeline, (compiling, linting, installing, etc).

Some of those pipelines take a very long time and other than intermittently checking back in with each terminal, I have no way of knowing if a pipeline is done compiling and waiting to install and sitting at a sudo prompt for installation permission.

I would like to provide a user-configurable way to hook some (pre-approved and defined) external tool to let me know that sudo is waiting for input before it eventually times out the and pipeline fails.

I have a proof of concept which accomplishes exactly what I want:

// in src/tgetpass.c::tgetpass
// right before writing the prompt to output

if (notify) {
    system("notify-send \"sudo\" \"sudo is prompting for a password\"");
}

I realize I don't want the external tool to be any arbitrary executable which could allow an injection and I don't want the notification to be configurable either. I would imagine that the user could specify something in the sudoers conf file something like:

Defaults promptpass_notify=notify-send

And the values for that option would be checked at init time to ensure there are no arbitrary calls to unexpected notifier scripts. (Although I realize someone could just symlink whatever they want, is this even a concern? This would be executed before sudo was even authorized to execute the given command)

I would be willing to do the legwork on this feature, but I got stuck in understanding how to implement this with support for editing with visudo and where a flag like this would live in conf or if it should just be an env flag.

Dominant language
C
Stars
1.7k
Forks
306
Avg merge
1d 2h
Merged PRs (30d)
22

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sudo-project/sudo

All issues in sudo-project/sudo

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.