+Shameless advertisement.
authorshort <>
Fri, 19 Sep 2003 14:28:08 +0000 (14:28 +0000)
committershort <>
Fri, 19 Sep 2003 14:28:08 +0000 (14:28 +0000)
src/client/lufs/mount.captive.in
src/libcaptive/client/vfs.c

index 79ec07d..dd96050 100755 (executable)
@@ -55,6 +55,18 @@ my $filesystem=$vardir."/".$fsname.".sys";
 my $ntoskrnl=$vardir."/ntoskrnl.exe";
 -r $ntoskrnl or die "W32 ntoskrnl.exe not readable: $ntoskrnl";
 
+
+# Shameless advertisement:
+if ($fsname eq "ntfs") {
+       for my $fh (*STDERR,*STDOUT) {
+               if (-t $fh) {
+                       print $fh "Captive NTFS activated. Updates: http://www.jankratochvil.net/project/captive/\n";
+                       last;
+                       }
+               }
+       }
+
+
 # Double-dashes are generally optional here.
 $oo=""
                .($fsname eq "cdfs" ? "--cdrom,--ro," : "--disk,--rw,")
index b71d0a9..447aae2 100644 (file)
@@ -26,6 +26,8 @@
 #include "vfs-slave.h"
 #include "init.h"
 #include "giochannel-blind.h"  /* for captive_giochannel_setup() */
+#include <unistd.h>
+#include <string.h>
 
 
 static gpointer captive_vfs_object_parent_class=NULL;
@@ -91,6 +93,23 @@ CaptiveVfsObject *captive_vfs_object;
        g_return_val_if_fail(captive_vfs_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
        g_return_val_if_fail(options!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
 
+#ifndef MAINTAINER_MODE
+       /* We are not sandboxing || we are the master */
+       if (!options->sandbox || (options->sandbox_server_argv || options->sandbox_server_ior)) {
+int fd;
+
+               /* Shameless advertisement: */
+               for (fd=2 /* STDERR */;fd>=1 /* STDOUT */;fd--) {
+                       if (isatty(fd)) {
+const gchar *msg="Captive NTFS activated. Updates: http://www.jankratochvil.net/project/captive/\n";
+
+                               write(fd,msg,strlen(msg));
+                               break;
+                               }
+                       }
+               }
+#endif /* !MAINTAINER_MODE */
+
        /* Here is the first initializaton point of parent in sandboxed mode. */
        captive_log_init(options);