<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Mac OS X SIG</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/" />
    <link rel="self" type="application/atom+xml" href="http://www.stanford.edu/group/macosxsig/blog/atom.xml" />
    <id>tag:www.stanford.edu,2011-03-30:/group/macosxsig/blog//1</id>
    <updated>2011-08-01T23:18:17Z</updated>
    <subtitle>Community supported Mac special interest group at Stanford University</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.12</generator>

<entry>
    <title>Enable Logging with 10.7 SMBX (Windows File Sharing)</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2011/08/enable-logging-with-107-smbx-w.html" />
    <id>tag:www.stanford.edu,2011:/group/macosxsig/blog//1.109</id>

    <published>2011-08-01T23:13:41Z</published>
    <updated>2011-08-01T23:18:17Z</updated>

    <summary>Apple replaced Samba with SMBX, their home-cooked application for Windows File Sharing. By default, it doesn&apos;t do much logging. If you want to review logs, you&apos;ll have to edit the launchd item. Add the two extra ProgramArgument keys in bold...</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>Apple replaced Samba with SMBX, their home-cooked application for Windows File Sharing. By default, it doesn't do much logging. If you want to review logs, you'll have to edit the launchd item. Add the two extra ProgramArgument keys in bold below.<br /></p>

<p><code>beteblanche:~ noahabrahamson$ sudo vi /System/Library/LaunchDaemons/com.apple.smbd.plist</code></p>

<p>...</p>

<pre><code>    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
            &lt;string&gt;/usr/sbin/smbd&lt;/string&gt;
<b>            &lt;string&gt;-debug&lt;/string&gt;
            &lt;string&gt;-stdout&lt;/string&gt;</b>
    &lt;/array&gt;
</code></pre>

<p>Now you can use <tt>syslog -w</tt> to review your logs in Terminal in real time.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>syntax differences between autofs and mount_smbfs</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2011/03/syntax-differences-between-autofs-and-mount-smbfs.html" />
    <id>tag:www.stanford.edu,2011:/group/macosxsig/blog//1.107</id>

    <published>2011-03-29T18:59:30Z</published>
    <updated>2011-08-10T19:10:34Z</updated>

    <summary> If you are trying to establish static CIFS (aka SMB) mounts on your Mac, here are a couple hints that might save some time and effort. If you need to specify the domain (say, if you are using Active...</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>
	If you are trying to establish static CIFS (aka SMB) mounts on your Mac, here are a couple hints that might save some time and effort.
</p>
<p>
	If you need to specify the domain (say, if you are using Active Directory credentials), you need to escape the semicolon that divides the domain and the username. So if your map file is /etc/auto_smb, then you could use something like this example.<br />
</p>
<div class="codeblock">
	localmountpoint &nbsp; -fstype=smbfs&nbsp; ://DOMAIN\;username:password@nas.stanford.edu/sharepoint\$&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<p>
	You <i>also</i> need to escape the dollar sign if have such a character on your remote server's sharepoint (plus any funky characters in your password). <i>Thanks Adam!</i> If you do not, you'll get errors like
</p>	
<div class="codeblock">
		/sbin/mount_smbfs[2017] &lt;Error&gt;: smb_mount: mount failed to nas.stanford.edu/sharepoint : syserr = No such file or directory&nbsp;&nbsp;&nbsp;&nbsp;
</div>   
<p>and the icon in the Mac's Finder will be a broken alias. Note that you may need to enable verbose logging (which isn't terribly verbose) in /etc/autofs.conf file to get these messages in your system.log file.</p>
<p>
	If you're using mount_smbfs (or mount -t smbfs) via command line, on the other hand, it's unnecessary to escape the trailing $, but acceptable.<br />
	<br />
	It would seem that your autofs map file could have the username, domain and password configured on a different file, as measure of security. This is normally done like this:<br />
</p>
<div class="codeblock">
	localmountpoint &nbsp; -fstype=smbfs,credentials=/path/to/file&nbsp; ://nas.stanford.edu/sharepoint\$&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<p>
	But that will result in an error message, like<br />
</p>
<div class="codeblock">
	com.apple.automountd[341]: mount_smbfs: -o credentials: option not supported&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<p>
	...so it's important to safeguard the map file if you're going to expose the credentials in plain text (chown root:wheel and chmod to 600).<br />
	<br />
	In the <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/mount_smbfs.8.html">man page</a> for mount_smbfs, the wording suggests we could use the -N flag to bypass a password prompt and instead have mount_smbfs consult /etc/nsmb.conf. It says, "
</p>
<div class="codeblock">
	Do not ask for a password. At run time, mount_smbfs reads the ~/Library/Preferences/nsmb.conf file for additional configuration parameters and a password. If no password is found, mount_smbfs prompts for it."&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<p>
	However, the <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/nsmb.conf.5.html#//apple_ref/doc/man/5/nsmb.conf">man page</a> for nsmb.conf gives no indication that the password could be a valid key.<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>kickstart vs serveradmin for ARD ON/OFF</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/12/kickstart-vs-serveradmin-for-a.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.105</id>

    <published>2010-12-03T19:25:43Z</published>
    <updated>2010-12-16T21:36:57Z</updated>

    <summary><![CDATA[I've always used the kickstart command to manage ARD. But little did I know that it can be managed using serveradmin too./usr/sbin/serveradmin settings info:enableARD = yes&nbsp;...does the trick too!...]]></summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>I've always used the <tt>kickstart</tt> command to manage ARD. But little did I know that it can be managed using <tt>serveradmin</tt> too.</p><p><tt>/usr/sbin/serveradmin settings info:enableARD = yes</tt>&nbsp;</p><p>...does the trick too!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Flipped mouse buttons, plist and MS Remote Desktop Connection</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/12/flipped-mouse-buttons-plist-an.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.103</id>

    <published>2010-12-02T19:37:44Z</published>
    <updated>2010-12-02T19:59:54Z</updated>

    <summary>For a while, I used a mouse with my laptop. Because I was dealing with some wrists issues, I had the buttons flipped so that the main clicking button was on the right side, and the &quot;right click&quot; button was...</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>For a while, I used a mouse with my laptop. Because I was dealing with some wrists issues, I had the buttons flipped so that the main clicking button was on the right side, and the "right click" button was actually on the left side. &nbsp;Over time, I lost the mouse and resumed using the trackpad.</p><p>What drove me nuts, however, was how my Microsoft Remote Desktop Connection connections still were programmed with the flipped buttons. Even though my trackpad on my Mac was now set back to the default arrangement, whenever I connected to a Windows machine, my buttons continued to be flipped. And since I connected to these particular Windows servers from different Macs, I had to keep flipping the right/left preference in Windows each time changed Macs.</p><p>Unfortunately, there's no evident way to reset your mouse button settings on a Mac laptop via the normal PreferencePane in System Preferences <i>if you don't actually have a mouse attached</i>. No mouse, no GUI.</p><p>I searched high and low for where that setting is kept so that I could reverse it, so my RDC connections would also be returned to normal too. &nbsp;For your information, the right/left mouse button configuration is configured in ~/Library/Preferences/ByHost/.GlobalPreferences.[yourMACaddress].plist. That's a hidden, binary-encoded plist that's unique to your Mac hardware, in your home folder.</p><p>To edit this file, you will need to convert it to XML using the <tt>plutil</tt>&nbsp;terminal command, then modify the structure using your favorite text editor. You could also just delete it and a new, default one will be created, but this is a big plist with lots of discrete preference settings. Or, you could use the Property List Editor.app included with Xcode. TextMate will also allow you to convert and edit the file accordingly.</p><p><br /></p>]]>
        
    </content>
</entry>

<entry>
    <title>diskutil command line secureErase options</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/11/diskutil-command-line-secureer.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.101</id>

    <published>2010-11-16T21:03:48Z</published>
    <updated>2010-11-16T21:49:09Z</updated>

    <summary>When I need to decommission a hard drive, it&apos;s necessary for me to to securely wipe the data prior to disposal. Stanford&apos;s data wiping policy is publicly accessible from the internet (though woefully out of date with the product recommendations&#8212;Mac...</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[When I need to decommission a hard drive, it's necessary for me to to securely wipe the data prior to disposal. Stanford's <a href="http://www.stanford.edu/group/security/securecomputing/data_destruction_guidelines.html">data wiping policy</a> is publicly accessible from the internet (though woefully out of date with the product recommendations&#8212;Mac OS 8 anyone?).&nbsp;It's usually not enough just to delete the files using the Finder or the <tt>rm</tt> command, since that action merely hides your files and makes their blocks eligible for possible future write-overs.&nbsp;Inexpensive file recovery software can usually return data when you simply delete files this way, to say nothing of real forensics software.<br />]]>
        <![CDATA[<div>You may know that your Mac's Disk Utility program has the "Secure Erase" option, where you can choose from three degrees of security. You can zero-out the data, which means the computer erases your data and writes over the drive with zeros. This is a minimal, but sometimes acceptable, data sanitization effort. You can also choose the seven-pass Department of Defense wipe, which takes longer, but makes data recovery nearly impossible. Then there's the 35-pass wipe, for the hyper vigilant and possibly neurotic.</div><div><div><br /></div><div>Here is Apple's KB article on securely erasing a disk:&nbsp;<a href="http://support.apple.com/kb/TA24002" style="text-decoration: underline; ">http://support.apple.com/kb/TA24002</a></div><div><br /></div><div>What you may not know is that the&nbsp;<tt>diskutil</tt>&nbsp;command line tool has two additional options. In addition to the single-pass zero-out, you can choose a single-pass write over with&nbsp;<i>random numbers</i>. I would expect that process to take as long as a zero-out effort with Disk Utility. I'm not sure exactly sure what the benefit here is, except that it would remove the known delta between the state prior to the zero-out and the zeros. That is, if you used forensic analysis to examine a drive and it's all zeros,&nbsp;<i>and</i>&nbsp;your sophisticated tools detect prior states, it's reasonable to understand that that prior state is likely true (since we know that the new state will always be a zero).</div><div><br /></div><div>The other option with&nbsp;<tt>diskutil</tt>&nbsp;is what Apple labels a "DoE [Department of Energy] three-pass secure erase". I don't know much about this option. &nbsp;</div><div><br /></div><div>Here is the <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/diskutil.8.html">man page</a> for&nbsp;<tt>diskutil</tt>&nbsp;and the secureErase option; you can also just type&nbsp;<tt>diskutil secureErase</tt>&nbsp;at the prompt for the associated help.</div></div>]]>
    </content>
</entry>

<entry>
    <title>Retrieving the password for Server Admin-generated Keys</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/08/retrieving-the-password-for-se.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.99</id>

    <published>2010-08-23T22:34:16Z</published>
    <updated>2011-08-02T16:40:38Z</updated>

    <summary>Here&apos;s how to find the private key password chosen automatically by Mac OS X Server 10.6. Plus, instructions on how to strip the password from a .pem certificate, once you know that password.</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>With Mac OS X Server, you can use Server Admin and the Certificate Assistant tools to create your private key for your server. In fact, when you start the server up, out of the box, one has already been created for you. You can use this key to create a certificate signing request (CSR) to send to your certificate authority (CA) to sign. If you do this, you will get a spiffy signed cert back, appropriate for securing your web server, chat server or a variety of other uses.</p><p>If you try to use this cert with your <i>own</i> version of Apache, however, you will encounter the default situation where httpd will ask for the password of that .crt file during the startup procedure.</p><p>Many admins choose to delete the password from this certificate to eliminate administrator intervention when restarting the service. The usual way this is done is to run the command <tt>openssl rsa -in /path/to/mycert.crt -out /output/path/ofmyclean.crt</tt>. (or the variant, <tt>openssl rsa -in key.pem -out newkey.pem</tt> if you are working with .pem-format certificates, which are the default if you use Server Admin.app to generate certs).<br /></p><p>To run this command, you need to know the original password.</p><p>Intuitively, you might think that the password MOSXS uses to create this private key (and thus&nbsp; used to create the signed cert) would be the initial root password, or maybe the first eight characters of the serial number. Instead, it's a randomly generated password created by the system.</p><p>You can retrieve this password using the Keychain Access application.  Search for the "Mac OS X Server certificate management" object of the type "application password".  Double-click to examine this object and to reveal the password used by the system.</p><p>With this information, you can proceed with the <tt>openssl</tt> command to delete the password from your signed certificate. Note that you needn't have to worry about this if you're using the built-in Mac OS X services, since those programs will automatically consult the Keychain to get the password for the .crt file when starting up.<br /></p>]]>
        
    </content>
</entry>

<entry>
    <title>Binding your 10.6 Mac to the Campus OpenLDAP directory</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/08/binding-your-106-mac-to-the-ca.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.97</id>

    <published>2010-08-23T18:36:08Z</published>
    <updated>2010-08-23T21:14:01Z</updated>

    <summary>You can use the Stanford Directory Utility Template installer to help configure Directory Utility on your Mac.</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    <category term="directoryservices" label="directory services" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="openldap" label="OpenLDAP" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>These instructions are Snow Leopard-specific. First, download the <a href="http://stanford.edu/%7Enbfa/SDUT.dmg">Stanford Directory Utility Template</a> installer. It will install a property list file into your home directory, which will make configuring your Mac to use the campus OpenLDAP directory system even easier than before. This template holds the record and attribute matching information, so you don't need to edit much.</p><p>Next, launch Directory Utility. It's located in /System/Library/CoreServices folder. Edit the LDAPv3 service to add a new directory system. For
the server name, enter <i>ldap.stanford.edu</i> in the field. The program will query the campus OpenLDAP directory, then ask you to choose a template for LDAP mapping. Since you just installed the Stanford LDAP template, choose that from the pull-down menu. Enter <i>cn=accounts,dc=stanford,dc=edu</i> for the searchbase. <br /></p><p>You can configure other options as you see fit. You should also install the <a href="https://itservices.stanford.edu/service/ess/mac/kfm">Kerberos Configuration Utility</a> from the Essential Stanford Software site.<br /></p>

<div class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_a.png?x-id=a605f8c9-87f4-4bbd-8799-375ae3c10e27" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        
    </content>
</entry>

<entry>
    <title>Chassis lock on Xserve prevents bootup</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/02/chassis-lock-on-xserve-prevent.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.93</id>

    <published>2010-02-23T18:15:06Z</published>
    <updated>2011-08-10T19:18:20Z</updated>

    <summary>I&apos;m sure there are parameters here that I&apos;m not acknowledging, but this is something that justifies jotting down for posterity. One of the Xserves I manage (Early 2009) has a quad fibre card with connections to two fibre different switches...</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
        <category term="server" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>I'm sure there are parameters here that I'm not acknowledging, but this is something that justifies jotting down for posterity. One of the Xserves I manage (Early 2009) has a quad fibre card with connections to two fibre different switches (an Emulex and Qlogic SanBox). If the server's chassis is locked (as if to prevent accidental ejection of the internal hard drives), bootup is prevented; all I get is a blinking folder on the screen. Unlock the chassis and the machine boots normally. In my experience, it doesn't seem to matter how the server was shutdown or started up, via LOM or at the console.</p>

<p>Though this behavior seems reasonable, it's still undesirable. After all, what's the point of remote lights-out reboots if you can't reboot, even when your machine is configured properly. Oftentimes, chassis are locked to prevent accidents, which increase in likelihood when a server is in a high traffic area. I suggest the desired behavior should be is for the system to note its state prior to the shutdown, and permit booting only when that state is maintained.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Level II Oplocks and Snow Leopard Server Samba</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/01/level-ii-oplocks-and-snow-leop.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.91</id>

    <published>2010-01-26T19:28:56Z</published>
    <updated>2010-01-26T20:41:17Z</updated>

    <summary> If you do a testparm on your /etc/smb.conf file on Mac OS X Server 10.6, there&apos;s a good chance you&apos;ll see this message: Level II oplocks can only be set if oplocks are also set. You can read about...</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[		<p>
			If you do a testparm on your /etc/smb.conf file on Mac OS X Server 10.6, there's a good chance you'll see this message:
		</p>
		<blockquote><span class="Apple-style-span" style="font-style: italic;">Level II oplocks can only be set if oplocks are also set.</span></blockquote>
		<p>You can read about "level2" or "level 2" opportunistic locking&nbsp;<a href="http://samba.org/samba/docs/man/Samba-HOWTO-Collection/locking.html#id2616906">here</a> in the official <a href="http://samba.org/samba/docs/man/Samba-HOWTO-Collection/">Samba HOWTO document</a>&nbsp;(though it's written for v3.2 and Apple ships 3.0, I find it's almost entirely compatible and, in the least, quite informative). Here is what the document says,</p>
		<blockquote>
			<i>Level2 Oplocks provides opportunistic locking for a file that will be treated as&nbsp;</i><span class="emphasis"><i>read only. Typically this is used on files that are read-only or on files that the client has no initial intention to write to at time of opening the file.</i></span>
		</blockquote>
		<p>Level 2 oplocks appear to be something set to "true" or "on" by default. While Server Admin allows for enabling (plain old) oplocks and strict oplocks, there's no interface for setting level 2 oplocks off. But as the message indicates, it's effectively disabled without enabling locking in the first place.</p>
		<p>
			If you do enable oplocks via Server Admin, and find the need to <i>not</i> have level 2 oplocks enabled too (for some odd reason &#8212; perhaps you're neurotically conscientious of your testparm output) you will need to specify this option explicitly on the <i>share</i> realm, not the <i>global</i> realm.&nbsp;
		</p>
		<p>
			Hand-edit your /etc/smb.conf file, following the convention indicated by Apple (that is, make your changes at the bottom of the conf file, using [My Sharepoint] instead of [global], setting
		</p>
		<blockquote>
			level2 oplocks = no [or <i>false</i>, if you prefer]
		</blockquote>
		<p>For example,</p><div class="codeblock">
			; Site-specific parameters can be added below this comment.<br />
			; END required configuration.<br />
<br />
			[global]<br />
			&nbsp;&nbsp; &nbsp;realm = stanford.edu<br />
			&nbsp;&nbsp; &nbsp;acl check permissions = no<br />
			&nbsp;&nbsp; &nbsp;nt acl support = no&nbsp;<br />
			&nbsp;&nbsp; &nbsp;veto files = /Thumbs.db/.DS_Store/.TemporaryItems/TheVolumeSettingsFolder/TheFindByContentFolder/Temporary Items/Network Trash Folder/&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<br />	<br />
			[Projects]<br />
			&nbsp;&nbsp; &nbsp;path = /Shares/Projects &nbsp; &nbsp;&nbsp;<br />
			&nbsp;&nbsp; &nbsp;acl check permissions = no&nbsp;<br />
			&nbsp;&nbsp; &nbsp;nt acl support = no<br />
			&nbsp;&nbsp; &nbsp;level2 oplocks = no</div><p>Remember that Apple <a href="http://docs.info.apple.com/article.html?path=ServerAdmin/10.5/en/c2fs7.html">recommends</a> using oplocks only on shares accessed via SMB only.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Snow Leopard&apos;s Samba adds unwanted directives to shares</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/01/snow-leopard-samba-and-nt-acl.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.89</id>

    <published>2010-01-14T22:53:18Z</published>
    <updated>2011-08-10T19:19:19Z</updated>

    <summary>If you want to set &quot;nt acl support&quot; and &quot;acl check permissions&quot; to &quot;no&quot; in Snow Leopard&apos;s Samba configuration, you&apos;ll need to do it with an extra per-share directive at the end of your /etc/smb.conf file and not rely on inclusion in the [global] realm. That&apos;s because 10.6 processes shares created in Server Admin differently.</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
        <category term="server" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<blockquote><i><b>Update:</b> Be sure to add the path of the share in your 10.6 edits suggested below.</i></blockquote><p>There's an important behavioral difference between the version of Samba in Mac OS X Server 10.5 (Version 3.0.25b-apple) Snow Leopard's (Version 3.0.28a-apple) in the way it handles processing the /etc/smb.conf file and manages shares.</p>
<p>
	With 10.5 you could edit your /etc/smb.conf file include at least two directives in your custom [global] parameter set "<b>acl check permissions = no</b>" and "<b>nt acl support = no</b>" to address issues with locking and access. In some environments, these are very important to have, especially <a href="http://www.stanford.edu/group/macosxsig/blog/2009/04/shared_workbook_and_acls.html">some Office documents</a> and <a href="http://www.stanford.edu/group/macosxsig/blog/2010/01/acls_not_being_properly_honore.html">Windows XP clients</a>.</p>
<p>
	With 10.6 however it appears you can't entirely rely on including these in your custom [global] section any longer, as recommended by Apple. You may need to append a share-specific parameter set with these two directives instead. </p><p>For example, at the end of /etc/smb.conf file:</p>
<p></p>
<div class="codeblock">
	; Site-specific parameters can be added below this comment.<br />
	; END required configuration.
	<br />
	[global]<br />
	&nbsp;&nbsp;&nbsp;&nbsp;veto files = /Thumbs.db/.DS_Store/.TemporaryItems/TheVolumeSettingsFolder/TheFindByContentFolder/Temporary Items/Network Trash Folder/&nbsp;&nbsp; &nbsp;<br />
	<br />
	[Test Share]<br />
	&nbsp;&nbsp; &nbsp;path = /Shares/Test Share<br />
	&nbsp;&nbsp; &nbsp;acl check permissions = no<br />
	&nbsp;&nbsp;&nbsp;&nbsp;nt acl support = no<br />
	<br /></div>
<p>I have a few ideas about what the problem might be.</p>]]>
        <![CDATA[
		
		<p>Samba distributions include a command called <i>testparm; </i>here is the <a href="http://www.samba.org/samba/docs/man/manpages-3/testparm.1.html">man page</a> for it. It checks the integrity of an smb.conf file, much like <i>apachectl configtest</i>&nbsp;does with Apache.</p><p>Running the&nbsp;<i>testparm</i>&nbsp;command yields different output when executed on a 10.5 or 10.6 machine. In 10.5, you do not see your shares in the output; in 10.6, you do.&nbsp;The results give insight into how Apple changed the way network shares are configured and implemented in Samba.&nbsp;</p><p>In the /etc/smb.conf file in 10.5, there's a <b>usershare path = /var/samba/shares</b>&nbsp;directive that hooks to a directory that contains discrete files for each sharepoint created using Server Admin. With 10.6, there's an&nbsp;<span class="Apple-style-span" style="font-weight: bold; ">include = /var/db/samba/smb.shares </span>hook that instead points to a single file with all your shares, also as established by Server Admin. In 10.5, the <i>testparm</i> output doesn't show your shares; in 10.6, it does. What's going on?</p><p>The testparm command processes the /etc/smb.conf file the same way that smbd does, which is precisely the point. It processes not only the main conf file, but how smbd will see things after all the configuration hooks are taken into account. Interestingly, as 10.6 displays your shares, it shows&nbsp;<b>acl check permissions = Yes</b>&nbsp;&nbsp;and&nbsp;<b>nt acl support = Yes</b>. Strange.</p><p>Well, it's not strange that they're set to Yes (that's the default). It's strange because its explicitness suggests these&nbsp;control parameters are associated with the [share] realm. If that's the case, attempting to negate these parameters in the [global] realm (as suggested <a href="http://support.apple.com/kb/TS2713">here</a>) won't be (or shouldn't be) effective. Directive values are concentric; if you have a value set in the [global] realm, it will be overridden by any identical but conflicting directive in the tighter [share] realm.</p><p>If my understanding is correct, the fix used with 10.5 needs to be further refined for 10.6. We&nbsp;can still negate parameters above by appending the same control parameter, but with a different value, further down the /etc/smb.conf file. Apple wants us to do this at the end, underneath the comments section (which tacitly implies they won't munge your hand edits in future updates). We just need the same directive, but this time not in the [global] realm, but in the [share] realm,&nbsp;something like this example, which has additions in both realms:</p><i><i>
		<div class="codeblock"><span class="Apple-style-span" style="font-style: normal;">
			; Site-specific parameters can be added below this comment.<br />
			; END required configuration.
			<br />
			[global]<br />
			&nbsp;&nbsp;&nbsp;&nbsp;veto files = /Thumbs.db/.DS_Store/.TemporaryItems/TheVolumeSettingsFolder/TheFindByContentFolder/Temporary Items/Network Trash Folder/<br /><br />
			[Test Share]<br />
			&nbsp;&nbsp;&nbsp;&nbsp;acl check permissions = no<br />
			&nbsp;&nbsp;&nbsp;&nbsp;nt acl support = no<br /></span>
		</div>
 <p><span class="Apple-style-span" style="font-style: normal;"><br /></span></p><p><span class="Apple-style-span" style="font-style: normal;">So what's up? Well, my theory is that the </span>usershare path<span class="Apple-style-span" style="font-style: normal;">&nbsp;inclusion for defining shares (like in 10.5) meant that any user with access to the directory specified in the path could effectively create a share. If you could write to that directory, you could create a file to tell smbd to present a share on the network. That's the point of the usershare directive: to empower non-root users.&nbsp;</span></p><p><span class="Apple-style-span" style="font-style: normal;">But parameters like&nbsp;</span>acl check permissions <span class="Apple-style-span" style="font-style: normal;">and </span>nt acl support<span class="Apple-style-span" style="font-style: normal;">&nbsp;are very powerful and hugely affect filesystem access, so allowing non-root users to change all the variables on s</span><span class="Apple-style-span" style="font-style: normal;">hares specified in the&nbsp;</span>usershare path<span class="Apple-style-span" style="font-style: normal;">&nbsp;might be disallowed. In this case, the defaults for&nbsp;<span class="Apple-style-span" style="font-style: italic; ">acl check permissions&nbsp;<span class="Apple-style-span" style="font-style: normal; ">and&nbsp;</span>nt acl support<span class="Apple-style-span" style="font-style: normal;">&nbsp;are</span><span class="Apple-style-span" style="font-style: normal; ">&nbsp;Yes, and since I theorize you </span>can't<span class="Apple-style-span" style="font-style: normal;">&nbsp;change these when also using&nbsp;</span>usershare path<span class="Apple-style-span" style="font-style: normal;">, that</span><span class="Apple-style-span" style="font-style: normal; ">&nbsp;effectively makes them global, overridable only by editing the restrictive/protected main smb.conf file.</span></span></span></p><p><span class="Apple-style-span" style="font-style: normal;">In 10.6 though, Apple uses an </span>include<span class="Apple-style-span" style="font-style: normal;">&nbsp;parameter instead to hook shares created by Server Admin. But w<span class="Apple-style-span" style="font-style: italic; "><span class="Apple-style-span" style="font-style: normal;">at remains unclear is why </span>acl check permissions<span class="Apple-style-span" style="font-style: normal;">&nbsp;and </span>nt acl support<span class="Apple-style-span" style="font-style: normal;">&nbsp;are still sticking closely to each share. Why does it take such an explicit un-doing of the default parameter? Defaults, when not explicit to the [share] realm, should also be un-doable at the [global] realm. So, to force Mac admins to make unique entries at the end of our /etc/smb.conf files seems the way to go for now.&nbsp;</span></span></span></p><p><span class="Apple-style-span" style="font-style: normal;"><span class="Apple-style-span" style="font-style: italic; "><span class="Apple-style-span" style="font-style: normal;">At least, this is my hypothesis at this point.</span></span></span></p><p><span class="Apple-style-span" style="font-style: normal;"><br /></span></p><p></p></i></i>]]>
    </content>
</entry>

<entry>
    <title>ACLs not being properly honored in Samba with XP clients</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2010/01/acls-not-being-properly-honore.html" />
    <id>tag:www.stanford.edu,2010:/group/macosxsig/blog//1.87</id>

    <published>2010-01-07T18:18:01Z</published>
    <updated>2010-01-15T01:22:35Z</updated>

    <summary>Using &quot;nt acl support = no&quot; in your smb.conf file will allow Win XP clients to modify files at the root level of your Mac OS X Server sharepoint.</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[

<div><b><i><br /></i></b></div><div><i><b>NB: </b>Snow Leopard Server (10.6) handles directives on shares differently than with Leopard Server. Please also read <a href="http://www.stanford.edu/group/macosxsig/blog/2010/01/snow_leopard_samba_and_nt_acl.html">this article</a>&nbsp;if you are using Mac OS X Server 10.6 and Samba for new information on how to address the issues below.</i></div><br />Back in January 2008, I began to notice troublesome behavior with Windows clients connecting to my Mac OS X Server 10.5 fileserver. &nbsp;When some Windows clients, particularly Windows XP users, try to connect to a share, they can create a folder but can't change the name of the folder from "New Folder". Also, they can drop a file on the share, but not change that name, either. This always happened when activity was performed at the root level of the network share, while subfolders behaved as expected. If the network share had 777 (rwxrwxrwx) at the root level, all worked well, which indicated a permissions issue, not so much a communication issue. BUt it's the ACLs that caused grief. &nbsp;I <a href="http://lists.apple.com/archives/macos-x-server/2008/Jan/msg00661.html">posted this</a> to the Mac OS X Server <a href="http://lists.apple.com/mailman/listinfo/macos-x-server">list</a> hosted by Apple.
		<p></p>]]>
        <![CDATA[		<div>
			<b>Troubleshooting tips</b>
		</div>
		<div>
			One good tool is to use smbstatus to confirm the shares are valid and to see if people are working with files (indicated by being locked). You can also run the shares command to see your sharepoints. Double-check your ACLs by doing an <code>ls -l@</code> and observe the output. Increase the verbosity of Samba logging by editing your /etc/smb.conf file, increasing the integer slightly, between one and ten (though five and above becomes very, very noisy).
		</div>
		<div>
			<b><br /></b>
		</div>
		<div>
			<b>Probable Solution</b>
		</div>
		<div>
			If you read the <a href="http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html">man page</a> for smb.conf and search for <code>nt acl support</code>; you'll see information about how Samba matches Windows NT permissions to POSIX-style permissions. This was the method used by Windows XP, while later versions of Windows used the more Windows-like ACLs which is analogous to Mac OS X ACLs. The net effect was that XP read the permissions in an undesirable way, paying attention to Samba's method instead of Mac OS X Server's method. We want the server OS to control access, not Samba.
		</div>
		<div>
			<br />
		</div>
		<div>
			Edit your /etc/smb.conf file to add <code><b>nt acl support = no</b></code> where appropriate &#8212; at the end of the file below the notes, in its own <code>[Global]</code>section. Do not edit the hooked /var/db/smb.conf file because that's associated with Server Admin (which writes to an XML file while another process converts that into a Samba conf file &#8212; change it here and it will likely get wiped).
		</div>
<br />
<big><strong>See also</strong></big><br />
• Samba in 10.6 <a href="http://www.stanford.edu/group/macosxsig/blog/2010/01/snow_leopard_samba_and_nt_acl.html">adds two directives to any share</a> that must be manually overridden.
• (Somewhat deprecated) <a href="http://www.stanford.edu/group/macosxsig/blog/2008/02/samba_openldap_kerberos_afp_le_1.html">Samba + OpenLDAP + Kerberos + AFP + Leopard = ♥</a><br />
 Guide<br />
• Samba and <a href="http://www.stanford.edu/group/macosxsig/blog/2009/12/extended_attributes_office_200.html">extended attributes</a><br />
• Samba and <a href="http://www.stanford.edu/group/macosxsig/blog/2009/10/removing_extended_attributes_f.html">ADS</a><br />
• <a href="http://www.stanford.edu/group/macosxsig/blog/2009/10/hiding_directories_with_spaces.html">Hiding directories</a> in Samba that have spaces in the name<br />
• Scary Excel "<a href="http://www.stanford.edu/group/macosxsig/blog/2009/04/shared_workbook_and_acls.html">Share Workbook</a>" feature behavior with Samba (See also <a href="http://support.apple.com/kb/TS2713">Apple KB article</a>.)<br />
• <a href="http://www.stanford.edu/group/macosxsig/blog/2008/04/ive_been_doing_some_mucking.html">Invalid characters</a> in extended attributes on Samba directories<br />

	]]>
    </content>
</entry>

<entry>
    <title>Extended attributes, Office 2007 clients via SMB from Xsan</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/12/extended-attributes-office-200.html" />
    <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.85</id>

    <published>2009-12-17T07:51:51Z</published>
    <updated>2011-08-10T19:18:33Z</updated>

    <summary>We recently deployed Mac OS X 10.6.2 Server, sharing files on an Xsan volume via Samba to Windows users with Office 2007. When these PC users try to download or open the file, however, they got this warning, &quot;Error Copying...</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
        <category term="server" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>We recently deployed Mac OS X 10.6.2 Server, sharing files on an Xsan volume via Samba to Windows users with Office 2007. When these PC users try to download or open the file, however, they got this warning, <span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial,sans-serif; border-collapse: collapse;">"<i>Error Copying File or Folder. Cannot copy FILENAME: Cannot find the specified file. Make sure you specify the correct path and file name.</i>"</span></p><p>Some forums suggested adding two parameters at the very end of your /etc/smb.conf file:</p><blockquote><div class="codeblock">[global]<br />&nbsp;&nbsp; &nbsp;ea support = yes<br />&nbsp;&nbsp; &nbsp;stream support = no</div></blockquote><p><b>I've edited this entry to reflect some changes in late 10.6 Samba releases. Further, with the right smb.conf configuration, the changes below to various EAs&nbsp; don't need to be made.</b><br /></p><p><br /></p><p>We I noticed that I could download the .doc files to my Mac via AFP, make a neglible modification and save the file, then upload it back to the SAN, my Windows colleagues could then view the file. When I did an ls -l@ on the file, I could see that this process added the com.apple.ResourceFork extended attribute. At this point, the modified Office files could be opened by my PC friends.</p><p>So, ironically, rather than deleting the EAs, I needed to apply this EA to the right files. It's probably OK to write this EA on each file and directory, but that's a little heavy handed. So instead, I executed this command:</p><div class="codeblock">find /Shares/Docs -name "*.doc" -print0 | xargs -0 sudo xattr -w com.apple.ResourceFork&nbsp;&nbsp;</div><p>This will find the files with the .doc extension in my /Shares/Docs, add the extended attribute, and make everyone happy.</p><p>If you want to make it more thorough, you could try:</p><div class="codeblock">find . \( -name "*.doc" -or -name "*.docx" -or -name "*.xls" -or -name "*.xlsx" -or -name "*.ppt" -or -name "*.pptx" \) -print0 | xargs -0 xattr -w com.apple.ResourceFork&nbsp;&nbsp;&nbsp;</div><p>One possible issue, though, is that if you apply this command too high up the hierarchy, it seems to make a problem. You might get this error:&nbsp;unable to execute /usr/bin/xattr: Argument list too long</p><p>You may wish to recursively apply this further down the directory tree.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Build WebAuth with Mac OS X Server 10.6 (Snow Leopard)</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/11/build-webauth-on-snow-leopard-server.html" />
    <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.83</id>

    <published>2009-11-13T05:44:32Z</published>
    <updated>2011-08-10T19:19:48Z</updated>

    <summary>Stanford&apos;s WebAuth can now be installed cleanly on Mac OS X Server 10.6, permitting the use of Server Admin to manage websites.</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
        <category term="advanced" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="server" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<div><br /></div><a href="http://webauth.stanford.edu/">WebAuth</a>&nbsp;(cf developer&nbsp;<a href="http://www.eyrie.org/~eagle/software/webauth/" style="text-decoration: underline; ">link</a>)&nbsp;can be built cleanly on Mac OS X Server 10.6 with no additional flags or configuration edits. Just ./configure, make and sudo make install. Because of the changes in Snow Leopard server, you can now use WebAuth while continuing to use Apple's Server Admin.app tool to manage your web server.<div><br /></div><div>This is different than with Mac OS X 10.5, which has an httpd built with 64- and 32-bit PowerPC and x86 architectures. WebAuth, like many other Apache modules, did not build properly, since each module needed to be of four architectures, too. (Instructions for Leopard Server are <a href="http://www.stanford.edu/group/macosxsig/blog/2008/04/building_webauth_on_leopard_se.html">here</a>. For instructions on installing WebAuth on other Unix-like operating systems, see <a href="http://webauth.stanford.edu/install.html">here</a>.)<div><br /></div><div>Here's a list of things that are, I think, unique to the process of installing and using WebAuth on Mac OS X Server 10.6, after the jump.</div><div><div><ul><div><p></p></div></ul></div></div></div>]]>
        <![CDATA[<div><div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 20px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; list-style-type: disc; list-style-position: outside; list-style-image: initial; background-repeat: repeat-y; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">To compile WebAuth&nbsp;you'll need both&nbsp;<a href="http://www.eyrie.org/~eagle/software/remctl/" style="text-decoration: underline; ">remctl</a>&nbsp;and&nbsp;<a href="http://www.eyrie.org/~eagle/software/wallet/" style="text-decoration: underline; ">wallet</a>&nbsp;(necessary if you're a Stanford affiliate, so you can create stanford.edu&nbsp;<a href="http://www.stanford.edu/services/kerberos/sysadmin/wallet.html" style="text-decoration: underline; ">keytabs</a>).</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">To compile anything, you need Apple's free Xcode&nbsp;<a href="http://developer.apple.com/technology/" style="text-decoration: underline; ">developer tools</a>.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Modules live in /usr/libexec/apache2. The WebAuth build process properly uses&nbsp;<a href="http://httpd.apache.org/docs/2.2/programs/apxs.html" style="text-decoration: underline; ">apsx</a>&nbsp;to sort things in the proper location.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">The main httpd.conf live in /etc/apache2 while virtual hosts are called sites and live in /etc/apache2/sites. There is no extras directory, so all the other conf files live in /etc/apache2 too (plus there's no man or bin directories here either &#8212; those files are in their OS locations).</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Unlike tweaks on /etc/smbd.conf, you can make your httpd.conf edits anywhere. If your parameters conflict with what's entered via Server Admin, the entry closest to the end of the conf file wins.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Your WebAuth folder, then, also lives in /etc/apache2.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">The user/group that httpd runs as is _www (aka www); this is already in the default httpd.conf, along with entries specific to the HFS filesystem and other unique Mac OS X attributes like forked files.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Once you install the WebAuth modules, you can use Server Admin.app to enable/disable them. This still all writes to httpd.conf. The don't appear automatically. Either add them graphically using Server Admin or write them out manually in the httpd.conf file.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Apache is started using a&nbsp;<a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man8/launchd.8.html" style="text-decoration: underline; ">launchd</a>&nbsp;item at /System/Library/LaunchDaemons/org.apache.httpd.plist.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">The default webroot is /Library/WebServer/Documents &#8212; think of this as the htdocs directory.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">SSL certificates live in /etc/certificates; Server Admin creates httpd.conf files with proper paths to this directory, but you need to make hand edits if you have intermediate certificates.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Certificates are commonly managed using Server Admin.app too.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">Although you'll see /private/etc/apache2/servermgr_web_apache2_config.plist, don't mess with this. That's what Server Admin.app writes to; if you edit this, you'll break the internet. The thing that takes Server Admin's XML values and schmooshes it into httpd.conf is /usr/share/servermgrd/bundles/servermgr_web.bundle/Contents/MacOS/servermgr_web.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><b>Don't hook stanford-webauth.conf using an include in httpd.conf.</b>&nbsp;Instead, for some odd reason, you need to write out all those values in httpd.conf itself (wherever, but mine are at the end of the conf file).</li><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "></p><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 20px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; background-repeat: repeat-y; ">WebAuthLdapKeytab webauth/keytab<br />WebAuthLdapTktCache webauth/krb5cc_ldap<br />WebAuthLdapHost ldap.stanford.edu<br />WebAuthLdapBase cn=people,dc=stanford,dc=edu<br />WebAuthLdapAuthorizationAttribute suPrivilegeGroup<br />WebAuthKeyring "/etc/apache2/webauth/keyring"<br />WebAuthKeytab "/etc/apache2/webauth/keytab"<br />WebAuthServiceTokenCache webauth/service_token_cache<br />WebAuthLoginURL https://weblogin.stanford.edu/login/<br />WebAuthWebKdcURL https://weblogin.stanford.edu/webkdc-service/<br />WebAuthWebKdcPrincipal service/webkdc@stanford.edu<br />WebAuthSSLRedirect on<br />WebAuthDebug off</blockquote><div><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 20px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; list-style-type: disc; list-style-position: outside; list-style-image: initial; background-repeat: repeat-y; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><b>Don't put WebAuth access restrictions parameters in your main httpd.conf.</b>&nbsp;&nbsp;Server Admin.app will complain (accurately) it can't create charts and graphs to display in that applications monitoring window. This is because it's effectively prohibited by WebAuth itself. You'll see a message like this in your system.log.&nbsp;</li></ul><div class="codeblock">Nov 12 00:23:26 crc-resources servermgrd[86]: servermgr_web: In request for status, web service returned unexpected response code: 500; Server Admin Web graphs may be inaccurate.</div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><br /></p></div><div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "></p><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 20px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; list-style-type: disc; list-style-position: outside; list-style-image: initial; background-repeat: repeat-y; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><b><span class="Apple-style-span" style="font-weight: normal; ">You need to move your WebAuth parameters to the specific vhost file in /etc/apache2/sites instead. This needs to be a hand-edit, since Server Admin doesn't permit raw editing of the configuration files.</span></b></li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><b>Using mod_webauthldap.so, you need to create a symlink</b>&nbsp;where /usr/webauth is created to point to /etc/apache2/webauth. There is probably a flag that could be used to compile this module differently, but the symlink works just as well.</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; ">You can set ACLs on the web-hosted directories and on /etc/apache2/webauth using Server Admin if you create a symlink targeted to some directory otherwise visible to the Finder.</li></ul><div><br /></div><div>That's it.&nbsp;<a href="http://www.stanford.edu/services/contract-support/" style="text-decoration: underline; ">We</a>&nbsp;use WebAuth on a Snow Leopard server quite well, with different parts of the file system served to different groups. Some web roots are also AFP and CIFS shares, which permit read/write to authenticated users. Another nice feature available with the built-in Apache 2.2 service is that administration can be controlled by service access controls, allowing granular privileges to users and groups designated either web server admins or monitors. &nbsp;It's a more elegant solution to use Apple tools on Mac web servers without having to resort to building and managing your own Apache installation and fighting with Webmin for GUI management.</div><div><br /></div></div></ul><b>UPDATE:</b> Be wary that Server Admin may write over /etc/apache2/sites/yourwebsite and remove the AuthType WebAuth directive. You'll see the notices in the Apache error log.</div></div>]]>
    </content>
</entry>

<entry>
    <title>Hiding directories containing spaces in Samba</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/10/hiding-directories-with-spaces.html" />
    <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.77</id>

    <published>2009-10-20T23:27:38Z</published>
    <updated>2009-10-21T00:09:58Z</updated>

    <summary>When configuring Samba 3 to hide Mac-specific directories from Windows users, I typically edit /etc/smb.conf on my Mac OS X Server, using either veto files = hide files = This worked fine &#8212; until it didn&apos;t. Seems I wasn&apos;t doing...</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>When configuring Samba 3 to hide Mac-specific directories from Windows users, I typically edit /etc/smb.conf on my Mac OS X Server, using either</p>

<p><tt>veto files =</tt><br />
<tt>hide files =</tt></p>

<p>This worked fine &#8212; until it didn't. Seems I wasn't doing it properly.</p>

<p>There's a lot of (typically legacy) HFS detritus sprinkled around on a Mac server. When both AFP and SMB are enable, Windows users see these bits and pieces, much to their confusion. (These files and directories are invisible to Macs.)</p>

<p>Originally, I had this at the end of my smb.conf file, but once I added the final <tt>veto files =</tt> option below at the bottom, I was disappointed things didn't work as expected.<br />
<div class="codeblock">[global]<br />&nbsp;&nbsp;veto files = /Thumbs.db/<br />&nbsp;&nbsp;veto files = /.DS_Store/<br />&nbsp;&nbsp;veto files = /.TemporaryItems/<br />&nbsp;&nbsp;veto files = /Network Trash Folder/</div><br />
It seems I was incorrectly adding the files and directories in my smb.conf file.  That last line refers to a directory that has a space in the middle.  When I did a </p>

<div class="codeblock">sudo serveradmin stop smb; serveradmin start smb</div><br />
they still were there, staring out at me. (By the way, I'm not confident in the smbcontrol reload-config command, since smbd is controlled by launchd on a Mac. I just do a quick severadmin command.)
<em><blockquote>NB: The slashes have nothing to do with the filename or with a path. See <a href="http://oreilly.com/catalog/samba/chapter/book/ch05_02.html">this entry</a> in the SMB book from O'reilly. They're there just so smbd properly parses out when an entry starts and ends. But it's the space that tripped things up.</blockquote></em>
So it seems what I needed to do was to group all the files and directories into one line, like what's below.

<div class="codeblock">&nbsp;&nbsp;veto files = /Thumbs.db/.DS_Store/.TemporaryItems/TheVolumeSettingsFolder/TheFindByContentFolder/Temporary Items/Network Trash Folder/&nbsp;&nbsp;</div>

<p>That was the trick. I'm not sure why, because seemingly the individual entries should work just as well as the string of filenames. Now those Mac filenames are now hidden from my Windows users.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Removing ADS for Samba Users</title>
    <link rel="alternate" type="text/html" href="http://www.stanford.edu/group/macosxsig/blog/2009/10/removing-extended-attributes-f.html" />
    <id>tag:www.stanford.edu,2009:/group/macosxsig/blog//1.75</id>

    <published>2009-10-16T18:02:14Z</published>
    <updated>2011-08-10T19:14:25Z</updated>

    <summary>Alternate data streams are an NTFS-specific extended attributes; they can cause problems for Windows clients connecting to Mac servers via Samba. This article discusses three ways to mitigate these problems.</summary>
    <author>
        <name>Noah Abrahamson</name>
        
    </author>
    
    <category term="xattrads" label="xattr ads" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.stanford.edu/group/macosxsig/blog/">
        <![CDATA[<p>Occasionally, I get a call that my Windows users connected to my Samba server on Mac OS X Server 10.5 can't manipulate a file. They get various errors when trying to open or download the file.  The problem seems to be random but consistent; some files show problems, others are fine &#8212; even in the same directory.</p>

<p>Consider whether the problem is related to <a href="http://www.securityfocus.com/infocus/1822">Windows NTFS alternate data streams</a> (ADS). (See also the <a href="http://en.wikipedia.org/wiki/Fork_(filesystem)">Wikipedia article</a>.) You can see whether this is the case using the Terminal.<br />
<div class=codeblock>[root@hsd-data-server 10:48:10 /Files/Annoyances]# ls -l@<br />total 184<br />-rw-r--r--@ 1 bobjones  finances  26112 Sep 21 09:13 FY_10_budget.xls&nbsp;&nbsp;<br /> :ZONE.IDENTIFIER:$DATA	   26 <br />-rw-r--r--@ 1 janedoe  finances  62464 Sep 21 09:13 FY_11_budget.xls&nbsp;&nbsp;<br /> :ZONE.IDENTIFIER:$DATA	   26 <br /></div></p>

<p>The extended attribute is the :ZONE.IDENTIFIER:$DATA part and needs to be whacked off. It's expendable.  One command uses the <tt>xattr</tt> command. (Note that you'll need to escape the dollar sign.)<br />
<div class=codeblock>xattr -d :ZONE.IDENTIFIER:\$DATA senate.xls</div></p>

<p>There are (at least) two additional ways to handle these.</p>]]>
        <![CDATA[<p>One way is script out a recursive command to run against a directory tree. <a href="http://www.zzamboni.org/brt/2008/05/07/removing-all-extended-attributes-from-a-directory-tree/index.html">This blog</a> gives an example of a shell script to execute.</p>

<p>Perhaps the best way is to modify your /etc/smb.conf file to ignore these altogether. Here's an example of the smb.conf file I use on my servers. The critical part here is the last line. Pay special attention to the commented instructions from Apple at the end of the document about where to put your additions (otherwise they risk being wiped out.).<br />
<div class=codeblock>; Site-specific parameters can be added below this comment.<br />; END required configuration.<br />[global]<br />&nbsp;&nbsp;&nbsp;&nbsp;use kerberos keytab = yes<br />&nbsp;&nbsp;&nbsp;&nbsp;realm = stanford.edu<br />&nbsp;&nbsp;&nbsp;&nbsp;acl check permissions = no<br />&nbsp;&nbsp;&nbsp;&nbsp;veto files = /Thumbs.db/<br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;veto files = /.DS_Store/<br />&nbsp;&nbsp;&nbsp;&nbsp;veto files = /.TemporaryItems/<br />&nbsp;&nbsp;&nbsp;&nbsp;client use spnego = yes<br />&nbsp;&nbsp;&nbsp;&nbsp;client NTLMv2 auth = no<br />&nbsp;&nbsp;&nbsp;&nbsp;client lanman auth = no<br />&nbsp;&nbsp;&nbsp;&nbsp;client plaintext auth = no<br />&nbsp;&nbsp;&nbsp;&nbsp;lanman auth = no<br />&nbsp;&nbsp;&nbsp;&nbsp;log level = 1<br />&nbsp;&nbsp;&nbsp;&nbsp;<strong>nt acl support = no</strong><br /></div></p>

<p>This will obviate the need to selectively use the <tt>xattr</tt> command; I've found no negative consequences of this addition.</p>]]>
    </content>
</entry>

</feed>
