fixmount.c (38495) | fixmount.c (38500) |
---|---|
1/* 2 * Copyright (c) 1997-1998 Erez Zadok 3 * Copyright (c) 1990 Jan-Simon Pendry 4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 5 * Copyright (c) 1990 The Regents of the University of California. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 24 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * %W% (Berkeley) %G% 40 * | 1/* 2 * Copyright (c) 1997-1998 Erez Zadok 3 * Copyright (c) 1990 Jan-Simon Pendry 4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 5 * Copyright (c) 1990 The Regents of the University of California. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 24 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * %W% (Berkeley) %G% 40 * |
41 * $Id: fixmount.c,v 5.2.2.2 1992/05/31 16:35:45 jsp Exp $ | 41 * $Id: fixmount.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $ |
42 * 43 */ 44 45#ifdef HAVE_CONFIG_H 46# include <config.h> 47#endif /* HAVE_CONFIG_H */ 48#include <am_defs.h> 49 --- 13 unchanged lines hidden (view full) --- 63#define DOREMOVE 0x4 64#define DOVERIFY 0x8 65#define DOREMALL 0x10 66 67extern int fixmount_check_mount(char *host, struct in_addr hostaddr, char *path); 68 69static char dir_path[NFS_MAXPATHLEN]; 70static char localhost[] = "localhost"; | 42 * 43 */ 44 45#ifdef HAVE_CONFIG_H 46# include <config.h> 47#endif /* HAVE_CONFIG_H */ 48#include <am_defs.h> 49 --- 13 unchanged lines hidden (view full) --- 63#define DOREMOVE 0x4 64#define DOVERIFY 0x8 65#define DOREMALL 0x10 66 67extern int fixmount_check_mount(char *host, struct in_addr hostaddr, char *path); 68 69static char dir_path[NFS_MAXPATHLEN]; 70static char localhost[] = "localhost"; |
71static char thishost[MAXHOSTNAMELEN] = ""; | 71static char thishost[MAXHOSTNAMELEN + 1] = ""; |
72static exports mntexports; 73static int quiet = 0; 74static int type = 0; 75static jmp_buf before_rpc; 76static mountlist mntdump; 77static struct in_addr thisaddr; 78static CLIENT *clnt_create_timeout(char *, struct timeval *); 79 --- 203 unchanged lines hidden (view full) --- 283 extern int optind; 284 groups grp; 285 int ch; 286 int force = 0; 287 int morethanone; 288 register int rpcs = 0; 289 struct timeval tv; 290 | 72static exports mntexports; 73static int quiet = 0; 74static int type = 0; 75static jmp_buf before_rpc; 76static mountlist mntdump; 77static struct in_addr thisaddr; 78static CLIENT *clnt_create_timeout(char *, struct timeval *); 79 --- 203 unchanged lines hidden (view full) --- 283 extern int optind; 284 groups grp; 285 int ch; 286 int force = 0; 287 int morethanone; 288 register int rpcs = 0; 289 struct timeval tv; 290 |
291 while ((ch = getopt(argc, argv, "adervAqfh:")) != EOF) | 291 while ((ch = getopt(argc, argv, "adervAqfh:")) != -1) |
292 switch ((char) ch) { 293 294 case 'a': 295 if (type == 0) { 296 type = ALL; 297 rpcs |= DODUMP; 298 } else 299 usage(); --- 49 unchanged lines hidden (view full) --- 349 350 if (!*thishost) { 351 struct hostent *he; 352 353 if (gethostname(thishost, sizeof(thishost)) < 0) { 354 perror("gethostname"); 355 exit(1); 356 } | 292 switch ((char) ch) { 293 294 case 'a': 295 if (type == 0) { 296 type = ALL; 297 rpcs |= DODUMP; 298 } else 299 usage(); --- 49 unchanged lines hidden (view full) --- 349 350 if (!*thishost) { 351 struct hostent *he; 352 353 if (gethostname(thishost, sizeof(thishost)) < 0) { 354 perror("gethostname"); 355 exit(1); 356 } |
357 thishost[sizeof(thishost) - 1] = '\0'; |
|
357 358 /* 359 * We need the hostname as it appears to the other side's 360 * mountd, so get our own hostname by reverse address 361 * resolution. 362 */ 363 if (!(he = gethostbyname(thishost))) { 364 fprintf(stderr, "gethostbyname failed on %s\n", --- 248 unchanged lines hidden --- | 358 359 /* 360 * We need the hostname as it appears to the other side's 361 * mountd, so get our own hostname by reverse address 362 * resolution. 363 */ 364 if (!(he = gethostbyname(thishost))) { 365 fprintf(stderr, "gethostbyname failed on %s\n", --- 248 unchanged lines hidden --- |