diff --git a/ChangeLog b/ChangeLog index 54bb813..6893058 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +0.3.0+ + cifs,smbfs use guest option when no user specified + sshfs add port as option 0.3.0 2012-07-13: cifs,ftpfs dont quote username, double quote password #3 default udevil.conf: allow option flush diff --git a/etc/udevil.conf b/etc/udevil.conf index 9f0e8e0..912660f 100644 --- a/etc/udevil.conf +++ b/etc/udevil.conf @@ -241,7 +241,7 @@ allowed_options = nosuid, noexec, nodev, noatime, fmask=0022, dmask=00 allowed_options_nfs = nosuid, noexec, nodev, noatime, ro, rw, sync, remount, port=*, rsize=*, wsize=*, hard, proto=*, timeo=*, retrans=* allowed_options_cifs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, uid=$UID, gid=$GID, credentials=* allowed_options_smbfs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, uid=$UID, gid=$GID, credentials=* -allowed_options_sshfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, idmap=user, BatchMode=yes +allowed_options_sshfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, idmap=user, BatchMode=yes, port=* allowed_options_curlftpfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other allowed_options_ftpfs = nosuid, noexec, nodev, noatime, ro, rw, port=*, user=*, pass=*, ip=*, root=*, uid=$UID, gid=$GID diff --git a/src/udevil.c b/src/udevil.c index 97696d0..34a1a43 100644 --- a/src/udevil.c +++ b/src/udevil.c @@ -2386,13 +2386,12 @@ static int parse_network_url( const char* url, const char* fstype, else if ( !g_strcmp0( nm->fstype, "ftpfs" ) ) nm->url = g_strdup( "none" ); else if ( !g_strcmp0( nm->fstype, "sshfs" ) ) - nm->url = g_strdup_printf( "sshfs#%s%s%s%s%s:%s%s", + nm->url = g_strdup_printf( "sshfs#%s%s%s%s%s:%s", nm->user ? nm->user : "", nm->pass ? ":" : "", nm->pass ? nm->pass : "", nm->user || nm->pass ? "@" : "", nm->host, - nm->port ? nm->port : "", nm->path ? nm->path : "/" ); else nm->url = g_strdup( trim_url ); @@ -3316,6 +3315,12 @@ _get_type: net_opts = g_strdup_printf( "%s,user=%s", str, netmount->user ); g_free( str ); } + else + { + str = net_opts; + net_opts = g_strdup_printf( "%s,guest", str ); + g_free( str ); + } if ( netmount->pass ) { str = net_opts; @@ -3329,6 +3334,11 @@ _get_type: g_free( str ); } } + else if ( !strcmp( fstype, "sshfs" ) ) + { + if ( netmount->port ) + net_opts = g_strdup_printf( "port=%s", netmount->port ); + } if ( net_opts && net_opts[0] != '\0' ) { if ( options )