Hi, On 10/02/15 13:30, Lennart Poettering wrote: > On Sun, 08.02.15 22:21, Philippe De Swert ([email protected]) wrote: > >> In user_mkdir_runtime_path() there is no need to continue if the >> creation of the directory fails for whatever reason, as subsequent >> actions on that directory will fail anyway. >> >> Found with Coverity. Fixes: CID#1237538 >> --- >> src/login/logind-user.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/src/login/logind-user.c b/src/login/logind-user.c >> index 7b40ef5..a329457 100644 >> --- a/src/login/logind-user.c >> +++ b/src/login/logind-user.c >> @@ -322,7 +322,8 @@ static int user_mkdir_runtime_path(User *u) { >> if (path_is_mount_point(p, false) <= 0) { >> _cleanup_free_ char *t = NULL; >> >> - mkdir(p, 0700); >> + if(mkdir(p, 0700) < 0) >> + goto fail; > > No, it's completely OK if this fails, and it is very likely that it > *will* fail, since the dir might already exist, and we thus get > EEXIST.
True, I somehow always forget that is an error case too. However the "problem" is still there if creation fails, filesystem full/ro, ... Although I need to admit it is rather cosmetic as problems will be caught later anyway. Regards, Philippe _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
