Work-around a sub session creation issue 38/283338/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 24 Oct 2022 15:47:14 +0000 (17:47 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 24 Oct 2022 17:26:39 +0000 (19:26 +0200)
Seems to be a libsmack issue at a glance.

Change-Id: I10dfc7e3cbc83450d730eaf4d008ac33e9b50a4b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/service/src/fs_helpers.cpp

index 504cb9e4174f92af7cbc54f30919af8aeb1ead75..c11d797227483127357251187aa8fb81ad1ea6a9 100644 (file)
@@ -139,6 +139,15 @@ static int copy_label(auto label, auto dest_path, auto type)
                return 0;
        }
 
+       /* WORK-AROUND. It appears that for symlinks, ENOENT
+        * is returned instead of ENODATA but otherwise has
+        * the same meaning. We can be certain of the existence
+        * of the files because we wouldn't have reached here
+        * if creation failed, so don't bother checking for a
+        * false negative, and ignore this error. */
+       if (ret == -1 && errno == ENOENT)
+               return 0;
+
        return ret;
 }