[BusyBox] RE:Busybox_unstable adduser patch2

Martin Volf volf at dragon.cz
Wed Jul 17 04:14:06 UTC 2002


On Wed, 17 Jul 2002, Tito wrote:

> void passwd_wrapper(const char *login)
> {
> 	static const char prog[] = "passwd";
> 	execlp(prog, prog, login, NULL);
>
> 		How can the error_msg_and_die func intercept an error from execlp
>                 we don't need to tell to it in some way?
>
> 	error_msg_and_die("Failed to execute 'passwd', you must set the password for '%s' manually", logi
> }
>
>                 and why die as at this point the whole job is already done and we are providing
>                 the default password "x".
>                 A simple error_msg wouldn't be enough ?

Hello,

quoting from man execlp:

       If  any  of the exec functions returns, an error will have
       occurred.  The return value is -1, and the global variable
       errno will be set to indicate the error.

Martin




More information about the busybox mailing list