~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source3/registry/reg_dispatcher.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* 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/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 */
25
25
 
26
26
#include "includes.h"
 
27
#include "registry.h"
 
28
#include "reg_dispatcher.h"
 
29
#include "../libcli/security/security.h"
27
30
 
28
31
#undef DBGC_CLASS
29
32
#define DBGC_CLASS DBGC_REGISTRY
34
37
/********************************************************************
35
38
********************************************************************/
36
39
 
37
 
static WERROR construct_registry_sd(TALLOC_CTX *ctx, SEC_DESC **psd)
 
40
static WERROR construct_registry_sd(TALLOC_CTX *ctx, struct security_descriptor **psd)
38
41
{
39
 
        SEC_ACE ace[3];
 
42
        struct security_ace ace[3];
40
43
        size_t i = 0;
41
 
        SEC_DESC *sd;
42
 
        SEC_ACL *theacl;
 
44
        struct security_descriptor *sd;
 
45
        struct security_acl *theacl;
43
46
        size_t sd_size;
44
47
 
45
48
        /* basic access for Everyone */
64
67
                return WERR_NOMEM;
65
68
        }
66
69
 
67
 
        sd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE,
 
70
        sd = make_sec_desc(ctx, SD_REVISION, SEC_DESC_SELF_RELATIVE,
68
71
                           &global_sid_Builtin_Administrators,
69
72
                           &global_sid_System, NULL, theacl,
70
73
                           &sd_size);
159
162
 
160
163
bool regkey_access_check(struct registry_key_handle *key, uint32 requested,
161
164
                         uint32 *granted,
162
 
                         const struct nt_user_token *token )
 
165
                         const struct security_token *token )
163
166
{
164
 
        SEC_DESC *sec_desc;
 
167
        struct security_descriptor *sec_desc;
165
168
        NTSTATUS status;
166
169
        WERROR err;
167
170
 
 
171
        /* root free-pass, like we have on all other pipes like samr, lsa, etc. */
 
172
        if (geteuid() == sec_initial_uid()) {
 
173
                *granted = REG_KEY_ALL;
 
174
                return true;
 
175
        }
 
176
 
168
177
        /* use the default security check if the backend has not defined its
169
178
         * own */
170
179