Skip to content

Running from a web server ,on Mac OS Racket try to open pref-dir of admin user that installed Racket instead of the one of current-user #786

Open

Description

@damien-mattei

Hi,

it is not easy to reproduce as it requires, Mac OS, a web server running an application that run racket.

i run the web server that seems to run under user _www:

ps xau
_www 13856 0,0 0,6 410998272 204400 s007 S+ 11:52 0:00.63 /Applications/Racket/bin/racket

but when the web application using racket try to use the preference file it fall back to the one of me, mattei, administrator of the host, as seen in the output of httpd log:

[3] => interpole-fields : Racket/Scheme+ (find-system-path 'pref-file): /Users/mattei/Library/Preferences/org.racket-lang.prefs.rktd

Racket must use the preference file from _www which is the proprietary of the Rackett running process.

Activity

  1. soegaard commented on Dec 5, 2025

    @soegaard
    Member

    How did you start the Racket program?

    I asked ChatGPT to explain the output from ps xau and it said:

    TT: s007 — controlling terminal (an interactive shell session)

    This seems odd if the Racket process is invoked by the web server.

  2. soegaard commented on Dec 5, 2025

    @soegaard
    Member

    FWIW find-system-path eventually calls rktio_system_path which is defined here:

    https://github.com/racket/racket/blob/master/racket/src/rktio/rktio_fs.c#L2302

    I think the current user is taken from the shell rather than from the user that owns the process.

  3. damien-mattei commented on Dec 5, 2025

    @damien-mattei
    Author

    ps is just the command ps of unix
    print statistics of processes

    about current user taken from shell and it seems the envionment is good:

    (myvenv3.10) _www@mac ~ % printenv
    LANG=fr_FR.UTF-8
    USER=_www
    LOGNAME=_www
    HOME=/Library/WebServer
    PATH=/Users/mattei/myvenv3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin:/opt/homebrew/bin
    SHELL=/bin/zsh
    TERM=xterm-256color
    mount_authenticator_shm=/pamF48D8F78B233
    SSH_CLIENT=::1 50824 22
    SSH_CONNECTION=::1 50824 ::1 22
    SSH_TTY=/dev/ttys004
    TMPDIR=/var/folders/zz/zyxvpxvq6csfxvn_n000008r000026/T/
    SHLVL=1
    PWD=/Library/WebServer
    OLDPWD=/Library/WebServer
    VIRTUAL_ENV=/Users/mattei/myvenv3.10
    PS1=(myvenv3.10) %n@%m %1~ %#
    VIRTUAL_ENV_PROMPT=(myvenv3.10)
    _=/usr/bin/printenv

    user is well _www but this output show mattei in PATH and other place that should not be, this could be causing because for using _www account i'm first logged in mattei and do ssh _www@localhost

    i will check all the varriable from web server app , not from console as it is what is important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions