aboutsummaryrefslogtreecommitdiffstats
path: root/lacme-accountd
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-12-05 16:52:52 +0100
committerGuilhem Moulin <guilhem@fripost.org>2016-12-05 16:52:52 +0100
commit47ff80f540e71229832c972dcc2653958a0d7b56 (patch)
tree331a34f4848f216382067ede028e84a484c2d8eb /lacme-accountd
parent94a72b73a2b7e4309a7bc6434e85dfba8b1c8a7d (diff)
parent0eb9f40182299b2615f5ac0190d40429f5f64ed7 (diff)
Merge tag 'upstream/0.2' into debian
Upstream version 0.2
Diffstat (limited to 'lacme-accountd')
-rwxr-xr-xlacme-accountd9
1 files changed, 5 insertions, 4 deletions
diff --git a/lacme-accountd b/lacme-accountd
index 411538d..00d6ccd 100755
--- a/lacme-accountd
+++ b/lacme-accountd
@@ -59,7 +59,7 @@ sub usage(;$$) {
}
exit $rv;
}
-usage(1) unless GetOptions(\%OPTS, qw/config=s privkey=s socket=s fdopen=i quiet|q debug help|h/);
+usage(1) unless GetOptions(\%OPTS, qw/config=s privkey=s socket=s conn-fd=i quiet|q debug help|h/);
usage(0) if $OPTS{help};
do {
@@ -137,8 +137,9 @@ $JWK = JSON::->new->encode($JWK);
# to support the abstract namespace.) The downside is that we have to
# delete the file manually.
#
-if (defined $OPTS{fdopen}) {
- die "Invalid file descriptor" unless $OPTS{fdopen} =~ /\A(\d+)\z/;
+if (defined $OPTS{'conn-fd'}) {
+ die "Invalid file descriptor" unless $OPTS{'conn-fd'} =~ /\A(\d+)\z/;
+ # untaint and fdopen(3) our end of the socket pair
open $S, '+<&=', $1 or die "fdopen $1: $!";
} else {
my $sockname = $OPTS{socket} // (defined $ENV{XDG_RUNTIME_DIR} ? "$ENV{XDG_RUNTIME_DIR}/S.lacme" : undef);
@@ -182,7 +183,7 @@ sub conn($;$) {
}
}
-if (defined $OPTS{fdopen}) {
+if (defined $OPTS{'conn-fd'}) {
conn($S, $$);
} else {
$SIG{PIPE} = 'IGNORE'; # ignore broken pipes