• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • fix_path.c

    October 9th, 2008
    fix_path, programming, shell  [html]
    I did end up writing a C program to do the path fixing; it makes a big difference when the system is under load.

    fix path in c

    Then I have to change my bashrc a little bit from before:

    PS1="${PS1}$(fix_path)"
    And now it's all spiffy fast.

    UPDATE 2009-07-20: The line above actually has an untrusted code excecution vulnerability. If the user can be tricked into navigating to a directory with something like $(foo) or `foo` in the name, then the foo program will be excecuted. This is quite bad. The problem is that the shell evaluates the PS1 variable before display. So we need to change that line to:

    PS1="${PS1}\$(fix_path)"
    And we postpone evaluation to when the prompt is displayed, instead of evaluating it both when PS1 is set and then again when it is displayed.

    Comment via: facebook

    Recent posts on blogs I like:

    It's ok to feed stray cats

    Before we had kids, Jeff and I fostered a couple of cats. One had feline AIDS and was very skinny. Despite our frugal grocery budget of the time, I put olive oil on her food, determined to get her healthier. I knew that stray cats were not a top global pr…

    via Giving Gladly May 15, 2021

    Collections: Teaching Paradox, Europa Universalis IV, Part III: Europa Provincalis

    This is the third part of our series (I, II) examining the historical assumptions of Paradox Interactive’s grand strategy computer game set in the early modern period, Europa Universalis IV (which is in turn the start of a yet larger series looking at sev…

    via A Collection of Unmitigated Pedantry May 14, 2021

    Randal O’Toole Gets High-Speed Rail Wrong

    Now that there’s decent chance of US investment in rail, Randal O’Toole is resurrecting his takes from the early Obama era, warning that high-speed rail is a multi-trillion dollar money sink. It’s not a good analysis, and in particular it gets the reality…

    via Pedestrian Observations May 12, 2021

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact