Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
324c7dca
Commit
324c7dca
authored
Aug 20, 2002
by
Austin Clements
Browse files
Fixed error in doaccounts when SFS isn't running
parent
dfc05da2
Changes
2
Hide whitespace changes
Inline
Side-by-side
tmcd/common/libsetup.pm
View file @
324c7dca
...
...
@@ -1139,74 +1139,76 @@ sub doaccounts()
#
# Create sfs_users file and populate it with public SFS keys
#
do
{
if
(
!
open
(
SFSKEYS
,
"
> /etc/sfs/sfs_users.new
"))
{
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
"
.
"
Emulab.Net account software.
\n
";
print
SFSKEYS
"
#
\n
";
print
SFSKEYS
"
# Please use the web interface to edit your
"
.
"
SFS public key list.
\n
";
print
SFSKEYS
"
#
\n
";
foreach
my
$key
(
@sfskeys
)
{
print
SFSKEYS
"
$key
\n
";
}
close
(
SFSKEYS
);
# Because sfs_users only contains public keys, sfs_users.pub is
# exactly the same
if
(
system
("
cp -p -f /etc/sfs/sfs_users.new
"
.
"
/etc/sfs/sfs_users.pub.new
"))
{
warn
("
*** Could not copy /etc/sfs/sfs_users.new to
"
.
"
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
");
next
;
}
if
(
!
chmod
(
0600
,
"
/etc/sfs/sfs_users.new
"))
{
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
");
next
;
}
if
(
!
chmod
(
0644
,
"
/etc/sfs/sfs_users.pub.new
"))
{
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
",
"
/etc/sfs/sfs_users.pub
")
{
if
(
-
e
$keyfile
)
{
if
(
system
("
cp -p -f
$keyfile
$keyfile
.old
"))
{
warn
("
*** Could not save off
$keyfile
: $!
\n
");
next
;
}
if
(
!
chown
(
0
,
0
,
"
$keyfile
"))
{
warn
("
*** Could not chown
$keyfile
: $!
\n
");
if
(
$USESFS
)
{
do
{
if
(
!
open
(
SFSKEYS
,
"
> /etc/sfs/sfs_users.new
"))
{
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
"
.
"
Emulab.Net account software.
\n
";
print
SFSKEYS
"
#
\n
";
print
SFSKEYS
"
# Please use the web interface to edit your
"
.
"
SFS public key list.
\n
";
print
SFSKEYS
"
#
\n
";
foreach
my
$key
(
@sfskeys
)
{
print
SFSKEYS
"
$key
\n
";
}
close
(
SFSKEYS
);
# Because sfs_users only contains public keys, sfs_users.pub is
# exactly the same
if
(
system
("
cp -p -f /etc/sfs/sfs_users.new
"
.
"
/etc/sfs/sfs_users.pub.new
"))
{
warn
("
*** Could not copy /etc/sfs/sfs_users.new to
"
.
"
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
");
next
;
}
if
(
!
chmod
(
0600
,
"
/etc/sfs/sfs_users.new
"))
{
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
");
next
;
}
if
(
!
chmod
(
0644
,
"
/etc/sfs/sfs_users.pub.new
"))
{
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
",
"
/etc/sfs/sfs_users.pub
")
{
if
(
-
e
$keyfile
)
{
if
(
system
("
cp -p -f
$keyfile
$keyfile
.old
"))
{
warn
("
*** Could not save off
$keyfile
: $!
\n
");
next
;
}
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
"))
{
warn
("
*** Could not
chmod
$keyfile
:
$
!
\n
");
if
(
system
("
mv -f
$keyfile
.new
$keyfile
"))
{
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
}
# The do-while is an easy way out in case of errors
while
0
;
}
while
0
;
return
0
;
}
...
...
tmcd/libsetup.pm
View file @
324c7dca
...
...
@@ -1139,74 +1139,76 @@ sub doaccounts()
#
# Create sfs_users file and populate it with public SFS keys
#
do
{
if
(
!
open
(
SFSKEYS
,
"
> /etc/sfs/sfs_users.new
"))
{
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
"
.
"
Emulab.Net account software.
\n
";
print
SFSKEYS
"
#
\n
";
print
SFSKEYS
"
# Please use the web interface to edit your
"
.
"
SFS public key list.
\n
";
print
SFSKEYS
"
#
\n
";
foreach
my
$key
(
@sfskeys
)
{
print
SFSKEYS
"
$key
\n
";
}
close
(
SFSKEYS
);
# Because sfs_users only contains public keys, sfs_users.pub is
# exactly the same
if
(
system
("
cp -p -f /etc/sfs/sfs_users.new
"
.
"
/etc/sfs/sfs_users.pub.new
"))
{
warn
("
*** Could not copy /etc/sfs/sfs_users.new to
"
.
"
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
");
next
;
}
if
(
!
chmod
(
0600
,
"
/etc/sfs/sfs_users.new
"))
{
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
");
next
;
}
if
(
!
chmod
(
0644
,
"
/etc/sfs/sfs_users.pub.new
"))
{
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
",
"
/etc/sfs/sfs_users.pub
")
{
if
(
-
e
$keyfile
)
{
if
(
system
("
cp -p -f
$keyfile
$keyfile
.old
"))
{
warn
("
*** Could not save off
$keyfile
: $!
\n
");
next
;
}
if
(
!
chown
(
0
,
0
,
"
$keyfile
"))
{
warn
("
*** Could not chown
$keyfile
: $!
\n
");
if
(
$USESFS
)
{
do
{
if
(
!
open
(
SFSKEYS
,
"
> /etc/sfs/sfs_users.new
"))
{
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
"
.
"
Emulab.Net account software.
\n
";
print
SFSKEYS
"
#
\n
";
print
SFSKEYS
"
# Please use the web interface to edit your
"
.
"
SFS public key list.
\n
";
print
SFSKEYS
"
#
\n
";
foreach
my
$key
(
@sfskeys
)
{
print
SFSKEYS
"
$key
\n
";
}
close
(
SFSKEYS
);
# Because sfs_users only contains public keys, sfs_users.pub is
# exactly the same
if
(
system
("
cp -p -f /etc/sfs/sfs_users.new
"
.
"
/etc/sfs/sfs_users.pub.new
"))
{
warn
("
*** Could not copy /etc/sfs/sfs_users.new to
"
.
"
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
");
next
;
}
if
(
!
chmod
(
0600
,
"
/etc/sfs/sfs_users.new
"))
{
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
");
next
;
}
if
(
!
chmod
(
0644
,
"
/etc/sfs/sfs_users.pub.new
"))
{
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
",
"
/etc/sfs/sfs_users.pub
")
{
if
(
-
e
$keyfile
)
{
if
(
system
("
cp -p -f
$keyfile
$keyfile
.old
"))
{
warn
("
*** Could not save off
$keyfile
: $!
\n
");
next
;
}
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
"))
{
warn
("
*** Could not
chmod
$keyfile
:
$
!
\n
");
if
(
system
("
mv -f
$keyfile
.new
$keyfile
"))
{
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
}
# The do-while is an easy way out in case of errors
while
0
;
}
while
0
;
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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