Tcl Source Code

Attachment Details
Login
Overview

Artifact ID: c4e1309d079a8e5860b5f69199ca336d5f879c539eccf7d66789f30be91e9605
Ticket: e2698b94b151aecf275b3dd2c5d605b89022684e
Date: 2026-04-14 23:48:41
User: jmroot
Artifact Attached: 264ae57d6455292a87251e0e642fe98fd9418984147a38a0e3f9f3b2789aa23b
Filename:cd_crash.c
Description:C program that reproduces the issue on macOS 26.4.1
Content:
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
#include <sys/types.h>
#include <pwd.h>
#include <uuid/uuid.h>
#include <unistd.h>
#include <tcl.h>

int main(void)
{
    Tcl_Interp *interp = Tcl_CreateInterp();
    struct passwd *pwent = getpwnam("nobody");
    Tcl_Obj *pathobj = Tcl_NewStringObj("/", -1);
    Tcl_IncrRefCount(pathobj);
    Tcl_Obj *cwdobj = Tcl_FSGetCwd(interp);
    setegid(pwent->pw_gid);
    seteuid(pwent->pw_uid);
    cwdobj = Tcl_FSGetCwd(interp);
    Tcl_FSChdir(pathobj);
    return 0;
}