Deleted Added
full compact
parsenfsfh.c (26183) parsenfsfh.c (39300)
1/*
2 * parsenfsfh.c - portable parser for NFS file handles
3 * uses all sorts of heuristics
4 *
5 * Jeffrey C. Mogul
6 * Digital Equipment Corporation
7 * Western Research Laboratory
8 */
9
10#ifndef lint
11static const char rcsid[] =
1/*
2 * parsenfsfh.c - portable parser for NFS file handles
3 * uses all sorts of heuristics
4 *
5 * Jeffrey C. Mogul
6 * Digital Equipment Corporation
7 * Western Research Laboratory
8 */
9
10#ifndef lint
11static const char rcsid[] =
12 "@(#) $Header: parsenfsfh.c,v 1.12 96/12/10 23:25:50 leres Exp $ (LBL)";
12 "@(#) $Header: parsenfsfh.c,v 1.14 97/06/15 13:20:27 leres Exp $ (LBL)";
13#endif
14
15#include <sys/types.h>
16#include <sys/time.h>
17
18#include <ctype.h>
13#endif
14
15#include <sys/types.h>
16#include <sys/time.h>
17
18#include <ctype.h>
19#ifdef HAVE_MEMORY_H
19#include <memory.h>
20#include <memory.h>
21#endif
20#include <stdio.h>
21#include <string.h>
22
23#include "interface.h"
24#include "nfsfh.h"
25
26/*
27 * This routine attempts to parse a file handle (in network byte order),

--- 280 unchanged lines hidden (view full) ---

308 *osnamep = "Ultrix";
309 break;
310
311 case FHT_VMSUCX:
312 /* No numeric file system ID, so hash on the device-name */
313 if (sizeof(*fsidp) >= 14) {
314 if (sizeof(*fsidp) > 14)
315 memset((char *)fsidp, 0, sizeof(*fsidp));
22#include <stdio.h>
23#include <string.h>
24
25#include "interface.h"
26#include "nfsfh.h"
27
28/*
29 * This routine attempts to parse a file handle (in network byte order),

--- 280 unchanged lines hidden (view full) ---

310 *osnamep = "Ultrix";
311 break;
312
313 case FHT_VMSUCX:
314 /* No numeric file system ID, so hash on the device-name */
315 if (sizeof(*fsidp) >= 14) {
316 if (sizeof(*fsidp) > 14)
317 memset((char *)fsidp, 0, sizeof(*fsidp));
316 memcpy((char *)fsidp, fh, 14); /* just use the whole thing */
318 /* just use the whole thing */
319 memcpy((char *)fsidp, (char *)fh, 14);
317 }
318 else {
319 u_int32_t tempa[4]; /* at least 16 bytes, maybe more */
320
321 memset((char *)tempa, 0, sizeof(tempa));
320 }
321 else {
322 u_int32_t tempa[4]; /* at least 16 bytes, maybe more */
323
324 memset((char *)tempa, 0, sizeof(tempa));
322 memcpy((char *)tempa, fh, 14); /* ensure alignment */
325 memcpy((char *)tempa, (char *)fh, 14); /* ensure alignment */
323 fsidp->Fsid_dev.Minor = tempa[0] + (tempa[1]<<1);
324 fsidp->Fsid_dev.Major = tempa[2] + (tempa[3]<<1);
325 fsidp->fsid_code = 0;
326 }
327
328 /* VMS file ID is: (RVN, FidHi, FidLo) */
329 *inop = make_uint32(fhp[26], fhp[27], fhp[23], fhp[22]);
330

--- 91 unchanged lines hidden ---
326 fsidp->Fsid_dev.Minor = tempa[0] + (tempa[1]<<1);
327 fsidp->Fsid_dev.Major = tempa[2] + (tempa[3]<<1);
328 fsidp->fsid_code = 0;
329 }
330
331 /* VMS file ID is: (RVN, FidHi, FidLo) */
332 *inop = make_uint32(fhp[26], fhp[27], fhp[23], fhp[22]);
333

--- 91 unchanged lines hidden ---