/[hurd]/hurd/ftpfs/ftpfs.c
ViewVC logotype

Diff of /hurd/ftpfs/ftpfs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by roland, Tue Mar 12 03:30:19 2002 UTC revision 1.13 by marcus, Sat Apr 20 03:22:46 2002 UTC
# Line 24  Line 24 
24  #include <error.h>  #include <error.h>
25  #include <argz.h>  #include <argz.h>
26  #include <netdb.h>  #include <netdb.h>
27    #include <sys/stat.h>
28    
29  #include <version.h>  #include <version.h>
30    
# Line 365  int Line 366  int
366  main (int argc, char **argv)  main (int argc, char **argv)
367  {  {
368    error_t err;    error_t err;
369    mach_port_t bootstrap;    mach_port_t bootstrap, underlying_node;
370      struct stat underlying_stat;
371    const struct argp_child argp_children[] =    const struct argp_child argp_children[] =
372      { {&common_argp}, {&netfs_std_startup_argp}, {0} };      { {&common_argp}, {&netfs_std_startup_argp}, {0} };
373    struct argp argp =    struct argp argp =
# Line 395  main (int argc, char **argv) Line 397  main (int argc, char **argv)
397    
398    netfs_root_node = ftpfs->root;    netfs_root_node = ftpfs->root;
399    
400    netfs_startup (bootstrap, 0);    underlying_node = netfs_startup (bootstrap, 0);
401      err = io_stat (underlying_node, &underlying_stat);
402      if (err)
403        error (1, err, "cannot stat underling node");
404    
405      /* Initialize stat information of the root node.  */
406      netfs_root_node->nn_stat = underlying_stat;
407      netfs_root_node->nn_stat.st_mode =
408        S_IFDIR | (underlying_stat.st_mode & ~S_IFMT & ~S_ITRANS);
409    
410      /* If the underlying node isn't a directory, propagate read permission to
411         execute permission since we need that for lookups.  */
412      if (! S_ISDIR (underlying_stat.st_mode))
413        {
414          if (underlying_stat.st_mode & S_IRUSR)
415            netfs_root_node->nn_stat.st_mode |= S_IXUSR;
416          if (underlying_stat.st_mode & S_IRGRP)
417            netfs_root_node->nn_stat.st_mode |= S_IXGRP;
418          if (underlying_stat.st_mode & S_IROTH)
419            netfs_root_node->nn_stat.st_mode |= S_IXOTH;
420        }
421    
422    for (;;)    for (;;)
423      netfs_server_loop ();      netfs_server_loop ();

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26