1 diff -Nru rpm-4.1/lib/rpmrc.c rpm-4.1.new/lib/rpmrc.c
2 --- rpm-4.1/lib/rpmrc.c Tue Aug 20 16:53:44 2002
3 +++ rpm-4.1.new/lib/rpmrc.c Tue Mar 11 18:41:48 2003
4 @@ -1756,27 +1756,39 @@
5 /* Expand ~/ to $HOME/ */
7 if (r[0] == '~' && r[1] == '/') {
8 + const char * etc_dir = getenv("HOME_ETC");
9 const char * home = getenv("HOME");
12 + if (strlen(etc_dir) > (sizeof(fn) - strlen(r))) {
13 + rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME_ETC is too large.\n"),r);
17 + strcpy(fn, etc_dir);
18 + strncat(fn, "/", sizeof(fn) - strlen(fn));
23 /* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */
24 - if (rcfiles == defrcfiles && myrcfiles != r)
26 - rpmError(RPMERR_RPMRC, _("Cannot expand %s\n"), r);
30 - if (strlen(home) > (sizeof(fn) - strlen(r))) {
31 - rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
32 + if (rcfiles == defrcfiles && myrcfiles != r)
34 + rpmError(RPMERR_RPMRC, _("Cannot expand %s\n"), r);
38 + if (strlen(home) > (sizeof(fn) - strlen(r))) {
39 + rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
47 - strncat(fn, r, sizeof(fn) - (strlen(fn) + 1));
48 - fn[sizeof(fn)-1] = '\0';
57 + strncat(fn, r, sizeof(fn) - (strlen(fn) + 1));
58 + fn[sizeof(fn)-1] = '\0';
59 /* Read another rcfile */
60 fd = Fopen(fn, "r.fpio");
61 if (fd == NULL || Ferror(fd)) {
62 diff -Nru rpm-4.1/rpmio/macro.c rpm-4.1.new/rpmio/macro.c
63 --- rpm-4.1/rpmio/macro.c Tue Sep 17 14:58:23 2002
64 +++ rpm-4.1.new/rpmio/macro.c Tue Mar 11 18:21:59 2003
65 @@ -1614,15 +1614,22 @@
67 if (mfile[0] == '~' && mfile[1] == '/') {
69 - if ((home = getenv("HOME")) != NULL) {
71 - strncpy(buf, home, sizeof(buf));
72 - strncat(buf, "/", sizeof(buf) - strlen(buf));
73 + char *etc_dir = getenv("HOME_ETC");
77 + strncpy(buf, etc_dir, sizeof(buf));
78 + strncat(buf, "/", sizeof(buf) - strlen(buf));
80 + if ((home = getenv("HOME")) != NULL) {
82 + strncpy(buf, home, sizeof(buf));
83 + strncat(buf, "/", sizeof(buf) - strlen(buf));
87 strncat(buf, mfile, sizeof(buf) - strlen(buf));
88 buf[sizeof(buf)-1] = '\0';
90 fd = Fopen(buf, "r.fpio");
91 if (fd == NULL || Ferror(fd)) {
92 if (fd) (void) Fclose(fd);
93 --- rpm-4.3/po/pl.po.orig 2003-06-10 23:59:11.000000000 +0200
94 +++ rpm-4.3/po/pl.po 2003-06-11 00:06:16.000000000 +0200
95 @@ -2834,6 +2834,10 @@
96 msgid "Please contact rpm-list@redhat.com\n"
97 msgstr "Proszê skontaktowaæ siê z rpm-list@redhat.com\n"
100 +msgid "Cannot read %s, HOME_ETC is too large.\n"
101 +msgstr "Nie mo¿na odczytaæ %s, HOME_ETC jest zbyt du¿e.\n"
105 msgid "Cannot expand %s\n"