Changeset 89 in MondoRescue for trunk/mondo/mondo/common/libmondo-devices.c
- Timestamp:
- Oct 27, 2005, 10:45:34 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-devices.c
r87 r89 2103 2103 } 2104 2104 // check whether already mounted - we better remove 2105 2106 strip_spaces 2105 // surrounding spaces and trailing '/' for this 2106 strip_spaces(bkpinfo->nfs_mount); 2107 2107 if (bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] == '/') 2108 2108 bkpinfo->nfs_mount[strlen(bkpinfo->nfs_mount) - 1] = '\0'; 2109 2109 sprintf(command, "mount | grep \"%s \" | cut -d' ' -f3", 2110 2110 bkpinfo->nfs_mount); 2111 2111 strcpy(bkpinfo->isodir, 2112 2112 call_program_and_get_last_line_of_output(command)); … … 2122 2122 } 2123 2123 if (!is_this_device_mounted(bkpinfo->nfs_mount)) { 2124 sprintf(bkpinfo->isodir, "/tmp/isodir.mondo.%d", (int)(random()%32768)); 2125 sprintf(command, "mkdir -p %s", bkpinfo->isodir); 2126 run_program_and_log_output(command, 5); 2127 sprintf(tmp, "mount %s -t nfs %s", bkpinfo->nfs_mount, bkpinfo->isodir); 2128 run_program_and_log_output(tmp, 5); 2129 malloc_string(g_selfmounted_isodir); 2130 strcpy(g_selfmounted_isodir, bkpinfo->isodir); 2124 sprintf(bkpinfo->isodir, "/tmp/isodir.mondo.%d", 2125 (int) (random() % 32768)); 2126 sprintf(command, "mkdir -p %s", bkpinfo->isodir); 2127 run_program_and_log_output(command, 5); 2128 sprintf(tmp, "mount %s -t nfs %s", bkpinfo->nfs_mount, 2129 bkpinfo->isodir); 2130 run_program_and_log_output(tmp, 5); 2131 malloc_string(g_selfmounted_isodir); 2132 strcpy(g_selfmounted_isodir, bkpinfo->isodir); 2131 2133 } 2132 2134 if (!is_this_device_mounted(bkpinfo->nfs_mount)) { … … 2144 2146 strcpy(bkpinfo->nfs_remote_dir, tmp); 2145 2147 // check whether writable - we better remove surrounding spaces for this 2146 strip_spaces (bkpinfo->nfs_remote_dir); 2147 sprintf (command, "echo hi > %s/%s/.dummy.txt", bkpinfo->isodir, 2148 bkpinfo->nfs_remote_dir); 2149 while (run_program_and_log_output (command, FALSE)) { 2150 strcpy(tmp, bkpinfo->nfs_remote_dir); 2151 asprintf (&prompt, 2152 "Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup.", 2153 bkpinfo->nfs_remote_dir, bkpinfo->isodir); 2154 if(!popup_and_get_string ("Directory", prompt, tmp, MAX_STR_LEN)) { 2155 log_to_screen("User has chosen not to backup the PC"); 2156 finish(1); 2157 } 2158 strcpy(bkpinfo->nfs_remote_dir, tmp); 2159 // check whether writable - we better remove surrounding spaces for this */ 2160 strip_spaces (bkpinfo->nfs_remote_dir); 2161 asprintf (&command, "echo hi > %s/%s/.dummy.txt", bkpinfo->isodir, 2162 bkpinfo->nfs_remote_dir); 2148 strip_spaces(bkpinfo->nfs_remote_dir); 2149 sprintf(command, "echo hi > %s/%s/.dummy.txt", bkpinfo->isodir, 2150 bkpinfo->nfs_remote_dir); 2151 while (run_program_and_log_output(command, FALSE)) { 2152 strcpy(tmp, bkpinfo->nfs_remote_dir); 2153 asprintf(&prompt, 2154 "Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup.", 2155 bkpinfo->nfs_remote_dir, bkpinfo->isodir); 2156 if (!popup_and_get_string 2157 ("Directory", prompt, tmp, MAX_STR_LEN)) { 2158 log_to_screen("User has chosen not to backup the PC"); 2159 finish(1); 2160 } 2161 strcpy(bkpinfo->nfs_remote_dir, tmp); 2162 // check whether writable - we better remove surrounding spaces for this */ 2163 strip_spaces(bkpinfo->nfs_remote_dir); 2164 asprintf(&command, "echo hi > %s/%s/.dummy.txt", 2165 bkpinfo->isodir, bkpinfo->nfs_remote_dir); 2163 2166 } 2164 2167 for (i = 0; i <= MAX_NOOF_MEDIA; i++) { … … 2908 2911 } 2909 2912 #endif 2910 log_msg(1, "Using %s", fdisk);2913 log_msg(1, "Using %s", fdisk); 2911 2914 sprintf(command, "%s -l %s | grep 'EFI GPT'", fdisk, drive); 2912 2915 strcpy(tmp, call_program_and_get_last_line_of_output(command));
Note:
See TracChangeset
for help on using the changeset viewer.