~ubuntu-branches/ubuntu/utopic/samba/utopic

« back to all changes in this revision

Viewing changes to source3/rpc_server/netlogon/srv_netlog_nt.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-02-21 09:06:34 UTC
  • mfrom: (0.39.23 sid)
  • Revision ID: package-import@ubuntu.com-20120221090634-svd7q7m33pfz0847
Tags: 2:3.6.3-1ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + 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 addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module.
* Dropped:
  - debian/patches/fix-samba-printer-browsing.patch: No longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1120
1120
                goto out;
1121
1121
        }
1122
1122
 
 
1123
        become_root();
1123
1124
        status = samr_find_machine_account(mem_ctx,
1124
1125
                                           h,
1125
1126
                                           account_name,
1127
1128
                                           NULL,
1128
1129
                                           NULL,
1129
1130
                                           &user_handle);
 
1131
        unbecome_root();
1130
1132
        if (!NT_STATUS_IS_OK(status)) {
1131
1133
                goto out;
1132
1134
        }
1170
1172
 
1171
1173
        info->info18 = info18;
1172
1174
 
 
1175
        become_root();
1173
1176
        status = dcerpc_samr_SetUserInfo2(h,
1174
1177
                                          mem_ctx,
1175
1178
                                          &user_handle,
1176
1179
                                          UserInternal1Information,
1177
1180
                                          info,
1178
1181
                                          &result);
 
1182
        unbecome_root();
1179
1183
        if (!NT_STATUS_IS_OK(status)) {
1180
1184
                goto out;
1181
1185
        }
1247
1251
                                  struct netr_ServerPasswordSet2 *r)
1248
1252
{
1249
1253
        NTSTATUS status;
1250
 
        struct netlogon_creds_CredentialState *creds;
 
1254
        struct netlogon_creds_CredentialState *creds = NULL;
1251
1255
        DATA_BLOB plaintext;
1252
1256
        struct samr_CryptPassword password_buf;
1253
1257
        struct samr_Password nt_hash;
1261
1265
        unbecome_root();
1262
1266
 
1263
1267
        if (!NT_STATUS_IS_OK(status)) {
 
1268
                const char *computer_name = "<unknown>";
 
1269
 
 
1270
                if (creds && creds->computer_name) {
 
1271
                        computer_name = creds->computer_name;
 
1272
                }
1264
1273
                DEBUG(2,("_netr_ServerPasswordSet2: netlogon_creds_server_step "
1265
1274
                        "failed. Rejecting auth request from client %s machine account %s\n",
1266
 
                        r->in.computer_name, creds->computer_name));
 
1275
                        r->in.computer_name, computer_name));
1267
1276
                TALLOC_FREE(creds);
1268
1277
                return status;
1269
1278
        }
1273
1282
        netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
1274
1283
 
1275
1284
        if (!extract_pw_from_buffer(p->mem_ctx, password_buf.data, &plaintext)) {
 
1285
                TALLOC_FREE(creds);
1276
1286
                return NT_STATUS_WRONG_PASSWORD;
1277
1287
        }
1278
1288
 
1283
1293
                                                   p->msg_ctx,
1284
1294
                                                   creds->account_name,
1285
1295
                                                   &nt_hash);
 
1296
        TALLOC_FREE(creds);
1286
1297
        return status;
1287
1298
}
1288
1299