sulogin
Ashwin Bihari
abihari at gmail.com
Fri Oct 20 13:32:37 PDT 2006
On 10/20/06, Tito <farmatito at tiscali.it> wrote:
>
> Hi Denis,
> I've a little size optimization for sulogin that I'm sure will win your
> obfuscated code price ;-)
>
> function old new delta
> sulogin_main 489 488 -1
>
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-1) Total: -1
> bytes
>
> This is only compile tested.
>
> Ciao,
> Tito
>
> --- loginutils/sulogin_orig.c 2006-10-20 13:47:02.000000000 +0200
> +++ loginutils/sulogin.c 2006-10-20 22:08:01.000000000 +0200
> @@ -42,7 +42,6 @@
> const char * const *p;
> struct passwd *pwd;
> struct spwd *spwd;
> - const char *shell;
>
> logmode > openlog(applet_name, 0, LOG_AUTH);
> @@ -106,14 +105,7 @@
>
> USE_SELINUX(renew_current_security_context());
>
> - shell > - if (!shell) shell > - if (!shell) {
> - shell > - if (pwd->pw_shell[0])
> - shell > - }
> - run_shell(shell, 1, 0, 0);
> + run_shell(getenv("SUSHELL") ? : getenv("sushell") ? :
> pwd->pw_shell ? : DEFAULT_SHELL, 1, 0, 0);
> /* never returns */
>
> auth_error:
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
>
Wow, all that obfuscation for a single byte size gain? Not worth it,
IMHO..:)
Regards
--
~ Ashwin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/busybox/attachments/20061020/dafea642/attachment.html
More information about the busybox
mailing list