Initialise the uid and gid values to a safe default in make_server_info()
authorTim Potter <tpot@samba.org>
Tue, 8 Jul 2003 05:37:13 +0000 (05:37 +0000)
committerTim Potter <tpot@samba.org>
Tue, 8 Jul 2003 05:37:13 +0000 (05:37 +0000)
(This used to be commit 3a1f4f5ea5379b0deb6dc6b8ed81dedc3a08f70e)

source3/auth/auth_util.c

index 408b26f5142fe984cb5ea4153db1cbeed889452d..7d6a5ff8c9ee91c27e625d9808dbbb0420771d19 100644 (file)
@@ -703,6 +703,14 @@ static NTSTATUS make_server_info(auth_serversupplied_info **server_info)
                return NT_STATUS_NO_MEMORY;
        }
        ZERO_STRUCTP(*server_info);
+
+       /* Initialise the uid and gid values to something non-zero
+          which may save us from giving away root access if there
+          is a bug in allocating these fields. */
+
+       (*server_info)->uid = -1;
+       (*server_info)->gid = -1;
+
        return NT_STATUS_OK;
 }