aboutsummaryrefslogtreecommitdiff
path: root/contrib/basebackup_to_shell/basebackup_to_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/basebackup_to_shell/basebackup_to_shell.c')
-rw-r--r--contrib/basebackup_to_shell/basebackup_to_shell.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/contrib/basebackup_to_shell/basebackup_to_shell.c b/contrib/basebackup_to_shell/basebackup_to_shell.c
index a279219966d..bc754b177af 100644
--- a/contrib/basebackup_to_shell/basebackup_to_shell.c
+++ b/contrib/basebackup_to_shell/basebackup_to_shell.c
@@ -37,13 +37,13 @@ typedef struct bbsink_shell
FILE *pipe;
} bbsink_shell;
-void _PG_init(void);
+void _PG_init(void);
static void *shell_check_detail(char *target, char *target_detail);
static bbsink *shell_get_sink(bbsink *next_sink, void *detail_arg);
static void bbsink_shell_begin_archive(bbsink *sink,
- const char *archive_name);
+ const char *archive_name);
static void bbsink_shell_archive_contents(bbsink *sink, size_t len);
static void bbsink_shell_end_archive(bbsink *sink);
static void bbsink_shell_begin_manifest(bbsink *sink);
@@ -101,7 +101,7 @@ shell_check_detail(char *target, char *target_detail)
{
if (shell_required_role[0] != '\0')
{
- Oid roleid;
+ Oid roleid;
StartTransactionCommand();
roleid = get_role_oid(shell_required_role, true);
@@ -125,8 +125,8 @@ static bbsink *
shell_get_sink(bbsink *next_sink, void *detail_arg)
{
bbsink_shell *sink;
- bool has_detail_escape = false;
- char *c;
+ bool has_detail_escape = false;
+ char *c;
/*
* Set up the bbsink.
@@ -171,15 +171,15 @@ shell_get_sink(bbsink *next_sink, void *detail_arg)
/*
* Since we're passing the string provided by the user to popen(), it will
* be interpreted by the shell, which is a potential security
- * vulnerability, since the user invoking this module is not necessarily
- * a superuser. To stay out of trouble, we must disallow any shell
+ * vulnerability, since the user invoking this module is not necessarily a
+ * superuser. To stay out of trouble, we must disallow any shell
* metacharacters here; to be conservative and keep things simple, we
* allow only alphanumerics.
*/
if (sink->target_detail != NULL)
{
- char *d;
- bool scary = false;
+ char *d;
+ bool scary = false;
for (d = sink->target_detail; *d != '\0'; ++d)
{
@@ -210,7 +210,7 @@ static char *
shell_construct_command(char *base_command, const char *filename,
char *target_detail)
{
- StringInfoData buf;
+ StringInfoData buf;
char *c;
initStringInfo(&buf);
@@ -271,7 +271,7 @@ shell_construct_command(char *base_command, const char *filename,
static void
shell_finish_command(bbsink_shell *sink)
{
- int pclose_rc;
+ int pclose_rc;
/* There should be a command running. */
Assert(sink->current_command != NULL);
@@ -335,9 +335,8 @@ shell_send_data(bbsink_shell *sink, size_t len)
{
/*
* The error we're about to throw would shut down the command
- * anyway, but we may get a more meaningful error message by
- * doing this. If not, we'll fall through to the generic error
- * below.
+ * anyway, but we may get a more meaningful error message by doing
+ * this. If not, we'll fall through to the generic error below.
*/
shell_finish_command(sink);
errno = EPIPE;