diff mbox

lib: framework: Improve message for results log file handling

Message ID 1468363194-31838-1-git-send-email-debmc@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Deb McLemore July 12, 2016, 10:39 p.m. UTC
When first creation of the results log is done
with root permissions, if subsequent non-root
user attempts to run tests which append to the
results log, the message can be improved to
suggest how to fix the problem or hints
on what the issue is for further diagnosis.

Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com>
---
 src/lib/src/fwts_framework.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Alex Hung July 13, 2016, 3:34 a.m. UTC | #1
On 2016-07-13 06:39 AM, Deb McLemore wrote:
> When first creation of the results log is done
> with root permissions, if subsequent non-root
> user attempts to run tests which append to the
> results log, the message can be improved to
> suggest how to fix the problem or hints
> on what the issue is for further diagnosis.
>
> Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com>
> ---
>   src/lib/src/fwts_framework.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index c53306a..9c2d3df 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -1520,7 +1520,10 @@ int fwts_framework_args(const int argc, char **argv)
>   			(fw->flags & FWTS_FLAG_FORCE_CLEAN) ? "w" : "a",
>   			fw->log_type)) == NULL) {
>   		ret = FWTS_ERROR;
> -		fprintf(stderr, "%s: Cannot open results log '%s'.\n", argv[0], fw->results_logname);
> +		fprintf(stderr, "%s: Cannot open results log '%s'"
> +			" (you may need to remove it to set proper"
> +			" permissions).\n",
> +			argv[0], fw->results_logname);
>   		goto tidy_close;
>   	}
>
>


Acked-by: Alex Hung <alex.hung@canonical.com>
Colin Ian King July 15, 2016, 9:17 a.m. UTC | #2
On 12/07/16 23:39, Deb McLemore wrote:
> When first creation of the results log is done
> with root permissions, if subsequent non-root
> user attempts to run tests which append to the
> results log, the message can be improved to
> suggest how to fix the problem or hints
> on what the issue is for further diagnosis.
> 
> Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com>
> ---
>  src/lib/src/fwts_framework.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index c53306a..9c2d3df 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -1520,7 +1520,10 @@ int fwts_framework_args(const int argc, char **argv)
>  			(fw->flags & FWTS_FLAG_FORCE_CLEAN) ? "w" : "a",
>  			fw->log_type)) == NULL) {
>  		ret = FWTS_ERROR;
> -		fprintf(stderr, "%s: Cannot open results log '%s'.\n", argv[0], fw->results_logname);
> +		fprintf(stderr, "%s: Cannot open results log '%s'"
> +			" (you may need to remove it to set proper"
> +			" permissions).\n",
> +			argv[0], fw->results_logname);
>  		goto tidy_close;
>  	}
>  
> 
Thanks Deb,

Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox

Patch

diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
index c53306a..9c2d3df 100644
--- a/src/lib/src/fwts_framework.c
+++ b/src/lib/src/fwts_framework.c
@@ -1520,7 +1520,10 @@  int fwts_framework_args(const int argc, char **argv)
 			(fw->flags & FWTS_FLAG_FORCE_CLEAN) ? "w" : "a",
 			fw->log_type)) == NULL) {
 		ret = FWTS_ERROR;
-		fprintf(stderr, "%s: Cannot open results log '%s'.\n", argv[0], fw->results_logname);
+		fprintf(stderr, "%s: Cannot open results log '%s'"
+			" (you may need to remove it to set proper"
+			" permissions).\n",
+			argv[0], fw->results_logname);
 		goto tidy_close;
 	}