X-Git-Url: http://git.ieval.ro/?p=gtk-theme-switch.git;a=blobdiff_plain;f=debian%2Fpatches%2Fexit-cleanly-when-we-have-no-homedir.patch;fp=debian%2Fpatches%2Fexit-cleanly-when-we-have-no-homedir.patch;h=0b30330e2298e561141957fe810f64dd8c8fa101;hp=0000000000000000000000000000000000000000;hb=e34c1b5b2f32e8015072caad0169799462744655;hpb=d7be8ae9c1d250e7f2fcd1c27cda7ec4f8466ad6 diff --git a/debian/patches/exit-cleanly-when-we-have-no-homedir.patch b/debian/patches/exit-cleanly-when-we-have-no-homedir.patch new file mode 100644 index 0000000..0b30330 --- /dev/null +++ b/debian/patches/exit-cleanly-when-we-have-no-homedir.patch @@ -0,0 +1,26 @@ +Description: Exit when there is no HOME environment variable + The home directory is used in multiple places without checking + whether it is non-NULL. I think that it is very unlikely for + someone to want to use this program without that variable in + the environment, so we just bail out if it is missing. + . + If anyone wants gtk-theme-switch2 to work without a HOME + environment variable, they will surely file a bug about this. +Author: Marius Gavrilescu +Forwarded: no +Last-Update: 2013-07-13 + +--- a/main.c ++++ b/main.c +@@ -951,6 +951,11 @@ + newfont = 0; + execname = argv[0]; + homedir = getenv("HOME"); ++ if(homedir == NULL) ++ { ++ fprintf(stderr, "No HOME variable in environment, bailing out\n"); ++ return 0; ++ } + hash = g_hash_table_new (g_str_hash, g_str_equal); + + if (argc == 1) /* start in dock mode auto if no args */