search for: passwd_fd

Displaying 3 results from an estimated 3 matches for "passwd_fd".

Did you mean: passwd_1
2003 May 19
0
[PATCH] getpwnam() implementation in tftpd.c
...passwd.pw_gid = (gid_t) strtoul(gid_ptr, &endptr, 10); + if (*endptr != '\0') + goto restart; + + passwd.pw_uid = (uid_t) strtoul(uid_ptr, &endptr, 10); + if (*endptr != '\0') + goto restart; + + return &passwd; +} + +struct passwd *getpwnam(const char *name) +{ + int passwd_fd; + struct passwd *passwd; + + if (name == NULL) { + errno = EINVAL; + return NULL; + } + + if ((passwd_fd = open("/etc/passwd", O_RDONLY)) < 0) + return NULL; + + while ((passwd = __getpwent(passwd_fd)) != NULL) + if (!strcmp(passwd->pw_name, name)) { + close(passwd_fd); + r...
1998 Sep 08
0
security bug in 2.4.1
...tely, it is *really* from the command-line, i.e., getpass() will read from /dev/tty, not stdin or such. Unless we do some pty magic, we won't be able to feed smbclient a password this way. Maybe the best bet is to support environment variables PASSWD_FILE (read password from this file) and/or PASSWD_FD (read it from the given file descriptor). I'd prefer the latter, because creating temporary files containing passwords is always dangerous. What do SAMBA people think? There's another SAMBA issue that has bothered me for a while: `Total bytes listed' will only be printed if `dir'...
1998 Nov 24
0
source/client/client.c : redundant calls to getenv()
...memset(strchr(user,'%')+1,'X',strlen(password\)); } /* modification to support PASSWD environmental var 25.Aug.97, jdblair@uab.edu */ if ((user=getenv("PASSWD"))) { pstrcpy(password,user); got_pass = True; } if ((user=getenv("PASSWD_FD")) { get_password_file(user); got_pass = True; } else if ((user=getenv("PASSWD_FILE")) { get_password_file(user); got_pass = True; } if (*username == 0 && (user=getenv("LOGNAME"))) { pstrcpy(username,user); strupper(username); } Also, I d...