[BusyBox] Fwd: BBUnstable adduser.c patch

Vladimir N. Oleynik dzo at simtreas.ru
Thu Jul 4 03:02:03 UTC 2002


Tito,

> ----------  Forwarded Message  ----------
> 
> Subject: BBUnstable adduser.c patch
> Date: Wed, 3 Jul 2002 22:02:53 +0200
> From: tito <farmatito at tiscali.it>
> To: <andersen at codepoet.org>
> 
> Hi Erik
> this little patch for adduser.c that i humbly submit to your attention
> contains my previous fixes for the commandline parsing (which you should
> check and optimize 'cause they looks too rustic to me ),
> on the same time i standardized the behavior of the
> 
>  addgroup_wrapper and passwd_wrapper functions
> 
> making them both able to use busybox builtins and external progs
> and improving the error handling
> (these part of the patch looks good to me).
> Let me know if you like it.......

"Much simpler and easier to unerstand and be sure it is correct" (c) Erik.
I like not strange patch:
http://www.busybox.net/lists/busybox/2002-February/010972.html

But, Why without fork() and "Exiting"?
Now it is possible to simplify still:

static void addgroup_wrapper(const char *login, gid_t gid)
{
	char *cmd = xmalloc(strlen(login)+32);

	sprintf(cmd, "addgroup %s -g %d", login, gid);
	system(cmd);
	free(cmd);
}



--w
vodz



More information about the busybox mailing list