~ubuntu-branches/ubuntu/maverick/gnome-keyring/maverick-proposed

« back to all changes in this revision

Viewing changes to pkcs11/gck/gck-data-file.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-03-10 21:37:48 UTC
  • mfrom: (1.1.59 upstream)
  • Revision ID: james.westby@ubuntu.com-20100310213748-imimrnfxu32ih4t3
Tags: 2.29.92-0ubuntu1
* New upstream version:
  - Fix various problems with not storing secret value properly.
  - Return no results when a search includes a bad collection identifier.
  - Don't raise error if ssh client disconnects early.
  - Allow running in a test environment.
  - Fix error when setting default keyring to NULL.
  - Autostart gnome-keyring-daemon in LXDE as well.
  - Rework the startup again, to use a singleton crontrolled via dbus, to help
    when no process was started by pam.
  - Display password and confirm prompts when creating keyring.
  - Allow specifying CKA_ID when creating collection.
  - Give translatable label to created login keyring.
  - When no default keyring set, use login keyring.
  - Fix problem initializing socket path in rpc module.
  - Fix endless loop in reading data.
  - Potential fix or sporadic crash.
  - Solaris build fixes.
  - Updated translations.
* debian/patches/05_git_no_read_looping.patch:
  - the change is in the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
{
133
133
        gsize all = len;
134
134
        int res;
135
 
        
 
135
 
136
136
        while (len > 0) {
137
 
                
138
137
                res = read (fd, buf, len);
139
 
                if (res <= 0) {
 
138
                if (res < 0) {
140
139
                        if (errno == EAGAIN || errno == EINTR)
141
140
                                continue;
142
 
                        if (res < 0 || len != all)
143
 
                                g_warning ("couldn't read %u bytes from store file: %s", 
144
 
                                           (guint)all, g_strerror (errno));
 
141
                        g_warning ("couldn't read %u bytes from store file: %s",
 
142
                                   (guint)all, g_strerror (errno));
 
143
                        return FALSE;
 
144
                } else if (res == 0) {
 
145
                        if (len != all)
 
146
                                g_warning ("couldn't read %u bytes from store file", (guint)all);
145
147
                        return FALSE;
146
148
                } else  {
147
149
                        len -= res;
148
150
                        buf += res;
149
151
                }
150
152
        }
151
 
        
 
153
 
152
154
        return TRUE;
153
155
}
154
156
 
161
163
        while (len > 0) {
162
164
                
163
165
                res = write (fd, buf, len);
164
 
 
165
 
                if (res <= 0) {
 
166
                if (res < 0) {
166
167
                        if (errno == EAGAIN || errno == EINTR)
167
168
                                continue;
168
169
                        g_warning ("couldn't write %u bytes to store file: %s", 
169
 
                                   (guint)all, res < 0 ? g_strerror (errno) : "");
 
170
                                   (guint)all, g_strerror (errno));
 
171
                        return FALSE;
 
172
                } else if (res == 0) {
 
173
                        g_warning ("couldn't write %u bytes to store file", (guint)all);
170
174
                        return FALSE;
171
175
                } else  {
172
176
                        len -= res;
219
223
                if (!egg_buffer_get_uint32 (&buffer, offset, &offset, &length) ||
220
224
                    !egg_buffer_get_uint32 (&buffer, offset, &offset, &block) || 
221
225
                    length < 8) {
222
 
                        res = GCK_DATA_SUCCESS;
 
226
                        res = GCK_DATA_FAILURE;
223
227
                        g_message ("invalid block size or length in store file");
224
228
                        break;
225
229
                }