util: Add a wrapper around getuid()
So we can use it from JS in an upcoming commit. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/465
This commit is contained in:
parent
83862d04a0
commit
b82039e324
@ -638,6 +638,20 @@ shell_util_check_cloexec_fds (void)
|
|||||||
g_info ("Open fd CLOEXEC check complete");
|
g_info ("Open fd CLOEXEC check complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* shell_util_get_uid:
|
||||||
|
*
|
||||||
|
* A wrapper around getuid() so that it can be used from JavaScript. This
|
||||||
|
* function will always succeed.
|
||||||
|
*
|
||||||
|
* Returns: the real user ID of the calling process
|
||||||
|
*/
|
||||||
|
gint
|
||||||
|
shell_util_get_uid (void)
|
||||||
|
{
|
||||||
|
return getuid ();
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_systemd_call_cb (GObject *source,
|
on_systemd_call_cb (GObject *source,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
|
@ -78,6 +78,8 @@ gboolean shell_util_has_x11_display_extension (MetaDisplay *display,
|
|||||||
|
|
||||||
char *shell_util_get_translated_folder_name (const char *name);
|
char *shell_util_get_translated_folder_name (const char *name);
|
||||||
|
|
||||||
|
gint shell_util_get_uid (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __SHELL_UTIL_H__ */
|
#endif /* __SHELL_UTIL_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user