diff options
Diffstat (limited to 'net/samba2/patches/patch-ap')
-rw-r--r-- | net/samba2/patches/patch-ap | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/samba2/patches/patch-ap b/net/samba2/patches/patch-ap index 207e1041f88..9e537b680af 100644 --- a/net/samba2/patches/patch-ap +++ b/net/samba2/patches/patch-ap @@ -1,9 +1,9 @@ -$NetBSD: patch-ap,v 1.1.1.1 2004/01/11 00:41:13 jlam Exp $ +$NetBSD: patch-ap,v 1.1.1.1.10.1 2005/06/08 01:29:22 snj Exp $ Expand & in the gecos field to a capitalized login name. ---- lib/util_getent.c.orig Sat Feb 2 19:46:42 2002 -+++ lib/util_getent.c Sun Oct 13 21:37:56 2002 +--- lib/util_getent.c.orig 2005-04-09 19:27:42.000000000 +0200 ++++ lib/util_getent.c 2005-04-09 19:35:09.000000000 +0200 @@ -155,6 +155,11 @@ struct sys_pwent *plist; struct sys_pwent *pent; @@ -14,7 +14,7 @@ Expand & in the gecos field to a capitalized login name. + int buflen; +#endif - pent = (struct sys_pwent *) malloc(sizeof(struct sys_pwent)); + pent = SMB_MALLOC_P(struct sys_pwent); if (pent == NULL) { @@ -178,9 +183,38 @@ pent->pw_uid = pwd->pw_uid; @@ -31,10 +31,10 @@ Expand & in the gecos field to a capitalized login name. + if (bp >= &buf[BUFLEN - 1]) + /* buffer overflow */ + goto gecos_done; -+ if (*p == '&') { ++ if (*p == '&') { + /* interpolate full name */ + snprintf(bp, BUFLEN - (bp - buf), -+ "%s", pwd->pw_name); ++ "%s", pwd->pw_name); + *bp = toupper(*bp); + bp += strlen(bp); + } @@ -42,16 +42,16 @@ Expand & in the gecos field to a capitalized login name. + *bp++ = *p; + } + *bp = '\0'; -+ if ((pent->pw_name = strdup(buf)) == NULL) ++ if ((pent->pw_name = SMB_STRDUP(buf)) == NULL) + goto err; +#else - if ((pent->pw_name = strdup(pwd->pw_gecos)) == NULL) + if ((pent->pw_name = SMB_STRDUP(pwd->pw_gecos)) == NULL) goto err; +#endif } +#ifdef BSD -+ gecos_done: ++ gecos_done: +#endif if (pwd->pw_dir) { - if ((pent->pw_name = strdup(pwd->pw_dir)) == NULL) + if ((pent->pw_name = SMB_STRDUP(pwd->pw_dir)) == NULL) goto err; |