Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proccontrol: make -s require a target #2205

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions usr.bin/proccontrol/proccontrol.1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 5, 2023
.Dd August 23, 2024
.Dt PROCCONTROL 1
.Os
.Sh NAME
Expand All @@ -35,9 +35,12 @@
.Sh SYNOPSIS
.Nm
.Fl m Ar mode
.Op Fl s Ar control
.Op Fl q
.Fl s Ar control
.Fl p Ar pid | command
.Nm
.Fl m Ar mode
.Fl q
.Op Fl p Ar pid | command
.Sh DESCRIPTION
The
.Nm
Expand Down
16 changes: 11 additions & 5 deletions usr.bin/proccontrol/proccontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,15 @@ str2pid(const char *str)
static void __dead2
usage(void)
{

fprintf(stderr, "Usage: proccontrol -m (aslr|protmax|trace|trapcap|"
"stackgap|nonewprivs|wxmap"KPTI_USAGE LA_USAGE CHERI_REVOKE_USAGE
CHERI_C18N_USAGE
") [-q] [-s (enable|disable)] [-p pid | command]\n");
fprintf(stderr, "Usage:\n");
fprintf(stderr, " proccontrol -m mode -s (enable|disable) "
"(-p pid | command)\n");
fprintf(stderr, " proccontrol -m mode -q [-p pid]\n");
fprintf(stderr, "Modes: "
"aslr|protmax|trace|trapcap|stackgap|nonewprivs|wxmap"
KPTI_USAGE LA_USAGE
CHERI_REVOKE_USAGE CHERI_C18N_USAGE
"\n");
exit(1);
}

Expand Down Expand Up @@ -183,6 +187,8 @@ main(int argc, char *argv[])
usage();
pid = getpid();
} else if (pid == -1) {
if (!query)
usage();
pid = getpid();
}

Expand Down
Loading