+/*
+ * Must set all three of these at once.
+ * Legal combinations are unset by name by uid
+ */
+static struct passwd *user_pwd; /* NULL non-NULL NULL */
+static uid_t user_uid = (uid_t)-1; /* -1 -1 >=0 */
+static gid_t user_gid = (gid_t)-1; /* -1 -1 >=0 */
+
+/*
+ * Prepare to change user ID. user_id can be one of 3 forms:
+ * - a username, in which case user ID will be changed to its uid,
+ * with primary and supplementary groups set up too;
+ * - a numeric uid, in which case only the uid will be set;
+ * - a pair of numeric uid:gid.
+ */
+bool os_set_runas(const char *user_id)