supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Guillermo <gdiazhartusch@gmail.com>
To: Supervision <supervision@list.skarnet.org>
Subject: Re: s6-log can create current with 640?
Date: Fri, 25 Oct 2019 14:06:58 -0300	[thread overview]
Message-ID: <CADQ2Nw9oYoCauQbvDa=N7G53tgTKKWDLoQUV-OxVE41kPM7iOg@mail.gmail.com> (raw)
In-Reply-To: <62d9001a-73bd-5cfe-4c47-f561c4dfabea@heuristicsystems.com.au>

El vie., 25 oct. 2019 a las 5:22, Dewayne Geraghty escribió:
>
> 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 at
> 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<O_RDONLY|O_CLOEXEC>)
   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.


  reply	other threads:[~2019-10-25 17:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23  2:27 Dewayne Geraghty
2019-10-23  4:53 ` Colin Booth
2019-10-23  5:39   ` Dewayne Geraghty
2019-10-23  7:15 ` Jonathan de Boyne Pollard
2019-10-23 23:03   ` Dewayne Geraghty
2019-10-23 23:58     ` Laurent Bercot
2019-10-25  8:20       ` Dewayne Geraghty
2019-10-25 17:06         ` Guillermo [this message]
2019-10-26  1:52           ` Dewayne Geraghty
2019-10-26  5:27             ` Laurent Bercot
2019-10-26  7:16               ` Dewayne Geraghty
2019-10-26 13:08                 ` Laurent Bercot
2019-10-29  7:28               ` Jonathan de Boyne Pollard
     [not found]               ` <a8fbd02e-0265-3d59-89d1-81048665693c@ntlworld.com>
2019-10-29  8:53                 ` Laurent Bercot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADQ2Nw9oYoCauQbvDa=N7G53tgTKKWDLoQUV-OxVE41kPM7iOg@mail.gmail.com' \
    --to=gdiazhartusch@gmail.com \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).