summaryrefslogtreecommitdiff
path: root/cleopatre/application/cwmp/inc
diff options
context:
space:
mode:
authorYacine Belkadi2011-01-07 17:46:15 +0100
committerYacine Belkadi2011-01-18 17:38:13 +0100
commit820cdbefa1334b4a6bdced2f69081944cea11470 (patch)
tree327021a317f6536bf744fa848666e0b1c34e27b2 /cleopatre/application/cwmp/inc
parent6cf3caf30e73b5eb327a5fed43a4f47ae8b61129 (diff)
cleo/app/cwmp: in utils_run_command() replace system() by execvp()
The string passed to system() needs to be sanitized because it could contain anything. Particularly if some args come from user input. execvp(), on the other hand, allows to clearly specify the (one and only) command and the different arguments. This should be safer.
Diffstat (limited to 'cleopatre/application/cwmp/inc')
-rw-r--r--cleopatre/application/cwmp/inc/utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cleopatre/application/cwmp/inc/utils.h b/cleopatre/application/cwmp/inc/utils.h
index 672bbeec3f..5ce3a7a165 100644
--- a/cleopatre/application/cwmp/inc/utils.h
+++ b/cleopatre/application/cwmp/inc/utils.h
@@ -46,7 +46,7 @@ struct utils_net_if_stats
unsigned long tx_errors;
};
-int utils_run_command(const char *command);
+utils_status_t utils_run_command(const char *command, char * const argv[], int *exit_status);
utils_status_t utils_get_network_interface_stats(const char *network_interface_name, struct utils_net_if_stats *stats);
utils_status_t utils_get_oui(char *buffer, int buffer_size);
utils_status_t utils_get_software_version(char *buffer, int buffer_size);