[prev in list] [next in list] [prev in thread] [next in thread] 

List:       klik-devel
Subject:    [klik-devel] [klikclient commit] r991 -
From:       codesite-noreply () google ! com
Date:       2008-02-02 17:35:40
Message-ID: 000e0cd20da004453051cded66afae7 () google ! com
[Download RAW message or body]

Author: lionel.tricon
Date: Sat Feb  2 09:35:31 2008
New Revision: 991

Modified:
   trunk/virtualization/unionfuse/trunk/klikfuse/src/fs.c
   trunk/virtualization/unionfuse/trunk/klikfuse/src/fusemain.c

Log:
Change the _home_path to _redirect_path.


Modified: trunk/virtualization/unionfuse/trunk/klikfuse/src/fs.c
==============================================================================
--- trunk/virtualization/unionfuse/trunk/klikfuse/src/fs.c	(original)
+++ trunk/virtualization/unionfuse/trunk/klikfuse/src/fs.c	Sat Feb  2 
09:35:31 2008
@@ -103,8 +103,8 @@

 extern bool _union_mounting;
 extern bool _sandbox_mounting;
-extern char* _home_path;
-extern int   _size_home_path;
+extern char* _redirect_path;
+extern int   _size_redirect_path;
 extern char* _sandbox_path;
 extern int   _size_sandbox_path;
 extern char* _exclude_list[];
@@ -170,7 +170,7 @@

     if (TRACE) printf("****** g_strsplit %s -> %s\n", v_path, \
&(v_path[_size_sandbox_path]));  parts = g_strsplit(&(v_path[_size_sandbox_path]), \
                "/", -1);
-    strcpy(source, _home_path);
+    strcpy(source, _redirect_path);
     strcpy(dest, _sandbox_path);
     for (i=0; i<local_g_strv_length(parts)-p_value; i++)
     {
@@ -239,7 +239,7 @@
 {
     int i, v_size = strlen(p_path);

-    if (!_sandbox_mounting || v_size<_size_home_path)
+    if (!_sandbox_mounting || v_size<_size_redirect_path)
     {
         *p_newpath = (char*)p_path;
         return 1;
@@ -259,7 +259,8 @@
     }

     // -B support
-    if (_size_home_path==1 && p_path[0]=='/')
+    if (_size_redirect_path==1 &&
+        p_path[0]=='/')
     {
         strcpy(*p_newpath, _sandbox_path);
         strcat(*p_newpath, p_path);
@@ -267,18 +268,21 @@
     }

     // -d support
-    if ((p_path[_size_home_path-2]=='/' && 
p_path[_size_home_path-1]=='.') && !strncmp(p_path,_home_path,_size_home_path))
+    if (p_path[_size_redirect_path-2]=='/' &&
+        p_path[_size_redirect_path-1]=='.' &&
+        !strncmp(p_path,_redirect_path,_size_redirect_path))
     {
         strcpy(*p_newpath, _sandbox_path);
-        strcat(*p_newpath, &(p_path[_size_home_path]));
+        strcat(*p_newpath, &(p_path[_size_redirect_path]));
         return 0;
     }

     // -b support
-    if ((v_size==_size_home_path || p_path[_size_home_path]=='/') && \
!strncmp(p_path,_home_path,_size_home_path)) +    if ((v_size==_size_redirect_path || \
 p_path[_size_redirect_path]=='/') &&
+        !strncmp(p_path,_redirect_path,_size_redirect_path))
     {
         strcpy(*p_newpath, _sandbox_path);
-        strcat(*p_newpath, &(p_path[_size_home_path]));
+        strcat(*p_newpath, &(p_path[_size_redirect_path]));
         return 0;
     }


Modified: trunk/virtualization/unionfuse/trunk/klikfuse/src/fusemain.c
==============================================================================
--- trunk/virtualization/unionfuse/trunk/klikfuse/src/fusemain.c	(original)
+++ trunk/virtualization/unionfuse/trunk/klikfuse/src/fusemain.c	Sat 
Feb  2 09:35:31 2008
@@ -85,8 +85,8 @@

  bool _union_mounting;                                                 
// if true, we want to union-mount the data
  bool _sandbox_mounting;                                               
// if true, we want to sandbox the application
-char* _home_path;                                                     
// $HOME directory
-int   _size_home_path;                                                
// Size of the $HOME directory
+char* _redirect_path;                                                 
// ~$HOME directory
+int   _size_redirect_path;                                            
// Size of the ~$HOME directory
  char* _sandbox_path;                                                  
// Directory where to redirect write (sandboxing)
  int   _size_sandbox_path;                                             
// Size of the directory where to redirect write
  char* _exclude_list[32];                                              
// We want to exclude some directories in case of sandboxing
@@ -512,9 +512,9 @@
 void usage(const char* prog)
 {
 #ifdef _ISOFS
-    printf("Version: %s\nUsage: %s [-n] [-p] [-u] [-b/B 
<sandbox_path>] [-c <iocharset>] [-h] <isofs_image_file> <mount_point> 
[<FUSE library options>]\n"
+    printf("Version: %s\nUsage: %s [-n] [-p] [-u] [-b/d/B 
<sandbox_path>] [-c <iocharset>] [-h] <isofs_image_file> <mount_point> 
[<FUSE library options>]\n"
 #else
-    printf("Version: %s\nUsage: %s [-n] [-p] [-u] [-b/B 
<sandbox_path>] [-c <iocharset>] [-h] <cramfs_image_file> <mount_point> 
[<FUSE library options>]\n"
+    printf("Version: %s\nUsage: %s [-n] [-p] [-u] [-b/d/B 
<sandbox_path>] [-c <iocharset>] [-h] <cramfs_image_file> <mount_point> 
[<FUSE library options>]\n"
 #endif
    "Where options are:\n"
     "    -n                       -- do NOT maintain file $HOME/.mtab.fuseiso\n"
@@ -557,19 +557,24 @@
             case 'n':
                 maintain_mtab = 0;
                 break;
+
             case 'p':
                 maintain_mount_point = 1;
                 break;
+
             case 'c':
                 if (optarg) iocharset=optarg;
                 break;
+
             case 'h':
                 usage(argv[0]);
                 exit(0);
                 break;
+
             case 'u':
                 _union_mounting = true;
                 break;
+
             case 'b':
                 _union_mounting = true;
                 _sandbox_mounting = true;
@@ -580,13 +585,13 @@
                     passwd = getpwuid( getuid() );
                     if (passwd && passwd->pw_dir)
                     {
-                        _size_home_path = strlen( passwd->pw_dir );
-                        _home_path = malloc( _size_home_path+1 );
-                        strcpy( _home_path, passwd->pw_dir );
+                        _size_redirect_path = strlen( passwd->pw_dir );
+                        _redirect_path = malloc( _size_redirect_path+1 );
+                        strcpy( _redirect_path, passwd->pw_dir );
                     }
                 }
                 break;
-
+
             case 'd':
                 _union_mounting = true;
                 _sandbox_mounting = true;
@@ -597,15 +602,14 @@
                     passwd = getpwuid( getuid() );
                     if (passwd && passwd->pw_dir)
                     {
-                        _size_home_path = strlen( passwd->pw_dir );
-                        _home_path = malloc( _size_home_path+3 );
-                         strcpy( _home_path, passwd->pw_dir );
-                         strcat(_home_path,  "/.");
+                        _size_redirect_path = strlen( passwd->pw_dir );
+                        _redirect_path = malloc( _size_redirect_path+3 );
+                         strcpy( _redirect_path, passwd->pw_dir );
+                         strcat( _redirect_path,  "/." );
                     }
                 }
                 break;
-
-
+
             case 'B':
                 _union_mounting = true;
                 _sandbox_mounting = true;
@@ -613,9 +617,9 @@
                 {
                     _sandbox_path=optarg;
                     _size_sandbox_path = strlen( _sandbox_path );
-                    _home_path = malloc( 2 );
-                    _size_home_path = 1;
-                    strcpy( _home_path, "/" );
+                    _redirect_path = malloc( 2 );
+                    _size_redirect_path = 1;
+                    strcpy( _redirect_path, "/" );
                 }
                 break;
             case '?':
_______________________________________________
klik-devel mailing list
klik-devel@kde.org
https://mail.kde.org/mailman/listinfo/klik-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic