Diff

Differences From Artifact [647fdab61a]:

To Artifact [6b6df68529]:


     1      1   /*
     2         - * Copyright (c) 2014  Roy Keene
            2  + * Copyright (c) 2014, 2015  Roy Keene
     3      3    *
     4      4    * Permission is hereby granted, free of charge, to any person obtaining a copy
     5      5    * of this software and associated documentation files (the "Software"), to deal
     6      6    * in the Software without restriction, including without limitation the rights
     7      7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     8      8    * copies of the Software, and to permit persons to whom the Software is
     9      9    * furnished to do so, subject to the following conditions:
................................................................................
   530    530   	}
   531    531   
   532    532   	return(ctx->uid);
   533    533   }
   534    534   
   535    535   /*
   536    536    * Determine the GID for the user making the current FUSE filesystem request.
   537         - * This will be used to lookup the user's home directory so we can search for
   538         - * locally modified files.
   539    537    */
   540    538   static gid_t appfs_get_fsgid(void) {
   541    539   	struct fuse_context *ctx;
   542    540   
   543    541   	if (!appfs_fuse_started) {
   544    542   		return(getgid());
   545    543   	}
................................................................................
  1416   1414   		APPFS_DEBUG("error: open failed");
  1417   1415   
  1418   1416   		return(errno * -1);
  1419   1417   	}
  1420   1418   
  1421   1419   	fi->fh = fh;
  1422   1420   
         1421  +	APPFS_DEBUG("Opened \"%s\" (for \"%s\") with file descriptor %i", real_path, path, fh);
         1422  +
  1423   1423   	return(0);
  1424   1424   }
  1425   1425   
  1426   1426   static int appfs_fuse_close(const char *path, struct fuse_file_info *fi) {
  1427   1427   	int close_ret;
  1428   1428   
  1429   1429   	appfs_get_path_info_cache_rm(path, appfs_get_fsuid());
................................................................................
  1438   1438   	return(0);
  1439   1439   }
  1440   1440   
  1441   1441   static int appfs_fuse_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi) {
  1442   1442   	ssize_t read_ret;
  1443   1443   	int retval;
  1444   1444   
  1445         -	APPFS_DEBUG("Enter (path = %s, buf, %lli, %lli, fd=%lli)", path, (long long) size, (long long) offset, (long long) fi->fh);
         1445  +	APPFS_DEBUG("Enter (path = %s, buf, size = %lli, offset = %lli, fd = %lli)", path, (long long) size, (long long) offset, (long long) fi->fh);
  1446   1446   
  1447   1447   	retval = 0;
  1448   1448   
  1449   1449   	while (size != 0) {
  1450   1450   		read_ret = pread(fi->fh, buf, size, offset);
  1451   1451   
  1452   1452   		if (read_ret < 0) {
................................................................................
  2024   2024   #else
  2025   2025   	appfs_threaded_tcl = 0;
  2026   2026   #endif
  2027   2027   
  2028   2028   	/**
  2029   2029   	 ** Add FUSE arguments which we always supply
  2030   2030   	 **/
  2031         -	fuse_opt_add_arg(args, "-odefault_permissions,fsname=appfs,subtype=appfsd,use_ino,direct_io,entry_timeout=0,attr_timeout=0,big_writes,intr,hard_remove");
         2031  +	fuse_opt_add_arg(args, "-odefault_permissions,fsname=appfs,subtype=appfsd,use_ino,entry_timeout=0,attr_timeout=0,big_writes,intr,hard_remove");
  2032   2032   
  2033   2033   	if (getuid() == 0) {
  2034   2034   		fuse_opt_parse(args, NULL, NULL, NULL);
  2035   2035   		fuse_opt_add_arg(args, "-oallow_other");
  2036   2036   
  2037   2037   		/*
  2038   2038   		 * This should generally be avoided, but if there are security
................................................................................
  2067   2067   						APPFS_DEBUG("Passing option to FUSE: -s");
  2068   2068   
  2069   2069   						fuse_opt_parse(args, NULL, NULL, NULL);
  2070   2070   						fuse_opt_add_arg(args, "-s");
  2071   2071   
  2072   2072   						appfs_threaded_tcl = 0;
  2073   2073   					} else if (strcmp(optstr, "allow_other") == 0) {
  2074         -						APPFS_DEBUG("Passing option to FUSE: -o allow_Other");
         2074  +						APPFS_DEBUG("Passing option to FUSE: -o allow_other");
  2075   2075   
  2076   2076   						fuse_opt_parse(args, NULL, NULL, NULL);
  2077   2077   						fuse_opt_add_arg(args, "-oallow_other");
  2078   2078   					} else if (strcmp(optstr, "rw") == 0) {
  2079   2079   						/* Ignored */
  2080   2080   					} else {
  2081   2081   						fprintf(stderr, "appfsd: invalid option: \"-o %s\"\n", optstr);