rpm-ostree/src/rpmostree-json-parsing.h
Colin Walters f9e9c06648 compose: Support "preserve-passwd" option (enabled by default)
The checking code from #56 landed, and started triggering for me on
the `dockerroot` user. It's nice to know it works. Then the issue
is... "what now"?

It turns out in the case of `dockerroot` it's actually unused, so we
could fix this by deleting it. But in general we need to support
dynamic uids/gids/. And we can't yet take a hard dep on #49.

So this patch changes things so we take a copy of the passwd/group
data from the previous commit.  Any users subsequently added in the
*new* commit will be additive.

Closes: https://github.com/projectatomic/rpm-ostree/issues/78
2014-12-23 16:28:53 -05:00

77 lines
3.3 KiB
C

/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2014 Colin Walters <walters@verbum.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2 of the licence or (at
* your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#pragma once
#include <gio/gio.h>
#include <json-glib/json-glib.h>
gboolean
_rpmostree_jsonutil_object_get_optional_string_member (JsonObject *object,
const char *member_name,
const char **out_value,
GError **error);
const char *
_rpmostree_jsonutil_object_require_string_member (JsonObject *object,
const char *member_name,
GError **error);
gboolean
_rpmostree_jsonutil_object_get_optional_int_member (JsonObject *object,
const char *member_name,
gint64 *out_value,
gboolean *found,
GError **error);
gboolean
_rpmostree_jsonutil_object_require_int_member (JsonObject *object,
const char *member_name,
gint64 *out_val,
GError **error);
gboolean
_rpmostree_jsonutil_object_get_optional_boolean_member (JsonObject *object,
const char *member_name,
gboolean *out_value,
GError **error);
const char *
_rpmostree_jsonutil_array_require_string_element (JsonArray *array,
guint i,
GError **error);
gboolean
_rpmostree_jsonutil_array_require_int_element (JsonArray *array,
guint i,
gint64 *out_val,
GError **error);
gboolean
_rpmostree_jsonutil_append_string_array_to (JsonObject *object,
const char *member_name,
GPtrArray *array,
GError **error);
GHashTable *
_rpmostree_jsonutil_jsarray_strings_to_set (JsonArray *array);