From 06d2ebd57f7cca7e9124929d94f4174f99aab45d Mon Sep 17 00:00:00 2001
From: Kevin Redon <kevredon@mail.tsaitgaist.info>
Date: Mon, 4 Nov 2013 22:43:15 +0100
Subject: [PATCH] fix database get value type

bug:
location update requests time out and get rejected because the
subscriber is not authorized
authorizing the subscriber through openBSC or sqlite3 doesn't help
the subscriber is still seen and shown as not authorized
fix:
the value is read as uint, this is the wrong type
it's a (u)longlong
note:
used libdbi 0.9.0
---
 openbsc/src/libmsc/db.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index d179c4e..a842353 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -633,14 +633,15 @@ static void db_set_from_query(struct gsm_subscriber *subscr, dbi_conn result)
 	if (string)
 		strncpy(subscr->extension, string, GSM_EXTENSION_LENGTH);
 
-	subscr->lac = dbi_result_get_uint(result, "lac");
+	subscr->lac = dbi_result_get_ulonglong(result, "lac");
 
 	if (!dbi_result_field_is_null(result, "expire_lu"))
 		subscr->expire_lu = dbi_result_get_datetime(result, "expire_lu");
 	else
 		subscr->expire_lu = GSM_SUBSCRIBER_NO_EXPIRATION;
 
-	subscr->authorized = dbi_result_get_uint(result, "authorized");
+	subscr->authorized = dbi_result_get_ulonglong(result, "authorized");
+
 }
 
 #define BASE_QUERY "SELECT * FROM Subscriber "
-- 
1.8.4.2

