Minor usage string improvement

Open Beginner friendly
#50 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
90/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
c, linux
Domain
cli

Research direction

Start in fscryptctl.c around lines 120-130, where the usage strings for add_key, remove_key, and key_status are defined. Replace the misleading MOUNTPOINT wording with PATH for all three commands, then run the tool's help or usage output to verify the updated text.

Written by the indexing model from the issue text.

Description

documentation

The usage string for add_key, remove_key, and key_status is somewhat misleading. These commands currently describe their path argument as a MOUNTPOINT, which suggests that the argument must be the root of the filesystem.

However, the implementation simply opens the supplied path and passes the resulting file descriptor to the corresponding fscrypt ioctl. The FS_IOC_ADD_ENCRYPTION_KEY, FS_IOC_REMOVE_ENCRYPTION_KEY, and FS_IOC_GET_ENCRYPTION_KEY_STATUS ioctls do not require the file descriptor to refer to the filesystem root. They can be executed on any file or directory on the target filesystem; the filesystem root is only recommended by the kernel documentation.

Consequently, a user who has a directory on the target filesystem should not need to first determine its mount point (for example, with findmnt) before using add_key, remove_key, or key_status. The current usage string implies that they do.

The usage string should therefore be generalized to describe the argument as a path on the target filesystem rather than specifically as a mount point.

For example, instead of:

fscryptctl add_key [OPTION...] MOUNTPOINT

the usage could use something like:

fscryptctl add_key [OPTION...] PATH

and similarly for remove_key and key_status.

Reference:
https://github.com/google/fscryptctl/blob/f1ec919877f6b5360c03fdb44b6ed8a47aa459e8/fscryptctl.c#L120-L130

Dominant language
C
Stars
147
Forks
36
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

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 google/fscryptctl

All issues in google/fscryptctl

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.