You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewUserSaveException("Something went wrong (exit code: {$retval})");
}
Moving the full command to a variable (so it could be dumped in the exception) shows the generated command as being sudo usermod -G "sudo" -m newuser. It looks fine at first glance, but running that command in a shell reveals the error:
usermod: -m flag is only allowed with the -d flag
According to the options, -m in usermod is an alias of --move-home, which is likely not what we want! Where is that coming from?
It would also be worth capturing (or redirecting to stdout) the stderr output and logging it somewhere when there errors happen so we have a bit more info to go by in future.
The text was updated successfully, but these errors were encountered:
Looks like the frontend is always (or perhaps only when a dir is set) sending move_home: true with the request, which causes -m to be added via setMoveHome() in System\User:
setHomeDirectory() will ensure the home directory has changed before adding the -d option, but this check is not applied in setMoveHome() which is why we end up with a bad command.
After creating a new regular user in System > Users, attempts to add the
sudo
group to that user will fail.It's this chunk of code that's throwing, reporting "exit code 2":
servidor/app/System/User.php
Lines 123 to 128 in ddee8af
Moving the full command to a variable (so it could be dumped in the exception) shows the generated command as being
sudo usermod -G "sudo" -m newuser
. It looks fine at first glance, but running that command in a shell reveals the error:According to the options,
-m
in usermod is an alias of--move-home
, which is likely not what we want! Where is that coming from?It would also be worth capturing (or redirecting to
stdout
) thestderr
output and logging it somewhere when there errors happen so we have a bit more info to go by in future.The text was updated successfully, but these errors were encountered: