Back to the month index |
Back to the list index
|
Kees Lemmens (lemmens@dv.twi.tudelft.nl)
Tue, 11 Nov 1997 17:54:06 +0100 (MET)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Dean Karres: "msql 2.0.3: indices and msqlListFields() question"
- Previous message: Steve Spicklemire: "Re: mSQL Logging"
- Next in thread: Pop Qvarnström: "Re: bug in acl parsing in msql2.0.3"
- Reply: Pop Qvarnström: "Re: bug in acl parsing in msql2.0.3"
From: Kees Lemmens <lemmens@dv.twi.tudelft.nl> Message-Id: <199711111654.AA012657246@dutind4.twi.tudelft.nl> Subject: bug in acl parsing in msql2.0.3 Date: Tue, 11 Nov 1997 17:54:06 +0100 (MET)Forwarded message:
>From lemmens@dutind4.twi.tudelft.nl Tue Nov 11 17:51:02 MET 1997
From: Kees Lemmens <lemmens@dutind4.twi.tudelft.nl>
Message-Id: <199711111650.AA012387044@dutind4.twi.tudelft.nl>
Subject: bug in acl parsing in msql2.0.3
To: bugs@Hughes.com.au
Date: Tue, 11 Nov 1997 17:50:44 +0100 (MET)
Cc: msql-list@services.bunyip.com
X-Mailer: ELM [version 2.4 PL24]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 2571
Hi all of you,
I just discovered an unpleasant bug in the msql2d.0.3 daemon that causes
problems in PARSING the MSQL.ACL file with respect to remote hostnames. This
makes it very difficult to use msql from a remote system as the hostname
check will fail, unless you open your database to the whole world, which is
definitely not the best solution IMHO ;-)
The problem is caused by the fact that the gethostbyname() function is NOT
"reentrant" : all information is stored in a static area that is overwritten
after every next call.
If it is called twice - as is done in msqld.c - the first pointer is lost
and cannot be used for any comparisons, although msqld.c tries to do so
anyway and thus the hostname match will fail.
I fixed the problem by saving the ip-adress and hostname in a temporary
buffer instead and then the code works fine.
Hereafter follows the diff file for my patches with the original msqld.c :
=========================================================================
894a895
> char *h_addr,*h_name; /* MOD K.Lemmens */
909a911,916
> /* Start additions K. Lemmens */
> h_name = (char *)malloc(strlen(hp->h_name)+1);
> h_addr = (char *)malloc(strlen(hp->h_addr_list[0])+1);
> strcpy(h_name,hp->h_name);
> strcpy(h_addr,hp->h_addr_list[0]);
> /* End additions K. Lemmens */
911,912c918,923
< gethostbyname(hp->h_name);
< if (bcmp(hp->h_addr_list[0],
--- > /* original : gethostbyname(hp->h_name); */ > gethostbyname(h_name); /* Modified K. Lemmens */ > > /* original : if (bcmp(hp->h_addr_list[0], */ > if (bcmp(h_addr, /* Modified K. Lemmens */ > 956c967,968 < strdup((char *)hp->h_name);--- > /* strdup((char *)hp->h_name); */ > strdup((char *)h_name); /* Modified K.Lemmens */ 958c970,971 < hp->h_name);--- > /* hp->h_name); */ > h_name); /* Modified K.Lemmens */ 959a973,974 > free(h_name); /* Modified K.Lemmens */ > free(h_addr); /* idem */ ==============================================================================Hope this will help other people as well: it took me about 3 hours searching before I found out what 2was wrong !!
best regards,
-- Kees Lemmens; Department of Applied Analysis, Fac. Tech. Maths & Comp. Science, Delft University of Technology, PO Box: 5031, NL-2600 GA, Delft, The Netherlands. Email: Email: C.W.J.Lemmens@dv.twi.tudelft.nl. Phone : +31-15-2787224, Fax : +31-15-2787209WWW : http://ta.twi.tudelft.nl/DV/Staff/C.W.J.Lemmens.html An. FTP: ftp://ta.twi.tudelft.nl/pub/dv/lemmens/
-- Kees Lemmens; Department of Applied Analysis, Fac. Tech. Maths & Comp. Science, Delft University of Technology, PO Box: 5031, NL-2600 GA, Delft, The Netherlands. Email: Email: C.W.J.Lemmens@dv.twi.tudelft.nl. Phone : +31-15-2787224, Fax : +31-15-2787209WWW : http://ta.twi.tudelft.nl/DV/Staff/C.W.J.Lemmens.html An. FTP: ftp://ta.twi.tudelft.nl/pub/dv/lemmens/ From cosmin@indigo.quadrant.net Tue Nov 11 13:21:27 1997 Received: from indigo.quadrant.net (cosmin@indigo.quadrant.net [207.219.71.2]) by services.bunyip.com (8.8.5/8.8.5) with ESMTP id NAA04444 for <msql-list@services.bunyip.com>; Tue, 11 Nov 1997 13:21:24 -0500 (EST) From: cosmin@indigo.quadrant.net Received: from localhost (Received: from localhost (cosmin@localhost) by indigo.quadrant.net (8.8.5/8.7.3) with SMTP id MAA21443 for <msql-list@services.bunyip.com>; Tue, 11 Nov 1997 12:29:33 -0600 (CST) Date: Tue, 11 Nov 1997 12:29:33 -0600 (CST) To: Multiple recipients of list <msql-list@services.bunyip.com> Subject: rc.local entry Message-ID: <Pine.BSI.3.95.971111120721.20915B-100000@indigo.quadrant.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi everyone,
I have msql running on a BSD 3.0 system. I have created a user called msql and the msql2d daemon runs as this user.
I want to be able to start up the msql2d daemon at boot time. A simple entry in the rc.local such as:
/usr/local/Hughes/bin/msql2d &
will not do it, since I need to run the server as user msql. If anyone setup their rc.local file to start the msql daemon at boot time and run as a user other than root, please let me know.
I did get it started with a crontab file for user msql, but I am interested in starting the daemon directly from the rc.local file - as user msql.
Any help would be appreciated. Thanks.
Version Details :-
msqladmin version 2.0.1 mSQL server version 2.0.1 mSQL protocol version 23 mSQL connection Localhost via UNIX socket Target platform BSD_OS-3.0-i386
Configuration Details :-
Default config file /usr/local/Hughes/msql.conf TCP socket 1114 UNIX socket /usr/local/Hughes/msql2.sock mSQL user msql Admin user cosmin Install directory /usr/local/Hughes PID file location /usr/local/Hughes/msql2d.pid Memory Sync Timer 30 Hostname Lookup True
--Cosmin H.
- Next message: Dean Karres: "msql 2.0.3: indices and msqlListFields() question"
- Previous message: Steve Spicklemire: "Re: mSQL Logging"
- Next in thread: Pop Qvarnström: "Re: bug in acl parsing in msql2.0.3"
- Reply: Pop Qvarnström: "Re: bug in acl parsing in msql2.0.3"