Hello community,

here is the log from the commit of package file for openSUSE:Factory checked in 
at 2014-05-22 20:37:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/file (Old)
 and      /work/SRC/openSUSE:Factory/.file.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "file"

Changes:
--------
--- /work/SRC/openSUSE:Factory/file/file.changes        2014-04-06 
09:56:12.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.file.new/file.changes   2014-05-22 
20:38:04.000000000 +0200
@@ -1,0 +2,6 @@
+Thu May  8 19:56:07 UTC 2014 - [email protected]
+
+- file-secure_getenv.patch use secure_getenv only as we 
+  can't know in which context the shared library is used.
+
+-------------------------------------------------------------------

New:
----
  file-secure_getenv.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ file.spec ++++++
--- /var/tmp/diff_new_pack.NZbOGQ/_old  2014-05-22 20:38:06.000000000 +0200
+++ /var/tmp/diff_new_pack.NZbOGQ/_new  2014-05-22 20:38:06.000000000 +0200
@@ -61,6 +61,7 @@
 Patch34:        file-5.18-endian.patch
 Patch35:        file-5.12-nitpick.dif
 Patch36:        file-5.15-clear-invalid.patch
+Patch37:        file-secure_getenv.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %global         _sysconfdir /etc
 %global         _miscdir    %{_datadir}/misc
@@ -126,6 +127,7 @@
 %patch34 -p0 -b .endian
 %patch35 -p0 -b .nitpick
 %patch36 -p1 -b .clear
+%patch37 -p1 -b .getenv
 %patch -b .0
 test -s src/magic.h.in || cp -p src/magic.h src/magic.h.in
 

++++++ file-secure_getenv.patch ++++++
--- file-5.18.orig/configure.ac
+++ file-5.18/configure.ac
@@ -86,6 +86,8 @@ AC_CHECK_HEADERS(getopt.h err.h)
 AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
 AC_CHECK_HEADERS(zlib.h)
 
+AC_CHECK_FUNCS([__secure_getenv secure_getenv])
+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_OFF_T
--- file-5.18.orig/src/file.h
+++ file-5.18/src/file.h
@@ -541,4 +541,12 @@ static const char *rcsid(const char *p)
 #define FILE_RCSID(id)
 #endif
 
+#ifndef HAVE_SECURE_GETENV
+#  ifdef HAVE___SECURE_GETENV
+#    define secure_getenv __secure_getenv
+#  else
+#    error neither secure_getenv nor __secure_getenv is available
+#  endif
+#endif
+
 #endif /* __file_h__ */
--- file-5.18.orig/src/magic.c
+++ file-5.18/src/magic.c
@@ -97,7 +97,7 @@ get_default_magic(void)
                free(default_magic);
                default_magic = NULL;
        }
-       if ((home = getenv("HOME")) == NULL)
+       if ((home = secure_getenv("HOME")) == NULL)
                return MAGIC;
 
        if (asprintf(&hmagicpath, "%s/.magic.mgc", home) < 0)
@@ -152,8 +152,8 @@ out:
        }
 
        /* First, try to get user-specific magic file */
-       if ((home = getenv("LOCALAPPDATA")) == NULL) {
-               if ((home = getenv("USERPROFILE")) != NULL)
+       if ((home = secure_getenv("LOCALAPPDATA")) == NULL) {
+               if ((home = secure_getenv("USERPROFILE")) != NULL)
                        if (asprintf(&tmppath,
                            "%s/Local Settings/Application Data%s", home,
                            hmagic) < 0)
@@ -166,7 +166,7 @@ out:
        APPENDPATH();
 
        /* Second, try to get a magic file from Common Files */
-       if ((home = getenv("COMMONPROGRAMFILES")) != NULL) {
+       if ((home = secure_getenv("COMMONPROGRAMFILES")) != NULL) {
                if (asprintf(&tmppath, "%s%s", home, hmagic) >= 0)
                        APPENDPATH();
        }
@@ -204,7 +204,7 @@ magic_getpath(const char *magicfile, int
        if (magicfile != NULL)
                return magicfile;
 
-       magicfile = getenv("MAGIC");
+       magicfile = secure_getenv("MAGIC");
        if (magicfile != NULL)
                return magicfile;
 
--- file-5.18.orig/src/file.c
+++ file-5.18/src/file.c
@@ -530,7 +530,7 @@ docprint(const char *opts)
 private void
 help(void)
 {
-       const unsigned long posix = (unsigned long)getenv("POSIXLY_CORRECT");
+       const unsigned long posix = (unsigned 
long)secure_getenv("POSIXLY_CORRECT");
        (void)fputs(
 "Usage: file [OPTION...] [FILE...]\n"
 "Determine type of FILEs.\n"
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to