Comment 10 for bug 57666

Revision history for this message
Guillaume Martres (smarter) wrote :

I've made a patch which should allow anonymous user to access to the printer but I can't get guest to list the computers, it looks like there's a bug in smbclient:
[smarter@fenny ~/Builds/kdelibs]% cat password
username =
password =
domain =
[smarter@fenny ~/Builds/kdelibs]% smbclient -N -L 'WINXP' -W WORKSGROUP -Apassword
Domain=[WORKSGROUP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename Type Comment
        --------- ---- -------
cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine PAPA. Error was NT_STATUS_ACCESS_DENIED
Error returning browse list: NT_STATUS_ACCESS_DENIED
Domain=[WORKSGROUP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server Comment
        --------- -------
        WINXP ordinateur de bureau

        Workgroup Master
        --------- -------
        WORKSGROUP WINXP
[smarter@fenny ~/Builds/kdelibs]% nano password
[smarter@fenny ~/Builds/kdelibs]% cat password
username = guest
password =
domain =
[smarter@fenny ~/Builds/kdelibs]% smbclient -N -L 'WINXP' -W WORKSGROUP -Apassword
Domain=[WINXP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename Type Comment
        --------- ---- -------
        IPC$ IPC IPC distant
        print$ Disk Pilotes d'imprimantes
        SharedDocs Disk
        Imprimante Printer hp deskjet 940c
Domain=[WINXP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server Comment
        --------- -------

        Workgroup Master
        --------- -------

The Lines "Server" and "Workgroup" are empty when a username(guest) is provided, but have the correct informations if the connection fails with "NT_STATUS_ACCESS_DENIED"! That's why the "anonymous" login can list the computers and the "guest" can't. And there's something even more strange:
[smarter@fenny ~/Builds/kdelibs]% smbclient -N -L 'WINXP' -W WORKSGROUP
Domain=[PAPA] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename Type Comment
        --------- ---- -------
        IPC$ IPC IPC distant
        print$ Disk Pilotes d'imprimantes
        SharedDocs Disk
        Imprimante Printer hp deskjet 940c
Domain=[WINXP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server Comment
        --------- -------

        Workgroup Master
        --------- -------

There's no "NT_STATUS_ACCESS_DENIED" message if you don't use the -A<file> option!

kdelibs .debs with my patch are available at: http://ppa.launchpad.net/smarter/ubuntu/pool/main/k/kdelibs/ (the *ubuntu3.2~ppa4_*.deb packages).