comparison cinst/main.c @ 65:e4088afd5281

Comment out validate instructions for now to avoid unused warnings
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 18 Mar 2014 14:23:30 +0000
parents fb9f78f7ab2f
children 8ffbb48528ae
comparison
equal deleted inserted replaced
64:fb9f78f7ab2f 65:e4088afd5281
86 } 86 }
87 } 87 }
88 88
89 return 0; 89 return 0;
90 } 90 }
91 91 /*
92 int validate_instructions(const char *certificate_list, 92 int validate_instructions(const char *certificate_list,
93 const size_t listLen, 93 const size_t list_len,
94 const char **to_install, 94 const char **to_install,
95 const char **to_remove) 95 const char **to_remove)
96 { 96 {
97 /* TODO */ 97 TODO
98 (void *) certificate_list;
99 (void **) to_install;
100 (void **) to_remove;
101 (void) list_len;
102
98 return 0; 103 return 0;
99 } 104 }
100 105 */
101 int main() { 106 int main() {
102 char **to_install = NULL; 107 char **to_install = NULL;
103 char **to_remove = NULL; 108 char **to_remove = NULL;
104 char *certificate_list = NULL; 109 char *certificate_list = NULL;
105 size_t listLen = 0; 110 size_t list_len = 0;
106 int ret = -1; 111 int ret = -1;
107 112
108 ret = readInput(&certificate_list, &to_install, &to_remove); 113 ret = readInput(&certificate_list, &to_install, &to_remove);
109 114
110 if (ret != 0) { 115 if (ret != 0) {
113 118
114 if (!certificate_list) { 119 if (!certificate_list) {
115 return ERR_INVALID_INPUT_NO_LIST; 120 return ERR_INVALID_INPUT_NO_LIST;
116 } 121 }
117 122
118 listLen = strnlen(certificate_list, MAX_INPUT_SIZE); 123 list_len = strnlen(certificate_list, MAX_INPUT_SIZE);
119 124
120 ret = verify_list(certificate_list, listLen); 125 ret = verify_list(certificate_list, list_len);
121 126
122 if (ret != 0) { 127 if (ret != 0) {
123 return ERR_INVALID_SIGNATURE; 128 return ERR_INVALID_SIGNATURE;
124 } 129 }
125 130
126 if (!strv_length(to_install) && !strv_length(to_remove)) { 131 if (!strv_length(to_install) && !strv_length(to_remove)) {
127 return ERR_NO_INSTRUCTIONS; 132 return ERR_NO_INSTRUCTIONS;
128 } 133 }
129 134
130 /* Check that the instructions are ok to execute */ 135 /* Check that the instructions are ok to execute
131 ret = validate_instructions(certificate_list, to_install, to_remove); 136 ret = validate_instructions(certificate_list, list_len, to_install,
137 to_remove);
132 138
133 if (ret != 0) { 139 if (ret != 0) {
134 return ERR_INVALID_INSTRUCTIONS; 140 return ERR_INVALID_INSTRUCTIONS;
135 } 141 }
136 142 */
137 /* Make valgrind happy */ 143 /* Make valgrind happy */
138 strfreev (to_install); 144 strfreev (to_install);
139 strfreev (to_remove); 145 strfreev (to_remove);
140 free (certificate_list); 146 free (certificate_list);
141 147

http://wald.intevation.org/projects/trustbridge/