Lines Matching refs:pwd
58 #include <pwd.h>
382 proc_maps(char *domain, struct passwd_entry *pwd)
391 ans = proc_map_list(map_list, domain, pwd, FALSE);
411 ans = proc_map_list(map_list, domain, pwd, TRUE);
433 struct passwd_entry *pwd, bool_t adjunct_flag)
442 if ((adjunct_flag) && (!pwd->adjunct)) {
473 if (0 != (ans = update_single_map(map_name, pwd, adjunct_flag)))
534 update_single_map(char *map_name, struct passwd_entry *pwd, bool_t adjunct_flag)
542 data.dptr = pwd->adjunct_str;
544 data.dptr = pwd->pwd_str;
550 key.dptr = pwd->pw_name;
552 key.dptr = pwd->pw_uid;
554 key.dptr = pwd->pw_gid;
802 decode_pwd_entry(datum *data, struct passwd_entry *pwd, bool_t adjunct)
815 if (NULL != pwd->pw_name)
816 sfree(pwd->pw_name);
818 pwd->pw_name = temp;
825 if (NULL != pwd->pw_passwd)
826 sfree(pwd->pw_passwd);
828 pwd->pw_passwd = temp;
832 pwd->adjunct_tail = am(myself, str_end - p + 1);
833 if (NULL == pwd->adjunct_tail)
835 strncpy(pwd->adjunct_tail, p, str_end - p);
836 pwd->adjunct_tail[str_end - p] = '\0';
839 pwd->adjunct = TRUE;
846 if (NULL == (p = get_next_token(p, &(pwd->pw_uid), str_end)))
850 if (NULL == (p = get_next_token(p, &(pwd->pw_gid), str_end)))
854 if (NULL == (p = get_next_token(p, &(pwd->pw_gecos), str_end)))
858 if (NULL == (p = get_next_token(p, &(pwd->pw_dir), str_end)))
862 get_next_token(p, &(pwd->pw_shell), str_end);
864 if (NULL == pwd->pw_shell)
937 free_pwd_entry(struct passwd_entry *pwd)
940 if (NULL != pwd->pw_name)
941 sfree(pwd->pw_name);
943 if (NULL != pwd->pw_passwd)
944 sfree(pwd->pw_passwd);
946 if (NULL != pwd->pw_gecos)
947 sfree(pwd->pw_gecos);
949 if (NULL != pwd->pw_shell)
950 sfree(pwd->pw_shell);
952 if (NULL != pwd->pw_dir)
953 sfree(pwd->pw_dir);
955 if (NULL != pwd->adjunct_tail)
956 sfree(pwd->adjunct_tail);
958 if (NULL != pwd->pwd_str)
959 sfree(pwd->pwd_str);
961 if (NULL != pwd->adjunct_str)
962 sfree(pwd->adjunct_str);
965 sfree(pwd);
980 create_pwd_str(struct passwd_entry *pwd, bool_t adjunct)
990 len = strlen(pwd->pw_name) + 1;
991 len += strlen(pwd->pw_passwd) + 1;
993 len += strlen(pwd->adjunct_tail) + 1;
995 len += strlen(pwd->pw_uid) + 1;
996 len += strlen(pwd->pw_gid) + 1;
997 len += strlen(pwd->pw_gecos) + 1;
998 len += strlen(pwd->pw_dir) + 1;
999 len += strlen(pwd->pw_shell) + 1;
1007 strcpy(s, pwd->pw_name);
1013 if (pwd->adjunct) {
1015 strcat(s, pwd->pw_name);
1017 strcat(s, pwd->pw_passwd);
1020 strcat(s, pwd->pw_uid);
1022 strcat(s, pwd->pw_gid);
1024 strcat(s, pwd->pw_gecos);
1026 strcat(s, pwd->pw_dir);
1028 strcat(s, pwd->pw_shell);
1031 strcat(s, pwd->pw_passwd);
1033 strcat(s, pwd->adjunct_tail);
1069 "Could not read old pwd for %s", name);
1076 logmsg(MSG_NOMEM, LOG_ERR, "Could not alloc for pwd decode");
1129 put_new_info(struct passwd_entry *pwd, char *domain)
1134 data.dptr = pwd->pwd_str;
1136 key.dptr = pwd->pw_name;
1144 if (pwd->adjunct) {
1145 data.dptr = pwd->adjunct_str;
1147 key.dptr = pwd->pw_name;