1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
Index: bootadm/usr/src/cmd/boot/bootadm/bootadm.c
===================================================================
--- bootadm.orig/usr/src/cmd/boot/bootadm/bootadm.c 2013-01-02 16:35:31.787358064 +0400
+++ bootadm/usr/src/cmd/boot/bootadm/bootadm.c 2013-01-02 16:36:42.247600489 +0400
@@ -2498,67 +2498,13 @@
const char *fcn = "read_list()";
flistp->head = flistp->tail = NULL;
-
- /*
- * build and check path to extract_boot_filelist.ksh
- */
- n = snprintf(path, sizeof (path), "%s%s", root, EXTRACT_BOOT_FILELIST);
- if (n >= sizeof (path)) {
- bam_error(NO_FLIST);
- return (BAM_ERROR);
- }
-
- if (is_safe_exec(path) == BAM_ERROR)
- return (BAM_ERROR);
-
- /*
- * If extract_boot_filelist is present, exec it, otherwise read
- * the filelists directly, for compatibility with older images.
- */
- if (stat(path, &sb) == 0) {
- /*
- * build arguments to exec extract_boot_filelist.ksh
- */
- char *rootarg, *platarg;
- int platarglen = 1, rootarglen = 1;
- if (strlen(root) > 1)
- rootarglen += strlen(root) + strlen("-R ");
- if (bam_alt_platform)
- platarglen += strlen(bam_platform) + strlen("-p ");
- platarg = s_calloc(1, platarglen);
- rootarg = s_calloc(1, rootarglen);
- *platarg = 0;
- *rootarg = 0;
-
- if (strlen(root) > 1) {
- (void) snprintf(rootarg, rootarglen,
- "-R %s", root);
- }
- if (bam_alt_platform) {
- (void) snprintf(platarg, platarglen,
- "-p %s", bam_platform);
- }
- n = snprintf(cmd, sizeof (cmd), "%s %s %s /%s /%s",
- path, rootarg, platarg, BOOT_FILE_LIST, ETC_FILE_LIST);
- free(platarg);
- free(rootarg);
- if (n >= sizeof (cmd)) {
- bam_error(NO_FLIST);
- return (BAM_ERROR);
- }
- if (exec_cmd(cmd, flistp) != 0) {
- BAM_DPRINTF((D_FLIST_FAIL, fcn, path, strerror(errno)));
- return (BAM_ERROR);
- }
- } else {
- /*
- * Read current lists of files - only the first is mandatory
- */
- rval = read_one_list(root, flistp, BOOT_FILE_LIST);
- if (rval != BAM_SUCCESS)
- return (rval);
- (void) read_one_list(root, flistp, ETC_FILE_LIST);
- }
+ /*
+ * Read current lists of files - only the first is mandatory
+ */
+ rval = read_one_list(root, flistp, BOOT_FILE_LIST);
+ if (rval != BAM_SUCCESS)
+ return (rval);
+ (void) read_one_list(root, flistp, ETC_FILE_LIST);
if (flistp->head == NULL) {
bam_error(NO_FLIST);
|