diff options
| author | 2023-10-13 06:33:12 +0200 | |
|---|---|---|
| committer | 2023-10-13 06:33:12 +0200 | |
| commit | 253e7f9eaa3f3279f2a8639949f74acf0797de33 (patch) | |
| tree | bb7ff4868154bdad2325c27fdd0b4c55083dd5f4 /snac.c | |
| parent | Updated TODO. (diff) | |
| download | snac2-253e7f9eaa3f3279f2a8639949f74acf0797de33.tar.gz snac2-253e7f9eaa3f3279f2a8639949f74acf0797de33.tar.xz snac2-253e7f9eaa3f3279f2a8639949f74acf0797de33.zip | |
Don't allow creating users which user name strings only differ in case.
Diffstat (limited to 'snac.c')
| -rw-r--r-- | snac.c | 3 |
1 files changed, 3 insertions, 0 deletions
| @@ -79,6 +79,9 @@ double ftime(void) | |||
| 79 | int validate_uid(const char *uid) | 79 | int validate_uid(const char *uid) |
| 80 | /* returns if uid is a valid identifier */ | 80 | /* returns if uid is a valid identifier */ |
| 81 | { | 81 | { |
| 82 | if (!uid || *uid == '\0') | ||
| 83 | return 0; | ||
| 84 | |||
| 82 | while (*uid) { | 85 | while (*uid) { |
| 83 | if (!(isalnum(*uid) || *uid == '_')) | 86 | if (!(isalnum(*uid) || *uid == '_')) |
| 84 | return 0; | 87 | return 0; |