aboutsummaryrefslogtreecommitdiffstats
path: root/libsbusd.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-11-07 23:27:29 +0100
committerMattias Andrée <maandree@kth.se>2017-11-07 23:27:29 +0100
commitf11353f412409fe1f78c71fca0bf7fc31fefdec6 (patch)
tree9e9b88c36f9d286b769168196b5c6ca4df13d313 /libsbusd.h
parentFix two errors and move reuseable code from sbusd to libsbusd (diff)
downloadsbus-f11353f412409fe1f78c71fca0bf7fc31fefdec6.tar.gz
sbus-f11353f412409fe1f78c71fca0bf7fc31fefdec6.tar.bz2
sbus-f11353f412409fe1f78c71fca0bf7fc31fefdec6.tar.xz
Move reuseable code from sbusd to libsbusd
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libsbusd.h')
-rw-r--r--libsbusd.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/libsbusd.h b/libsbusd.h
index 535c1d3..6c0d45c 100644
--- a/libsbusd.h
+++ b/libsbusd.h
@@ -12,6 +12,22 @@ enum {
LIBSBUS_AFUNIX_CONCRETE
};
+#define DLLIST_ADD_BEFORE(NEW, OLD)\
+ ((NEW)->next = (OLD),\
+ (NEW)->prev = (OLD)->prev,\
+ (OLD)->prev->next = (NEW),\
+ (OLD)->prev = (NEW))
+
+#define DLLIST_ADD_AFTER(NEW, OLD)\
+ ((NEW)->next = (OLD)->next,\
+ (NEW)->prev = (OLD),\
+ (OLD)->next->prev = (NEW),\
+ (OLD)->next = (NEW))
+
+#define DLLIST_REMOVE(NODE)\
+ ((NODE)->prev->next = (NODE)->next,\
+ (NODE)->next->prev = (NODE)->prev)
+
#ifndef eprintf
# define eprintf(...) (libsbusd_weprintf(__VA_ARGS__), exit(1))
#endif
@@ -21,6 +37,9 @@ void libsbusd_weprintf(const char *, ...);
# define weprintf libsbusd_weprintf
#endif
+int libsbusd_who(int, char *, const char *);
+int libsbusd_iscredok(int, const char *, const char *);
+int libsbusd_checkuser(int, uid_t *, size_t);
int libsbusd_doessubmatch(const char *, const char *);
int libsbusd_issubed(char *const *, size_t, const char *);
void libsbusd_adduser(uid_t *, size_t *, const char *);