- ORBit2>=2.7.x use private 'linc2'/'link' instead of external 'linc'.
BuildRoot: /var/tmp/@PACKAGE@-@VERSION@-%{release}-root
BuildRequires: ORBit2-devel
Requires: ORBit2
-# We do not yet handle correctly linc2 of ORBit-2.7.x+
+# Due to --with-orbit-line=linc
Conflicts: ORBit2 >= 2.7.0
BuildRequires: openssl-devel
Requires: openssl
--enable-man-pages \
--enable-sbin-mountdir=/sbin \
--enable-sbin-mount-fs=ntfs:fastfat:cdfs:ext2fsd \
- --disable-gtk-doc
+ --disable-gtk-doc \
+ --with-orbit-line=linc
make
%install
AM_CONDITIONAL(ENABLE_LUFS,[ $have_lufs_includes && test x$PATH_LUFSMOUNT != x -a x$enable_lufs != no ])
AC_SUBST(PATH_LUFSMOUNT)
-dnl for $(top_srcdir)/src/libcaptive/sandbox/split-sandbox.c
-AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
-
dnl for $(top_srcdir)/src/libcaptive/client/
dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
dnl - currently this argument is not used by 'orbit2-config' in any way anyway
AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit library.])])
+AC_ARG_WITH(orbit-line,[ --with-orbit-line=[link/linc/auto] Use 'link' for ORBit2 >=2.7.x+ (def.=auto)],,with_orbit_line=auto)
+captive_save_CFLAGS="$CFLAGS"
+captive_save_LIBS="$LIBS"
+CFLAGS="$CFLAGS $ORBIT_CFLAGS"
+LIBS="$LIBS $ORBIT_LIBS"
+AC_CHECK_FUNC(link_get_tmpdir,[
+ AC_DEFINE(HAVE_ORBIT_LINK,,[ORBit2 is 2.7.x+ and therefore includes its own 'link' library])
+ found_orbit_line=link
+ ],
+ found_orbit_line=linc
+ )
+CFLAGS="$captive_save_CFLAGS"
+LIBS="$captive_save_LIBS"
+if test "x$with_orbit_line" != "xauto" -a "x$with_orbit_line" != "x$found_orbit_line";then
+ AC_MSG_ERROR([--with-orbit-line=$with_orbit_line specified but the detected line is $found_orbit_line])
+fi
+
+if test "x$found_orbit_line" = "xlinc";then
+ AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
+fi
+
# AC_ARG_ENABLE(install-pkg,[--enable-install-pkg=[no/yes/auto]],,enable_install_pkg=auto)
GLADE_W_INIT([
./src/install/acquire/ui-gnome-interface.c
libpopt0,
libglib2.0-0,
libreadline4
-Conflicts: liborbit2 (>= 2.7.0)
+# Due to --with-orbit-line=link
+Conflicts: liborbit2 (< 2.8.2)
Recommends: captive-lufs (= ${Source-Version})
Description: NTFS filesystem using Microsoft Windows drivers
Existing binary Microsoft Windows file system drivers were exploited
--enable-man-pages \
--enable-sbin-mountdir=/sbin \
--enable-sbin-mount-fs=ntfs:fastfat:cdfs:ext2fsd \
- --disable-gtk-doc
+ --disable-gtk-doc \
+ --with-orbit-line=link
build-arch: config.status build-arch-stamp
build-arch-stamp:
#include <fcntl.h>
#include <sys/file.h>
#include <sys/resource.h>
-#include <linc/linc-protocol.h> /* for linc_set_tmpdir() */
#include <orbit/orb-core/corba-defs.h>
+#ifdef HAVE_ORBIT_LINK
+char *link_get_tmpdir(void);
+void link_set_tmpdir(const char *dir);
+#else
+#include <linc/linc-protocol.h> /* for linc_set_tmpdir() */
+#endif
+
/* Do not: #include "../../libcaptive/sandbox/split.h" * for captive_sandbox_fd_closeup(); FIXME *
* as it has libcaptive-dependent includes conditioned by ORBIT2.
if (ev._major!=CORBA_NO_EXCEPTION)
fatal("Cannot initialize CORBA ORB (exception): %m");
}
+#ifdef HAVE_ORBIT_LINK
+ chrooted_orbit_dir_old=link_get_tmpdir(); /* returns g_strdup()ed string */
+#else
chrooted_orbit_dir_old=linc_get_tmpdir(); /* returns g_strdup()ed string */
+#endif
g_assert(chrooted_orbit_dir_old!=NULL);
+#ifdef HAVE_ORBIT_LINK
+ link_set_tmpdir(chrooted_orbit_dir);
+#else
linc_set_tmpdir(chrooted_orbit_dir);
+#endif
+ if (!*chrooted_orbit_dir_old)
+ fatal("Cannot detect chrooted_orbit_dir: --with-orbit-line incompatible with ORBit2 version");
if (rmdir(chrooted_orbit_dir_old))
fatal("Cannot remove old chrooted_orbit_dir \"%s\": %m",chrooted_orbit_dir_old);
g_free(chrooted_orbit_dir_old);
SANDBOX_SERVER_RLIMIT(RLIMIT_MEMLOCK,0);
SANDBOX_SERVER_RLIMIT(RLIMIT_CORE,0);
SANDBOX_SERVER_RLIMIT(RLIMIT_FSIZE,0);
- SANDBOX_SERVER_RLIMIT(RLIMIT_NOFILE,6); /* >=6 */
+ SANDBOX_SERVER_RLIMIT(RLIMIT_NOFILE,16); /* >=6; newer ORBit2/link require >6 */
/* FIXME: Why flock(dirfd,...) in chrooted_createdir() succeeds?: */
SANDBOX_SERVER_RLIMIT(RLIMIT_LOCKS,0);
#undef SANDBOX_SERVER_RLIMIT
servant, /* data */
NULL); /* notify */
g_source_attach(source,
- g_main_loop_get_context(linc_main_get_loop())); /* context; NULL means 'default context' */
+ captive_corba_get_context()); /* context; NULL means 'default context' */
g_source_unref(source);
}
servant, /* data */
NULL); /* notify */
g_source_attach(source,
- g_main_loop_get_context(linc_main_get_loop())); /* context; NULL means 'default context' */
+ captive_corba_get_context()); /* context; NULL means 'default context' */
g_source_unref(source);
}
servant, /* data */
NULL); /* notify */
g_source_attach(source,
- g_main_loop_get_context(linc_main_get_loop())); /* context; NULL means 'default context' */
+ captive_corba_get_context()); /* context; NULL means 'default context' */
g_source_unref(source);
#endif
}
#include "captive/rtl-file.h"
#include <unistd.h>
#include <fcntl.h>
-#include <linc/linc.h> /* for linc_main_get_loop() */
#include "server-Directory.h"
#include "server-Vfs.h"
#include "../client/vfs.h"
#include "../client/giochannel-blind.h" /* for captive_giochannel_blind_new() */
#include <signal.h>
+#ifdef HAVE_ORBIT_LINK
+extern GMainLoop *link_loop;
+void link_set_tmpdir(const char *dir);
+#else
+#include <linc/linc.h> /* for linc_main_get_loop() */
+#endif
+
/* CONFIG: */
}
#endif
+GMainLoop *captive_corba_get_loop(void)
+{
+#ifdef HAVE_ORBIT_LINK
+ return link_loop;
+#else
+ return linc_main_get_loop();
+#endif
+}
+
+GMainContext *captive_corba_get_context(void)
+{
+ return g_main_loop_get_context(captive_corba_get_loop());
+}
void sandbox_child_shutdown(void)
{
/* Do not fail by passing logging messages to the master. */
impl_Captive_Vfs_init_g_log_func_disable();
- g_main_loop_quit(linc_main_get_loop());
+ g_main_loop_quit(captive_corba_get_loop());
}
heartbeat_source_callback_orb=captive_corba_orb;
- /* linc_main_get_loop() makes sense only after corba_init() -> CORBA_ORB_init() */
+ /* captive_corba_get_context() makes sense only after corba_init() -> CORBA_ORB_init() */
errguint=g_source_attach(
captive_corba_sandbox_child_heartbeat_gsource, /* source */
- g_main_loop_get_context(linc_main_get_loop())); /* context; NULL means 'default context' */
+ captive_corba_get_context()); /* context; NULL means 'default context' */
g_assert(errguint!=0);
/* Init 'Vfs_object' */
g_assert_not_reached();
}
sandbox_parent_own_orbit_dir_cleanup_init();
+#ifdef HAVE_ORBIT_LINK
+ link_set_tmpdir(sandbox_parent_own_orbit_dir);
+#else
linc_set_tmpdir(sandbox_parent_own_orbit_dir);
+#endif
}
data=captive_rtl_file_read(Vfs_IOR_fd_read,&data_size); /* data_fd_read */
#include <glib/gmacros.h>
+#include <glib/gmain.h>
#ifdef ORBIT2 /* Prevent missing $(ORBIT_CFLAGS) outside of libcaptive/sandbox/ */
#include "sandbox.h"
#include "captive/client-vfs.h"
void sandbox_child_prepare_shutdown(void);
void captive_sandbox_fd_closeup(int fd_first_to_delete);
void sandbox_child_shutdown(void);
+GMainLoop *captive_corba_get_loop(void);
+GMainContext *captive_corba_get_context(void);
#ifdef ORBIT2 /* Prevent missing $(ORBIT_CFLAGS) outside of libcaptive/sandbox/ */
gboolean captive_sandbox_spawn(CaptiveVfsParentObject *captive_vfs_parent_object);
gboolean validate_CORBA_Environment(CORBA_Environment *evp);