From 1a5d2d5a6fd32000715971c6935fc1559d900dc1 Mon Sep 17 00:00:00 2001 From: Pavlina Moravcova Varekova Date: Wed, 24 Apr 2019 10:29:14 +0200 Subject: Use --dpbath only with full path (RhBug:1696408) Before the patch rpm treats the relative path as a full path. The new behavior is similar to the "--root" option. (cherry picked from commit d313baf1d3a4756447e398ee55f8c6760f942d50) --- lib/poptALL.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/poptALL.c b/lib/poptALL.c index f8fe23068..c48067a0b 100644 --- a/lib/poptALL.c +++ b/lib/poptALL.c @@ -137,6 +137,10 @@ static void rpmcliAllArgCallback( poptContext con, break; case POPT_DBPATH: rpmcliConfigured(); + if (arg && arg[0] != '/') { + fprintf(stderr, _("arguments to --dbpath must begin with '/'\n")); + exit(EXIT_FAILURE); + } rpmPushMacro(NULL, "_dbpath", NULL, arg, RMIL_CMDLINE); break; case POPT_SHOWVERSION: -- cgit v1.2.1