Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix loading of manifest with permission set in attributes for files
Baptiste Daroussin committed 12 years ago
commit d13a3b7e3ce30121a5c30bba99a8bca22045459b
parent 8cfbfb0
1 file changed +6 -4
modified libpkg/pkg_manifest.c
@@ -510,8 +510,9 @@ pkg_set_files_from_object(struct pkg *pkg, ucl_object_t *obj)
		else if (!strcasecmp(key, "sum") && cur->type == UCL_STRING &&
		    strlen(ucl_object_tostring(cur)) == 64)
			sum = ucl_object_tostring(cur);
-
		else if (!strcasecmp(key, "perm") && cur->type == UCL_STRING) {
-
			if ((set = setmode(ucl_object_tostring(cur))) == NULL)
+
		else if (!strcasecmp(key, "perm") &&
+
		    (cur->type == UCL_STRING || cur->type == UCL_INT)) {
+
			if ((set = setmode(ucl_object_tostring_forced(cur))) == NULL)
				pkg_emit_error("Not a valid mode: %s",
				    ucl_object_tostring(cur));
			else
@@ -548,8 +549,9 @@ pkg_set_dirs_from_object(struct pkg *pkg, ucl_object_t *obj)
			uname = ucl_object_tostring(cur);
		else if (!strcasecmp(key, "gname") && cur->type == UCL_STRING)
			gname = ucl_object_tostring(cur);
-
		else if (!strcasecmp(key, "perm") && cur->type == UCL_STRING) {
-
			if ((set = setmode(ucl_object_tostring(cur))) == NULL)
+
		else if (!strcasecmp(key, "perm") &&
+
		    (cur->type == UCL_STRING || cur->type == UCL_INT)) {
+
			if ((set = setmode(ucl_object_tostring_forced(cur))) == NULL)
				pkg_emit_error("Not a valid mode: %s",
				    ucl_object_tostring(cur));
			else