chiark / gitweb /
disorder setup-guest + docs + tests
[disorder] / clients / authorize.c
index bb6d3665ec935a07626ec5767e82da18732048aa..c442d23730b55f4b3b28a4bc103fce00e2aff982 100644 (file)
 /** @brief Create a DisOrder login for the calling user, called @p user
  * @param client DisOrder client
  * @param user Username to create (UTF-8)
+ * @param rights Initial rights or NULL for default
  * @return 0 on success, non-0 on error
  */
-int authorize(disorder_client *client, const char *user) {
+int authorize(disorder_client *client, const char *user, const char *rights) {
   uint8_t pwbin[10];
   const struct passwd *pw, *jbpw;
   gid_t jbgid;
@@ -82,7 +83,7 @@ int authorize(disorder_client *client, const char *user) {
     fatal(errno, "error renaming %s to %s", t, c);
 
   /* create the user on the server */
-  if(disorder_adduser(client, user, pwhex))
+  if(disorder_adduser(client, user, pwhex, rights))
     return -1;
 
   return 0;