Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
aa599c4b
Commit
aa599c4b
authored
Jan 07, 2016
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smb: factorize smb strings used by SMB and DSM modules
parent
5ba5b53f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
47 deletions
+47
-47
modules/access/dsm/access.c
modules/access/dsm/access.c
+6
-32
modules/access/smb.c
modules/access/smb.c
+7
-15
modules/access/smb_common.h
modules/access/smb_common.h
+34
-0
No files found.
modules/access/dsm/access.c
View file @
aa599c4b
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include <netdb.h>
#include <netdb.h>
#include <bdsm/bdsm.h>
#include <bdsm/bdsm.h>
#include "../smb_common.h"
/*****************************************************************************
/*****************************************************************************
* Module descriptor
* Module descriptor
...
@@ -56,18 +57,6 @@ static void Close( vlc_object_t * );
...
@@ -56,18 +57,6 @@ static void Close( vlc_object_t * );
#define vlc_sd_probe_Open bdsm_sd_probe_Open
#define vlc_sd_probe_Open bdsm_sd_probe_Open
#define USER_TEXT N_("Username")
#define USER_LONGTEXT N_("Username that will be used for the connection, " \
"if no username is set in the URL.")
#define PASS_TEXT N_("Password")
#define PASS_LONGTEXT N_("Password that will be used for the connection, " \
"if no username or password are set in URL.")
#define DOMAIN_TEXT N_("SMB domain")
#define DOMAIN_LONGTEXT N_("Domain/Workgroup that " \
"will be used for the connection. Domain of uri will also be tried.")
#define BDSM_LOGIN_DIALOG_RETRY 1
#define BDSM_HELP N_("libdsm's SMB (Windows network shares) input and browser")
#define BDSM_HELP N_("libdsm's SMB (Windows network shares) input and browser")
vlc_module_begin
()
vlc_module_begin
()
...
@@ -77,9 +66,9 @@ vlc_module_begin ()
...
@@ -77,9 +66,9 @@ vlc_module_begin ()
set_capability
(
"access"
,
20
)
set_capability
(
"access"
,
20
)
set_category
(
CAT_INPUT
)
set_category
(
CAT_INPUT
)
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
add_string
(
"smb-user"
,
NULL
,
USER_TEXT
,
USER_LONGTEXT
,
false
)
add_string
(
"smb-user"
,
NULL
,
SMB_USER_TEXT
,
SMB_
USER_LONGTEXT
,
false
)
add_password
(
"smb-pwd"
,
NULL
,
PASS_TEXT
,
PASS_LONGTEXT
,
false
)
add_password
(
"smb-pwd"
,
NULL
,
SMB_PASS_TEXT
,
SMB_
PASS_LONGTEXT
,
false
)
add_string
(
"smb-domain"
,
NULL
,
DOMAIN_TEXT
,
DOMAIN_LONGTEXT
,
false
)
add_string
(
"smb-domain"
,
NULL
,
SMB_DOMAIN_TEXT
,
SMB_
DOMAIN_LONGTEXT
,
false
)
add_shortcut
(
"smb"
,
"cifs"
)
add_shortcut
(
"smb"
,
"cifs"
)
set_callbacks
(
Open
,
Close
)
set_callbacks
(
Open
,
Close
)
...
@@ -131,14 +120,6 @@ struct access_sys_t
...
@@ -131,14 +120,6 @@ struct access_sys_t
smb_stat_list
files
;
smb_stat_list
files
;
};
};
/*****************************************************************************
* Dialog strings
*****************************************************************************/
#define BDSM_LOGIN_DIALOG_TITLE N_( "%s: Authentication required" )
#define BDSM_LOGIN_DIALOG_TEXT N_( "The computer you are trying to connect " \
"to requires authentication.\n Please provide a username (and ideally a " \
"domain name using the format DOMAIN;username)\n and a password." )
/*****************************************************************************
/*****************************************************************************
* Open: Initialize module's data structures and libdsm
* Open: Initialize module's data structures and libdsm
*****************************************************************************/
*****************************************************************************/
...
@@ -358,24 +339,17 @@ static int login( access_t *p_access )
...
@@ -358,24 +339,17 @@ static int login( access_t *p_access )
if
(
smb_connect
(
p_access
,
psz_login
,
psz_password
,
psz_domain
)
if
(
smb_connect
(
p_access
,
psz_login
,
psz_password
,
psz_domain
)
!=
VLC_SUCCESS
)
!=
VLC_SUCCESS
)
{
{
char
*
psz_title
;
if
(
asprintf
(
&
psz_title
,
BDSM_LOGIN_DIALOG_TITLE
,
p_sys
->
netbios_name
)
==
-
1
)
goto
error
;
while
(
vlc_credential_get
(
&
credential
,
p_access
,
"smb-user"
,
"smb-pwd"
,
while
(
vlc_credential_get
(
&
credential
,
p_access
,
"smb-user"
,
"smb-pwd"
,
psz_title
,
BDSM_LOGIN_DIALOG_TEXT
)
)
SMB_LOGIN_DIALOG_TITLE
,
SMB_LOGIN_DIALOG_TEXT
,
p_sys
->
netbios_name
)
)
{
{
psz_login
=
credential
.
psz_username
;
psz_login
=
credential
.
psz_username
;
psz_password
=
credential
.
psz_password
;
psz_password
=
credential
.
psz_password
;
psz_domain
=
credential
.
psz_realm
;
psz_domain
=
credential
.
psz_realm
;
if
(
smb_connect
(
p_access
,
psz_login
,
psz_password
,
psz_domain
)
if
(
smb_connect
(
p_access
,
psz_login
,
psz_password
,
psz_domain
)
==
VLC_SUCCESS
)
==
VLC_SUCCESS
)
{
free
(
psz_title
);
goto
success
;
goto
success
;
}
}
}
free
(
psz_title
);
msg_Err
(
p_access
,
"Unable to login with username = %s, domain = %s"
,
msg_Err
(
p_access
,
"Unable to login with username = %s, domain = %s"
,
p_sys
->
creds
.
login
,
p_sys
->
creds
.
domain
);
p_sys
->
creds
.
login
,
p_sys
->
creds
.
domain
);
...
...
modules/access/smb.c
View file @
aa599c4b
...
@@ -48,22 +48,14 @@
...
@@ -48,22 +48,14 @@
#include <vlc_access.h>
#include <vlc_access.h>
#include <vlc_input_item.h>
#include <vlc_input_item.h>
#include "smb_common.h"
/*****************************************************************************
/*****************************************************************************
* Module descriptor
* Module descriptor
*****************************************************************************/
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
#define USER_TEXT N_("Username")
#define USER_LONGTEXT N_("Username that will be used for the connection, " \
"if no username is set in the URL.")
#define PASS_TEXT N_("Password")
#define PASS_LONGTEXT N_("Password that will be used for the connection, " \
"if no username or password are set in URL.")
#define DOMAIN_TEXT N_("SMB domain")
#define DOMAIN_LONGTEXT N_("Domain/Workgroup that " \
"will be used for the connection.")
#define SMB_HELP N_("Samba (Windows network shares) input")
#define SMB_HELP N_("Samba (Windows network shares) input")
vlc_module_begin
()
vlc_module_begin
()
set_shortname
(
"SMB"
)
set_shortname
(
"SMB"
)
...
@@ -72,12 +64,12 @@ vlc_module_begin ()
...
@@ -72,12 +64,12 @@ vlc_module_begin ()
set_capability
(
"access"
,
0
)
set_capability
(
"access"
,
0
)
set_category
(
CAT_INPUT
)
set_category
(
CAT_INPUT
)
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
add_string
(
"smb-user"
,
NULL
,
USER_TEXT
,
USER_LONGTEXT
,
add_string
(
"smb-user"
,
NULL
,
SMB_USER_TEXT
,
SMB_
USER_LONGTEXT
,
false
)
false
)
add_password
(
"smb-pwd"
,
NULL
,
PASS_TEXT
,
add_password
(
"smb-pwd"
,
NULL
,
SMB_
PASS_TEXT
,
PASS_LONGTEXT
,
false
)
SMB_
PASS_LONGTEXT
,
false
)
add_string
(
"smb-domain"
,
NULL
,
DOMAIN_TEXT
,
add_string
(
"smb-domain"
,
NULL
,
SMB_
DOMAIN_TEXT
,
DOMAIN_LONGTEXT
,
false
)
SMB_
DOMAIN_LONGTEXT
,
false
)
add_shortcut
(
"smb"
)
add_shortcut
(
"smb"
)
set_callbacks
(
Open
,
Close
)
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
vlc_module_end
()
...
...
modules/access/smb_common.h
0 → 100644
View file @
aa599c4b
/*****************************************************************************
* smb_common.h: common strings used by SMB and DSM modules
*****************************************************************************
* Copyright (C) 2016 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#define SMB_USER_TEXT N_("Username")
#define SMB_USER_LONGTEXT N_("Username that will be used for the connection, " \
"if no username is set in the URL.")
#define SMB_PASS_TEXT N_("Password")
#define SMB_PASS_LONGTEXT N_("Password that will be used for the connection, " \
"if no username or password are set in URL.")
#define SMB_DOMAIN_TEXT N_("SMB domain")
#define SMB_DOMAIN_LONGTEXT N_("Domain/Workgroup that " \
"will be used for the connection.")
#define SMB_LOGIN_DIALOG_TITLE N_( "SMB authentication required" )
#define SMB_LOGIN_DIALOG_TEXT N_( "The computer (%s) you are trying to connect " \
"to requires authentication.\nPlease provide a username (and ideally a " \
"domain name using the format DOMAIN;username)\n and a password" )
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment