aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
authorJulio Merino <jmmv@meroh.net>2016-02-08 21:10:48 -0500
committerJulio Merino <jmmv@meroh.net>2016-02-08 21:10:48 -0500
commit9b4ca1aadefbb75ab4051e0b0e9173709456f7fb (patch)
treee7f4f74ed91779bdde639cc35a12a7ab27626334 /sshfs.c
parenta03d3eab39b265fb9fcb5287d81061e7957f355a (diff)
downloadsshfs-9b4ca1aadefbb75ab4051e0b0e9173709456f7fb.tar
sshfs-9b4ca1aadefbb75ab4051e0b0e9173709456f7fb.tar.gz
sshfs-9b4ca1aadefbb75ab4051e0b0e9173709456f7fb.tar.bz2
sshfs-9b4ca1aadefbb75ab4051e0b0e9173709456f7fb.zip
Avoid using cpp for sshfs.1 generation
Move the logic to determine which values to stick into the manual page to the configure script and replace the logic to build the sshfs.1 manual page with sed instead of abusing cpp. I'm not using AC_OUTPUT here because this macro is typically used to generate support build files. Final artifacts of the build should, in general, be built by the Makefile itself.
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sshfs.c b/sshfs.c
index 64c1d8c..6d5e083 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -3413,14 +3413,9 @@ static void usage(const char *progname)
" [no]nodelaysrv set nodelay tcp flag in sshd (default: off)\n"
" [no]truncate fix truncate for old servers (default: off)\n"
" [no]buflimit fix buffer fillup bug in server (default: on)\n"
-" -o idmap=TYPE user/group ID mapping, possible types are:\n"
-#ifdef __APPLE__
+" -o idmap=TYPE user/group ID mapping (default: " IDMAP_DEFAULT ")\n"
" none no translation of the ID space\n"
-" user only translate UID/GID of connecting user (default)\n"
-#else
-" none no translation of the ID space (default)\n"
-" user only translate UID of connecting user\n"
-#endif
+" user only translate UID/GID of connecting user\n"
" file translate UIDs/GIDs contained in uidfile/gidfile\n"
" -o uidfile=FILE file containing username:remote_uid mappings\n"
" -o gidfile=FILE file containing groupname:remote_gid mappings\n"
@@ -3975,11 +3970,15 @@ int main(int argc, char *argv[])
sshfs.delay_connect = 0;
sshfs.slave = 0;
sshfs.detect_uid = 0;
-#ifdef __APPLE__
- sshfs.idmap = IDMAP_USER;
-#else
- sshfs.idmap = IDMAP_NONE;
-#endif
+ if (strcmp(IDMAP_DEFAULT, "none") == 0) {
+ sshfs.idmap = IDMAP_NONE;
+ } else if (strcmp(IDMAP_DEFAULT, "user") == 0) {
+ sshfs.idmap = IDMAP_USER;
+ } else {
+ fprintf(stderr, "bad idmap default value built into sshfs; "
+ "assuming none (bad logic in configure script?)\n");
+ sshfs.idmap = IDMAP_NONE;
+ }
sshfs.nomap = NOMAP_ERROR;
ssh_add_arg("ssh");
ssh_add_arg("-x");