<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>the bits</title>
	<atom:link href="http://www.dreness.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dreness.com/blog</link>
	<description>dre's technical blog</description>
	<lastBuildDate>Mon, 09 Aug 2010 22:29:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>ATI Radeon 5870, where art thou?!</title>
		<link>http://www.dreness.com/blog/?p=181</link>
		<comments>http://www.dreness.com/blog/?p=181#comments</comments>
		<pubDate>Mon, 09 Aug 2010 22:28:36 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=181</guid>
		<description><![CDATA[Want to buy. Can&#8217;t click button. Starcraft II is running pretty nice in my current rig (MacPro4,1 + ATI Radeon 4870), but I&#8217;ve read that the 5870 is substantially faster &#8211; double the VRAM, too.]]></description>
			<content:encoded><![CDATA[<p><a href="http://store.apple.com/us/product/MC743ZM/A?mco=MTY3ODQ5OTY" target="_blank">Want to buy</a>. Can&#8217;t click button.</p>
<p>Starcraft II is running pretty nice in my current rig (MacPro4,1 + ATI Radeon 4870), but I&#8217;ve read that the 5870 is substantially faster &#8211; double the VRAM, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=181</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I closed my facebook account</title>
		<link>http://www.dreness.com/blog/?p=179</link>
		<comments>http://www.dreness.com/blog/?p=179#comments</comments>
		<pubDate>Mon, 09 Aug 2010 18:08:27 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[bit bucket]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=179</guid>
		<description><![CDATA[I&#8217;m writing this so I have something to link to, so I don&#8217;t have to keep answering the question over and over. Starting yesterday, I began to receive emails from various facebook friends, wherein they warned me that perhaps my fb account had been hacked. It seems my fb friends were getting invites for a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing this so I have something to link to, so I don&#8217;t have to keep answering the question over and over.</p>
<p>Starting yesterday, I began to receive emails from various facebook friends, wherein they warned me that perhaps my fb account had been hacked. It seems my fb friends were getting invites for a &#8216;free ipad&#8217; from me. I don&#8217;t have any way to tell whether my account has actually been hacked, but I was able to log in with my current password, change the password, and then disable the account.</p>
<p>I&#8217;ve seen this kind of thing before from other users&#8230; legit-looking invites that are probably faked somehow. I don&#8217;t really know, don&#8217;t really care, except that facebook has just become more trouble than it&#8217;s worth. I now retreat to platforms where messages are not sent on my behalf, ever. Feel free to follow me via Twitter @GuacamoleQueen. You can find my generic, life-oriented musings here: http://dreness.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=179</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Somniac and a UI scripting quickie</title>
		<link>http://www.dreness.com/blog/?p=175</link>
		<comments>http://www.dreness.com/blog/?p=175#comments</comments>
		<pubDate>Thu, 05 Aug 2010 04:20:37 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[The More You Know]]></category>
		<category><![CDATA[bit bucket]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=175</guid>
		<description><![CDATA[Just about every time I want an AppleScript to wait a second or two during script execution, I instinctively insert a &#8220;sleep x&#8221; statement, where x is some small number of seconds. Every time, I&#8217;m surprised when I test the script and my computer promptly&#8230; goes to sleep. The command to use is delay, not [...]]]></description>
			<content:encoded><![CDATA[<p>Just about every time I want an AppleScript to wait a second or two during script execution, I instinctively insert a &#8220;sleep x&#8221; statement, where x is some small number of seconds. Every time, I&#8217;m surprised when I test the script and my computer promptly&#8230; goes to sleep. The command to use is delay, not sleep :)</p>
<p>&#8211;</p>
<p>Here&#8217;s a short bit of UI scripting I use to wrangle the MouseZoom prefpane, which I require prior to playing Quake4 to get just the right mouse acceleration curve. Even though it&#8217;s just an extra click-and-wait, the whole 32 / 64 bit prefpane shuffle has me kinda annoyed, hence this script.</p>
<pre>tell application "System Events"
	tell application "System Preferences"
		activate
		set current pane to pane id "com.benhines.mousezoompp"
	end tell
	delay 1
	tell process "System Preferences"
		click button "OK" of sheet 1 of window "Loading MouseZoom…"
                             --that's an elipsis! accessibility inspector ftw
		delay 2
		keystroke tab
		keystroke tab
		keystroke ".02"
		keystroke tab
	end tell
end tel</pre>
<p><a href="http://www.dreness.com/blog/wp-content/uploads/2010/03/loading-mousezoom.png"><img class="aligncenter size-full wp-image-147" title="loading-mousezoom" src="http://www.dreness.com/blog/wp-content/uploads/2010/03/loading-mousezoom.png" alt="" width="501" height="549" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=175</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GNU screen and white space, holy crap</title>
		<link>http://www.dreness.com/blog/?p=161</link>
		<comments>http://www.dreness.com/blog/?p=161#comments</comments>
		<pubDate>Wed, 28 Jul 2010 03:27:01 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[bit bucket]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=161</guid>
		<description><![CDATA[GNU screen has been a key player in my workflow for a long time, and I&#8217;ve been putting up with a strange and very much undesired screen behavior for just about that long. I don&#8217;t fully understand the problem, but at least now I have a fix. The problem is that when in screen, some [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gnu.org/software/screen/">GNU screen</a> has been a key player in my workflow for a long time, and I&#8217;ve been putting up with a strange and very much undesired screen behavior for just about that long. I don&#8217;t fully understand the problem, but at least now I have a fix.</p>
<p>The problem is that when in screen, some &#8216;full-screen&#8217; curses based apps like vim or mutt will cause screen to render empty space as white space&#8230; like for example all the space between the end of a line and the right side of the window. Normally this is not a problem. Who cares if it&#8217;s white space at the output rendering layer, right? Well, as it turns out, the guy on the other end of the clipboard really cares, even if you are that guy. Trust me. He&#8217;s actually kinda angry that it&#8217;s taken this long for his lobbying efforts to bear fruit.</p>
<p><a href="http://www.dreness.com/blog/wp-content/uploads/2010/07/screenspace-still1.png"><img class="aligncenter size-full wp-image-167" title="screenspace-still" src="http://www.dreness.com/blog/wp-content/uploads/2010/07/screenspace-still1.png" alt="" width="567" height="320" /></a>Anyway, the fix is to employ the services of background color erase, known on the street as bce.</p>
<div id="_mcePaste" style="padding-left: 30px;"><span style="color: #000000;">bce [on|off]</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="color: #000000;">Change background-color-erase setting. If &#8220;bce&#8221; is set to on,  all  charac-</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="color: #000000;">ters cleared by an erase/insert/scroll/clear operation will be displayed in</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="color: #000000;">the current background color. Otherwise the  default  background  color  is</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="color: #000000;">used.</span></div>
<p>The correct setting for me is: on, although I can&#8217;t really deduce that from the above description. Basically I just showed up in #screen on freenode, started mumbling, and somebody was like &#8220;&#8230; bce on?&#8221;, which was enough for me to arrive at the following .screenrc additions:</p>
<p style="padding-left: 30px;">defbce on<br />
term screen-bce</p>
<p>Here&#8217;s a <a href="http://dreness.com/bits/tech/screenspace.mov">short demo</a> of expected behavior outside of screen, broken behavior in screen, and then fixed behavior.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=161</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dreness.com/bits/tech/screenspace.mov" length="7491693" type="video/quicktime" />
		</item>
		<item>
		<title>SSL Passphrase in Mac OS X Server</title>
		<link>http://www.dreness.com/blog/?p=158</link>
		<comments>http://www.dreness.com/blog/?p=158#comments</comments>
		<pubDate>Thu, 08 Jul 2010 17:49:17 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[bit bucket]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=158</guid>
		<description><![CDATA[Here&#8217;s a one-liner (spread across two lines for the 80 column internet) for mining Mac OS  X Server&#8217;s SSL passphrase out of Keychain: security dump-keychain -d /Library/Keychains/System.keychain &#124; \ grep '"svce"&#60;blob&#62;="Mac OS X Server certificate management"' -A 3 &#124; tail -n 1 Typically this is most useful right before you say something like the following, [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a one-liner (spread across two lines for the 80 column internet) for mining Mac OS  X Server&#8217;s SSL passphrase out of Keychain:</p>
<pre><span style="color: #000000;">security dump-</span><span style="color: #000000;">keychain</span><span style="color: #000000;"> -d /Library/</span><span style="color: #000000;">Keychains</span><span style="color: #000000;">/System.</span><span style="color: #000000;">keychain</span><span style="color: #000000;"> | \
grep '"</span><span style="color: #000000;">svce</span><span style="color: #888888;"><span style="color: #000000;">"&lt;blob&gt;="Mac OS X Server certificate management"' -A</span><span style="color: #000000;"> 3 | tail -n 1</span></span></pre>
<p>Typically this is most useful right before you say something like the following, which writes out a decrypted version of the private key (after you supply the passphrase, of course :)</p>
<pre>openssl rsa -in key.pem -out decrypted-key.pem</pre>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=158</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CalendarServer on Ubuntu 10.0.4 Desktop</title>
		<link>http://www.dreness.com/blog/?p=153</link>
		<comments>http://www.dreness.com/blog/?p=153#comments</comments>
		<pubDate>Wed, 23 Jun 2010 16:22:34 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[bit bucket]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=153</guid>
		<description><![CDATA[&#8220;Why should I read this silly article when I can just install the CalendarServer .deb?!&#8221;, you might be thinking. That&#8217;s easy. That deb is release 1.2, which is like a million years old or something. Lots of great stuff has been added since then, such as shared calendars and the integration of the formerly separate [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Why should I read this silly article when I can just install the CalendarServer .deb?!&#8221;, you might be thinking. That&#8217;s easy. That deb is release 1.2, which is like a million years old or something. Lots of great stuff has been added since then, such as shared calendars and the integration of the formerly separate AddressBook server.</p>
<p>The concept here is to use apt to satisfy as many of the CalendarServer dependencies as possible, then let the &#8216;run&#8217; script do the rest. I&#8217;ve tested this numerous times, and it works pretty flawlessly. I&#8217;ll have more detailed content later, but I just wanted to get the quick steps out there for any bleeding edgers out there&#8230;</p>
<p>1) edit /etc/fstab to enable xattrs by adding the &#8220;user_xattr&#8221; option.</p>
<p>e.g. (all on one line):</p>
<p>UUID=8f2bb850-0e8f-4d81-bba5-fb93ef9b9990 /               ext4    errors=remount-ro,<strong>user_xattr</strong> 0       1</p>
<p>after doing the above you need to reboot, or &#8220;sudo mount / -o remount&#8221;</p>
<p>2) sudo apt-get build-dep postgresql</p>
<p>3) sudo apt-get install python-setuptools python-xattr python-twisted subversion curl</p>
<p>4) svn co <a href="http://svn.macosforge.org/repository/calendarserver/CalendarServer/trunk">http://svn.macosforge.org/repository/calendarserver/CalendarServer/trunk</a> CalendarServer</p>
<p>5) cd CalendarServer ; ./run -s</p>
<p>&#8230; at this point, if all goes well, you should be prompted with a message indicating that there is no config file. Run the suggested command to use the sample config file. You can then start the server with run -d, and run the protocol tests using the &#8216;testserver&#8217; script.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=153</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare Fusion 3.1 is way faster</title>
		<link>http://www.dreness.com/blog/?p=151</link>
		<comments>http://www.dreness.com/blog/?p=151#comments</comments>
		<pubDate>Thu, 03 Jun 2010 00:37:14 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X Server]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=151</guid>
		<description><![CDATA[Check this out. I ran the &#8216;openssl speed&#8217; benchmark in Ubunto Desktop 10.0.4 in Fusion 3.0.2 and again in 3.1. The difference is pretty impressive.]]></description>
			<content:encoded><![CDATA[<p>Check this out. I ran the &#8216;openssl speed&#8217; benchmark in Ubunto Desktop 10.0.4 in Fusion <a href="http://dreness.com/bits/tech/openssl-speed-fusion-3.0.2.txt" target="_blank">3.0.2</a> and again in <a href="http://dreness.com/bits/tech/openssl-speed-fusion-3.1.txt" target="_blank">3.1</a>. The difference is pretty impressive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=151</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Of logs and non-boot volumes</title>
		<link>http://www.dreness.com/blog/?p=142</link>
		<comments>http://www.dreness.com/blog/?p=142#comments</comments>
		<pubDate>Sun, 14 Mar 2010 19:02:56 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X Server]]></category>
		<category><![CDATA[Pro Tip]]></category>
		<category><![CDATA[The More You Know]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=142</guid>
		<description><![CDATA[It&#8217;s a beautiful Sunday morning, and as you wait for the coffee to start working, you figure it&#8217;s probably about time that you started on those benchmark results that have to be done by Monday. You&#8217;re sitting there thinking &#8220;MAN I wish I&#8217;d provisioned a larger boot volume for these Mac Minis, I keep filling [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a beautiful Sunday morning, and as you wait for the coffee to start working, you figure it&#8217;s probably about time that you started on those benchmark results that have to be done by Monday. You&#8217;re sitting there thinking &#8220;MAN I wish I&#8217;d provisioned a larger boot volume for these Mac Minis, I keep filling it up with logs! Oh wait, I have a smart idea that I acquired from thinking! Maybe I can use the non-boot volume to hold the computer software logs, since it has SO much more space! Ok then, all I need to do is find the buttons for making a symbolic link from /var/log to /Volumes/foo/log, and then&#8230; it&#8217;ll work! Yeah!&#8221;</p>
<p>And lo, it did work, for a time. Imagine my surprise when 2 out of 20 of my mac mini-ons became unusable for my nefarious purposes of generating ical server load because the data volume used by the load simulator was somehow mounted read-only! The two failing minions also happened to be the two that were recently rebooted, after moving their power cables to different power circuits (to prevent blowing breakers, but that&#8217;s a whole other story). I didn&#8217;t ask for this crazy read-only nonsense!</p>
<p>Volumes get mounted read-only early at boot time, every time you boot, and that is normal. Usually, they are very quickly re-mounted in read-write mode, which is&#8230; ya know, more useful and stuff. My best guess at the fail here is that some part of the logging subsystem tried to open /Volumes/foo while it was still read-only, and SUCCEEDED when it probably should have failed. After all, what is the point of a logging system that mounts its log targets read-only, other than to prevent re-mounting of that filesystem read-write!</p>
<p>It appears that this happens. So, don&#8217;t do it, unless you wanted both no logging and a read-only data volume.</p>
<p>Recovering from this was not as easy as it should have been. On the first minion, I actually got beyond nuking /Volumes/foo until I remembered the /var/log symlink, so then I removed the symlink, re-created /var/log, and rebooted &#8211; this fixed minion number one. The SECOND minion was weirder. I removed the /var/log symlink, made a local /var/log, then rebooted &#8211; but /Volumes/foo still came back read-only! What?! Well I&#8217;m on a schedule so I just blew that one away too (diskutil eraseVolume), and then it came back ok &#8211; *after another reboot*. Funky.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=142</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automator: Variable stacking</title>
		<link>http://www.dreness.com/blog/?p=124</link>
		<comments>http://www.dreness.com/blog/?p=124#comments</comments>
		<pubDate>Fri, 12 Feb 2010 23:56:37 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[bit bucket]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=124</guid>
		<description><![CDATA[Shortly after discovering the existence of variables as real drag-n-droppable objects in Applescript Studio, I ran smack into a big limitation: the linear flow of an Automator workflow does not seem to allow for storing and recalling multiple values at once. Fortunately I was mistaken, as I discovered by accident while examining the &#8216;results&#8217; view [...]]]></description>
			<content:encoded><![CDATA[<p>Shortly after discovering the existence of variables as real drag-n-droppable objects in Applescript Studio, I ran smack into a big limitation: the linear flow of an Automator workflow does not seem to allow for storing and recalling multiple values at once. Fortunately I was mistaken, as I discovered by accident while examining the &#8216;results&#8217; view of each workflow object as it received data from upstream objects. We begin with a touch of background.</p>
<p>At first blush, the &#8220;Get Value of Variable&#8221; action seems like it can only really be used in conjunction with &#8220;Set Value of Variable&#8221;. You&#8217;d use &#8220;Set&#8221; to catch the output of some upstream object, and then store the value for later use.</p>
<p><img class="aligncenter size-full wp-image-125" title="set-value-of-variable" src="http://www.dreness.com/blog/wp-content/uploads/2010/02/set-value-of-variable.png" alt="set-value-of-variable" width="578" height="287" /></p>
<p>For those actions which do not support direct use of variable objects (e.g. &#8220;Name Single Item in Finder Item Names), one might instead try to pass the variable data as input, by connecting the input of a &#8220;Run Applescript&#8221; object to the output of &#8220;Get Value of Variable&#8221;, as long as you&#8217;re prepared to hand-write the stuff you need in Applescript.</p>
<p>That&#8217;s all well and good, until you realize that you need to use more than one variable in your &#8220;Run Applescript&#8221; object. For example, let&#8217;s say you&#8217;re writing a file re-namer &#8211; you might need to pass in the file extension of the &#8216;old&#8217; file name, as well as the &#8216;new&#8217; file name. &#8220;Get Value of Variable&#8221; can only recall a single variable&#8217;s value.</p>
<p>Here&#8217;s the trick: &#8220;Get Value of Variable&#8221; ALSO acts as a pass-through for whatever it receives on input, which allows you to stack multiple &#8220;Get Value&#8221;s, and then connect them to &#8220;Run Applescript&#8221;. In the &#8220;Run&#8221; object, the value of &#8216;input&#8217; will be a list of the values received. In the below example, I&#8217;ve got a pair of &#8220;Get&#8221;s under another object which outputs a file / folder reference, then all of that output is dumped into a &#8220;Run&#8221; object. Those values are then accessed in the standard fashion: &#8220;the first text item of input&#8221;, &#8220;the second item of input&#8221;, etc.</p>
<p><img class="aligncenter size-full wp-image-129" title="get-double-stack" src="http://www.dreness.com/blog/wp-content/uploads/2010/02/get-double-stack.png" alt="get-double-stack" width="513" height="662" /></p>
<p>Finally, the &#8220;Get Value&#8221; behavior of accepting input can be disabled by control-clicking on the &#8220;Get Value of Variable&#8221; title text on the object.</p>
<p><img class="aligncenter size-full wp-image-134" title="get-value-contextual-menu" src="http://www.dreness.com/blog/wp-content/uploads/2010/02/get-value-contextual-menu.png" alt="get-value-contextual-menu" width="174" height="199" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=124</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LDAP client: local static and variable mappings</title>
		<link>http://www.dreness.com/blog/?p=102</link>
		<comments>http://www.dreness.com/blog/?p=102#comments</comments>
		<pubDate>Tue, 24 Nov 2009 00:17:18 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X Server]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=102</guid>
		<description><![CDATA[I was recently discussing Mac OS X / Active Directory integration with a friend, and one of the things I mentioned was the local static / variable mappings feature of the Mac OS X LDAPv3 plugin. After some fairly extensive internet searching, it appears that the only reason I know about that feature is because [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently discussing Mac OS X / Active Directory integration with a friend, and one of the things I mentioned was the local static / variable mappings feature of the Mac OS X LDAPv3 plugin. After some fairly extensive internet searching, it appears that the only reason I know about that feature is because I learned about it in Apple&#8217;s official training courses about Mac OS X Server and Directory Services several years ago; in other words, there appears to be no public documentation of this, except for the <a href="http://www.peachpit.com/store/product.aspx?isbn=0321509730">Peachpit 10.5 Directory Services</a> book (and probably <a href="http://www.peachpit.com/store/product.aspx?isbn=0321635329">the 10.6 version</a> that is unpublished as of this writing). Until now.</p>
<p>This is all in the context of configuring LDAP mappings using Directory Utility, one of the many topics covered in <a href="http://images.apple.com/server/macosx/docs/Open_Directory_Admin_v10.6.pdf">this PDF</a> from Apple. The following content would fit in around page 149.</p>
<p>In addition to configuring custom mappings by referring to existing attributes by name (e.g. repurposing an unused attribute), you can also create local mappings that are either static or dynamic. A static mapping for an attribute means that a specified text string will be returned when the attribute is queried, instead of checking the actual record on the directory server. A local variable mapping allows you to compose the value from a mixture of supplied text strings and also references to other attribute values.</p>
<p><strong>Background: LDAP Mappings<br />
<span style="font-weight: normal;">First, let us visualize what a mapping is. To really see this work on your own machine, you&#8217;ll need to be connected to some real LDAP service. Check out <a href="https://helposx.apple.com/snowleopard/directoryutilityhelpr1/en.lproj/pgs/od494316a0.html">these steps</a> if you&#8217;re unsure how to get at the LDAP mapping configuration in Directory Utility. In general, the process of &#8216;mapping&#8217; is used to express relationships between the schema of different directory systems. There is a &#8216;standard&#8217; name space that is used by Mac OS X to describe things that it needs to talk about (e.g. the name of the attribute that holds the user id). This standard name space is so-called because it is agnostic of any specific directory data storage backend. There are also &#8216;native&#8217; name spaces for each backend that are used to refer to the things in that directory store.</span></strong></p>
<p>Let&#8217;s say I have a user account in an LDAP directory, and I want to look up the unix ID and the value in the &#8216;comment&#8217; field. The &#8216;standard&#8217; names for these attributes are UniqueID and Comment. You can find the full definition of Apple&#8217;s &#8216;standard&#8217; name space on page 273 of the aforementioned PDF.</p>
<pre>{28} andre@donk [~] % dscl /Search read /Users/dre UniqueID Comment
Comment:
 just this guy, you know...
UniqueID: 42</pre>
<p>If we add the -raw option, we see the name space that is associated with the attributes:</p>
<pre>{29} andre@donk [~] % dscl -raw /Search read /Users/dre UniqueID Comment
dsAttrTypeStandard:Comment:
 just this guy, you know...
dsAttrTypeStandard:UniqueID: 42</pre>
<p>dsAttrTypeStandard is the prefix for &#8216;standard&#8217; attributes. Now let&#8217;s look in the LDAP mapping configuration to observe how these standard attributes are mapped to native attributes on the LDAP server:</p>
<p><img class="size-full wp-image-107 alignnone" title="user-comment" src="http://www.dreness.com/blog/wp-content/uploads/2009/11/user-comment.png" alt="user-comment" width="499" height="589" /></p>
<p>For this LDAP configuration, whenever we get a query for the Comment attribute of a user record, we will look up the &#8216;native&#8217; attribute named &#8216;description&#8217;. Using dscl, we can ask for things using either the native or standard name.</p>
<pre>{30} andre@donk [~] % dscl -raw /Search read /Users/dre \
UniqueID Comment description UidNumber
dsAttrType<strong>Native</strong>:description:
 just this guy, you know...
dsAttrType<strong>Native</strong>:UidNumber: 42
dsAttrType<strong>Standard</strong>:Comment:
 just this guy, you know...
dsAttrType<strong>Standard</strong>:UniqueID: 42</pre>
<p>To change the mapping, simply add or remove items from the right-side list. One common use case for a customized mapping is when the Mac OS X client is connecting to a directory service that doesn&#8217;t have a defined attribute for storing a piece of data that is required by Mac OS X. You might choose to  instead re-purpose an existing but unused attribute to store this data. To pull that off, you simply add the mapping for the appropriate &#8216;standard&#8217; attribute, using the native name of the re-purposed attribute.</p>
<p><strong>Local Static Mappings<br />
<span style="font-weight: normal;">Suppose that you want all clients to use the same specific value for a given attribute. In this case, a local static mapping will do the trick. Let&#8217;s say for this example that I want to create a local static mapping for the &#8220;Street&#8221; attribute. I currently have no value for that attribute in my user record:</span></strong></p>
<pre>{32} andre@donk [~] % dscl -raw /Search read /Users/dre Street
No such key: Street</pre>
<p>Let&#8217;s add one. Click &#8220;Add&#8230;&#8221; under the right-side list. Normally this is where you&#8217;d type the name of some attribute. To treat the supplied text as a literal value instead of an attribute name to look up, prefix with a hash sign (#).</p>
<p><img class="alignnone size-full wp-image-108" title="user-street" src="http://www.dreness.com/blog/wp-content/uploads/2009/11/user-street.png" alt="user-street" width="500" height="498" /></p>
<p>Now when we do the same query as before:</p>
<pre>{37} andre@donk [~] % dscl -raw /Search read /Users/dre Street
dsAttrTypeStandard:Street:
 Shakedown Street</pre>
<p>This also demonstrates that you&#8217;re allowed to have multiple mapped values, although the results aren&#8217;t that interesting yet&#8230; read on.</p>
<p><strong>Local Variable Mappings<br />
<span style="font-weight: normal;">Local variable mappings are just a twist on the above. A good example is using a variable that represents the user&#8217;s short name to compose a home directory path. Click &#8220;Add&#8230;&#8221; and enter the text #/road/to/$uid$. Next, drag the entry you just created above the existing homeDirectory entry. The order in this list determines the order that results are returned. For attributes that are supposed to be single-value (like this one), that means that the requestor will only get the first result.</span></strong></p>
<p><img class="alignnone size-full wp-image-109" title="user-nfshomedirectory" src="http://www.dreness.com/blog/wp-content/uploads/2009/11/user-nfshomedirectory.png" alt="user-nfshomedirectory" width="500" height="503" /></p>
<pre>{40} andre@donk [~] % dscl -raw /Search read /Users/dre NFSHomeDirectory
dsAttrTypeStandard:NFSHomeDirectory: /road/to/dre
/Network/Servers/host.orange.com/Volumes/yowza/dre</pre>
<p>At the Open Directory layer, we see that there are actually two values returned &#8211; our local variable mapping, and also another (obfuscated) result that came from the LDAP server. What happens if we actually request this data using a &#8216;real&#8217; directory services client?</p>
<pre>{2} andre@donk [~] % cd ~dre
cd: no such file or directory: /road/to/dre</pre>
<p>We see that &#8216;cd&#8217; only gets one result &#8211; the first one in the list. Of course it&#8217;s a dead end, because this is just an example!</p>
<p><strong>Don&#8217;t forget&#8230;<br />
<span style="font-weight: normal;">Everything you&#8217;ve seen here is 100% client-side, and only applies to the computer you used to configure the custom mappings. If you find yourself running around configuring custom mappings on a bunch of computers, you are probably doing it wrong &#8211; in this case, please check out the handy &#8220;Write to Server&#8230;&#8221; button. This publishes the custom mappings to the LDAP server where they will be automatically downloaded by other Mac OS X Clients &#8211; provided that the LDAP server has the required support for hosting this data; it wants to put this data in a record under Config called macosxodconfig, in an attribute called &#8216;description&#8217;. Here&#8217;s a nice <a href="http://blogs.techworld.com/a-world-without-walls/2009/11/osx-and-openldap-taming-the-leopard/index.htm">techworld article</a> that provides an example of all this from start to finish.</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=102</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php 5.3: short_open_tag default has changed!</title>
		<link>http://www.dreness.com/blog/?p=95</link>
		<comments>http://www.dreness.com/blog/?p=95#comments</comments>
		<pubDate>Thu, 24 Sep 2009 16:17:57 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[bit bucket]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=95</guid>
		<description><![CDATA[Snow Leopard Server includes an upgrade of PHP to version 5.3. This version has a changed default for the &#8220;short_open_tag&#8221; option as compared to the version that shipped in Leopard server. The difference is that short_open_tag is now disabled by default, which means that the following will not work: &#60;? phpinfo(); ?&#62; The problem is [...]]]></description>
			<content:encoded><![CDATA[<p>Snow Leopard Server includes an upgrade of PHP to version 5.3. This version has a changed default for the &#8220;short_open_tag&#8221; option as compared to the version that shipped in Leopard server. The difference is that short_open_tag is now disabled by default, which means that the following will not work:</p>
<pre>&lt;?
phpinfo();
?&gt;</pre>
<p>The problem is the opening &lt;?, which is in &#8216;short&#8217; form. The long / normal form of the open tag would be &lt;?php. If you don&#8217;t feel like editing all your scripts, you can simply declare the following in your /etc/php.ini:</p>
<pre>short_open_tag = On</pre>
<p>To further illustrate the change, consider the following command results, produced on a Snow Leopard Server that was upgraded from Leopard:</p>
<pre>bash-3.2# grep 'short_open' /etc/php*default*
php.ini.default:; short_open_tag
php.ini.default:short_open_tag = <strong>Off</strong>
php.ini.default-5.2-previous:short_open_tag = <strong>On</strong>
php.ini.server-default:; short_open_tag
php.ini.server-default:short_open_tag = <strong>Off</strong></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=95</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>eggdrop1.6.19+ctcpfix</title>
		<link>http://www.dreness.com/blog/?p=91</link>
		<comments>http://www.dreness.com/blog/?p=91#comments</comments>
		<pubDate>Mon, 06 Jul 2009 21:24:07 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=91</guid>
		<description><![CDATA[Not exactly new, but since I&#8217;m the eggdrop maintainer for macports, and since I haven&#8217;t updated this port for almost 3 years&#8230; here ya go! Macports users may sudo port -d selfupdate to retrieve the updated Portfile (and new patch file). Details: https://trac.macports.org/ticket/20198]]></description>
			<content:encoded><![CDATA[<p>Not exactly new, but since I&#8217;m the eggdrop maintainer for macports, and since I haven&#8217;t updated this port for almost 3 years&#8230; here ya go!</p>
<p>Macports users may sudo port -d selfupdate to retrieve the updated Portfile (and new patch file).</p>
<p>Details: https://trac.macports.org/ticket/20198</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=91</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4870: why aren&#8217;t you supported on MacPro1,1?</title>
		<link>http://www.dreness.com/blog/?p=84</link>
		<comments>http://www.dreness.com/blog/?p=84#comments</comments>
		<pubDate>Sat, 27 Jun 2009 04:31:34 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[mac pro]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=84</guid>
		<description><![CDATA[UPDATE: This is no longer a mystery. If you want the punchline, please proceed directly to the comments at the end of this post. The ATI HD 4870 video card is a nice upgrade from the NVidia 8800 GT (my current card), however it&#8217;s not supported on the first generation Mac Pro (my current Mac [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: This is no longer a mystery. If you want the punchline, please proceed directly to the comments at the end of this post.</p>
<p>The <a title="ATI HD 4870 video card" href="http://store.apple.com/us/product/MB999ZM/A" target="_blank">ATI HD 4870 video card</a> is a nice upgrade from the NVidia 8800 GT (my current card), however it&#8217;s not supported on the first generation Mac Pro (my current Mac Pro). Apple&#8217;s site states:</p>
<h4>Compatibility:</h4>
<ul>
<li>Requires Mac Pro (Early 2009 with 1066MHz DDR3 memory) or Mac Pro (Early 2008 with 800MHz DDR2 FB-DIMM memory) with PCI Express 2.0 slot</li>
</ul>
<p>(The MacPro1,1 has 667 MHz DDR2 memory). I heard a rumor on the internets that this card DOES in fact work on a MacPro1,1 &#8211; with no issues or weirdness, so I had to try. My card arrived yesterday, and I&#8217;m here to report that indeed, it seems to work fine!</p>
<p>So far, I&#8217;ve only tried it in WoW and Motion, but so far so good&#8230; Well except for the fact that the <a href="http://blogs.vmware.com/teamfusion/2009/05/a-message-to-mac-users-with-atibased-system-about-apples-mac-os-x-1057.html" target="_blank">ATI driver in 10.5.7 breaks 3d acceleration in VM guests</a>&#8230; oh wells.</p>
<p>The question remains: why is this card not supported on the first-gen Mac Pro?</p>
<p><img class="alignnone size-full wp-image-88" title="asp" src="http://www.dreness.com/blog/wp-content/uploads/2009/06/asp.png" alt="asp" width="600" height="641" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=84</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Problem With Twitter</title>
		<link>http://www.dreness.com/blog/?p=81</link>
		<comments>http://www.dreness.com/blog/?p=81#comments</comments>
		<pubDate>Tue, 24 Mar 2009 18:43:20 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[You Do It]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=81</guid>
		<description><![CDATA[The Problem With Twitter is that the concept of &#8216;signal to noise ratio&#8217; is an intensely personal thing. It varies greatly with mood, activity level of people being followed, current political events, weather, appetite, what&#8217;s on sale this weekend, presence of television &#8216;marathons&#8217; of popular shows, etc, etc, etc. Even that one sentence has nearly [...]]]></description>
			<content:encoded><![CDATA[<p>The Problem With Twitter is that the concept of &#8216;signal to noise ratio&#8217; is an intensely personal thing. It varies greatly with mood, activity level of people being followed, current political events, weather, appetite, what&#8217;s on sale this weekend, presence of television &#8216;marathons&#8217; of popular shows, etc, etc, etc. Even that one sentence has nearly depleted my desire to continue writing. I promise I won&#8217;t be talking about those things here. Suffice to say that the single linear stream of messages ordered by age is completely and utterly wrong.</p>
<p>I&#8217;ve seen people tagging twitter messages with things like #foo or #bar. I haven&#8217;t read the RFCs on this behavior (heh), but I&#8217;m guessing that these are really just tags, used to create relationships between twats (that&#8217;s right). I have NOT seen any notion of verbosity level, which is the one thing that twitter desperately needs. Just for you, here&#8217;s my million dollar idea. Please, take the challenge. I can&#8217;t do it cause I have handcuffs&#8230; but really, I wouldn&#8217;t even if I didn&#8217;t.Â I think the trickiest part of all this is that many of the people who would fix this are themselves the worst offenders, so performing my suggestion would constitute an admission that they themselves are often uninteresting. If that&#8217;s you, please understand that I mean no offense&#8230; I&#8217;m mostly uninteresting as well (the difference is that I don&#8217;t share it with the world). Just think of this as a way to refrain from driving users off your &#8216;platform&#8217;.</p>
<p>All twitter clients should support tagging outbound messages with a &#8216;priority&#8217; of 0 through 9. Twitter users are not required to tag their twats (that&#8217;s right) with a verbosity level, but they are encouraged to do so.</p>
<p>All twitter clients should support a verbosity filter for the main messages view. I would implement this as a slider that effects the UI as you drag it up or down from 0 to 9. This would easily allow a reader to start at 9 and slowly drag down, seeing messages appear in order from most to least &#8216;important&#8217; (still sorted by age).</p>
<p>Now, here&#8217;s the key. It is only natural that many or most of your followees (leaders?) will use what you consider to be an incorrect verbosity level for some or all of their messages. That&#8217;s why the client supports the notion of TwatFactor, a per-user setting which is a simple mathematical function applied to the verbosity level of all inbound messages from a given user. This could be as simple as &#8220;whatever that guy set, minus 3&#8243;, or something more debonaire like some kind of non-linear scaling factor that gets more or less &#8216;sensitive&#8217; as you approach the extremes of the scale.</p>
<p>Extra credit: anonymously publish and consume TwatFactor settings from other users, the end result of which could be a bona-fide self balancing system where all users get just the amount of content they want.</p>
<p>Go!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=81</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When your seagate 1.5 TB hard drive begins to fail&#8230;</title>
		<link>http://www.dreness.com/blog/?p=78</link>
		<comments>http://www.dreness.com/blog/?p=78#comments</comments>
		<pubDate>Wed, 25 Feb 2009 05:17:47 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[Pro Tip]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=78</guid>
		<description><![CDATA[you might say to yourself, &#8220;yes, that&#8217;s definitely busted up. I can tell by all the fsck failures, and how sometimes it&#8217;ll spin up and down a bunch of times all anxious-like, right before a nasty kernel panic.&#8221; perhaps you look into it, carefully examining logs, and suspect that this is probably related to time [...]]]></description>
			<content:encoded><![CDATA[<p>you might say to yourself, &#8220;yes, that&#8217;s definitely busted up. I can tell by all the fsck failures, and how sometimes it&#8217;ll spin up and down a bunch of times all anxious-like, right before a nasty kernel panic.&#8221;</p>
<p>perhaps you look into it, carefully examining logs, and suspect that this is probably related to time machine backups (which is the exclusive use of this disk, and which surely does involve a lot of disk activity), and think you can be clever by simply turning off Time Machine and unmounting this volume to work around those unsightly panics. but no. no, I say.</p>
<p>Any time I had to reboot, I would always make sure to unmount this volume immediately. With it unmounted, I reasoned, the disk should just sit there unused&#8230; defective, but dormant.</p>
<p>This is wrong. I would still hear this disk spin up and down followed by kernel panics. The volume was not actually being mounted, according to the kernel&#8230; so who knows what was making it spin up and down. Something.</p>
<p>So, when your seagate 1.5 TB hard drive begins to fail: take the 3 minutes to shut down and disconnect it from your computer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=78</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross-application URL cache searching!</title>
		<link>http://www.dreness.com/blog/?p=73</link>
		<comments>http://www.dreness.com/blog/?p=73#comments</comments>
		<pubDate>Tue, 28 Oct 2008 05:52:16 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[The More You Know]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=73</guid>
		<description><![CDATA[I was out taking a (filesystem) walk, and wandered into /var/folders. Not remembering where / when this came from, I was pleased to find that the hier(7) manpage is aware of this directory, describing it as &#8216;per-user temporary files and caches&#8217;. More research reveals that this directory structure is created as defined by some code [...]]]></description>
			<content:encoded><![CDATA[<p>I was out taking a (filesystem) walk, and wandered into /var/folders. Not remembering where / when this came from, I was pleased to find that the <a title="hier(7) manpage" href="x-man-page://hier" target="_blank">hier(7) manpage</a> is aware of this directory, describing it as &#8216;per-user temporary files and caches&#8217;. More research reveals that this directory structure is created as defined by <a title="some code in Apple's Libc" href="http://www.opensource.apple.com/darwinsource/10.5/Libc-498/darwin/" target="_blank">some code in Apple&#8217;s Libc </a>as of Leopard. Some of the constants are defined in <a title="Libc-498/darwin/dirhelper_priv.h" href="http://www.opensource.apple.com/darwinsource/10.5/Libc-498/darwin/dirhelper_priv.h" target="_blank">dirhelper_priv.h</a>, and the corresponding <a title="_dirhelper.c" href="http://www.opensource.apple.com/darwinsource/10.5/Libc-498/darwin/_dirhelper.c" target="_blank">_dirhelper.c</a> does the creating and locating of directories &#8211; note the fancy two-level hashing.</p>
<p>Walking around more, I find that I&#8217;ve got a directory for myself (as observed via the file permissions) with the following contents:</p>
<pre>drwx------  35 andre  staff  1190 Oct 27 19:34 -Caches-
drwx------  12 andre  staff   408 Oct 27 21:03 -Tmp-
drwxrwxrwx@  3 andre  staff   102 Oct 27 20:42 Cleanup At Startup
drwxr-xr-x   2 andre  staff    68 Oct 27 19:26 TemporaryItems</pre>
<p>The -Caches- folder contains application directories in the reverse domain notation, e.g. com.apple.Safari, or com.apple.mail or com.blizzard.worldofwarcraft. All of these directories seem to have at least one file: Cache.db. hmm&#8230; ok, database. fun. Let&#8217;s see what&#8217;s in it!</p>
<pre>{56} andre@gyro [-Caches-/com.apple.Safari] % file Cache.db
Cache.db: SQLite database (Version 3)</pre>
<p>Cool! I can do sqlite3&#8230;</p>
<pre>{74} andre@gyro [-Caches-/com.apple.Safari] % sqlite3 Cache.db
SQLite version 3.4.0
Enter ".help" for instructions
sqlite&gt; .tables
cfurl_cache_blob_dataÂ Â Â Â Â Â  cfurl_cache_schema_version
cfurl_cache_responseÂ Â Â Â Â 
sqlite&gt; .schema cfurl_cache_response</pre>
<p>(this produces output with really long lines, so let&#8217;s hop back to the shell right quick)</p>
<pre>sqlite3 Cache.db ".schema cfurl_cache_response" | fold -s
CREATE TABLE cfurl_cache_response(entry_ID INTEGER PRIMARY KEY AUTOINCREMENT
UNIQUE, 		     version INTEGER, hash_value INTEGER,
storage_policy INTEGER, request_key TEXT UNIQUE, 		     time_stamp
NOT NULL DEFAULT CURRENT_TIMESTAMP);
CREATE INDEX request_key_index ON cfurl_cache_response(request_key);
CREATE INDEX time_stamp_index ON cfurl_cache_response(time_stamp);</pre>
<p>ok, back in sqlite3 interactive mode now:</p>
<pre>sqlite&gt; .mode line
sqlite&gt; select * from cfurl_cache_response where entry_ID=1;
      entry_ID = 1
       version = 0
    hash_value = -1475899696
storage_policy = 0
   request_key = http://i.cdn.turner.com/cnn/.element/css/2.0/pgaleader.css
    time_stamp = 2008-10-28 01:55:10
sqlite&gt;
sqlite&gt; select * from cfurl_cache_response where entry_ID&lt;4;
      entry_ID = 1
       version = 0
    hash_value = -1475899696
storage_policy = 0
   request_key = http://i.cdn.turner.com/cnn/.element/css/2.0/pgaleader.css
    time_stamp = 2008-10-28 01:55:10

      entry_ID = 2
       version = 0
    hash_value = -763438389
storage_policy = 0
   request_key = http://i.cdn.turner.com/cnn/.element/css/2.0/main.css
    time_stamp = 2008-10-28 01:55:10

      entry_ID = 3
       version = 0
    hash_value = 1822950361
storage_policy = 0
   request_key = http://www.cnn.com/
    time_stamp = 2008-10-28 01:55:10</pre>
<p>Neat! Ok ok, here&#8217;s the cross-app url cache searching code:</p>
<pre>#!/bin/bash
# Here's a little ditty that does keyword searching across all the URLs in your
# /var/folders caches directory - the one returned by
# /usr/bin/getconf DARWIN_USER_CACHE_DIR

# Search term comes in as first command line argument
# -v is an optional second argument to list databases are they are searched
SEARCH=$1
VERBOSE=0

if [ ! $SEARCH ]
then echo "Usage: $0 [search term] [-v]"
exit
fi

if ( [ -n "$2" ] &amp;&amp; [ $2 == "-v" ] )
then VERBOSE=1
fi

CACHE=`getconf DARWIN_USER_CACHE_DIR`

ls -1 $CACHE/*/Cache.db | while read db
	do
	echo -n ""
	if [ $VERBOSE == "1" ] ; then echo "   Searching $db" ; fi
	sqlite3 $db "select request_key from cfurl_cache_response where \
		request_key LIKE'%$SEARCH%';"
	done</pre>
<p>Probably safe to not depend on any of this being available or staying the way it is in future versions of Mac OS X&#8230; but for now at least, it&#8217;s here and contains data. In case you were wondering, Safari doesn&#8217;t log here when private browsing is enabled :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=73</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Instamapper</title>
		<link>http://www.dreness.com/blog/?p=70</link>
		<comments>http://www.dreness.com/blog/?p=70#comments</comments>
		<pubDate>Sat, 20 Sep 2008 22:51:50 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[bit bucket]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=70</guid>
		<description><![CDATA[Instamapper is kinda nifty. Upload GPS coords from a mobile device to a web service, plot them on google maps. Simple and fun! Here&#8217;s my bike ride home from coffee: Â  They have an iPhone app called GPS Tracker that pushes the coordinates up.]]></description>
			<content:encoded><![CDATA[<p><a href="http://instamapper.com">Instamapper</a> is kinda nifty. Upload GPS coords from a mobile device to a web service, plot them on google maps. Simple and fun! Here&#8217;s my bike ride home from coffee:</p>
<p>Â </p>
<p style="text-align: center;"><a href="http://www.dreness.com/blog/wp-content/uploads/2008/09/instamapper.png"><img class="size-full wp-image-71   aligncenter" title="instamapper" src="http://www.dreness.com/blog/wp-content/uploads/2008/09/instamapper.png" alt="" width="500" height="408" /></a></p>
<p>They have an iPhone app called <a title="GPS Tracker, mobile app for instamapper.com web service" href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=286658744&amp;mt=8">GPS Tracker</a> that pushes the coordinates up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=70</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>get notified!</title>
		<link>http://www.dreness.com/blog/?p=65</link>
		<comments>http://www.dreness.com/blog/?p=65#comments</comments>
		<pubDate>Sun, 07 Sep 2008 22:06:29 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X Server]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=65</guid>
		<description><![CDATA[Mac OS X makes extensive use of a variety of event notification mechanisms, as described here. One such mechanism is documented in the notify(3) man pages, and it is these types of libnotify notifications that are the focus of this post. Notifications can be posted and observed in a global namespace across all processes (with [...]]]></description>
			<content:encoded><![CDATA[<p>Mac OS X makes extensive use of a variety of event notification mechanisms, as described <a title="Mac OS X Notifications" href="http://developer.apple.com/documentation/Darwin/Conceptual/MacOSXNotifcationOv/MacOSXNotifcationOv.pdf" target="_blank">here</a>. One such mechanism is documented in the <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/notify.3.html#//apple_ref/doc/man/3/notify" target="_blank">notify(3)</a> man pages, and it is these types of <a href="http://www.opensource.apple.com/darwinsource/10.5.4/Libnotify-35/" target="_blank">libnotify</a> notifications that are the focus of this post. Notifications can be posted and observed in a global namespace across all processes (with optional <a href="http://www.opensource.apple.com/darwinsource/10.5.4/notify-15/notifyd.tproj/notify.conf" target="_blank">access control</a>), and in general allow a process to respond to events that occur outside the purview of the process.</p>
<p>One simple example would be the shutdown or restart event. When the user clicks Restart, loginwindow posts a notification called com.apple.loginwindow.restartinitiated. Various other processes who have registered to receive this notification will now know that a restart is coming (soon!). A lot of stuff begins to happen to prepare the machine for a reboot. Getting that event notification from userspace out in a timely fashion to all the various custodians who need to do work is key to the whole operation.</p>
<p>I see two primary use cases for such a notification system: 1) You are authoring software that creates events that others (perhaps even other parts of your own software, running in a different context) need to respond to,  or 2) you wish to respond to a notification for a certain event that you know is being posted by someone else.</p>
<p>The first case is succinctly demonstrated by the example in the man page for <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/notifyutil.1.html" target="_blank">notifyutil.</a> To expand on it just a bit, and more clearly demonstrate the common case of there being some indeterminate time delta between registering for a notification and receiving it, consider this example:</p>
<p>Open a Terminal window. Execute:</p>
<pre>date; notifyutil -t -1 some.pants ; say 'zomg'</pre>
<p>Open another Terminal window, but keep the first one in view. In your mind, count to &#8216;d&#8217;, and then execute:</p>
<pre>notifyutil -p some.pants</pre>
<p>In the first window, you see that a notification for some.pants was received roughly &#8216;d&#8217; seconds after the registration occured, and if your audio volume is up, you hear that Mac OS X does not know how to pronounce &#8216;zomg&#8217;.</p>
<p>The second case of responding to notifications generated by others is less obvious, since in normal operation, all of these notifications are invisible to the user.  You have to know the name of a notification to register for it. The fun begins when you remember to ask the question &#8220;how do I find out what notifications are being posted?&#8221;. The answer might be obvious to anyone who read the man page! <a href="http://www.opensource.apple.com/darwinsource/10.5.4/notify-15/notifyd.tproj/" target="_blank">notifyd</a> is our <a href="http://www.youtube.com/watch?v=JQxpexX0uf4" target="_blank">friend</a>, <a href="http://www.youtube.com/watch?v=1YZvu-apIis" target="_blank">buddy</a>. As all this is open source, we could confirm our suspicions that notifyd probably logs to <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html" target="_blank">ASL</a>, and sure enough, in <a href="http://www.opensource.apple.com/darwinsource/10.5.4/notify-15/notifyd.tproj/notify_proc.c" target="_blank">notify_proc.c</a>, we see :</p>
<pre>log_message(ASL_LEVEL_DEBUG, "__notify_server_post %s", name);</pre>
<p>Ok! So all we need to do is ask ASL to show us debug messages for notifyd.</p>
<pre>sudo syslog -c notifyd -d</pre>
<p>At this point, the messages are theoretically being sent. However, the default data store (i.e. that which you can examine with the Console app) still isn&#8217;t listening, so we also need:</p>
<pre>sudo syslog -c syslogd -d</pre>
<p>Next you should make a new log database query using Console:<br />
<a href="http://www.dreness.com/blog/wp-content/uploads/2008/09/notifyd-log-query.png"><img class="alignnone size-full wp-image-66" title="notifyd-log-query" src="http://www.dreness.com/blog/wp-content/uploads/2008/09/notifyd-log-query.png" alt="" width="500" height="326" /></a></p>
<p>Now you can just sit back and watch the notifications roll in! For example, if I choose Restart from the Apple menu:</p>
<pre>__notify_server_post com.apple.loginwindow.likelyShutdown
__notify_server_post com.apple.loginwindow.restartinitiated</pre>
<p>and then a few seconds later, after I click Cancel:</p>
<pre>__notify_server_post com.apple.loginwindow.logoutcancelled</pre>
<p>At this point, you should be armed with enough information to find out what events are flying around, and then attach an action of your choosing to events of interest. Have fun!</p>
<p>Update: you can disable the debug logging as follows:</p>
<pre>sudo syslog -c syslogd -n</pre>
<pre>sudo syslog -c notifyd off</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=65</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking Time Machine</title>
		<link>http://www.dreness.com/blog/?p=48</link>
		<comments>http://www.dreness.com/blog/?p=48#comments</comments>
		<pubDate>Fri, 08 Aug 2008 23:50:52 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X Server]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/?p=48</guid>
		<description><![CDATA[It&#8217;s &#8220;hack some shit up&#8221; Friday. Everybody ready? Have a Time Capsule or Mac OS X Server configured to provide network time machine backups? Of course you do! Let&#8217;s examine the client / server interaction. The Time Machine preference pane provides a list of available backup volumes. This list includes local volumes as well as [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s &#8220;hack some shit up&#8221; Friday. Everybody ready?</p>
<p>Have a Time Capsule or Mac OS X Server configured to provide network time machine backups? Of course you do! Let&#8217;s examine the client / server interaction.</p>
<p>The Time Machine preference pane provides a list of available backup volumes. This list includes local volumes as well as network volumes. Mac OS X makes extensive use of multicast dns for service discovery, so let&#8217;s check there first. Get yourself a copy of <a href="http://www.tildesoft.com/Programs.html" target="_blank">Bonjour Browser</a>, then fire it up and look under &#8216;local&#8217; for things that seem interesting. Ooo there&#8217;s one called &#8220;adisk&#8221;, let&#8217;s check in there&#8230;</p>
<p><a href="http://www.dreness.com/blog/wp-content/uploads/2008/08/adisk.png"><img class="aligncenter size-full wp-image-58" title="adisk" src="http://www.dreness.com/blog/wp-content/uploads/2008/08/adisk.png" alt="" /></a></p>
<p>From <a href="http://www.dns-sd.org/ServiceTypes.html " target="_blank">http://www.dns-sd.org/ServiceTypes.html</a> we see:</p>
<pre><strong>adisk</strong>          Automatic Disk Discovery
                Bob Bradley &lt;bradleyÂ atÂ apple.com&gt;
                Defined TXT keys: sys, dkX</pre>
<p>We could read a <a href="http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt" target="_blank">bit more</a> about service discovery via multicast dns to learn that:</p>
<pre>DNS-SD uses DNS TXT records to store arbitrary name/value pairs
conveying additional information about the named service. Each
name/value pair is encoded as its own constituent string within the
DNS TXT record, in the form "name=value".
...
The intention of DNS-SD TXT records is to convey a small amount of
useful additional information about a service. Ideally it SHOULD NOT
be necessary for a client to retrieve this additional information
before it can usefully establish a connection to the service. For a
well-designed TCP-based application protocol, it should be possible,
knowing only the host name and port number, to open a connection
to that listening process, and then perform version- or feature-
negotiation to determine the capabilities of the service instance.
For example, when connecting to an AppleShare server over TCP, the
client enters into a protocol exchange with the server to determine
which version of the AppleShare protocol the server implements, and
which optional features or capabilities (if any) are available.</pre>
<p>Ok, so there&#8217;s a record there, and along with the standard parts of the record, there are two additional key / value pairs in the text record portion. The meaning of the keys and values is probably only known for sure by Time Machine and friends, but certainly some of that data looks familiar.</p>
<p>First there&#8217;s the IPv4 address&#8230; that&#8217;s probably provided automatically when the record is published, based on the machine&#8217;s current IP address. IPv6 address follows, again we needn&#8217;t worry about that. The port number is listed at 9, which is &#8216;discard&#8217;, so this is probably not used. What port *is* used, then? Well, we know that Time Machine over the network supports either AFP or SMB, so it&#8217;s going to be one of those two. Seems like AFP would be most common, just since it is the APPLE file protocol and whatnot&#8230;</p>
<p>Then we have the sys and dk0 items&#8230; well I dunno what waMA means (something something mac address?), but what follows certainly looks like a MAC address&#8230; and sure enough, it matches the MAC address on my Time Capsule.</p>
<p>Note also that the second key in the shown record is dk0, whereas the spec says the defined TXT keys are &#8220;sys, dkX&#8221;. The &#8220;X&#8221; here suggests that there might be more than one of these keys, and they are numbered starting from 0 and counting up. Let&#8217;s pick appart the dk0 entry.</p>
<pre>dk0=adVF=0xa1,adVN=backupz,adVU=AF9AC8F1-BCF5-3E63-9EBD-CD171CF5061B</pre>
<ul>
<li>adVF: no idea</li>
<li>adVN: hmm&#8230; another &#8220;adV&#8221; prefix. air disk volume? air disk volume name?</li>
<li>adVU: air disk volume UUID! (I think)</li>
</ul>
<p>Ok, now let&#8217;s have some fun. Fire up file sharing. Click the little + button to create a new share point. Select a folder / volume that has some eh&#8230; free space on it :) The name of the folder / volume as it appears in the list of share points is the AFP share point name, so we should try to use that for &#8216;adVN&#8217;.</p>
<p>Next, use diskutil to find the UUID for the volume on which your new share point resides. The argument after &#8220;info&#8221; is the path to the volume. &#8220;/&#8221; for the boot volume, &#8220;/Volumes/whatever&#8221; for something other than the boot volume.</p>
<pre>sudo diskutil info / | grep "UUID"</pre>
<p>Finally, find your system&#8217;s MAC address (the one that corresponds to your primary network interface).</p>
<pre>netstat -rn | grep default | awk '{print $6}' | xargs ifconfig | grep ether</pre>
<p>Now we should have enough information to try to create a record. Looking at the man page for dns-sd, we see the basic usage for registering a record is:</p>
<pre>dns-sd -R name type domain port [key=value ...]</pre>
<p>Let&#8217;s try it! We still don&#8217;t know what adVF is, so we&#8217;ll just use 0xa1 like the Time Capsule does and see what happens. In the command below, replace 00:11:22:33:44:55 with your MAC address, &#8220;Backupz&#8221; with your new share point name, and &#8220;AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE&#8221; with the UUID of the volume on which your share point resides.</p>
<pre>sudo dns-sd -R "Back it on up" "_adisk._tcp." "local" "9" \
        "sys=waMA=00:11:22:33:44:55" \
        "dk0=adVF=0xa1,adVN=Backupz,adVU=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE"</pre>
<p>You should see something similar to</p>
<pre>Registering Service Back it on up._adisk._tcp..local port 9 TXT ...</pre>
<p>Leave that window open. Open a new terminal window.</p>
<pre>dns-sd -B _adisk._tcp</pre>
<p>You should see your service instance listed. cntrl-c. Get the details:</p>
<pre>dns-sd -L "Back it on up" _adisk._tcp local</pre>
<p>Looks good. Now go to another mac on your local network. Open the Time Machine prefpane. Click &#8220;Choose Backup Disk&#8230;&#8221;.</p>
<p><a href="http://www.dreness.com/blog/wp-content/uploads/2008/08/back-it-on-up.png"><img class="aligncenter size-full wp-image-59" title="back-it-on-up" src="http://www.dreness.com/blog/wp-content/uploads/2008/08/back-it-on-up.png" alt="" width="176" height="37" /></a></p>
<p>Cool!</p>
<p>Limited testing has shown that once you pick a network Time Machine disk in this fashion, the multicast dns service advertisement record is no longer needed. Apparently the Time Machine client caches the information about the location of the network disk. Also, probably a good idea to make sure that your network time machine volume is not guest-accessible&#8230;</p>
<p>Here&#8217;s a little script to ease the process&#8230;</p>
<pre>#!/bin/sh
# Instructions:
# 1. Use the Sharing preference pane to configure an AFP share point that will
# be your network backup volume. Connect from another mac using Finder --&gt;
# Connect To Server. Make sure you can log in. Note the name of the AFP volume.
# 2. Use diskutil info to get the UUID from the volume on which your AFP
# sharepoint resides.
# 3. Customize the values below.

# Customize here
servicename="Back it on up"		# the name shown in parens in the TM browser
macaddy="00:11:22:33:44:55"		# MAC address of the AFP server
volname="backupz"				# AFP sharepoint name
voluuid="6E132F57-8292-4A73-9B37-5C0F82928E85" # volume UUID 

# 4. Make sure this script is executable (chmod +x), then run it. You will be
# prompted for your password (must be admin).
# 5. Go to your other mac, use the Time Machine prefpane to select your shared
# AFP volume. The other mac needs to be on the same local network.
# 6. After selecting the volume, you can cntrl-c this script to stop it.
# 7. Enjoy your network time machine backups!

# no touchy
servicetype="_adisk._tcp."
domain="local"
port="9"
adVF="0xa1"			# magic?

# we need at least two key / value pairs, like such:
# sys=waMA=00:1F:5B:34:BC:41
# something something Mac Address, I guess...
# dk0=adVF=0x0a1,adVN=TM Test,adVU=AF9AC8F1-BCF5-3E63-9EBD-CD171CF5061B
# dkn iterates starting with dk0, then dk1... these are backup volumes
# adVF is ... something. I used trial and error to find that 0xa1 works
# adVN is volume name
# adVU is volume UUID, which you can get from diskutil info.

# dns-sd -R name type domain port [key=value ...]
sudo dns-sd -R "$servicename" "$servicetype" "$domain" "$port" \
		"sys=waMA=$macaddy" \
		"dk0=adVF=$adVF,adVN=$volname,adVU=$voluuid"</pre>
<p>Have fun :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=48</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Applied Kerberos troubleshooting</title>
		<link>http://www.dreness.com/blog/?p=43</link>
		<comments>http://www.dreness.com/blog/?p=43#comments</comments>
		<pubDate>Fri, 04 Jul 2008 21:10:45 +0000</pubDate>
		<dc:creator>dre</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[OS X Server]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.dreness.com/blog/archives/43</guid>
		<description><![CDATA[The following is an IRC transcript taken from #afp548, irc.freenode.net. It chronicles the troubleshooting process of a fairly well-hidden edge case of Kerberos configuration in Mac OS X Server. pastebin.ca was used to relay larger hunks of textual information; I&#8217;ve made local copies of the results since the pastebin pages expire in 1 month. Pastebin [...]]]></description>
			<content:encoded><![CDATA[<p>The following is an IRC transcript taken from #afp548, irc.freenode.net. It chronicles the troubleshooting process of a fairly well-hidden edge case of Kerberos configuration in Mac OS X Server.</p>
<p>pastebin.ca was used to relay larger hunks of textual information; I&#8217;ve made local copies of the results since the pastebin pages expire in 1 month. Pastebin displays line numbers, and those numbers are used here to refer to specific portions of text&#8230; however, pastebin doesn&#8217;t seem to allow users to copy the text including line numbers, so I added those myself (awk &#8216;{print NR &#8220;. &#8220;$0}&#8217; file)</p>
<p>16:44 &lt;@dre^&gt; re the kerberos question: still have to use &#8216;connect to&#8217; to get kerberos<br />
16:44 &lt;@dre^&gt; which is weird, because the browsing method is how you get kerberos for the LKDC realms, heh<br />
16:44 &lt;@dre^&gt; at least for things like screen sharing<br />
16:51 &lt;@dre^&gt; wow, /dev/random is slow<br />
16:51 &lt;@dre^&gt; erps, ww<br />
17:34 -!- ideopathic [n=ideopath@75-56-246-1.lightspeed.brbnca.sbcglobal.net] has joined #afp548<br />
17:39 &lt; SpaceBass&gt; dre^, connect to server doesnt use the ticket either<br />
17:41 &lt; SpaceBass&gt; and for that matter, screen sharing doesnt seem to consistantly use kerberos either<br />
17:41 &lt; SpaceBass&gt; apple really broke things with the whole lkdc implementation<br />
17:44 &lt;@dre^&gt; heh<br />
17:44 &lt;@dre^&gt; if you can&#8217;t get kerberos via connect to, there is some other problem<br />
17:44 &lt;@dre^&gt; lkdc works, kerberos works&#8230; if configured and used properly ;)<br />
17:45 &lt;@dre^&gt; a quick list of things to check regarding kerberized services in general:<br />
17:45 &lt;@dre^&gt; * are the client and the service service configured for the same kerberos realm?<br />
17:45 &lt;@dre^&gt; * does the client have a valid kerberos principal in the kdc? can the client user kinit at all?<br />
17:46 &lt;@dre^&gt; * does the service server have service keytabs in the kdc? if you kadmin &#8211;&gt; listprincs on the kdc, do you see afpserver/hostname@REALM?<br />
17:46 &lt;@dre^&gt; * does the service&#8217;s configuration know what principal name to use? this is in teh afp preferences in the case of afp server<br />
17:48 &lt; SpaceBass&gt; dre^, hard to misconfigure Leopard Server &#8211; create the DNS, create the OD domain, join to the domain<br />
17:48 &lt; SpaceBass&gt; there&#8217;s posts all over the apple forums about it&#8230;just though I&#8217;d see if anyone had identified a work around<br />
17:49 &lt;@dre^&gt; have an example post?<br />
17:49 &lt;@dre^&gt; I&#8217;ve used kerberos a ton<br />
17:49 &lt;@dre^&gt; so I know it&#8217;s not always broken all the time<br />
17:49 &lt; SpaceBass&gt; kinit works fine, and I get a ticket at login &#8230; but I cannot use that ticket via the finder for almost anything &#8230; it does work for SSH or mount_afp in the terminal<br />
17:50 &lt;@dre^&gt; right, but pls distinguish between finder browsing vs finder connect to<br />
17:50 &lt; SpaceBass&gt; ever leopard machine that joins the realm creates 3 enteries for each service &#8230; host.fqdn.com host.local and a random serial number for the LKDC /back to my mac stuff<br />
17:51 &lt; SpaceBass&gt; so when you say connect to, do you mean GO menu &#8211;&gt; connect to server?<br />
17:51 &lt;@dre^&gt; yes<br />
17:51 &lt; SpaceBass&gt; and it hasn&#8217;t been broken all the time &#8230; 10.4 worked flawlessly &#8230;<br />
17:51 &lt; SpaceBass&gt; ok an in the connect to menu, what is the uri?  I&#8217;m using afp://host  &#8230; I have also tried host.domain.com and host.local<br />
17:52 &lt;@dre^&gt; ah, .local&#8230;<br />
17:52 &lt; SpaceBass&gt; ok, tried that and I get a box asking for user/pass<br />
17:52 &lt;@dre^&gt; are you using .local in your actual DNS / realm names?<br />
17:52 &lt;@dre^&gt; no. dont  use .local unless you are forced to, heh<br />
17:53 &lt; SpaceBass&gt; no, I have a private domain &#8230;<br />
17:53 &lt;@dre^&gt; and yes, it shoudl be afp://fqdn.goes.here<br />
17:53 &lt;@dre^&gt; also verify that afpserver&#8217;s auth settings are either &#8220;any method&#8221; or &#8220;kerberos&#8221;<br />
17:53 &lt; SpaceBass&gt; ok&#8230;with afp://host.domain.com I get 2 different results &#8230;somtimes it fails right off the bat, others it asks for user/pass<br />
17:54 &lt;@dre^&gt; so then you check the KDC logs to see what&#8217;s going on<br />
17:54 &lt;@dre^&gt; but of course you probably don&#8217;t have access to those&#8230;<br />
17:54 &lt; SpaceBass&gt; dre^, I hand checked each plist last night &#8230; that occured to me late in the game, and I was impressed to see that they all said any and kerb<br />
17:54 &lt;@dre^&gt; which is the crappy part about debugging kerberos<br />
17:54 &lt; SpaceBass&gt; the logs? I&#8217;m the admin<br />
17:54 &lt;@dre^&gt; ok good. check the kdc log<br />
17:56 &lt; SpaceBass&gt; ok&#8230;logs show me requesting a ticket for host.local<br />
17:56 &lt; SpaceBass&gt; but I&#8217;m using fqdn and the afp plist shows the host.fqdn.com as the principal to use<br />
17:57 &lt; SpaceBass&gt; I dont mind manually adding those principals but that seems broken to me<br />
17:57 &lt;@dre^&gt; ok&#8230; what are your existing tickets? klist<br />
17:57 &lt;@dre^&gt; you should not have to add .local principals<br />
17:58 &lt;@dre^&gt; specifically, what&#8217;s the realm associated with your existing tickets (if any)<br />
17:58 &lt; SpaceBass&gt; right now I just have the krbtgt<br />
17:58 &lt;@dre^&gt; but in what realm?<br />
17:58 &lt;@dre^&gt; a .local realm or &#8216;other&#8217;?<br />
17:59 &lt; SpaceBass&gt; NSNET.cc<br />
17:59 &lt;@dre^&gt; ok great<br />
17:59 &lt; SpaceBass&gt; my realm<br />
17:59 &lt; SpaceBass&gt; krbtgt/NSNET.CC@NSNET.CC<br />
17:59 &lt; SpaceBass&gt; what I&#8217;d expect<br />
17:59 &lt; SpaceBass&gt; and if I ssh into a linux server I get host/linux.nsnet.cc@<br />
17:59 &lt;@dre^&gt; so the next step woudl probably be to verify the client-side kerberos configuration. get root and take a walk into /var/db/dslocal/nodes/Default/config<br />
18:00 &lt;@dre^&gt; ok intersting, so the client-side config is probably correct<br />
18:00 &lt;@dre^&gt; is the afp service running on the OD master?<br />
18:00 &lt; SpaceBass&gt; dre^, yes, but I dont really have any shares there&#8230;mostly on leopard workstations<br />
18:01 &lt; SpaceBass&gt; (and a linux box running netatalk, but I don&#8217;t expect anyone to help me troubleshoot that)<br />
18:01 &lt;@dre^&gt; no problem, just getting the lay of the land&#8230; in particular, in that configuration, it&#8217;s very unlikely that your afp service would not have the required keytabs<br />
18:01 &lt; SpaceBass&gt; in &#8230;../config &#8230; didn&#8217;t know about this dir<br />
18:01 &lt;@dre^&gt; yes, that config dir is the authoritative spot for such configurations<br />
18:01 &lt;@dre^&gt;  /L/P/edu.mit.Kerberos is an externalized representation of data found here<br />
18:01 &lt;@dre^&gt; and is really &#8216;for legacy purposes only&#8217;<br />
18:02 &lt; SpaceBass&gt; cool &#8230; I&#8217;m used to /L/P/edu &#8230;<br />
18:02 &lt; SpaceBass&gt; gotcha<br />
18:02 &lt; SpaceBass&gt; good to know<br />
18:02 &lt;@dre^&gt; yes it is. cause sometimes that translation breaks down<br />
18:02 &lt;@dre^&gt; and you need to go see what&#8217;s up<br />
18:02 &lt;@dre^&gt; ok&#8230; so the next thing I would do is&#8230;<br />
18:03 &lt;@dre^&gt; stand by, but I have some awesome debugging steps for you<br />
18:03 &lt; SpaceBass&gt; very apperciative<br />
18:04 &lt;@dre^&gt; ok here goes<br />
18:04 &lt;@dre^&gt; a) open a terminal and execute the following:<br />
18:04 &lt;@dre^&gt;  sudo syslog -c syslog -d<br />
18:04 &lt;@dre^&gt;  sudo syslog -c 0 -d<br />
18:04 &lt;@dre^&gt;  killall NetAuthAgent<br />
18:04 &lt;@dre^&gt;  kdestroy -A<br />
18:04 &lt;@dre^&gt;  syslog -w<br />
18:04 &lt;@dre^&gt; b) start a connection in Finder using &#8216;connect to&#8217;<br />
18:05 &lt;@dre^&gt; once you attempt a connection using the proper fqdn, enter a name / pw if prompted<br />
18:05 &lt;@dre^&gt; then wait 30 seconds for syslog in teh terminal to catch up, then cntrl-c it<br />
18:05 &lt;@dre^&gt; you should find ample / useful debugging info in the terminal (syslog) output<br />
18:05 &lt; SpaceBass&gt; interesting<br />
18:05 &lt; SpaceBass&gt; lots of info<br />
18:05 &lt;@dre^&gt; but I can help make sense of it if you need<br />
18:05 &lt; SpaceBass&gt; getting asked for user/pass for the share<br />
18:06 &lt; SpaceBass&gt; checking the logs now<br />
18:06 &lt;@dre^&gt; Look for KRBCreateSession, and right after that&#8230;<br />
18:06 &lt;@dre^&gt; you should see the results of some realm_for_host calls&#8230;<br />
18:07 &lt; SpaceBass&gt; now the kdestroy removed all tickets &#8230; expected ?<br />
18:07 &lt;@dre^&gt; my guess is that such results are either wrong or missing<br />
18:07 &lt;@dre^&gt; yes, expected<br />
18:07 &lt; SpaceBass&gt; k<br />
18:07 &lt;@dre^&gt; but this process should obtain new tickets<br />
18:07 &lt; SpaceBass&gt; how would it get my password?<br />
18:07 &lt; SpaceBass&gt; I dont have it saved in the keychain<br />
18:08 &lt; SpaceBass&gt; right after the KRBCreateSession line I see:<br />
18:08 &lt; SpaceBass&gt; (and I can&#8217;t cut/paste b/c I&#8217;m using two different machines)<br />
18:09 &lt; SpaceBass&gt; parse_principal &#8230; decomposing afpserver/osx5.nsnet.cc@NSNET.cc    (seems correct)<br />
18:09 &lt;@dre^&gt; ok<br />
18:10 &lt;@dre^&gt; and you probably do have it in your keychain if you got in without authing<br />
18:10 -!- SpaceBass2 [n=SP@96.228.61.195] has joined #afp548<br />
18:10 &lt;@dre^&gt; ok, so that means that afp server is returning the expected principal name<br />
18:10 &lt; SpaceBass2&gt; flood warning<br />
18:10 &lt; SpaceBass2&gt; : [[[ KRBCreateSession () - required parameters okay<br />
18:10 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;: [[[ parse_principal_name () decomposing afpserver/osx5.nsnet.com@NSNET.COM<br />
18:10 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;: ]]] parse_principal_name () &#8211; 0<br />
18:10 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     KRBCreateSession: processed host name = osx5.nsnet.com<br />
18:10 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     KRBCreateSession: last char of host name = 0x6d<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     KRBCreateSession: getaddrinfo = success (0)<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     KRBCreateSession: canonical host name = osx5.nsnet.com<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;: [[[ realm_for_host: hostname=osx5.nsnet.com hintrealm=NSNET.COM<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;:     realm_for_host: krb5_get_host_realm returned unusable realm!<br />
18:11 &lt; SpaceBass2&gt; Thu Jul  3 18:02:07 osx1 NetAuthAgent[2861] &lt;Debug&gt;: ]]] realm_for_host: failed to determine realm<br />
18:11 &lt;@dre^&gt; ah ha<br />
18:11 &lt; SpaceBass&gt; dre^, I did  NOT get in without authing  &#8230; I got the finder prompt for user/pass<br />
18:11 &lt;@dre^&gt; ok that&#8217;s good<br />
18:11 &lt;@dre^&gt; and expected<br />
18:12 &lt;@dre^&gt; it definitely looks as though the client kerberos config is malformed somehow<br />
18:12 &lt;@dre^&gt; since it thinks NSNET.COM is unusable<br />
18:12 &lt;@dre^&gt; go ahead and kinit and paste in the TGT you get<br />
18:12 &lt;@dre^&gt; or jsut klist if you already have one<br />
18:12 &lt; SpaceBass&gt; ok&#8230;here&#8217;s the thing&#8230;its a brand spanking new Macbook pro &#8230; first thing out of the box&#8230;configured DNS, did updates, jointed to domain using directory utility.app<br />
18:13 &lt;@dre^&gt; is that the client or afp server?<br />
18:13 &lt; SpaceBass2&gt; Kerberos 5 ticket cache: &#8216;API:Initial default ccache&#8217;<br />
18:13 &lt; SpaceBass2&gt; Default principal: ndawson@NSNET.COM<br />
18:13 &lt; SpaceBass2&gt; Valid Starting     Expires            Service Principal<br />
18:13 &lt; SpaceBass2&gt; 07/03/08 18:09:58  07/04/08 04:09:58  krbtgt/NSNET.COM@NSNET.COM<br />
18:13 &lt; SpaceBass2&gt;     renew until 07/10/08 18:09:58<br />
18:13 &lt; SpaceBass&gt; client<br />
18:13 &lt;@dre^&gt; hmm, ok<br />
18:14 &lt;@dre^&gt; could you post or email me your /L/P/edu.mit.Kerberos?<br />
18:14 &lt;@dre^&gt; dre@mac.com<br />
18:14 &lt; SpaceBass&gt; can post &#8211; its short<br />
18:15 &lt; SpaceBass&gt; pastebin at least<br />
18:15 &lt;@dre^&gt; sure<br />
18:15 &lt; SpaceBass2&gt; http://pastebin.ca/1061728</p>
<p># WARNING This file is automatically created, if you wish to make changes<br />
# delete the next two lines<br />
# autogenerated from : /LDAPv3/vail.nsnet.com<br />
# generation_id : 97528862<br />
[libdefaults]<br />
default_realm = NSNET.COM<br />
[realms]<br />
NSNET.COM = {<br />
admin_server = vail.local<br />
kdc = vail.local<br />
}<br />
[domain_realm]<br />
.local = NSNET.COM<br />
local = NSNET.COM<br />
[logging]<br />
admin_server = FILE:/var/log/krb5kdc/kadmin.log<br />
kdc = FILE:/var/log/krb5kdc/kdc.log</p>
<p>18:16 &lt; SpaceBass&gt; thats a little different than I&#8217;m used to seeing &#8211; but its what apple generates<br />
18:16 &lt;@dre^&gt; loading&#8230;<br />
18:16 &lt;@dre^&gt; (slowly)<br />
18:17 &lt; SpaceBass&gt; again, really appreciate the help<br />
18:17 &lt;@dre^&gt; sure no prob :)<br />
18:18 &lt; SpaceBass2&gt; I am surprised that apple&#8217;s automated processes seem to be broken<br />
18:19 &lt;@dre^&gt; heh, well&#8230; I guess that&#8217;s good. one should ideally expect things to work properly without too much work :)<br />
18:20 &lt; SpaceBass2&gt; exactly<br />
18:21 &lt;@dre^&gt; ok it loaded finally<br />
18:21 &lt;@dre^&gt; oh, lol<br />
18:21 &lt;@dre^&gt; I see the problem :P<br />
18:22 &lt;@dre^&gt; kdc = vail.local<br />
18:22 &lt;@dre^&gt; vail.local should be a fqdn<br />
18:22 &lt; SpaceBass2&gt; in the edu&#8230; ?<br />
18:22 &lt;@dre^&gt; yes absolutely<br />
18:22 &lt; SpaceBass2&gt; see, I thought the same thing, but what is that part about the aliasing?<br />
18:23 &lt;@dre^&gt; theoretically in a perfect world this would be a valid configuration<br />
18:23 &lt; SpaceBass2&gt; :D<br />
18:23 &lt;@dre^&gt; the thing is that Kerberos makes assumptions based on host name / fqdn<br />
18:23 &lt; SpaceBass2&gt; ok &#8230; if I change edu.mit.kerb &#8230;how do I get it to update the files in /var&#8230;/config<br />
18:23 &lt;@dre^&gt; so you need to use the fqdn for the KDC that matches the host name portion of the kerberos principals<br />
18:23 &lt;@dre^&gt; you should not change it<br />
18:23 &lt;@dre^&gt; you should unbind and rebind using a fqdn and see what happens<br />
18:23 &lt; SpaceBass2&gt; ok<br />
18:24 &lt; SpaceBass2&gt; rebind using the fqdn of the server?<br />
18:24 &lt;@dre^&gt; yes<br />
18:24 &lt; SpaceBass2&gt; odd, b/c thats what I did<br />
18:24 &lt;@dre^&gt; unbind / rebind the client<br />
18:24 &lt;@dre^&gt; ok, then don&#8217;t do that<br />
18:24 &lt; SpaceBass2&gt; glad to re-try<br />
18:24 -!- dakine [n=sam@bas3-toronto01-1177779856.dsl.bell.ca] has quit ["This computer has gone to sleep"]<br />
18:24 &lt;@dre^&gt; let&#8217;s verify the server configuraiton<br />
18:24 &lt; SpaceBass2&gt; k<br />
18:24 &lt;@dre^&gt; on teh OD master: sudo slapconfig -checkhostname<br />
18:24 &lt;@dre^&gt; er, sorry<br />
18:25 &lt;@dre^&gt; sudo changeip -checkhostname<br />
18:25 &lt; SpaceBass2&gt; yeah , I figured thats what you meant :D &#8230; vail.nsnet.com<br />
18:25 &lt;@dre^&gt; in general, it&#8217;s good to resist the temptation to hand-hack any config files, because doing so may break assumptions that apple makes about the contents of the files, in the cases where the same config files are maintained automatically by apple tools<br />
18:26 &lt; SpaceBass2&gt; dre^, I&#8217;ve learned that the hard way before :)<br />
18:26 &lt;@dre^&gt; so it says &#8220;there&#8217;s nothing to change&#8221; at the end?<br />
18:26 &lt; SpaceBass2&gt; yes<br />
18:26 &lt;@dre^&gt; ok good<br />
18:26 &lt; SpaceBass2&gt; names match, nothing to change<br />
18:27 &lt;@dre^&gt; does the server&#8217;s /L/P/edu.mit.Kerberos look the same?<br />
18:27 &lt;@dre^&gt; it probably will&#8230;<br />
18:27 &lt; SpaceBass2&gt; exactly the same<br />
18:27 &lt; SpaceBass2&gt; (and that damn .local keeps throwing me off too)<br />
18:27 &lt;@dre^&gt; yeah. it should be. that data is all downloaded by the client from the LDAP directory<br />
18:28 &lt;@dre^&gt; (when you bind, a tool called kerberosautoconfig &#8230; well, does that)<br />
18:28 &lt; ideopathic&gt; i&#8217;m following a long trying to learn a little about kerberos.  where is the file located that you uploaded to pastbin?<br />
18:28 &lt; SpaceBass2&gt; and, like I said&#8230;ssh and mount_afp work &#8230;<br />
18:28 &lt; SpaceBass2&gt; ideopathic, /Library/Preferences<br />
18:28 &lt; SpaceBass2&gt; ideopathic, this is a good one to follow :D learning a lot myself<br />
18:28 &lt;@dre^&gt; there is still something wrong if it thinks your kdc is hosted by a .local thing<br />
18:28 &lt;@dre^&gt; you&#8217;re supposed to get a fqdn there, e.g. vail.nsnet.com<br />
18:29 &lt;@dre^&gt; ok, so let&#8217;s check your kdc configuration&#8230;<br />
18:29 &lt;@dre^&gt; on the KDC (OD master): ps auxwww | grep krb<br />
18:29 -!- dakine [n=sam@bas3-toronto01-1177779856.dsl.bell.ca] has joined #afp548<br />
18:29 &lt;@dre^&gt; you shoudl see krb5kdc running and supporting at least one realm<br />
18:29 &lt; SpaceBass2&gt; root        96   0.0  0.2    82512   2480   ??  S    25Jun08   0:15.03 /usr/sbin/krb5kdc -n -r LKDC:SHA1.B3567769537F126486F54B94C5B03C7A439C0F80 -r NSNET.COM -a<br />
18:29 &lt;@dre^&gt; very interesting<br />
18:30 &lt;@dre^&gt; so the KDC thinks it&#8217;s hosting two realms, the LKDC realm and the NSNET.COM realm<br />
18:30 &lt; SpaceBass2&gt; yeah&#8230;theres those damn lkdc entries again<br />
18:30 &lt;@dre^&gt; that&#8217;s fine, don&#8217;t fear the lkdc ;)<br />
18:30 &lt; SpaceBass2&gt; oh but I do :D<br />
18:30 &lt;@dre^&gt; perhaps this will aleviate your concern: http://www.dreness.com/wikimedia/index.php?title=LKDC<br />
18:30 &lt;@dre^&gt; a little write-up I did about the LKDC<br />
18:31 &lt;@dre^&gt; but that is beside the point<br />
18:31 &lt;@dre^&gt; the question is: what broke between the KDC configuration and the population of the KerberosClientConfig record in OD<br />
18:31 &lt;@dre^&gt; open workgroup manager<br />
18:32 &lt;@dre^&gt; actually let&#8217;s just use dscl<br />
18:32 &lt; SpaceBass2&gt; cool &#8211; good reading!<br />
18:32 &lt;@dre^&gt; dscl /LDAPv3/127.0.0.1 (on the OD master)<br />
18:32 &lt; SpaceBass2&gt; k<br />
18:32 &lt;@dre^&gt; read /Config/KerberosClient<br />
18:32 &lt; SpaceBass2&gt; I&#8217;ll warn you, my dscl-fu is weak<br />
18:33 &lt;@dre^&gt; this should be similar to what you see in /L/P/edu.mit.kerberos (albeit formated differently)<br />
18:33 &lt;@dre^&gt; true or false?<br />
18:33 &lt; SpaceBass2&gt; checking -its xml &#8230;but close<br />
18:33 &lt;@dre^&gt; mainly looking for vail.local<br />
18:33 &lt; SpaceBass2&gt; yeah<br />
18:34 &lt; SpaceBass2&gt; its there<br />
18:34 &lt;@dre^&gt; ok<br />
18:34 &lt; SpaceBass2&gt; as the KDC for nsnet.com<br />
18:34 &lt; SpaceBass2&gt; nsnet.cc<br />
18:34 &lt;@dre^&gt; this is the data that is downloaded by clients when they bind<br />
18:34 &lt;@dre^&gt; wait<br />
18:34 &lt; SpaceBass2&gt; ah!<br />
18:34 &lt;@dre^&gt; nsnet.cc or nsnet.com!?!<br />
18:34 &lt; SpaceBass2&gt; cc<br />
18:34 &lt; SpaceBass2&gt; sorry<br />
18:34 &lt; SpaceBass2&gt; er..com<br />
18:34 &lt; SpaceBass2&gt; it is com<br />
18:34 &lt;@dre^&gt; hehe<br />
18:34 &lt; SpaceBass2&gt; and .com is correct<br />
18:35 &lt;@dre^&gt; ok<br />
18:35 &lt; SpaceBass2&gt; and if I&#8217;ve been saying .cc its an old habit<br />
18:35 &lt; SpaceBass2&gt; but nsnet.com is a private domain &#8230;in that i do not own it on the interwebs<br />
18:35 &lt;@dre^&gt; &#8230; that is not recommended ;)<br />
18:35 &lt;@dre^&gt; you should use fake TLDs in that case<br />
18:35 &lt; SpaceBass2&gt; yeah, stupid move that I made years ago and wish I could undo<br />
18:36 &lt;@dre^&gt; e.g. nsnet.lan<br />
18:36 &lt; SpaceBass2&gt; but I suspect trying to change the realm now would be pretty challenging<br />
18:36 &lt;@dre^&gt; you can and should un-do it as a reasonably high priority<br />
18:36 &lt;@dre^&gt; it could cause very hard to track down DNS &#8216;problems&#8217;<br />
18:36 &lt;@dre^&gt; but we&#8217;ll talk about that later<br />
18:36 &lt; SpaceBass2&gt; what I&#8217;d really like to do get a public domain and do a dual horizon dns &#8230; would make getting a comercial cert much easier<br />
18:37 &lt; SpaceBass2&gt; but like you said, I can tackel that later<br />
18:37 &lt;@dre^&gt; ok, so<br />
18:37 &lt;@dre^&gt; now let&#8217;s look at /Library/Logs/slapconfig.log<br />
18:37 &lt;@dre^&gt; might wanna slap that on pastebin<br />
18:37 &lt;@dre^&gt; (on the OD master)<br />
18:37 &lt;@dre^&gt; slapconfig.log records information about OD role changes, such as promotion to master<br />
18:38 &lt; SpaceBass2&gt; assume there is nothing sensitive in there<br />
18:38 &lt;@dre^&gt; nothing that you haven&#8217;t already told us :)<br />
18:38 &lt;@dre^&gt; might be an admin account name<br />
18:38  * SpaceBass2 pats his PFsense box<br />
18:38 &lt;@dre^&gt; but certainly no passwords&#8230;<br />
18:39 &lt; SpaceBass2&gt; http://pastebin.ca/1061749</p>
<p><a href="http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste1" target="_blank">http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste1</a></p>
<p>18:39 &lt;@dre^&gt; (although before tiger shipped, I did find admin passwords in that log&#8230; heh. fixed before ship though, thankfully&#8230;)<br />
18:39 &lt; SpaceBass2&gt; ouch!<br />
18:39 &lt;@dre^&gt; full disclosure: I work at apple<br />
18:40 &lt;@dre^&gt; loading slow again&#8230;<br />
18:40 &lt; SpaceBass2&gt; yeah? awesome<br />
18:40 &lt; SpaceBass2&gt; full discolsure I&#8217;m a fan boy<br />
18:40 &lt;@dre^&gt; hehe<br />
18:40  * SpaceBass2 has 16 macs &#8230;personally &#8230; this is a home setup by the way<br />
18:41 &lt; SpaceBass2&gt; and my wife is only tolerating  me troubleshooting this right now b/c I&#8217;ve promised that she&#8217;ll be able to mount the media share again<br />
18:41 &lt;@dre^&gt; haha<br />
18:41 &lt;@dre^&gt; ok it&#8217;s loaded, reading<br />
18:42 &lt; SpaceBass2&gt; k<br />
18:42 &lt; SpaceBass2&gt; reading myself as its new to me<br />
18:42 &lt;@dre^&gt; I see you had one false start<br />
18:43 &lt; SpaceBass2&gt; yeah &#8211; in fact, the long history is that I did a tiger-leo upgrade and it failed several times &#8230; so I blew it away and re-created the OD from sctatch &#8230;and did indeed have a false start<br />
18:44 &lt;@dre^&gt; hmm, looks like you&#8217;re merging in an OD backup from tiger<br />
18:45 &lt; SpaceBass2&gt;  I did try and pull in a backup &#8211; again failed &#8230; you should see where I eventually re-created by hand<br />
18:45 &lt; SpaceBass2&gt; if memory serves &#8230;.<br />
18:45 &lt;@dre^&gt; heh ok, still reading<br />
18:45 &lt; SpaceBass2&gt; I did try and pull in the backup and then create new passwords, but I wasn&#8217;t getting user principals<br />
18:46 &lt;@dre^&gt; upgrades are risky business&#8230;<br />
18:48 &lt;@dre^&gt; ok, so if you look at line 247<br />
18:48 &lt;@dre^&gt; that&#8217;s where it starts creating the wrong service principals<br />
18:48 &lt;@dre^&gt; though there is no obvious indication of why it&#8217;s doing it wrong&#8230; between line 202 and 247 appears normal<br />
18:49 &lt; SpaceBass2&gt; leme look<br />
18:49 &lt; SpaceBass2&gt; the warnings?<br />
18:49 &lt;@dre^&gt; no, the principal name itself<br />
18:49 &lt;@dre^&gt; er, the hostname portion of the service principals<br />
18:49 &lt;@dre^&gt; vail.local<br />
18:50 &lt; SpaceBass2&gt; i see<br />
18:50 &lt;@dre^&gt; intersetingly enough, when you kerberize other hosts, they work<br />
18:50 &lt;@dre^&gt; e.g. telluride<br />
18:50 &lt;@dre^&gt; that explains why ssh to linux is working<br />
18:50 &lt; SpaceBass2&gt; telluride is a linux box &#8211; added by hand<br />
18:50 &lt;@dre^&gt; *nod*<br />
18:50 &lt;@dre^&gt; note line 327<br />
18:51 &lt;@dre^&gt; the service principals are being created with the correct server name<br />
18:51 &lt; SpaceBass2&gt; humm I cannot seem to get into kadmin<br />
18:51 &lt;@dre^&gt; try kadmin.local as root<br />
18:51 &lt; SpaceBass2&gt; but what I have observed in the past is that it creates 3 enteries for each OSX host<br />
18:51 &lt;@dre^&gt; yes, that is fixed in 10.5.3<br />
18:51 &lt;@dre^&gt; but only for &#8216;new&#8217; installs :/<br />
18:51 &lt; SpaceBass2&gt; is it?!?!<br />
18:52 &lt;@dre^&gt; it&#8217;s not really a functional problem, more cosmetic<br />
18:52 &lt; SpaceBass2&gt; I&#8217;m on 10.5.2 &#8211; been avoiding the upgrade b/c I wasn&#8217;t sure it was safe yet<br />
18:52 &lt;@dre^&gt; well now it&#8217;s 10.5.4, heh<br />
18:52 &lt; SpaceBass2&gt; even for server?<br />
18:52 &lt;@dre^&gt; yes<br />
18:52 &lt; SpaceBass2&gt; on .4 for clients<br />
18:52 &lt; SpaceBass2&gt; cool<br />
18:52 &lt;@dre^&gt; in general, updates ship at the same time for client and server<br />
18:52 &lt; SpaceBass2&gt; I&#8217;ll update tonight if all goes well<br />
18:52 &lt; smultron&gt; i updated<br />
18:53 &lt; smultron&gt; no problems<br />
18:53 &lt;@dre^&gt; well&#8230; if you don&#8217;t have a lot of stuff in your OD master, you should probably demote / promote<br />
18:53 &lt; SpaceBass2&gt; interesting &#8211; I only see vail.local in the keytab<br />
18:53 &lt;@dre^&gt; yes, that is a problem :)<br />
18:53 &lt;@dre^&gt; you might be able to slapconfig -kerberize your way to nirvana&#8230; lemme see<br />
18:53 &lt; SpaceBass2&gt; oh yeah it is! can&#8217;t belive I missed that<br />
18:53 &lt;@dre^&gt; I&#8217;ve never really done that, since I always stop at the first sign of weirdness and start over<br />
18:53 &lt; SpaceBass2&gt; I mean, I can add em if need be<br />
18:54 &lt;@dre^&gt; in general, watch slapconfig.log like a hawk whenever you do OD stuff<br />
18:54 &lt; SpaceBass2&gt; but, since osx1.nsnet.com is trying to connect to osx5.nsnet.com  &#8230; does vail.local matter?<br />
18:54 &lt; SpaceBass2&gt; would that break the &#8220;chain&#8221; so to speak?<br />
18:55 &lt;@dre^&gt; well, it matters in the sense that vail&#8217;s services are kerberized using the wrong hostname<br />
18:55 &lt; SpaceBass2&gt; (and hostname on the kdc reports vail.nsnet.com )<br />
18:55 &lt;@dre^&gt; right, it&#8217;s just the self-kerberization that failed for some reason<br />
18:56 &lt;@dre^&gt; ok, couple more things to check&#8230;<br />
18:57 &lt;@dre^&gt; sudo sso_util info -r /LDAPv3/127.0.0.1<br />
18:57 &lt;@dre^&gt; should return NSNET.COM<br />
18:58 &lt; SpaceBass2&gt; &#8217;tis<br />
18:58 &lt; SpaceBass2&gt; nsnet.com<br />
19:00 &lt;@dre^&gt; ok, so there is an sso_util command that can attempt to kerberize services on the OD master<br />
19:00 &lt;@dre^&gt; sso_util configure<br />
19:00 &lt; SpaceBass2&gt; oh&#8230;?<br />
19:00 &lt;@dre^&gt; but this will make changes<br />
19:00 &lt; SpaceBass2&gt; at this point, its not like I cannot rebuild again &#8230; data is on the clients and its all backed up<br />
19:00 &lt;@dre^&gt; so before doing that, let me ask: how much stuff is in the OD master? How long would it take you to demote and promote, and recreate all of the users / kerberized hosts?<br />
19:00 &lt;@dre^&gt; ok<br />
19:00 &lt; SpaceBass2&gt; and rebuilding the OD master isn&#8217;t too hard<br />
19:01 &lt;@dre^&gt; well depends on how much stuff is in it :) the idea is we don&#8217;t want to restore from an archive<br />
19:01 &lt; SpaceBass2&gt; I&#8217;d really prefer not to do that&#8230;at least not tonight &#8230; but its &#8220;do-able&#8221;<br />
19:01 &lt;@dre^&gt; as that will restore potentially bad data<br />
19:01 &lt;@dre^&gt; well doing the sso_util configure shouldn&#8217;t break anything other than kerberized services on the OD master<br />
19:01 &lt; SpaceBass2&gt; guess what I&#8217;m saying is: I&#8217;m ok with risking it<br />
19:01 &lt;@dre^&gt; which means that at works, you have to use standard auth and not kerberos<br />
19:01 &lt;@dre^&gt; s/works/worst/<br />
19:02 &lt; SpaceBass2&gt; I can live with standard for a few days if I have to<br />
19:03 &lt;@dre^&gt; ok so try: sudo sso_util configure -r NSNET.COM -a admin-name all<br />
19:03 &lt;@dre^&gt; where admin-name is your *directory* administraotr<br />
19:03 &lt;@dre^&gt; you will be prompted for a password<br />
19:03 &lt; SpaceBass2&gt; says either us -p or named pipe<br />
19:04 &lt;@dre^&gt; oh, interesting&#8230; must be a difference between versions<br />
19:04 &lt;@dre^&gt; try passing -p with no password<br />
19:04 &lt; SpaceBass2&gt; same error<br />
19:04 &lt;@dre^&gt; blah, then do -p &lt;password&gt;<br />
19:04 &lt;@dre^&gt; which is evil and stupid<br />
19:04 &lt;@dre^&gt; 10.5.4 server allows you to get a secure prompt<br />
19:04 &lt; SpaceBass2&gt; guess I can truncate history later :D<br />
19:04 &lt;@dre^&gt; heh *nod*<br />
19:05 &lt;@dre^&gt; hopefully you will see it creating new service principals&#8230;<br />
19:05 &lt; SpaceBass2&gt; ok&#8230;same error &#8230;so I moved -p right after the -a diradmin<br />
19:05 &lt;@dre^&gt; in the form service/vail.nsnet.com/NSNET.COM<br />
19:05 &lt;@dre^&gt; hmm<br />
19:05 &lt; SpaceBass2&gt; creating service princs<br />
19:05 &lt; SpaceBass2&gt; add_principal: Principal or policy already exists while creating &#8220;ldap/vail.local@NSNET.COM&#8221;.<br />
19:05 &lt;@dre^&gt; bah!<br />
19:06 &lt;@dre^&gt; and you are sure that the &#8216;hostname&#8217; command does not return vail.local?<br />
19:06 &lt; SpaceBass2&gt; 100%<br />
19:06 &lt;@dre^&gt; oh, I guess this could be keying off the KerberosConfig record&#8230;<br />
19:06 &lt;@dre^&gt; maybe we need to re-publish that<br />
19:06 &lt;@dre^&gt; ok let&#8217;s see&#8230;<br />
19:07 &lt; SpaceBass2&gt; and by the way &#8211; if I&#8217;m keeping you from something, please say so<br />
19:07 &lt; SpaceBass2&gt; you&#8217;v been more than helpful, to say the least<br />
19:07 &lt;@dre^&gt; well thanks :) I kinda wanna solve this, I&#8217;m sure i&#8217;ll be seeing similar problems from others&#8230;<br />
19:07 &lt;@dre^&gt; (I help scrub incomming server bugs)<br />
19:08 &lt; SpaceBass2&gt; I really appreciate the help!<br />
19:08 &lt; SpaceBass2&gt; gotcha &#8211; so this is right up your alley then<br />
19:08 &lt; SpaceBass2&gt; although I suspect you dont see many home users with Server<br />
19:09 &lt;@dre^&gt; well, no&#8230;<br />
19:10 &lt;@dre^&gt; ok, gotta find how the KerberosClient record can be re-created<br />
19:10 &lt;@dre^&gt; cause that&#8217;s where the bad data is coming from<br />
19:10 &lt; SpaceBass2&gt; I&#8217;d show you my server cabinet and rack &#8230;but its a tad shoddy compared to a real server room<br />
19:10 &lt;@dre^&gt; could very well have been left over from the false start(s)<br />
19:12 &lt; SpaceBass2&gt; humm<br />
19:12 &lt;@dre^&gt; ok how about this<br />
19:12 &lt;@dre^&gt; dscl /Search list /Computers<br />
19:13 &lt; SpaceBass2&gt; livingroom.local$<br />
19:13 &lt; SpaceBass2&gt; livingroom.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.2F5BAB71984D985DC0BA0D103C85DC067EF0A22E$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.64604752011301522B118A9CFE83A95560B194E5$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.AB999D5B63EDDCDC11B360E1EACB9536849844CC$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.C1E7E428054307B586CD240141B42583DF46FB5A$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.C2DA7627FD7C4E44EFE720A00FAE2CE2F76BA9A8$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.DD1F37D568FCC14ACE2F3935554012B235C87A4C$<br />
19:13 &lt; SpaceBass2&gt; LKDC:SHA1.DD362AEF0FD6C7CBA5664D5FD27818058317ED49$<br />
19:13 &lt; SpaceBass2&gt; osx1<br />
19:13 &lt; SpaceBass2&gt; osx1.local$<br />
19:13 &lt; SpaceBass2&gt; osx1.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; osx10.local$<br />
19:13 &lt; SpaceBass2&gt; osx10.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; osx5<br />
19:13 &lt; SpaceBass2&gt; osx5.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; osx7.local$<br />
19:13 &lt; SpaceBass2&gt; osx7.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; telluride.nsnet.com<br />
19:13 &lt; SpaceBass2&gt; vail.nsnet.com$<br />
19:13 &lt; SpaceBass2&gt; oops&#8230;SORRY<br />
19:13 &lt; SpaceBass2&gt; ment to put that into pastebin<br />
19:13 &lt;@dre^&gt; no worries, butok, vail.nsnet.com is there<br />
19:15 &lt; SpaceBass2&gt; help me understand the $ &#8230; is that some kind of wild card<br />
19:15 &lt;@dre^&gt; used for computer records<br />
19:15 &lt;@dre^&gt; maybe only those with a qualified name<br />
19:15 &lt;@dre^&gt; e.g. foo.tld instead of just foo<br />
19:15 &lt;@dre^&gt; and I think only when they are auto-generated<br />
19:16 &lt;@dre^&gt; which is why teh linux box record doesn&#8217;t have one<br />
19:16 &lt; SpaceBass2&gt; gotcha<br />
19:16 &lt; SpaceBass2&gt; gotcha<br />
19:17 &lt;@dre^&gt; ok hmmm<br />
19:17 &lt; SpaceBass2&gt; I&#8217;ve avoided joining the other machines until I get the issues sussed out<br />
19:18 &lt;@dre^&gt; dscl /Search read &#8220;/Computers/vail.nsnet.com$&#8221;<br />
19:18 &lt;@dre^&gt; sorry<br />
19:18 &lt;@dre^&gt; dscl /Search read &#8220;/Computers/vail.nsnet.com$&#8221; cn<br />
19:19 &lt; SpaceBass2&gt; dsAttrTypeNative:cn: vail.nsnet.com$ vail.nsnet.com<br />
19:19 &lt;@dre^&gt; ok<br />
19:20 &lt;@dre^&gt; kdcsetup is the one who writes the KerberosClient record into LDAP<br />
19:22 &lt;@dre^&gt; but it doesn&#8217;t appear to be able to only re-write KerberosClient without doing everything else<br />
19:22 &lt;@dre^&gt; so fire up WGM<br />
19:22 &lt;@dre^&gt; go into prefs, turn on the inspector<br />
19:22 &lt; SpaceBass2&gt; k<br />
19:22 &lt; dakine&gt; hey guys, quick question<br />
19:23 &lt; dakine&gt; what do you say you do for a living?<br />
19:23 &lt;@dre^&gt; click the bullseye icon (the right-most above the left-hand list view)<br />
19:23 &lt;@dre^&gt; I work at apple as a seed engineer<br />
19:23 &lt; SpaceBass2&gt; &lt;&#8211; healthcare process improvement   :D<br />
19:23 &lt;@dre^&gt; software seeding, that is<br />
19:23 &lt; SpaceBass2&gt; looking for inspector<br />
19:24 &lt;@dre^&gt; second checkbox<br />
19:24 &lt;@dre^&gt; (in the wgm prefs)<br />
19:24 &lt; dakine&gt; lol<br />
19:24 &lt; dakine&gt; ok<br />
19:24 &lt; SpaceBass2&gt; see it now<br />
19:24 &lt;@dre^&gt; dakine: in case that isn&#8217;t clear, I help mediate communications between external customers with bugs and apple software engineers<br />
19:24 &lt; SpaceBass2&gt; ok&#8230;in the bulls eye<br />
19:24 &lt; SpaceBass2&gt; also new to me<br />
19:25 &lt; dakine&gt; ah<br />
19:25 &lt;@dre^&gt; from the pop-up menu, select Config<br />
19:25 &lt; dakine&gt; so you are the middleman<br />
19:25 &lt;@dre^&gt; well I hate that term, heh<br />
19:25 &lt; dakine&gt; cause the software engineers arent people persons<br />
19:25 &lt;@dre^&gt; middleman implies that I&#8217;m good for nothing ;)<br />
19:25 &lt; dakine&gt; lol<br />
19:25 &lt; dakine&gt; listen<br />
19:25 &lt; dakine&gt; nothing gets done without the middle man<br />
19:26 &lt;@dre^&gt; space: then select KerberosClient<br />
19:26 &lt; dakine&gt; its just the problem givers and the problems solvers in communicado<br />
19:26 &lt;@dre^&gt; then select XMLPlist and click Edit below<br />
19:26 &lt; dakine&gt; anyways I am off<br />
19:26 &lt;@dre^&gt; later dakine :)<br />
19:26 &lt; SpaceBass2&gt; im there<br />
19:26 &lt; SpaceBass2&gt; later dakine<br />
19:26 &lt;@dre^&gt; fix the hostnames<br />
19:26 &lt;@dre^&gt; vail.local becomes vail.nsnet.com<br />
19:27 &lt; SpaceBass2&gt; k<br />
19:27 &lt;@dre^&gt; and increment the generation ID by one<br />
19:27 &lt;@dre^&gt; (at the bottom)<br />
19:27 &lt; SpaceBass2&gt; fixed<br />
19:27 &lt;@dre^&gt; the generation ID is how the client tells if its local version of the config is stale<br />
19:28 &lt; SpaceBass2&gt; ah<br />
19:28 &lt; SpaceBass2&gt; that long integer at the btm?<br />
19:28 &lt;@dre^&gt; yes<br />
19:28 &lt; SpaceBass2&gt; k<br />
19:29 &lt;@dre^&gt; click OK to comit the changes<br />
19:29 &lt;@dre^&gt; click Save if it&#8217;s lit up<br />
19:29 &lt; SpaceBass2&gt; k<br />
19:29 &lt;@dre^&gt; go back to the client and run sudo kerberosautoconfig<br />
19:29 &lt;@dre^&gt; (we&#8217;ll do the server next if this works)<br />
19:29 &lt;@dre^&gt; then examine edu.mit.Kerberos on the client<br />
19:30 &lt;@dre^&gt; the kdc and kdc admin server should be reported as vail.nsnet.com<br />
19:30 &lt; SpaceBass2&gt; yep<br />
19:30 &lt; SpaceBass2&gt; it is<br />
19:30 &lt;@dre^&gt; ok great<br />
19:30 &lt;@dre^&gt; same thing on the OD master<br />
19:30 &lt; SpaceBass2&gt; on the master huh?<br />
19:30 &lt; SpaceBass2&gt; k<br />
19:30 &lt;@dre^&gt; aye<br />
19:31 &lt; SpaceBass2&gt; done<br />
19:31 &lt;@dre^&gt; now we want to sso_util configure again, same as before&#8230; lemme double check the usage<br />
19:31 &lt;@dre^&gt; sudo sso_util configure -r NSNET.COM -a whatever -p whatever all<br />
19:32 &lt;@dre^&gt; now you shoudl get correct keytabs<br />
19:32 &lt;@dre^&gt; if so, that *should* be it<br />
19:32 &lt; SpaceBass2&gt; still got warnings about the .local :(<br />
19:33 &lt;@dre^&gt; BAH<br />
19:33 &lt;@dre^&gt; and you did check that it got an updated edu.mit.kerberos, right?<br />
19:33 &lt;@dre^&gt; the od master<br />
19:33 &lt; SpaceBass2&gt; yeah<br />
19:34 &lt; SpaceBass2&gt; its correct<br />
19:34 &lt;@dre^&gt; hmm<br />
19:34 &lt;@dre^&gt; oh, uhm..<br />
19:34 &lt;@dre^&gt; well no, not a stale DS cache if hte on-disk file is correct<br />
19:35 &lt; SpaceBass2&gt; yeah, checking /L/P/edu&#8230;<br />
19:35 -!- Azhi_Dahaka [n=Azhi@unaffiliated/azhidahaka/x-172934] has quit []<br />
19:36 &lt;@dre^&gt; oooo<br />
19:36 &lt;@dre^&gt; I think I know :)<br />
19:37 &lt;@dre^&gt; you might have an &#8216;upgraded&#8217; sso_util<br />
19:37 &lt;@dre^&gt; from tiger<br />
19:37 &lt;@dre^&gt; md5 /usr/sbin/sso_util<br />
19:37 &lt;@dre^&gt; paste results pls<br />
19:37 &lt; SpaceBass2&gt; its a fresh install from leopard<br />
19:37 &lt;@dre^&gt; oh dammit<br />
19:37 &lt; SpaceBass2&gt; its a one liner<br />
19:37 &lt; SpaceBass2&gt; MD5 (/usr/sbin/sso_util) = 32a7a95f3e49502ddb0863583c30410d<br />
19:37 &lt; SpaceBass2&gt; 10.5.3 remember<br />
19:38 &lt;@dre^&gt; ppc?<br />
19:38 &lt; SpaceBass2&gt; yeah &#8230;<br />
19:38 &lt; SpaceBass2&gt; g4<br />
19:38 &lt;@dre^&gt; k, no problem. but that probably explains why its different from mine<br />
19:38 &lt;@dre^&gt; actually..<br />
19:38 &lt;@dre^&gt; file /usr/sbin/sso_util<br />
19:38 &lt;@dre^&gt; paste results<br />
19:38 &lt; SpaceBass2&gt; if I buy an xserver my wife call it quits<br />
19:39 &lt;@dre^&gt; heh, they are big and loud<br />
19:39 &lt; SpaceBass2&gt; http://pastebin.ca/1061784<br />
19:40 &lt; SpaceBass2&gt; can&#8217;t be louder than my 2u linux box :D<br />
19:40 &lt; SpaceBass2&gt; but might be hotter<br />
19:41 &lt;@dre^&gt; just looking for both a ppc and i386 image, that&#8217;s all&#8230;<br />
19:41 &lt;@dre^&gt; not really taht important.<br />
19:41 &lt;@dre^&gt; hmm, there&#8217;s supposed to be an sso_util debug mode&#8230;<br />
19:42 &lt; SpaceBass2&gt; is sso_util unique to OSX?<br />
19:42 &lt;@dre^&gt; here we go<br />
19:42 &lt;@dre^&gt; this is gonna be big-ass<br />
19:43 &lt;@dre^&gt; same sso_util command, but add: -v 7 after configure and before -r<br />
19:43 &lt;@dre^&gt; and pastebin results<br />
19:43 &lt; SpaceBass2&gt; which cmd?<br />
19:43 &lt; SpaceBass2&gt; the confgure ?<br />
19:43 &lt; SpaceBass2&gt; configure ?<br />
19:43 &lt;@dre^&gt; sso_util configure -v 7 &#8230;<br />
19:44 &lt; SpaceBass2&gt; any second Im going to forget and pastebin the admin passwd<br />
19:45 &lt;@dre^&gt; well at least your conscious of that possibility ;)<br />
19:46 &lt; SpaceBass2&gt; http://pastebin.ca/1061791</p>
<p><a href="http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste2" target="_blank">http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste2 </a></p>
<p>19:46 &lt;@dre^&gt; I suspect that the GerPrimaryHostName block will contain the error&#8230;<br />
19:47 &lt;@dre^&gt; oh snap, do you have multiple IPs on the od master?<br />
19:47 &lt; SpaceBass2&gt; leme check &#8211; I did under tiger server, but didn&#8217;t tink I did any more<br />
19:48 &lt;@dre^&gt; man pastebin.ca needs an upgrade<br />
19:48 &lt;@dre^&gt; still loading&#8230; there it goes<br />
19:48 &lt;@dre^&gt; shit<br />
19:48 &lt; SpaceBass2&gt; I had to do it under tiger b/c I did a DNS move (migrated from Windows Server&#8230;what a mistake that was) &#8230; but thats a long story<br />
19:49 &lt; SpaceBass2&gt; yeah&#8230;still have two IPs<br />
19:50 &lt; SpaceBass2&gt; don&#8217;t need the 2nd anymore since I&#8217;m not doing VPN on the OSX server anymore<br />
19:50 &lt;@dre^&gt; yep foudn the problem<br />
19:50 &lt;@dre^&gt; line 433<br />
19:51 &lt; SpaceBass2&gt; &lt;CFArray 0x10ec80 [0xa07e7174]&gt;{type = immutable, count = 2, values = (<br />
19:51 &lt; SpaceBass2&gt; ?<br />
19:51 &lt;@dre^&gt; heh, no not that specific line<br />
19:51 &lt;@dre^&gt; but that begins a block&#8230;<br />
19:51 &lt;@dre^&gt; 432: GetPrimaryHostName<br />
19:51 &lt;@dre^&gt; then it steps through your network interfaces<br />
19:52 &lt;@dre^&gt; in the two blocks that follow<br />
19:52 &lt;@dre^&gt; for each interface, you see attributes like family, dnsName, name, serviceName, etc<br />
19:52 &lt;@dre^&gt; note that the second one has isPrimaryIPv4Interface<br />
19:52 &lt; SpaceBass2&gt; brb&#8230;.going to change root on several computers<br />
19:52 &lt;@dre^&gt; guess which one that is :)<br />
19:52 &lt;@dre^&gt; good idea<br />
19:53 &lt;@dre^&gt; you *should* be able to solve this by simply setting 10.1.1.5 as your primary address<br />
19:53 &lt;@dre^&gt; which you can do by drag / drop in the network prefpane&#8217;s list of interfaces (under &#8216;change network service order&#8217;, from the gear menu)<br />
19:54 &lt;@dre^&gt; woohoo, we found the problem!<br />
19:54 &lt; SpaceBass2&gt; one sec&#8230;<br />
19:55 &lt;@dre^&gt; do you mind if I post this chat log to my blog?<br />
19:55 &lt; SpaceBass2&gt; and I created a huge one<br />
19:55 &lt;@dre^&gt; yeah, heh. happens to everybody at one time or another&#8230;<br />
19:55 &lt; SpaceBass2&gt; no, please do&#8230;I was going to ask you if I could keep it too<br />
19:55 &lt;@dre^&gt; just be fast about changing and double-check access logs&#8230;<br />
19:56 &lt;@dre^&gt; I&#8217;ve actually typed passwords directly into IRC before, when I thought a certain window had focus but between the time that it had focus and the time I typed the password, something caused a change in window focus&#8230;<br />
19:56 &lt;@dre^&gt; like an errant mouse click, for instance&#8230;<br />
19:56 &lt; SpaceBass2&gt; ok&#8230; ssh closed &#8230;. passwords changed<br />
19:57  * SpaceBass2 wipes brow<br />
19:57 &lt;@dre^&gt; so anyway, do you see what&#8217;s going on line 432?<br />
19:57 &lt;@dre^&gt; &#8220;going on on line 432&#8243;<br />
19:58 &lt;@dre^&gt; &#8220;GetPrimaryHostName&#8221;&#8230; this result will be used to form the server name portion of the kerberos service principal<br />
19:58 &lt; SpaceBass2&gt; leme look<br />
19:59 &lt;@dre^&gt; looking at the two blocks directly following (434 &#8211; 439 and 441 &#8211; 448), you can see attributes that look like they are related to network interfaces<br />
19:59 &lt;@dre^&gt; like ipAddress, dnsName, family, etc<br />
19:59 &lt; SpaceBass2&gt; ahhhh<br />
19:59 &lt; SpaceBass2&gt; snap!<br />
19:59 &lt;@dre^&gt; so the bonus question is:<br />
19:59 &lt;@dre^&gt; how does the system determine what the primary hostname is?<br />
19:59 &lt; SpaceBass2&gt; of course<br />
19:59 &lt;@dre^&gt; look at the differences in the attributes for each interface<br />
19:59 &lt; SpaceBass2&gt; there&#8217;s no DNS entry for the 2nd interface<br />
20:00 &lt;@dre^&gt; well&#8230; they both have dnsName<br />
20:00 &lt;@dre^&gt; but what attribute is present for one but not the other?<br />
20:00 &lt; SpaceBass2&gt; looking<br />
20:00 &lt;@dre^&gt; ok there&#8217;s two&#8230; userDefinedName, and one other&#8230; the other one is the key :)<br />
20:01 &lt; SpaceBass2&gt; yep&#8230; .nsnet.com vs .local<br />
20:01 &lt; SpaceBass2&gt; binbo<br />
20:01 &lt; SpaceBass2&gt; bingo<br />
20:01 &lt;@dre^&gt; no no<br />
20:01 &lt;@dre^&gt; keep looking<br />
20:01 &lt;@dre^&gt; how does it know which of those to choose?<br />
20:01 &lt; SpaceBass2&gt; en0?<br />
20:01 &lt;@dre^&gt; nope<br />
20:01 &lt;@dre^&gt; which attribute is present for one but not the other?<br />
20:01 &lt; SpaceBass2&gt; ok&#8230;leme keep looking<br />
20:01 &lt;@dre^&gt; besides userDefinedName<br />
20:01 &lt; SpaceBass2&gt; dont tell me<br />
20:02 &lt;@dre^&gt; en0 is not an attribute, it&#8217;s a value<br />
20:02 &lt; SpaceBass2&gt; d&#8217;oh<br />
20:02 &lt; SpaceBass2&gt; isPrimaryIPv4Interface = true<br />
20:02 &lt;@dre^&gt; the attribute that corresponds to en0 is &#8216;name&#8217;, as in the bsd name of the interface<br />
20:02 &lt;@dre^&gt; yep, that&#8217;s the one<br />
20:02 &lt; SpaceBass2&gt; I&#8217;m actually laughing out loud<br />
20:02 &lt;@dre^&gt; so then, how do you set which is the primary interface? :)<br />
20:02 &lt; SpaceBass2&gt; never in a million years<br />
20:02 &lt; SpaceBass2&gt; well now, thats a good question<br />
20:03 &lt;@dre^&gt; there is a very easy GUI answer, also :)<br />
20:03 &lt; SpaceBass2&gt; b/c the one it identifies as primary is actually a copy<br />
20:03 &lt;@dre^&gt; and that&#8217;s perfectly legit<br />
20:03 &lt; SpaceBass2&gt; I&#8217;m guessing you go into network prefs and drag it first<br />
20:03 &lt;@dre^&gt; yep!<br />
20:03 &lt; SpaceBass2&gt; ALRIGHT!<br />
20:03 &lt;@dre^&gt; the top-most active interface is the primary<br />
20:03 &lt;@dre^&gt; you should be able to simply make that change and re-run sso_util<br />
20:04 &lt; SpaceBass2&gt; ok &#8230;what if I just delete it?<br />
20:04 &lt; SpaceBass2&gt; since I dont need it?<br />
20:04 &lt;@dre^&gt; well&#8230; that could be a problem<br />
20:04 &lt; SpaceBass2&gt; ok<br />
20:04 &lt;@dre^&gt; because when you promote to master, the primary hostname / address is encoded in several spots<br />
20:04 &lt;@dre^&gt; but no fear: changeip to the rescue<br />
20:05 &lt;@dre^&gt; so you want to changeip over to .15 / vail.nsnet.com<br />
20:05 &lt;@dre^&gt; see the changeip manpage for examples<br />
20:05 &lt; SpaceBass2&gt; ok,&#8230; the one listed as primary is actually 2nd in the gui<br />
20:05 &lt;@dre^&gt; really?!?<br />
20:05 &lt; SpaceBass2&gt; yeah<br />
20:05 &lt;@dre^&gt; well, which gui<br />
20:05 &lt;@dre^&gt; are you in &#8216;change network service order&#8217;, or the overview?<br />
20:06 &lt;@dre^&gt; sorry, &#8216;set network service order&#8217;, under the gear menu<br />
20:06 &lt; SpaceBass2&gt; http://www.flickr.com/photos/nickdawson/2634507389/</p>
<p><img src="http://www.dreness.com/blog/wp-content/uploads/2008/07/2634507389_b6afcbb829.jpg" alt="2634507389_b6afcbb829.jpg" /></p>
<p>20:06 &lt;@dre^&gt; which is just above the lock<br />
20:06 &lt;@dre^&gt; ya, click the gear icon<br />
20:06 &lt;@dre^&gt; &#8216;set network service order&#8217;<br />
20:06 &lt; SpaceBass2&gt; modem, if1 (.15) firewire if2 (.17)<br />
20:07 &lt; SpaceBass2&gt; .17 is the one set as .local and primary and is not needed<br />
20:07 &lt;@dre^&gt; .17 should appear above .15 in the &#8216;set network service order&#8217; list<br />
20:07 &lt;@dre^&gt; since it is in fact the primary, and that list order is supposed to be what defines the primary<br />
20:08 &lt;@dre^&gt; on the ohter hand<br />
20:08 &lt;@dre^&gt; most of hte system appears to believe that vail.nsnet.com is the primary hostname<br />
20:08 &lt;@dre^&gt; which suggest that somehow, somewhere, the network config got confused<br />
20:08 &lt;@dre^&gt; what I would try is simply dragging .17 to the top, and then dragging .15 to the top<br />
20:09 &lt;@dre^&gt; which should re-set the isPrimaryIPv4Interface to be correct<br />
20:09 &lt; SpaceBass2&gt; back&#8230;had to get power<br />
20:09 &lt; SpaceBass2&gt; http://www.flickr.com/photos/nickdawson/2635335214/</p>
<p><img src="http://www.dreness.com/blog/wp-content/uploads/2008/07/2635335214_1c1a36fc13.jpg" alt="2635335214_1c1a36fc13.jpg" /></p>
<p>20:10 &lt;@dre^&gt; yeah just try dragging &#8216;ethernet&#8217; to the top<br />
20:10 &lt;@dre^&gt; er sorry<br />
20:10 &lt;@dre^&gt; oh wow<br />
20:10 &lt;@dre^&gt; no this is very broken<br />
20:10 &lt;@dre^&gt; lol<br />
20:10 &lt; SpaceBass2&gt; lol!<br />
20:10 &lt;@dre^&gt; both of those interfaces claim to be &#8216;en0&#8242;<br />
20:11 &lt;@dre^&gt; which is theoretically impossible<br />
20:11 &lt; SpaceBass2&gt; well, in linux-speak &#8230; en1 and en1:1<br />
20:11 &lt;@dre^&gt; right, but when you create virtual interfaces in os x, they each get unique bsd names<br />
20:11 &lt; SpaceBass2&gt; in other words 10.1.1.17 is a vitrual IP<br />
20:11 &lt; SpaceBass2&gt; right<br />
20:11 &lt; SpaceBass2&gt; and bsd interface names baffle me :D<br />
20:12 &lt;@dre^&gt; hmm&#8230; actually maybe I&#8217;m wrong about that. ifconfig would show them in teh same physical interface<br />
20:12 &lt;@dre^&gt; os maybe this isn&#8217;t horribly broken as I thought<br />
20:12 &lt;@dre^&gt; but they are definitely ordered wrong, or at least the OS thinks they are<br />
20:12 &lt;@dre^&gt; (you can use ifconfig to read, but should not use it to change settings)<br />
20:12 &lt; SpaceBass2&gt; how detrimental would it be to delete the virtual IP?<br />
20:12 &lt;@dre^&gt; (the os x equivalent is ipconfig)<br />
20:13 &lt;@dre^&gt; probably not very, since your system already thinks it is vail.nsnet.com<br />
20:13 &lt; SpaceBass2&gt; yeah, I know ifconfig :D &#8230;<br />
20:13 &lt;@dre^&gt; except for this one little piece of configuration which is wrong<br />
20:13 &lt;@dre^&gt; but just to be safe, disable it instead of deleting<br />
20:13 &lt; SpaceBass2&gt; ok<br />
20:13 &lt;@dre^&gt; gear &#8211;&gt; make service inactive<br />
20:13 &lt;@dre^&gt; that way you can always turn it on if something assplodes<br />
20:14 &lt; SpaceBass2&gt; is that the same as ifconfig &lt;interface&gt; down ?<br />
20:14 &lt;@dre^&gt; yes, but don&#8217;t do that in os x<br />
20:14 &lt;@dre^&gt; you should only use ifconfig to read settings, not write them<br />
20:14 &lt; SpaceBass2&gt; yeah?<br />
20:14 &lt; SpaceBass2&gt; you mentioned that<br />
20:14 &lt;@dre^&gt; (because ifconfig bypasses the system frameworks that are used by the rest of the OS)<br />
20:15 &lt; SpaceBass2&gt; I always have to remind myself that bash in osx is truly just a shell<br />
20:15 &lt;@dre^&gt; so you could make a change, but hte OS doens&#8217;t know the change was made (only the very low networking layers), and so e.g. network prefs would be totally ignorant of the change<br />
20:15 &lt; SpaceBass2&gt; which is arguably the way it should be<br />
20:15 &lt;@dre^&gt; if you want to make network changes from the cli, use ipconfig or networksetup<br />
20:16 &lt;@dre^&gt; so disable the interface and re-run sso_util<br />
20:16 &lt;@dre^&gt; brb, potty<br />
20:16 &lt; SpaceBass2&gt; jawdrop &#8211; ipconfig is a binary in 10.5 &#8230; wow<br />
20:18 &lt; SpaceBass2&gt; ok &#8230; re-ran and same result &#8230;still .local<br />
20:18 &lt; SpaceBass2&gt; but I feel that we are very close :D<br />
20:18 &lt;@dre^&gt; hmm<br />
20:18 &lt;@dre^&gt; let me see that relevant hunk of sso_util configure -v 7 output<br />
20:19 &lt; SpaceBass2&gt; Entry for principal ftp/vail.local@NSNET.COM with kvno 7, encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/etc/krb5.keytab.<br />
20:19 &lt;@dre^&gt; the part where it detects network name<br />
20:19 &lt; SpaceBass2&gt; leme get it<br />
20:19 &lt;@dre^&gt; GetPrimaryHostName<br />
20:20 &lt; SpaceBass2&gt; http://pastebin.ca/1061809</p>
<p><a href="http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste3"> http://dreness.com/bits/tech/applied_kerberos_troubleshooting/paste3</a></p>
<p>20:21 &lt;@dre^&gt; (loading)<br />
20:24 &lt;@dre^&gt; well tha&#8217;ts bizarre&#8230;<br />
20:24 &lt;@dre^&gt; it still think vail.local is primary<br />
20:26 &lt;@dre^&gt; maybe you will need to delete .17<br />
20:26 &lt;@dre^&gt; it could also be that the settings are horked enough that you cannot change them<br />
20:26 &lt; SpaceBass2&gt; yeah, not ruling that out<br />
20:26 &lt;@dre^&gt; (you did remember to click Apply right?)<br />
20:26 &lt;@dre^&gt; in network prefs&#8230;<br />
20:27 &lt; SpaceBass2&gt; heck, let me delete it and see<br />
20:27 &lt; SpaceBass2&gt; yeah, closed prefs and re-opned even<br />
20:28 &lt; SpaceBass2&gt; BOOM!<br />
20:28 &lt; SpaceBass2&gt; removed it and bingop<br />
20:28 &lt; SpaceBass2&gt; bingo<br />
20:28 &lt; SpaceBass2&gt; xmpp/vail.nsnet.com@NSNET.COM<br />
20:28 &lt;@dre^&gt; woot!<br />
20:28 &lt; SpaceBass2&gt; high-five!<br />
20:28 &lt;@dre^&gt; ^5 :)</p>
<p>Epilogue:  After re-reading this, I realized that his afp server is actually a separate host from his OD master (vail), but the same troubleshooting steps apply&#8230; so in the end, I might not have actually fixed the AFP mounting problem, but we did fix at least *some* problems :)</p>
<p>Finally: if anyone knows how to make WordPress not DELETE AN ENTIRE POST when you paste in a chunk of text that is too big; or, how to adjust this threshold, please tell me. This post took entirely too long to compose, as I had to move text around in increasingly smaller chunks to work around this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreness.com/blog/?feed=rss2&amp;p=43</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
