~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source4/torture/basic/utable.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:
18
18
*/
19
19
 
20
20
#include "includes.h"
21
 
#include "torture/torture.h"
22
21
#include "system/filesys.h"
23
22
#include "system/locale.h"
24
23
#include "libcli/libcli.h"
50
49
                SSVAL(c2, 0, c);
51
50
                strncpy(fname, "\\utable\\x", sizeof(fname)-1);
52
51
                p = fname+strlen(fname);
53
 
                convert_string_convenience(lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, 
 
52
                len = convert_string(CH_UTF16, CH_UNIX, 
54
53
                                     c2, 2, 
55
 
                                     p, sizeof(fname)-strlen(fname), &len, false);
 
54
                                     p, sizeof(fname)-strlen(fname), false);
56
55
                p[len] = 0;
57
56
                strncat(fname,"_a_long_extension",sizeof(fname)-1);
58
57
 
98
97
}
99
98
 
100
99
 
101
 
static char *form_name(struct smb_iconv_convenience *iconv_convenience, int c)
 
100
static char *form_name(int c)
102
101
{
103
102
        static char fname[256];
104
103
        uint8_t c2[4];
109
108
        p = fname+strlen(fname);
110
109
        SSVAL(c2, 0, c);
111
110
 
112
 
        convert_string_convenience(iconv_convenience, CH_UTF16, CH_UNIX, 
 
111
        len = convert_string(CH_UTF16, CH_UNIX, 
113
112
                             c2, 2, 
114
 
                             p, sizeof(fname)-strlen(fname), &len, false);
 
113
                             p, sizeof(fname)-strlen(fname), false);
 
114
        if (len == -1)
 
115
                return NULL;
115
116
        p[len] = 0;
116
117
        return fname;
117
118
}
139
140
 
140
141
                torture_comment(tctx, "%04x (%c)\n", c, isprint(c)?c:'.');
141
142
 
142
 
                fname = form_name(lp_iconv_convenience(tctx->lp_ctx), c);
 
143
                fname = form_name(c);
143
144
                fnum = smbcli_nt_create_full(cli->tree, fname, 0,
144
145
#if 0
145
146
                                             SEC_RIGHT_MAXIMUM_ALLOWED,