summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-11-23 21:08:56 +0000
committerMatt Wilson <msw@redhat.com>1999-11-23 21:08:56 +0000
commitc3d5a7b0d5d8aafbd13ef57147e0920c8410d1ef (patch)
tree1065f8143691c136cfc1d01b70e7bab93ac5aa43
parentc6949a368ffe68f43f1eddb6973e5eabeb140833 (diff)
downloadanaconda-c3d5a7b0d5d8aafbd13ef57147e0920c8410d1ef.tar.gz
anaconda-c3d5a7b0d5d8aafbd13ef57147e0920c8410d1ef.tar.xz
anaconda-c3d5a7b0d5d8aafbd13ef57147e0920c8410d1ef.zip
merge with anaconda-6-1-1-merge-2
-rw-r--r--balkan/dos.c3
-rw-r--r--harddrive.py10
-rw-r--r--loader/loader.c8
-rw-r--r--loader/urls.c14
-rw-r--r--todo.py83
5 files changed, 67 insertions, 51 deletions
diff --git a/balkan/dos.c b/balkan/dos.c
index 40410fadc..a0462dcb1 100644
--- a/balkan/dos.c
+++ b/balkan/dos.c
@@ -94,7 +94,8 @@ static int readNextTable(int fd, struct partitionTable * table, int nextNum,
for (i = 0; i < 4; i++) {
if (!singleTable.parts[i].size) continue;
- if (singleTable.parts[i].type == DOSP_TYPE_EXTENDED) {
+ if (singleTable.parts[i].type == DOSP_TYPE_EXTENDED ||
+ singleTable.parts[i].type == WINP_TYPE_EXTENDED) {
if (gotExtended) return BALKAN_ERROR_BADTABLE;
gotExtended = 1;
diff --git a/harddrive.py b/harddrive.py
index 2738bf841..4c31c6582 100644
--- a/harddrive.py
+++ b/harddrive.py
@@ -30,16 +30,14 @@ class InstallMethod:
hl = []
path = "/tmp/hdimage" + self.path + "/RedHat/RPMS"
for n in os.listdir(path):
-# no gurantee on suffix - do a copy onto msdos filesytem from
-# linux and you don't get .rpm
-# if (n[len(n) - 4:] == '.rpm'):
fd = os.open(path + "/" + n, 0)
try:
(h, isSource) = rpm.headerFromPackage(fd)
+ if (h and not isSource):
+ self.fnames[h] = n
+ hl.append(h)
except:
- continue
- self.fnames[h] = n
- hl.append(h)
+ pass
os.close(fd)
isys.umount("/tmp/hdimage")
diff --git a/loader/loader.c b/loader/loader.c
index 00f3da940..9740a76db 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1510,7 +1510,7 @@ int kickstartFromNfs(char * location, moduleList modLoaded, moduleDeps modDeps,
writeNetInfo("/tmp/netinfo", &netDev);
- if (!(netDev.dev.set & PUMP_INTFINFO_HAS_BOOTSERVER)) {
+ if (!(netDev.dev.set & PUMP_INTFINFO_HAS_NEXTSERVER)) {
logMessage("no bootserver was found");
return 1;
}
@@ -1522,8 +1522,8 @@ int kickstartFromNfs(char * location, moduleList modLoaded, moduleDeps modDeps,
file = netDev.dev.bootFile;
}
- ksPath = alloca(strlen(file) + strlen(netDev.dev.hostname) + 70);
- strcpy(ksPath, inet_ntoa(netDev.dev.bootServer));
+ ksPath = alloca(strlen(file) + 70);
+ strcpy(ksPath, inet_ntoa(netDev.dev.nextServer));
strcat(ksPath, ":");
strcat(ksPath, file);
@@ -1717,6 +1717,8 @@ void loadUpdates(struct knownDevices *kd, moduleList modLoaded,
int done = 0;
int rc;
+ startNewt(flags);
+
do {
rc = newtWinChoice(_("Devices"), _("OK"), _("Cancel"),
_("Insert your updates disk and press \"OK\" to continue."));
diff --git a/loader/urls.c b/loader/urls.c
index ff5f65eb5..5c991bc6c 100644
--- a/loader/urls.c
+++ b/loader/urls.c
@@ -107,6 +107,7 @@ int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
char * reflowedText = NULL;
int width, height, len;
newtGrid entryGrid, buttons, grid;
+ char * chptr;
if (ui->address) {
site = ui->address;
@@ -207,7 +208,14 @@ int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
_("You must enter a directory."));
continue;
}
+
+ if (!addrToIp(site)) {
+ newtWinMessage(_("Unknown Host"), _("Ok"),
+ _("%s is not a valid hostname."), site);
+ continue;
+ }
}
+
break;
} while (1);
@@ -224,6 +232,12 @@ int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
if (ui->prefix) free(ui->prefix);
ui->prefix = strdup(dir);
+ /* Get rid of trailing /'s */
+ chptr = ui->prefix + strlen(ui->prefix) - 1;
+ while (chptr > ui->prefix && *chptr == '/') chptr--;
+ chptr++;
+ *chptr = '\0';
+
if (ui->urlprefix) free(ui->urlprefix);
len = strlen(ui->address);
if (len < 15) len = 15;
diff --git a/todo.py b/todo.py
index b8085a841..a5918f9cb 100644
--- a/todo.py
+++ b/todo.py
@@ -161,25 +161,26 @@ class Network:
class Password:
def __init__ (self):
- self.crypt = ""
+ self.crypt = None
self.pure = None
def getPure(self):
return self.pure
def set (self, password, isCrypted = 0):
- if not isCrypted:
+ if isCrypted:
+ self.crypt = password
+ self.pure = None
+ else:
salt = (whrandom.choice (string.letters +
string.digits + './') +
whrandom.choice (string.letters +
string.digits + './'))
self.crypt = crypt.crypt (password, salt)
self.pure = password
- else:
- self.crypt = password
- def get (self):
- return self.crypt
+ def getCrypted(self):
+ return self.crypt
class Desktop (SimpleConfigFile):
def __init__ (self):
@@ -966,20 +967,25 @@ class ToDo:
f.close ()
def writeRootPassword (self):
- f = open (self.instPath + "/etc/passwd", "r")
- lines = f.readlines ()
- f.close ()
- index = 0
- for line in lines:
- if line[0:4] == "root":
- entry = string.splitfields (line, ':')
- entry[1] = self.rootpassword.get ()
- lines[index] = string.joinfields (entry, ':')
- break
- index = index + 1
- f = open (self.instPath + "/etc/passwd", "w")
- f.writelines (lines)
- f.close ()
+ pure = self.rootpassword.getPure()
+ if pure:
+ self.setPassword("root", pure)
+ else:
+ # we need to splice in an already crypted password for kickstart
+ f = open (self.instPath + "/etc/passwd", "r")
+ lines = f.readlines ()
+ f.close ()
+ index = 0
+ for line in lines:
+ if line[0:4] == "root":
+ entry = string.splitfields (line, ':')
+ entry[1] = self.rootpassword.get ()
+ lines[index] = string.joinfields (entry, ':')
+ break
+ index = index + 1
+ f = open (self.instPath + "/etc/passwd", "w")
+ f.writelines (lines)
+ f.close ()
def setupAuthentication (self):
args = [ "/usr/sbin/authconfig", "--kickstart", "--nostart" ]
@@ -1226,6 +1232,19 @@ class ToDo:
def getUserList(todo):
return todo.users
+ def setPassword(todo, account, password):
+ todo.log("in SetPassword for %s %s" % (account, password))
+ devnull = os.open("/dev/null", os.O_RDWR)
+
+ argv = [ "/usr/bin/passwd", "--stdin", account ]
+ p = os.pipe()
+ os.write(p[1], password + "\n")
+ iutil.execWithRedirect(argv[0], argv, root = todo.instPath,
+ stdin = p[0], stdout = devnull)
+ os.close(p[0])
+ os.close(p[1])
+ os.close(devnull)
+
def createAccounts(todo):
if not todo.users: return
@@ -1240,13 +1259,8 @@ class ToDo:
iutil.execWithRedirect(argv[0], argv, root = todo.instPath,
stdout = devnull)
- argv = [ "/usr/bin/passwd", "--stdin", account ]
- p = os.pipe()
- os.write(p[1], password + "\n")
- iutil.execWithRedirect(argv[0], argv, root = todo.instPath,
- stdin = p[0], stdout = devnull)
- os.close(p[0])
- os.close(p[1])
+ todo.setPassword(account, password)
+
os.close(devnull)
def createCdrom(self):
@@ -1347,11 +1361,10 @@ class ToDo:
self.writeMouse ()
self.writeKeyboard ()
self.writeNetworkConfig ()
- self.writeRootPassword ()
self.setupAuthentication ()
+ self.writeRootPassword ()
self.createAccounts ()
self.writeTimezone()
-
def doInstall(self):
# make sure we have the header list and comps file
@@ -1524,18 +1537,6 @@ class ToDo:
self.createCdrom()
self.copyExtraModules()
self.writeFstab ()
- #
- # move to generic writeConfiguration method above
- #
- # self.writeLanguage ()
- # self.writeMouse ()
- # self.writeKeyboard ()
- # self.writeNetworkConfig ()
- # self.writeRootPassword ()
- # self.setupAuthentication ()
- # self.createAccounts ()
- # self.writeTimezone()
-
self.writeConfiguration ()
self.writeDesktop ()
if (self.instClass.defaultRunlevel):