[mw-devel] MW3 r1090 - trunk/src

arthur at sucs.org arthur at sucs.org
Tue Oct 27 14:27:23 GMT 2009


Author: arthur
Date: 2009-10-27 14:27:23 +0000 (Tue, 27 Oct 2009)
New Revision: 1090

Modified:
   trunk/src/user.c
Log:
dont print, or accept a default username in bbs mode


Modified: trunk/src/user.c
===================================================================
--- trunk/src/user.c	2009-10-09 20:53:46 UTC (rev 1089)
+++ trunk/src/user.c	2009-10-27 14:27:23 UTC (rev 1090)
@@ -28,10 +28,13 @@
 char *getmylogin(void)
 {
 	struct passwd *pw;
-	if ((pw=getpwuid(getuid()))!=NULL)
+	if ((pw=getpwuid(getuid()))==NULL)
+		return NULL ;
+	else
+	if (strcmp(pw->pw_name, "bbs")==0)
+		return NULL;
+	else
 		return(pw->pw_name);
-	else
-		return("");
 }
 
 void update_user(struct person *record, int32_t userposn)
@@ -83,7 +86,10 @@
 gstart:	if (autochat) 
 		name[0]=0;
 	else {
-		printf(_("Please enter username [%s]: "), lname);
+		if (lname == NULL)
+			printf(_("Please enter username: "));
+		else
+			printf(_("Please enter username [%s]: "), lname);
 		get_str(name,NAMESIZE);
 	}
 	strip_name(name);
@@ -336,7 +342,7 @@
 		printf(_("Status set to [%s]\n"),buff);
 	/* if you have a SUCS account, allow auto-registering if the logon name matches the sucs name */
 	/* a special restricted uid */
-	}else if (getuid()!=200 && !internet && !strcasecmp(getmylogin(),tmp->name))
+	}else if (getuid()!=200 && !internet && getmylogin()!=NULL && !strcasecmp(getmylogin(),tmp->name))
 	{
 		tmp->status|=1;
 		tmp->groups|=1;




More information about the mw-devel mailing list