docs: add comment

This commit is contained in:
Ting-Jun Wang 2024-05-25 18:35:26 +08:00
parent 91d9a3e66b
commit fe27808a65
Signed by: snsd0805
GPG Key ID: 48D331A3D6160354

View File

@ -38,6 +38,18 @@ bool check_user(char *filename, char *username, unsigned long *new_start) {
} }
void insert_user(char *filename, char *username, unsigned long start) { void insert_user(char *filename, char *username, unsigned long start) {
/*
* Insert the user into uid file
* It will setup the next start uid automatically
* == it will change /etc/subuid or /etc/subgid ==
*
* Args:
* filename (char *): means the uid file (subuid or subgid).
* username (char *): the user who run this excutable file.
* new_start (unsigned long ): it's a value, means the next start uid
* Return:
* No
*/
FILE *fp = fopen(filename, "a"); FILE *fp = fopen(filename, "a");
if (fp == NULL) { if (fp == NULL) {