Merge pull request #53 from jtanx/master
[matches/MCTX3420.git] / irc / log
diff --git a/irc/log b/irc/log
index 822a1d8..52e0630 100644 (file)
--- a/irc/log
+++ b/irc/log
 16:08 < jtanx> because of the -pedantic flag
 21:13 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]"]
 21:23 -!- MctxBot [[email protected]] has joined #mctxuwa_softdev
+--- Day changed Wed Oct 02 2013
+17:34 -!- Rowan [[email protected]] has joined #mctxuwa_softdev
+21:54 -!- Rowan [[email protected]] has quit [Ping timeout]
+--- Day changed Thu Oct 03 2013
+09:30 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+09:30 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]"]
+09:32 -!- MctxBot_ [[email protected]] has joined #mctxuwa_softdev
+09:45 -!- Rowan [[email protected]] has joined #mctxuwa_softdev
+09:47 -!- MctxBot [[email protected]] has quit [Ping timeout]
+10:26 -!- MctxBot_ is now known as MctxBot
+10:37 -!- MctxBot [[email protected]] has quit ["leaving"]
+10:44 -!- MctxBot [[email protected]] has joined #mctxuwa_softdev
+10:45 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+10:45 < jtanx> finally
+11:02 -!- Rowan [[email protected]] has quit [EOF From client]
+12:09 < MctxBot> guh
+12:09 < MctxBot> crappy laptop keeps crashing
+12:17 -!- jtanx [[email protected]] has quit [Ping timeout]
+12:20 -!- jtanx_ [[email protected]] has joined #mctxuwa_softdev
+12:20 -!- jtanx_ is now known as jtanx
+12:28 < jtanx> about login_handler
+12:28 < jtanx> The result from FCGI_ParseRequest
+12:28 < jtanx> for string types
+12:28 < jtanx> should be treated as const char*
+12:29 < jtanx> I guess it really doesn't matter, unless it returns an empty string
+12:29 < jtanx> it's also not true that user/pass would be of max length BUFSIZ
+12:30 < jtanx> because of how it was defined, params has a max length of BUFSIZ
+12:30 < jtanx> but user/pass may be anywhere in that string
+12:30 < jtanx> so their max length < BUFSIZ
+12:30 < jtanx> so the bounds check makes no sense
+12:31 < jtanx> (sure, it prevents an infinite loop, but by that stage, you could be writing to locations where you don't want to anyway)
+12:31 < jtanx> besides, FCGI_ParseRequest should guarantee that they're null terminated
+12:38 < jtanx> also, whitespace (>.< :P)
+12:38 < sam_moore> True, but this is the whole "defensive" programming thing where you assume that some future unspecified developer is going to do something stupid and you attempt to minimise the damage they can cause :P
+12:38 < jtanx> while (*user && isspace(*user)) user++;
+12:38 < jtanx> char *ptr = user;
+12:38 < jtanx> while (*ptr && isalnum(*ptr)) ptr++;
+12:38 < jtanx> *ptr = 0;
+12:39 < jtanx> well
+12:39 < jtanx> by that stage you're screwed anyway
+12:39 < jtanx> not much point doing something that doesn't make sense too
+12:39 < sam_moore> You're more screwed if your program is writing to undefined locations in an infinite loop than if it's writing to a finite number of undefined locations
+12:39 < jtanx> still
+12:39 < jtanx> at least if it's infinite
+12:39 < jtanx> you'll know it crashes
+12:40 < jtanx> actually that's hardly the case
+12:40 < jtanx> because it will come across a zero at some point
+12:40 < jtanx> more often than not
+12:40 < jtanx> but anyway...
+12:40 < jtanx> does valgrind pick that up?
+12:41 < sam_moore> Hah
+12:41 < jtanx> and to be honest, by adding the BUFSIZ check, that's implying their max length when it's actually not
+12:41 < jtanx> which may be confusing in itself
+12:41 < sam_moore> The operating system should pick up a segfault on the first invalid write anyway
+12:41 < jtanx> unless
+12:41 < jtanx> the following region is writeable too
+12:42 < jtanx> eg you have a struct, members follow each other
+12:43 < sam_moore> If you really want to remove the bounds check go ahead
+12:43 < sam_moore> Either way that code does what it's meant to
+12:43 < jtanx> ok, well yeah
+12:44 < jtanx> hmm
+12:44 < jtanx> problem
+12:44 < jtanx> anyone can logout the currently logged in user
+12:44 < jtanx> oh wait
+12:45 < jtanx> sorry
+12:48 < sam_moore> My network is being terrible so I can't say much
+12:48 < sam_moore> One last argument in favour of the BUFSIZ check... if someone modifies the function that "should" be guaranteed to null terminate the string and doesn't... then you fall into an infinite loop
+12:49 < jtanx> well that's a case of too bad
+12:49 < jtanx> if it infinite loops
+12:49 < jtanx> then it shows you've done something wrong, so it'd be a good case to check what you've done
+12:50 < jtanx> if you hide that with a BUFSIZ check, you may not know there's a problem until later down the track
+12:50 < sam_moore> If you port the code to run in a kernel module or something, it's a case of instead of getting a seg fault, you suddenly wipe out all your memory
+12:50 < jtanx> with a kernel module, you'd be testing it pretty rigorously in a vm, i would think :P
+12:51 < sam_moore> Yeah, but it pays not to assume things about the sanity of other programmers
+12:51 < sam_moore> That's why all that extremely irritating "public, private" stuff is used
+12:52 < jtanx> to be honest, I'd rather have it fail fast than come up with weird issues that may/may not happen all the time
+12:52 < sam_moore> Anyway, just remove the bounds check, this is getting ridiciluos
+13:31 < jtanx> hmmm
+13:31 < jtanx> if ($http_cookie ~* "id=([^;] +)(?:;|$)" ) {
+13:31 < jtanx>   set  $id  $1;
+13:31 < jtanx> }
+13:32 < jtanx> right now, only the control key can be sent as the one and only cookie
+13:38 < jtanx> we could get nginx to extract the desired cookie
+14:33 < jtanx> actually nah
+15:02 -!- MctxBot [[email protected]] has quit [Ping timeout]
+16:27 -!- jtanx [[email protected]] has quit [Connection reset by peer]
+21:16 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+21:17 < jtanx> herp derp
+21:17 < jtanx> was idling in mctxuwa
+21:17 < jtanx> not mctxuwa_softdev
+21:40 < jtanx> anyway...
+21:40 < jtanx> a (the) login/logout functionality is almost done for the gui
+21:40 < jtanx> to make it work, I need to add the identify module to the modules that doesn't need login
+21:41 < jtanx> also, maybe fields to indicate if logged in or not when ident is called + if logged in, a 'human friendly' name to display for the user
+22:34 < jtanx> ok
+22:34 < jtanx> it's just about done. It auto redirects you (via javascript) to the login page if you're logged out (and vice versa)
+22:34 < jtanx> this can be disabled for debugging purposes by changing mctx.debug=true in mctx.gui.js
+22:34 < jtanx> it works quite well, I think
+22:35 < jtanx> I still haven't implemented the whole 'friendly name' thing though
+22:35 < jtanx> (e.g the 'Welcome Joe Bloggs' with the actual user name or something)
+22:40 < jtanx> test at: https://mctx.us.to:8043/test/
+22:42 < jtanx> except now there's a logout bug grr...
+22:46 < jtanx> fixed
+23:32 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]"]
+--- Day changed Fri Oct 04 2013
+14:50 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+14:50 < jtanx> so i'm in uni right now
+14:50 < jtanx> and was playing with the webcam
+14:50 < jtanx> If I followed this: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=35689&p=314596
+14:51 < jtanx> It actually displays something and not the black image
+14:51 < jtanx> the problem is that it only displays maybe the top 5% of the image
+14:51 < jtanx> the rest is nothing
+14:51 < jtanx> I think the next step from here is to try compiling the latest version of the uvcvideo driver ourselves
+14:51 < jtanx> see if it helps
+14:59 < jtanx> google 'uvcvideo beaglebone issues'
+14:59 < jtanx> I wonder how we didn't see that before
+15:00 < jtanx> http://e2e.ti.com/support/arm/sitara_arm/f/791/t/223368.aspx
+15:03 < jtanx> so many issues getting the camera to work
+15:03 < jtanx> https://groups.google.com/forum/#!msg/beagleboard/sgCwaP5RVUo/aFPBOk02A7IJ
+15:04 < jtanx> fwiw I'm not sure we'll be able to support cameras at all, at this rate
+15:04 < jtanx> although some seem to have success with UVC video. no idea why
+15:08 < jtanx> except I was testing it on angstrom 
+15:08 < jtanx> when i boot off the sd card, there's no modprobe and no rmmod
+15:08 < jtanx> tf
+15:08 < jtanx> wtf
+15:10 < jtanx> derp
+15:10 < jtanx> not root
+15:20 < jtanx> well crap, I got it working with ffmpeg
+15:20 < jtanx>  ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 -vcodec copy o.mjpg
+15:21 < jtanx> along with the 'uvcvideo nodrop=1 timeout=5000 quriks=0x80'
+15:21 < jtanx> it spits out a bunch of warnings though
+15:26 < jtanx> ahh
+15:26 < jtanx> if set to rawvideo
+15:27 < jtanx> 640x480 is not supported
+15:27 < jtanx> it must be that it's such a large resolution that only mjpg is supported
+15:27 < jtanx> 320x240 works fine
+15:32 < jtanx> ah well
+15:32 < jtanx> that's alll for now
+15:32 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]"]
+16:16 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+21:25 -!- MctxBot [[email protected]] has joined #mctxuwa_softdev
+22:15 < jtanx> I got user friendly names working
+22:15 < jtanx> 'except by user friendly I mean their usernames
+22:16 < jtanx> I guess for LDAP we could look up their real name? but I don't know how to do that.
+22:19 < sam_moore> I'm not sure how, but it can be done
+22:20 < sam_moore> However it's probably a fair amount of work
+22:20 < sam_moore> So I'd make it low priority
+22:20 < jtanx> yeah ok
+22:20 < sam_moore> Afterall, *they* know who they are
+22:20 < sam_moore> Good work with the camera
+22:20 < sam_moore> I'll be in tomorrow morning I guess
+22:20 < sam_moore> Working on another project now
+22:21 < jtanx> Yeah, the camera's still not finished though - it's really buggy and I only got it working with ffmpeg and not opencv
+22:21 < sam_moore> Anything is progress
+22:23 < sam_moore> 0/away
+22:24 < sam_moore> Stupid network lag
+23:13 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]"]
+--- Day changed Sat Oct 05 2013
+08:41 -!- jtanx [[email protected]] has joined #mctxuwa_softdev
+08:44 -!- MctxBot [[email protected]] has quit [Ping timeout]
+11:37 < sam_moore> Hi, I'm at Uni, but we can't access G19
+11:38 < sam_moore> I was hoping Rowan, Justin, James or Callum would come in though
+11:38 < sam_moore> But I guess I need to do more stuff for CITS3003 anyway
+12:18 < jtanx> Sorry, I can't make it today
+12:19 < jtanx> Too much crap with my CITS3242 and CITS2232 projects to deal with
+12:19 < sam_moore> Ok no problem
+13:16 < jtanx> james just posted some layout stuff via email
+13:17 -!- MctxBot [[email protected]] has joined #mctxuwa_softdev
+18:06 < jtanx> now... to do some work on this gui
+21:15 -!- jtanx [[email protected]] has quit ["ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]"]

UCC git Repository :: git.ucc.asn.au