glib-unix: Add g_unix_get_passwd_entry() function

This is a convenience wrapper around getpwnam_r() which handles all the
memory allocation faff.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1687
This commit is contained in:
Philip Withnall
2019-06-11 13:52:48 +01:00
parent ae49ff0903
commit 94a800fb9d
4 changed files with 165 additions and 0 deletions

View File

@ -114,6 +114,10 @@ guint g_unix_fd_add (gint fd,
GUnixFDSourceFunc function,
gpointer user_data);
GLIB_AVAILABLE_IN_2_64
struct passwd *g_unix_get_passwd_entry (const gchar *user_name,
GError **error);
G_END_DECLS
#endif /* __G_UNIX_H__ */