<br><div><span class="gmail_quote">On 1/1/08, <b class="gmail_sendername">Ryan Schmidt</b> &lt;<a href="mailto:ryandesign@macports.org">ryandesign@macports.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On Jan 1, 2008, at 22:32, Jordan K. Hubbard wrote:<br><br>&gt; On Jan 1, 2008, at 8:01 PM, Tabitha McNerney wrote:<br>&gt;<br>&gt;&gt; Jordan, appreciate the further clarity. Quick question then (just<br>&gt;&gt; to make sure I&#39;m ultra clear) -- even if a MacPort installs a new
<br>&gt;&gt; entry in the local directory domain with a &quot;Crypt Password&quot; type,<br>&gt;&gt; what you&#39;re saying is that in reality, under Leopard Server (and<br>&gt;&gt; the past few versions of Mac OS X Server) this password is a
<br>&gt;&gt; Shadow Password disguised to the system as a Crypt Password? I ask<br>&gt;&gt; because using Workgroup Manager on Leopard Server, I can select<br>&gt;&gt; the user that was installed by the MacPort (for example, take the
<br>&gt;&gt; openldap MacPort which installs a local directory domain entry<br>&gt;&gt; with the username &quot;ldap&quot;, UID &quot;500&quot; and a User Password Type of<br>&gt;&gt; &quot;Crypt Password&quot; and I can select the pop-up menu with the &quot;Crypt
<br>&gt;&gt; Password&quot; selection and change the type to either &quot;Shadow<br>&gt;&gt; Password&quot; or &quot;OpenDirectory&quot; because I am also running an<br>&gt;&gt; OpenDirectory Master on the same machine).<br>
&gt;<br>&gt; I&#39;m not sure how MacPorts installs user records on Leopard (I&#39;ve<br>&gt; never looked).&nbsp;&nbsp;Presumably, it just drops a plist file into /var/db/<br>&gt; dslocal/nodes/Default/users since that&#39;s all you need to do in
<br>&gt; Leopard.&nbsp;&nbsp;The contents of that plist file, however, can specify a<br>&gt; number of different password types - &quot;it all depends&quot; is about the<br>&gt; best answer I can give you there.&nbsp;&nbsp;You should look at the
<br>&gt; authentication_authority array in the user plists you&#39;re wondering<br>&gt; about and verify that they&#39;re doing whatever it is you want them to<br>&gt; do (this is an array value, so there are multiple options here).
<br>&gt; I&#39;d be surprised if MacPorts was using some obsolete password<br>&gt; types, but you never know I guess.<br><br>It looks like MacPorts uses dscl to create users and groups, on all<br>versions of Mac OS X. See src/port1.0/portutil.tcl.
<br><br>proc adduser {name args} {<br>&nbsp;&nbsp;&nbsp;&nbsp; global os.platform<br>&nbsp;&nbsp;&nbsp;&nbsp; set passwd {*}<br>&nbsp;&nbsp;&nbsp;&nbsp; set uid [nextuid]<br>&nbsp;&nbsp;&nbsp;&nbsp; set gid [existsgroup nogroup]<br>&nbsp;&nbsp;&nbsp;&nbsp; set realname ${name}<br>&nbsp;&nbsp;&nbsp;&nbsp; set home /dev/null<br>&nbsp;&nbsp;&nbsp;&nbsp; set shell /dev/null
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; foreach arg $args {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if {[regexp {([a-z]*)=(.*)} $arg match key val]} {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; regsub -all &quot; &quot; ${val} &quot;\\ &quot; val<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set $key $val<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp; if {[existsuser ${name}] != 0 || [existsuser ${uid}] != 0} {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp; if {${os.platform} eq &quot;darwin&quot;} {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec dscl . -create /Users/${name} Password ${passwd}</blockquote>
<div><br>I just checked the man page for dscl on Leopard Server (sorry I don&#39;t have a copy of Leopard (non-Server) but its probably the same). It strikes me that dscl is just fine (it would be a major hassle to change MacPorts ports) and it should be left up to the system administrator who takes responsibility for installing and maintaining MacPorts on a Mac OS X / Mac OS X Server system to decide what to do with passwords after the installation by MacPorts:
<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">&nbsp;&nbsp; <span style="font-weight: bold;">passwd</span><br>&nbsp;&nbsp;&nbsp;&nbsp; Usage: passwd user_path [new_pasword | old_password new_pasword]
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; Changes a password for a user. The user must be specified by full path, not just a username.&nbsp; If you are authenticated to the node (either by specifying the -u<br>&nbsp;&nbsp;&nbsp;&nbsp; and -P flags or by using the auth command when in interactive node) then you can simply specify a new password.&nbsp; If you are not authenticated then the user&#39;s old
<br>&nbsp;&nbsp;&nbsp;&nbsp; password must be specified.&nbsp; If passwords are not specified while in interactive mode, you will be prompted for them.<br></blockquote><br>Thanks for touching on this subject,<br><br>T.M.<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec dscl . -create /Users/${name} UniqueID ${uid}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec dscl . -create /Users/${name} PrimaryGroupID ${gid}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec dscl . -create /Users/${name} RealName ${realname}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec dscl . -create /Users/${name} NFSHomeDirectory ${home}
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec dscl . -create /Users/${name} UserShell ${shell}<br>&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # XXX adduser is only available for darwin, add more support<br>here<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ui_warn &quot;WARNING: adduser is not implemented on $
<br>{os.platform}.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ui_warn &quot;The requested user was not created.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>}<br><br><br></blockquote></div><br>