| 1 | Fromscip-debian debian qutemol 0.4.1~cvs20081111-15 qutemol/patches/`35_gifsave_honor_umask.patch`#From.: Michael Banck <[email protected]scip-debian . . . identity/`[email protected]`.> |
| 2 | Subjectscip-debian debian qutemol 0.4.1~cvs20081111-15 qutemol/patches/`35_gifsave_honor_umask.patch`#Subject.: Honor umask when saving a gif animation by changing the permissions accordingly afterwards. |
| 3 | |
| 4 | --- a/src/gifSave.cppscip-debian debian qutemol 0.4.1~cvs20081111-15 qutemol/upstream/`src/gifSave.cpp`: |
| 5 | +++ b/src/gifSave.cppscip-debian debian qutemol 0.4.1~cvs20081111-15 qutemol/upstream/`src/gifSave.cpp`: |
| 6 | @@ -9,6 +9,8 @@ |
| 7 | |
| 8 | #include <gif_lib.h> |
| 9 | #include <stdio.h> |
| 10 | +#include <sys/types.h> |
| 11 | +#include <sys/stat.h> |
| 12 | |
| 13 | #include <vector> |
| 14 | |
| 15 | @@ -181,6 +183,10 @@ |
| 16 | |
| 17 | if (EGifCloseFile(GifFile) == GIF_ERROR) return false; |
| 18 | |
| 19 | + mode_t mask = umask(0); |
| 20 | + umask(mask); |
| 21 | + chmod(filename, mask ^ 0666); |
| 22 | + |
| 23 | return true; |
| 24 | } |
| 25 |