Hi...

The following patches from Massimo have been applied to the source
tree, but there are a couple that I haven't applied (ie. a Makefile patch),
and one that I applied, but would like comments on...
On Tue, 21 Jan 1997, Massimo Dal Zotto wrote:

The first patch changes the behavior of aclcheck for groups. Currently an user
can access a table only if he has the required permission for ALL the groups
defined for that table. With my patch he can access a table if he has the
permission for ONE of the groups, which seems to me a more useful thing.
If you think this should be the correct behavior of the acl group check feel
free to remove the #ifdef, if not please add a commented line to config.h.
Applied...right now, as stated, its #ifdef'd, and in config.h, its
turned on by default. Comments on whether this is good, bad, should be
"standard"?
The second patch adds a more explicative error message to BufferPoolCheckLeak.
It should be completely harmless.
Applied, don't see any problems with it myself...
The third patch corrects a bug in the libpq Makefile which prevents the
correct linking of libpgtcl (at least on my linux box). The latest versions
of linux ld search the input libraries only with the suffix .so, and if
libpq is not accessible under that suffix it is not linked in and the
dynamic load from Tcl fails.
This is the Makefile one that I won't touch...Bryan?
The last patch fixes some incongruences in the #define used to compile the
Tcl arrays support. Here are the correct values to be defined in config.h
and pgtclCmds.c.
Again, the source patches are applied, but haven't touched the
Makefile patch. Its another one of those "Linux-related" issues :(
--- acl-group.patch ----------------------------------------------------------
*** src/backend/tcop/aclchk.c.orig Tue Jul 9 08:21:59 1996
--- src/backend/tcop/aclchk.c Wed Nov 20 23:16:27 1996
***************
*** 287,292 ****
--- 290,301 ----
i < num && aip->ai_idtype == ACL_IDTYPE_GID;
++i, ++aip) {
if (in_group(id, aip->ai_id)) {
+ #ifdef ACLGROUP_PATCH
+ if (aip->ai_mode & mode) {
+ found_group = 1;
+ break;
+ }
+ #else
if (aip->ai_mode & mode)
++found_group;
else {
***************
*** 296,301 ****
--- 305,311 ----
#endif
return(0);
}
+ #endif
}
}
if (found_group) {
------------------------------------------------------------------------------


--- buffer-pool-check.patch --------------------------------------------------
*** src/backend/storage/buffer/bufmgr.c.orig Fri Nov 8 06:58:11 1996
--- src/backend/storage/buffer/bufmgr.c Fri Jan 3 12:22:18 1997
***************
*** 1041,1054 ****
BufferPoolCheckLeak()
{
register int i;
void PrintBufferDescs();

for (i = 1; i <= NBuffers; i++) {
if (BufferIsValid(i)) {
! elog(NOTICE, "buffer leak detected in BufferPoolCheckLeak()");
! PrintBufferDescs();
! return(1);
}
}
return(0);
}
--- 1041,1060 ----
BufferPoolCheckLeak()
{
register int i;
+ int error = 0;
void PrintBufferDescs();

for (i = 1; i <= NBuffers; i++) {
if (BufferIsValid(i)) {
! elog(NOTICE,
! "buffer leak [%d] detected in BufferPoolCheckLeak()",
! i-1);
! error = 1;
}
+ }
+ if (error) {
+ PrintBufferDescs();
+ return(1);
}
return(0);
}
------------------------------------------------------------------------------


--- libpq-makefile.patch -----------------------------------------------------
*** src/libpq/Makefile.orig Mon Jan 20 06:01:48 1997
--- src/libpq/Makefile Tue Jan 21 19:28:43 1997
***************
*** 62,67 ****
--- 62,69 ----

libpq.so.1: $(OBJS)
gcc $(LDFLAGS) -shared -o $@ $(OBJS)
+ rm -f libpq.so
+ ln -s libpq.so.1 libpq.so

c.h: ../include/c.h
rm -f c.h
***************
*** 130,135 ****
--- 132,139 ----

install-shlib: $(shlib)
$(INSTALL) $(INSTL_LIB_OPTS) $(shlib) $(DESTDIR)$(LIBDIR)/$(shlib)
+ rm -f $(DESTDIR)$(LIBDIR)/libpq.so
+ ln -s libpq.so.1 $(DESTDIR)$(LIBDIR)/libpq.so

depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend
------------------------------------------------------------------------------


--- libpgtcl.patch -----------------------------------------------------------
*** src/libpgtcl/Makefile.orig Sat Jan 11 00:01:59 1997
--- src/libpgtcl/Makefile Tue Jan 21 19:54:01 1997
***************
*** 75,81 ****

install-shlib: libpgtcl.so.1
$(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.so.1 \
! $(DESTDIR)$(LIBDIR)/libpgtcl.so
rm -f $(DESTDIR)$(LIBDIR)/libpgtcl.so
ln -s libpgtcl.so.1 $(DESTDIR)$(LIBDIR)/libpgtcl.so

--- 75,81 ----

install-shlib: libpgtcl.so.1
$(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.so.1 \
! $(DESTDIR)$(LIBDIR)/libpgtcl.so.1
rm -f $(DESTDIR)$(LIBDIR)/libpgtcl.so
ln -s libpgtcl.so.1 $(DESTDIR)$(LIBDIR)/libpgtcl.so

*** src/libpgtcl/pgtclCmds.c.orig Sat Jan 11 18:01:54 1997
--- src/libpgtcl/pgtclCmds.c Tue Jan 21 19:57:13 1997
***************
*** 43,49 ****
{
register char c, *q, *s;

! #ifdef DEBUG_ESCAPE
printf(" escape = '%s'\n", p);
#endif
/* Address of the first character after the escape sequence */
--- 43,49 ----
{
register char c, *q, *s;

! #ifdef TCL_ARRAYS_DEBUG_ESCAPE
printf(" escape = '%s'\n", p);
#endif
/* Address of the first character after the escape sequence */
***************
*** 125,131 ****
*q++ = *s++;
}
*q = '\0';
! #ifdef DEBUG_ESCAPE
printf(" after = '%s'\n", p);
#endif
return p;
--- 125,131 ----
*q++ = *s++;
}
*q = '\0';
! #ifdef TCL_ARRAYS_DEBUG_ESCAPE
printf(" after = '%s'\n", p);
#endif
return p;
***************
*** 143,155 ****
tcl_value (char *value)
{
int literal, last;
! register char c, *p, *q, *s;

if (!value) {
return ((char *) NULL);
}

! #ifdef DEBUG
printf("pq_value = '%s'\n", value);
#endif
last = strlen(value)-1;
--- 143,155 ----
tcl_value (char *value)
{
int literal, last;
! register char *p;

if (!value) {
return ((char *) NULL);
}

! #ifdef TCL_ARRAYS_DEBUG
printf("pq_value = '%s'\n", value);
#endif
last = strlen(value)-1;
***************
*** 202,208 ****
}
}
}
! #ifdef DEBUG
printf("tcl_value = '%s'\n\n", value);
#endif
return (value);
--- 202,208 ----
}
}
}
! #ifdef TCL_ARRAYS_DEBUG
printf("tcl_value = '%s'\n\n", value);
#endif
return (value);
*** src/include/config.h.orig Wed Jan 15 06:01:21 1997
--- src/include/config.h Tue Jan 21 19:46:19 1997
***************
*** 319,325 ****
* of postgres C-like arrays, for example {{"a1" "a2"} {"b1" "b2"}} instead
* of {{"a1","a2"},{"b1","b2"}}.
*/
! #define TCL_ARRAY

/*
* The comparison routines for text and char data type give incorrect results
--- 319,325 ----
* of postgres C-like arrays, for example {{"a1" "a2"} {"b1" "b2"}} instead
* of {{"a1","a2"},{"b1","b2"}}.
*/
! #define TCL_ARRAYS

/*
* The comparison routines for text and char data type give incorrect results
------------------------------------------------------------------------------


--
Massimo

+----------------------------------------------------------------------+
Massimo Dal Zotto e-mail: dz@cs.unitn.it |
Via Marconi, 141 phone/fax: ++39-461-534251 |
38057 Pergine Valsugana (TN) pgp: finger dz@tango.cs.unitn.it |
Italy |
+----------------------------------------------------------------------+
------------------------------

Search Discussions

  • Massimo Dal Zotto at Jan 23, 1997 at 9:51 pm

    Hi...

    The following patches from Massimo have been applied to the source
    tree, but there are a couple that I haven't applied (ie. a Makefile patch),
    and one that I applied, but would like comments on...
    ...
    The third patch corrects a bug in the libpq Makefile which prevents the
    correct linking of libpgtcl (at least on my linux box). The latest versions
    of linux ld search the input libraries only with the suffix .so, and if
    libpq is not accessible under that suffix it is not linked in and the
    dynamic load from Tcl fails.
    This is the Makefile one that I won't touch...Bryan?
    The last patch fixes some incongruences in the #define used to compile the
    Tcl arrays support. Here are the correct values to be defined in config.h
    and pgtclCmds.c.
    Again, the source patches are applied, but haven't touched the
    Makefile patch. Its another one of those "Linux-related" issues :(
    ...
    --- libpq-makefile.patch -------------------------------------------------
    *** src/libpq/Makefile.orig Mon Jan 20 06:01:48 1997
    --- src/libpq/Makefile Tue Jan 21 19:28:43 1997
    ***************
    *** 62,67 ****
    --- 62,69 ----

    libpq.so.1: $(OBJS)
    gcc $(LDFLAGS) -shared -o $@ $(OBJS)
    + rm -f libpq.so
    + ln -s libpq.so.1 libpq.so

    c.h: ../include/c.h
    rm -f c.h
    ***************
    *** 130,135 ****
    --- 132,139 ----

    install-shlib: $(shlib)
    $(INSTALL) $(INSTL_LIB_OPTS) $(shlib) $(DESTDIR)$(LIBDIR)/$(shlib)
    + rm -f $(DESTDIR)$(LIBDIR)/libpq.so
    + ln -s libpq.so.1 $(DESTDIR)$(LIBDIR)/libpq.so

    depend dep:
    $(CC) -MM $(INCLUDE_OPT) *.c >depend
    --------------------------------------------------------------------------


    --- libpgtcl.patch -------------------------------------------------------
    *** src/libpgtcl/Makefile.orig Sat Jan 11 00:01:59 1997
    --- src/libpgtcl/Makefile Tue Jan 21 19:54:01 1997
    ***************
    *** 75,81 ****

    install-shlib: libpgtcl.so.1
    $(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.so.1 \
    ! $(DESTDIR)$(LIBDIR)/libpgtcl.so
    rm -f $(DESTDIR)$(LIBDIR)/libpgtcl.so
    ln -s libpgtcl.so.1 $(DESTDIR)$(LIBDIR)/libpgtcl.so
    This is obviously wrong. It installs a file and replaces it with a symlink.
    --- 75,81 ----

    install-shlib: libpgtcl.so.1
    $(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.so.1 \
    ! $(DESTDIR)$(LIBDIR)/libpgtcl.so.1
    rm -f $(DESTDIR)$(LIBDIR)/libpgtcl.so
    ln -s libpgtcl.so.1 $(DESTDIR)$(LIBDIR)/libpgtcl.so
    The problem is that the new linux ld "ld version cygnus-2.6 (with BFD 2.6.0.14)"
    wants the libraries with suffix ".so" while previous versions worked also with
    suffixes like ".so.x.y.z".
    It seems to me that keeping the long name with version numbers and adding a
    symlink with suffix ".so" is the easiest way to make the linux linker happy
    without introducing problem on other architectures. Correct me if I'm wrong.

    - --
    Massimo

    +----------------------------------------------------------------------+
    Massimo Dal Zotto e-mail: dz@cs.unitn.it |
    Via Marconi, 141 phone/fax: ++39-461-534251 |
    38057 Pergine Valsugana (TN) pgp: finger dz@tango.cs.unitn.it |
    Italy |
    +----------------------------------------------------------------------+

    ------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedJan 23, '97 at 7:50p
activeJan 23, '97 at 9:51p
posts2
users2
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase