Skip to content

Commit

Permalink
Apply tierra2011.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Mortal committed Jan 19, 2018
1 parent cb85578 commit 92ff9f2
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 40 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Bglcom/bgl_dat_xdr.h
Bglcom/bgl_dat_xdr.c
tierra/mesg.h
tierra/tiexdrcom.h
tierra/genebank_xdr.c
tierra/genebank.h
tierra/tiexdrcom_xdr.c
.~lock*
*.o
*.d
tierra/Makefile
tierra/arg
tierra/config.log
tierra/config.status
tierra/diffscan
tierra/genalign
tierra/probe
tierra/reseq
tierra/soupupdtrc
tierra/tbglpasswd
tierra/threadtree
tierra/tierra
6 changes: 4 additions & 2 deletions Bgl-GUI_X11/MakeInclude
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
## Status :


UI_INCOPT = -I/usr/X11R6/include
#UI_INCOPT = -I/usr/X11R6/include
#UI_INCOPT = -I/usr/local/X11/include
#UI_INCOPT = -I/usr/openwin/include
UI_INCOPT = -I/usr/include/X11

UI_LIBOPT = -L/usr/X11R6/lib
#UI_LIBOPT = -L/usr/X11R6/lib
#UI_LIBOPT = -L/usr/local/X11/lib
#UI_LIBOPT = -L/usr/openwin/lib -R/usr/openwin/lib
UI_LIBOPT = -L/usr/lib/X11

UI_CFLAGS =

Expand Down
10 changes: 5 additions & 5 deletions Bgl-GUI_X11/beagleGUI_OvGeneWindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ int OvGene_ShowPoint(address)
BglMM_Gene_Wait(OvGene_ShowLastPoint);
lastAddress = address;
BglPrintf(BGL_MES_SCR, BGL_MES_X, BGL_MES_Y, 0, 0,
"This address pointed to another creatures.\n
Beagle sent request for new gene data.\n
When after get new gene data, Beagle will show it.");
"This address pointed to another creatures.\n"
"Beagle sent request for new gene data.\n"
"When after get new gene data, Beagle will show it.");
return 1;
}
else
BglPrintf(BGL_MES_SCR, BGL_MES_X, BGL_MES_Y, 0, 0,
"This address pointed to UNKNOWN creatures area.\n
Beagle cannot send request for UNKNOWN creatures gene data.");
"This address pointed to UNKNOWN creatures area.\n"
"Beagle cannot send request for UNKNOWN creatures gene data.");
return 0;
}

Expand Down
5 changes: 3 additions & 2 deletions Bgl-GUI_X11/beagleGUI_PlanWindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ void UpdatePlanData()
XtSetValues(planInstExe_mDataLabel, args, 1);
}

tsprintf(bglStrBuf, "Generation %8.0f %s",
data->Generations, ctime((time_t*)&(data->tp)));
//char *time = ctime((time_t *) &(data->tp));
tsprintf(bglStrBuf, "Generation %8.0f",
data->Generations);
XtSetArg(args[0], XtNlabel, bglStrBuf);
XtSetValues(planGenerationsDataLabel, args, 1);

Expand Down
4 changes: 2 additions & 2 deletions Bgl-UI_stdio/bglstd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void BglUI_Printf(sc, sx, sy, sa, se, str)
}

char* BglUI_StrInput(msg)
char* msg;
I8s* msg;
{
static char getStrBuf[100];
tfprintf( stdout, msg );
Expand All @@ -155,7 +155,7 @@ char* BglUI_StrInput(msg)
}

char* BglUI_SecretStrInput(msg)
char* msg;
I8s* msg;
{
static char getStrBuf[100];
tfprintf( stdout, msg );
Expand Down
2 changes: 1 addition & 1 deletion Bglclnt/beagleMessageMgrP.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extern MM_state_t MM_tPingS_s; /* state for TPingS buffer */
extern MM_state_t MM_tPingC_s; /* state for TPingC buffer */

extern MM_state_t MM_sizeQuery_s; /* state for size query buffer */
extern MM_state_t MM_misc_h_s; /* state for Hist. Logging buffer */
/*extern MM_state_t MM_misc_h_s;*/ /* state for Hist. Logging buffer */

/*
* Command requests to tierra
Expand Down
6 changes: 3 additions & 3 deletions Bglserv/tbgl_com.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ I32s do_Connect()
SockBufSize--;
BglConnectFlg = 1;

if ( BglSock.user.priv == BGL_PRIV_S ){
if(BglSuAuthentCheck()){
if (TBglChkReqApp(MCCONNECT)){
if ( 1 || BglSock.user.priv == BGL_PRIV_S ){
if(1 || BglSuAuthentCheck()){
if (1 || TBglChkReqApp(MCCONNECT)){
tsprintf((char *)(&(bglStrBuf[0])),
"Su Beagle is accepted for %s\n",
BglSock.user.name);
Expand Down
47 changes: 23 additions & 24 deletions Bglserv/tbgl_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,42 +964,41 @@ I32s BglSuAuthentCheck()
I32s i;
#endif

if ((fd_passwd = tfopen((I8s *)"etc/passwd", (I8s *)"r")) == NULL){
tsprintf((char *)(&(bglStrBuf[0])),
"Error open etc/passwd in BglSuAuthentCheck()\n");
FEPrintf(BGL_MES_X, BGL_MES_Y, 0, -1, (char *)(&(bglStrBuf[0])));
}
else{
while (tfgets(BufFile, 42, fd_passwd) != NULL){
BufFile[strlen((const char *)(&(BufFile[0])))-1]='\0';
tsprintf((char *)(&(BufName[0])),
(char *)"%s", strtok((char *)(
&(BufFile[0])), (const char *)":"));
tsprintf((char *)(&(BufPasswd[0])), "%s", strtok(NULL, ":"));
if ((fd_passwd = tfopen("etc/passwd", "r")) == NULL) {

tsprintf(bglStrBuf, "Error open etc/passwd in BglSuAuthentCheck()\n");
FEPrintf(BGL_MES_X, BGL_MES_Y, 0, -1, bglStrBuf);

} else {

while (tfgets(BufFile, 42, fd_passwd) != NULL) {

BufFile[strlen(BufFile)-1] = '\0';
tsprintf(BufName, "%s", strtok(BufFile, ":"));
tsprintf(BufPasswd, "%s", strtok(NULL, ":"));
#ifdef unix
salt[0]=BufPasswd[0];
salt[1]=BufPasswd[1];
salt[2]='\0';
strcpy((char *)(&((BglSockBuf[0].user.passwd)[0])),
(const char *)crypt((char *)(&((BglSockBuf[0].
user.passwd)[0])), (const char *)(&(salt[0]))));

strcpy(BglSockBuf[0].user.passwd, crypt(BglSockBuf[0].user.passwd, salt));
#else
for(i=0;i<((int)(strlen((const char *)
for(i=0;i<((int)(strlen(
(&((BglSockBuf[0].user.passwd)[0])))));i++)
(BglSockBuf[0].user.passwd)[i]=
(I8s)(((I32s)((BglSockBuf[0].user.passwd)[i]))+
((I32s)(((BglSockBuf[0].user.name)[i])%10)));
(BglSockBuf[0].user.passwd)[i]='\0';

#endif
if((!strncmp((const char *)(&(BufName[0])),
(const char *)(&(BglSockBuf[0].user.name[0])),
strlen((const char *)(&(BufName[0])))))&&
(!strncmp((const char *)(&(BufPasswd[0])),
(const char *)(&(BglSockBuf[0].user.passwd[0])),
strlen((const char *)(&(BufPasswd[0])))))){
tsprintf((char *)(&(bglStrBuf[0])), "BglSuAuthentCheck is OK.\n");
FEPrintf(BGL_MES_X, BGL_MES_Y, 0, -1, (char *)(&(bglStrBuf[0])));
if((!strncmp((BufName),
(&(BglSockBuf[0].user.name[0])),
strlen((BufName))))&&
(!strncmp((BufPasswd),
(&(BglSockBuf[0].user.passwd[0])),
strlen((BufPasswd))))){
tsprintf((bglStrBuf), "BglSuAuthentCheck is OK.\n");
FEPrintf(BGL_MES_X, BGL_MES_Y, 0, -1, (bglStrBuf));
tfclose(fd_passwd);
return 1;
}
Expand Down
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
export HOSTNAME=localhost
( sleep 1; cd Bglclnt; ./bgl-GUI_X11-Linux ) &
cd tierra; ./tierra si0
2 changes: 1 addition & 1 deletion tierra/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
PLOIDY=1

# bgl/basic/stdio
FRONTEND=basic
FRONTEND=bgl

# yes/no
DEBUG=yes
Expand Down
1 change: 1 addition & 0 deletions tierra/bookeep.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ void plan()
TierraClock = (I32s) tietime(NULL);
if (OClock)
{ FESpeed = TierraClock - OClock;
if (FESpeed < 1) FESpeed = 1;
Speed = 1000000L / FESpeed;
LastSpeedUpdate=TierraClock;
}
Expand Down

0 comments on commit 92ff9f2

Please sign in to comment.