~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source4/torture/basic/denytest.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
 
#include "libcli/raw/libcliraw.h"
24
22
#include "libcli/libcli.h"
25
23
#include "libcli/security/security.h"
26
24
#include "torture/util.h"
27
 
#include "torture/smbtorture.h"
28
 
#include "libcli/util/clilsa.h"
29
25
#include "cxd_known.h"
30
26
 
31
27
extern int torture_failures;
1403
1399
};
1404
1400
 
1405
1401
 
1406
 
static void progress_bar(struct torture_context *tctx, uint_t i, uint_t total)
 
1402
static void progress_bar(struct torture_context *tctx, unsigned int i, unsigned int total)
1407
1403
{
1408
1404
        if (torture_setting_bool(tctx, "progress", true)) {
1409
1405
                torture_comment(tctx, "%5d/%5d\r", i, total);
1420
1416
        int fnum1, fnum2;
1421
1417
        int i;
1422
1418
        bool correct = true;
1423
 
        struct timeval tv, tv_start;
 
1419
        struct timespec tv, tv_start;
1424
1420
        const char *fnames[2] = {"\\denytest1.dat", "\\denytest1.exe"};
1425
1421
        int failures=0;
1426
1422
 
1433
1429
                smbcli_close(cli1->tree, fnum1);
1434
1430
        }
1435
1431
 
1436
 
        torture_comment(tctx, "testing %d entries\n", (int)ARRAY_SIZE(denytable1));
 
1432
        torture_comment(tctx, "Testing %d entries\n", (int)ARRAY_SIZE(denytable1));
1437
1433
 
1438
 
        GetTimeOfDay(&tv_start);
 
1434
        clock_gettime_mono(&tv_start);
1439
1435
 
1440
1436
        for (i=0; i<ARRAY_SIZE(denytable1); i++) {
1441
1437
                enum deny_result res;
1443
1439
 
1444
1440
                progress_bar(tctx, i, ARRAY_SIZE(denytable1));
1445
1441
 
 
1442
                if (!torture_setting_bool(tctx, "deny_fcb_support", true) &&
 
1443
                    (denytable1[i].deny1 == DENY_FCB ||
 
1444
                        denytable1[i].deny2 == DENY_FCB))
 
1445
                        continue;
 
1446
 
 
1447
                if (!torture_setting_bool(tctx, "deny_dos_support", true) &&
 
1448
                    (denytable1[i].deny1 == DENY_DOS ||
 
1449
                        denytable1[i].deny2 == DENY_DOS))
 
1450
                        continue;
 
1451
 
1446
1452
                fnum1 = smbcli_open(cli1->tree, fname, 
1447
1453
                                 denytable1[i].mode1,
1448
1454
                                 denytable1[i].deny1);
1468
1474
                if (torture_setting_bool(tctx, "showall", false) || 
1469
1475
                        res != denytable1[i].result) {
1470
1476
                        int64_t tdif;
1471
 
                        GetTimeOfDay(&tv);
1472
 
                        tdif = usec_time_diff(&tv, &tv_start);
1473
 
                        tdif /= 1000;
 
1477
                        clock_gettime_mono(&tv);
 
1478
                        tdif = nsec_time_diff(&tv, &tv_start);
 
1479
                        tdif /= 1000000;
1474
1480
                        torture_comment(tctx, "%lld: %s %8s %10s    %8s %10s    %s (correct=%s)\n",
1475
1481
                               (long long)tdif,
1476
1482
                               fname,
1512
1518
        int i;
1513
1519
        bool correct = true;
1514
1520
        const char *fnames[2] = {"\\denytest2.dat", "\\denytest2.exe"};
1515
 
        struct timeval tv, tv_start;
 
1521
        struct timespec tv, tv_start;
1516
1522
        int failures=0;
1517
1523
 
1518
1524
        for (i=0;i<2;i++) {
1522
1528
                smbcli_close(cli1->tree, fnum1);
1523
1529
        }
1524
1530
 
1525
 
        GetTimeOfDay(&tv_start);
 
1531
        clock_gettime_mono(&tv_start);
1526
1532
 
1527
1533
        for (i=0; i<ARRAY_SIZE(denytable2); i++) {
1528
1534
                enum deny_result res;
1530
1536
 
1531
1537
                progress_bar(tctx, i, ARRAY_SIZE(denytable1));
1532
1538
 
 
1539
                if (!torture_setting_bool(tctx, "deny_fcb_support", true) &&
 
1540
                    (denytable1[i].deny1 == DENY_FCB ||
 
1541
                        denytable1[i].deny2 == DENY_FCB))
 
1542
                        continue;
 
1543
 
 
1544
                if (!torture_setting_bool(tctx, "deny_dos_support", true) &&
 
1545
                    (denytable1[i].deny1 == DENY_DOS ||
 
1546
                        denytable1[i].deny2 == DENY_DOS))
 
1547
                        continue;
 
1548
 
1533
1549
                fnum1 = smbcli_open(cli1->tree, fname, 
1534
1550
                                 denytable2[i].mode1,
1535
1551
                                 denytable2[i].deny1);
1555
1571
                if (torture_setting_bool(tctx, "showall", false) || 
1556
1572
                        res != denytable2[i].result) {
1557
1573
                        int64_t tdif;
1558
 
                        GetTimeOfDay(&tv);
1559
 
                        tdif = usec_time_diff(&tv, &tv_start);
1560
 
                        tdif /= 1000;
 
1574
                        clock_gettime_mono(&tv);
 
1575
                        tdif = nsec_time_diff(&tv, &tv_start);
 
1576
                        tdif /= 1000000;
1561
1577
                        torture_comment(tctx, "%lld: %s %8s %10s    %8s %10s    %s (correct=%s)\n",
1562
1578
                               (long long)tdif,
1563
1579
                               fname,
1726
1742
  a denytest for ntcreatex
1727
1743
 */
1728
1744
static bool torture_ntdenytest(struct torture_context *tctx, 
1729
 
                                                           struct smbcli_state *cli1, struct smbcli_state *cli2, int client)
 
1745
                               struct smbcli_state *cli1,
 
1746
                               struct smbcli_state *cli2, int client)
1730
1747
{
1731
1748
        const struct bit_value share_access_bits[] = {
1732
1749
                { NTCREATEX_SHARE_ACCESS_READ,   "S_R" },
1746
1763
        int fnum1;
1747
1764
        int i;
1748
1765
        bool correct = true;
1749
 
        struct timeval tv, tv_start;
 
1766
        struct timespec tv, tv_start;
1750
1767
        const char *fname;
1751
1768
        int nbits1 = ARRAY_SIZE(share_access_bits);
1752
1769
        int nbits2 = ARRAY_SIZE(access_mask_bits);
1766
1783
        smbcli_write(cli1->tree, fnum1, 0, buf, 0, sizeof(buf));
1767
1784
        smbcli_close(cli1->tree, fnum1);
1768
1785
 
1769
 
        GetTimeOfDay(&tv_start);
 
1786
        clock_gettime_mono(&tv_start);
1770
1787
 
1771
1788
        io1.ntcreatex.level = RAW_OPEN_NTCREATEX;
1772
 
        io1.ntcreatex.in.root_fid = 0;
 
1789
        io1.ntcreatex.in.root_fid.fnum = 0;
1773
1790
        io1.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED;
1774
1791
        io1.ntcreatex.in.create_options = NTCREATEX_OPTIONS_NON_DIRECTORY_FILE;
1775
1792
        io1.ntcreatex.in.file_attr = 0;
1780
1797
        io1.ntcreatex.in.fname = fname;
1781
1798
        io2 = io1;
1782
1799
 
1783
 
        torture_comment(tctx, "testing %d entries on %s\n", torture_numops, fname);
 
1800
        torture_comment(tctx, "Testing %d entries on %s\n", torture_numops, fname);
1784
1801
 
1785
1802
        for (i=0;i<torture_numops;i++) {
1786
1803
                NTSTATUS status1, status2, status2_p;
1854
1871
                                                   read_for_execute,
1855
1872
                                                   &res2);
1856
1873
                
1857
 
                GetTimeOfDay(&tv);
1858
 
                tdif = usec_time_diff(&tv, &tv_start);
1859
 
                tdif /= 1000;
 
1874
                clock_gettime_mono(&tv);
 
1875
                tdif = nsec_time_diff(&tv, &tv_start);
 
1876
                tdif /= 1000000;
1860
1877
                if (torture_setting_bool(tctx, "showall", false) || 
1861
1878
                    !NT_STATUS_EQUAL(status2, status2_p) ||
1862
1879
                    res != res2) {
2078
2095
        return -1;
2079
2096
}
2080
2097
 
2081
 
#define FILL_NTCREATEX(_struct, _init...)                       \
2082
 
        do {                                                    \
2083
 
                (_struct)->generic.level = RAW_OPEN_NTCREATEX;  \
2084
 
                (_struct)->ntcreatex.in                         \
2085
 
                    = (typeof((_struct)->ntcreatex.in)) {_init};\
2086
 
        } while (0)
2087
 
 
2088
2098
#define CREATEX_NAME "\\createx_dir"
2089
2099
 
2090
2100
static bool createx_make_dir(struct torture_context *tctx,
2107
2117
        bool ret = true;
2108
2118
        NTSTATUS status;
2109
2119
 
2110
 
        FILL_NTCREATEX(&open_parms,
2111
 
            .flags = 0,
2112
 
            .access_mask = SEC_RIGHTS_FILE_ALL,
2113
 
            .file_attr = FILE_ATTRIBUTE_NORMAL,
2114
 
            .share_access = 0,
2115
 
            .open_disposition = NTCREATEX_DISP_CREATE,
2116
 
            .create_options = 0,
2117
 
            .fname = fname,
2118
 
        );
 
2120
        ZERO_STRUCT(open_parms);
 
2121
        open_parms.generic.level = RAW_OPEN_NTCREATEX;
 
2122
        open_parms.ntcreatex.in.flags = 0;
 
2123
        open_parms.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
 
2124
        open_parms.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
 
2125
        open_parms.ntcreatex.in.share_access = 0;
 
2126
        open_parms.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
 
2127
        open_parms.ntcreatex.in.create_options = 0;
 
2128
        open_parms.ntcreatex.in.fname = fname;
 
2129
 
2119
2130
        status = smb_raw_open(tree, mem_ctx, &open_parms);
2120
2131
        CHECK_STATUS(status, NT_STATUS_OK);
2121
2132
 
2129
2140
static void createx_fill_dir(union smb_open *open_parms, int accessmode,
2130
2141
    int sharemode, const char *fname)
2131
2142
{
2132
 
        FILL_NTCREATEX(open_parms,
2133
 
            .flags = 0,
2134
 
            .access_mask = accessmode,
2135
 
            .file_attr = FILE_ATTRIBUTE_DIRECTORY,
2136
 
            .share_access = sharemode,
2137
 
            .open_disposition = NTCREATEX_DISP_OPEN_IF,
2138
 
            .create_options = NTCREATEX_OPTIONS_DIRECTORY,
2139
 
            .fname = fname,
2140
 
        );
 
2143
        ZERO_STRUCTP(open_parms);
 
2144
        open_parms->generic.level = RAW_OPEN_NTCREATEX;
 
2145
        open_parms->ntcreatex.in.flags = 0;
 
2146
        open_parms->ntcreatex.in.access_mask = accessmode;
 
2147
        open_parms->ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY;
 
2148
        open_parms->ntcreatex.in.share_access = sharemode;
 
2149
        open_parms->ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
 
2150
        open_parms->ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
 
2151
        open_parms->ntcreatex.in.fname = fname;
2141
2152
}
2142
2153
 
2143
2154
static void createx_fill_file(union smb_open *open_parms, int accessmode,
2144
2155
    int sharemode, const char *fname)
2145
2156
{
2146
 
        FILL_NTCREATEX(open_parms,
2147
 
            .flags = 0,
2148
 
            .access_mask = accessmode,
2149
 
            .file_attr = FILE_ATTRIBUTE_NORMAL,
2150
 
            .share_access = sharemode,
2151
 
            .open_disposition = NTCREATEX_DISP_OPEN_IF,
2152
 
            .create_options = 0,
2153
 
            .fname = fname,
2154
 
        );
 
2157
        ZERO_STRUCTP(open_parms);
 
2158
        open_parms->generic.level = RAW_OPEN_NTCREATEX;
 
2159
        open_parms->ntcreatex.in.flags = 0;
 
2160
        open_parms->ntcreatex.in.access_mask = accessmode;
 
2161
        open_parms->ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
 
2162
        open_parms->ntcreatex.in.share_access = sharemode;
 
2163
        open_parms->ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
 
2164
        open_parms->ntcreatex.in.create_options = 0;
 
2165
        open_parms->ntcreatex.in.fname = fname;
 
2166
        open_parms->ntcreatex.in.root_fid.fnum = 0;
2155
2167
}
2156
2168
 
2157
2169
static int data_file_fd = -1;
2166
2178
        union smb_open open_parms;
2167
2179
 
2168
2180
        /* bypass original handle to guarantee creation */
2169
 
        FILL_NTCREATEX(&open_parms,
2170
 
            .flags = 0,
2171
 
            .access_mask = SEC_RIGHTS_FILE_ALL,
2172
 
            .file_attr = FILE_ATTRIBUTE_NORMAL,
2173
 
            .share_access = 0,
2174
 
            .open_disposition = NTCREATEX_DISP_CREATE,
2175
 
            .create_options = 0,
2176
 
            .fname = CREATEX_NAME "\\" KNOWN,
2177
 
        );
 
2181
        ZERO_STRUCT(open_parms);
 
2182
        open_parms.generic.level = RAW_OPEN_NTCREATEX;
 
2183
        open_parms.ntcreatex.in.flags = 0;
 
2184
        open_parms.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
 
2185
        open_parms.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
 
2186
        open_parms.ntcreatex.in.share_access = 0;
 
2187
        open_parms.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
 
2188
        open_parms.ntcreatex.in.create_options = 0;
 
2189
        open_parms.ntcreatex.in.fname = CREATEX_NAME "\\" KNOWN;
 
2190
 
2178
2191
        status = smb_raw_open(tree, mem_ctx, &open_parms);
2179
2192
        CHECK_STATUS(status, NT_STATUS_OK);
2180
2193
        smbcli_close(tree, open_parms.ntcreatex.out.file.fnum);
2182
2195
        result[CXD_DIR_ENUMERATE] = NT_STATUS_OK;
2183
2196
 
2184
2197
        /* try to create a child */
2185
 
        FILL_NTCREATEX(&open_parms,
2186
 
            .flags = 0,
2187
 
            .access_mask = SEC_RIGHTS_FILE_ALL,
2188
 
            .file_attr = FILE_ATTRIBUTE_NORMAL,
2189
 
            .share_access = 0,
2190
 
            .open_disposition = NTCREATEX_DISP_CREATE,
2191
 
            .create_options = 0,
2192
 
            .fname = CHILD,
2193
 
            .root_fid = fnum,
2194
 
        );
 
2198
        ZERO_STRUCT(open_parms);
 
2199
        open_parms.generic.level = RAW_OPEN_NTCREATEX;
 
2200
        open_parms.ntcreatex.in.flags = 0;
 
2201
        open_parms.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
 
2202
        open_parms.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
 
2203
        open_parms.ntcreatex.in.share_access = 0;
 
2204
        open_parms.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
 
2205
        open_parms.ntcreatex.in.create_options = 0;
 
2206
        open_parms.ntcreatex.in.fname = CHILD;
 
2207
        open_parms.ntcreatex.in.root_fid.fnum = fnum;
2195
2208
 
2196
2209
        result[CXD_DIR_CREATE_CHILD] =
2197
2210
            smb_raw_open(tree, mem_ctx, &open_parms);
2198
2211
        smbcli_close(tree, open_parms.ntcreatex.out.file.fnum);
2199
2212
 
2200
2213
        /* try to traverse dir to known good file */
2201
 
        FILL_NTCREATEX(&open_parms,
2202
 
            .flags = 0,
2203
 
            .access_mask = SEC_RIGHTS_FILE_ALL,
2204
 
            .file_attr = FILE_ATTRIBUTE_NORMAL,
2205
 
            .share_access = 0,
2206
 
            .open_disposition = NTCREATEX_DISP_OPEN,
2207
 
            .create_options = 0,
2208
 
            .fname = KNOWN,
2209
 
            .root_fid = fnum,
2210
 
        );
 
2214
        ZERO_STRUCT(open_parms);
 
2215
        open_parms.generic.level = RAW_OPEN_NTCREATEX;
 
2216
        open_parms.ntcreatex.in.flags = 0;
 
2217
        open_parms.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
 
2218
        open_parms.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
 
2219
        open_parms.ntcreatex.in.share_access = 0;
 
2220
        open_parms.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
 
2221
        open_parms.ntcreatex.in.create_options = 0;
 
2222
        open_parms.ntcreatex.in.fname = KNOWN;
 
2223
        open_parms.ntcreatex.in.root_fid.fnum = fnum;
2211
2224
 
2212
2225
        result[CXD_DIR_TRAVERSE] =
2213
2226
            smb_raw_open(tree, mem_ctx, &open_parms);
2224
2237
static bool createx_test_file(struct torture_context *tctx,
2225
2238
    struct smbcli_tree *tree, int fnum, TALLOC_CTX *mem_ctx, NTSTATUS *result)
2226
2239
{
2227
 
        union smb_read rd = {};
2228
 
        union smb_write wr = {};
 
2240
        union smb_read rd;
 
2241
        union smb_write wr;
2229
2242
        char buf[256] = "";
2230
2243
 
 
2244
        memset(&rd, 0, sizeof(rd));
2231
2245
        rd.readx.level = RAW_READ_READX;
2232
2246
        rd.readx.in.file.fnum = fnum;
2233
2247
        rd.readx.in.mincnt = sizeof(buf);
2234
2248
        rd.readx.in.maxcnt = sizeof(buf);
2235
 
        rd.readx.out.data = buf;
 
2249
        rd.readx.out.data = (uint8_t *)buf;
2236
2250
 
2237
2251
        result[CXD_FILE_READ] = smb_raw_read(tree, &rd);
2238
2252
 
 
2253
        memset(&wr, 0, sizeof(wr));
2239
2254
        wr.writex.level = RAW_WRITE_WRITEX;
2240
2255
        wr.writex.in.file.fnum = fnum;
2241
2256
        wr.writex.in.count = sizeof(buf);
2242
 
        wr.writex.in.data = buf;
 
2257
        wr.writex.in.data = (uint8_t *)buf;
2243
2258
 
2244
2259
        result[CXD_FILE_WRITE] = smb_raw_write(tree, &wr);
2245
2260
 
2249
2264
        rd.readx.in.mincnt = sizeof(buf);
2250
2265
        rd.readx.in.maxcnt = sizeof(buf);
2251
2266
        rd.readx.in.read_for_execute = 1;
2252
 
        rd.readx.out.data = buf;
 
2267
        rd.readx.out.data = (uint8_t *)buf;
2253
2268
 
2254
2269
        result[CXD_FILE_EXECUTE] = smb_raw_read(tree, &rd);
2255
2270
 
2259
2274
/* TODO When redirecting stdout to a file, the progress bar really screws up
2260
2275
 * the output. Could use a switch "--noprogress", or direct the progress bar to
2261
2276
 * stderr? No other solution? */
2262
 
static void createx_progress_bar(struct torture_context *tctx, uint_t i,
2263
 
    uint_t total, uint_t skipped)
 
2277
static void createx_progress_bar(struct torture_context *tctx, unsigned int i,
 
2278
    unsigned int total, unsigned int skipped)
2264
2279
{
2265
2280
        if (torture_setting_bool(tctx, "progress", true)) {
2266
2281
                torture_comment(tctx, "%5d/%5d (%d skipped)\r", i, total,
2581
2596
                        torture_createx_specific(tctx, cli, NULL, mem_ctx,
2582
2597
                            &cxd, est);
2583
2598
                }
2584
 
 
2585
2599
                for (i = 0; i < num_access_bits; i++) {
2586
2600
                        /* And now run through the single access bits. */
2587
2601
                        cxd.cxd_access1 = 1 << i;
2665
2679
    struct smbcli_state *cli)
2666
2680
{
2667
2681
        struct security_descriptor *sd, *sd_orig;
2668
 
        union smb_open io = {};
 
2682
        union smb_open io;
2669
2683
        static TALLOC_CTX *mem_ctx;
2670
2684
        int fnum, i;
2671
2685
        bool ret = true;
2690
2704
        smbcli_unlink(cli->tree, MAXIMUM_ALLOWED_FILE);
2691
2705
 
2692
2706
        /* create initial file with restrictive SD */
 
2707
        memset(&io, 0, sizeof(io));
2693
2708
        io.generic.level = RAW_OPEN_NTTRANS_CREATE;
2694
2709
        io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
2695
2710
        io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
2715
2730
 
2716
2731
        owner_sid = dom_sid_string(tctx, sd_orig->owner_sid);
2717
2732
 
2718
 
        status = smblsa_sid_check_privilege(cli, 
2719
 
                                            owner_sid, 
2720
 
                                            sec_privilege_name(SEC_PRIV_RESTORE));
 
2733
        status = torture_check_privilege(cli, 
 
2734
                                         owner_sid, 
 
2735
                                         sec_privilege_name(SEC_PRIV_RESTORE));
2721
2736
        has_restore_privilege = NT_STATUS_IS_OK(status);
2722
 
        torture_comment(tctx, "Checked SEC_PRIV_RESTORE - %s\n", has_restore_privilege?"Yes":"No");
 
2737
        torture_comment(tctx, "Checked SEC_PRIV_RESTORE for %s - %s\n", 
 
2738
                        owner_sid,
 
2739
                        has_restore_privilege?"Yes":"No");
2723
2740
 
2724
 
        status = smblsa_sid_check_privilege(cli, 
2725
 
                                            owner_sid, 
2726
 
                                            sec_privilege_name(SEC_PRIV_BACKUP));
 
2741
        status = torture_check_privilege(cli, 
 
2742
                                         owner_sid, 
 
2743
                                         sec_privilege_name(SEC_PRIV_BACKUP));
2727
2744
        has_backup_privilege = NT_STATUS_IS_OK(status);
2728
 
        torture_comment(tctx, "Checked SEC_PRIV_BACKUP - %s\n", has_backup_privilege?"Yes":"No");
 
2745
        torture_comment(tctx, "Checked SEC_PRIV_BACKUP for %s - %s\n", 
 
2746
                        owner_sid,
 
2747
                        has_backup_privilege?"Yes":"No");
2729
2748
 
2730
2749
        smbcli_close(cli->tree, fnum);
2731
2750
 
2773
2792
        }
2774
2793
 
2775
2794
 done:
 
2795
        smbcli_unlink(cli->tree, MAXIMUM_ALLOWED_FILE);
2776
2796
        return ret;
2777
2797
}