Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
324c7dca
Commit
324c7dca
authored
Aug 20, 2002
by
Austin Clements
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed error in doaccounts when SFS isn't running
parent
dfc05da2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
126 deletions
+130
-126
tmcd/common/libsetup.pm
tmcd/common/libsetup.pm
+65
-63
tmcd/libsetup.pm
tmcd/libsetup.pm
+65
-63
No files found.
tmcd/common/libsetup.pm
View file @
324c7dca
...
@@ -1139,74 +1139,76 @@ sub doaccounts()
...
@@ -1139,74 +1139,76 @@ sub doaccounts()
#
#
# Create sfs_users file and populate it with public SFS keys
# Create sfs_users file and populate it with public SFS keys
#
#
do
{
if
(
$USESFS
)
{
if
(
!
open
(
SFSKEYS
,
"
> /etc/sfs/sfs_users.new
"))
{
do
{
warn
("
*** WARNING: Could not open /etc/sfs/sfs_users.new: $!
\n
");
if
(
!
open
(
SFSKEYS
,
"
> /etc/sfs/sfs_users.new
"))
{
next
;
warn
("
*** WARNING: Could not open /etc/sfs/sfs_users.new: $!
\n
");
}
next
;
}
print
SFSKEYS
"
#
\n
";
print
SFSKEYS
"
# DO NOT EDIT! This file auto generated by
"
.
print
SFSKEYS
"
#
\n
";
"
Emulab.Net account software.
\n
";
print
SFSKEYS
"
# DO NOT EDIT! This file auto generated by
"
.
print
SFSKEYS
"
#
\n
";
"
Emulab.Net account software.
\n
";
print
SFSKEYS
"
# Please use the web interface to edit your
"
.
print
SFSKEYS
"
#
\n
";
"
SFS public key list.
\n
";
print
SFSKEYS
"
# Please use the web interface to edit your
"
.
print
SFSKEYS
"
#
\n
";
"
SFS public key list.
\n
";
foreach
my
$key
(
@sfskeys
)
{
print
SFSKEYS
"
#
\n
";
print
SFSKEYS
"
$key
\n
";
foreach
my
$key
(
@sfskeys
)
{
}
print
SFSKEYS
"
$key
\n
";
close
(
SFSKEYS
);
}
close
(
SFSKEYS
);
# Because sfs_users only contains public keys, sfs_users.pub is
# exactly the same
# Because sfs_users only contains public keys, sfs_users.pub is
if
(
system
("
cp -p -f /etc/sfs/sfs_users.new
"
.
# exactly the same
"
/etc/sfs/sfs_users.pub.new
"))
{
if
(
system
("
cp -p -f /etc/sfs/sfs_users.new
"
.
warn
("
*** Could not copy /etc/sfs/sfs_users.new to
"
.
"
/etc/sfs/sfs_users.pub.new
"))
{
"
sfs_users.pub.new: $!
\n
");
warn
("
*** Could not copy /etc/sfs/sfs_users.new to
"
.
next
;
"
sfs_users.pub.new: $!
\n
");
}
next
;
}
if
(
!
chown
(
0
,
0
,
"
/etc/sfs/sfs_users.new
"))
{
warn
("
*** WARNING: Could not chown /etc/sfs/sfs_users.new: $!
\n
");
if
(
!
chown
(
0
,
0
,
"
/etc/sfs/sfs_users.new
"))
{
next
;
warn
("
*** WARNING: Could not chown /etc/sfs/sfs_users.new: $!
\n
");
}
next
;
if
(
!
chmod
(
0600
,
"
/etc/sfs/sfs_users.new
"))
{
}
warn
("
*** WARNING: Could not chmod /etc/sfs/sfs_users.new: $!
\n
");
if
(
!
chmod
(
0600
,
"
/etc/sfs/sfs_users.new
"))
{
next
;
warn
("
*** WARNING: Could not chmod /etc/sfs/sfs_users.new: $!
\n
");
}
next
;
}
if
(
!
chown
(
0
,
0
,
"
/etc/sfs/sfs_users.pub.new
"))
{
warn
("
*** WARNING: Could not chown /etc/sfs/sfs_users.pub.new: $!
\n
");
if
(
!
chown
(
0
,
0
,
"
/etc/sfs/sfs_users.pub.new
"))
{
next
;
warn
("
*** WARNING: Could not chown /etc/sfs/sfs_users.pub.new: $!
\n
");
}
next
;
if
(
!
chmod
(
0644
,
"
/etc/sfs/sfs_users.pub.new
"))
{
}
warn
("
*** WARNING: Could not chmod /etc/sfs/sfs_users.pub.new: $!
\n
");
if
(
!
chmod
(
0644
,
"
/etc/sfs/sfs_users.pub.new
"))
{
next
;
warn
("
*** WARNING: Could not chmod /etc/sfs/sfs_users.pub.new: $!
\n
");
}
next
;
}
# Save off old key files and move in new ones
foreach
my
$keyfile
("
/etc/sfs/sfs_users
",
# Save off old key files and move in new ones
"
/etc/sfs/sfs_users.pub
")
{
foreach
my
$keyfile
("
/etc/sfs/sfs_users
",
if
(
-
e
$keyfile
)
{
"
/etc/sfs/sfs_users.pub
")
{
if
(
system
("
cp -p -f
$keyfile
$keyfile
.old
"))
{
if
(
-
e
$keyfile
)
{
warn
("
*** Could not save off
$keyfile
: $!
\n
");
if
(
system
("
cp -p -f
$keyfile
$keyfile
.old
"))
{
next
;
warn
("
*** Could not save off
$keyfile
: $!
\n
");
}
next
;
if
(
!
chown
(
0
,
0
,
"
$keyfile
"))
{
}
warn
("
*** Could not chown
$keyfile
: $!
\n
");
if
(
!
chown
(
0
,
0
,
"
$keyfile
"))
{
warn
("
*** Could not chown
$keyfile
: $!
\n
");
}
if
(
!
chmod
(
0600
,
"
$keyfile
"))
{
warn
("
*** Could not chmod
$keyfile
: $!
\n
");
}
}
}
if
(
!
chmod
(
0600
,
"
$keyfile
"))
{
if
(
system
("
mv -f
$keyfile
.new
$keyfile
"))
{
warn
("
*** Could not
chmod
$keyfile
: $
!
\n
");
warn
("
*** Could not
mv
$keyfile
: ~
!
\n
");
}
}
}
}
if
(
system
("
mv -f
$keyfile
.new
$keyfile
"))
{
warn
("
*** Could not mv
$keyfile
: ~!
\n
");
# The do-while is an easy way out in case of errors
}
}
}
while
0
;
# The do-while is an easy way out in case of errors
}
}
while
0
;
return
0
;
return
0
;
}
}
...
...
tmcd/libsetup.pm
View file @
324c7dca
...
@@ -1139,74 +1139,76 @@ sub doaccounts()
...
@@ -1139,74 +1139,76 @@ sub doaccounts()
#
#
# Create sfs_users file and populate it with public SFS keys
# Create sfs_users file and populate it with public SFS keys
#
#
do
{
if
(
$USESFS
)
{
if
(
!
open
(
SFSKEYS
,
"
> /etc/sfs/sfs_users.new
"))
{
do
{
warn
("
*** WARNING: Could not open /etc/sfs/sfs_users.new: $!
\n
");
if
(
!
open
(
SFSKEYS
,
"
> /etc/sfs/sfs_users.new
"))
{
next
;
warn
("
*** WARNING: Could not open /etc/sfs/sfs_users.new: $!
\n
");
}
next
;
}
print
SFSKEYS
"
#
\n
";
print
SFSKEYS
"
# DO NOT EDIT! This file auto generated by
"
.
print
SFSKEYS
"
#
\n
";
"
Emulab.Net account software.
\n
";
print
SFSKEYS
"
# DO NOT EDIT! This file auto generated by
"
.
print
SFSKEYS
"
#
\n
";
"
Emulab.Net account software.
\n
";
print
SFSKEYS
"
# Please use the web interface to edit your
"
.
print
SFSKEYS
"
#
\n
";
"
SFS public key list.
\n
";
print
SFSKEYS
"
# Please use the web interface to edit your
"
.
print
SFSKEYS
"
#
\n
";
"
SFS public key list.
\n
";
foreach
my
$key
(
@sfskeys
)
{
print
SFSKEYS
"
#
\n
";
print
SFSKEYS
"
$key
\n
";
foreach
my
$key
(
@sfskeys
)
{
}
print
SFSKEYS
"
$key
\n
";
close
(
SFSKEYS
);
}
close
(
SFSKEYS
);
# Because sfs_users only contains public keys, sfs_users.pub is
# exactly the same
# Because sfs_users only contains public keys, sfs_users.pub is
if
(
system
("
cp -p -f /etc/sfs/sfs_users.new
"
.
# exactly the same
"
/etc/sfs/sfs_users.pub.new
"))
{
if
(
system
("
cp -p -f /etc/sfs/sfs_users.new
"
.
warn
("
*** Could not copy /etc/sfs/sfs_users.new to
"
.
"
/etc/sfs/sfs_users.pub.new
"))
{
"
sfs_users.pub.new: $!
\n
");
warn
("
*** Could not copy /etc/sfs/sfs_users.new to
"
.
next
;
"
sfs_users.pub.new: $!
\n
");
}
next
;
}
if
(
!
chown
(
0
,
0
,
"
/etc/sfs/sfs_users.new
"))
{
warn
("
*** WARNING: Could not chown /etc/sfs/sfs_users.new: $!
\n
");
if
(
!
chown
(
0
,
0
,
"
/etc/sfs/sfs_users.new
"))
{
next
;
warn
("
*** WARNING: Could not chown /etc/sfs/sfs_users.new: $!
\n
");
}
next
;
if
(
!
chmod
(
0600
,
"
/etc/sfs/sfs_users.new
"))
{
}
warn
("
*** WARNING: Could not chmod /etc/sfs/sfs_users.new: $!
\n
");
if
(
!
chmod
(
0600
,
"
/etc/sfs/sfs_users.new
"))
{
next
;
warn
("
*** WARNING: Could not chmod /etc/sfs/sfs_users.new: $!
\n
");
}
next
;
}
if
(
!
chown
(
0
,
0
,
"
/etc/sfs/sfs_users.pub.new
"))
{
warn
("
*** WARNING: Could not chown /etc/sfs/sfs_users.pub.new: $!
\n
");
if
(
!
chown
(
0
,
0
,
"
/etc/sfs/sfs_users.pub.new
"))
{
next
;
warn
("
*** WARNING: Could not chown /etc/sfs/sfs_users.pub.new: $!
\n
");
}
next
;
if
(
!
chmod
(
0644
,
"
/etc/sfs/sfs_users.pub.new
"))
{
}
warn
("
*** WARNING: Could not chmod /etc/sfs/sfs_users.pub.new: $!
\n
");
if
(
!
chmod
(
0644
,
"
/etc/sfs/sfs_users.pub.new
"))
{
next
;
warn
("
*** WARNING: Could not chmod /etc/sfs/sfs_users.pub.new: $!
\n
");
}
next
;
}
# Save off old key files and move in new ones
foreach
my
$keyfile
("
/etc/sfs/sfs_users
",
# Save off old key files and move in new ones
"
/etc/sfs/sfs_users.pub
")
{
foreach
my
$keyfile
("
/etc/sfs/sfs_users
",
if
(
-
e
$keyfile
)
{
"
/etc/sfs/sfs_users.pub
")
{
if
(
system
("
cp -p -f
$keyfile
$keyfile
.old
"))
{
if
(
-
e
$keyfile
)
{
warn
("
*** Could not save off
$keyfile
: $!
\n
");
if
(
system
("
cp -p -f
$keyfile
$keyfile
.old
"))
{
next
;
warn
("
*** Could not save off
$keyfile
: $!
\n
");
}
next
;
if
(
!
chown
(
0
,
0
,
"
$keyfile
"))
{
}
warn
("
*** Could not chown
$keyfile
: $!
\n
");
if
(
!
chown
(
0
,
0
,
"
$keyfile
"))
{
warn
("
*** Could not chown
$keyfile
: $!
\n
");
}
if
(
!
chmod
(
0600
,
"
$keyfile
"))
{
warn
("
*** Could not chmod
$keyfile
: $!
\n
");
}
}
}
if
(
!
chmod
(
0600
,
"
$keyfile
"))
{
if
(
system
("
mv -f
$keyfile
.new
$keyfile
"))
{
warn
("
*** Could not
chmod
$keyfile
: $
!
\n
");
warn
("
*** Could not
mv
$keyfile
: ~
!
\n
");
}
}
}
}
if
(
system
("
mv -f
$keyfile
.new
$keyfile
"))
{
warn
("
*** Could not mv
$keyfile
: ~!
\n
");
# The do-while is an easy way out in case of errors
}
}
}
while
0
;
# The do-while is an easy way out in case of errors
}
}
while
0
;
return
0
;
return
0
;
}
}
...
...
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