Search Results: "tin"

7 March 2011

Daniel Kahn Gillmor: PHP, MySQL, and SSL?

Is there a way to access a MySQL database over the network from PHP and be confident that As far as i can tell, when using the stock MySQL bindings, setting MYSQL_CLIENT_SSL is purely advisory (i.e. it won't fail if the server doesn't advertise SSL support). This means it won't defend against an active network attacker performing the equivalent of sslstrip. Even if MYSQL_CLIENT_SSL was stronger than an advisory flag, i can't seem to come up with a way to tell PHP's basic MySQL bindings the equivalent of the --ssl-ca flag to the mysql client binary. Without being able to configure this, a "man-in-the-middle" should be able to intercept the connection by offering their own certificate on their endpoint, and otherwise relaying the traffic. A client that does not verify the server's identity would be none the wiser. One option to avoid a MITM attack would be for the server to require client-side certs via the REQUIRE option for a GRANT statement, but the basic MySQL bindings for php don't seem to support that either. PHP's mysqli bindings (MySQL Improved, i think) feature a command called ssl_set() which appears to allow client-side certificate support. But its documentation isn't clear on how it handles an invalid/expired/revoked server certificate (let alone a server that announces that it doesn't support SSL), and it also mentions:
This function does nothing unless OpenSSL support is enabled.
Given that debian MySQL packages don't use OpenSSL because of licensing incompatibilities with the GPL, i'm left wondering if packages built against yaSSL support this feature. And i'm more than a little bit leery that i have no way of telling whether my configuration request succeeded, or whether this function just happily did nothing because the interpreter got re-built with the wrong flags. Shouldn't the function fail explicitly if it cannot meet the user's request? Meanwhile, the PDO bindings for MySQL apparently don't support SSL connections at all. What's going on here? Does no one use MySQL over the network via PHP? Given the number of LAMP-driven data centers, this seems pretty unlikely. Do PHP+MySQL users just not care about privacy or integrity of their data? Or (please let this be the case) have i just somehow missed the obvious documentation? Tags: mysql, php, question, security, ssl, tls

6 March 2011

Tim Retout: Software Architect

I've been promoted - my job title will now be 'Software Architect'. This seems to mean I'll be writing documents rather than code - any higher-level, and I'd need Mark Shuttleworth's spacesuit. Is this a good thing? Anyway, I celebrated by opening my last bottle of Debian wine. <spam>Unfortunately, I can't take up my new role until we have hired a replacement. UK-based developers who know Perl and ideally PostgreSQL might want to look at the job description, although I'd recommend sending your CV and covering letter to me directly. I don't get a referral bonus, it's just that I don't like what that agency does with your carefully-crafted application.</spam> I'd like to thank everyone who maintains LaTeX for their assistance in this matter. In other news, I'm studying a couple of Open University courses part-time - one on software development (i.e. UML), and one on interaction design. They're going well so far - I've had a couple of tutorials, and the first part of an assignment came back with good marks. I've been reading the Lean Software Development books by Mary and Tom Poppendieck. They seem to put Agile development into a 'respectable' historical context of similar improvements in manufacturing, which might be useful for persuading project managers.

Stefano Zacchiroli: on the influence of Debian and derivatives

Counting derivatives In the news, there's an article by Bruce Byfield discussing the influence of Debian and its (transitive) derivatives on the ecosystem of GNU/Linux distributions: Linux Leaders: Debian and Ubuntu Derivative Distros. The article is a sort of review of what you can find in the vast ecosystem of distributions rooted at Debian: from embedded to supercomputer distro, from netbook to scientific computing distros. The articles cites the Debian derivatives front desk and is a study similar to what we might tackle with the derivatives census by Paul Wise. (By the way: did you check if your favorite Debian derivative is already in? No? Do it!) With this article, Bruce has made me quite a favor in harvesting distrowatch to refresh the figures about the number of derivatives that I often use in speeches. The need of doing that has been polluting my LaTeX "% TODO" comments for a while now Here they are: Update: update figures that Bruce misinterpreted; live data are available, thanks to Loris (see comments) for noticing

Neil Williams: Checking build-dependencies

I've been nagged for a while (by Wookey mainly) about the unhelpfulness of dpkg-checkbuilddeps when it outputs the versions and alternatives alongside the package names which are missing, making it harder to pass the list to the package manager. apt-get build-dep isn't particular helpful either - it doesn't look at the modified package at all.

Of course, once the output is in a suitable format, a new script might as well make it possible to simply pass that output to said package manager. Once it can do that, it can then pass the output to the cross-dependency tools, like xapt.

So, I've refactored the embuilddeps script in the xapt package to do just this.

It's gained a few features in the process:

  1. Support for Build-Conflicts resolution

  2. Support for virtual packages, swapping the virtual for the first package to provide it (borrowed some code from Dpkg::Deps for that one).

  3. Support for Build-Depends alternatives (currently using the buildd default of "first alternative gets first chance")

  4. Reads data from debian/control, not the apt cache - to help with the package you're building instead of the one you've already uploaded.

  5. Handles cross dependencies (which are always assumed to not currently be installed) and native dependencies. This support is transitory until such time as enough packages are Multi-Arch compatible that Cross-Multi-Arch becomes trivial.

  6. Support for being used as a build-dependency resolver in pbuilder, including cross-architecture dependencies with pdebuild-cross.

  7. Can locate a debian/control file in a specified directory without needing to be called from that directory

  8. Checks your apt-cache policy to see if the required version of a package is available from your current apt sources. Fails completely if not. (The pdebuild-cross usage will need that to be extended a touch to look at the apt-cache policy from within the chroot.)

  9. Hector Oron has also been asking me to get embuilddeps working with sbuild, so I'm working on that feature too.

  10. verbose and quiet support (so use -q inside other scripts)

  11. most output is already translated - more translations are welcome, especially for the documentation, but hold on until this version has actually been uploaded.



More testing is needed, particularly that the extensive refactoring hasn't broken the pbuilder resolution support and then looking at what still needs to be done for sbuild support. The new script is in Emdebian SVN.

The first-choice method for virtuals and alternatives may well bear extension to explicit management via command-line options. I'm unsure yet whether it needs to be a configuration file setting. It could simply be a recursive - try one, move on - model.

Yves-Alexis Perez: Update on Xfce 4.8

Since the last post, few things did happen. Basically, it's still not the right time for Debian users to upgrade to Xfce 4.8. We eventually managed to upload the whole desktop part (except the xfce metapackage) to experimental and we did upload some of the goodies too. Licensing issues have been solved so the concerned packages have been uploaded, and we're right now waiting on the three packages sitting in NEW. So you'll need to be a little more patient and kindly wait for our ftp-masters to process the (quite huge) NEW backlog. After that we'll need a bit more time in experimental to test upgrade cases, then we'll do an upload to unstable of the whole desktop part and the whole goodies. Upgrading to xfce4-panel 4.8 means *all* plugins need to be rebuilt too, so that means a huge upgrade and a quite large transition to handle for the release team, so we'll have to schedule the unstable upload with them in order not to break all their plans (yes, we try to be good Debian citizens) So please be patient, but you'll see Xfce 4.8 in unstable in a not too distant future. I'll put an update here when we'll need brave volunteers willing to break their systems by doing upgrade tests. [UPDATE]: garcon, thunar-vfs and tumbler were just accepted into experimental, thanks to our ftp-masters. Now we'll synchronize with release team and upload to unstable when possible.

Lars Wirzenius: Keep companies honest

Bradley Kuhn writes about the phrase "open core". In summary, avoid that phrase and use clearer, unambiguous terms instead. He also touches upon the practice of projects requiring copyright assignment before accepting contributions. Like Bradley, I dislike the practice. If a corporation requires me to assign copyright to them, so that they have power to change the license, I need to be paid in a currency that helps me pay rent. The only reason they need the power to change the license is to make the code proprietary, for the purpose of extorting users for money. If they get money, I want money. On the other hand, if I don't assign them copyright, I have a bit of power myself, and I can use that to keep them honest. If enough people do that, the corporation would have to rewrite all the code to make sure they have copyright on all of it, and can license it in a proprietary way. There's another kind of copyright assignment, which the FSF uses: the FSF gets copyright, but the contract with them guarantees that they'll not violate the freedom of the code. In return, the contributor gets relieved from the burden of having to deal with license violators, and can rely on the FSF to do that instead. This is an acceptable bargain to me, even though I haven't contributed enough to GNU projects to do a copyright assignment. There may be other entities than the FSF doing the same thing. I have not seen any others, though, so on the whole I consider copyright assignment as a way to trick me. With the exception of the FSF, copyright assignment smells dishonest to me.

Gintautas Miliauskas: Trip to Bay Area coming to an end

My trip to the Bay Area is coming to the end. It has been surprisingly productive. Here's some things I have done in the nearly two weeks I have been here:

While I am getting a little travel-weary, I know I will be sad leaving this place.



    Thorsten Glaser: mksh gains recursive parser for command substitutions $( )

    mksh-current has just gained an experimental recursive parser for command substitutions, fixing RedHat BZ#496791 and decades-old complaints about the pdksh codebase, compared to AT&T ksh93. (GNU bash could also do the example, but not some other things mksh(1) parses fine now.)

    This means that things like the following work now.

    	# POSIX, should  always  work
    	echo $(case 1 in (1) echo yes;; (2) echo no;; esac)
    	# POSIX optional, works now in mksh, works in GNU bash
    	echo $(case 1 in 1) echo yes;; 2) echo no;; esac)
    	# GNU bash seems to choke on comments ending with backslash
    	# a comment with " ' \
    	x=$(
    	echo yes
    	# a comment with " ' \
    	)
    	# No non-recursive COMSUB parser can pass all of the above
    	# tests and these below at the same time (some extensions)
    	echo $(typeset -i10 x=16#20; echo $x)
    	echo $(typeset -Uui16 x=16#$(id -u)
    	) .
    	echo $(c=1; d=1
    	typeset -Uui16 a=36#foo; c=2
    	typeset -Uui16 b=36 #foo; d=2
    	echo $a $b $c $d)
    	# the  #  is especially tricky, that s why the above cases
     

    Next on my TODO is the complete rewrite of the read built-in command, as well as its documentation. I think that the (reduced) goals for mksh R40 will have been met by then, except porting to LynxOS and MPE, but we re working on it, and re-testing Syllable and Plan 9). Of course, a release implies testing on a lot of the supposedly supported platforms, so it won t be out immediately . Though, associative arrays have been removed from the R40 goals, so that I can at least get a new release out. Note that Debian and OpenSuSE Buildservice users have been provided with somewhat well-tested mksh-current snapshots for a while already, and Gentoo users can use the live ebuild ; there s always compiling from source too

    5 March 2011

    John Goerzen: Visiting Purdue

    Terah went to college at Purdue University, and always enjoyed basketball games there. I ve not been much of a sports fan, but have enjoyed watching Purdue games with her on TV. Terah has been wanting to see a game in person for awhile, so a couple of weeks ago, we went. It was a really fun weekend! When we planed the trip, we had no idea that the Purdue-Ohio State game was going to be such a big one. We walked over from the Union Club Hotel where we were staying on the Purdue campus. People were streaming towards Mackey Arena from all directions. Once inside, it was already loud and buzzing people cheering, the band playing. I ve never experienced anything quite so loud. The game started out badly for Purdue; they were down a few points up front. The entire game was a close one, and the crowd sometimes got so loud that nothing else could be heard not even the band or the announcer. When it became clear at the end that Purdue won the game, the people behind me and apparently 12,000 others began screaming at the top of their lungs. My hearing did eventually return to normal. So did my throat, which had gotten rather sore from from cheering myself. This was our first road trip since I got my amateur radio license. I had a lot of fun visiting with people as we drove. I talked to a retired railroad engineer that used to take an amateur radio with him in his locomotive. As he went through a certain town where he had friends he liked to talk with on the radio, he d get their attention by blowing CQ in Morse code with the train s whistle. Some people in Kansas City had us laughing as we passed through. In Missouri, I talked with some farmers and a World War II vet. In Champaign, IL, I visited with a retired Unix systems administrator that had spent decades working with Unix operating systems. Our hotel was connected to the Purdue Memorial Union, a large and historic building. Besides having some ice cream at the Sweet Shop one evening, we also spent a bit of time exploring it. I noticed that the Purdue Amateur Radio Club was having a testing session in there. We walked past once it was underway, and one of the students was not very busy. I introduced myself and asked if we could see their shack. It was neat to see all the equipment some of it quite old in the room that they must have been using for decades. Terah, of course, had ideas for visiting a number of her favorite places while we were there. We visited Arni s and Bruno s, both pizza places. Bruno s happens to be a Swiss pizza place, so much to my surprise, I had Wienerschnitzel there, which was excellent. We ate a (week late) Valentine s dinner at Bistro 501. On our way back, we also chatted with various people on the radio, though not quite as much. We got helpful suggestions for which route to take, and stopped at the excellent Bobby D s Merchant St. BBQ in Emporia, KS for supper. The boys had also enjoyed their weekend with grandparents, but were glad to see us back. They were particularly interested to see a lot of train videos from Youtube with me the next day.

    Amaya Rodrigo: Indignez vous (II)

    Spend millions visiting space TWICE, take Amazon referal money from non profit... priceless!

    Take Amazon referal money from non profit... priceless!

    From skitterman.wordpress.com/2011/03/02/business-oppor<wbr></wbr><wbr></wbr>tunity-in-ubuntu/#comment-364:
    Mark, with his wealth, could have set up any model of organisation. He chose a for-profit one. As such, the conflict of loyalty necessarily must become ever more pronounced as that profit is sought.
    Thanks to a former friend for pointing me to these two people who could express this better than me.

    David Welton: Manipulating ckeditor data with jQuery

    I'm working on a project that utilizes CKeditor and need to manipulate the data it contains. Since I'm familiar with jQuery and it's fairly efficient at doing that sort of thing, rather than figuring out how CKeditor manipulates things internally, I wanted to, at least to get started, access things in jQuery. There isn't a lot of information out there on the best way to do that. Here's what I figured out - it seems to work pretty well:
        var editor = theeditor();
        var contents = $("<div id='specialwrapperthing'>" + editor.getData() + "</div>");
        .... hack away with jQuery ....
        editor.setData(contents.html());
    Basically, you just wrap up what the editor hands you in terms of the data, hack away on it, and then put the HTML back into the editor.

    Mike Hommey: More graphs for the Debian Bug Tracking System

    I have been maintaining Debian Bug Tracking System graphs for a few years, now, though not very actively. They initially were available on people.debian.org/~glandium/bts/, but there have been some recent changes. A while ago, I started experimenting with brand new graphs on merkel.debian.org/~glandium/bts/, and when merkel was announced to be dying a few months ago, I got in touch with the QA team to know what to do with them, and it was decided we d put them on qa.debian.org. I unfortunately didn t follow up much on this and only recently actually worked on the migration, which took place 2 weeks ago. The result is that the graphs have officially moved to qa.debian.org/data/bts/graphs/, and links on the Package Tracking System have been updated accordingly. There is now also an additional graph tracking all open bugs in the BTS, across all packages: Today, I added a new feature, allowing to consolidate data for multiple arbitrary packages in a single graph. Such graphs can be generated with the following URL scheme (please don t over-abuse of it):
    http://qa.debian.org/data/bts/graphs/multi/name0,name1,name2,etc.png
    As an example, here is a graph for all the bugs on the packages I (co-)maintain:
    http://qa.debian.org/data/bts/graphs/multi/dehydra,diggler,iceape,iceweasel,libxml2,libxslt,livehttpheaders,mozilla-dom-inspector,nspr,nss,pyxpcom,venkman,vmfs-tools,webkit,xulrunner,zfs-fuse.png
    And here are the bugs affecting Mozilla-related packages:
    http://qa.debian.org/data/bts/graphs/multi/iceape,icedove,iceowl,iceweasel,nspr,nss,xulrunner.png
    I guess the next step is to allow per-maintainer consolidation through URLs such as
    http://qa.debian.org/data/bts/graphs/by-maint/address.png
    Update: per-maintainer consolidation has been added. (Hidden message here: please help triaging these bugs)

    Lars Wirzenius: DPL nomination period for 2011

    The nominations for Debian Project Leader elections for 2011 are open. As always, I'm tempted to nominate myself, but after thinking about it, I again conclude that I shouldn't. If I did nominate myself, there's a couple of things I'd like to push for. The DPL position is inherently a political one, which is why nothing in the list above is technical. On the other hand, I want to concentrate my Debian time on doing stuff that is fun, and right now that means writing code. I want to write code for Debian.

    4 March 2011

    Steve Kemp: A final update on redisfs

    I think I'm done with the redis filesystem for the moment. It does everything I need it to do, although I am curious to see how much faster it could go if it were to use non-blocking writes that isn't a major concern. There is only one missing feature I'm planning to play with - and that is the ability to implement snapshots. As a refresher redis is a key+value store, which mostly uses system memory. I've built a simple FUSE filesystem on top of that (now with symlink support!) and so all the file contents, meta-data, and similar is stored in memory. Implementing snapshots could be done by two different routes:
    Copying all keys and their values, under a new name.
    For example right now, by default, all the filesystem entries in the root directory are stored beneath the key "SKX:/" - where "SKX" is the key prefix. Assume I copy each existing key, and the associated value(s), giving them a new prefix such as "SKX2:" I can mount the filesystem against that prefix - and we've got a point-in-time snapshot.
    Serialising all keys & values
    Redis has a primitive which allows you to determine the names of keys at runtime. Given that all my filesystem keys have a prefix ("SKX:" by default) it wouldn't be difficult to find them, and serialise them. This would require more effort to re-import and re-mount, but it should be portable across hosts.
    Anyway assuming I get this right we'll have a filesystem which is replication-friendly and snapshot-able. A fun combination. ObQuote: "We had been everywhere. We had really seen nothing. " - Lolita

    Jo Shields: Protip: parallel-installing Mono versions in an APT-happy way

    If you ve ever gotten tired of waiting for a new Mono release to appear, and taken matters into your own hands by compiling your own copy of Mono, you ve likely faced the problem of missing libraries. That s weird, it says it can t find gtk-sharp, but I have that package! This happens because every version of Mono on your system has what s called a Global Assembly Cache a location where all system-wide assemblies lives. So when you run an app like Tomboy, it loads its libraries such as GTK# from the GAC belonging to the Mono runtime being used. Ordinarily, this is in /usr/lib/mono/gac on a Debian/Ubuntu system. When you have your parallel Mono, it doesn t share a GAC as a result, libraries in your main distro GAC are not available in your DIY GAC, as they were never registered in there. Typically, the advice is to either start compiling every lib you need into a non-standard place too however, here s a better idea. Why not make Apt take care of not only your system s GAC but additional GACs too? We actually have structures in place to handle this, so it s not as hard as you think (merely relatively unknown). This guide does NOT take startup scripts into account it s your problem to ensure you re using the correct mono command to run your copy of MonoDevelop or Tomboy or whatever. You should probably learn about update-alternatives and $PATH for this. Oh, and this guide will BREAK HORRIBLY if you try to uninstall system mono completely. Don t try it. Setup step 1: preparation Don t install parallel Mono into /usr/local. I don t care what happens to you if you do. Use some random folder in /opt, usually a per-build prefix like /opt/mono-2.10 Setup step 2: duplicating existing magic Open a terminal, and copy /usr/share/cli-common/runtimes.d/mono to a new filename, e.g. /usr/share/cli-common/runtimes.d/mono-2.10 Setup step 3: tweak duplicate magic Open your copied file in an editor, and change the name value on line 27ish (e.g. from Mono\n to Mono (parallel 2.10 install)\n ). Then change the two places in the file, on lines 64ish and 120ish, from /usr/bin/gacutil to /opt/mono-2.8.2/bin/gacutil or equivalent. Setup step 4: apply magic to existing packages Run /usr/share/cli-common/gac-install mono-2.10 (or whatever filename you picked for your runtimes.d entry) as root. This will instantiate your parallel GAC(s). From now on, every GAC library you install or uninstall will happen to every single runtime in runtimes.d. To go back to how things were before, with only a single Mono runtime: Uninstall step 1: empty out parallel GAC Run /usr/share/cli-common/gac-remove mono-2.10 (or whatever filename you picked for your runtimes.d entry) as root. This will remove all packaged entried from your parallel GAC(s). Uninstall step 2: remove magic Delete your file from runtimes.d

    Dirk Eddelbuettel: RcppArmadillo 0.2.14 and 0.2.15

    A few days ago Conrad Sanderson released version 1.1.6 of his Armadillo templated C++ library for linear algebra. Accordingly, I made a new release 0.2.14 of RcppArmadillo, our Rcpp-based integration into R which included a few local fixes. However, while I updated SVN at the R-Forge project I didn't update the final tarball so Armadillo 1.1.6 wasn't in it. That is corrected in the 0.2.15 upload which is now on CRAN and its mirrors. The short NEWS file extract for both releases follows, also containing Conrad's entry for 1.1.6. A few minor tweaks were added but no user-visible changes:
    0.2.15  2011-03-04
        o   Upgraded to Armadillo Version 1.1.6    Baby Carpet Shark 
             * fixed size matrices and vectors can use auxiliary (external) memory
             * .in_range() can use span() arguments
             * subfields can use span() arguments
    0.2.14  2011-03-02
        o   Support Run-Time Type Information (RTTI) on matrices by setting the
            state variable vec_state in Row and Col instantiation, with thanks to
            Conrad Sanderson for the hint
        o   fastLm code simplified further by instantiating the Armadillo matrix
            and vector directly from the SEXP coming from R
        o   inst/doc/Makefile now respects $R_HOME environment variable
    
    And courtesy of CRANberries, here are the diffs to.2.14
     ChangeLog                                                   14 -
     DESCRIPTION                                                  8 
     inst/NEWS                                                   10 
     inst/doc/RcppArmadillo-unitTests.pdf                     binary
     inst/doc/unitTests-results/RcppArmadillo-unitTests.html     10 
     inst/doc/unitTests-results/RcppArmadillo-unitTests.txt      39 +-
     inst/include/armadillo_bits/Col_meat.hpp                    51 +++
     inst/include/armadillo_bits/Col_proto.hpp                    3 
     inst/include/armadillo_bits/Cube_meat.hpp                   52 +++
     inst/include/armadillo_bits/Cube_proto.hpp                   7 
     inst/include/armadillo_bits/Mat_meat.hpp                    51 +++
     inst/include/armadillo_bits/Mat_proto.hpp                   12 
     inst/include/armadillo_bits/Row_meat.hpp                    51 +++
     inst/include/armadillo_bits/Row_proto.hpp                    3 
     inst/include/armadillo_bits/arma_version.hpp                 6 
     inst/include/armadillo_bits/config.hpp                       9 
     inst/include/armadillo_bits/field_meat.hpp                 220 ++++++++++++++--
     inst/include/armadillo_bits/field_proto.hpp                 20 +
     inst/unitTests/runit.RcppArmadillo.R                        16 +
     19 files changed, 521 insertions(+), 61 deletions(-)
    
    and to the previous release 0.2.13, respectivel
     ChangeLog                                                   14 ++++++
     DESCRIPTION                                                  6 +-
     inst/NEWS                                                   11 +++++
     inst/doc/Makefile                                           15 +++++--
     inst/doc/RcppArmadillo-unitTests.pdf                     binary
     inst/doc/unitTests-results/RcppArmadillo-unitTests.html     18 ++++----
     inst/doc/unitTests-results/RcppArmadillo-unitTests.txt      34 ++++++++--------
     inst/include/RcppArmadillo/Col_meat.h                       24 ++++++-----
     inst/include/RcppArmadillo/Row_meat.h                       19 ++++----
     src/fastLm.cpp                                              15 ++-----
     10 files changed, 94 insertions(+), 62 deletions(-)
    
    More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

    David Paleino: Optional argument with \newcommand in LaTeX

    In LaTeX, it seems like you can't define a command with a really optional argument, using \newcommand. You can make commands with arguments having a default value though. Now, I found myself in need of having such a functionality. I had to google a while, but finally found it, so I'm posting it here, both to share knowledge and to remember it in future :) Suppose you want to do something like \mycmd foo and \mycmd foo bla , doing different things (in my case, I needed to add the second argument enclosed by parenthesis in the TOC and other places, but only if it was present) Here's the code:
    \def\mycmd#1 \def\tempa #1 \futurelet\next\mycmd@i % Save first argument
    \def\mycmd@i \ifx\next\bgroup\expandafter\mycmd@ii\else\expandafter\mycmd@end\fi %Check brace
    \def\mycmd@ii#1 ... %Two args
    \def\mycmd@end ... %Single args
    
    In the last two lines of the code, use \tempa for your first argument, and #1 for your second optional argument. If you need spaces there (maybe as part of some text), be sure to escape them with a backslash \. I think it's expandable for additional arguments, but I haven't tried, and I don't feel like getting my hands dirty with TeX yet ;)

    Michal &#268;iha&#345;: Fun with MinGW64 and ODBC

    The test suite for recently added ODBC support in Gammu was consistently failing on Win64 platform (all others were just fine). It took me some time to figure out why. The reason is SQLLEN type, which is in some sort special, that generated code for it is broken. All started with pretty much standard retrieving value from ODBC result:
    SQLLEN size;
    SQLRETURN ret;
    /* Figure out string length */
    ret = SQLGetData(res->odbc, 1, SQL_C_CHAR, NULL, 0, &size);
    if (!SQL_SUCCEEDED(ret))  
        return NULL;
     
    /* Did not we get NULL? */
    if (size == SQL_NULL_DATA)  
        return NULL;
     
    /* Allocate buffer for string */
    out = reallocate(out, size + 1);
    
    The first problem was comparing of size against SQL_NULL_DATA. It simply always failed even if size did contain -1 (what is actually value of SQL_NULL_DATA). Yesterday, I've come out with typecasting magic that worked fine for this case. However what I've missed is that even reallocate is failing with this parameter. No matter what the size would be, it would return NULL. Typecasting again did help here. Hey, should not be compiler clever enough to typecast this for me? It turns out that in case of MinGW64 it is not. Anybody has suggestion why? At the end I ended up with pretty ugly duplicating of the variable just to avoid mixing it up in future changes (as would happen with typecasting everywhere). I'd really like to know why my assumptions are wrong in this case.

    Filed under: English Gammu 0 comments Flattr this!

    Craig Small: Apache and incomplete redirection messages

    As part of moving my site around, I needed a bunch of redirects so that http://enc.com.au/docs/linuxload.html now becomes http://enc.com.au/2010/07/manually_calculating_process_times/ because its now controlled by WordPress. so I used the RedirectPermanent feature of mod_alias to do it with lines like:
    RedirectPermanent /docs/linuxload.html /2010/07/manually_calculating_process_times/
    So you come in on /docs/linuxload.html and redirect to the blog entry, simple really! It actually works, kinda, but the log files fill with things like:
    [Fri Mar 04 14:40:17 2011] [warn] [client 172.16.242.1] incomplete redirection target of '/2010/07/manually_calculating_process_times/' for URI '/docs/linuxload.html' modified to 'http://enc.com.au/2010/07/manually_calculating_process_times/
    What is going on? Why won t Apache just be quiet and be happy? The reason is in the Redirect Directive documentation on the 2.0 mod_alias page:
    Also, URL-path must be a fully qualified URL, not a relative path, even when used with .htaccess files or inside of <directory> sections.
    But I m running Apache 2.2 and the 2.2 mod_alias page says:
    The new URL should be an absolute URL beginning with a scheme and hostname, but a URL-path beginning with a slash may also be used, in which case the scheme and hostname of the current server will be added.
    That s it, you two choices: Changing the above config snippet to use absolute paths fixed it.
    RedirectPermanent /docs/linuxload.html http://enc.com.au/2010/07/manually_calculating_process_times/

    Cyril Brulebois: Debian XSF News #7

    Time for a seventh Debian XSF News issue!

    Next.

    Previous.