[Midnightbsd-cvs] src: usr.sbin/sysinstall: Bring in fixes found during 0.2 snafu

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon Sep 1 21:30:30 EDT 2008


Log Message:
-----------
Bring in fixes found during 0.2 snafu

Modified Files:
--------------
    src/usr.sbin/sysinstall:
        anonFTP.c (r1.5 -> r1.6)
        config.c (r1.11 -> r1.12)
        devices.c (r1.7 -> r1.8)
        dhcp.c (r1.4 -> r1.5)
        dist.c (r1.6 -> r1.7)
        doc.c (r1.4 -> r1.5)
        ftp.c (r1.4 -> r1.5)
        http.c (r1.3 -> r1.4)
        index.c (r1.3 -> r1.4)
        install.c (r1.6 -> r1.7)
        media.c (r1.6 -> r1.7)
        misc.c (r1.5 -> r1.6)
        modules.c (r1.3 -> r1.4)
        msg.c (r1.3 -> r1.4)
        network.c (r1.3 -> r1.4)
        options.c (r1.3 -> r1.4)
        pccard.c (r1.3 -> r1.4)
        tape.c (r1.4 -> r1.5)
        tcpip.c (r1.4 -> r1.5)
        ttys.c (r1.3 -> r1.4)
        wizard.c (r1.3 -> r1.4)

-------------- next part --------------
Index: tcpip.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/tcpip.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -L usr.sbin/sysinstall/tcpip.c -L usr.sbin/sysinstall/tcpip.c -u -r1.4 -r1.5
--- usr.sbin/sysinstall/tcpip.c
+++ usr.sbin/sysinstall/tcpip.c
@@ -515,7 +515,7 @@
     draw_box(ds_win, TCP_DIALOG_Y + 9, TCP_DIALOG_X + 8, TCP_DIALOG_HEIGHT - 13, TCP_DIALOG_WIDTH - 17,
 	     dialog_attr, border_attr);
     wattrset(ds_win, dialog_attr);
-    snprintf(title, sizeof(title), " Configuration for Interface %s ", devp->name);
+    sprintf(title, " Configuration for Interface %s ", devp->name);
     mvwaddstr(ds_win, TCP_DIALOG_Y + 9, TCP_DIALOG_X + 14, title);
 
     /* Some more initialisation before we go into the main input loop */
@@ -531,13 +531,13 @@
 	     * class A/B network).
 	     */
 	    if (!netmask[0]) {
-		strlcpy(netmask, "255.255.255.0", sizeof(netmask));
+		strcpy(netmask, "255.255.255.0");
 		RefreshStringObj(layout[LAYOUT_NETMASK].obj);
 		++filled;
 	    }
 	    if (!index(hostname, '.') && domainname[0]) {
-		strlcat(hostname, ".", sizeof(hostname));
-		strlcat(hostname, domainname, sizeof(hostname));
+		strcat(hostname, ".");
+		strcat(hostname, domainname);
 		RefreshStringObj(layout[LAYOUT_HOSTNAME].obj);
 		++filled;
 	    }
@@ -596,14 +596,14 @@
 	if (use_dhcp || ipaddr[0])
 	    ipv4_enable = TRUE;
 	if (ipv4_enable) {
-	    snprintf(ifn, sizeof(ifn), "%s%s", VAR_IFCONFIG, devp->name);
+	    sprintf(ifn, "%s%s", VAR_IFCONFIG, devp->name);
 	    if (use_dhcp) {
 		if (strlen(extras) > 0)
-		    snprintf(temp, sizeof(temp), "DHCP %s", extras);
+		    sprintf(temp, "DHCP %s", extras);
 		else
-		    snprintf(temp, sizeof(temp), "DHCP");
+		    sprintf(temp, "DHCP");
 	    } else
-		snprintf(temp, sizeof(temp), "inet %s %s netmask %s",
+		sprintf(temp, "inet %s %s netmask %s",
 			ipaddr, extras, netmask);
 	    variable_set2(ifn, temp, 1);
 	}
Index: dist.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/dist.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -L usr.sbin/sysinstall/dist.c -L usr.sbin/sysinstall/dist.c -u -r1.6 -r1.7
--- usr.sbin/sysinstall/dist.c
+++ usr.sbin/sysinstall/dist.c
@@ -348,7 +348,7 @@
     cp = alloca(strlen(tmp) + 1);
     if (!cp)
 	msgFatal("Couldn't alloca() %d bytes!\n", (int)(strlen(tmp) + 1));
-    strlcpy(cp, tmp, sizeof(cp));
+    strcpy(cp, tmp);
     while (cp) {
 	if ((cp2 = index(cp, ' ')) != NULL)
 	    *(cp2++) = '\0';
@@ -721,7 +721,7 @@
 	*col += strlen(me[i].my_name);
 	if (*col > 50) {
 	    *col = 0;
-	    strlcat(buf, "\n", sizeof(buf));
+	    strcat(buf, "\n");
 	}
 	sprintf(&buf[strlen(buf)], " %s", me[i].my_name);
 
Index: options.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/options.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/options.c -L usr.sbin/sysinstall/options.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/options.c
+++ usr.sbin/sysinstall/options.c
@@ -178,7 +178,7 @@
 	return (char *)opt.data;
 
     case OPT_IS_INT:
-	snprintf(ival, sizeof(ival), "%lu", (long)opt.data);
+	sprintf(ival, "%lu", (long)opt.data);
 	return ival;
 
     case OPT_IS_FUNC:
Index: install.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/install.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -L usr.sbin/sysinstall/install.c -L usr.sbin/sysinstall/install.c -u -r1.6 -r1.7
--- usr.sbin/sysinstall/install.c
+++ usr.sbin/sysinstall/install.c
@@ -943,7 +943,7 @@
     command_clear();
     if (SwapChunk && RunningAsInit) {
 	/* As the very first thing, try to get ourselves some swap space */
-	snprintf(dname, sizeof(dname), "/dev/%s", SwapChunk->name);
+	sprintf(dname, "/dev/%s", SwapChunk->name);
 	if (!Fake && !file_readable(dname)) {
 	    msgConfirm("Unable to find device node for %s in /dev!\n"
 		       "The creation of filesystems will be aborted.", dname);
@@ -965,7 +965,7 @@
 
     if (RootChunk && RunningAsInit) {
 	/* Next, create and/or mount the root device */
-	snprintf(dname, sizeof(dname), "/dev/%s", RootChunk->name);
+	sprintf(dname, "/dev/%s", RootChunk->name);
 	if (!Fake && !file_readable(dname)) {
 	    msgConfirm("Unable to make device node for %s in /dev!\n"
 		       "The creation of filesystems will be aborted.", dname);
@@ -1014,7 +1014,7 @@
 	}
 
 	/* Switch to block device */
-	snprintf(dname, sizeof(dname), "/dev/%s", RootChunk->name);
+	sprintf(dname, "/dev/%s", RootChunk->name);
 	if (Mount("/mnt", dname)) {
 	    msgConfirm("Unable to mount the root file system on %s!  Giving up.", dname);
 	    return DITEM_FAILURE | DITEM_RESTORE;
@@ -1070,7 +1070,7 @@
 			if (c2 == RootChunk)
 			    continue;
 
-			snprintf(dname, sizeof(dname), "%s/dev/%s",
+			sprintf(dname, "%s/dev/%s",
 			    RunningAsInit ? "/mnt" : "", c2->name);
 
 			if (tmp->do_newfs && (!upgrade ||
@@ -1095,7 +1095,7 @@
 
 			if (c2 == SwapChunk)
 			    continue;
-			snprintf(fname, sizeof(fname), "%s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name);
+			sprintf(fname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name);
 			i = (Fake || swapon(fname));
 			if (!i) {
 			    dialog_clear_norefresh();
@@ -1111,27 +1111,10 @@
 		(root->do_newfs || upgrade)) {
 		char name[FILENAME_MAX];
 
-		snprintf(name, sizeof(name), "%s/%s", RunningAsInit ? "/mnt" : "", 
+		sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", 
 		    ((PartInfo *)c1->private_data)->mountpoint);
 		Mkdir(name);
 	    }
-#if defined(__ia64__)
-	    else if (c1->type == efi && c1->private_data) {
-		char bootdir[FILENAME_MAX];
-		PartInfo *pi = (PartInfo *)c1->private_data;
-		char *p;
-
-		snprintf(dname, sizeof(dname), "%s/dev/%s", RunningAsInit ? "/mnt" : "",
-		    c1->name);
-
-		if (pi->do_newfs && (!upgrade ||
-		    !msgNoYes("You are upgrading - are you SURE you want to "
-		    "newfs /dev/%s?", c1->name)))
-			performNewfs(pi, dname, QUEUE_YES);
-
-		command_func_add(pi->mountpoint, Mount_msdosfs, c1->name);
-	    }
-#endif
 	}
     }
 
Index: devices.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/devices.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -L usr.sbin/sysinstall/devices.c -L usr.sbin/sysinstall/devices.c -u -r1.7 -r1.8
--- usr.sbin/sysinstall/devices.c
+++ usr.sbin/sysinstall/devices.c
@@ -190,7 +190,7 @@
     dev_t d;
     int fail;
 
-    snprintf(unit, sizeof unit, dev.name, i);
+    sprintf(unit, dev.name, i);
     snprintf(try, FILENAME_MAX, "/dev/%s", unit);
     if (isDebug())
 	msgDebug("deviceTry: attempting to open %s\n", try);
@@ -428,12 +428,12 @@
 		    cp = device_names[i].description;
 		    /* Serial devices get a slip and ppp device each, if supported */
 		    newdesc = safe_malloc(strlen(cp) + 40);
-		    snprintf(newdesc, sizeof(newdesc), cp, "SLIP interface", try, j + 1);
+		    sprintf(newdesc, cp, "SLIP interface", try, j + 1);
 		    deviceRegister("sl0", newdesc, strdup(try), DEVICE_TYPE_NETWORK, TRUE, mediaInitNetwork,
 				   NULL, mediaShutdownNetwork, NULL);
 		    msgDebug("Add mapping for %s to sl0\n", try);
 		    newdesc = safe_malloc(strlen(cp) + 50);
-		    snprintf(newdesc, sizeof(newdesc), cp, "PPP interface", try, j + 1);
+		    sprintf(newdesc, cp, "PPP interface", try, j + 1);
 		    deviceRegister("ppp0", newdesc, strdup(try), DEVICE_TYPE_NETWORK, TRUE, mediaInitNetwork,
 				   NULL, mediaShutdownNetwork, NULL);
 		    if (isDebug())
Index: modules.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/modules.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/modules.c -L usr.sbin/sysinstall/modules.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/modules.c
+++ usr.sbin/sysinstall/modules.c
@@ -64,10 +64,10 @@
 	while ((dp = readdir(dirp))) {
 	    if (dp->d_namlen < (sizeof(".ko") - 1)) continue;
 	    if (strcmp(dp->d_name + dp->d_namlen - (sizeof(".ko") - 1), ".ko") == 0) {
-		strlcpy(module, MODULESDIR, sizeof(module));
-		strlcat(module, "/", sizeof(module));
-		strlcat(module, dp->d_name, sizeof(module));
-		strlcpy(desc, module, sizeof(desc));
+		strcpy(module, MODULESDIR);
+		strcat(module, "/");
+		strcat(module, dp->d_name);
+		strcpy(desc, module);
 		len = strlen(desc);
 		strcpy(desc + (len - (sizeof(".ko") - 1)), ".dsc");
 		fd = open(module, O_RDONLY);
Index: anonFTP.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/anonFTP.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -L usr.sbin/sysinstall/anonFTP.c -L usr.sbin/sysinstall/anonFTP.c -u -r1.5 -r1.6
--- usr.sbin/sysinstall/anonFTP.c
+++ usr.sbin/sysinstall/anonFTP.c
@@ -169,7 +169,7 @@
 	return DITEM_SUCCESS; 	/* succeeds if already exists */
     }
     
-    snprintf(pwline, sizeof(pwline), "%s:*:%s:%d::0:0:%s:%s:/nonexistent\n", 
+    sprintf(pwline, "%s:*:%s:%d::0:0:%s:%s:/nonexistent\n", 
         FTP_NAME, tconf.uid, gid, tconf.comment, tconf.homedir);
     
     fptr = fopen(_PATH_MASTERPASSWD,"a");
@@ -219,7 +219,7 @@
     SAFE_STRCPY(tconf.upload, FTP_UPLOAD);
     SAFE_STRCPY(tconf.comment, FTP_COMMENT);
     SAFE_STRCPY(tconf.homedir, FTP_HOMEDIR);
-    snprintf(tconf.uid, sizeof(tconf.uid), "%d", FTP_UID);
+    sprintf(tconf.uid, "%d", FTP_UID);
     
     /* Some more initialisation before we go into the main input loop */
     obj = initLayoutDialog(ds_win, layout, ANONFTP_DIALOG_X, ANONFTP_DIALOG_Y, &max);
@@ -268,7 +268,7 @@
     
     /*** Use defaults for any invalid values ***/
     if (atoi(tconf.uid) <= 0)
-	snprintf(tconf.uid, sizeof(tconf.uid), "%d", FTP_UID);
+	sprintf(tconf.uid, "%d", FTP_UID);
     
     if (!tconf.group[0])
 	SAFE_STRCPY(tconf.group, FTP_GROUP);
@@ -312,7 +312,7 @@
 	if (!msgYesNo("Create a welcome message file for anonymous FTP users?")) {
 	    char cmd[256];
 	    vsystem("echo Your welcome message here. > %s/etc/%s", tconf.homedir, MOTD_FILE);
-	    snprintf(cmd, sizeof(cmd), "%s %s/etc/%s", variable_get(VAR_EDITOR), tconf.homedir, MOTD_FILE);
+	    sprintf(cmd, "%s %s/etc/%s", variable_get(VAR_EDITOR), tconf.homedir, MOTD_FILE);
 	    if (!systemExecute(cmd))
 		i = DITEM_SUCCESS;
 	    else
Index: ttys.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/ttys.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/ttys.c -L usr.sbin/sysinstall/ttys.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/ttys.c
+++ usr.sbin/sysinstall/ttys.c
@@ -64,7 +64,7 @@
 		   strerror(errno));
 	return;
     }
-    strlcpy(templ, _PATH_TTYS _X_EXTENSION, sizeof(templ));
+    strcpy(templ, _PATH_TTYS _X_EXTENSION);
     if ((t = mkstemp(templ)) < 0) {
 	msgConfirm("Can't create %s: %s", templ, strerror(errno));
 	(void)fclose(fp);
Index: wizard.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/wizard.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/wizard.c -L usr.sbin/sysinstall/wizard.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/wizard.c
+++ usr.sbin/sysinstall/wizard.c
@@ -35,8 +35,8 @@
     u_long l;
     int i,j,fd;
 
-    strlcpy(device,"/dev/", sizeof(device));
-    strlcat(device,d->name, sizeof(device));
+    strcpy(device,"/dev/");
+    strcat(device,d->name);
 
     fd = open(device,O_RDWR);
     if (fd < 0) {
@@ -73,7 +73,7 @@
     int ncmd,i;
 
     systemSuspendDialog();
-    snprintf(myprompt, sizeof(myprompt), "%s> ", d->name);
+    sprintf(myprompt, "%s> ", d->name);
     while(1) {
 	printf("--==##==--\n");
 	Debug_Disk(d);
Index: doc.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/doc.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -L usr.sbin/sysinstall/doc.c -L usr.sbin/sysinstall/doc.c -u -r1.4 -r1.5
--- usr.sbin/sysinstall/doc.c
+++ usr.sbin/sysinstall/doc.c
@@ -99,7 +99,7 @@
     if (strstr(str, "Other")) {
 	where = msgGetInput("http://www.midnightbsd.org", "Please enter the URL of the location you wish to visit.");
 	if (where)
-	    strlcpy(target, where, sizeof(target));
+	    strcpy(target, where);
     }
     else if (strstr(str, "FAQ")) {
 	where = strcpy(target, "/usr/share/doc/faq/index.html");
@@ -112,7 +112,7 @@
 	    where = strcpy(target, "http://www.midnightbsd.org/docs");
     }
     if (where) {
-	snprintf(tmp, sizeof(tmp), "%s %s", browser, target);
+	sprintf(tmp, "%s %s", browser, target);
 	systemExecute(tmp);
 	return DITEM_SUCCESS;
     }
Index: http.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/http.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/http.c -L usr.sbin/sysinstall/http.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/http.c
+++ usr.sbin/sysinstall/http.c
@@ -88,7 +88,7 @@
     }
 
     msgNotify("Checking access to\n %s", variable_get(VAR_HTTP_PATH));
-    snprintf(req, sizeof(req), "GET %s/ HTTP/1.0\r\n\r\n", variable_get(VAR_HTTP_PATH));
+    sprintf(req, "GET %s/ HTTP/1.0\r\n\r\n", variable_get(VAR_HTTP_PATH));
     write(s,req,strlen(req));
 /*
  *  scan the headers of the response
@@ -161,7 +161,7 @@
 
     if (strcmp(rel, "__RELEASE") && strcmp(rel, "any"))  {
         for (fdir = 0; ftp_dirs[fdir]; fdir++) {
-            snprintf(req, sizeof(req), "%s/%s/%s", variable_get(VAR_FTP_PATH),
+            sprintf(req, "%s/%s/%s", variable_get(VAR_FTP_PATH),
                 ftp_dirs[fdir], rel);
             variable_set2(VAR_HTTP_PATH, req, 0);
             if (checkAccess(FALSE)) {
@@ -220,7 +220,7 @@
 	return NULL;
     }
 						   
-    snprintf(req, sizeof(req), "GET %s/%s%s HTTP/1.0\r\n\r\n",
+    sprintf(req, "GET %s/%s%s HTTP/1.0\r\n\r\n",
 	    variable_get(VAR_HTTP_PATH), file, variable_get(VAR_HTTP_FTP_MODE));
 
     if (isDebug()) {
Index: index.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/index.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/index.c -L usr.sbin/sysinstall/index.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/index.c
+++ usr.sbin/sysinstall/index.c
@@ -96,17 +96,20 @@
     "devel", "Software development utilities and libraries.",
     "dns", "Domain Name Service tools.",
     "documentation", "Document preparation utilities.",
-    "editors", "Common text editors.",
+    "editors", "Editors.",
     "elisp", "Things related to Emacs Lisp.",
-    "emulators", "Utilities for emulating other OS types.",
+    "emulators", "Utilities for emulating other operating systems.",
     "finance", "Monetary, financial and related applications.",
     "french", "Ported software for French countries.",
     "ftp", "FTP client and server utilities.",
     "games", "Various and sundry amusements.",
     "german", "Ported software for Germanic countries.",
+    "geography", "Geography-related software.",
     "gnome", "Components of the Gnome Desktop environment.",
+    "gnustep", "Software for the GNUstep environment.",
     "graphics", "Graphics libraries and utilities.",
     "haskell", "Software related to the Haskell language.",
+    "hamradio", "Software for amateur radio.",
     "hebrew", "Ported software for Hebrew language.",
     "hungarian", "Ported software for the Hungarian market.",
     "ipv6", "IPv6 related software.",
@@ -114,51 +117,53 @@
     "japanese", "Ported software for the Japanese market.",
     "java", "Java language support.",
     "kde", "Software for the K Desktop Environment.",
+    "kld", "Kernel loadable modules.",
     "korean", "Ported software for the Korean market.",
     "lang", "Computer languages.",
-    "languages", "Computer languages.",
     "libraries", "Software development libraries.",
     "linux", "Linux programs that can be run under binary compatibility.",
+    "lisp", "Software related to the Lisp language",
     "mail", "Electronic mail packages and utilities.",
     "math", "Mathematical computation software.",
     "mbone", "Applications and utilities for the MBONE.",
     "misc", "Miscellaneous utilities.",
     "multimedia", "Multimedia software.",
     "net", "Networking utilities.",
+    "net-im", "Instant messaging software",
     "net-mgmt", "Network Management",
+    "net-p2p", "Peer to peer network applications.",
     "news", "USENET News support software.",
     "numeric", "Mathematical computation software.",
     "offix", "An office automation suite of sorts.",
     "orphans", "Packages without a home elsewhere.",
     "palm", "Software support for the Palm(tm) series.",
     "parallel", "Applications dealing with parallelism in computing.",
+    "pear", "Software relatd to the Pear PHP framework.",
     "perl5", "Utilities/modules for the PERL5 language.",
-    "picobsd", "Ports to support PicoBSD.",
-    "pilot", "Software support for the 3Com Palm Pilot(tm) series.",
     "plan9", "Software from the Plan9 operating system.",
     "polish", "Ported software for the Polish market.",
+    "ports-mgmt", "Utilities for managing ports and packages.",
     "portuguese", "Ported software for the Portuguese market.",
     "print", "Utilities for dealing with printing.",
     "printing", "Utilities for dealing with printing.",
     "programming", "Software development utilities and libraries.",
     "python", "Software related to the Python language.",
     "ruby", "Software related to the Ruby language.",
+    "rubygems", "Ports of RubyGems packages",
     "russian", "Ported software for the Russian market.",
     "science", "Scientific software.",
     "scheme", "Software related to the Scheme language.",
     "security", "System security software.",
     "shells", "Various shells (tcsh, bash, etc).",
+    "spanish", "Ported software for the Spanish market.",
     "sysutils", "Various system utilities.",
-    "tcl75", "TCL v7.5 and packages that depend on it.",
-    "tcl76", "TCL v7.6 and packages that depend on it.",
+    "tcl", "TCL and packages that depend on it.",
     "tcl80", "TCL v8.0 and packages that depend on it.",
-    "tcl81", "TCL v8.1 and packages that depend on it.",
     "tcl82", "TCL v8.2 and packages that depend on it.",
     "tcl83", "TCL v8.3 and packages that depend on it.",
     "tcl84", "TCL v8.4 and packages that depend on it.",
     "textproc", "Text processing/search utilities.",
-    "tk41", "Tk4.1 and packages that depend on it.",
-    "tk42", "Tk4.2 and packages that depend on it.",
+    "tk", "Tk and packages that depend on it.",
     "tk80", "Tk8.0 and packages that depend on it.",
     "tk81", "Tk8.1 and packages that depend on it.",
     "tk82", "Tk8.2 and packages that depend on it.",
@@ -171,12 +176,14 @@
     "www", "WEB utilities (browers, HTTP servers, etc).",
     "x11", "X Window System based utilities.",
     "x11-clocks", "X Window System based clocks.",
+    "x11-drivers", "X Window System drivers.",
     "x11-fm", "X Window System based file managers.",
     "x11-fonts", "X Window System fonts and font utilities.",
     "x11-servers", "X Window System servers.",
     "x11-themes", "X Window System themes.",
     "x11-toolkits", "X Window System based development toolkits.",
     "x11-wm", "X Window System window managers.",
+    "xfce", "Software related to the Xfce Desktop Environment.",
     "zope", "Software related to the Zope platform.",
     NULL, NULL,
 };
@@ -268,7 +275,19 @@
 	return 0;
     }
     *tok = '\0';
-    strlcpy(to, from, sizeof(to));
+    strcpy(to, from);
+    return tok + 1 - from;
+}
+
+static int
+skip_to_sep(char *from, int sep)
+{
+    char *tok;
+
+    tok = strchr(from, sep);
+    if (!tok)
+	return 0;
+    *tok = '\0';
     return tok + 1 - from;
 }
 
@@ -310,21 +329,21 @@
     cp += copy_to_sep(descr, cp, '|');		/* path to pkg-descr */
     cp += copy_to_sep(maint, cp, '|');		/* maintainer */
     cp += copy_to_sep(cats, cp, '|');		/* categories */
-    cp += copy_to_sep(junk, cp, '|');		/* build deps - not used */
+    cp += skip_to_sep(cp, '|');			/* build deps - not used */
     cp += copy_to_sep(rdeps, cp, '|');		/* run deps */
     if (index(cp, '|'))
-        cp += copy_to_sep(junk, cp, '|');	/* url - not used */
+        cp += skip_to_sep(cp, '|');		/* url - not used */
     else {
 	strncpy(junk, cp, 1023);
 	*volume = 0;
 	return 0;
     }
     if (index(cp, '|'))
-	cp += copy_to_sep(junk, cp, '|');	/* extract deps - not used */
+	cp += skip_to_sep(cp, '|');		/* extract deps - not used */
     if (index(cp, '|'))
-	cp += copy_to_sep(junk, cp, '|');	/* patch deps - not used */
+	cp += skip_to_sep(cp, '|');		/* patch deps - not used */
     if (index(cp, '|'))
-	cp += copy_to_sep(junk, cp, '|');	/* fetch deps - not used */
+	cp += skip_to_sep(cp, '|');		/* fetch deps - not used */
     if (index(cp, '|'))
         cp += copy_to_sep(volstr, cp, '|');	/* media volume */
     else {
Index: network.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/network.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/network.c -L usr.sbin/sysinstall/network.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/network.c
+++ usr.sbin/sysinstall/network.c
@@ -240,7 +240,7 @@
     if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
 	SAFE_STRCPY(myaddr, ((DevInfo *)devp->private)->ipaddr);
     else
-	strlcpy(myaddr, "0", sizeof(myaddr));
+	strcpy(myaddr, "0");
 
     if (!Fake)
 	fp = fopen("/etc/ppp/ppp.linkup", "w");
Index: msg.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/msg.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/msg.c -L usr.sbin/sysinstall/msg.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/msg.c
+++ usr.sbin/sysinstall/msg.c
@@ -111,7 +111,7 @@
     int attrs;
 
     errstr = (char *)alloca(FILENAME_MAX);
-    strlcpy(errstr, "Warning: ", sizeof(errstr));
+    strcpy(errstr, "Warning: ");
     va_start(args, fmt);
     vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args);
     va_end(args);
@@ -134,7 +134,7 @@
     int attrs;
 
     errstr = (char *)alloca(FILENAME_MAX);
-    strlcpy(errstr, "Error: ", sizeof(errstr));
+    strcpy(errstr, "Error: ");
     va_start(args, fmt);
     vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args);
     va_end(args);
@@ -157,7 +157,7 @@
     int attrs;
 
     errstr = (char *)alloca(FILENAME_MAX);
-    strlcpy(errstr, "Fatal Error: ", sizeof(errstr));
+    strcpy(errstr, "Fatal Error: ");
     va_start(args, fmt);
     vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args);
     va_end(args);
@@ -313,7 +313,7 @@
     if (DebugFD == -1)
 	return;
     dbg = (char *)alloca(FILENAME_MAX);
-    strlcpy(dbg, "DEBUG: ", sizeof(dbg));
+    strcpy(dbg, "DEBUG: ");
     va_start(args, fmt);
     vsnprintf((char *)(dbg + strlen(dbg)), FILENAME_MAX, fmt, args);
     va_end(args);
Index: misc.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/misc.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -L usr.sbin/sysinstall/misc.c -L usr.sbin/sysinstall/misc.c -u -r1.5 -r1.6
--- usr.sbin/sysinstall/misc.c
+++ usr.sbin/sysinstall/misc.c
@@ -329,8 +329,8 @@
 	return DITEM_SUCCESS;
 
     if (*((char *)dev) != '/') {
-    	snprintf(device, sizeof(device), "%s/dev/%s", RunningAsInit ? "/mnt" : "", (char *)dev);
-	snprintf(mountpoint, sizeof(mountpoint), "%s%s", RunningAsInit ? "/mnt" : "", mountp);
+    	sprintf(device, "%s/dev/%s", RunningAsInit ? "/mnt" : "", (char *)dev);
+	sprintf(mountpoint, "%s%s", RunningAsInit ? "/mnt" : "", mountp);
     }
     else {
 	strcpy(device, dev);
@@ -365,12 +365,12 @@
 	return DITEM_SUCCESS;
 
     if (*((char *)dev) != '/') {
-    	snprintf(device, sizeof(device), "%s/dev/%s", RunningAsInit ? "/mnt" : "", (char *)dev);
-	snprintf(mountpoint, sizeof(mountpoint), "%s%s", RunningAsInit ? "/mnt" : "", mountp);
+    	sprintf(device, "%s/dev/%s", RunningAsInit ? "/mnt" : "", (char *)dev);
+	sprintf(mountpoint, "%s%s", RunningAsInit ? "/mnt" : "", mountp);
     }
     else {
-	strlcpy(device, dev, sizeof(device));
-	strlcpy(mountpoint, mountp, sizeof(mountpoint));
+	strcpy(device, dev);
+	strcpy(mountpoint, mountp);
     }
 
     if (Mkdir(mountpoint)) {
Index: config.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/config.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -L usr.sbin/sysinstall/config.c -L usr.sbin/sysinstall/config.c -u -r1.11 -r1.12
--- usr.sbin/sysinstall/config.c
+++ usr.sbin/sysinstall/config.c
@@ -255,7 +255,7 @@
     for (i = 0; i < cnt; i++) {
 	char cdname[10];
 	
-	snprintf(cdname, sizeof(cdname), "/cdrom%s", i ? itoa(i) : "");
+	sprintf(cdname, "/cdrom%s", i ? itoa(i) : "");
 	if (Mkdir(cdname))
 	    msgConfirm("Unable to make mount point for: %s", cdname);
 	else
@@ -503,7 +503,7 @@
     if (status == DITEM_SUCCESS) {
 	static char tmp[255];
 
-	snprintf(tmp, sizeof(tmp), "rdate_enable=YES,rpdate_flags=%s",
+	sprintf(tmp, "rdate_enable=YES,rpdate_flags=%s",
 		 variable_get(VAR_RDATE_FLAGS));
 	self->data = tmp;
 	dmenuSetVariables(self);
@@ -801,7 +801,7 @@
 		   "IPv6 must be separately enabled from IPv4 services.\n\n"
                    "Select [Yes] now to invoke an editor on /etc/inetd.conf, or [No] to\n"
                    "use the current settings.\n")) {
-            snprintf(cmd, sizeof(cmd), "%s /etc/inetd.conf", variable_get(VAR_EDITOR));
+            sprintf(cmd, "%s /etc/inetd.conf", variable_get(VAR_EDITOR));
             dialog_clear();
             systemExecute(cmd);
 	}
@@ -840,7 +840,7 @@
 	    vsystem("echo '# You should replace these lines with your actual exported filesystems.' >> /etc/exports");
 	    vsystem("echo \"# Note that BSD's export syntax is 'host-centric' vs. Sun's 'FS-centric' one.\" >> /etc/exports");
 	    vsystem("echo >> /etc/exports");
-	    snprintf(cmd, sizeof(cmd), "%s /etc/exports", variable_get(VAR_EDITOR));
+	    sprintf(cmd, "%s /etc/exports", variable_get(VAR_EDITOR));
 	    dialog_clear();
 	    systemExecute(cmd);
 	}
@@ -896,7 +896,7 @@
 		 "To load /etc/ttys in the editor, select [Yes], otherwise, [No].")) {
     } else {
 	configTtys();
-	snprintf(cmd, sizeof(cmd), "%s /etc/ttys", variable_get(VAR_EDITOR));
+	sprintf(cmd, "%s /etc/ttys", variable_get(VAR_EDITOR));
 	dialog_clear();
 	systemExecute(cmd);
     }
Index: media.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/media.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -L usr.sbin/sysinstall/media.c -L usr.sbin/sysinstall/media.c -u -r1.6 -r1.7
--- usr.sbin/sysinstall/media.c
+++ usr.sbin/sysinstall/media.c
@@ -533,9 +533,9 @@
 
     /* If they gave us a CDROM or something, try and pick a better name */
     if (statfs(cp, &st))
-	strlcpy(ufsDevice.name, "ufs", sizeof(ufsDevice.name));
+	strcpy(ufsDevice.name, "ufs");
     else
-	strlcpy(ufsDevice.name, st.f_fstypename, sizeof(ufsDevice.name));
+	strcpy(ufsDevice.name, st.f_fstypename);
 
     ufsDevice.type = DEVICE_TYPE_UFS;
     ufsDevice.init = dummyInit;
Index: tape.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/tape.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -L usr.sbin/sysinstall/tape.c -L usr.sbin/sysinstall/tape.c -u -r1.4 -r1.5
--- usr.sbin/sysinstall/tape.c
+++ usr.sbin/sysinstall/tape.c
@@ -101,13 +101,13 @@
 	restorescr(w);
     }
 
-    snprintf(buf, sizeof(buf), "%s/%s", (char *)dev->private, file);
+    sprintf(buf, "%s/%s", (char *)dev->private, file);
     if (isDebug())
 	msgDebug("Request for %s from tape (looking in %s)\n", file, buf);
     if (file_readable(buf))
 	fp = fopen(buf, "r");
     else {
-	snprintf(buf, sizeof(buf), "%s/releases/%s", (char *)dev->private, file);
+	sprintf(buf, "%s/releases/%s", (char *)dev->private, file);
 	fp = fopen(buf, "r");
     }
     /* Nuke the files behind us to save space */
Index: pccard.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/pccard.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -L usr.sbin/sysinstall/pccard.c -L usr.sbin/sysinstall/pccard.c -u -r1.3 -r1.4
--- usr.sbin/sysinstall/pccard.c
+++ usr.sbin/sysinstall/pccard.c
@@ -189,7 +189,7 @@
 	return;
     }
 
-    snprintf(card_device, sizeof(card_device), CARD_DEVICE, 0);
+    sprintf(card_device, CARD_DEVICE, 0);
 
     if ((fd = open(card_device, O_RDWR)) < 0) {
 	msgDebug("Can't open PC Card controller %s.\n", card_device);
@@ -237,8 +237,8 @@
     if (CardIrq) {
         for (i = 0; i < IRQ_COUNT; i++) {
             if ((CardIrq & IrqTable[i].my_bit) != 0) {
-                snprintf(temp, sizeof(temp), "%s %s", card_irq, IrqTable[i].my_flag);
-                strlcpy(card_irq, temp, sizeof(card_irq));
+                sprintf(temp, "%s %s", card_irq, IrqTable[i].my_flag);
+                strcpy(card_irq, temp);
             }
         } 
     }
@@ -279,9 +279,9 @@
 
     }
 
-    strlcpy(pccardd_cmd, "/stand/pccardd ", pccardd_cmd);
-    strlcat(pccardd_cmd, card_irq, pccardd_cmd);
-    strlcat(pccardd_cmd, " -z", pccardd_cmd);
+    strcpy(pccardd_cmd, "/stand/pccardd ");
+    strcat(pccardd_cmd, card_irq);
+    strcat(pccardd_cmd, " -z");
 
     variable_set2("pccardd_flags", card_irq, 1);
     variable_set2("pccard_enable", "YES", 1);
Index: ftp.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/sysinstall/ftp.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -L usr.sbin/sysinstall/ftp.c -L usr.sbin/sysinstall/ftp.c -u -r1.4 -r1.5
--- usr.sbin/sysinstall/ftp.c
+++ usr.sbin/sysinstall/ftp.c
@@ -118,7 +118,7 @@
     if (variable_get(VAR_FTP_PASS))
 	SAFE_STRCPY(password, variable_get(VAR_FTP_PASS));
     else if (RunningAsInit)
-	snprintf(password, sizeof(password), "installer@%s", variable_get(VAR_HOSTNAME));
+	sprintf(password, "installer@%s", variable_get(VAR_HOSTNAME));
     else {
 	struct passwd *pw;
 	char *user;
@@ -246,17 +246,17 @@
 	    /* Try some alternatives */
 	    switch (nretries++) {
 	    case 1:
-		snprintf(buf, sizeof(buf), "releases/%s", file);
+		sprintf(buf, "releases/%s", file);
 		try = buf;
 		break;
 
 	    case 2:
-		snprintf(buf, sizeof(buf), "%s/%s", variable_get(VAR_RELNAME), file);
+		sprintf(buf, "%s/%s", variable_get(VAR_RELNAME), file);
 		try = buf;
 		break;
 
 	    case 3:
-		snprintf(buf, sizeof(buf), "%s/releases/%s", variable_get(VAR_RELNAME), file);
+		sprintf(buf, "%s/releases/%s", variable_get(VAR_RELNAME), file);
 		try = buf;
 		break;
 


More information about the Midnightbsd-cvs mailing list