Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
27e614dc
Commit
27e614dc
authored
Feb 18, 2005
by
petr@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new variant of passwd() by S. Vojtovich
parent
dbc0937d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
server-tools/instance-manager/Makefile.am
server-tools/instance-manager/Makefile.am
+1
-0
server-tools/instance-manager/options.cc
server-tools/instance-manager/options.cc
+11
-7
No files found.
server-tools/instance-manager/Makefile.am
View file @
27e614dc
...
@@ -36,6 +36,7 @@ liboptions_a_CPPFLAGS= $(CPPFLAGS) \
...
@@ -36,6 +36,7 @@ liboptions_a_CPPFLAGS= $(CPPFLAGS) \
-DPROTOCOL_VERSION
=
@PROTOCOL_VERSION@
-DPROTOCOL_VERSION
=
@PROTOCOL_VERSION@
liboptions_a_SOURCES
=
options.h options.cc priv.h priv.cc
liboptions_a_SOURCES
=
options.h options.cc priv.h priv.cc
liboptions_a_LIBADD
=
$(top_builddir)
/libmysql/get_password.
$(OBJEXT)
# MySQL sometimes uses symlinks to reuse code
# MySQL sometimes uses symlinks to reuse code
# All symlinked files are grouped in libnet.a
# All symlinked files are grouped in libnet.a
...
...
server-tools/instance-manager/options.cc
View file @
27e614dc
...
@@ -151,27 +151,31 @@ static void usage()
...
@@ -151,27 +151,31 @@ static void usage()
static
void
passwd
()
static
void
passwd
()
{
{
char
user
[
1024
],
pw
[
1024
],
*
p
;
char
user
[
1024
],
*
p
;
const
char
*
pw1
,
*
pw2
;
char
pw1msg
[]
=
"Enter password: "
;
char
pw2msg
[]
=
"Re-type password: "
;
char
crypted_pw
[
SCRAMBLED_PASSWORD_CHAR_LENGTH
+
1
];
char
crypted_pw
[
SCRAMBLED_PASSWORD_CHAR_LENGTH
+
1
];
fprintf
(
stderr
,
"Creating record for new user.
\n
"
);
fprintf
(
stderr
,
"Creating record for new user.
\n
"
);
fprintf
(
stderr
,
"Enter user name: "
);
fprintf
(
stderr
,
"Enter user name: "
);
if
(
!
fgets
(
user
,
sizeof
(
user
),
stdin
))
if
(
!
fgets
(
user
,
sizeof
(
user
),
stdin
))
{
{
fprintf
(
stderr
,
"Unable to read user.
\n
"
);
fprintf
(
stderr
,
"Unable to read user.
\n
"
);
return
;
return
;
}
}
if
((
p
=
strchr
(
user
,
'\n'
)))
*
p
=
0
;
if
((
p
=
strchr
(
user
,
'\n'
)))
*
p
=
0
;
fprintf
(
stderr
,
"Enter password: "
);
pw1
=
get_tty_password
(
pw1msg
);
if
(
!
fgets
(
pw
,
sizeof
(
pw
),
stdin
))
pw2
=
get_tty_password
(
pw2msg
);
if
(
strcmp
(
pw1
,
pw2
))
{
{
fprintf
(
stderr
,
"
Unable to read password
.
\n
"
);
fprintf
(
stderr
,
"
Sorry, passwords do not match
.
\n
"
);
return
;
return
;
}
}
if
((
p
=
strchr
(
pw
,
'\n'
)))
*
p
=
0
;
make_scrambled_password
(
crypted_pw
,
pw
);
make_scrambled_password
(
crypted_pw
,
pw
1
);
printf
(
"%s:%s
\n
"
,
user
,
crypted_pw
);
printf
(
"%s:%s
\n
"
,
user
,
crypted_pw
);
}
}
...
...
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