347
if (user_is_excluded (daemon, username, daemon->priv->minimal_uid)) {
348
pw = getpwnam (username);
350
if (user_is_excluded (daemon, username, pw->pw_uid)) {
348
351
g_debug ("excluding user '%s'", username);
349
352
g_free (username);
1104
1107
argv[1] = "-m";
1105
1108
argv[2] = "-c";
1106
1109
argv[3] = cd->real_name;
1110
argv[4] = cd->user_name;
1114
if (!spawn_with_login_uid (context, argv, &error)) {
1115
throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message);
1116
g_error_free (error);
1107
1120
if (cd->account_type == ACCOUNT_TYPE_ADMINISTRATOR) {
1110
argv[6] = cd->user_name;
1113
else if (cd->account_type == ACCOUNT_TYPE_STANDARD) {
1114
argv[6] = cd->user_name;
1118
throw_error (context, ERROR_FAILED, "Don't know how to add user of type %d", cd->account_type);
1123
if (!spawn_with_login_uid (context, argv, &error)) {
1124
throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message);
1125
g_error_free (error);
1121
add_user_to_group (context, cd->user_name, "admin");
1123
if (cd->account_type == ACCOUNT_TYPE_ADMINISTRATOR ||
1124
cd->account_type == ACCOUNT_TYPE_STANDARD) {
1125
add_user_to_group (context, cd->user_name, "audio");
1126
add_user_to_group (context, cd->user_name, "cdrom");
1127
add_user_to_group (context, cd->user_name, "dialout");
1128
add_user_to_group (context, cd->user_name, "plugdev");
1129
1131
user = daemon_local_find_user_by_name (daemon, cd->user_name);