From fe27808a6562c1d7eb9a041c81a10e090acfc3ea Mon Sep 17 00:00:00 2001 From: Ting-Jun Wang Date: Sat, 25 May 2024 18:35:26 +0800 Subject: [PATCH] docs: add comment --- tool/setup_uid.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tool/setup_uid.c b/tool/setup_uid.c index d9f32e9..7500b8d 100644 --- a/tool/setup_uid.c +++ b/tool/setup_uid.c @@ -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) { + /* + * 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"); if (fp == NULL) {