accept smb workgroup/user

This commit is contained in:
IgnorantGuru 2012-08-03 06:35:09 -06:00
parent 58231d1d29
commit 2eeb5f0535
3 changed files with 21 additions and 10 deletions

View File

@ -1,5 +1,6 @@
0.3.1+
added remove to remove devices safely (under development)
accept smb workgroup/user
0.3.1 2012-07-25:
cifs,smbfs use guest option when no user specified
sshfs add port as option

View File

@ -240,8 +240,8 @@ default_options_ramfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
# WARNING: OPTIONS HERE CAN CAUSE SERIOUS SECURITY PROBLEMS - CHOOSE CAREFULLY
allowed_options = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID, ro, rw, sync, flush, remount
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_cifs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=*
allowed_options_smbfs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, 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, 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

@ -2366,17 +2366,10 @@ static int parse_network_url( const char* url, const char* fstype,
{
xurl = str + 1;
}
while ( xurl[0] == '/' )
xurl++;
char* trim_url = g_strdup( xurl );
// path
if ( str = strchr( xurl, '/' ) )
{
nm->path = g_strdup( str );
str[0] = '\0';
}
// user:pass
if ( str = strchr( xurl, '@' ) )
{
@ -2391,6 +2384,12 @@ static int parse_network_url( const char* url, const char* fstype,
nm->user = g_strdup( xurl );
xurl = str + 1;
}
// path
if ( str = strchr( xurl, '/' ) )
{
nm->path = g_strdup( str );
str[0] = '\0';
}
// host:port
if ( xurl[0] == '[' )
{
@ -3376,7 +3375,17 @@ _get_type:
else if ( !strcmp( fstype, "smbfs" ) || !strcmp( fstype, "cifs" ) )
{
if ( netmount->user )
net_opts = g_strdup_printf( "user=%s", netmount->user );
{
if ( str = strchr( netmount->user, '/' ) )
{
// domain included DOMAIN/USER@HOST
str[0] = '\0';
net_opts = g_strdup_printf( "user=%s,domain=%s", str + 1, netmount->user );
str[0] = '/';
}
else
net_opts = g_strdup_printf( "user=%s", netmount->user );
}
else
net_opts = g_strdup( "" );
if ( netmount->pass )
@ -4540,6 +4549,7 @@ static void show_help()
printf( " udevil mount sys.domain:/share # %s\n", _("nfs share") );
printf( " udevil mount smb://sys.domain/share # %s\n", _("samba share w/ cifs") );
printf( " udevil mount smb://user:pass@10.0.0.1:50/share # %s\n", _("samba share w/ u/p/port") );
printf( " udevil mount smb://workgroup/user@sys.domain # %s\n", _("samba share w/ workgroup") );
printf( " udevil mount //sys.domain/share # %s\n", _("samba share w/ cifs") );
printf( " udevil mount //sys.domain/share -t smbfs # %s\n", _("samba share w/ smbfs") );
printf( " udevil mount ssh://user@sys.domain # %s\n", _("sshfs with user - ") );