~ubuntu-branches/ubuntu/intrepid/samba/intrepid-updates

« back to all changes in this revision

Viewing changes to source/utils/net_rpc_join.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-06-02 09:01:46 UTC
  • mfrom: (0.25.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080602090146-92ur4nx39ccg708r
Tags: 2:3.0.30-2ubuntu1
* Merge from debian unstable, remaining changes:
  * debian/patches/VERSION.patch
    - set SAMABA_VERSION_VENDOR_SUFFIX to Ubuntu
  * debian/smb.conf
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] shares, and a comment about
      "value users = %S to show users how to restrict access to 
      \\server\useranem to only username.
    - Add map to guest = Bad user, maps bad username to guest access.
      (LP: #32067)
  * debian/samba-common.postinst:
    - Fix upgrade from a first installation done with feisty, edgy, or dapper.
      (LP: #201059)
    - When populating the new sambashare group, it's not an error if the user
      simply doesn't exist; test for this case and the install continue 
      instead of aborting. (LP: #206036)
  * debian/smba-common.config:
    - do not change priority to HIGH if dhclient3 is installed
    - used priority medium instead of hight for the workgroup question
  * debian/winbind.files
    - insclude additional files
  * debian/patches/fix-documentation.patch:
    - fix typos in net(8) and smb.conf(5) man pages
  * debian/mksambapasswd.awk:
    - Don't add user with UID less than 1000 to smbpasswd.
  * debian/samba.init:
    - add 'status' option for LSB conformance.
  * Updated control version.
  * Dropped Changes:
    - Dropped debian/patches/fix-smbprinting-os2.patch. Accepted upstream.
    - Dropped debian/patches/fix-documentation.patch. Accepted upstream.
     

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 **/
44
44
int net_rpc_join_ok(const char *domain, const char *server, struct in_addr *ip )
45
45
{
46
 
        uint32 neg_flags = NETLOGON_NEG_SELECT_AUTH2_FLAGS|NETLOGON_NEG_SCHANNEL;
 
46
        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
 
47
        enum security_types sec;
 
48
        unsigned int conn_flags = NET_FLAGS_PDC;
47
49
        struct cli_state *cli = NULL;
48
50
        struct rpc_pipe_client *pipe_hnd = NULL;
49
51
        struct rpc_pipe_client *netlogon_pipe = NULL;
50
52
        NTSTATUS ntret = NT_STATUS_UNSUCCESSFUL;
51
53
 
 
54
        sec = (enum security_types)lp_security();
 
55
 
 
56
        if (sec == SEC_ADS) {
 
57
                /* Connect to IPC$ using machine account's credentials. We don't use anonymous
 
58
                   connection here, as it may be denied by server's local policy. */
 
59
                net_use_machine_account();
 
60
 
 
61
        } else {
 
62
                /* some servers (e.g. WinNT) don't accept machine-authenticated
 
63
                   smb connections */
 
64
                conn_flags |= NET_FLAGS_ANONYMOUS;
 
65
        }
 
66
 
52
67
        /* Connect to remote machine */
53
 
        if (!(cli = net_make_ipc_connection_ex(domain, server, ip, (NET_FLAGS_ANONYMOUS|NET_FLAGS_PDC)))) {
 
68
        if (!(cli = net_make_ipc_connection_ex(domain, server, ip, conn_flags))) {
54
69
                return -1;
55
70
        }
56
71
 
114
129
        struct cli_state *cli;
115
130
        TALLOC_CTX *mem_ctx;
116
131
        uint32 acb_info = ACB_WSTRUST;
117
 
        uint32 neg_flags = NETLOGON_NEG_SELECT_AUTH2_FLAGS|(lp_client_schannel() ? NETLOGON_NEG_SCHANNEL : 0);
 
132
        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
118
133
        uint32 sec_channel_type;
119
134
        struct rpc_pipe_client *pipe_hnd = NULL;
120
135