commit | 3d8fb24cc2e2ad9f13cf3a5f24c959f92b36a87a | [log] [tgz] |
---|---|---|
author | Yabin Cui <yabinc@google.com> | Thu Jan 10 21:12:25 2019 -0800 |
committer | android-build-merger <android-build-merger@google.com> | Thu Jan 10 21:12:25 2019 -0800 |
tree | e0d8a2a952753138fe3dd4ccf2ca986af5be74fe | |
parent | 3cd91d9cb776633849363dc1dbece95588976976 [diff] | |
parent | d220cdc71ff1bb3ec433f1051f1612348510f8ad [diff] |
Merge "libpackagelistparser: export profileable_from_shell flag." am: d220cdc71f Change-Id: I6da5bafd26bacd69b3253aa1bd32fc0cf4587481
diff --git a/libpackagelistparser/include/packagelistparser/packagelistparser.h b/libpackagelistparser/include/packagelistparser/packagelistparser.h index d602c26..8bcc1e2 100644 --- a/libpackagelistparser/include/packagelistparser/packagelistparser.h +++ b/libpackagelistparser/include/packagelistparser/packagelistparser.h
@@ -53,6 +53,7 @@ char *seinfo; gid_list gids; void *private_data; + bool profileable_from_shell; }; /**
diff --git a/libpackagelistparser/packagelistparser.c b/libpackagelistparser/packagelistparser.c index 3e1a3d1..4ce2363 100644 --- a/libpackagelistparser/packagelistparser.c +++ b/libpackagelistparser/packagelistparser.c
@@ -223,6 +223,23 @@ } } + cur = strsep(&next, " \t\r\n"); + if (cur) { + tmp = strtoul(cur, &endptr, 10); + if (*endptr != '\0') { + errmsg = "Could not convert field \"profileable_from_shell\" to integer value"; + goto err; + } + + /* should be a valid boolean of 1 or 0 */ + if (!(tmp == 0 || tmp == 1)) { + errmsg = "Field \"profileable_from_shell\" is not 0 or 1 boolean value"; + goto err; + } + + pkg_info->profileable_from_shell = (bool)tmp; + } + rc = callback(pkg_info, userdata); if (rc == false) { /*