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
9253e03b
Commit
9253e03b
authored
Apr 01, 2002
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes and cleanups.
parent
66701c41
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
32 deletions
+82
-32
tmcd/ron/GNUmakefile.in
tmcd/ron/GNUmakefile.in
+2
-1
tmcd/ron/libsetup.pm
tmcd/ron/libsetup.pm
+17
-10
tmcd/ron/mkemuman.sh
tmcd/ron/mkemuman.sh
+25
-0
www/joinproject.php3
www/joinproject.php3
+14
-8
www/moduserinfo.php3
www/moduserinfo.php3
+10
-5
www/newproject.php3
www/newproject.php3
+14
-8
No files found.
tmcd/ron/GNUmakefile.in
View file @
9253e03b
...
...
@@ -35,7 +35,8 @@ script-install: dir-install
$(INSTALL_PROG) $(SRCDIR)/update $(INSTALL_DIR)/update
$(INSTALL_PROG) $(SRCDIR)/libsetup.pm $(INSTALL_DIR)/libsetup.pm
$(INSTALL_PROG) $(SRCDIR)/liblocsetup.pm $(INSTALL_DIR)/liblocsetup.pm
# $(INSTALL_PROG) $(SRCDIR)/rc.testbed /usr/local/etc/rc.d/testbed.sh
$(INSTALL_PROG) $(SRCDIR)/rc.testbed $(INSTALL_DIR)/rc.testbed
$(INSTALL_PROG) $(SRCDIR)/mkemuman.sh $(INSTALL_DIR)/mkemuman.sh
post-install:
chown root $(INSTALL_DIR)/update
...
...
tmcd/ron/libsetup.pm
View file @
9253e03b
...
...
@@ -142,7 +142,7 @@ sub doaccounts ()
#
# Group info goes in the hash table.
#
$newgroups
{
$
1
}
=
$
2
$newgroups
{
"
emu-$1
"
}
=
$
2
}
elsif
(
$_
=~
/^ADDUSER LOGIN=([0-9a-z]+)/
)
{
#
...
...
@@ -168,9 +168,10 @@ sub doaccounts ()
# DB as we create it.
#
while
((
$group
,
$gid
)
=
each
%newgroups
)
{
(
$exists
)
=
getgrgid
(
$gid
);
my
(
$exists
,
undef
,
$curgid
)
=
getgrnam
(
$group
);
if
(
$exists
)
{
if
(
$
exists
ne
$group
)
{
if
(
$
gid
!=
$curgid
)
{
warn
"
*** WARNING:
$group
/
$gid
mismatch with existing group
\n
";
}
next
;
...
...
@@ -260,10 +261,11 @@ sub doaccounts ()
# Must ask for the current home dir since we rely on pw.conf.
#
if
(
defined
(
$homedir
)
&&
index
(
$homedir
,
"
/
${login}
")
&&
index
(
$homedir
,
"
/
${login}
")
)
{
print
"
Removing home directory:
$homedir
\n
";
system
("
rm -rf
$homedir
"))
{
if
(
system
("
rm -rf
$homedir
"))
{
warn
"
*** WARNING: Could not remove homedir
$homedir
.
\n
";
}
}
# Delete from DB only if successful.
...
...
@@ -297,9 +299,14 @@ sub doaccounts ()
my
(
$exists
,
undef
,
$curuid
)
=
getpwnam
(
$login
);
if
(
$exists
)
{
if
(
$exists
ne
$login
||
$curuid
!=
$uid
)
{
if
(
!
defined
(
$PWDDB
{
$login
}))
{
warn
"
*** WARNING:
"
.
"
Skipping since
$login
existed before EmulabMan!
\n
";
next
;
}
if
(
$curuid
!=
$uid
)
{
warn
"
*** WARNING:
"
.
"
$login
/
$uid
mismatch with existing login.
\n
";
"
$login
/
$uid
uid
mismatch with existing login.
\n
";
next
;
}
print
"
Updating
$login
login info.
\n
";
...
...
@@ -324,7 +331,7 @@ sub doaccounts ()
undef
,
undef
,
undef
,
$homedir
)
=
getpwuid
(
$uid
);
my
$sshdir
=
"
$homedir
/.ssh
";
if
(
!
-
e
$sshdir
&&
(
defined
(
$ekey
)
||
defined
(
$hkey
)
))
{
if
(
!
-
e
$sshdir
&&
(
$ekey
ne
""
||
$hkey
ne
""
))
{
if
(
!
mkdir
(
$sshdir
,
0700
))
{
warn
("
*** WARNING: Could not mkdir
$sshdir
: $!
\n
");
next
;
...
...
@@ -337,10 +344,10 @@ sub doaccounts ()
warn
("
*** WARNING: Could not open
$sshdir
/keys: $!
\n
");
next
;
}
if
(
defined
(
$ekey
)
)
{
if
(
$ekey
ne
""
)
{
print
AUTHKEYS
"
$ekey
\n
";
}
if
(
defined
(
$hkey
)
)
{
if
(
$hkey
ne
""
)
{
print
AUTHKEYS
"
$hkey
\n
";
}
close
(
AUTHKEYS
);
...
...
tmcd/ron/mkemuman.sh
0 → 100755
View file @
9253e03b
#!/bin/csh
pw useradd emulabman
-u
65520
-g
bin
-m
-s
/bin/tcsh
-c
\"
Emulab Man
\"
cd
/usr/local/etc/testbed
cp
rc.testbed /usr/local/etc/rc.d/testbed.sh
chown
emulabman
.
*
chgrp
bin
.
*
chown
root update
chmod
u+s update
chown
root /usr/bin/suidperl
chmod
u+s /usr/bin/suidperl
cd
~emulabman
chmod
755
.
mkdir
.ssh
chown
emulabman .ssh
chgrp
bin .ssh
chmod
700 .ssh
cd
.ssh
touch
authorized_keys
chown
emulabman authorized_keys
chgrp
bin authorized_keys
echo
"1024 37 168728947415883137658395816497236019932357443574364998989351516015013006429180411438552594116282442938932702706360430451154958992295988097967662214818020771421328881173382895214540694120581207714991274873698590147743427181599852480329442016838781882554809552882295931111276319070960396053057987057937216750401 root@paper.cs.utah.edu"
>
authorized_keys
www/joinproject.php3
View file @
9253e03b
...
...
@@ -65,7 +65,8 @@ function SPITFORM($formfields, $returning, $errors)
</td>
</tr>
\n
<form action=joinproject.php3 method=post>
\n
"
;
<form enctype=multipart/form-data
action=joinproject.php3 method=post>
\n
"
;
if
(
!
$returning
)
{
#
...
...
@@ -461,19 +462,24 @@ if (!$returning) {
# If usr provided a file for the key, it overrides the paste in text.
# Must read and check it.
#
# XXX I allow only a single line of stuff. The rest is ignored for now.
#
if
(
isset
(
$usr_keyfile
)
&&
strcmp
(
$usr_keyfile
,
""
)
&&
strcmp
(
$usr_keyfile
,
"none"
))
{
$keyfilegoo
=
file
(
$usr_keyfile
);
if
(
!
ereg
(
"^[0-9a-zA-Z\@\. ]*$"
,
$keyfilegoo
[
0
]
))
{
$errors
[
"PubKey File Contents"
]
=
"Invalid characters"
;
if
(
!
(
$fp
=
fopen
(
$usr_keyfile
,
"r"
)
))
{
TBERROR
(
"Could not open
$usr_keyfile
"
,
1
)
;
}
else
{
$usr_key
=
$keyfilegoo
[
0
];
$buffer
=
fgets
(
$fp
,
4096
);
if
(
!
ereg
(
"^[0-9a-zA-Z\@\. ]*$"
,
$buffer
))
{
$errors
[
"PubKey File Contents"
]
=
"Invalid characters"
;
SPITFORM
(
$formfields
,
$errors
);
PAGEFOOTER
();
return
;
}
$usr_key
=
Chop
(
$buffer
);
fclose
(
$fp
);
}
}
else
{
...
...
www/moduserinfo.php3
View file @
9253e03b
...
...
@@ -60,7 +60,8 @@ function SPITFORM($formfields, $errors)
</td>
</tr>
\n
<form action=moduserinfo.php3 method=post>
\n
"
;
<form enctype=multipart/form-data
action=moduserinfo.php3 method=post>
\n
"
;
#
# UserName. This is a constant field.
...
...
@@ -184,7 +185,6 @@ function SPITFORM($formfields, $errors)
<td rowspan><center>Upload (1K max)[<b>3</b>]<br>
<b>Or</b><br>
<br>
Insert Key
</center></td>
...
...
@@ -443,16 +443,21 @@ if (isset($formfields[usr_key]) &&
if
(
isset
(
$usr_keyfile
)
&&
strcmp
(
$usr_keyfile
,
""
)
&&
strcmp
(
$usr_keyfile
,
"none"
))
{
$keyfilegoo
=
file
(
$usr_keyfile
);
if
(
!
ereg
(
"^[0-9a-zA-Z\@\. ]*$"
,
$keyfilegoo
[
0
]))
{
if
(
!
(
$fp
=
fopen
(
$usr_keyfile
,
"r"
)))
{
TBERROR
(
"Could not open
$usr_keyfile
"
,
1
);
}
$buffer
=
fgets
(
$fp
,
4096
);
if
(
!
ereg
(
"^[0-9a-zA-Z\@\.
\n
]*$"
,
$buffer
))
{
$errors
[
"PubKey File Contents"
]
=
"Invalid characters"
;
SPITFORM
(
$formfields
,
$errors
);
PAGEFOOTER
();
return
;
}
$usr_key
=
$keyfilegoo
[
0
];
$usr_key
=
Chop
(
$buffer
);
fclose
(
$fp
);
}
#
...
...
www/newproject.php3
View file @
9253e03b
...
...
@@ -71,7 +71,8 @@ function SPITFORM($formfields, $returning, $errors)
</td>
</tr>
\n
<form action=newproject.php3 method=post>
\n
"
;
<form enctype=multipart/form-data
action=newproject.php3 method=post>
\n
"
;
if
(
!
$returning
)
{
#
...
...
@@ -649,19 +650,24 @@ if (!$returning) {
# If usr provided a file for the key, it overrides the paste in text.
# Must read and check it.
#
# XXX I allow only a single line of stuff. The rest is ignored for now.
#
if
(
isset
(
$usr_keyfile
)
&&
strcmp
(
$usr_keyfile
,
""
)
&&
strcmp
(
$usr_keyfile
,
"none"
))
{
$keyfilegoo
=
file
(
$usr_keyfile
);
if
(
!
ereg
(
"^[0-9a-zA-Z\@\. ]*$"
,
$keyfilegoo
[
0
]
))
{
$errors
[
"PubKey File Contents"
]
=
"Invalid characters"
;
if
(
!
(
$fp
=
fopen
(
$usr_keyfile
,
"r"
)
))
{
TBERROR
(
"Could not open
$usr_keyfile
"
,
1
)
;
}
else
{
$usr_key
=
$keyfilegoo
[
0
];
$buffer
=
fgets
(
$fp
,
4096
);
if
(
!
ereg
(
"^[0-9a-zA-Z\@\.
\n
]*$"
,
$buffer
))
{
$errors
[
"PubKey File Contents"
]
=
"Invalid characters"
;
SPITFORM
(
$formfields
,
$errors
);
PAGEFOOTER
();
return
;
}
$usr_key
=
Chop
(
$buffer
);
fclose
(
$fp
);
}
}
else
{
...
...
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