Modified smack label for resolv.conf file 37/44837/1 submit/tizen/20150728.100704
authortaesub.kim <taesub.kim@samsung.com>
Tue, 28 Jul 2015 10:02:02 +0000 (19:02 +0900)
committertaesub.kim <taesub.kim@samsung.com>
Tue, 28 Jul 2015 10:03:00 +0000 (19:03 +0900)
Change-Id: Ifd271983fdd1752bad4840f29964f5c103738aba
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
configure.ac
packaging/connman.spec
src/resolver.c

index dee2dcb..08f42dc 100644 (file)
@@ -67,6 +67,13 @@ AC_ARG_ENABLE(telephony,
 AM_CONDITIONAL(TELEPHONY, test "${enable_telephony}" != "no")
 AM_CONDITIONAL(TELEPHONY_BUILTIN, test "${enable_telephony}" = "builtin")
 
+AC_ARG_ENABLE(tizen-ext,
+       AC_HELP_STRING([--enable-tizen-ext], [enable TIZEN extensions]),
+                       [if (test "${enableval}" = "yes"); then
+                               CFLAGS="$CFLAGS -DTIZEN_EXT"
+                               LIBS="$LIBS -lsmack"
+                       fi])
+
 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
         [specify location of openconnect binary]), [path_openconnect=${withval}])
 
index 830977e..b3f58cf 100644 (file)
@@ -4,7 +4,7 @@
 %bcond_with     connman_ntp
 
 Name:           connman
-Version:        1.26
+Version:        1.26.1
 Release:        1
 License:        GPL-2.0
 Summary:        Connection Manager
@@ -19,6 +19,7 @@ BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(libiptc)
 BuildRequires:  pkgconfig(xtables)
+BuildRequires:  pkgconfig(libsmack)
 BuildRequires:  pkgconfig(gnutls)
 %if %{with connman_openconnect}
 BuildRequires:  openconnect
@@ -86,13 +87,13 @@ Header files and development files for connman.
 cp %{SOURCE1001} .
 
 %build
-CFLAGS+=" -DTIZEN_EXT"
 
 chmod +x bootstrap
 ./bootstrap
 %configure \
             --enable-threads \
             --enable-client \
+            --enable-tizen-ext \
             --enable-pacrunner \
             --enable-wifi=builtin \
 %if %{with connman_openconnect}
index 01e7c0e..f6fd063 100644 (file)
 
 #define RESOLVER_FLAG_PUBLIC (1 << 0)
 
+#if defined TIZEN_EXT
+#include <sys/smack.h>
+#endif
+
 /*
  * Threshold for RDNSS lifetime. Will be used to trigger RS
  * before RDNSS entries actually expire
@@ -137,6 +141,11 @@ static int resolvfile_export(void)
                goto done;
        }
 
+#if defined TIZEN_EXT
+       if (smack_fsetlabel(fd, "_", SMACK_LABEL_ACCESS) != 0)
+               DBG("Failed to label _");
+#endif
+
        if (ftruncate(fd, 0) < 0) {
                err = -errno;
                goto failed;