wuyuoss / rpms / rpm

Forked from rpms/rpm 3 years ago
Clone

Blame SOURCES/0001-Use-dpbath-only-with-full-path-RhBug-1696408.patch

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