Bug 3534 - users.map does not take the default = * at the end when the user is not mapped
users.map does not take the default = * at the end when the user is not mapped
Product: Samba 3.0
Classification: Unclassified
Component: User/Group Accounts
Other AIX
: P3 major
: none
Assigned To: Gerald (Jerry) Carter
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2006-02-21 10:16 UTC by Francisco
Modified: 2006-03-01 09:33 UTC (History)
0 users

See Also:

Level 10 log for smbd (4.34 KB, text/plain)
2006-02-22 08:58 UTC, Francisco
no flags Details
Level 10 machine's log of user with error (1.49 KB, text/plain)
2006-02-23 11:54 UTC, Francisco
no flags Details
Log with max log size = 5000 (19.19 KB, text/plain)
2006-02-27 04:47 UTC, Francisco
no flags Details
ignore misformed map lines rather than failing (517 bytes, patch)
2006-03-01 09:32 UTC, Gerald (Jerry) Carter
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francisco 2006-02-21 10:16:13 UTC
We have installed version 3.0.21b and copied smb.conf and users.map from the old 2.2.5. We use Samba just to share AIX files and directories with windows boxes, so we only need to map Windows users to de AIX users through users.map. These are our smb.conf and users.map files:

        workgroup = EAENT4DOM
        netbios name = NEPTUNO
        server string = Servidor de Datos
        interfaces = en4
        security = SERVER
        password server = uno dos
        username map = /usr/local/samba/lib/users.map
        log file = /var/samba/log/log.%m
        max log size = 50
        deadtime = 15
        load printers = No
        show add printer wizard = No
        wins server = tres
        create mask = 0664
        domain master = no
        local master = no
        preferred master = no

        comment = Documentacion Scaneada
        path = /home/explota
        read list = faxcat
        write list = explota cierres scan
        read only = No
        directory mask = 0775
        default case = upper

and the users.map looks like this:

!explota = user1 user2
!cierres = user3 user4
!scan = user5 user6
faxcat = *

This configuration was working fine with 2.2.5, but with 3.0.21b the configuration has the next issues:

If user7 is added to either explota, cierres or scan it works as expected, but if no user is defined and faxcat is supposed to be the default, access to \\neptuno\scan_general shows a window in the windows client machine asking for a user and a password.
If faxcat is put the first user in users.map then every user enters as faxcat even if faxcat doesn't have the ! before it.

The error that appears on the log when faxcat is the last user is the nextone:

[2006/02/21 12:58:46, 0] lib/username.c:map_username(179)
  Unable to build user list

Francisco Rodr
Comment 1 Gerald (Jerry) Carter 2006-02-22 08:09:49 UTC
please attach a gzipped level 10 debug log from smbd.  Thanks.
Comment 2 Francisco 2006-02-22 08:58:06 UTC
Created attachment 1751 [details]
Level 10 log for smbd
Comment 3 Gerald (Jerry) Carter 2006-02-22 12:30:35 UTC
Sorry.  This log file does not contain a user actually connecting
to the server with the failed username  map behavior that you
reported. Please make sure to capture the failure in the log file.
Comment 4 Francisco 2006-02-23 11:54:52 UTC
Created attachment 1755 [details]
Level 10 machine's log of user with error
Comment 5 Volker Lendecke 2006-02-24 09:57:05 UTC
Is it possible that you have the 'max log size' setting to something very small? The logfile you sent seems truncated.

Comment 6 Francisco 2006-02-27 04:47:53 UTC
Created attachment 1761 [details]
Log with max  log size = 5000

Sorry for the the log size, I wasn't aware of that. :(

Another thing, I have checked the log before posting it, and found something, in case it helps. 
The problem is a line in the users.map when a user doesn't have assigned a value, here are the last 4 lines in users.map: 

!dr_admon = luis carabiam
!dr.asist =
!dr.rrhh = angeles
!dr.var =
faxcat = *

As you will see in the log, the last check done is with user carabiam. The user angeles is not checked, so I commented the two lines without a user and it worked. The user was recognized as faxcat.

I know I shouldn't have those lines, but someone put them in a test and didn't remove them, the case is that version 2.2.5 didn't stop on that line, and the new one does.


Francisco Rodríguez
Comment 7 Gerald (Jerry) Carter 2006-03-01 09:32:51 UTC
Created attachment 1763 [details]
ignore misformed map lines rather than failing

This should fix the problem and has been checked in for 3.0.22
Comment 8 Gerald (Jerry) Carter 2006-03-01 09:33:09 UTC
patch checked in.