Lines Matching refs:pwd
34 struct passwd *pwd, const char *real_name,
38 handle_getpw_result(enum nss_status status, struct passwd *pwd,
50 struct passwd *pwd;
73 pwd = talloc_zero(tmpctx, struct passwd);
74 if (!pwd) {
88 status = ctx->ops.getpwnam_r(shortname_or_alias, pwd, buffer, buflen, &ret);
89 ret = handle_getpw_result(status, pwd, dom, &del_user);
101 uid = pwd->pw_uid;
125 status = ctx->ops.getpwuid_r(uid, pwd, buffer, buflen, &ret);
126 ret = handle_getpw_result(status, pwd, dom, &del_user);
133 real_name = sss_create_internal_fqname(tmpctx, pwd->pw_name, dom->name);
146 ret = save_user(dom, pwd, real_name, i_name);
159 handle_getpw_result(enum nss_status status, struct passwd *pwd,
179 pwd->pw_name, pwd->pw_uid, pwd->pw_gid);
183 if (OUT_OF_ID_RANGE(pwd->pw_uid, dom->id_min, dom->id_max) ||
184 OUT_OF_ID_RANGE(pwd->pw_gid, dom->id_min, dom->id_max)) {
288 struct passwd *pwd,
297 if (pwd->pw_shell && pwd->pw_shell[0] != '\0') {
298 shell = pwd->pw_shell;
303 if (pwd->pw_gecos && pwd->pw_gecos[0] != '\0') {
304 gecos = pwd->pw_gecos;
317 pwd->pw_passwd,
318 pwd->pw_uid,
319 pwd->pw_gid,
321 pwd->pw_dir,
345 struct passwd *pwd;
360 pwd = talloc_zero(tmpctx, struct passwd);
361 if (!pwd) {
373 status = ctx->ops.getpwuid_r(uid, pwd, buffer, buflen, &ret);
374 ret = handle_getpw_result(status, pwd, dom, &del_user);
386 name = sss_create_internal_fqname(tmpctx, pwd->pw_name, dom->name);
389 pwd->pw_name);
392 ret = save_user(dom, pwd, name, NULL);
413 struct passwd *pwd;
430 pwd = talloc_zero(tmpctx, struct passwd);
431 if (!pwd) {
459 /* always zero out the pwd structure */
460 memset(pwd, 0, sizeof(struct passwd));
463 status = ctx->ops.getpwent_r(pwd, buffer, buflen, &ret);
500 pwd->pw_name, pwd->pw_uid, pwd->pw_gid);
505 if (OUT_OF_ID_RANGE(pwd->pw_uid, dom->id_min, dom->id_max) ||
506 OUT_OF_ID_RANGE(pwd->pw_gid, dom->id_min, dom->id_max)) {
509 " of range)\n", pwd->pw_name);
515 name = sss_create_internal_fqname(tmpctx, pwd->pw_name, dom->name);
519 pwd->pw_name);
522 ret = save_user(dom, pwd, name, NULL);
527 " Ignoring.\n", pwd->pw_name);
1195 struct passwd *pwd);
1205 struct passwd *pwd;
1227 pwd = talloc_zero(tmpctx, struct passwd);
1228 if (!pwd) {
1249 status = ctx->ops.getpwnam_r(shortname_or_alias, pwd,
1251 ret = handle_getpw_result(status, pwd, dom, &del_user);
1267 uid = pwd->pw_uid;
1291 status = ctx->ops.getpwuid_r(uid, pwd, buffer, buflen, &ret);
1292 ret = handle_getpw_result(status, pwd, dom, &del_user);
1299 real_name = sss_create_internal_fqname(tmpctx, pwd->pw_name, dom->name);
1315 ret = save_user(dom, pwd, real_name, i_name);
1321 ret = get_initgr_groups_process(tmpctx, ctx, sysdb, dom, pwd);
1350 struct passwd *pwd)
1373 gids[0] = pwd->pw_gid;
1379 status = ctx->ops.initgroups_dyn(pwd->pw_name, pwd->pw_gid, &num_gids,
1404 "primary group (%"SPRIgid")\n", pwd->pw_gid);
1408 "groups\n", pwd->pw_name, num_gids);