ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Spectre/Mounter.cpp
(Generate patch)

Comparing trunk/Spectre/Mounter.cpp (file contents):
Revision 227 by douglas, 2003-07-30T17:56:29-07:00 vs.
Revision 228 by douglas, 2003-07-30T21:14:12-07:00

# Line 2 | Line 2
2   //
3   // Douglas Thrift
4   //
5 < // $Id: Mounter.cpp,v 1.10 2003/07/31 00:56:29 douglas Exp $
5 > // $Id: Mounter.cpp,v 1.11 2003/07/31 04:14:12 douglas Exp $
6  
7   #include "Mounter.h"
8  
# Line 20 | Line 20 | void Mounter::mount()
20          {
21                  cerr << "mounted = {\n";
22  
23 <                for (set<string>::iterator itor = mounted.begin();
24 <                        itor != mounted.end(); itor++)
23 >                for (set<string>::iterator itor = mounted.begin(); itor !=
24 >                        mounted.end(); itor++)
25                  {
26                          cerr << "   " << *itor << "\n";
27                  }
# Line 50 | Line 50 | void Mounter::samba()
50          string path = config.root + "/" + host;
51          DIR* dir = opendir(path.c_str());
52          dirent* file;
53 +
54 +        if (dir == NULL)
55 +        {
56 +                string prefix = program + ": " + path;
57 +                perror(prefix.c_str());
58 +
59 +                return;
60 +        }
61          
62          while ((file = readdir(dir)) != NULL)
63          {
# Line 124 | Line 132 | void Mounter::samba(ipstream& pin)
132   void Mounter::mount(const string& folder, const string& user, const string&
133          owner)
134   {
135 <        string path = config.root + "/" + host + "/" + (folder[folder.length() -
136 <                1] == '$' ? "." + folder.substr(0, folder.length() - 1) : folder);
135 >        string path = config.root + "/" + host + "/" + (folder[folder.length() - 1]
136 >                == '$' ? "." + folder.substr(0, folder.length() - 1) : folder);
137          
138          if (mounted.find(path) != mounted.end()) return;
139  
132        ostringstream options;
133
140          struct passwd* item = getpwnam(user.c_str());
141  
142          if (item == NULL)
# Line 138 | Line 144 | void Mounter::mount(const string& folder
144                  cerr << program << ": " << user << ": Unknown user\n";
145                  return;
146          }
147 +
148 +        ostringstream options;
149          
150   #if defined _Linux_
151          char credentials[17];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines