~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to lib/compression/lzxpress.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:
34
34
 
35
35
#include "replace.h"
36
36
#include "lzxpress.h"
 
37
#include "../lib/util/byteorder.h"
37
38
 
38
39
 
39
40
#define __BUF_POS_CONST(buf,ofs)(((const uint8_t *)buf)+(ofs))
80
81
 
81
82
        uncompressed_pos = 0;
82
83
        indic = 0;
 
84
        *(uint32_t *)compressed = 0;
83
85
        compressed_pos = sizeof(uint32_t);
84
86
        indic_pos = &compressed[0];
85
87
 
129
131
                        if (best_len < 10) {
130
132
                                /* Classical meta-data */
131
133
                                metadata = (uint16_t)(((best_offset - 1) << 3) | (best_len - 3));
132
 
                                dest[metadata_size / sizeof(uint16_t)] = metadata;
 
134
                                SSVAL(dest, metadata_size / sizeof(uint16_t), metadata);
133
135
                                metadata_size += sizeof(uint16_t);
134
136
                        } else {
135
137
                                metadata = (uint16_t)(((best_offset - 1) << 3) | 7);
136
 
                                dest[metadata_size / sizeof(uint16_t)] = metadata;
 
138
                                SSVAL(dest, metadata_size / sizeof(uint16_t), metadata);
137
139
                                metadata_size = sizeof(uint16_t);
138
140
 
139
141
                                if (best_len < (15 + 7 + 3)) {
155
157
                                                compressed[nibble_index] |= (15 * 16);
156
158
                                        }
157
159
 
158
 
                                        /* Additionnal best_len */
 
160
                                        /* Additional best_len */
159
161
                                        compressed[compressed_pos + metadata_size] = (best_len - (3 + 7 + 15)) & 0xFF;
160
162
                                        metadata_size += sizeof(uint8_t);
161
163
                                } else {
167
169
                                                compressed[nibble_index] |= 15 << 4;
168
170
                                        }
169
171
 
170
 
                                        /* Additionnal best_len */
 
172
                                        /* Additional best_len */
171
173
                                        compressed[compressed_pos + metadata_size] = 255;
172
174
 
173
175
                                        metadata_size += sizeof(uint8_t);
198
200
                indic_bit++;
199
201
 
200
202
                if ((indic_bit - 1) % 32 > (indic_bit % 32)) {
201
 
                        *(uint32_t *)indic_pos = indic;
 
203
                        SIVAL(indic_pos, 0, indic);
202
204
                        indic = 0;
203
205
                        indic_pos = &compressed[compressed_pos];
204
206
                        compressed_pos += sizeof(uint32_t);
212
214
                uncompressed_pos++;
213
215
                compressed_pos++;
214
216
                if (((indic_bit - 1) % 32) > (indic_bit % 32)){
215
 
                        *(uint32_t *)indic_pos = indic;
 
217
                        SIVAL(indic_pos, 0, indic);
216
218
                        indic = 0;
217
219
                        indic_pos = &compressed[compressed_pos];
218
220
                        compressed_pos += sizeof(uint32_t);
223
225
                for (; (indic_bit % 32) != 0; indic_bit++)
224
226
                        indic |= 0 << (32 - ((indic_bit % 32) + 1));
225
227
 
226
 
                *(uint32_t *)indic_pos = indic;
 
228
                *(uint32_t *)&compressed[compressed_pos] = 0;
 
229
                SIVAL(indic_pos, 0, indic);
227
230
                compressed_pos += sizeof(uint32_t);
228
231
        }
229
232