pkgxdev / pkgx

the last thing you’ll install

Home Page:https://pkgx.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Did the umask change when installing to 0700?

magnusviri opened this issue · comments

At some point the umasks changed. I don't think this is because of my OS. This happens with the tea gui and cli. This is an ls -l of the directories in ~/.tea/tea.xyz:

drwxr-xr-x 10 u0076374  wheel   320 Jul  7 21:02 brewkit
drwxr-xr-x  7 u0076374  wheel   224 Jun 20 08:01 gui
drwxr-xr-x  3 u0076374  wheel    96 Jun 27 12:46 gx
drwxr-xr-x  3 u0076374  wheel    96 Jun 17 07:44 v0.35.7
drwx------  3 u0076374  wheel    96 Jun 20 08:02 v0.35.8
drwx------  3 u0076374  wheel    96 Jul  8 13:50 v0.36.0
drwxr-xr-x  4 u0076374  wheel   128 Jun 17 13:24 var

This breaks a global install of tea. The new umask is applying to all installed packages and it looks like it's only for the version directories. This is the v0.36.0 directory.

drwxr-xr-x  3 u0076374  wheel   96 Jun 28 07:17 bin

I wonder if this is affecting it: https://deno.land/api@v1.35.0?s=Deno.MkdirOptions#prop_mode

What is the umask of your tea binary?

-rwxr-xr-x@ 1 u0076374  wheel  87729159 Jun 28 07:17 tea

tar creates these directories. edit: no we strip all components, so we create them with this:

    const tmpdir = Path.mktemp({
      dir: tea_prefix.join(".local/tmp").join(pkg.project),
      prefix: `v${pkg.version}.`
      //NOTE ^^ inside tea prefix to avoid TMPDIR is on a different volume problems
    })
import { mkdtempSync } from "node:fs"

static mktemp(opts?: { prefix?: string, dir?: Path }): Path {
    let {prefix, dir} = opts ?? {}
    dir ??= new Path(os.tmpdir())
    prefix ??= ""
    if (!prefix.startsWith('/')) prefix = `/${prefix}`
    // not using deno.makeTempDirSync because it's bugg’d and the node shim doesn’t handler `dir`
    const rv = mkdtempSync(`${dir.mkdir('p')}${prefix}`)
    return new Path(rv)
}