Lines Matching full:userinfo

39  * Frees userInfo structure. This implements the g_auto cleanup
132 * userInfo -> Information about the current user
137 static bool create_acl_user(PWindowsUserInfo userInfo, PACL *pACL, Error **errp) in create_acl_user() argument
145 bool converted = ConvertStringSidToSid(userInfo->SSID, &userPSID); in create_acl_user()
148 userInfo->username); in create_acl_user()
176 userInfo->username, setResult); in create_acl_user()
283 * userInfo -> pointer to structure that contains information about the user
289 static bool create_acl(PWindowsUserInfo userInfo, PACL *pACL, Error **errp) in create_acl() argument
303 if (!userInfo->isAdmin) { in create_acl()
304 if (!create_acl_user(userInfo, pACL, errp)) { in create_acl()
319 * userInfo -> Contains information about the user
323 static bool create_ssh_directory(WindowsUserInfo *userInfo, Error **errp) in create_ssh_directory() argument
329 if (!create_acl(userInfo, &pNewACL, errp)) { in create_ssh_directory()
355 BOOL created = CreateDirectory(userInfo->sshDirectory, &sAttr); in create_ssh_directory()
358 userInfo->sshDirectory); in create_ssh_directory()
373 * parameters: userInfo -> Information about the user
377 static bool set_file_permissions(PWindowsUserInfo userInfo, Error **errp) in set_file_permissions() argument
383 if (!create_acl(userInfo, &pACL, errp)) { in set_file_permissions()
388 bool converted = ConvertStringSidToSid(userInfo->SSID, &userPSID); in set_file_permissions()
391 userInfo->username); in set_file_permissions()
400 if (SetNamedSecurityInfo(userInfo->authorizedKeyFile, SE_FILE_OBJECT, in set_file_permissions()
405 userInfo->authorizedKeyFile); in set_file_permissions()
423 * userInfo: Information about the user we are writing the authkeys file to.
428 static bool write_authkeys(WindowsUserInfo *userInfo, GStrv authkeys, in write_authkeys() argument
436 if (!g_file_set_contents(userInfo->authorizedKeyFile, contents, -1, &err)) { in write_authkeys()
438 userInfo->authorizedKeyFile, err->message); in write_authkeys()
442 if (!set_file_permissions(userInfo, errp)) { in write_authkeys()
453 * userInfo -> Double pointer to a WindowsUserInfo structure. Upon success, it
459 static bool get_user_info(PWindowsUserInfo *userInfo, const char *username, in get_user_info() argument
481 *userInfo = uData; in get_user_info()
560 g_auto(PWindowsUserInfo) userInfo = NULL; in qmp_guest_ssh_get_authorized_keys()
563 if (!get_user_info(&userInfo, username, errp)) { in qmp_guest_ssh_get_authorized_keys()
568 authKeys = read_authkeys(userInfo->authorizedKeyFile, errp); in qmp_guest_ssh_get_authorized_keys()
606 g_auto(PWindowsUserInfo) userInfo = NULL; in qmp_guest_ssh_add_authorized_keys()
617 if (!get_user_info(&userInfo, username, errp)) { in qmp_guest_ssh_add_authorized_keys()
625 authkeys = read_authkeys(userInfo->authorizedKeyFile, NULL); in qmp_guest_ssh_add_authorized_keys()
629 if (!g_file_test(userInfo->sshDirectory, G_FILE_TEST_IS_DIR)) { in qmp_guest_ssh_add_authorized_keys()
630 BOOL success = create_ssh_directory(userInfo, errp); in qmp_guest_ssh_add_authorized_keys()
654 write_authkeys(userInfo, authkeys, errp); in qmp_guest_ssh_add_authorized_keys()
668 g_auto(PWindowsUserInfo) userInfo = NULL; in qmp_guest_ssh_remove_authorized_keys()
681 if (!get_user_info(&userInfo, username, errp)) { in qmp_guest_ssh_remove_authorized_keys()
686 authkeys = read_authkeys(userInfo->authorizedKeyFile, errp); in qmp_guest_ssh_remove_authorized_keys()
711 write_authkeys(userInfo, new_keys, errp); in qmp_guest_ssh_remove_authorized_keys()