We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e86dd1c commit 99f763cCopy full SHA for 99f763c
Userland/Utilities/usermod.cpp
@@ -27,7 +27,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
27
TRY(Core::System::pledge("stdio wpath rpath cpath fattr tty"));
28
TRY(Core::System::unveil("/etc", "rwc"));
29
30
- int uid = 0;
+ uid_t uid = 0;
31
int gid = 0;
32
bool lock = false;
33
bool unlock = false;
@@ -75,12 +75,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
75
unveil(nullptr, nullptr);
76
77
if (uid) {
78
- if (uid < 0) {
79
- warnln("invalid uid {}", uid);
80
- return 1;
81
- }
82
-
83
- if (getpwuid(static_cast<uid_t>(uid))) {
+ if (getpwuid(uid)) {
84
warnln("uid {} already exists", uid);
85
return 1;
86
}
0 commit comments