tclhttpd

Check-in [5269e4d34c]
Login

Check-in [5269e4d34c]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix to prevent limit.c from accessing the ->result field in interp. (Which Tcl 8.6 REALLY doesn't like)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5269e4d34ccdf1ae20fb7ab87b1ffa409e8a6758
User & Date: hypnotoad 2014-08-08 15:15:33.706
Context
2014-08-08
15:21
(no comment) check-in: c833e75716 user: hypnotoad tags: trunk
15:15
Fix to prevent limit.c from accessing the ->result field in interp. (Which Tcl 8.6 REALLY doesn't like) check-in: 5269e4d34c user: hypnotoad tags: trunk
2014-08-06
03:28
Moved "package require fileutil" from tclhttpd.rc to httpd.tcl. This is where other package requires are done. Tclhttpd.rc is evaluated in a safe interp and can't perform package require. Added namespace import to config.tcl to force the fileutil::tempdir into the Safe interp. check-in: c9f8384938 user: clif tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/limit.c.
42
43
44
45
46
47
48
49


50
51
52
53
54
55
56
    Tcl_GetInt(interp, argv[1], (int *)&limit.rlim_cur);
        if (setrlimit(RLIMIT_NOFILE, &limit) < 0) {
        Tcl_AppendResult(interp, "NOFILE: ", Tcl_PosixError(interp), NULL);
        return TCL_ERROR;
    }
    }
    /* bad, bad style, direct writing to interp->result */
    sprintf(interp->result, "%d %d", limit.rlim_cur, limit.rlim_max);


    return TCL_OK;
}

/*
 * Limit_Init --
 *  Initialize the Tcl limit facility.
 *







|
>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    Tcl_GetInt(interp, argv[1], (int *)&limit.rlim_cur);
        if (setrlimit(RLIMIT_NOFILE, &limit) < 0) {
        Tcl_AppendResult(interp, "NOFILE: ", Tcl_PosixError(interp), NULL);
        return TCL_ERROR;
    }
    }
    /* bad, bad style, direct writing to interp->result */
    sprintf(buf, "%d %d", limit.rlim_cur, limit.rlim_max);
    Tcl_Obj *errStr=Tcl_NewStringObj(buf,-1);
    Tcl_SetObjResult(interp,errStr);
    return TCL_OK;
}

/*
 * Limit_Init --
 *  Initialize the Tcl limit facility.
 *