Friday, August 27. 2010
Beware of quotes passed to init-scripts! Posted by Luca Longinotti
in Gentoo at
04:55
Comments (0) Trackbacks (0) Beware of quotes passed to init-scripts!
Just a quick note in case I or others run into this again...
I use Trac to manage a few projects, more specifically Gentoo's www-apps/trac package to ease its deployment. One feature of the package I take advantage of is the init-script to manage the tracd standalone server. I now wanted to enable authentication for my Trac installs, and all guides out there tell you to add --auth="*,/path/to/digest/auth/file,domain"to your commandline when starting Trac (notice the quotes!), I tried this on the shell, and it worked as expected. I thus changed the TRACD_OPTS variable in /etc/conf.d/tracd to the following:
It started fine but authentication didn't work at all... Somewhat baffling, but after some investigation, I noticed that the quotes around the --auth argument were passed as-is to tracd, which then failed to find the environment *, since when splitting the --auth argument apart, "* would be used as environment name. The solution is simply to not set any type of quotes when starting tracd through the provided init-script, so that TRACD_OPTS looks as follows:
In hindsight logical, as the TRACD_OPTS variable gets evaluated only once and then passed to start-stop-daemon, which passes the arguments verbatim to tracd. Monday, April 19. 2010
GCC's __attribute__ ((nonnull ... Posted by Luca Longinotti
in C99, Rig at
21:22
Comment (1) Trackbacks (0) GCC's __attribute__ ((nonnull (...))) not helpful at all
Today I encountered some really interesting and disconcerting GCC behaviour...
I'm currently writing a library with some data structures in it, and basically have functions such as the following:
where item is an address to allocated space on which to operate, this basically is the way you do generics in pure C, using void pointers to memory locations you copy from/store to, based on some size you know depending on your usage pattern. Now, the first thing any security conscious (and sane) programmer would do is to check that both queue and item are not NULL and act accordingly, either returning false to the user, or in my case aborting completely as I'm of the opinion this is a serious error on the programmers part that he must fix, still I digress, the fact is: there should be some form of NULL check there, for example:
This has always worked beautifully. Now the other day I was reading the GCC manual on function attributes and stumbled upon attribute "nonnull", documented as such:
Note the bold sentence, we'll come back to it later on. Now, I thought this looked quite useful and changed the prototypes of my functions to accordingly hint to the compiler when I expected a parameter to be nonnull, so for example I changed my queue_get prototype to look like this:
And I then started testing this throughly, and was surprised by what I found: GCC's enforcing of this is more or less useless, it only emits a warning if you pass NULL directly as a parameter to the annotated function, meaning only an erroneous call of the form "queue_get(q, NULL);" would for example be detected, anything else, like "void *p = NULL; queue_get(q, p);" or "queue_get(q, myfunc());" where myfunc() may return NULL, are not detected. There is an enhancement bug open at GCC (bug #17308) to improve it to handle more cases, but it hasn't seen much activity. Still, I thought even if it was only that one warning, annotating the function this way would surely help and also work as a form of documentation for clients later reading the libraries header file, so no harm in leaving it there, because the explicit NULL checks inside the library's functions would anyway correctly catch any passed NULL pointer and abort, right? WRONG! COMPLETELY WRONG! Let's return to that quote from the GCC docs and the last, seemingly innocent line there: "The compiler may also choose to make optimizations based on the knowledge that certain function arguments will not be null.", what this actually means is that at any meaningful optimization level, such as -O2, any NULL-pointer-checks against parameters of a function declared with the nonnull attribute will be simply optimized away silently, so suddenly calling the function while passing NULL during testing always led to a segmentation fault. Whoa, that's somewhat unexpected! And passing "-fno-delete-null-pointer-checks" didn't change anything. Searching GCC's bugzilla I found bug #36166, which discussed the exact same thing I was observing, marked as RESO INVALID... Basically it boils down to the fact GCC does the detection for warnings and the optimization of code in separate parts, and they don't quite seem to agree, meaning that you only get a warning in one particular case of passing NULL, and even then only if the appropriate warning level and options are set, while it ALWAYS optimizes out NULL checks from the code, resulting in quite broken code. The GCC developers seem to regard this as correct, the reporter disagrees (and I agree with him!), comment #7 summarizes the core of the problem quite well, as well as both positions. RESO INVALID makes it quite clear who won the dispute, and in the end we get a mostly useless function attribute that silently completely breaks code, based on a somewhat unclear line of documentation, that was never updated to be clearer (and at least that would have been easy and helpful to do!). Conclusion: all the _attribute_ nonnull's have been removed from my code again, and what looked like a great idea, completely failed in practice in my opinion. Friday, April 2. 2010
Retiring from Gentoo Posted by Luca Longinotti
in Gentoo, Longi's life at
18:23
Comments (0) Trackbacks (0) Retiring from Gentoo
I'm officially retiring as a Gentoo developer, simply because I've not really done anything in the last year and will not be getting back into the swing of things anytime in the future, so I feel it's time to retire.
It's been a fun 4.5 years, even if I wasn't present much as developer in the last 1.5 years, and I will definitely continue using Gentoo as my distribution of choice, nothing will change that. I've had the honor of getting to know some amazing people during those years, and improve a lot of my skills and competences, and for that I'm grateful. See you all around, Luca Longinotti. Thursday, December 31. 2009
Happy New Year people! Posted by Luca Longinotti
in Longi's life at
23:00
Comments (0) Trackbacks (0) Happy New Year people!
Happy New Year people!!!
Let's hope for a great 2010. Friday, December 25. 2009
Merry Christmas everyone! Posted by Luca Longinotti
in Longi's life at
00:10
Comments (0) Trackbacks (0) Merry Christmas everyone!
Merry Christmas everyone, have a happy time!
Friday, November 13. 2009ExpoVina & Sushi
I'll try to blog again more often, so that at least I'll have a log of my life, more or less.
Yesterday (Tuesday) evening I and a couple of friends (Flavio, Andrea and Dersim) went to ExpoVina 2009 in Zürich, a big wine exposition held on 12 boats anchored at the Bürkliplatz port. We arrived at around 1700 and stayed till about 1920, sampling wines from different countries, regions and producers. I particularly appreciated the selection of sweet wines from Bindella, as I love sweet and dessert wines, and ordered a few right away, their VinSanto "Dolce Sinfonia" and the "Brachetto d'Aqui" were incredibly good. We also sampled a few wines from Valais, Switzerland, (Favre, Dubois), which were quite good, but I didn't order any of those, as they are relatively easy to find here, and I actually know the Favre Caves in Sion personally, as I was there with the military during my Fourier advancement course, and later with my father. They make quite good white wine, such as the Petite Arvine. Being a fan of sweet wines, I also couldn't resist ordering a few bottles of Samos, a very sweet Greek wine, by Keel. We also had our first taste of Spanish wine, from Casa del Vino, they were quite different from the usual Italian wines we were accustomed to, but quite good nonetheless. The people manning the stand were also very polite and helpful, telling us the differences and histories of the various wines as we sampled them, and offering us samples from all regions and types of wines they had. One of the friends with me then told us another guy we know (Simone) already was here a few days ago, and recommended to try the Port wines from Amarela, which we did. Most of us had no particular experience with Port wines at all, so the guy there helped us choose, and we all were pleasantly surprised, ordering a few bottles of Ruby Reserva and Finest Reserve. To conclude the wine-tasting evening, we enjoyed a few Italian red wines at Weibel, and had a nice discussion with the Italian guy there. All in all a very nice event, which I'll be sure to go again next year. After that we hooked up with a few other friends (albeit we were ~20 minutes late, sorry guys! After that we all went home, and me and Flavio watched another episode of "My name is Earl", it's a really hilarious show that I recommend to anyone. Yo, have a good day! Sunday, October 5. 2008tmux
I'm finally back on the net, after not having any internet access at my new apartment in Zürich after I moved there.
I now started my bachelor studies at the ETH Zürich, of course in Computer Science, though there's a little bit too much maths right now for me to be really excited about it, future semesters will be better I hope. So I'll try to get back to a few Gentoo things in the near future, now that I also finally fixed up my main dev system (which had its disk die just before I moved)... Still this blog entry's main focus is to tell you the name of a package I discovered today: app-misc/tmux After reinstalling this system I, as always before, emerged screen to take care of my detached terminal needs, I always had the problem with backspace not working correctly from the desktop, which I was never able to fix correctly, but it was bearable. This time it seems something else went wrong too, and inside my screen sessions it didn't source .bashrc or .bash_profile (which sources .bashrc), even if the shell was correctly set to a bash login shell... So, while perusing Gentoo Wiki's Screen TIPs to see if anyone had seen something like this, at the end of that page I came across the mention of tmux, a "simple, modern, BSD-licensed alternative to GNU Screen". Seeing that it only depended on ncurses (which is usually installed everywhere), and was only like 100kb of source, I installed it and tried it out. I have to say I'm impressed, this little tool does everything I did with screen too (mainly just having multiple, detached terminals and resuming them, which is probably no "advanced screen usage", but what most people will likely need), backspace works without any fiddling, the Bash stuff is correctly sourced, and the few commands are easy to adapt to, here a little overview: tmux Starts a new tmux session CTRL-b d Press CTRL-b, then d, to detach the terminal tmux a Reattach to the detached terminal Still, read man tmux to get the full overview, and then happily do emerge -C screen, as I did. Best regards, chtekk. Saturday, May 12. 2007net-www/apache-1* masked.
This I just wrote to gentoo-dev and gentoo-server, finally ending Apache-1* support in Gentoo.
Best regards, CHTEKK. Thursday, February 22. 2007
FOSDEM 07, here we come! Posted by Luca Longinotti
in Gentoo, Longi's life, SysCP at
22:12
Comments (2) Trackbacks (0) FOSDEM 07, here we come!
Yo all!
Tomorrow to FOSDEM 07 /me goes, along with hansmi, KillerFox and blubb from the swiss crowd! Later on both flo and EleRas will join us too, so for me not only will it be "the great Gentoo dev gathering", but also "the great SysCP dev gathering", will all three of us present. Now off to bed, as I have to get up early (~4AM) to catch the first train to get to Basel, where the others await, and from there off to Bruxelles. Lugano-Basel-Frankfurt Am Main-Köln-Bruxelles is the exact route, almost 1000 Km, for a total en-route time of about 11 hours, yay! On the PHP front, I've finally put PHP 5.2.1 and PHP 4.4.5, with all the needed patches and, of course, Suhosin support, into the PHP Overlay. I'll test it all during the next days and hopefully commit to the tree on Monday at the latest. Many bugs are fixed with the latest releases, concurrentmodphp support was greatly improved and fixed (especially wrt 64bit archs), and the new MySQL extension patches are included to have the connection charset settable per-SAPI, for each PHP version, using php.ini, instead of my.cnf. Work on VCD is also going steady, we should be near feature-completion soon, so expect some form of pre-release in the next two weeks... Poke Hollow on #gentoo-vserver for more info. Best regards, cya all, CHTEKK. Monday, January 1. 2007
Happy 2007! Posted by Luca Longinotti
in Gentoo, Longi's life, SysCP at
01:16
Comments (0) Trackbacks (0) Happy 2007!
Happy new year people!!!
I wish you all a great 2007 full of fun and happiness and all the other good stuff (new hardware comes to mind 23C3 finished two days ago, it was really great fun with great talks and great people (yeah, Polish guy living in the USA, from the university near Atlanta, you know who you are Now we've passed yesterday by visiting Berlin and at the moment we're connected through the Hostels connection... It depresses me to know it's at least twice as fast as my home DSL. By the way, all this convinced me to come to FOSDEM 07, so be prepared to know the CHTEKK (or be scared, that all depends). Cya, and happy new year, CHTEKK. Thursday, December 28. 2006
Greetings from 23C3. Posted by Luca Longinotti
in Gentoo, Longi's life, SysCP at
12:42
Comment (1) Trackbacks (0) Greetings from 23C3.
Yo! Greetings from the 23C3, the Chaos Computer Congress in Berlin.
Great talks and great people here, at the moment I'm attending a talk about JSON RPC (who knows, maybe that can/will be used someday to improve SysCP As you can see from this blog post, the wireless network works well (as does the wired one). With regards to Gentoo devs, I've already seen and got to know hansmi, KillerFox and Pylon. I've also been told that mabi is around and hanno should be too (at least based on the fact he gave a Lightning Talk about XGL yesterday, which I sadly missed), we should really define a place to meet and get to know eachother... That goes for Gentoo and SysCP users too. I myself can usually be found attending some talk or down in the Hackcenter (central position, at a round table). Have fun! Best regards, CHTEKK. Monday, December 18. 2006Work continues ...
Work on SysCP 1.3 continues, even with Christmas approaching!
General cleanup in various parts was done, me and EleRas reviewed all the regular expressions of the RegExp validator now used to validate data coming from the user, now they're much better and precise, and I've also added a Type validator to check that the type of the passed data is what we expect. Paging was also removed from the 1.3 codebase, as it was incomplete, outdated and completely broken there... It will be reimplemented once we've completed other parts of SysCP 1.3 which have priority. And the biggest change probably, is that the whole login/logout system was updated and rewritten to conform to the new structure, the "new way of doing thins". Best regards, CHTEKK. Sunday, November 19. 2006
New Propel db structure on its way! Posted by Luca Longinotti
in SysCP at
21:56
Comments (0) Trackbacks (0) New Propel db structure on its way!
The new database structure for SysCP 1.4 is taking form, I'd say it's almost complete, only the foreign-key definitions are still missing, something I intend to rectify in a day or two.
While changing towards this new structure, we've also changed to use Propel to connect and work with the database, it will thus replace the old DatabaseHandler. Starting with SysCP 1.4, thanks to all this, we'll also support using SysCP on a PostgreSQL database, and there will also be a module to let your customers create and administrate PostgreSQL databases, just like you can now with MySQL. Only thing that deluded me a little is that the Propel generated classes change when built with MySQL or PgSQL, which is kinda "WTF?", as we're speaking about a database abstraction layer to an extent... Oh well, the changes are tiny and we'll then decide how to approach this... Either distributing two SysCP tarballs, one with PgSQL classes and one with the MySQL ones, or just supplying a diff against the MySQL ones to support PgSQL... Once we're more into the whole thing we'll be able to decide! Best regards, CHTEKK. Friday, November 10. 2006
New PostgreSQL and PHP (late) Posted by Luca Longinotti
in Gentoo at
22:45
Comments (0) Trackbacks (0) New PostgreSQL and PHP (late)
As the title says, I'm late with this blog post, but better late than never...
The new dev-db/libpq and dev-db/postgresql ebuilds reached Portage on Thursday, they seem to work well (we've received positive feedback until now) and already solved a number of bugs! Thanks to dev-zero too for all the work spent on them, we make a good team! Btw, it seems dbs are made to be maintained by two people... Me and dev-zero for PgSQL, me and vivo for MySQL, and it works very well! WEEEE TEAMWORK RULEZ! Thansk guys, it's great to work with you all! On the PHP front, 5.2.0 reached the overlay, I still have to update the eclasses a little and fix some stuff, as well as update the 4.4.X and 5.1.X releases with some patches, which will probably happen tomorrow, and they'll probably be put into Portage on Sunday or Monday, sorry for the little delay, but at least the stuff's well tested and working then. Best regards and a great weekend to all, CHTEKK. Monday, November 6. 2006News, news, ... ;)
Hi all, /me is back, since a few days now, and I've been working on updating stuff...
Today, together with vivo, MySQL 5.0.X stabilization was agreed on, and https://bugs.gentoo.org/144999 updated accordingly. x86 already responded and stabled dev-db/mysql-5.0.26-r1, the other arches will soon follow. The upgrade from 4.1.X should be painless, just remember to read the MySQL upgrading guide for instructions on how to backup your data before the upgrade, and be sure to run revdep-rebuild from gentoolkit after the upgrade, as all things linking to MySQL will need to be recompiled. New PostgreSQL ebuilds are also coming up, those are the first of the new generation of PostgreSQL ebuilds, done together with dev-zero, that will fix up a lot of issues and ease maintainance of PostgreSQL a lot, as well as permitting some exciting new things in the future. ETA for those new ebuilds to enter Portage is this evening (UTC timezone). PHP 5.2.0 is also finally out, congrats to the PHP Team, expect an ebuild for the final version in the PHP Overlay by Wednesday and in Portage by Saturday at most. Samhain will also be updated soon to the newest versions, so if you use that, stay tuned. Work on SysCP 1.3 is going on strong, more about that in another blog entry in the next days. Best regards, CHTEKK. Friday, October 27. 2006
/me away until 03.11 Posted by Luca Longinotti
in Gentoo, Longi's life, LongiTEKK Networks, SysCP at
17:59
Comment (1) Trackbacks (0) /me away until 03.11
I'll be away from this evening UTC until evening UTC 03.11.2006, so don't search for me or await any reply from me.
Absolutely no internet access, so... See ya all in a week! Best regards, CHTEKK. Tuesday, October 24. 2006
Completion of languagesplitting Posted by Luca Longinotti
in SysCP at
23:57
Comments (0) Trackbacks (0) Completion of languagesplitting
Right, no more "update"! I've done the last four modules today and EleRas did all the rest yesterday, many thanks for that.
Now we only need to update the old design and we'll then merge branches/syscp-1.3/ back into trunk/syscp-1.3/. YAY! Step 1 of our plan to conquer the webpanel world completed. EleRas also wrote a fancy script that does some comparisions and generates updated language files also for all the other languages SysCP supports, but those are highly incomplete now that many definitions etc. changed, so they will have to be updated by the translators. English (of course), italian and german we can take care of ourselves, but for all the others we'd very much appreciate help from the community, we already have a list of translators, but having other people also working on it or as backup would really be great! So if you know any of: Portugues, Chinese, Catalan, Russian, French, Spanish, Danish very well, drop a note to flo [at] syscp [dot] org and/or eleras [at] syscp [dot] org, thanks! Best regards, CHTEKK. Tuesday, October 17. 2006Even more 1.3 ideas ;)
Expanding on EleRas's latests posts...
Wrt the email question: I agree that having an additional level, where a user which is intended to only have an email-account, can login and at least modify his own password, is a very good idea. This can then naturally be extended for antispam/antivirus settings, auto-responders, filters, etc.. But, thinking about it, we suffer from the same problem with FTP: how can an additional FTP account user change his own password? Another "ftp" level? No, that's not the solution, as isn't only a new "email" level in my opinion... Continue reading "Even more 1.3 ideas ;)" Saturday, October 14. 2006New SysCP blog & status
Hi all!
This blog post should be my first to also be syndicated on blog.syscp.org, one of the new resources we SysCP devs will use to better bring news and informations to you, the user. First, let me again thank Martin Burchert aka eremit for all the work he's done over the years and the big help and guidance he has provided to all of us, and the really fantastic work done on SysCP 1.3! Thanks Martin! Second, as EleRas said on his previous post, we're working on SysCP 1.3, largely following the proposals of SysCP EP01. We've already implemented most of the backend changes:
Also on the frontend side we're going pretty well:
Also a lot of bugfixes were added, as well as the theme by me and Luca Piona (which is also default in 1.2.14 now, yay!), thanks to EleRas for porting that to the SysCP 1.3 structure! We also should now be E_ALL and E_STRICT compliant on PHP 5.1.6 at least (that's what me and EleRas tested with, no more warnings, yay!). The PHPBeautifier SysCP filter also was ran over the whole codebase, and yelded very good results and a much more readable and beautiful code (it's all about beauty today, isn't it? And as EleRas also already announced, we're currently working on splitting up all the language files into a modular structure, it's no difficult job, but a tedious, boring one! Plans for the future (future = SysCP 1.4 final release):
There's also some talk about adding some type of optional LDAP support sometimes in the future, we'll see about that... Ah, and MacOS X support is also planned, again sometimes in the future, this will probably mainly be done by flo, unless someone buys me a Mac Mini (Intel CPU, at least 1GB ram, contact me for a shipping address That's it. Best regards, CHTEKK. Sunday, July 30. 2006#gentoo-db
#gentoo-db has just opened it's (virtual) doors (or windows or terminals, depends on what IRC client you use
The new channel is intented to provide a platform for discussions, concerning both support and development, centering on Gentoo and databases. At the moment Gentoo MySQL and PostgreSQL people hang out there, but it's my hope to see other developers and/or teams that maintain database-related packages for Gentoo (Firebird, Oracle, SQLite, BerkeleyDB, ...) join too, as well as users with experience in SQL and database management, or just people intersted in databases and their uses. Best regards, CHTEKK. |
QuicksearchSyndicate This BlogCreative CommonsCategoriesArchivesCalendar
Blog Administration |
|||||||||||||||||||||||||||||||||||||||||||||||||


Comments