cifs,smbfs use guest option when no user specified; sshfs add port as option

This commit is contained in:
IgnorantGuru 2012-07-14 07:50:02 -06:00
parent 29d45c45de
commit b28f39ed4a
3 changed files with 16 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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 )