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
8980e78c
Commit
8980e78c
authored
Mar 13, 2015
by
Petri Hintukainen
Committed by
Jean-Baptiste Kempf
Mar 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sftp: add options for username and password
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
4072c19a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
modules/access/sftp.c
modules/access/sftp.c
+18
-4
No files found.
modules/access/sftp.c
View file @
8980e78c
...
@@ -52,6 +52,12 @@ static void Close( vlc_object_t* );
...
@@ -52,6 +52,12 @@ static void Close( vlc_object_t* );
#define PORT_LONGTEXT N_("SFTP port number to use on the server")
#define PORT_LONGTEXT N_("SFTP port number to use on the server")
#define MTU_TEXT N_("Read size")
#define MTU_TEXT N_("Read size")
#define MTU_LONGTEXT N_("Size of the request for reading access")
#define MTU_LONGTEXT N_("Size of the request for reading access")
#define USER_TEXT N_("SFTP user name")
#define USER_LONGTEXT N_("Sets the username for the connection, " \
"if no username or password are set in the url.")
#define PASS_TEXT N_("SFTP password")
#define PASS_LONGTEXT N_("Sets the password for the connection, " \
"if no username or password are set in the url.")
vlc_module_begin
()
vlc_module_begin
()
set_shortname
(
"SFTP"
)
set_shortname
(
"SFTP"
)
...
@@ -61,6 +67,8 @@ vlc_module_begin ()
...
@@ -61,6 +67,8 @@ vlc_module_begin ()
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
add_integer
(
"sftp-readsize"
,
8192
,
MTU_TEXT
,
MTU_LONGTEXT
,
true
)
add_integer
(
"sftp-readsize"
,
8192
,
MTU_TEXT
,
MTU_LONGTEXT
,
true
)
add_integer
(
"sftp-port"
,
22
,
PORT_TEXT
,
PORT_LONGTEXT
,
true
)
add_integer
(
"sftp-port"
,
22
,
PORT_TEXT
,
PORT_LONGTEXT
,
true
)
add_string
(
"sftp-user"
,
NULL
,
USER_TEXT
,
USER_LONGTEXT
,
false
)
add_password
(
"sftp-pwd"
,
NULL
,
PASS_TEXT
,
PASS_LONGTEXT
,
false
)
add_shortcut
(
"sftp"
)
add_shortcut
(
"sftp"
)
set_callbacks
(
Open
,
Close
)
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
vlc_module_end
()
...
@@ -120,13 +128,19 @@ static int Open( vlc_object_t* p_this )
...
@@ -120,13 +128,19 @@ static int Open( vlc_object_t* p_this )
goto
error
;
goto
error
;
}
}
/* If the user name is empty, ask the user */
/* get user/password from url or options */
if
(
!
EMPTY_STR
(
url
.
psz_username
)
&&
url
.
psz_password
)
if
(
!
EMPTY_STR
(
url
.
psz_username
)
)
{
psz_username
=
strdup
(
url
.
psz_username
);
psz_username
=
strdup
(
url
.
psz_username
);
else
psz_username
=
var_InheritString
(
p_access
,
"sftp-user"
);
if
(
url
.
psz_password
)
psz_password
=
strdup
(
url
.
psz_password
);
psz_password
=
strdup
(
url
.
psz_password
);
}
else
else
psz_password
=
var_InheritString
(
p_access
,
"sftp-pwd"
);
/* If the user name or password is empty, ask the user */
if
(
EMPTY_STR
(
psz_username
)
||
!
psz_password
)
{
{
dialog_Login
(
p_access
,
&
psz_username
,
&
psz_password
,
dialog_Login
(
p_access
,
&
psz_username
,
&
psz_password
,
_
(
"SFTP authentication"
),
_
(
"SFTP authentication"
),
...
...
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