summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2007-05-21 14:48:18 +0200
committerDavid Härdeman <david@hardeman.nu>2007-05-21 14:48:18 +0200
commit36d91ba2fe1ecc8120a252c12c19729519bdb078 (patch)
tree3437dfc9dd5056c84215b44d766086c9087a66fa /utils.h
parent201f1e4dfd09f41cce99182294824af0274898ae (diff)
Add caching uid/gid lookup functions
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index e3096c9..a5f8b54 100644
--- a/utils.h
+++ b/utils.h
@@ -24,6 +24,10 @@
#include <unistd.h>
/* For FILE */
#include <stdio.h>
+/* For struct passwd */
+#include <pwd.h>
+/* For struct group */
+#include <grp.h>
/* Adjusts the verbosity level for msg() */
void adjust_verbosity(int adj);
@@ -69,3 +73,15 @@ char *read_binary_string(char **from, size_t len, const char *max);
/* Reads a normal C string from a file */
char *read_string(char **from, const char *max);
+/* Caching version of getgrnam */
+struct group *xgetgrnam(const char *name);
+
+/* Caching version of getgrgid */
+struct group *xgetgrgid(gid_t gid);
+
+/* Caching version of getpwnam */
+struct passwd *xgetpwnam(const char *name);
+
+/* Caching version of getpwuid */
+struct passwd *xgetpwuid(uid_t uid);
+