Update of /cvsroot/monetdb/sql/src/backends/monet5/merovingian
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6082

Modified Files:
      Tag: Nov2009
        ChangeLog.Nov2009 merovingian.c 
Log Message:
Strip trailing newlines from the control channel password, bug #2931392

Index: merovingian.c
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian/merovingian.c,v
retrieving revision 1.65.2.5
retrieving revision 1.65.2.6
diff -u -d -r1.65.2.5 -r1.65.2.6
--- merovingian.c       7 Jan 2010 15:18:31 -0000       1.65.2.5
+++ merovingian.c       13 Jan 2010 14:56:15 -0000      1.65.2.6
@@ -680,14 +680,16 @@
 
                len = fread(_mero_controlpass, 1,
                                sizeof(_mero_controlpass) - 1, secretf);
+               fclose(secretf);
                _mero_controlpass[len] = '\0';
                len = strlen(_mero_controlpass); /* secret can contain 
null-bytes */
+               /* strip trailing newlines */
+               for (; len > 0 && _mero_controlpass[len - 1] == '\n'; len--)
+                       _mero_controlpass[len - 1] = '\0';
                if (len == 0) {
                        Mfprintf(stderr, "control passphrase has 
zero-length\n");
-                       fclose(secretf);
                        MERO_EXIT(1);
                }
-               fclose(secretf);
        }
 
        /* we need a pidfile */

Index: ChangeLog.Nov2009
===================================================================
RCS file: 
/cvsroot/monetdb/sql/src/backends/monet5/merovingian/ChangeLog.Nov2009,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -d -r1.1.2.6 -r1.1.2.7
--- ChangeLog.Nov2009   30 Nov 2009 09:29:40 -0000      1.1.2.6
+++ ChangeLog.Nov2009   13 Jan 2010 14:56:15 -0000      1.1.2.7
@@ -1,6 +1,9 @@
 # ChangeLog file for sql/src/backends/monet5/merovingian
 # This file is updated with mchangelog
 
+  13 Jan 2010; Fabian Groffen <[email protected]> merovingian.c:
+  Strip trailing newlines from the control channel password, bug #2931392
+
 *Nov2009
 
   26 Oct 2009; Fabian Groffen <[email protected]> utils.c


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to