[openwrt/openwrt] scripts/metadata.pm: allow group-only Require-User specs

LEDE Commits lede-commits at lists.infradead.org
Sun Feb 25 22:20:30 PST 2018


neoraider pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/884c9575e1c6ac4f53a313c99f3e65a2efa77bd1

commit 884c9575e1c6ac4f53a313c99f3e65a2efa77bd1
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Feb 26 07:10:32 2018 +0100

    scripts/metadata.pm: allow group-only Require-User specs
    
    /lib/functions.sh can deal with Require-User specifications that only
    contain a group, but no user. Adjust metadata.pm to allow such
    specifications as well.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 scripts/metadata.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index ea38735..e05e400 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -283,8 +283,10 @@ sub parse_package_metadata($) {
 
 			for my $ugspec (@ugspecs) {
 				my @ugspec = split /:/, $ugspec, 2;
-				parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0;
-				if (@ugspec > 1) {
+				if ($ugspec[0]) {
+					parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0;
+				}
+				if ($ugspec[1]) {
 					parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0;
 				}
 			}



More information about the lede-commits mailing list