aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/pies.texi4
-rw-r--r--src/piesctl-cl.opt6
-rw-r--r--src/piesctl.c4
-rw-r--r--tests/env.at4
-rw-r--r--tests/respawn.at2
-rw-r--r--tests/shell.at2
-rw-r--r--tests/shutdown.at4
-rw-r--r--tests/startup.at4
8 files changed, 21 insertions, 9 deletions
diff --git a/doc/pies.texi b/doc/pies.texi
index 1a798e1..b77a40c 100644
--- a/doc/pies.texi
+++ b/doc/pies.texi
@@ -3021,12 +3021,16 @@ Dump obtained responses verbatim. This is useful mainly for debugging
purposes.
@item -i @var{inst}
@itemx --instance=@var{inst}
Talk to @command{pies} instance @var{inst}.
+@item --no-netc
+@itemx -N
+Don't read @file{~/.netrc} file.
+
@item -u @var{url}
@itemx --url=@var{url}
Specifies the URL of the communication socket. @xref{piesctl url},
for a description of allowed URL forms.
@item -v
diff --git a/src/piesctl-cl.opt b/src/piesctl-cl.opt
index f7eaf2a..ebdfec4 100644
--- a/src/piesctl-cl.opt
+++ b/src/piesctl-cl.opt
@@ -66,12 +66,18 @@ BEGIN
grecs_error (NULL, 0, _("%s: cannot create URL: %s"),
optarg, strerror (errno));
exit (EX_USAGE);
}
END
+OPTION(no-netrc,N,,
+ [<don't read ~/.netrc file>])
+BEGIN
+ no_netrc_option = 1;
+END
+
GROUP(Preprocessor)
OPTION(include-directory,I,DIR,
[<add include directory>])
BEGIN
grecs_preproc_add_include_dir (optarg);
diff --git a/src/piesctl.c b/src/piesctl.c
index 0cd2736..4c777d7 100644
--- a/src/piesctl.c
+++ b/src/piesctl.c
@@ -46,12 +46,13 @@ struct client_conn
struct grecs_sockaddr *source_addr;
} client;
char const *instance = "pies";
char *config_file;
char default_config_file[] = SYSCONFDIR "/piesctl.conf";
int preprocess_only;
+int no_netrc_option;
int verbose;
int dump;
struct grecs_sockaddr_hints hints = { .flags = GRECS_AH_PASSIVE };
#define EX_OK 0
@@ -540,13 +541,14 @@ shttp_connect (struct pies_url *url, struct grecs_sockaddr *source_addr)
conn = grecs_zalloc (sizeof (*conn));
conn->fp = fp;
if (pies_url_copy (&conn->url, url))
grecs_alloc_die ();
- netrc_scan (conn->url);
+ if (!no_netrc_option)
+ netrc_scan (conn->url);
return conn;
}
static void
shttp_auth_free (struct shttp_connection *conn)
diff --git a/tests/env.at b/tests/env.at
index c293c65..18b0e52 100644
--- a/tests/env.at
+++ b/tests/env.at
@@ -12,18 +12,18 @@ component envtest {
}
command "$abs_builddir/envtest -clone";
chdir $PWD;
stdout file "$PWD/log";
return-code 0 {
action disable;
- exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
+ exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
}
}
_EOT
-to 3 \
+to 5 \
envtest -exec \
$abs_top_builddir/src/pies --foreground --stderr \
--config-file control.conf --config-file envtest.conf 2>errlog
cat log
],
[0],
diff --git a/tests/respawn.at b/tests/respawn.at
index 0ba60dc..ab29f11 100644
--- a/tests/respawn.at
+++ b/tests/respawn.at
@@ -24,13 +24,13 @@ cat > pies.conf <<_EOT
component test {
mode respawn;
command "$auxdir/respawn $statefile 3";
chdir $PWD;
return-code 1 {
action disable;
- exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
+ exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
}
}
_EOT
to 5 \
pies --foreground --stderr \
diff --git a/tests/shell.at b/tests/shell.at
index e3d104b..b459d02 100644
--- a/tests/shell.at
+++ b/tests/shell.at
@@ -26,13 +26,13 @@ component test {
mode respawn;
flags shell;
command "if $auxdir/respawn $statefile 3; then echo pass; else exit 1; fi >> $outfile";
chdir $PWD;
return-code 1 {
action disable;
- exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
+ exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
}
}
_EOT
set -e
to 5 \
diff --git a/tests/shutdown.at b/tests/shutdown.at
index 1c2a4ef..24a4504 100644
--- a/tests/shutdown.at
+++ b/tests/shutdown.at
@@ -26,26 +26,26 @@ cat > pies.conf <<_EOT
component test {
mode respawn;
command "$auxdir/respawn $statefile 3";
chdir $PWD;
return-code 1 {
action disable;
- exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
+ exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
}
}
component s {
mode shutdown;
command "$auxdir/touchfile shutdown";
}
_EOT
set -e
to 5 \
pies --foreground --stderr \
- --config-file control.conf --config-file pies.conf 2>errlog
+ --config-file control.conf --config-file pies.conf --debug 1 2>errlog
cat shutdown
],
[0],
[shutdown
])
diff --git a/tests/startup.at b/tests/startup.at
index 22ad25b..b65f9f6 100644
--- a/tests/startup.at
+++ b/tests/startup.at
@@ -36,21 +36,21 @@ component test {
command "$auxdir/startcheck b1 b2";
chdir $PWD;
stdout file "log.out";
stderr file "log.err";
return-code * {
action disable;
- exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
+ exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown";
}
}
_EOT
set -e
to 5 \
pies --foreground --stderr \
- --config-file control.conf --config-file pies.conf 2>errlog
+ --config-file control.conf --config-file pies.conf --debug 1 2>errlog
cat log.out
cat log.err >&2
],
[0],
[# b1

Return to:

Send suggestions and report system problems to the System administrator.