Changeset 221 for branches/samba-3.3.x/source/client
- Timestamp:
- May 24, 2009, 7:17:10 AM (16 years ago)
- Location:
- branches/samba-3.3.x/source/client
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/client/client.c
r206 r221 1786 1786 ****************************************************************************/ 1787 1787 1788 static void free_file_list (struct file_list *l ist_head)1788 static void free_file_list (struct file_list *l_head) 1789 1789 { 1790 1790 struct file_list *list, *next; 1791 1791 1792 for (list = l ist_head; list; list = next) {1792 for (list = l_head; list; list = next) { 1793 1793 next = list->next; 1794 DLIST_REMOVE(l ist_head, list);1794 DLIST_REMOVE(l_head, list); 1795 1795 SAFE_FREE(list->file_path); 1796 1796 SAFE_FREE(list); -
branches/samba-3.3.x/source/client/mount.cifs.c
r206 r221 86 86 const char *thisprogram; 87 87 int verboseflag = 0; 88 int fakemnt = 0; 88 89 static int got_password = 0; 89 90 static int got_user = 0; … … 1031 1032 char * temp; 1032 1033 char * dev_name; 1033 int rc ;1034 int rc = 0; 1034 1035 int rsize = 0; 1035 1036 int wsize = 0; … … 1104 1105 exit(EX_USAGE); 1105 1106 case 'n': 1106 1107 1107 ++nomtab; 1108 break; 1108 1109 case 'b': 1109 1110 #ifdef MS_BIND … … 1209 1210 break; 1210 1211 case 't': 1212 break; 1213 case 'f': 1214 ++fakemnt; 1211 1215 break; 1212 1216 default: … … 1411 1415 } 1412 1416 1413 if ( mount(dev_name, mountpoint, "cifs", flags, options)) {1417 if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) { 1414 1418 switch (errno) { 1415 1419 case ECONNREFUSED: … … 1441 1445 } 1442 1446 1447 if (nomtab) 1448 goto mount_exit; 1443 1449 atexit(unlock_mtab); 1444 1450 rc = lock_mtab(); -
branches/samba-3.3.x/source/client/umount.cifs.c
r206 r221 34 34 #include <string.h> 35 35 #include <mntent.h> 36 #include <limits.h> 36 37 #include "mount.h" 37 38 … … 232 233 } 233 234 235 /* Make a canonical pathname from PATH. Returns a freshly malloced string. 236 It is up the *caller* to ensure that the PATH is sensible. i.e. 237 canonicalize ("/dev/fd0/.") returns "/dev/fd0" even though ``/dev/fd0/.'' 238 is not a legal pathname for ``/dev/fd0'' Anything we cannot parse 239 we return unmodified. */ 240 static char * 241 canonicalize(char *path) 242 { 243 char *canonical; 244 245 if (path == NULL) { 246 return NULL; 247 } 248 249 if (strlen(path) > PATH_MAX) { 250 fprintf(stderr, "Mount point string too long\n"); 251 return NULL; 252 } 253 254 canonical = (char *)malloc (PATH_MAX + 1); 255 256 if (!canonical) { 257 fprintf(stderr, "Error! Not enough memory!\n"); 258 return NULL; 259 } 260 261 if (realpath (path, canonical)) 262 return canonical; 263 264 strncpy (canonical, path, PATH_MAX); 265 canonical[PATH_MAX] = '\0'; 266 return canonical; 267 } 268 234 269 int main(int argc, char ** argv) 235 270 { … … 305 340 argc -= optind; 306 341 307 mountpoint = argv[0];342 mountpoint = canonicalize(argv[0]); 308 343 309 344 if((argc < 1) || (argv[0] == NULL)) {
Note:
See TracChangeset
for help on using the changeset viewer.