Author: bdefreese Date: 2013-08-10 00:52:07 +0000 (Sat, 10 Aug 2013) New Revision: 14466
Added: packages/trunk/billard-gl/debian/patches/07_segfault_no_home.patch Modified: packages/trunk/billard-gl/debian/changelog packages/trunk/billard-gl/debian/patches/series Log: Add patch to handle no HOME environment variable. Modified: packages/trunk/billard-gl/debian/changelog =================================================================== --- packages/trunk/billard-gl/debian/changelog 2013-08-08 15:45:20 UTC (rev 14465) +++ packages/trunk/billard-gl/debian/changelog 2013-08-10 00:52:07 UTC (rev 14466) @@ -1,9 +1,13 @@ -billard-gl (1.75-14) UNRELEASED; urgency=low +billard-gl (1.75-15) unstable; urgency=low + [ Evgeni Golov ] * Correct Vcs-* URLs to point to anonscm.debian.org - -- Evgeni Golov <evg...@debian.org> Mon, 15 Jul 2013 22:21:09 +0200 + [ Barry deFreese ] + * Add patch to fix null HOME var. (Closes: #715681). + -- Barry deFreese <bdefre...@debian.org> Fri, 09 Aug 2013 11:54:47 -0400 + billard-gl (1.75-13) unstable; urgency=low * Use override_dh_fixperms-indep. Added: packages/trunk/billard-gl/debian/patches/07_segfault_no_home.patch =================================================================== --- packages/trunk/billard-gl/debian/patches/07_segfault_no_home.patch (rev 0) +++ packages/trunk/billard-gl/debian/patches/07_segfault_no_home.patch 2013-08-10 00:52:07 UTC (rev 14466) @@ -0,0 +1,48 @@ +Description: billard-gl tries to get the HOME dir but doesn't fail gracefully + if it is not set in the environment. This patch addresses that. +Author: Barry deFreese <bdefre...@debian.org> +Debian-Bug: http://bugs.debian.org/715681 +Index: billard-gl-1.75/src/KommandoZeilenParameter.cpp +=================================================================== +--- billard-gl-1.75.orig/src/KommandoZeilenParameter.cpp 2013-08-09 11:52:05.000000000 -0400 ++++ billard-gl-1.75/src/KommandoZeilenParameter.cpp 2013-08-09 20:25:45.906456954 -0400 +@@ -2,6 +2,9 @@ + #include <stdlib.h> + #include <stdio.h> + #include <string.h> ++#include <unistd.h> ++#include <sys/types.h> ++#include <pwd.h> + #include "Namen.h" + #include "KommandoZeilenParameter.h" + +@@ -9,7 +12,13 @@ + FILE *f; + #ifndef _WIN32 + char dateiname[512]; +- snprintf(dateiname,sizeof(dateiname),"%s/.BillardGL.conf.v7",getenv("HOME")); ++ const char *homedir = getenv("HOME"); ++ if (!homedir) { ++ struct passwd *pw; ++ pw = getpwuid(getuid()); ++ homedir = pw->pw_dir; ++ } ++ snprintf(dateiname,sizeof(dateiname),"%s/.BillardGL.conf.v7",homedir); + f=fopen(dateiname,"w+"); + #endif + #ifdef _WIN32 +@@ -66,7 +75,13 @@ + FILE *f; + #ifndef _WIN32 + char dateiname[512]; +- snprintf(dateiname,sizeof(dateiname),"%s/.BillardGL.conf.v7",getenv("HOME")); ++ const char *homedir = getenv("HOME"); ++ if (!homedir) { ++ struct passwd *pw; ++ pw = getpwuid(getuid()); ++ homedir = pw->pw_dir; ++ } ++ snprintf(dateiname,sizeof(dateiname),"%s/.BillardGL.conf.v7",homedir); + f=fopen(dateiname,"r"); + #endif + #ifdef _WIN32 Modified: packages/trunk/billard-gl/debian/patches/series =================================================================== --- packages/trunk/billard-gl/debian/patches/series 2013-08-08 15:45:20 UTC (rev 14465) +++ packages/trunk/billard-gl/debian/patches/series 2013-08-10 00:52:07 UTC (rev 14466) @@ -5,3 +5,5 @@ 05_Makefile.patch 06_language_pack.patch 99_cosmetic_fixes.patch +07_segfault_no_home.patch +98_test.patch _______________________________________________ Pkg-games-commits mailing list Pkg-games-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits