google / google/fscryptctl

Minor usage string improvement

Open Beginner friendly
#50 2 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
C
Stars
147
Forks
36
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.