Samba 2.1 pre-release okay - RedHat 5.2/glibc is my problem

Bill Nugent whn at
Tue Feb 2 13:20:56 GMT 1999


I've tried that already.  :-(  The source code for smbpasswd strips off 
any '$' on the end and then appends one when run '-m' just to be sure (at 
about line 378 of utils/smbpasswd.c).

The problem is with glibc 2.0.7 runtime library - it skips over usernames 
that have a '$' in them (I have not exhaustively tried all permutations 
but on the end and in the middle are ignored).

Look at the little C program I enclosed in the original posting with the 
two test runs at the end and you will see that username 'bonker$' is 
skipped over.  There is a copy of that posting at the bottom of this 

After I sent the email I wrote a variation using getpwent() and it 
skipped it as well.

My next question to the list is how hard would it be for me to kludge 
around this either by using a different character?  I feel writing a 
custom function my_getpwnam() function is a loosing battle because PAM, 
etc. all use run-time library.

Thank you!


On Monday, Feb 1 1999 at 20:09:35, Andrew Perrin - Demography wrote:

>unless I'm misunderstanding your message, I think your problem is simple:
>the -m flag on smbpasswd adds the $ for you; if your machine is named
>BONKERS and its associated /etc/passwd entry is for BONKERS$, you should
>just do smbpasswd -a -m bonkers .
>Hope this helps-
>Andrew J. Perrin - aperrin at - NT/Unix Admin/Support
>Department of Demography    -    University of California at Berkeley
>2232 Piedmont Avenue #2120  -    Berkeley, California, 94720-2120 USA
> --------------------------SEIU1199
>On Tue, 2 Feb 1999, Bill Nugent wrote:
>> Howdy,
>> I reported earlier that I could not get smbpasswd to work properly - 
>> "smbpasswd -m 'bonkers$'" is one example.  I think I may have found a 
>> problem - getpwnam() doesn't work when '$' is the last character of 
>> name.  I'm running RedHat Linux 5.2 with glibc-2.0.7-29 and my 
>> /etc/passwd (and /etc/shadow) have an entry for bonkers$:
>> bonkers$:4999:5000:bonkers to use NT:/home/samba/Machines:/bin/false
>> My test program:
>> $ cat test.c
>> #include <stdio.h>
>> #include <pwd.h>
>> #include <sys/types.h>
>> main(int argc, char *argv[])
>> {
>>   struct passwd *p = getpwnam(argv[1]);
>>   printf("%s = %x\n", argv[1], p);
>> }
>> And some results:
>> $ ./test joe		# Dummy user joe - an entry is returned
>> joe = 400ae2d8
>> $ ./test 'bonkers$'	# And this is broken
>> bonkers$ = 0
>> I tried escaping the dollar sign in case there was an RE 
>> such luck.
>> I submitted a bug report to RedHat.  I took a look at the glibc source 
>> and it is appears to be non-trivial (multiple levels of macros) and I 
>> not have the cycles to spare looking into this problem as well...sigh.
>> 	Bill

More information about the samba-ntdom mailing list