Subject: Re: NetBSD, Samba & PDC
To: None <emre@vsrc.uab.edu>
From: Paul Chakravarti <paulc@passtheaardvark.com>
List: netbsd-users
Date: 10/15/2002 13:17:27
The problem is that that the 'valid_login' function in 
user.sbin/user/user.c does not allow the $ character in login names - 
here is a patch for the -current user.c which fixes this (I originally 
did this for OpenBSD so haven't tested under NetBSD). If you don't feel 
like recompiling you can just create the account without the $ and then 
edit using vipw.

PaulC

--- user.c.orig Tue Oct 15 13:03:54 2002
+++ user.c      Tue Oct 15 13:05:42 2002
@@ -637,7 +637,9 @@
         char    *cp;

         for (cp = login_name ; *cp ; cp++) {
-               if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != 
'-') {
+               /* Allow $ as last character only */
+               if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != 
'-'
+                       && !(*cp == '$' && *(cp+1) == 0) ) {
                         return 0;
                 }
         }




On Tuesday, October 15, 2002, at 12:12  PM, <emre@vsrc.uab.edu> wrote:
> Hi folks,
>
> I'm trying to setup a primary domain controller using samba and netbsd.
> Unfortunately, netbsd will not let me add 'machine' account names.  I'm
> trying to do:
>
> useradd -g machines -c WINDESKTOP -d /dev/null -s /bin/false 
> 'windesktop$'
>
> It complains about windesktop$ not being a valid login name.  
> According to
> this tutorial I'm using, I have to have a $ after the login name.  
> This is
> just for setting up "trust accounts".  Has anyone else set up a PDC 
> using
> netbsd and samba?  if so, I'd be very happy to see some suggestions or
> possibly some tricks, especially on how to automate the whole user
> administration process :)
>