.
OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=91
This commit is contained in:
parent
988eb15320
commit
86ebc7a3f6
125
bash-4.2-endpw.dif
Normal file
125
bash-4.2-endpw.dif
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
--- bashline.c
|
||||||
|
+++ bashline.c 2011-11-11 13:22:00.119146416 +0000
|
||||||
|
@@ -2148,10 +2148,10 @@ bash_groupname_completion_function (text
|
||||||
|
if (gnamelen == 0 || (STREQN (gname, grent->gr_name, gnamelen)))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
+ endgrent ();
|
||||||
|
|
||||||
|
if (grent == 0)
|
||||||
|
{
|
||||||
|
- endgrent ();
|
||||||
|
return ((char *)NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
--- examples/loadables/finfo.c
|
||||||
|
+++ examples/loadables/finfo.c 2011-11-11 13:21:12.319218165 +0000
|
||||||
|
@@ -269,9 +269,11 @@ struct stat *st;
|
||||||
|
printmode((int) st->st_mode);
|
||||||
|
printf("Link count: %d\n", (int) st->st_nlink);
|
||||||
|
pw = getpwuid(st->st_uid);
|
||||||
|
+ endpwent();
|
||||||
|
owner = pw ? pw->pw_name : "unknown";
|
||||||
|
printf("Uid of owner: %d (%s)\n", (int) st->st_uid, owner);
|
||||||
|
gr = getgrgid(st->st_gid);
|
||||||
|
+ endgrent();
|
||||||
|
owner = gr ? gr->gr_name : "unknown";
|
||||||
|
printf("Gid of owner: %d (%s)\n", (int) st->st_gid, owner);
|
||||||
|
printf("Device type: %d\n", (int) st->st_rdev);
|
||||||
|
@@ -348,12 +350,14 @@ int flags;
|
||||||
|
printf("%o\n", getperm(st->st_mode) & pmask);
|
||||||
|
else if (flags & OPT_UID) {
|
||||||
|
pw = getpwuid(st->st_uid);
|
||||||
|
+ endpwent();
|
||||||
|
if (flags & OPT_ASCII)
|
||||||
|
printf("%s\n", pw ? pw->pw_name : "unknown");
|
||||||
|
else
|
||||||
|
printf("%d\n", st->st_uid);
|
||||||
|
} else if (flags & OPT_GID) {
|
||||||
|
gr = getgrgid(st->st_gid);
|
||||||
|
+ endgrent();
|
||||||
|
if (flags & OPT_ASCII)
|
||||||
|
printf("%s\n", gr ? gr->gr_name : "unknown");
|
||||||
|
else
|
||||||
|
--- examples/loadables/id.c
|
||||||
|
+++ examples/loadables/id.c 2011-11-11 13:19:36.515148229 +0000
|
||||||
|
@@ -42,6 +42,7 @@
|
||||||
|
|
||||||
|
#if !defined (HAVE_GETPW_DECLS)
|
||||||
|
extern struct passwd *getpwuid ();
|
||||||
|
+extern void endpwent ();
|
||||||
|
#endif
|
||||||
|
extern struct group *getgrgid ();
|
||||||
|
|
||||||
|
@@ -146,6 +147,7 @@ inituser (uname)
|
||||||
|
builtin_error ("%s: no such user", uname);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
+ endpwent ();
|
||||||
|
ruid = euid = pwd->pw_uid;
|
||||||
|
rgid = egid = pwd->pw_gid;
|
||||||
|
}
|
||||||
|
@@ -173,6 +175,7 @@ id_pruser (uid)
|
||||||
|
pwd = getpwuid (uid);
|
||||||
|
if (pwd == NULL)
|
||||||
|
r = 1;
|
||||||
|
+ endpwent ();
|
||||||
|
}
|
||||||
|
if (pwd)
|
||||||
|
printf ("%s", pwd->pw_name);
|
||||||
|
@@ -197,6 +200,7 @@ id_prgrp (gid)
|
||||||
|
grp = getgrgid (gid);
|
||||||
|
if (grp == NULL)
|
||||||
|
r = 1;
|
||||||
|
+ endgrent ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (grp)
|
||||||
|
@@ -307,6 +311,8 @@ id_prall (uname)
|
||||||
|
else
|
||||||
|
printf ("(%s)", grp->gr_name);
|
||||||
|
}
|
||||||
|
+ endpwent ();
|
||||||
|
+ endgrent ();
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
--- lib/tilde/shell.c
|
||||||
|
+++ lib/tilde/shell.c 2011-11-11 13:12:35.932960442 +0000
|
||||||
|
@@ -45,7 +45,12 @@
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
|
#if !defined (HAVE_GETPW_DECLS)
|
||||||
|
+# if defined (HAVE_GETPWUID)
|
||||||
|
extern struct passwd *getpwuid ();
|
||||||
|
+# endif
|
||||||
|
+# if defined (HAVE_GETPWENT)
|
||||||
|
+extern void endpwent ();
|
||||||
|
+# endif
|
||||||
|
#endif /* !HAVE_GETPW_DECLS */
|
||||||
|
|
||||||
|
char *
|
||||||
|
@@ -62,8 +67,13 @@ get_home_dir ()
|
||||||
|
struct passwd *entry;
|
||||||
|
|
||||||
|
home_dir = (char *)NULL;
|
||||||
|
+#if defined (HAVE_GETPWUID)
|
||||||
|
entry = getpwuid (getuid ());
|
||||||
|
if (entry)
|
||||||
|
home_dir = entry->pw_dir;
|
||||||
|
+#endif
|
||||||
|
+#if defined (HAVE_GETPWENT)
|
||||||
|
+ endpwent ();
|
||||||
|
+#endif
|
||||||
|
return (home_dir);
|
||||||
|
}
|
||||||
|
--- lib/tilde/tilde.c
|
||||||
|
+++ lib/tilde/tilde.c 2011-11-11 13:10:07.375646928 +0000
|
||||||
|
@@ -61,6 +61,7 @@ extern struct passwd *getpwuid PARAMS((u
|
||||||
|
# endif
|
||||||
|
# if defined (HAVE_GETPWNAM)
|
||||||
|
extern struct passwd *getpwnam PARAMS((const char *));
|
||||||
|
+extern void endpwent ();
|
||||||
|
# endif
|
||||||
|
#endif /* !HAVE_GETPW_DECLS */
|
||||||
|
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Nov 11 13:45:40 UTC 2011 - werner@suse.de
|
||||||
|
|
||||||
|
- Always close get(pw|gr)func with endpw() respectivly with endgr()
|
||||||
|
to avoid memory mapped passwd/groups of cache files from nscd
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Nov 2 08:23:24 UTC 2011 - werner@suse.de
|
Wed Nov 2 08:23:24 UTC 2011 - werner@suse.de
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ Patch2: bash-4.0-security.patch
|
|||||||
Patch3: bash-4.2-2.4.4.patch
|
Patch3: bash-4.2-2.4.4.patch
|
||||||
Patch4: bash-3.0-evalexp.patch
|
Patch4: bash-3.0-evalexp.patch
|
||||||
Patch5: bash-3.0-warn-locale.patch
|
Patch5: bash-3.0-warn-locale.patch
|
||||||
|
Patch6: bash-4.2-endpw.dif
|
||||||
Patch7: bash-3.0-decl.patch
|
Patch7: bash-3.0-decl.patch
|
||||||
Patch8: bash-4.0-async-bnc523667.dif
|
Patch8: bash-4.0-async-bnc523667.dif
|
||||||
Patch9: bash-4.0-extended_quote.patch
|
Patch9: bash-4.0-extended_quote.patch
|
||||||
@ -74,6 +75,7 @@ Patch21: readline-4.3-input.dif
|
|||||||
Patch22: readline-6.1-wrap.patch
|
Patch22: readline-6.1-wrap.patch
|
||||||
Patch23: readline-5.2-conf.patch
|
Patch23: readline-5.2-conf.patch
|
||||||
Patch24: readline-6.2-metamode.patch
|
Patch24: readline-6.2-metamode.patch
|
||||||
|
Patch25: readline-6.2-endpw.dif
|
||||||
Patch30: readline-6.2-destdir.patch
|
Patch30: readline-6.2-destdir.patch
|
||||||
Patch40: bash-4.1-bash.bashrc.dif
|
Patch40: bash-4.1-bash.bashrc.dif
|
||||||
Patch46: man2html-no-timestamp.patch
|
Patch46: man2html-no-timestamp.patch
|
||||||
@ -270,6 +272,7 @@ unset p
|
|||||||
%patch3 -p0 -b .2.4.4
|
%patch3 -p0 -b .2.4.4
|
||||||
%patch4 -p0 -b .evalexp
|
%patch4 -p0 -b .evalexp
|
||||||
%patch5 -p0 -b .warnlc
|
%patch5 -p0 -b .warnlc
|
||||||
|
%patch6 -p0 -b .endpw
|
||||||
%patch7 -p0 -b .decl
|
%patch7 -p0 -b .decl
|
||||||
%patch8 -p0 -b .async
|
%patch8 -p0 -b .async
|
||||||
%patch9 -p0 -b .extended_quote
|
%patch9 -p0 -b .extended_quote
|
||||||
@ -284,6 +287,7 @@ unset p
|
|||||||
%patch22 -p0 -b .wrap
|
%patch22 -p0 -b .wrap
|
||||||
%patch23 -p0 -b .conf
|
%patch23 -p0 -b .conf
|
||||||
%patch24 -p0 -b .metamode
|
%patch24 -p0 -b .metamode
|
||||||
|
%patch25 -p0 -b .endpw
|
||||||
%patch40 -p0 -b .bashrc
|
%patch40 -p0 -b .bashrc
|
||||||
%patch46 -p0 -b .notimestamp
|
%patch46 -p0 -b .notimestamp
|
||||||
%patch0 -p0 -b .0
|
%patch0 -p0 -b .0
|
||||||
@ -297,6 +301,7 @@ done
|
|||||||
%patch22 -p2 -b .wrap
|
%patch22 -p2 -b .wrap
|
||||||
%patch23 -p2 -b .conf
|
%patch23 -p2 -b .conf
|
||||||
%patch24 -p2 -b .metamode
|
%patch24 -p2 -b .metamode
|
||||||
|
%patch25 -p2 -b .endpw
|
||||||
%patch30 -p0 -b .destdir
|
%patch30 -p0 -b .destdir
|
||||||
%patch20 -p0 -b .0
|
%patch20 -p0 -b .0
|
||||||
|
|
||||||
|
65
readline-6.2-endpw.dif
Normal file
65
readline-6.2-endpw.dif
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
--- lib/readline/complete.c
|
||||||
|
+++ lib/readline/complete.c 2011-11-11 13:16:05.635147670 +0000
|
||||||
|
@@ -83,6 +83,7 @@ typedef int QSFUNC ();
|
||||||
|
defined. */
|
||||||
|
#if defined (HAVE_GETPWENT) && (!defined (HAVE_GETPW_DECLS) || defined (_POSIX_SOURCE))
|
||||||
|
extern struct passwd *getpwent PARAMS((void));
|
||||||
|
+extern void endpwent ();
|
||||||
|
#endif /* HAVE_GETPWENT && (!HAVE_GETPW_DECLS || _POSIX_SOURCE) */
|
||||||
|
|
||||||
|
/* If non-zero, then this is the address of a function to call when
|
||||||
|
@@ -2049,12 +2050,12 @@ rl_username_completion_function (text, s
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+#if defined (HAVE_GETPWENT)
|
||||||
|
+ endpwent ();
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
if (entry == 0)
|
||||||
|
{
|
||||||
|
-#if defined (HAVE_GETPWENT)
|
||||||
|
- endpwent ();
|
||||||
|
-#endif
|
||||||
|
return ((char *)NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
--- lib/readline/shell.c
|
||||||
|
+++ lib/readline/shell.c 2011-11-11 13:14:02.683147026 +0000
|
||||||
|
@@ -61,9 +61,14 @@
|
||||||
|
#include "rlshell.h"
|
||||||
|
#include "xmalloc.h"
|
||||||
|
|
||||||
|
-#if defined (HAVE_GETPWUID) && !defined (HAVE_GETPW_DECLS)
|
||||||
|
+#if !defined (HAVE_GETPW_DECLS)
|
||||||
|
+# if defined (HAVE_GETPWUID)
|
||||||
|
extern struct passwd *getpwuid PARAMS((uid_t));
|
||||||
|
-#endif /* HAVE_GETPWUID && !HAVE_GETPW_DECLS */
|
||||||
|
+# endif
|
||||||
|
+# if defined (HAVE_GETPWENT)
|
||||||
|
+extern void endpwent ();
|
||||||
|
+# endif
|
||||||
|
+#endif /* !HAVE_GETPW_DECLS */
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
# define NULL 0
|
||||||
|
@@ -168,6 +173,9 @@ sh_get_home_dir ()
|
||||||
|
if (entry)
|
||||||
|
home_dir = entry->pw_dir;
|
||||||
|
#endif
|
||||||
|
+#if defined (HAVE_GETPWENT)
|
||||||
|
+ endpwent ();
|
||||||
|
+#endif
|
||||||
|
return (home_dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
--- lib/readline/tilde.c
|
||||||
|
+++ lib/readline/tilde.c 2011-11-11 13:09:48.843646721 +0000
|
||||||
|
@@ -61,6 +61,7 @@ extern struct passwd *getpwuid PARAMS((u
|
||||||
|
# endif
|
||||||
|
# if defined (HAVE_GETPWNAM)
|
||||||
|
extern struct passwd *getpwnam PARAMS((const char *));
|
||||||
|
+extern void endpwent ();
|
||||||
|
# endif
|
||||||
|
#endif /* !HAVE_GETPW_DECLS */
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user