DragonFly BSD
DragonFly kernel List (threaded) for 2003-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Prebinding for DragonFly/FreeBSD-4


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Sep 2003 19:59:01 -0700 (PDT)

    Patching for suid/sgid prebinding disablement is trivial.  The code
    in _rtld() is just slightly modified to add an if (trust) ...

    if (trust) {
	prebind_disable = getenv("LD_PREBIND_DISABLE") != NULL;
    } else {
	prebind_disable = 1;
    }

    ...

    if (trust) {
        ld_prebind = getenv("LD_PREBIND");
        if (ld_prebind != NULL && *ld_prebind != '\0') {
            ld_bind_now = ld_prebind;
            prebind_disable = 1;
        } 
    }

    Also, you do not need to initialize prebind_disable to 0 in the
    'int prebind_disable = 0' declaration, since you unconditionally
    initialize it below and the compiler will catch simple cases for
    variables that are used without being initialized.  Or, alternatively,
    you can default prebind_disable to 1 in the declaration and clean up
    my else clause above.

						-Matt





[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]