~ubuntu-branches/ubuntu/maverick/samba/maverick-security

« back to all changes in this revision

Viewing changes to source3/utils/net_rpc.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-01-29 06:16:15 UTC
  • mfrom: (0.27.9 upstream) (0.34.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100129061615-37hs6xqpsdhjq3ld
Tags: 2:3.4.5~dfsg-1ubuntu1
* Merge from debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/smb.conf:
    - Add "(Samba, Ubuntu)" to server string.
    - Comment out the default [homes] share, and add a comment about "valid users = %s"
      to show users how to restrict access to \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are allowed to create
      public shares in additon to authenticated ones.
    - add map to guest = Bad user, maps bad username to gues access.
  + debian/samba-common.conf:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/mksambapasswd.awk:
    - Do not add user with UID less than 1000 to smbpasswd.
  + debian/control: 
    - Make libswbclient0 replace/conflict with hardy's likewise-open.
    - Don't build against ctdb, since its not in main yet.
  + debian/rules:
    - Enable "native" PIE hardening.
    - Add BIND_NOW to maximize benefit of RELRO hardening.
  + Add ufw integration:
    - Created debian/samba.ufw.profile.
    - debian/rules, debian/samba.dirs, debian/samba.files: install
  + Add apoort hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + debian/rules, debian/samba.if-up: allow "NetworkManager" as a recognized address
    family... it's obviously /not/ an address family, but it's what gets
    sent when using NM, so we'll cope for now.  (LP: #462169). Taken from karmic-proposed.
  + debian/control: Recommend keyutils for smbfs (LP: #493565)
  + Dropped patches:
    - debian/patches/security-CVE-2009-3297.patch: No longer needed
    - debian/patches/fix-too-many-open-files.patch: No longer needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
586
586
 
587
587
int net_rpc_getsid(struct net_context *c, int argc, const char **argv)
588
588
{
 
589
        int conn_flags = NET_FLAGS_PDC;
 
590
 
 
591
        if (!c->opt_user_specified) {
 
592
                conn_flags |= NET_FLAGS_ANONYMOUS;
 
593
        }
 
594
 
589
595
        if (c->display_usage) {
590
596
                d_printf("Usage:\n"
591
597
                         "net rpc getsid\n"
594
600
        }
595
601
 
596
602
        return run_rpc_command(c, NULL, &ndr_table_samr.syntax_id,
597
 
                               NET_FLAGS_ANONYMOUS | NET_FLAGS_PDC,
 
603
                               conn_flags,
598
604
                               rpc_getsid_internals,
599
605
                               argc, argv);
600
606
}
5958
5964
        int i;
5959
5965
        struct lsa_DomainList dom_list;
5960
5966
        fstring pdc_name;
 
5967
        bool found_domain;
5961
5968
 
5962
5969
        /* trusting domains listing variables */
5963
5970
        struct policy_handle domain_hnd;
6042
6049
         
6043
6050
        d_printf("Trusted domains list:\n\n");
6044
6051
 
 
6052
        found_domain = false;
 
6053
 
6045
6054
        do {
6046
6055
                nt_status = rpccli_lsa_EnumTrustDom(pipe_hnd, mem_ctx,
6047
6056
                                                    &connect_hnd,
6059
6068
                for (i = 0; i < dom_list.count; i++) {
6060
6069
                        print_trusted_domain(dom_list.domains[i].sid,
6061
6070
                                             dom_list.domains[i].name.string);
 
6071
                        found_domain = true;
6062
6072
                };
6063
6073
 
6064
 
                /*
6065
 
                 * in case of no trusted domains say something rather
6066
 
                 * than just display blank line
6067
 
                 */
6068
 
                if (!dom_list.count) d_printf("none\n");
6069
 
 
6070
6074
        } while (NT_STATUS_EQUAL(nt_status, STATUS_MORE_ENTRIES));
6071
6075
 
 
6076
        /*
 
6077
         * in case of no trusted domains say something rather
 
6078
         * than just display blank line
 
6079
         */
 
6080
        if (!found_domain) {
 
6081
                d_printf("none\n");
 
6082
        }
 
6083
 
6072
6084
        /* close this connection before doing next one */
6073
6085
        nt_status = rpccli_lsa_Close(pipe_hnd, mem_ctx, &connect_hnd);
6074
6086
        if (NT_STATUS_IS_ERR(nt_status)) {
6131
6143
         * perform actual enumeration
6132
6144
         */
6133
6145
 
 
6146
        found_domain = false;
 
6147
 
6134
6148
        enum_ctx = 0;   /* reset enumeration context from last enumeration */
6135
6149
        do {
6136
6150
 
6153
6167
 
6154
6168
                        char *str = CONST_DISCARD(char *, trusts->entries[i].name.string);
6155
6169
 
 
6170
                        found_domain = true;
 
6171
 
6156
6172
                        /*
6157
6173
                         * get each single domain's sid (do we _really_ need this ?):
6158
6174
                         *  1) connect to domain's pdc
6193
6209
                        };
6194
6210
                };
6195
6211
 
6196
 
                if (!num_domains) d_printf("none\n");
6197
 
 
6198
6212
        } while (NT_STATUS_EQUAL(nt_status, STATUS_MORE_ENTRIES));
6199
6213
 
 
6214
        if (!found_domain) {
 
6215
                d_printf("none\n");
 
6216
        }
 
6217
 
6200
6218
        /* close opened samr and domain policy handles */
6201
6219
        nt_status = rpccli_samr_Close(pipe_hnd, mem_ctx, &domain_hnd);
6202
6220
        if (!NT_STATUS_IS_OK(nt_status)) {