xref: /openbsd/usr.bin/ssh/sftp-usergroup.h (revision 38e6e118)
1*38e6e118Sdjm /*
2*38e6e118Sdjm  * Copyright (c) 2022 Damien Miller <djm@mindrot.org>
3*38e6e118Sdjm  *
4*38e6e118Sdjm  * Permission to use, copy, modify, and distribute this software for any
5*38e6e118Sdjm  * purpose with or without fee is hereby granted, provided that the above
6*38e6e118Sdjm  * copyright notice and this permission notice appear in all copies.
7*38e6e118Sdjm  *
8*38e6e118Sdjm  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*38e6e118Sdjm  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*38e6e118Sdjm  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*38e6e118Sdjm  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*38e6e118Sdjm  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*38e6e118Sdjm  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*38e6e118Sdjm  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*38e6e118Sdjm  */
16*38e6e118Sdjm 
17*38e6e118Sdjm /* sftp client user/group lookup and caching */
18*38e6e118Sdjm 
19*38e6e118Sdjm /* Lookup uids/gids and populate cache */
20*38e6e118Sdjm void get_remote_user_groups_from_glob(struct sftp_conn *conn, glob_t *g);
21*38e6e118Sdjm void get_remote_user_groups_from_dirents(struct sftp_conn *conn, SFTP_DIRENT **d);
22*38e6e118Sdjm 
23*38e6e118Sdjm /* Return user/group name from cache or NULL if not found */
24*38e6e118Sdjm const char *ruser_name(uid_t uid);
25*38e6e118Sdjm const char *rgroup_name(uid_t gid);
26