Index: client-src/getfsent.h =================================================================== RCS file: /cvsroot/amanda/amanda/client-src/getfsent.h,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -u -r1.4 -r1.4.4.1 --- client-src/getfsent.h 1998/07/04 00:18:15 1.4 +++ client-src/getfsent.h 2001/04/12 00:58:47 1.4.4.1 @@ -54,7 +54,7 @@ void close_fstab P((void)); int get_fstab_nextentry P((generic_fsent_t *fsent)); -int search_fstab P((char *name, generic_fsent_t *fsent)); +int search_fstab P((char *name, generic_fsent_t *fsent, int check_dev)); int is_local_fstype P((generic_fsent_t *fsent)); char *amname_to_devname P((char *str)); Index: client-src/getfsent.c =================================================================== RCS file: /cvsroot/amanda/amanda/client-src/getfsent.c,v retrieving revision 1.20.4.2 retrieving revision 1.20.4.4 diff -u -r1.20.4.2 -r1.20.4.4 --- client-src/getfsent.c 2001/03/30 02:40:21 1.20.4.2 +++ client-src/getfsent.c 2001/04/12 00:58:47 1.20.4.4 @@ -1,6 +1,6 @@ /* * Amanda, The Advanced Maryland Automatic Network Disk Archiver - * Copyright (c) 1991-1998 University of Maryland at College Park + * Copyright (c) 1991-1998, 2001 University of Maryland at College Park * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -144,24 +144,29 @@ #include static FILE *fstabf1 = NULL; /* /proc/mounts */ -static FILE *fstabf2 = NULL; /* MNTTAB */ +static FILE *fstabf2 = NULL; /* MOUNTED */ +static FILE *fstabf3 = NULL; /* MNTTAB */ int open_fstab() { close_fstab(); #if defined(HAVE_SETMNTENT) fstabf1 = setmntent("/proc/mounts", "r"); - fstabf2 = setmntent(MNTTAB, "r"); +# if defined(MOUNTED) + fstabf2 = setmntent(MOUNTED, "r"); +# endif + fstabf3 = setmntent(MNTTAB, "r"); #else - fstabf2 = fopen(MNTTAB, "r"); + fstabf3 = fopen(MNTTAB, "r"); #endif - return (fstabf1 != NULL || fstabf2 != NULL); + return (fstabf1 != NULL || fstabf2 != NULL || fstabf3 != NULL); } void close_fstab() { afclose(fstabf1); afclose(fstabf2); + afclose(fstabf3); } int get_fstab_nextentry(fsent) @@ -181,6 +186,12 @@ afclose(fstabf2); } } + if(!sys_fsent && fstabf3) { + sys_fsent = getmntent(fstabf3); + if(!sys_fsent) { + afclose(fstabf3); + } + } if(!sys_fsent) { return 0; } @@ -427,9 +438,10 @@ return 0; } -int search_fstab(name, fsent) -char *name; -generic_fsent_t *fsent; +int search_fstab(name, fsent, check_dev) + char *name; + generic_fsent_t *fsent; + int check_dev; { struct stat stats[3]; char *fullname = NULL; @@ -476,8 +488,8 @@ if(fsent->fsname != NULL) { sfs = stat(fsent->fsname, &fsstat); sfsr = stat((rdev = dev2rdev(fsent->fsname)), &fsrstat); - if(sfs == -1 && sfsr == -1) - continue; + if(check_dev == 1 && sfs == -1 && sfsr == -1) + continue; } if((fsent->mntdir != NULL && @@ -520,8 +532,9 @@ { generic_fsent_t fsent; - if(search_fstab(str, &fsent)) - if (fsent.fsname != NULL) + if(search_fstab(str, &fsent, 1) && fsent.fsname != NULL) + str = fsent.fsname; + else if(search_fstab(str, &fsent, 0) && fsent.fsname != NULL) str = fsent.fsname; return dev2rdev(str); @@ -532,8 +545,9 @@ { generic_fsent_t fsent; - if(search_fstab(str, &fsent)) - if (fsent.mntdir != NULL) + if(search_fstab(str, &fsent, 1) && fsent.mntdir != NULL) + str = fsent.mntdir; + else if(search_fstab(str, &fsent, 0) && fsent.mntdir != NULL) str = fsent.mntdir; return stralloc(str); @@ -544,7 +558,7 @@ { generic_fsent_t fsent; - if (!search_fstab(str, &fsent)) + if (!search_fstab(str, &fsent, 1) && !search_fstab(str, &fsent, 0)) return stralloc(""); return stralloc(fsent.fstype); @@ -603,7 +617,7 @@ close_fstab(); name = newstralloc(name, "/usr"); - if(search_fstab(name, &fsent)) { + if(search_fstab(name, &fsent, 1) || search_fstab(name, &fsent, 0)) { printf("Found %s mount for %s:\n", is_local_fstype(&fsent)? "local" : "remote", name); print_entry(&fsent); @@ -612,7 +626,7 @@ printf("Mount for %s not found\n", name); name = newstralloc(name, "/"); - if(search_fstab(name, &fsent)) { + if(search_fstab(name, &fsent, 1) || search_fstab(name, &fsent, 0)) { printf("Found %s mount for %s:\n", is_local_fstype(&fsent)? "local" : "remote", name); print_entry(&fsent);