Return user id if user found, otherwise return -1.
| 112 | |
| 113 | // Return user id if user found, otherwise return -1. |
| 114 | SLONG get_user_id(const TEXT* user_name) |
| 115 | { |
| 116 | MutexLockGuard guard(pwMutex, "get_user_id"); |
| 117 | |
| 118 | const struct passwd* user = getpwnam(user_name); |
| 119 | return user ? user->pw_uid : -1; |
| 120 | } |
| 121 | |
| 122 | // Fills the buffer with home directory if user found |
| 123 | bool get_user_home(int user_id, PathName& homeDir) |
no outgoing calls
no test coverage detected