]> iEval git - gtk-theme-switch.git/commitdiff
Exit cleanly if there is no HOME environment variable
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 13 Jul 2013 14:57:29 +0000 (17:57 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 13 Jul 2013 14:57:29 +0000 (17:57 +0300)
debian/changelog
debian/patches/exit-cleanly-when-we-have-no-homedir.patch [new file with mode: 0644]
debian/patches/series

index 1411747b3a0cfdb08513d683a023bf7bb1796420..613ede8ab54d864f1ee3c8eeaca568c7f64b4ba8 100644 (file)
@@ -6,6 +6,7 @@ gtk-theme-switch (2.1.0-3) UNRELEASED; urgency=low
   * Fix spelling error in help
   * Use dh-style debian/rules
   * Add hardening
+  * Exit cleanly if there is no HOME environment variable (Closes: #716007)
 
  -- Marius Gavrilescu <marius@ieval.ro>  Sat, 13 Jul 2013 16:31:46 +0300
 
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 (file)
index 0000000..0b30330
--- /dev/null
@@ -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 <marius@ieval.ro>
+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 */
index 213d22d7b53ba640b8508150f6b03be37bc49fad..7039fe6c4980a5f54289095d99833dbcff536e44 100644 (file)
@@ -1 +1,2 @@
 fix-spelling.patch
+exit-cleanly-when-we-have-no-homedir.patch
This page took 0.02313 seconds and 4 git commands to generate.