Include default user in `GetUserList` call 25/277725/2
authorAdam Michalski <a.michalski2@partner.samsung.com>
Tue, 12 Jul 2022 11:32:26 +0000 (13:32 +0200)
committerArkadiusz Nowak <a.nowak3@samsung.com>
Tue, 12 Jul 2022 12:19:05 +0000 (14:19 +0200)
Change-Id: I9e2319615f06e2896157adba0c8545c2e41fffdc

sessiond/src/fs_helpers.cpp

index d890de3..298c705 100644 (file)
@@ -284,7 +284,7 @@ fs::path fs_helpers::get_subsession_dir_by_uid(const int session_uid)
 std::vector<std::string> fs_helpers::get_user_list(const int session_uid) try
 {
        auto const subsession_path = get_subsession_dir_by_uid(session_uid);
-       std::vector<std::string> subsessions;
+       std::vector<std::string> subsessions = { SUBSESSION_INITIAL_SID };
 
        /* NB: the `subsession` folder may not exist if no
         * subsessions have been created before. */
@@ -302,6 +302,8 @@ std::vector<std::string> fs_helpers::get_user_list(const int session_uid) try
        }
 
        return subsessions;
+} catch (std::runtime_error &ex) {
+       return {};
 } catch (std::exception const &ex) {
        std::cerr << "Exception " << ex.what() << std::endl
                << "while enumerating user subsessions [session_uid="