s3-auth: add "system" bool flag to auth_serversupplied_info.
authorGünther Deschner <gd@samba.org>
Fri, 28 May 2010 12:19:28 +0000 (14:19 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 31 May 2010 13:30:59 +0000 (15:30 +0200)
Guenther

source3/auth/auth_util.c
source3/include/auth.h

index 1f9bc7b6d7354da307ff357c546a68bfca7adcfb..74d8873f5c7b060b1cb91789c087e85227f3f327 100644 (file)
@@ -765,16 +765,24 @@ static NTSTATUS make_new_server_info_system(TALLOC_CTX *mem_ctx,
                                            struct auth_serversupplied_info **server_info)
 {
        struct passwd *pwd;
+       NTSTATUS status;
 
        pwd = getpwuid_alloc(mem_ctx, sec_initial_uid());
        if (pwd == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
 
-       return make_serverinfo_from_username(mem_ctx,
+       status = make_serverinfo_from_username(mem_ctx,
                                             pwd->pw_name,
                                             false,
                                             server_info);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       (*server_info)->system = true;
+
+       return NT_STATUS_OK;
 }
 
 /****************************************************************************
@@ -829,6 +837,7 @@ struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
        }
 
        dst->guest = src->guest;
+       dst->system = src->system;
        dst->utok.uid = src->utok.uid;
        dst->utok.gid = src->utok.gid;
        dst->utok.ngroups = src->utok.ngroups;
index ed422c24a0ab8d8c32e820190a514a46727ec27d..69a91d29aa3de2a0c901460efffefa801350019e 100644 (file)
@@ -42,6 +42,7 @@ struct auth_usersupplied_info {
 
 struct auth_serversupplied_info {
        bool guest;
+       bool system;
 
        struct dom_sid *sids;   /* These SIDs are preliminary between
                           check_ntlm_password and the token creation. */