~ubuntu-branches/debian/stretch/nfs-utils/stretch

« back to all changes in this revision

Viewing changes to utils/mountd/rmtab.c

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar, Anibal Monsalve Salazar, Ben Hutchings
  • Date: 2010-04-06 16:11:22 UTC
  • mfrom: (1.2.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20100406161122-x7erw0q8xiitoyp6
Tags: 1:1.2.2-1
[ Anibal Monsalve Salazar ]
* New upstream release 
  Build depend on libcap-dev
  Set configure option --enable-nfsv41
* X-ref nfsd({7,8})
  02-524255-manpages.patch by Cyril Brulebois
  Closes: 524255

[ Ben Hutchings ]
* Change maintainer to Debian kernel team; move Aníbal to uploaders and
  add myself to uploaders
* Check for nfsd in /proc/filesystems rather than looking for signs of it in
  /proc/kallsyms (Closes: #563104, #572736)
* Document the -n option to svcgssd, thanks to Alberto Gonzalez Iniesta
  (Closes: #451402, #550270)
* Replace upstream reference in package descriptions with Homepage fields,
  and do not refer to the obsolete CVS repository
* Update policy version to 3.8.4; no changes required
* Override lintian error 'init.d-script-missing-dependency-on-remote_fs';
  the init script does work without /usr mounted

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "ha-callout.h"
25
25
 
26
26
#include <limits.h> /* PATH_MAX */
 
27
#include <errno.h>
27
28
 
28
29
extern int reverse_resolve;
29
30
 
143
144
                return;
144
145
        if (!(hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET))) {
145
146
                xlog(L_ERROR, "can't get hostname of %s", inet_ntoa(addr));
146
 
                xfunlock(lockid);
147
 
                return;
148
 
        }
149
 
        else
150
 
                hp = hostent_dup (hp);
151
 
 
152
 
        if (!setrmtabent("r")) {
153
 
                xfunlock(lockid);
154
 
                free (hp);
155
 
                return;
156
 
        }
157
 
        if (!(fp = fsetrmtabent(_PATH_RMTABTMP, "w"))) {
158
 
                endrmtabent();
159
 
                xfunlock(lockid);
160
 
                free (hp);
161
 
                return;
162
 
        }
 
147
                goto out_unlock;
 
148
        }
 
149
        hp = hostent_dup (hp);
 
150
 
 
151
        if (!setrmtabent("r"))
 
152
                goto out_free;
 
153
 
 
154
        if (!(fp = fsetrmtabent(_PATH_RMTABTMP, "w")))
 
155
                goto out_close;
 
156
 
163
157
        while ((rep = getrmtabent(1, NULL)) != NULL) {
164
158
                if (strcmp(rep->r_client, hp->h_name) == 0 &&
165
159
                    (exp = auth_authenticate("umountall", sin, rep->r_path)))
170
164
                xlog(L_ERROR, "couldn't rename %s to %s",
171
165
                                _PATH_RMTABTMP, _PATH_RMTAB);
172
166
        }
 
167
        fendrmtabent(fp);
 
168
out_close:
173
169
        endrmtabent();  /* close & unlink */
174
 
        fendrmtabent(fp);
175
 
        xfunlock(lockid);
 
170
out_free:
176
171
        free (hp);
 
172
out_unlock:
 
173
        xfunlock(lockid);
177
174
}
178
175
 
179
176
mountlist
191
188
        if ((lockid = xflock(_PATH_RMTABLCK, "r")) < 0)
192
189
                return NULL;
193
190
        if (stat(_PATH_RMTAB, &stb) < 0) {
194
 
                xlog(L_ERROR, "can't stat %s", _PATH_RMTAB);
 
191
                xlog(L_ERROR, "can't stat %s: %s",
 
192
                                _PATH_RMTAB, strerror(errno));
 
193
                xfunlock(lockid);
195
194
                return NULL;
196
195
        }
197
196
        if (stb.st_mtime != last_mtime) {