diff options
author | Michal Čihař <nijel@debian.org> | 2015-08-26 15:40:59 +0200 |
---|---|---|
committer | Michal Čihař <nijel@debian.org> | 2015-08-26 15:40:59 +0200 |
commit | 3a1d9ea026f7f0ce5c5fedd8058892d5e1d3d271 (patch) | |
tree | df28b5ce314804f67ed244c804f4d533b85daafb /smsd | |
parent | 7bc932d13fe000a6b895efcbf54105970e1773d0 (diff) |
Imported Upstream version 1.36.5
Diffstat (limited to 'smsd')
-rw-r--r-- | smsd/CMakeTests.txt | 2 | ||||
-rw-r--r-- | smsd/core.c | 2 | ||||
-rw-r--r-- | smsd/core.h | 2 | ||||
-rw-r--r-- | smsd/inject.c | 2 | ||||
-rw-r--r-- | smsd/main.c | 4 | ||||
-rw-r--r-- | smsd/monitor.c | 4 | ||||
-rw-r--r-- | smsd/services/dbi.c | 2 | ||||
-rw-r--r-- | smsd/services/files.c | 4 | ||||
-rw-r--r-- | smsd/services/mysql.c | 2 | ||||
-rw-r--r-- | smsd/services/null.c | 2 | ||||
-rw-r--r-- | smsd/services/null.h | 2 | ||||
-rw-r--r-- | smsd/services/odbc.c | 2 | ||||
-rw-r--r-- | smsd/services/pgsql.c | 2 | ||||
-rw-r--r-- | smsd/services/sql.c | 8 |
14 files changed, 22 insertions, 18 deletions
diff --git a/smsd/CMakeTests.txt b/smsd/CMakeTests.txt index 59e11ec..ccaac8f 100644 --- a/smsd/CMakeTests.txt +++ b/smsd/CMakeTests.txt @@ -1,5 +1,5 @@ # cmake <http://www.cmake.org> test file for SMSD -# Copyright (c) 2007 - 2010 Michal Cihar +# Copyright (c) 2007 - 2015 Michal Cihar # vim: expandtab sw=4 ts=4 sts=4 ft=cmake: if (WITH_BACKUP) diff --git a/smsd/core.c b/smsd/core.c index 6895503..cf3bc65 100644 --- a/smsd/core.c +++ b/smsd/core.c @@ -1,5 +1,5 @@ /* Copyright (c) 2002-2004 by Marcin Wiacek and Joergen Thomsen */ -/* Copyright (c) 2009 - 2012 Michal Cihar <michal@cihar.com> */ +/* Copyright (c) 2009 - 2015 Michal Cihar <michal@cihar.com> */ #include <string.h> #include <signal.h> diff --git a/smsd/core.h b/smsd/core.h index 0ce499c..488dc80 100644 --- a/smsd/core.h +++ b/smsd/core.h @@ -1,5 +1,5 @@ /* (c) 2002-2004 by Marcin Wiacek and Joergen Thomsen */ -/* Copyright (c) 2009 - 2011 Michal Cihar <michal@cihar.com> */ +/* Copyright (c) 2009 - 2015 Michal Cihar <michal@cihar.com> */ #ifndef __core_h_ #define __core_h_ diff --git a/smsd/inject.c b/smsd/inject.c index cf6cf65..5d99fd9 100644 --- a/smsd/inject.c +++ b/smsd/inject.c @@ -1,7 +1,7 @@ /** * SMSD message inject program */ -/* Copyright (c) 2009 - 2011 Michal Cihar <michal@cihar.com> */ +/* Copyright (c) 2009 - 2015 Michal Cihar <michal@cihar.com> */ /* Licensend under GNU GPL 2 */ #include <gammu-smsd.h> diff --git a/smsd/main.c b/smsd/main.c index 0b51435..e5fe816 100644 --- a/smsd/main.c +++ b/smsd/main.c @@ -1,7 +1,7 @@ /** * Main SMSD program */ -/* Copyright (c) 2009 - 2011 Michal Cihar <michal@cihar.com> */ +/* Copyright (c) 2009 - 2015 Michal Cihar <michal@cihar.com> */ /* Licensend under GNU GPL 2 */ #include <gammu-smsd.h> @@ -115,7 +115,7 @@ NORETURN void version(void) printf(" - %s\n", "ODBC"); #endif printf("\n"); - printf("Copyright (C) 2003 - 2011 Michal Cihar <michal@cihar.com> and other authors.\n"); + printf("Copyright (C) 2003 - 2015 Michal Cihar <michal@cihar.com> and other authors.\n"); printf("\n"); printf("License GPLv2: GNU GPL version 2 <https://spdx.org/licenses/GPL-2.0>.\n"); printf("This is free software: you are free to change and redistribute it.\n"); diff --git a/smsd/monitor.c b/smsd/monitor.c index 14ef5ea..8854a13 100644 --- a/smsd/monitor.c +++ b/smsd/monitor.c @@ -1,7 +1,7 @@ /** * SMSD message monitor program */ -/* Copyright (c) 2009 - 2011 Michal Cihar <michal@cihar.com> */ +/* Copyright (c) 2009 - 2015 Michal Cihar <michal@cihar.com> */ /* Licensend under GNU GPL 2 */ #include <gammu-smsd.h> @@ -63,7 +63,7 @@ NORETURN void version(void) printf(" - %s\n", "ODBC"); #endif printf("\n"); - printf("Copyright (C) 2003 - 2011 Michal Cihar <michal@cihar.com> and other authors.\n"); + printf("Copyright (C) 2003 - 2015 Michal Cihar <michal@cihar.com> and other authors.\n"); printf("\n"); printf("License GPLv2: GNU GPL version 2 <https://spdx.org/licenses/GPL-2.0>.\n"); printf("This is free software: you are free to change and redistribute it.\n"); diff --git a/smsd/services/dbi.c b/smsd/services/dbi.c index 5c36a79..abd88eb 100644 --- a/smsd/services/dbi.c +++ b/smsd/services/dbi.c @@ -3,7 +3,7 @@ * * Part of Gammu project * - * Copyright (c) 2009 - 2011 Michal Cihar <michal@cihar.com> + * Copyright (c) 2009 - 2015 Michal Cihar <michal@cihar.com> * * Licensed under GNU GPL version 2 or later */ diff --git a/smsd/services/files.c b/smsd/services/files.c index e3f7d5e..380f835 100644 --- a/smsd/services/files.c +++ b/smsd/services/files.c @@ -614,6 +614,10 @@ static GSM_Error SMSDFiles_AddSentSMSInfo(GSM_MultiSMSMessage * sms UNUSED, GSM_ fseek(file, 0, SEEK_END); filesize = ftell(file); + if (filesize < 0) { + fclose(file); + return ERR_CANTOPENFILE; + } fseek(file, 0, SEEK_SET); Buffer = malloc(filesize + 200); diff --git a/smsd/services/mysql.c b/smsd/services/mysql.c index 14e4f2e..99cd9d5 100644 --- a/smsd/services/mysql.c +++ b/smsd/services/mysql.c @@ -1,5 +1,5 @@ /* (c) 2004 by Marcin Wiacek */ -/* Copyright (c) 2009 - 2011 Michal Cihar <michal@cihar.com> */ +/* Copyright (c) 2009 - 2015 Michal Cihar <michal@cihar.com> */ #include <gammu.h> diff --git a/smsd/services/null.c b/smsd/services/null.c index 5e498f4..1955e88 100644 --- a/smsd/services/null.c +++ b/smsd/services/null.c @@ -3,7 +3,7 @@ * * This service does not store anything anywhere. */ -/* Copyright (c) 2010 Michal Cihar <michal@cihar.com>. */ +/* Copyright (c) 2010 - 2015 Michal Cihar <michal@cihar.com>. */ #include "../core.h" diff --git a/smsd/services/null.h b/smsd/services/null.h index 817cf77..169a43c 100644 --- a/smsd/services/null.h +++ b/smsd/services/null.h @@ -3,7 +3,7 @@ * * This service does not store anything anywhere. */ -/* Copyright (c) 2010 Michal Cihar <michal@cihar.com>. */ +/* Copyright (c) 2010 - 2015 Michal Cihar <michal@cihar.com>. */ extern GSM_SMSDService SMSDNull; diff --git a/smsd/services/odbc.c b/smsd/services/odbc.c index f3b7174..a6a79cc 100644 --- a/smsd/services/odbc.c +++ b/smsd/services/odbc.c @@ -3,7 +3,7 @@ * * Part of Gammu project * - * Copyright (C) 2011 Michal Čihař + * Copyright (C) 2011 - 2015 Michal Čihař * * Licensed under GNU GPL version 2 or later */ diff --git a/smsd/services/pgsql.c b/smsd/services/pgsql.c index 749a9dd..26f917b 100644 --- a/smsd/services/pgsql.c +++ b/smsd/services/pgsql.c @@ -1,5 +1,5 @@ /* (c) 2006 by Andrea Riciputi */ -/* Copyright (c) 2009 - 2011 Michal Cihar <michal@cihar.com> */ +/* Copyright (c) 2009 - 2015 Michal Cihar <michal@cihar.com> */ #define _XOPEN_SOURCE #define _BSD_SOURCE diff --git a/smsd/services/sql.c b/smsd/services/sql.c index a111f47..826c92f 100644 --- a/smsd/services/sql.c +++ b/smsd/services/sql.c @@ -3,7 +3,7 @@ * * Part of Gammu project * - * Copyright (C) 2009-2011 Michal Čihař + * Copyright (C) 2009 - 2015 Michal Čihař * (c) 2010 Miloslav Semler * * Licensed under GNU GPL version 2 or later @@ -46,7 +46,7 @@ const char *SMSDSQL_SQLName(GSM_SMSDConfig * Config) const char now_plus_odbc[] = "{fn CURRENT_TIMESTAMP()} + INTERVAL %d SECOND"; const char now_plus_mysql[] = "(NOW() + INTERVAL %d SECOND) + 0"; const char now_plus_pgsql[] = "now() + interval '%d seconds'"; -const char now_plus_sqlite[] = "datetime('now', '+%d seconds')"; +const char now_plus_sqlite[] = "datetime('now', '+%d seconds', 'localtime')"; const char now_plus_freetds[] = "DATEADD('second', %d, CURRENT_TIMESTAMP)"; const char now_plus_access[] = "now()+#00:00:%d#"; const char now_plus_fallback[] = "NOW() + INTERVAL %d SECOND"; @@ -149,7 +149,7 @@ static const char *SMSDSQL_LimitClause(GSM_SMSDConfig * Config, const char *coun const char now_odbc[] = "{fn CURRENT_TIMESTAMP()}"; const char now_mysql[] = "NOW()"; const char now_pgsql[] = "now()"; -const char now_sqlite[] = "datetime('now')"; +const char now_sqlite[] = "datetime('now', 'localtime')"; const char now_freetds[] = "CURRENT_TIMESTAMP"; const char now_access[] = "now()"; const char now_fallback[] = "NOW()"; @@ -157,7 +157,7 @@ const char now_fallback[] = "NOW()"; const char currtime_odbc[] = "{fn CURTIME()}"; const char currtime_mysql[] = "CURTIME()"; const char currtime_pgsql[] = "localtime"; -const char currtime_sqlite[] = "time('now')"; +const char currtime_sqlite[] = "time('now', 'localtime')"; const char currtime_freetds[] = "CURRENT_TIME"; const char currtime_fallback[] = "CURTIME()"; |