Merge pull request #55 from glerchundi/master
logutil-newfifo permit -o (owner) and -m (mode) params
This commit is contained in:
commit
77dd4dc25a
3 files changed
+25
-14
No files matched your search
@@ -12,7 +12,11 @@ import -u envuidgid_opts
|
||||
foreground { s6-envuidgid ${envuidgid_opts} ${account} s6-chown -U -- ${1} }
|
||||
ifelse -- { if { s6-${2} } s6-test -d ${1} }
|
||||
{
|
||||
foreground { s6-chmod ${5} ${1} }
|
||||
foreground
|
||||
{
|
||||
if -t { s6-test ! ${5} = "-" }
|
||||
s6-chmod ${5} ${1}
|
||||
}
|
||||
forbacktickx -0 subfile { s6-ls -0 ${1} }
|
||||
multisubstitute
|
||||
{
|
||||
@@ -21,6 +25,7 @@ ifelse -- { if { s6-${2} } s6-test -d ${1} }
|
||||
}
|
||||
execlineb -S5 -c ${recfunction} ${1}/${subfile} true ${3} ${4} ${5}
|
||||
}
|
||||
if -t { s6-test ! ${4} = "-" }
|
||||
s6-chmod ${4} ${1}"
|
||||
|
||||
forstdin -d"\n" -- line
|
||||
|
||||
@@ -6,7 +6,7 @@ multisubstitute
|
||||
importas -u envdir 1
|
||||
importas -u envvar 2
|
||||
importas -u -D "" defval ELGETOPT_D
|
||||
import -u -D 0 ELGETOPT_u
|
||||
importas -u -D 0 unexport ELGETOPT_u
|
||||
}
|
||||
shift -n 2
|
||||
elgetpositionals -P0
|
||||
@@ -20,7 +20,7 @@ backtick -n ${envvar}
|
||||
}
|
||||
s6-echo -n "${defval}"
|
||||
}
|
||||
ifelse { s6-test ${ELGETOPT_u} -eq 1 }
|
||||
ifelse { s6-test ${unexport} -eq 1 }
|
||||
{
|
||||
import -u ${envvar}
|
||||
$@
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
#!/usr/bin/execlineb
|
||||
|
||||
# test if arguments were given
|
||||
if { s6-test $# -ge 1 }
|
||||
|
||||
|
||||
# wait for fdholderd
|
||||
elgetopt "m:o:"
|
||||
multisubstitute
|
||||
{
|
||||
importas -u -D "0600" fmode ELGETOPT_m
|
||||
importas -u -D "root" owner ELGETOPT_o
|
||||
}
|
||||
elgetpositionals -P0
|
||||
emptyenv -P
|
||||
if { s6-test ${#} -ge 1 }
|
||||
if { s6-svwait -t 5000 -U /var/run/s6/services/s6-fdholderd }
|
||||
|
||||
|
||||
# initialize fifo and put it inside fdholderd
|
||||
if { s6-rmrf ${1} }
|
||||
if { s6-mkfifo -m 0600 -- ${1} }
|
||||
if { s6-mkfifo -m ${fmode} -- ${1} }
|
||||
if
|
||||
{
|
||||
s6-envuidgid -- ${owner}
|
||||
s6-chown -U -- ${1}
|
||||
}
|
||||
if
|
||||
{
|
||||
backtick -n name { s6-uniquename fifo }
|
||||
import -u name
|
||||
redirfd -rnb 0 ${1}
|
||||
s6-fdholder-store /var/run/s6/fdholderd-socket fifo:${name}
|
||||
s6-fdholder-store /var/run/s6/fdholderd-socket ${name}
|
||||
}
|
||||
Reference in new issue
Block a user