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

« back to all changes in this revision

Viewing changes to source3/registry/reg_parse_internal.h

  • 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:
 
1
/*
 
2
 * Unix SMB/CIFS implementation.
 
3
 *
 
4
 * Registry helper routines
 
5
 *
 
6
 * Copyright (C) Gregor Beck 2010
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published by
 
10
 * the Free Software Foundation; either version 3 of the License, or
 
11
 * (at your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 * GNU General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
/**
 
23
 * @brief  Some stuff used by reg_parse and reg_format.
 
24
 * It might be usefull elsewehre but need some review of the interfaces.
 
25
 * @file   reg_parse_internal.h
 
26
 * @author Gregor Beck <gb@sernet.de>
 
27
 * @date   Sep 2010
 
28
 */
 
29
#ifndef __REG_PARSE_INTERNAL_H
 
30
#define __REG_PARSE_INTERNAL_H
 
31
 
 
32
#include "includes.h"
 
33
#include "system/iconv.h"
 
34
 
 
35
struct cbuf;
 
36
 
 
37
#define USE_NATIVE_ICONV
 
38
#if defined USE_NATIVE_ICONV && defined HAVE_NATIVE_ICONV
 
39
#  define smb_iconv_t     iconv_t
 
40
#  define smb_iconv(CD, IPTR, ILEN, OPTR, OLEN) \
 
41
        iconv(CD, (char**)(IPTR), ILEN, OPTR, OLEN)
 
42
#  define smb_iconv_open  iconv_open
 
43
#  define smb_iconv_close iconv_close
 
44
#endif
 
45
 
 
46
size_t iconvert_talloc(const void* ctx,
 
47
                       smb_iconv_t cd,
 
48
                       const char* src, size_t srclen,
 
49
                       char** pdst);
 
50
 
 
51
struct hive_info {
 
52
        uint32_t handle;
 
53
        const char* short_name;
 
54
        size_t short_name_len;
 
55
        const char* long_name;
 
56
        size_t long_name_len;
 
57
};
 
58
 
 
59
const struct hive_info* hive_info(const char* name, int nlen);
 
60
 
 
61
const char* get_charset(const char* c);
 
62
 
 
63
bool set_iconv(smb_iconv_t* t, const char* to, const char* from);
 
64
 
 
65
/**
 
66
 * Parse option string
 
67
 * @param[in,out] ptr parse position
 
68
 * @param[in] mem_ctx talloc context
 
69
 * @param[out] name ptr 2 value
 
70
 * @param[out] value ptr 2 value
 
71
 * @return true on success
 
72
 */
 
73
bool srprs_option(const char** ptr, const void* mem_ctx, char** name, char** value);
 
74
 
 
75
/**
 
76
 * Write Byte Order Mark for \p charset to file.
 
77
 * If \c charset==NULL write BOM for \p ctype.
 
78
 *
 
79
 * @param[in] file file to write to
 
80
 * @param[in] charset
 
81
 * @param[in] ctype
 
82
 *
 
83
 * @return number of bytes written, -1 on error
 
84
 * @todo write to cbuf
 
85
 */
 
86
int write_bom(FILE* file, const char* charset, charset_t ctype);
 
87
 
 
88
/**
 
89
 * Parse Byte Order Mark.
 
90
 *
 
91
 * @param[in,out] ptr parse position
 
92
 * @param[out] name name of characterset
 
93
 * @param[out] ctype charset_t
 
94
 *
 
95
 * @return true if found
 
96
 * @ingroup parse bom
 
97
 */
 
98
bool srprs_bom(const char** ptr, const char** name, charset_t* ctype);
 
99
 
 
100
enum fmt_case {
 
101
        FMT_CASE_PRESERVE=0,
 
102
        FMT_CASE_UPPER,
 
103
        FMT_CASE_LOWER,
 
104
        FMT_CASE_TITLE
 
105
};
 
106
int cbuf_puts_case(struct cbuf* s, const char* str, size_t len, enum fmt_case fmt);
 
107
 
 
108
#endif /* __REG_PARSE_INTERNAL_H */