From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2692 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Guillermo Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: s6-log can create current with 640? Date: Fri, 25 Oct 2019 14:06:58 -0300 Message-ID: References: <6f3a28f8-798c-9a55-e79b-2e54b37edf2e@heuristicsystems.com.au> <01b8c564-887f-16cf-405c-8bcfc52c02b1@heuristicsystems.com.au> <62d9001a-73bd-5cfe-4c47-f561c4dfabea@heuristicsystems.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="178803"; mail-complaints-to="usenet@blaine.gmane.org" To: Supervision Original-X-From: supervision-return-2281-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Oct 25 19:07:03 2019 Return-path: Envelope-to: gcsg-supervision@m.gmane.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iO33G-000kMT-U9 for gcsg-supervision@m.gmane.org; Fri, 25 Oct 2019 19:07:03 +0200 Original-Received: (qmail 12725 invoked by uid 89); 25 Oct 2019 17:07:27 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Original-Received: (qmail 12718 invoked from network); 25 Oct 2019 17:07:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=2hT3V0bSa/unkfz9FcFWoSyxyRm58w59VRVGVsUm7Ck=; b=YT81sCWOfLqLwR6LerNXE4V3pCwen+6L4H4lZIWqMw9i3fIawH2RBWqV9iKfWBNu6g cFy8Z5vHONXDq7vDcBSTekOByHFJxFOkd/g2m+lzBB66WJQ+hfb9Qy6d+8/PC1t7ilIP 9mAWGQUNjsDhrmTcNaIF6rtKjVEghv7su9nidCbF2r3bfg5IQ9dBNohfApPbv1SwXFZh fcoYY9ubJMyW36c//NFqjNggcRSxcg83lMaXZX/Ft12zN6+oGp199W5vUCIIzojBUfEo 48acUCgl2zEkCavO9AqTGASzbym09mrCmM9ucK3gKEwr08V0/13X4K+qQKJOZh3yhor1 U0zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=2hT3V0bSa/unkfz9FcFWoSyxyRm58w59VRVGVsUm7Ck=; b=dOPzAWaaSSOgUtG0E+M1Gn/eamU6h9shyCfB+RCrf7nVNF2+a31/Bt5J3s4V3xsQty 4OJP+XhNTnz8PTt4Bo0PyAJ360JHVeYNUF0WKx5jXDPkhjz9hJea9nDp3O8ZRDw3JWwQ H5Hvu9phlK6P7NXNTrfHEF5Vv4XolpzlqIYtJvTEaIVHRx5TPsysSD3dGZFM5xT3sGon qkGJ9zBA97SR2tdkAd/Cpfk20jDDZ3gGbFX3V4PeGn+slk5mzCRA0OthVsI2AzZ3QTq/ z9EXI+4AP4GF9PzDSH3vKMX87b8aFy8ZOzqGTkW9oq5PGiWZDQB7ZjNDj8T7hCrTrJRm /oVQ== X-Gm-Message-State: APjAAAUHHTiXlXh0p0gVgD8ljSQCpCSjuMfD4EKlZ+vAZBCZFd2xlB38 UEyFXCZo9QG102POruhi2PJCe6uaSXmvgKYomArmTA== X-Google-Smtp-Source: APXvYqw3nsNSoK5ClU9rPoxz67hymdB68ctZVQnpyzIIVB8nf3Nz2OnTwMi4+q3lYdnkUk+tJGSzPPyjN6V0jXqR4Ws= X-Received: by 2002:a5d:9284:: with SMTP id s4mr4945086iom.38.1572023218830; Fri, 25 Oct 2019 10:06:58 -0700 (PDT) In-Reply-To: <62d9001a-73bd-5cfe-4c47-f561c4dfabea@heuristicsystems.com.au> Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2692 Archived-At: El vie., 25 oct. 2019 a las 5:22, Dewayne Geraghty escribi=C3=B3: > > Results for umask > rm -f /tmp/t1 ; /usr/local/bin/execlineb -Pc 'redirfd -w 1 /tmp/t1 umask > 037 echo hello' ; echo $? ; ls -l /tmp/t1 > [...] > I've placed the ktrace's dumpfile in txt format so its readable for you a= t > http://www.heuristicsystems.com/s6-umask/t1.kdump 42180 execlineb CALL execve(0x7fffffffc770,0x7fffffffc830,0x7fffffffea40) 42180 execlineb NAMI "/sbin/redirfd" 42180 execlineb RET execve -1 errno 2 No such file or directory 42180 execlineb CALL execve(0x7fffffffc770,0x7fffffffc830,0x7fffffffea40) 42180 execlineb NAMI "/bin/redirfd" 42180 execlineb RET execve -1 errno 2 No such file or directory 42180 execlineb CALL execve(0x7fffffffc760,0x7fffffffc830,0x7fffffffea40) 42180 execlineb NAMI "/usr/sbin/redirfd" 42180 execlineb RET execve -1 errno 2 No such file or directory 42180 execlineb CALL execve(0x7fffffffc760,0x7fffffffc830,0x7fffffffea40) 42180 execlineb NAMI "/usr/bin/redirfd" 42180 execlineb RET execve -1 errno 2 No such file or directory 42180 execlineb CALL execve(0x7fffffffc760,0x7fffffffc830,0x7fffffffea40) 42180 execlineb NAMI "/usr/local/sbin/redirfd" 42180 execlineb RET execve -1 errno 2 No such file or directory 42180 execlineb CALL execve(0x7fffffffc760,0x7fffffffc830,0x7fffffffea40) 42180 execlineb NAMI "/usr/local/bin/redirfd" 42180 execlineb NAMI "/libexec/ld-elf.so.1" 42180 redirfd RET execve JUSTRETURN > I also tried what I thought was the more logical > # rm -f /tmp/t1 ; /usr/local/bin/execlineb -Pc 'umask 033 redirfd -w 1 > /tmp/t1 echo hello' ; echo $? ; ls -l /tmp/t1 > [...] > This ktrace is > http://www.heuristicsystems.com/s6-umask/t1-umask-redirfd.kdump 276 execlineb CALL execve(0x7fffffffc770,0x7fffffffc830,0x7fffffffea40) 276 execlineb NAMI "/usr/bin/umask" 276 execlineb NAMI "/bin/sh" 276 execlineb NAMI "/libexec/ld-elf.so.1" 276 sh RET execve JUSTRETURN [...] 276 sh CALL openat(AT_FDCWD,0x7fffffffed10,0x100000) 276 sh NAMI "/usr/bin/umask" 276 sh RET openat 3 276 sh CALL fcntl(0x3,F_DUPFD_CLOEXEC,0xa) 276 sh RET fcntl 10/0xa 276 sh CALL close(0x3) [...] 276 sh CALL read(0xa,0x104c9d0,0x400) 276 sh GIO fd 10 read 160 bytes "#!/bin/sh # $FreeBSD: stable/12/usr.bin/alias/generic.sh 151635 2005-10-24 22:32:19Z cperciva $ # This file is in the public domain. builtin ${0##*/} ${1+"$@"} " 276 sh RET read 160/0xa0 Let me guess: the value of PATH is /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin, execline's chain loading umask is in /usr/local/bin, and FreeBSD happens to have an 'umask' shell script in /usr/bin. If that is correct, then you'll have to either use the absolute pathname /usr/local/bin/umask in the execlineb chain, or run it with a PATH in which /usr/local/bin comes before /usr/bin. G.