Skip to content

Commit

Permalink
doveadm: Getting user from USER environment wasn't done in the right …
Browse files Browse the repository at this point in the history
…place.

doveadm_mail_cmdline_init() is also called when parsing commands from
doveadm-server. The USER environment is supposed to be read only from
doveadm command line.
  • Loading branch information
sirainen committed Mar 23, 2016
1 parent 4a76960 commit 7b98fc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/doveadm/doveadm-mail.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ doveadm_mail_cmdline_init(const struct doveadm_mail_cmd *cmd)
ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT;
if (doveadm_debug)
ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_DEBUG;
ctx->cur_username = getenv("USER");
return ctx;
}

Expand Down Expand Up @@ -933,7 +932,7 @@ doveadm_cmd_ver2_to_mail_cmd_wrapper(struct doveadm_cmd_context *cctx)
};

mctx = doveadm_mail_cmdline_init(&mail_cmd);

mctx->cur_username = cctx->username;
mctx->iterate_all_users = FALSE;
wildcard_user = NULL;
p_array_init(&pargv, mctx->pool, 8);
Expand Down
1 change: 1 addition & 0 deletions src/doveadm/doveadm.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ int main(int argc, char *argv[])

memset(&cctx,0,sizeof(cctx));
cctx.cli = TRUE;
cctx.username = getenv("USER");

i_set_failure_exit_callback(failure_exit_callback);
doveadm_dsync_main(&argc, &argv);
Expand Down

0 comments on commit 7b98fc3

Please sign in to comment.