ckc302.txt 387 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882
  1. C-KERMIT 9.0 CHANGE LOG (Changes since 8.0.207 / K95 2.1.3 January 2003)
  2. Chronological order.
  3. Go to the bottom to find the newest edits.
  4. F. da Cruz, The Kermit Project, Columbia University, NYC.
  5. Last update: 28 June 2011.
  6. FTP USER, FTP ACCOUNT, plus the various prompts and switches for FTP username,
  7. password, and account all neglected to strip quotes, and in most cases quotes
  8. are necessary to specify a username that contains spaces. ckcftp.c,
  9. 15 Jan 2003.
  10. FTP MPUT f1 f2 f3... gets a parse error if any of the fn's do not match an
  11. existing file. This is bad for scripts. In doftpput(), cmfdb() looks for
  12. keywords (switches) or CMIFI. When it hits CMIFI, it exits from the initial
  13. parse loop and then does additional cmifi()s in a loop until done. The most
  14. obvious fix is to parse each field with cmfdb(CMIFI,CMFLD), i.e. fall back to
  15. CMFLD if CMIFI doesn't match anything. Then if CMFLD was used, we don't add
  16. the filespec to the list. This is a rather big change but it seems to work.
  17. No error messages or failures happen for non-matching fields, but an error
  18. message is printed (and the MPUT command fails) if none of the fields match
  19. any files. This fix got in too late for 2.1.3; workaround: use C-Shell
  20. like wildcard list (ftp mput "{*.abc,foo.*}"). ckcftp.c, 16 Jan 2003.
  21. GREP did not pass its pattern through the expander, thus variables could
  22. not be used for patterns. This must have been an oversight -- I can't find
  23. anything in my notes about it. Fixed in dogrep(): ckuus6.c, 24 Jan 2003.
  24. New makefile target for HP-UX 11.xx with OpenSSL from Tapani Tarvainen.
  25. makefile, 31 Jan 2003.
  26. From Jeff:
  27. . Avoid core dump when dereferencing tnc_get_signature(): ckuus4.c.
  28. . Bump version numbers to 8.0.208, 2.1.4: ckcmai.c.
  29. Added /NOLOGIN to FTP [OPEN]. ckcftp.c, 10 Feb 2003.
  30. Don't dump core if FTP DEBUG is ON and FTP OPEN does not include a service.
  31. openftp(): ckcftp.c, 10 Feb 2003.
  32. HELP PATTERN text incorrectly identified commands and functions with
  33. floating and anchored patterns. The corrected lists are:
  34. Floating: GREP, TYPE /MATCH:, /EXCEPT: patterns, \farraylook(),
  35. Anchored: IF MATCH, file-matching wildcards, \fsearch(), \frsearch()
  36. ckuus2.c, 10 Feb 2003.
  37. INPUT n \fpattern(xxx) did not work for case-independent comparisons.
  38. Fixed in doinput(): ckuus4.c, 10 Feb 2003.
  39. It seems \fpattern() didn't work with MINPUT at all. There was no code to
  40. handle \fpattern() in the MINPUT parse loop, so it never worked. The code
  41. had to be totally rewritten to use cmfld() in a loop, rather than cmtxt()
  42. and then cksplit(). Furthermore, whenever any of the fields was an
  43. \fjoin(), this had to be split. ckuusr.c, 10 Feb 2003.
  44. Macro replacement via \m() and \fdefinition() does not work as advertised
  45. (i.e. case sensitively) for associative array elements; e.g. \m(xxx<abc>) is
  46. treated the same as \m(xxx<ABC>), contrary to section 7.10.10 of the C-Kermit
  47. 7.0 update notes, and to the fact that the two really do exist separately.
  48. Fixed by adding a static function isaarray(s) which succeeds if s is an
  49. associative array reference and fails otherwise, and then having \m()
  50. and \fdef() call mxxlook() (case-sensitive lookup) if isaarray(), otherwise
  51. (as before) mxlook()). ckuus4.c, 11 Feb 2003.
  52. Fixed FTP OPEN to allow the /USER switch to override SET FTP AUTOLOGIN OFF,
  53. just as /NOLOGIN overrides SET FTP AUTOLOGIN ON. ckcftp.c, 11 Feb 2003.
  54. In K95, "set key \1234 \27H" (any SET KEY command in which the first char of
  55. the definition was backslash, and the ONLY character after the backslash
  56. quantity was an uppercase letter, that letter would be lowercased). Diagnosis:
  57. xlookup() poking its argument (see notes from July 2000). Jeff sent a fix.
  58. ckucmd.c, 15 Feb 2003.
  59. Ran my S-Expression torture test to make sure Sexps still worked. They do,
  60. except the bitwise & and | operators were broken, e.g. (& 7 2) and (| 1 2 4)
  61. get "Invalid operand" errors. Jeff's code had added an early failure return
  62. from the lookup loop when when a single-byte keyword matched a keyword that
  63. started with the same byte but was more than one byte long. So "&" would hit
  64. "&&" and fail instead of continuing its search (xlookup tables aren't sorted
  65. so there can be no early return). Fixed in xlookup(): ckucmd.c, 16 Feb 2003.
  66. Got rid of "krbmit" target from makefile. It's still there, but we don't
  67. use it any more. All secure targets now use "xermit", and produce a binary
  68. called wermit, just like the regular ones do (except the old ckucon.c ones).
  69. Non-secure targets, since they don't define any of the security symbols,
  70. wind up compiling and linking to (mostly) empty security modules. makefile,
  71. 15 Feb 2003.
  72. Added \fcvtdate(xxx,3) to format its result in MDTM format (yyyymmddhhmmss,
  73. all numeric, no spaces or punctuation). Of course these numeric strings
  74. are too big to be 32-bit numbers and are useless for arithmetic, but they're
  75. useful for lexical comparison, etc. ckuus[24].c, 16 Feb 2003.
  76. The following FTP commands did not set FAILURE when they failed: RMDIR,
  77. CD, CDUP, Fixed in the corresponding doftpblah() routines. ckcftp.c,
  78. 16 Feb 2003.
  79. RENAME would sometimes not print an error message when it failed, e.g. in K95
  80. when the destination file already existed. ckuus6.c, 17 Feb 2003.
  81. Fixed COPY error messages, which did not come out in standard format when
  82. /LIST was not included. ckuus6.c, 17 Feb 2003.
  83. Fixed #ifdefs in ck_crp.c to allow nonsecure builds on old platforms like
  84. System V/68 R3. 19 Feb 2003.
  85. Similar treatment for ck_ssl.c. 20 Feb 2003.
  86. From Jeff, 21 Feb 2003:
  87. . AIX53 and AIX52 symbols for ckcdeb.h, makefile.
  88. . New gcc targets for various AIX 4.x/5.x versions: makefile.
  89. . Copyright date updates: ck_crp.c, ck_ssl.c.
  90. . ENABLE/DISABLE QUERY broken because keyword table out of order: ckuusr.c.
  91. . Fixed the use of HTTP proxies for HTTP [RE]OPEN for Unix: ckcnet.c.
  92. Also for K95 only: Allow file transfer when K95 is invoked on the remote end
  93. of a connection to a Pragma Systems Terminal Server connection; automatically
  94. SET EXIT HANGUP OFF when invoked with open port handle ("k95 -l nnnn").
  95. "cd a*" failed even when "a*" matched only one directory. Fixed in cmifi():
  96. ckucmd.c, 21 Feb 2003.
  97. In the Unix version, replace "extern int errno;" with "#include <errno.h>"
  98. if __GLIBC__ is defined, since glibc now defines a thread-specific errno.
  99. ckcdeb.h, 26 Feb 2003.
  100. Added #ifdefs to skip compilation of ckuath.c in nonsecure builds. Tested
  101. by building both secure and regular versions in Linux. ckuath.c, 26 Feb 2003.
  102. Ran the build-in-84-different-configurations script on Linux to make sure it
  103. still builds with all different combinations of feature selection options.
  104. All OK. 26 Feb 2003.
  105. Built on VMS. Needed to add a prototype for mxxlook*() to ckuusr.h; built
  106. OK otherwise. 26 Feb 2003.
  107. From Jeff: More #ifdef shuffling for nonsecure builds: ckuath.c, ck_ssl.c,
  108. 27 Feb 2003.
  109. Added code to ensure \v(download) ends in a directory separator in Unix,
  110. Windows, and OS/2. ckuus7.c, 27 Feb 2003.
  111. Added code to K95 zfnqfp() to tack on directory separator when returning
  112. a directory name. ckofio.c, 27 Feb 2003.
  113. Somehow an old copy of ckuath.c popped to replace the new one. Put the new
  114. one back. 28 Feb 2003.
  115. From Jeff: Fix typo in my K95 zfnqfp() code from yesterday; fixes for handling
  116. UNCs uniformly, no matter which way their slashes are leaning. ckofio.c,
  117. 28 Feb 2003.
  118. At Jeff Mezei's suggestion, separate text and binary mode open sequences
  119. for VMS session log. ckvfio.c, 28 Feb 2003.
  120. Added freebsd48 target for FreeBSD 4.8. makefile, 1 Mar 2003.
  121. Changed Mac OS X entries to include -DUSE_STRERROR. makefile, 2 Mar 2003.
  122. Fixed GETOK /GUI to evaluate its text argument. ckuus6.c, 3 Mar 2003.
  123. Jeff fixed the K95 Dialer QUICK dialog to (a) allow templates, and (b) have
  124. a Save-As option. 3 Mar 2003.
  125. Jeff fixed a problem with the Xmodem-CRC checksum being crunched whenever
  126. there was a retransmission. 7 Mar 2003.
  127. Added target/banner for Tru64 5.1B. makefile, ckuver.h, 5 Mar 2003.
  128. In Unix, the zcopy() routine (used by the COPY command) reset the user's umask
  129. to 0 for the remainder of the Kermit process lifetime. The bug was in
  130. ckufio.c 8.0.194, 24 Oct 2002, and is fixed in ckufio.c 8.0.195, 6 Mar 2003.
  131. Of course this happened after building 155 C-Kermit 8.0.208 binaries. (But
  132. before officially releasing 8.0.208.)
  133. In the VMS version, changed:
  134. while ((n--) && xx_inc(2) > -1) ;
  135. to:
  136. while ((n--) && xx_inc(2) >= 0) ;
  137. to suppress the "...is being compared with a relational operator to a constant
  138. whose value is not greater than zero" warning. ckvtio.c, 7 Mar 2002.
  139. Added a debug call to dologend in hopes of catching overzealous Locus
  140. switching, which seems to happen only in K95. ckuus3.c, 7 Mar 2002.
  141. Rebuilt binaries for some of the more current Unix releases: AIX 4.3.3-5.1,
  142. Solaris 7-9 , Red Hat 7.0-8.0, Slackware 8.1, Freebsd 4.7-4.8, NetBSD 1.6,
  143. OpenBSD 3.2, Unixware 7.1.3, Open Unix 8, OSR5.0.6a, etc. A Unix binary with
  144. COPY umask fix shows a 6 Mar 2003 date for "UNIX File support" in SHOW
  145. VERSIONS; a binary without the fix shows 24 Oct 2002.
  146. C-Kermit 8.0.208 dated 14 March 2003 released on 10 March 2003.
  147. ---8.0.208---
  148. From Jeff 13 Mar 2003:
  149. . Updated SSL module allows importation of tickets from host.
  150. . freebsd50+openssl target: makefile.
  151. . FTP PUT /PERMISSIONS error message for K95: ckcftp.c.
  152. Fixed MINPUT to strip quotes or braces from around targets (this was broken
  153. on Feb 10th). Thanks to Jason Heskett for discovering and reporting this
  154. (killer) bug. ckuusr.c, 14 Mar 2003.
  155. Changed version number to 209 Dev.00. ckcmai.c, 14 Mar 2003.
  156. While debugging the alphapage script, I found that the command "minput 8 \6\13
  157. \21\13 \13\27\4\13 \30\13" gets "?Not confirmed" in 8.0.208 and 8.0.209, but
  158. not in 206 and earlier. This problem too was introduced on Feb 10th by
  159. changing MINPUT parsing from cmtxt() followed by cksplit() to cmfld() in a
  160. loop. cmfld() uses setatm() to return its result and of course setatm()
  161. breaks on \13. Changing setatm() not to do this would break everything else.
  162. But cmfld() has no arguments that let us tell it to do anything different in
  163. this case. Changing the API would be a disaster. The only solution is to add
  164. an "MINPUT ACTIVE" (minputactive) global variable that tells cmfld() to tell
  165. setatm() not to break on CR. Now MINPUT with braced targets containing CR
  166. and/or LF works in 209, 206, and 201 (but not 208). ckucmd.c, ckuusr.c,
  167. ckuus5.c, 15 Mar 2003.
  168. MINPUT n \fjoin(&a) works OK if all the members of \&a[] are text strings, but
  169. if they are strings of control chars (as above), they don't get separated by
  170. the spaces. For example in:
  171. dcl \&a[] = "\4\5" "\6\7" xxx
  172. minput 10 \fjoin(&a)
  173. MINPUT gets two targets: "aaa" and "\4\5 \6\7 xxx". The bug was in the
  174. cksplit() call in the \fjoin() case of MINPUT: it needed to specify an
  175. include set consisting of all the control characters except NUL. ckuusr.c,
  176. 16 Mar 2003.
  177. But there's still a problem:
  178. dcl \&a[] = "\4\5\13\10" "\6\7" "xxx"
  179. creates an array whose first member is "^D^E (one doublequote included). But
  180. if braces are used instead, there's no problem. Same deal as MINPUT: cmfld()
  181. breaks on CR or LF, thus the end quote is lost. If I set minputactive for
  182. DECLARE initializers too, that fixes it. Is there any reason not to do this?
  183. Can't think of any (famous last words)... ckuusr.c, 16 Mar 2003.
  184. Since it has multiple applications, changed the flag's name from minputactive
  185. to keepallchars. ckucmd.c, ckuus[r5].c, 16 Mar 2003.
  186. \v(exedir) wasn't being set correctly (it included the program name as well
  187. as the directory). Fixed in getexedir(): ckuus4.c, 16 Mar 2003.
  188. SET CARRIER-WATCH <Esc> "auto matic" (spurious space in supplied keyword).
  189. Cosmetic only; it still worked. Fixed in setdcd(): ckuus3.c, 16 Mar 2003.
  190. "directory a b c" listed too many files -- all files whose names END WITH a,
  191. b, or c, rather than the files whose names WERE a, b, or c. Diagnosis: The
  192. filespec is changed into a pattern: {a,b,c}, which is the correct form. It is
  193. passed to nzxpand(), which goes through the directory getting filenames and
  194. sending each one to ckmatch() with the given pattern. ckmatch() receives the
  195. correct pattern but then prepends a "*" -- that's not right. It's not just
  196. in filename matching either. The following succeeds when it shouldn't:
  197. if match xxxxc {{a,b,c}} <command>
  198. Changing ckmatch() to not prepend the "*" to each segment fixes the command
  199. above but breaks lots of others. Running through the "match" torture-test
  200. script shows the problem occurs only when the {a,b,c} list is the entire
  201. pattern, and not embedded within a larger pattern. Testing for this case
  202. fixed the problem. ckmatch(): ckclib.c, 16 Mar 2003.
  203. Fixed FTP MODTIME to not print anything if QUIET ON. ckcftp.c, 16 Mar 2003.
  204. Picked up a new ckuath.c from Jeff, not sure what the changes are. 16 Mar 2003.
  205. Did a few regular and secure builds to make sure I didn't wreck anything.
  206. Changed version number to 209 (final). ckcmai.c, 16 Mar 2003.
  207. Jason Heskett found another bug: if you define a macro FOO inside the
  208. definition of another macro BAR, and FOO's definition includes an odd number
  209. of doublequotes (such as 1), FOO's definition absorbs the rest of BAR's
  210. definition. Example:
  211. def TEST {
  212. .foo = {X"}
  213. sho mac foo
  214. }
  215. do test
  216. sho mac foo
  217. Results in:
  218. foo = {X"}, sho mac foo
  219. Diagnosis: the TEST definition becomes:
  220. def TEST .foo = {X"}, sho mac foo
  221. and the macro reader is erroneously treating the doublequote as an open
  222. quote, and then automatically closes the quote at the end of the definition.
  223. The error is that a doublequote should be significant only at the beginning of
  224. a field. But the macro reader isn't a command parser; it doesn't know what
  225. a field is -- it's just looking for commas and skipping over quoted ones.
  226. First we have to fix an oversight: SET COMMAND DOUBLEQUOTING OFF should have
  227. worked here, but it wasn't tested in this case. Fixed in getncm(): ckuus5.c,
  228. 17 Mar 2003.
  229. There are only certain cases where it makes sense to treat doublequotes as
  230. significant:
  231. . An open quote must be at the beginning or preceded by a space.
  232. . A close quote is only at the end or else followed by a space.
  233. This too was fixed in getncm(): ckuus5.c, 17 Mar 2003.
  234. A fix from Jeff SSL/TLS FTP data decoding. ckcftp.c, 18 Mar 2003.
  235. Tried building C-Kermit on a Cray Y-MP with UNICOS 9.0. "int suspend",
  236. declared in ckcmai.c and used in many modules, conflicts with:
  237. unistd.h:extern int suspend __((int _Category, int _Id));
  238. The "=Dsuspend=xsuspend" trick doesn't work for this; there is no way around
  239. the conflict other than to rename the variable: ckcmai.c, ckutio.c,
  240. ckuus[35xy].c. 26 Mar 2003. VMS and K95 not affected.
  241. OK that gets us past ckcmai.c... Then in ckutio.c I had to add a new #ifdef
  242. around the LFDEVNO setting, because the Cray didn't have mkdev.h. Could not
  243. find a Cray-specific manifest symbol, so I made a new makefile target (cray9)
  244. that sets this symbol. Having done this I have no idea what kind of lockfile
  245. would be created, but I also doubt if anybody dials out from a Cray. The
  246. binary should run a C90, J90, or Y-MP. makefile, 26 Mar 2003.
  247. Added a target for SCO OSR5.0.7. makefile, ckuver.h, 30 Mar 2003.
  248. Changed since 208:
  249. makefile ckuver.h ckcmai.c ckclib.c ckcftp.c ckucmd.c ckuus*.c ckutio.c.
  250. ---8.0.209---
  251. From Mark Sapiro, a fix for the March 17th doublequote fix, getncm(): ckuus5.c,
  252. 4 Apr 2003.
  253. From Jeff, 29 Apr 2003:
  254. . Corrected target for HP-UX 11.00 + OpenSSL: makefile,
  255. . Do not allow WILL AUTH before WONT START_TLS: ckctel.h ckctel.c
  256. . Add hooks for SFTP and SET/SHOW SFTP: ckcdeb.h ckuusr.h ckuusr.c ckuus3.c
  257. . Add SKERMIT ckuusr.h ckuusr.c
  258. . Add ADM-5 terminal emulation: ckuus7.c, ckuus5.c
  259. . Uncomment and update HELP SET SSH V2 AUTO-REKEY: ckuus2.c
  260. . Enable IF TERMINAL-MACRO and IF STARTED-FROM-DIALER for C-Kermit: ckuus6.c
  261. . Fix conflicting NOSCROLL keyword definition: ckuusr.h
  262. . Set ttname when I_AM_SSH: ckuusy.c
  263. . Add extended arg parsing for SSH, Rlogin, Telnet: ckuusy.c, ckuus4.c
  264. . Security updates: ckuath.c, ck_ssl.c
  265. . Change K95 version number to 2.2.0: ckcmai.c
  266. . Save K95 term i/o state before executing keyboard macro: ckuus4.c
  267. . Add tests for SSH Subsystem active during INPUT/OUTPUT/CONNECT: ckuus[45].c
  268. . Enable K95 SET SSH V2 AUTO-REKEY: ckuus3.c
  269. SFTP and SET SFTP subcommands are implemented up to the case statements.
  270. Files of mine that Jeff hadn't picked up:
  271. ckuver.h ckcftp.c ckutio.c ckuusx.c (just minor changes for last build-all)
  272. On 4 Jan 2003, SET RECEIVE MOVE-TO was changed to convert is argument to an
  273. absolute path, which made it impossible to specify a relative path, then
  274. move to different directories and have it apply relatively to each directory.
  275. Changed this as follows:
  276. . Parser uses cmtxt() rather than cmdir() so it won't fail at parse time.
  277. . If path is absolute, we fail at parse time if directory doesn't exist.
  278. . In reof() we run the the path through xxstring (again, in case deferred
  279. evaluation of variables is desired) and then, if not null, use it.
  280. . If the directory doesn't exist, rename() fails and reof() returns -4,
  281. resulting in a protocol error (this is not a change). We do NOT create
  282. the directory on the fly.
  283. I also fixed SET SEND/RECEIVE RENAME-TO to parse with cmtxt() rather than
  284. cmdir(), since it's parsing a text template, not a directory name, e.g.
  285. "set receive rename-to file-\v(time)-v(date)-\v(pid)". This was totally
  286. broken, since when I don't know. We don't call xxstring() in this parse, so
  287. evaluation is always deferred -- I'd better not change this. ckuus7.c,
  288. ckcfns.c, 1 May 2003.
  289. From Jeff, Sat May 3 14:15:23 2003:
  290. . Pick up the right isascii definition for K95: ckctel.c
  291. . malloc... ckuath.c (new safe malloc routines for K95)
  292. . Add author listing: ckuus5.c
  293. . SSH Heartbeat support (K95 only): ckuus[23].c
  294. . Prescan --height and --width to avoid window resizing at startup: ckuusy.c
  295. . Add checks for fatal() or doexit() called from sysinit(): ckuusx.c
  296. . Move some K95-specific definitions to ckoker.h: ckcdeb.h
  297. . Add support for ON_CD macro in zchdir(): ckufio.c
  298. . Add a command to let FTP client authenticate with SSLv2: ckcftp.c
  299. . Fix parsing of FTP file facts like "UNIX.mode": ckcftp.c
  300. ON_CD will need some explaining (to be done). It's implemented for Unix,
  301. VMS, WIndows, and OS/2.
  302. The FTP file facts fix came from first exposure to the new OpenBSD FTP
  303. server: ftp://ftp7.usa.openbsd.org/pub/os/OpenBSD/3.3/i386/
  304. The period in "UNIX.mode" caused an erroneous word break, adding junk to
  305. the filename.
  306. About the malloc changes, Jeff says "K95 is not behaving well in low memory
  307. environments. I'm not sure that C-Kermit does much better. The program does
  308. not crash but it certainly does not behave the way the user expects it to.
  309. I'm beginning to think that any malloc() error should be treated as fatal."
  310. Not visible in these changes because it's in K95-specific modules: Jeff made
  311. SET ATTRIBUTES OFF and SET ATTRIBUTES DATE OFF apply to XYZMODEM transfers.
  312. From Jeff, 11 May 2003:
  313. . Add support for SSH Keepalive to relevant SET command (K95): ckuus3.c
  314. . Reduce max overlapped i/o requests from 30 to 7 (K95): ckuus7.c
  315. . Don't call sysinit() in fatal(): ckuusx.c.
  316. . Some new conditionalizations for SSL module: ck_ssl.c
  317. The doublequote-parsing fixes from March and April broke the SWITCH statement,
  318. which is implemented by internally defining, then executing, a macro. If I
  319. drop back to the old dumb handling of doublequotes, everything is fixed except
  320. the problem of March 17th. But can we really expect getncm() to pre-guess
  321. what the parser is going to do? getncm()'s only job is to find command
  322. boundaries, which are represented by commas. Commas, however, is needed IN
  323. commands too. We take a comma literally if it is quoted with \, or is inside
  324. a matched pair of braces, parens, or doublequotes. It is not unreasonable to
  325. require a doublequote in a macro definition to be prefixed by \ when it is to
  326. be taken literally. The proper response to Jason Heskett's complaint of March
  327. 17th should have been to leave the code alone and recommand an appropriate
  328. form of quoting:
  329. def TEST {
  330. .foo = {X\"}
  331. sho mac foo
  332. }
  333. And this is what I have done. Another reason for sticking with the old method
  334. is that it's explainable. The "improved" method, even if it worked, would be
  335. be impossible to explain. Btw, in testing this I noticed that the switch-test
  336. script made 8.0.201 dump core. Today's version is fine. The problem with
  337. quoted strings inside of IF {...} clauses and FOR and WHILE loops is fixed
  338. too. Perhaps "unbroken" would be a better word. ckuus5.c, 11 May 2003.
  339. Vace discovered that FTP MGET /EXCEPT:{... (with an unterminated /EXCEPT list)
  340. could crash Kermit. Fixed in ckcftp.c, 11 May 2003.
  341. CONTINUE should not affect SUCCESS/FAILURE status. ckuusr.c, 11 May 2003.
  342. Fixed an oversight that goes back 15 years. While \{123} is allowed for
  343. decimal codes, \x{12} and \o{123} were never handled. ckucmd.c, 11 May 2003.
  344. Added support for Red Hat <baudboy.h> and /usr/sbin/lockdev. Supposedly this
  345. allows Kermit to be installed without setuid or setgid bits and still be able
  346. to lock and use the serial device. Compiles and starts, but not tested.
  347. ckcdeb.h, makefile, ckutio.c, ckuus5.c, 16 May 2003.
  348. From Jeff: FTP ASCII send data to host when FTP /SSL was in use was broken.
  349. ftp_dpl is set to Clear when FTP /SSL is in use. This was causing the data to
  350. be written to the socket with send() instead of the OpenSSL routines.
  351. ckcftp.c, ckuath.c, 21 May 2003.
  352. From Jeff: Stuff for Kerberos 524: ckcdeb.h. Fixes for FTP; "FTP ASCII send
  353. data did not properly compute the end of line translations. On Unix (and
  354. similar platforms) the end of line was correct for no character sets but
  355. incorrect when character sets were specified. On Windows/OS2, the end of line
  356. was correct when character sets were specified and incorrect when they were
  357. not. On MAC, both were broken. Also, FTP Send Byte counts were incorrect
  358. when character sets were specified." ckcftp.c. 17 Jun 2003.
  359. From Jeff: fixes to HTTP /AGENT: and /USER: switch action: ckcnet.c ckuus3.c
  360. ck_crp.c ckcftp.c ckuus2.c ckuusy.c ckuusr.c ckcnet.h, 21 Jun 2003.
  361. From Jeff: Fix SET DIALER BACKSPACE so it can override a previous SET KEY
  362. (e.g. from INI file): ckuus7.c. Some SSL/TLS updates: ck_ssl.c. HTTP support
  363. for VMS and other VMS improvements (e.g. a way to not have to hardwire the
  364. C-Kermit version number into the build script) from Martin Vorlaender:
  365. ckcnet.h, ckuus[r3].c, ckcdeb.h, ckvtio.c, ckcnet.c, ckvker.com. Built on
  366. Solaris (gcc/ansi) and SunOS (cc/k&r). The new VMS script tests the VMS
  367. version and includes HTTP support only for VMS 6.2 or later. 2 Jul 2003.
  368. Tried to build on our last VMS system but it seems to be dead. Looks like a
  369. head crash (makes really loud noises, boot says DKA0 not recognized) (fooey, I
  370. just paid good money to renew the VMS license). Tried building at another
  371. site with:
  372. Process Software MultiNet V4.3 Rev A-X,
  373. Compaq AlphaServer ES40, OpenVMS AXP V7.3
  374. Compaq C V6.4-008 on OpenVMS Alpha V7.3
  375. Had to make a few corrections to ckvker.com. But still, compilation of
  376. ckcnet.c bombs, indicating that the SELECT definition somehow got lost
  377. somewhere since the 209 release (i.e. no SELECT type is defined so it falls
  378. thru to "SELECT is required for this code"). But I don't see anything in
  379. ckcdeb.h or ckcnet.[ch] that would explain this. Not ckvker.com either
  380. (putting the old one back gives the same result). OK, I give up, maybe it's
  381. just that I haven't tried building it on MultiNet recently. What about UCX?
  382. Aha, builds fine there except for warnings about mlook, dodo, and parser in
  383. ckvfio.c (because of ON_CD) -- I suppose I have #include <ckucmd.h>... (done)
  384. Anyhow it builds OK and the HTTP code is active and almost works (HTTP OPEN
  385. works; HTTP GET seems to succeed but creates an empty file every time). Tried
  386. building under MultiNet at another installation; same bad result.
  387. OK so why won't it build for MultiNet? Comparing ckcnet.c with the 209
  388. version, not a single #ifdef or #include is changed. Tried building with
  389. p3="NOHTTP" -- builds OK, aha. Where's the problem? Not ckcnet.h...
  390. Not ckcdeb.h... OK I give up, will revisit this next time I get time to
  391. do anything with the code.
  392. Later Jeff said "Martin did not implement VMS networking for the HTTP code.
  393. All he did was activate the #define HTTP which happens to work because his
  394. connections are using SSL/TLS connections. http_inc(), http_tol(), etc have
  395. no support for VMS networking regardless of whether it is UCX or MULTINET.
  396. The vast majority of HTTP connections are not secured by SSL/TLS. It makes no
  397. sense to support HTTP on VMS until someone is willing to either do the work or
  398. pay have the work done to implement VMS networking in that code base." So the
  399. fix is to not enable HTTP for VMS after all. Removed the CKHTTP definition
  400. for VMS from ckcdeb.h, 6 Jul 2003.
  401. Fixed ckvfio.c to #include <ckuusr.h> (instead of <ckucmd.h>) to pick up
  402. missing prototypes. 6 Jul 2003.
  403. From Arthur Marsh: solaris2xg+openssl+zlib+srp+pam+shadow and the corresponding
  404. Solaris 7 target. makefile, 6 Jul 2003.
  405. Remove duplicate #includes for <sys/stat.h>, <errno.h>, and <ctype.h> from
  406. ckcftp.c. 6 Jul 2003.
  407. Add -DUSE_MEMCPY to Motorola SV/68 targets because of shuffled #includes in
  408. ckcftp.c. 8 Jul 2003.
  409. From Jeff: Fix problems mixing SSL and SRP without Kerberos. Plus a few minor
  410. #define comment changes and a reshuffling of #defines in ckcdeb.h to allow me
  411. to build on X86 Windows without Kerberos. ckcdeb.h, ck_crp.c, ckuath.c,
  412. 10 Jul 2003.
  413. From Jeff: updated ckuat2.h and ckuath.c, 29 Jul 2003.
  414. Mats Peterson noticed that a very small Latin-1 file would be incorrectly
  415. identified as UCS-2 by scanfile(). Fixed in ckuusx.c, 29 Jul 2003.
  416. Fixed ACCESS macro definition to account for the fact that FIND is now a
  417. built-in command. ckermit.ini, 30 Jul 2003.
  418. From Jeff: Fix for typo in urlparse() (svc/hos): ckuusy.c, 18 Aug 2003.
  419. From Jeff: Redhat9 makefile targets (needed for for OpenSSL 0.9.7):
  420. makefile, 19 Aug 2003.
  421. GREP /NOLIST and /COUNT did too much magic, with some undesirable fallout:
  422. "GREP /NOLIST /COUNT:x args" printed "file:count" for each file. "GREP
  423. /COUNT:x /NOLIST args" did not print "file:count", but neither did it set the
  424. count variable. Removed the magic. Also one of the GREP switches,
  425. /LINENUMBERS, was out of order. Fixed in ckuus6.c, 20 Aug 2003.
  426. From Jeff: "Reorganizing code to enable building with different subsets of
  427. options; a few typos corrected as well." ckcdeb.h, ckuver.h (for RH9),
  428. ckcnet.c, ckuus7.c, ckuus3.c: 24 Aug 2003.
  429. Scanfile misidentified a big PDF file as text because the first 800K of it
  430. *was* text (most other PDF files were correctly tagged as binary). Fixed
  431. by adding a check for the PDF signature at the beginning of the file.
  432. scanfile(): ckuusx.c, 25 Aug 2003.
  433. Ditto for PostScript files, but conservatively. Signature at beginning of
  434. file must begin with "%!PS-Ado". If it's just "%!" (or something nonstandard
  435. like "%%Creator: Windows PSCRIPT") we do a regular scan. Also added "*.ps"
  436. to all binary filename patterns. ckuusx.c, 4 Sep 2003.
  437. Ditto (but within #ifndef NOPCLSCAN) for PCL (<ESC>E) and PJL (<ESC>%) files,
  438. but no binpatterns (note: ".PCL" is the extension for TOPS-20 EXEC scripts).
  439. ckuusx.c, 4 Sep 2003.
  440. Added comments about OpenSSL 0.9.7 to all linux+openssl targets.
  441. makefile, 4 Sep 2003.
  442. From Jeff: Added - #define ALLOW_KRB_3DES_ENCRYPT. When this symbol is defined
  443. at compilation Kermit will allow non-DES session keys to be used during Telnet
  444. Auth. These session keys can then be used for Telnet Encrypt. The reason
  445. this is not compiled on by default is that the MIT Kerberos Telnet does not
  446. follow the RFC for constructing keys for ENCRYPT DES when the keys are longer
  447. than 8 bytes in length. ckuath.c, ckuus5.c, 4 Sep 2003.
  448. "ftp mget a b c" succeeded if one or more of the files did not exist, even
  449. with "set ftp error-action proceed". This is because the server's NLST file
  450. list does not include any files that don't exist, so the client never even
  451. tries to get them. Fortunately, the way the code is structured, this one was
  452. easy to fix. ckcftp.c, 14 Sep 2003.
  453. From Jeff: Corrected code in ckcnet.c to ensure that Reverse DNS Lookups are
  454. not performed if tcp_rdns is OFF. Fixed ck_krb5_getrealm() to actually return
  455. the realm of the credentials cache and not the default realm specified in the
  456. krb5.conf file. Previously krb5_cc_get_principal() was not being called.
  457. Fixed ck_krb5_is_tgt_valid() to test the TGT in the current ccache and not the
  458. TGT constructed from the default realm. ckcnet.c, ckuath.c, 14 Sep 2003.
  459. Marco Bernardi noticed that IF DIRECTORY could produce a false positive if
  460. the argument directory had previously been referenced but then removed. This
  461. is because of the clever isdir() cache that was added to speed up recursion
  462. through big directory trees. Changed IF DIRECTORY to make a second check
  463. (definitive but more expensive) if isdir() succeeds, and changed the
  464. directory-deleting routine, ckmkdir(), to flush the directory cache (UNIX
  465. only -- this also should be done in K95 but it's not critical). This was
  466. done by adding a routine, clrdircache() to ckufio.c, which sets prevstat
  467. to -1 and prevpath[0] to NUL. ckcfn3.c, ckuus6.c, ckufio.c, 18 Sep 2003.
  468. Marco reported the second fix still didn't work for him (even though it did
  469. for me). Rather than try to figure out why, I concluded that the directory
  470. cache is just not safe: a directory found a second ago might have been deleted
  471. or renamed not only by Kermit but by some other process. Why did I add this
  472. in the first place? The log says:
  473. Some debug logs showed that isdir() is often called twice in a row on the
  474. same file. Rather than try to sort out clients, I added a 1-element cache
  475. to Unix isdir(). ckufio.c, 24 Apr 2000.
  476. Experimentation with DIR and DIR /RECURSIVE does not show this happening at
  477. all. So I #ifdef'd out the directory cache (see #ifdef ISDIRCACHE in ckufio.c;
  478. ISDIRCACHE is not defined) and backed off the previous changes: ckufio.c,
  479. ckcfn3.c, ckuus6.c, 28 Sep 2003.
  480. From Jeff: Replace the compile time ALLOW_KRB_3DES_ENCRYPT with a run-time
  481. command SET TELNET BUG AUTH-KRB5-DES which defaults to ON: ckctel.[ch],
  482. ckuus[234].c, ck_crp.c, ckuath.c. 4 Oct 2003.
  483. Allow DIAL RETRIES to be any positive number, and catch negative ones.
  484. Also added code to check for atoi() errors (e.g. truncation). At least on
  485. some platforms (e.g. Solaris) atoi() is supposed to set errno, but it
  486. doesn't. ckuus3.c, ckucmd.c, 4 Oct 2003.
  487. Added /DEFAULT: to ASK-class commands (ASK, ASKQ, GETOK):
  488. . For popups: no way to send defaults to popup_readtext() or popup_readpass().
  489. . For GUI ASK[Q], pass default to gui_txt_dialog().
  490. . For GUI GETOK, convert "yes" "ok" or "no" default to number for uq_ok().
  491. . For Text GETOK, add default to cmkey().
  492. . For Text ASK[Q], add default to cmtxt().
  493. . For GETC, GETKEY, and READ: no changes.
  494. GETOK, ASK, and ASKQ with /TIMEOUT: no longer fail when the timer goes off
  495. if a /DEFAULT was supplied. The GUI functions (uq_blah) don't seem to
  496. support timeouts. Only the text version has been tested. ckuus[26].c,
  497. 4 Oct 2003.
  498. From Jeff: add /DEFAULT: for popups. ckuus6.c. 6 Oct 2003.
  499. Change SET DIAL INTERVAL to be like SET DIAL RETRIES. ckuus[34].c, 6 Oct 2003.
  500. Added target for HP-UX 10/11 + OpenSSL built with gcc, from Chris Cheney.
  501. Makefile, 12 Oct 2003.
  502. From Jeff, 6 Nov 2003:
  503. . #ifdef adjustments: ckcftp.c, ckcdeb.h
  504. . Fix spurious consumption of first byte(s) on Telnet connection: ckctel.c
  505. . Another HP PJL test for scanfile: ckuusx.c.
  506. . K95: Recognize DG4xx protected fields in DG2xx emulation: ckuus7.c.
  507. . Add SSLeay version display to SHOW AUTH command: ckuus7.c
  508. . Improved SET MOUSE CLEAR help text: ckuus2.c.
  509. . Improved Kverbs help text: ckuus2.c (+ new IBM-3151 Kverbs).
  510. . Some changes to ck_ssl.c, ckuath.c.
  511. From PeterE, 10 Nov 2003:
  512. . Improved HP-UX 10/11 makefile targets for OpenSSL.
  513. . #ifdef fix for OpenSSL on HP-UX: ck_ssl.c.
  514. Another new makefile from PeterE with improved and integrated HP-UX targets.
  515. 12 Nov 2003.
  516. A couple fixes to the solaris9g+krb5+krb4+openssl+shadow+pam+zlib target
  517. from Jeff. Added a solaris9g+openssl+shadow+pam+zlib target. makefile,
  518. 21 Nov 2003.
  519. From Jeff, 30 Nov 2003:
  520. . Fix SEND /MOVE-TO: ckuusr.c.
  521. . Fix K95 SET TITLE to allow quotes/braces around text: ckuus7.c.
  522. . Improved "set term autodownload ?" response: ckuus5.c.
  523. . Fix SHOW FEATURES to specify the protocol for encryption: ckuus5.c
  524. . Make {SEND, RECEIVE} {MOVE-TO, RENAME-TO} work for XYZMODEM (K95 only).
  525. From Jeff: 7 Jan 2004:
  526. . At one point Frank started to add a timer parameter to the
  527. uq_txt() function but he only did it for the non-ANSI
  528. compilers. I added it for the ANSI compilers, fixed the
  529. prototypes and provided a default value easily changed
  530. DEFAULT_UQ_TIMEOUT: ckcker.h, ckuus[36].c, ck_ssl.c, ckcftp.c, ckuath.c.
  531. . Fixed SET TERMINAL DEBUG ON (typo in variable name): ckuus7.c.
  532. . Fixed BEEP INFORMATION; previously it made no sound, now uses
  533. MB_ICONQUESTION. ckuusx.c.
  534. From Ian Beckwith <ian@nessie.mcc.ac.uk> (Debianization), 7 Jan 2004:
  535. . Search dir/ckermit for docs, as well as dir/kermit in cmdini(): ckuus5.c.
  536. . New linux+krb5+krb4+openssl+shadow+pam target (kitchen sink minus SRP,
  537. which Debian does not distribute): makefile.
  538. ? Mangles the DESTDIR support in makefile to install into a staging area:
  539. makefile (I didn't take this one yet).
  540. Updated copyright notices for 2004, all modules. 7 Jan 2004.
  541. Added INPUT /NOMATCH, allowing INPUT to be used for a fixed amount of time
  542. without attempting to match any text or patterns, so it's no longer
  543. necessary to "input 600 STRING_THAT_WILL_NEVER_COME". If /NOMATCH is
  544. included, INPUT succeeds if the timeout expires, with \v(instatus) = 1
  545. (meaning "timed out"); fails upon interruption or i/o error. ckuusr.h,
  546. ckuus[r24].c, 7 Jan 2004.
  547. Added SET INPUT SCALE-FACTOR <float>. This scales all INPUT timeouts by the
  548. given factor, allowing time-sensitive scripts to be adjusted to changing
  549. conditions such as congested networks or different-speed modems without
  550. having to change each INPUT-class command. This affects only those timeouts
  551. that are given in seconds, not as wall-clock times. Although the scale
  552. factor can have a fractional part, the INPUT timeout is still an integer.
  553. Added this to SHOW INPUT, and added a \v(inscale) variable for it.
  554. ckuusr.h, ckuus[r257].c, 7 Jan 2004.
  555. undef \%a, \fverify(abc,\%a) returns 0, which makes it look as if \%a is a
  556. string composed of a's, b's, and/or c's, when in fact it contains nothing.
  557. Changed \fverify() to return -1 in this case. ckuus4.c, 12 Jan 2004.
  558. \fcode(xxx) returned an empty string if its argument string was empty. This
  559. makes it unsafe to use in arithmetic or boolean expressions. Changed it to
  560. return 0 if its argument was missing, null, or empty. ckuus4.c, 12 Jan 2004.
  561. Updated \verify() and \fcode() help text. ckuus2.c, 12 Jan 2004.
  562. While setting up IKSD, Ian Beckwith noticed that including the --initfile:
  563. option caused Kermit to start parsing its own Copyright string as if it were
  564. the command line, and eventually crash. I couldn't reproduce on Solaris /
  565. Sparc but I could in Linux / i386 (what Ian is using) -- a change from Jeff
  566. on 28 Apr 2003 set the command-line arg pointer to a literal empty string in
  567. prescan() about line 1740 of of ckuus4.c; the pointer is incremented next
  568. time thru the loop, resulting in random memory being referenced. Fixed by
  569. setting the pointer to NULL instead of "". ckuus4.c, 12 Jan 2004.
  570. declare \&a[999999999999999] would dump core on some platforms. atoi()
  571. or whatever would truncate the dimension to maxint. When we add 1 to the
  572. result, we get a negative number, which is used as an index, loop test, etc.
  573. Fixed both dodcl() and dclarray() to check for (n+1 < 0). ckuus[r5].c,
  574. 12 Jan 2004.
  575. Unix zchki() would fail on /dev/tty, which is unreasonable. This prevented
  576. FOPEN /READ from reading from the terminal. zchki() already allowed for
  577. /dev/null, so I added /dev/tty to the list of specials. Ditto for FOPEN
  578. /WRITE and zchko(). ckufio.c 13 Jan 2004.
  579. Added untabify() routine to ckclib.[ch], 13 Jan 2004.
  580. Added FREAD /TRIM and /UNTABIFY. ckuus[27].c, 13 Jan 2004.
  581. Added \funtabify(). ckuusr.h, ckuus[24].c, 13 Jan 2004.
  582. Dat Nguyen noticed that (setq u 'p') followed by (u) dumped core. This was
  583. caused by an over-clever optimization that skipped mallocs for short
  584. literals, but then went on later to try to free one that hadn't been
  585. malloc'd. Fixed in dosexp(): ckuus3.c, 14 Jan 2004.
  586. Catch another copyright date. ckuus5.c, 14 Jan 2004.
  587. Fixed SWITCH to work even when SET COMMAND DOUBLEQUOTE OFF (from Mark
  588. Sapiro). ckuus5.c, 15 Jan 2004.
  589. Changed version to 8.0.211 so scripts can test for recently added features.
  590. ckcmai.c, 15 Jan 2004.
  591. Fixed a glitch in K95 "help set port". ckuus2.c, 20 Jan 2004.
  592. Fix from Jeff: Connections to a TLS-aware protocol which require a reconnect
  593. upon certificate verification failure could not reconnect if the connection
  594. was initiated from the command line or via a URL. ckctel.c ckcmai.c
  595. ckuusr.c ckuus7.c ckuusy.c, 20 Jan 2004.
  596. From Alex Lewin: makefile target and #ifdef for Mac OS X 10.3 (Panther):
  597. makefile, ckcnet.c, 7 Feb 2004.
  598. Added KFLAGS to sco32v507 targets to make PTY and SSH commands work. The
  599. same flags could probably also be added to earlier OSR5 targets but they
  600. have not been tested there. makefile, 7 Feb 2004.
  601. Checked a complaint that "LOCAL &a" did not make array \&a[] local. Indeed
  602. it did not, and can not. You have to use the full syntax in the LOCAL
  603. command, "LOCAL \&a[]", or else it doesn't know it's not a macro named &a.
  604. 7 Feb 2004.
  605. Fixed some confusion in creating IKSD database file and temp-file names.
  606. I was calling zfnqfp() without remembering that the path member of the
  607. returned struct included the filename, so to get just the directory name,
  608. I needed to strip the filename from the right. ckuusy.c, 2 Mar 2004.
  609. New ckuath.c, ck_ssl.c from Jeff. 2 Mar 2004.
  610. Updated Jeff's affiliation in VERSION command text. ckuusr.c, 2 Mar 2004.
  611. Designation changed from Dev.00 to Beta.01. ckcmai.c, 2 Mar 2004.
  612. Fixed zrename() syslogging -- it had success and failure reversed.
  613. Beta.02: ckufio.c, 4 Mar 2004.
  614. Problem: when accessing IKSD via a kermit:// or iksd:// URL, and a user ID
  615. is given but no password, doxarg() set the password to "" instead of leaving
  616. it NULL, but all the tests in dourl() are for NULL. Fixed in doxarg():
  617. ckuusy.c, 5 Mar 2004.
  618. The logic in dourl() about which macro to construct (login and connect,
  619. login and get directory listing, or login and fetch a file) was a bit off,
  620. so all three cases were not handled. ckcmai.c, 5 Mar 2004.
  621. Trial Beta builds:
  622. . HP-UX B.11.11 PA-RISC
  623. . HP-UX B.11.23 IA64
  624. . Tru64 4.0G Alpha
  625. . Tru64 5.1B Alpha
  626. . Debian 3.0 i386
  627. . Red Hat ES 2.1 i386
  628. . Slackware 9.1 i386
  629. . VMS 7.3-1 Alpha + UCX 5.3
  630. . VMS 7.3-1 Alpha no TCP/IP
  631. . VMS 7.3 Alpha MultiNet 4.3 A-X
  632. . SCO UnixWare 7.1.4 i386
  633. . SCO OSR5.0.7 i386
  634. . Solaris 9 Sparc
  635. Fixed compiler warning in doxarg() caused by typo (NULL instead of NUL) in
  636. the 5 March doxarg() edit. ckuusy.c, 9 Mar 2004.
  637. IKSD (kermit://) command-line URLs did not work right if the client had
  638. already preauthenticated with Kerberos or somesuch because they tried to log
  639. in again with REMOTE LOGIN. The macros constructed in doxarg() needed to
  640. check \v(authstate) before attempting REMOTE LOGIN. ckcmai.c, 10 Mar 2004.
  641. Added ckuker.nr to x.sh (ckdaily upload) and updated ckuker.nr with current
  642. version number and dates. 10 Mar 2004.
  643. Replaced hardwired references to /usr/local in makefile with $(prefix)
  644. (which defaults to /usr/local, but can be overridden on the command line),
  645. suggested by Nelson Beebe for use with Configure. 10 Mar 2004.
  646. From Nelson Beebe: In the Kermit makefile in the install target commands,
  647. line 981 reads:
  648. cp $(BINARY) $(DESTDIR)$(BINDIR)/kermit || exit 1;\
  649. Could you please add this line before it:
  650. rm -f $(DESTDIR)$(BINDIR)/kermit;\
  651. Some sites (mine included) keep multiple versions of software around,
  652. with hard links between $(prefix)/progname and $(prefix)/progname-x.y.z.
  653. Failure to remove the $(prefix)/progname at "make install" time then
  654. replaces the old $(prefix)/progname-x.y.z with the new one, destroying
  655. an old version that the site wanted to be preserved. makefile, 10 Mar 2004.
  656. Minor syntax and typo fixes (mostly prototypes): ckcdeb.h, ckcfns.c,
  657. ckclib.c, ckufio.c, ckuusr.h, ckuusx.c, 10 Mar 2004. (I still have a few
  658. more to do.)
  659. Added CC=$(CC) CC2=$(CC2) to many (but not all) makefile targets that
  660. reference other makefile targets. On some platforms (notably AIX, Solaris,
  661. SunOS) there are specific targets for different compilers, so I skipped
  662. those. makefile, 10 Mar 2004.
  663. Added error checking to kermit:// URL macros, so they don't plow ahead
  664. after the connection is closed. ckcmai.c, 11 Mar 2004.
  665. Added FreeBSD 4.9 and 5.1 targets (only the herald is affected).
  666. makefile, ckuver.h, 11 Mar 2004.
  667. Added "LIBS=-lcrypt" to bsd44 targets since nowadays crypt is almost always
  668. unbundled from libc. Also added explanatory notes. makefile, 11 Mar 2004.
  669. Changed MANDIR to default to $(manroot)/man/man1, and manroot to default
  670. to $(prefix). More adding of CC=$(CC) clauses: {Free,Net,Open}BSD, 4.4BSD.
  671. makefile, 11 Mar 2004.
  672. Miscellaneous cleanups: ckuusx.c, ckcnet.c, ckufio.c, 11 Mar 2004.
  673. Corrected the check in the linux target to see if /usr/include/crypt.h
  674. exists, and if so to define HAVE_CRYPT_H, which is used in ckcdeb.h to
  675. #include <crypt.h> to get the prototype for crypt() and prevent bogus
  676. conversions on its return type on 64-bit platforms (the previous test wasn't
  677. quite right and the resulting symbol wasn't spelled right). makefile,
  678. 12 Mar 2004.
  679. From Jeff, 14 Mar 2004:
  680. . Initialize localuidbuf[] in tn_snenv(): ckctel.c.
  681. . Remove remote-mode checks in hupok() for K95G only (why?): ckuus3.c.
  682. . Add help text for new K95-only TYPE /GUI switches: ckuus2.c.
  683. . TYPE /GUI parsing, ...: ckuusr.c.
  684. . TYPE /GUI action, dotype(): ckuus6.c
  685. . Change Jeff's affiliation: most modules.
  686. 20 Mar 2004: Looked into adding long file support, i.e. handling files more
  687. than 2GB (or 4GB) long. Discovered very quickly this would be a major
  688. project. Each platform has a different API, or environment, or transition
  689. plan, or whatever -- a nightmare to handle in portable code. At the very
  690. least we'll need to convert a lot of Kermit variables from long or unsigned
  691. long to some new Kermit type, which in turn is #defined or typedef'd
  692. appropriately for each platform (to off_t or size_t or whatever). Then we
  693. have to worry about the details of open() vs fopen(); printf() formats (%lld
  694. vs %Ld vs %"PRId64"...), platforms like HP-UX where you might have to use
  695. different APIs for different file systems on the same computer, etc. We'll
  696. need to confront this soon, but let's get a good stable 8.0.211 release out
  697. first! Meanwhile, for future reference, here are a few articles:
  698. General: http://freshmeat.net/articles/view/709/
  699. Linux: http://www.ece.utexas.edu/~luo/linux_lfs.html
  700. HP-UX: http://devrsrc1.external.hp.com/STK/partner/lg_files.pdf
  701. Solaris: http://wwws.sun.com/software/whitepapers/wp-largefiles/largefiles.pdf
  702. Looked into FTP timeouts. It appears I can just call empty() (which is
  703. nothing more than a front end for select()) with the desired timeout before
  704. any kind of network read. If it returns <= 0, we have a timeout. This is
  705. not quite the same as using alarm() / signal() around a recv() (which could
  706. get stuck) but alarm() / signal() are not not used in the FTP module and are
  707. not naturally portable to Windows, but select() is already in use in the FTP
  708. module for both Unix and Windows. This form of timeout could be used
  709. portably for both command response and data reads. What about writes to the
  710. command or data socket? They can get stuck for hours and hours without
  711. returning too, but the select() approach won't help here -- we need the
  712. actual send() or recv() to time out, or be wrapped in an alarm()/signal()
  713. kind of mechanism. But if we can do that for sends, we can also do it for
  714. receives. Better check with Jeff before I start programming anything.
  715. 20 Mar 2004.
  716. Later: Decided to postpone the above two projects (ditto IPv6) until after
  717. 8.0.211 is released because both will have major impacts on portability.
  718. Grumble: all i/o APIs should have been designed from the beginning with a
  719. timeout parameter. To this day, hardly any have this feature.
  720. 3-4 Apr 2004: More 8.0.211 Beta.02+ test builds:
  721. . FreeBSD 3.3
  722. . FreeBSD 4.4
  723. . Linux Debian 2.1
  724. . Linux RH 6.1
  725. . Linux RH 7.1
  726. . Linux RH 7.2
  727. . Linux RH 9 (with 84 different combinations of feature selection)
  728. . Linux SuSE 6.4
  729. . Linux SuSE 7.0
  730. . NetBSD 1.4.1
  731. . NetBSD 1.5.2
  732. . OpenBSD 2.5
  733. . OpenBSD 3.0
  734. . QNX 4.25
  735. . SCO UnixWare 2.1.3
  736. . SCO UnixWare 7.1.4
  737. . SCO OpenServer 5.0.7
  738. . SCO XENIX 2.3.4 (no TCP)
  739. Changes needed: None.
  740. Problem: SCO XENIX 2.3.4 network build failed in the FTP module with
  741. header-file syntax and conflicting-definitions trouble. I'm not going to
  742. try to fix it; 8.0.209 built OK with FTP, so we'll just keep that one
  743. available.
  744. Got access to VMS 8.1 on IA64. Building the nonet version of C-Kermit
  745. required minor modifications to ckvvms.h, ckv[ft]io.c, and ckvcon.c, to
  746. account for a third architecture. Also to SHOW FEATURES in ckuus5.c. Once
  747. that was done, the UCX 5.5 version built OK too. Starts OK, makes Telnet
  748. connection OK, sends files. Has some obvious glitches though -- "stat"
  749. after a file transfer reports 0 elapsed time (in fact it was 00:09:48) and
  750. 1219174400 cps (when in fact it was 10364). This doesn't happen on the
  751. Alpha. Btw, the IA64 binary is twice as big as the Alpha one. Changed
  752. to Beta.03. 5 Apr 2004.
  753. Fixed the ckdaily script to include the makefile and man page in the Zip
  754. file (they were not included because the Zip file was intended mainly for
  755. VMS users, but some Unix users prefer Zip to tar.gz). 6 Apr 2004.
  756. Traced problems in VMS/IA64 statistics report to rftimer()/gftimer() in
  757. ckvtio.c, which use sys$ and lib$ calls to figure elapsed time. These work
  758. on VAX and Alpha but not IA64. Sent a report to the chief engineer of the
  759. IA64 VMS port; he says it's probably a bug in VMS 8.1 (which is not a real
  760. release); he'll make sure it's fixed in 8.2. As an experiment, tried
  761. swapping in the Unix versions of these routines (which call gettimeofday()
  762. etc). They seem work just fine (it hung a couple times but I think that's
  763. because the underlying system hung too; trying it later on a new connection,
  764. it was fine; however I noticed a BIG discrepancy in throughput between
  765. sending and receiving). Moved definitions for VMS64BIT and VMSI64 to
  766. ckcdeb.h so all modules can use them and added them to the SHOW FEATURES
  767. display. Added VMSV80 definition to build procedure. Beta.03+. ckcdeb.h,
  768. ckcuus5.c, ckcvvms.h, ckvtio.c, ckvker.com, 6 Apr 2004.
  769. While doing the build-all, I noticed the VMS version did not build with
  770. Multinet or older UCX versions, always with the same errors -- undeclared
  771. variables, undefined symbols, all TCP/IP related. This didn't happen a
  772. couple weeks ago... Somehow the order of #includes was messed up --
  773. ckuusr.h depended on symbols that are defined in ckcnet.h, but ckcnet.h
  774. was being included after ckuusr.h... this was compounded by two missing
  775. commas in ckvker.com. 11 Apr 2004.
  776. Removed Beta designation, released as 8.0.211, 10 Apr 2004.
  777. I had somehow lost the edit to ckutio.c that changed the UUCP lockfile for
  778. Mac OS X from /var/spool/uucp to /var/spool/lock. So I slipped it in and
  779. re-uploaded version 8.0.211. You can tell the difference because SHOW
  780. VERSIONS has 17 Apr 2004 for the Communications I/O module. Also the 10.3
  781. executable now has a designer banner: "Mac OS X 10.3". makefile, ckuver.h,
  782. ckutio.c, ckuus[45].c, 17 Apr 2004.
  783. ---8.0.211---
  784. Removed "wermit" from "make clean" (how did it get there?). makefile.
  785. From Jeff, applied 10 May 2004.
  786. . Rearrange #ifdefs that define OS/2-only features. ckcdeb.h.
  787. . Fix two strncat()s that should have been ckstrncat()s. ckuus7.c.
  788. . Fix two strncat()s that should have been ckstrncat()s. ckuus4.c.
  789. . Fix one strncat(). ckcfns.c.
  790. . SET FTP CHAR ON used backwards byte order when output to screen. ckcfns.c.
  791. . Fix two strncat()s. ckuus3.c.
  792. . Add SET NETWORK TYPE NAMED-PIPE for K95. ckuus3.c.
  793. . Add "No active connections" message to hupok(). ckuus3.c.
  794. . Fix many strncat()s. ckcnet.c.
  795. . Fix some strncat()s. ckcftp.c
  796. . Make FTP port unsigned short for 16383 < port < 65536. ckcftp.c.
  797. . Improvements to FTP USER command. ckcftp.c.
  798. . Fix FEAT parsing to allow for various forms of whitespace. ckcftp.c.
  799. S-Expression (AND FOO BAR) would not short-circuit if FOO's value was 0,
  800. even though short-circuiting code has been there since Day 1. Similarly for
  801. (OR BAR FOO). Turns out the first operand was a special case that bypassed
  802. the short-circuit check. Fixed in dosexp(): ckuus3.c, 10 May 2004.
  803. Red Hat 7.3 (and maybe others) <baudboy.h> referenced open() without first
  804. ensuring it was declared. The declaration is in <fcntl.h>, which is after
  805. <baudboy.h> in ckutio.c series of #includes. Made a special case for this.
  806. ckutio.c (see comments), 10 May 2004.
  807. If the local Kermit's parity is set to SPACE and then a file arrives via
  808. autodownload, automatic parity detection improperly switches it to NONE.
  809. Fixed in rpack() by switching parity automatically only if parchk() returns
  810. > 0 (rather than > -1), since NONE and SPACE are indistinguishable. A
  811. bigger problem still remains: autodownload does not work at all if the
  812. sender is using actual parity bits (even, odd, or mark) and the receiver's
  813. parity is NONE. ckcfn2.c, 10 May 2004.
  814. When a DIAL MACRO is defined and the phone number is comprised of more than
  815. one "word" (i.e. contains spaces), the dial macro loses the second and
  816. subsequent words after the first call. Fixed in xdial() by inserting quotes
  817. around phone number before passing it to xdial(). ckuus6.c, 10 May 2004.
  818. DIAL MACRO fix was not right; the quotes were kept as part of the phone
  819. number and sent to the modem. dodo() pokes its argument to separate the
  820. macro argument string into its component arguments. xdial() is called
  821. repeatedly on the same string, so after the first time, a NUL has been
  822. deposited after the first word of the telephone number. The fix is to have
  823. xdial() create a pokeable copy of its argument string before calling
  824. dodo(dial-macro,args...). It might seem odd that dodo pokes its argument,
  825. but making copies would be would be prohibitive in space and time.
  826. ckuus6.c, 23 May 2004.
  827. FTP CD did not strip braces or quotes from around its argument. Fixed in
  828. doftprmt(): ckcftp.c, 23 May 2004.
  829. Added client side of REMOTE MESSAGE/RMESSAGE/RMSG: ckuus[r27].c, 23 May 2004.
  830. Server side of REMOTE MESSAGE: ckcpro.w, 23 May 2004.
  831. From Dave Sneddon: an updated CKVKER.COM containing a fix where the
  832. COMPAQ_SSL symbol was not defined but later referenced which generated an
  833. undefined symbol error. ckvker.com, 5 Jan 2005.
  834. From Andy Tanenbaum (28 May 2005):
  835. . Fix an errant prototype in ckcker.h and ckucmd.h - () instead of (void).
  836. . Add support for MINIX 3.0. makefile, ckutio.c, ckufio.c, ckuver.h.
  837. Fixed messed-up sndhlp() call which apparently had been jiggered to
  838. compensate for the bad prototype which has now been fixed, ckcpro.w,
  839. 12 Jun 2005.
  840. From Jeff (12 June 2005):
  841. . Security updates. ck_ssl.c, ck_crp.c, ckuath.c.
  842. . Fix bug in K95 SET PRINTER CHARACTER-SET. ckuus3.c.
  843. . Add printer character-set to K95 SHOW PRINTER display. ckuus5,c
  844. . Add SET MSKERMIT FILE-RENAMING to K95. ckuus7.c, ckuusr.h.
  845. . Add help for K95 SET MSKERMIT. ckuus2.c.
  846. . Add SET GUI CLOSE to K95. ckuusr.h, ckuus2.c, ckuus3.c
  847. . Add help text for K95 SET GUI MENUBAR and TOOLBAR. ckuus2.c.
  848. . Add --noclose command-line option for K95. ckuusy.c
  849. . Add PAM support for Mac OS X. ckufio.c.
  850. . Add GSSAPI support for Mac OS X. ckcftp.c.
  851. . Pick up more URL options. ckcker.h, ckuusy.c.
  852. . Fix bug in delta-time calculation across year boundary. ckucmd.c.
  853. . Add Secure Endpoints to copyright notices. ckcmai.c.
  854. . Fix FTP HELP to override unverbose setting. ckcftp.c.
  855. . Fix assorted minor typos.
  856. From Matthias Kurz: automatic herald generation for NetBSD 2.0 and later,
  857. "make netbsd2". ckuver.h, makefile, 12 Jun 2005.
  858. Added SET TERMINAL LF-DISPLAY, like CR-DISPLAY but for linefeed rather than
  859. carriage return. ckuusr.h, ckuus[257x].c, 12 Jun 2005.
  860. Made a command-line option --unbuffered to do what the -DNONOSETBUF
  861. compile-time option does, i.e. force unbuffered console i/o. Unix only.
  862. ckuusr.h, ckuusy.c, ckutio.c, 12 Jun 2005.
  863. Fixed getiact() (which displays TERM IDLE-ACTION setting) to display
  864. space as \{32}. ckuus7.c, 12 Jun 2005.
  865. Added LMV as a synonym for LRENAME, which is itself a synonym for LOCAL
  866. RENAME. ckuusr.c, 12 Jun 2005.
  867. Put HELP SET TERMINAL DG-UNIX-MODE text where it belonged. ckuus2.c,
  868. 12 Jun 2005.
  869. Added IF LINK (Unix only) to test if a filename is a symlink. Uses the most
  870. simpleminded possible method, calls readlink() to see if it succeeds or fails.
  871. No other method is dependable across different Unixes. This code should be
  872. portable because I already use readlink() elsewhere within exactly the same
  873. #ifdefs. ckufio.c, ckuus2.c, ckuus6.c, 12 Jun 2005.
  874. Fixed a bug in which \fdir() wouldn't work when its argument was the nonwild
  875. name of a directory file. zxpand(): ckufio.c, 12 Jun 2005.
  876. Made \fdirectory() a synonym for \fdirectories(). Made \fdir() an
  877. acceptable abbreviation for these, even though it clashes with \fdirname(),
  878. which still works as before. ckuus4.c, 12 Jun 2005.
  879. Added the long-needed \flopx() function, to return rightmost pieces of
  880. strings, such as file extensions. \fstripx() and \flopx() are the
  881. orthogonal functions we need to pick filenames apart from the right:
  882. \stripx(foo.tar.gz) = foo.tar; flopx(foo.tar.gz) = gz. ckuusr.h, ckuusr.c,
  883. ckuus2.c, 12 Jun 2005.
  884. Removed reference to defunct fax number, ckcmai.c, 12 Jun 2005.
  885. Added -DHAVE_PTMX to linux+krb5+openssl+zlib+shadow+pam. From Timothy Folks.
  886. makefile, 12 Jun 2005.
  887. Built on Solaris 9 and NetBSD 2.0.
  888. From Jeff: New build target for Mac OS X 10.3 with Kerberos 5 and SSL.
  889. makefile, 14 Jun 2005.
  890. Fixed error in ckuver.h NetBSD #ifdefs. 15 Jun 2005.
  891. Fixed SET TERMINAL IDLE-ACTION OUTPUT to work as documented, namely if the
  892. output string is empty, to send a NUL. Previously there was no way to make
  893. it send a NUL. ckuus7.c, 15 Jun 2005.
  894. Suppose (in Unix, for example) a filename contains wildcard characters, such
  895. as {abc}.txt. When referring to such a file (e.g. in a SEND command), these
  896. characters can be quoted, e.g. \{abc\}.txt. But if the file list has been
  897. obtained programmatically, e.g. stored in an array, there is no way, short
  898. of tedious, complicated, and error-prone string processing, to reference the
  899. file. For this we need a way to disable wildcard processing. I added { ON,
  900. OFF } choices for the SET WILD and SHOW FILE commands: ckuusr.h, ckuus[234].c.
  901. { ON, OFF } turns wildcarding off and on without affecting the { KERMIT,
  902. SHELL } agent choice; it does this by setting a new and separate global
  903. variable, wildena. Added semantics to ckufio.c. Crude but effective. It
  904. might have been more Unixlike to add Yet Another form of quoting but we
  905. have enough of that already (later maybe I'll add a \function() for this).
  906. Needs to be propagated to Windows and VMS. 15 Jun 2005.
  907. Improved and fixed typos in HELP WILDCARD and HELP PATTERN. ckuus2.c,
  908. 15 Jun 2005.
  909. The GREP command, and probably anything else that uses ckmatch() for pattern
  910. matching, failed on patterns like */[0-3]*.html. The [a-b] handler, when
  911. failing to match at the current position, neglected to back up the pattern
  912. and try again on the remainder of the string. I also fixed another case, in
  913. which matching a literal string a*b?c against the pattern a[*?]*[?*]c caused
  914. ckmatch() to recurse until it blew up. ckclib.c, 16 Jun 2005.
  915. Added builds and designer banner for Solaris 10. makefile, ckuver.h,
  916. 27 Jun 2005.
  917. Defined CKHTTP for NetBSD, the HTTP code builds and works fine there.
  918. ckcdeb.h, 2 Jul 2005.
  919. Added #ifndef OSF40..#endif around definition of inet_aton() in ck_ssl()
  920. to allow building in Tru64. Added tru64-51b+openssl to makefile.
  921. 15 Jul 2005.
  922. HTTP GET would fail if the URL contained any metacharacters, no matter how
  923. much you quoted them. Although it uses cmfld() to parse the (partial) URL,
  924. it then uses cmofi() to get the output filename, which by default is the
  925. "filename" from the URL, which might be something like "rankem.asp?id=1639".
  926. cmofi() refuses to accept unquoted metacharacters in "filenames" and that's
  927. what happens in this case if the output filename is not specified. Worked
  928. around this by disabling wildcard processing around HTTP GET using the new
  929. "wildena" variable from June 15th. ckuusr.c, 18 Jul 2005.
  930. Fixed the June 16th fix to the pattern matcher. I fixed a real problem, but
  931. I made an unrelated optimization that introduced new ones. ckclib.c,
  932. 18 Jul 2005.
  933. Added missing help text for \fb64encode() and \fb64decode(). ckuus2.c,
  934. 18 Jul 2005.
  935. Changed SET WILD OFF help text to warn that this setting prevents the
  936. creation of backup files (later I'll have to see if something more useful
  937. can be done about this). ckuus2.c, 18 Jul 2005.
  938. Built OK on Mac OS X 10.4.2 using macosx103 target (but with some
  939. "signedness" warnings in ckcnet.c and ckcftp.c). Built on Unixware 7.1.4
  940. with uw7 target. 27-28 Jul 2005.
  941. Added -DCKHTTP to Mac OS X 10.3-.4 KFLAGS. Makefile, 4 Aug 2005.
  942. Built on BSDI 4.3.1. Added -DCKHTTP.
  943. Compact substring notation extended to accept not only start:length but also
  944. start-end notation. Thus \s(foo[12:18]) means the substring of foo starting
  945. at position 12 of length 18, and tne new \s(foo[12-18]) means the substring
  946. of foo starting at position 12 and ending with position 18. Ditto for
  947. \:(\%a), etc. ckuus4.c, 9 Aug 2005.
  948. See correspondence with Mark Sapiro, Nov 2003 and Sep 2004, about certain
  949. variations on IF syntax having been broken by the introduction of "immediate
  950. macros" circa 1999. It seems the problem -- variables not being expanded --
  951. always occurs in the ELSE part when (a) the IF condition is false; (b) the
  952. ELSE command is "standalone", i.e. expressed as a separate command after the
  953. IF command (original C-Kermit 5A syntax), and (c) its command list is a block.
  954. This would suggest the problem is in the XXELS parser.
  955. Going back to 1999, I find this:
  956. Fixed a problem Jim Whitby noticed with quoting in ELSE statements. This
  957. problem was introduced when I unified IF and XIF, and occurs only when
  958. ELSE begins on a line, followed by a { command list } rather than a single
  959. command. The solution (gross) was to make a special version of pushcmd()
  960. (called pushqcmd()) for this situation, which doubles backslashes while
  961. copying, BUT ONLY IF it's a command list (i.e. starts with "{"); otherwise
  962. we break lots of other stuff. Result passes Jim's test and still passes
  963. ckedemo.ksc and iftest.ksc. ckucmd.c, ckuus6.c, 27 Sep 99.
  964. I undid this change and it made no difference to all the other IF
  965. constructions (in fact, it fixed an unrelated one that was broken, so now
  966. iftest scores 54 out of 54, instead of 53). However, it does not fix the
  967. ELSE problem; in fact it pushes it all the way in the other direction:
  968. The opposite occurs any time you try to execute an immediate macro inside a
  969. macro or any other { block }: not only is the variable evaluated, it is
  970. evaluated into nothing. It looks like this happens only in immediate
  971. macros, i.e. *commands* that start with '{'. So maybe we really have two
  972. isolated problems, that can each be fixed.
  973. The situation is illustrated by this simple script:
  974. def xx {
  975. if false { echo \%1, echo \%2 }
  976. else { echo \%3, echo \%4 }
  977. }
  978. xx one two three four
  979. With pushqcmd() it echoes the variable names literally; with pushcmd() it
  980. echoes empty lines. Since ELSE, when its argument is a block, dispatches
  981. to the immediate-macro handler, it seems we have unified the two problems,
  982. so fixing one should fix the other.
  983. The problem is that we define a new temporary macro and then call dodo() to
  984. execute it. But if the definition contains macro arguments, we have added a
  985. new level of macro invocation, thus wiping out the current level of args.
  986. The cure is to expand the variables in the immediate macro in the current
  987. context, before executing it. This means simply changing the cmtxt() call
  988. that reads the immediate macro to specify xxsting as its processing
  989. function, rather than NULL, which is used for real macros to defer their
  990. argument evaluation until after the macro entered. ckuusr.c, 11 Aug 2005.
  991. Added a new makefile target, macosx10.4, for Mac OS X 10.4. This one uses
  992. an undocumented trick to get the otherwise unavailable-except-by-clicking
  993. Mac OS X version number (in this case 10.4.2) and stuff it into the HERALD
  994. string. makefile, 11 Aug 2005.
  995. Built OK on Solaris 9, Solaris 10 (with a few implicit declaration warnings
  996. in ckuusx.c), Mac OS X 10.4.2 (with some warnings in ckcnet.c and ckcftp.c),
  997. Mac OS X 10.3.9 (also using the macos10.4 entry, which gets the right
  998. version number, and gets no warnings at all), RH Enterprise Linux AS4 on AMD
  999. x86_64, Tru64 Unix 4.0F, SCO UnixWare 7.1.4
  1000. For docs and/or scriptlib: Unix C-Kermit can be a stdin/out filter. The
  1001. trick is to use the ASK, ASKQ, or GETC command for input, specifying no
  1002. prompt, and ECHO or XECHO for output, e.g.:
  1003. while true {
  1004. ask line
  1005. if fail exit 0
  1006. echo \freverse(\m(line))
  1007. }
  1008. exit 0
  1009. FOPEN didn't do anything with the channel number if the open failed, so any
  1010. subsequent command that tried to reference it would get a parse error it was
  1011. undefined or non-numeric, not very helpful. Changed FOPEN to set the
  1012. channel number to -1 if the file can't be opened. Now subsequent operations
  1013. on the channel fail with "Channel -1: File not open". I also added two
  1014. magic channel numbers: -8 means that any FILE command (besides OPEN and
  1015. STATUS) on that channel is a noop that succeeds silently; -9 is a noop that
  1016. fails silently. So now it's possible to simply set a channel number to one
  1017. of these values to disable i/o to certain file without getting lots of error
  1018. messages. dofile(): ckuus7.c, 12 Aug 2005.
  1019. Added automatic herald construction for UnixWare 7. makefile, 12 Aug 2005.
  1020. Unix isdir() never allowed for arguments that started with tilde, so gave
  1021. incorrect results for ~/tmp/ or ~fdc. The problem was mainly invisible
  1022. since most commands that parsed file or directory names used cmifi(), cmdir(),
  1023. etc, which did the conversions themselves. But IF DIRECTORY was an exception,
  1024. since its operand had to be treated as just text, and then tested after it
  1025. was parsed. ckufio.c, 13 Aug 2005.
  1026. Fixed the following:
  1027. "ckuusx.c", line 8959: warning: implicit function declaration: ckgetpeer
  1028. "ckufio.c", line 1869: warning: implicit function declaration: ttwait
  1029. "ckufio.c", line 2941: warning: implicit function declaration: mlook
  1030. "ckufio.c", line 2943: warning: implicit function declaration: dodo
  1031. "ckufio.c", line 2944: warning: implicit function declaration: parser
  1032. "ckcftp.c", line 2625: warning: implicit function declaration: delta2sec
  1033. "ckcftp.c", line 4071: warning: no explicit type given for parameter: prm
  1034. "ckcftp.c", line 8389: warning: no explicit type given for parameter: brief
  1035. ckuusx.c, ckufio.c, ckcftp.c, ckucmd.h. 13 Aug 2005.
  1036. Unbuffered stdout code has never worked because the setbuf(stdout,NULL) call
  1037. has to occur before the stdout has been used. The reason it's needed is
  1038. that some Kermit code writes to stderr (which is unbuffered) and other code
  1039. writes to stdout, and therefore typescripts can come out jumbled. Robert
  1040. Simmons <robertls@nortel.com> provided the needed clue when he insisted it
  1041. worked only when executed at the very beginning of main(). So I moved the
  1042. code to that spot. But since now we also want to make unbuffered a runtime
  1043. (command-line) option, I had to do a clunky by-hand pre-prescan inline in
  1044. main() to look thru argv[], even before prescan() was called. ckcmai.c,
  1045. ckutio.c, ckuusy.c, 13 Aug 2005. (Now that this works, it might be a good
  1046. idea to remove all use of stderr from Kermit.)
  1047. Managed, after some finagling, to build a 64-bit version on Solaris 10 at
  1048. Utah Math with Sun cc. (Can't make any gcc builds at all, 32- or 64-bit,
  1049. they all blow up in <sys/siginfo.h>.) New target: solaris10_64. makefile,
  1050. 15 Aug 2005.
  1051. The 64-bit Solaris 10 version compiles and links OK and transfers files in
  1052. remote mode. It can make FTP connections and use them, but Telnet connections
  1053. always fail with "network unreachable". This is with all default libs and
  1054. include files. Nelson has a separate set in /usr/local, which he references
  1055. explicitly in all his 64-bit builds, but using these makes no difference.
  1056. Some data type is wrong in ckcnet.c. But telnet works fine in 64-bit Linux
  1057. and Tru64 builds. Debug logs trace the difference to netopen() (of course),
  1058. the spot where we test the results of inet_addr(), which is already marked
  1059. suspicious for 64-bit builds. It seems that inet_addr() is of type in_addr_t,
  1060. which in turn is u_int32, i.e. an unsigned 32-bit int. Yet the man page says
  1061. that failure is indicated by returning -1. I guess this doesn't matter in
  1062. 32-bit builds, but in the 64-bit world, the test for failure didn't work
  1063. right. I made a Solaris-specific workaround, and checked that it works in
  1064. both 32-bit and 64-builds. I really hate typedefs. ckcnet.c, 15 Aug 2005.
  1065. Changed the plain-text version (as opposed to the popup or GUI version - the
  1066. GUI version, at least, already does this) of ASKQ to echo keystrokes
  1067. asterisks rather than simply not echo anything, so it's easier to see what
  1068. you're doing, the effects of editing, etc. Experimental; for now, there's
  1069. no way to disable this. Not sure if there needs to be. Anyway, to get this
  1070. working required a fair amount of cleaning up of gtword(), which was echoing
  1071. different ways in different places. ckuus6.c, ckucmd.c, 15 Aug 2005.
  1072. Added a solaris9_64 target for building a 64-bit version on Solaris 9 with
  1073. Sun cc. Verified, using the DIR command and \fsize() function on a 4.4GB
  1074. file, that the Solaris 64-bit version of Kermit gets the size correctly, and
  1075. that it can copy such a file (thus its fopen/fread/fwrite/fclose interface
  1076. works right). Initiated a large-file transfer between here and Utah over
  1077. SSH and verified that it puts the correct file size in the A packet when
  1078. sending; the right quantities are shown on the file transfer display (file
  1079. size CPS, percent done, etc). But even at 5Mb/sec, it takes a good while to
  1080. transfer 4.4GB, more than 2 hours (not streaming; 30 window slots, 4K
  1081. packets, maybe it would go faster with streaming)... After an hour or so,
  1082. it filled up the partition and gave up (gracefully) before it reached the
  1083. 2GB frontier (drained its pending packets, closed the partial file).
  1084. Restarted at 12:54, this time with streaming and 8K packets (the speed
  1085. wasn't significantly different). This time it transferred 95% of the file
  1086. (4187660288 bytes) before failing because the disk filled up. Went to Utah
  1087. and started a transfer between two Solaris 10/Sparc hosts; this goes about 8
  1088. times faster. The transfer completed successfully after 17m41s. All fields
  1089. in the f.t. display looked right the whole time. Then I verified various
  1090. other 64-bit combinations transferring the same 4.4GB file:
  1091. To................
  1092. From Sol Amd i64 Tru
  1093. Sol OK OK OK OK Sol = Solaris 10 / Sparc
  1094. Amd OK Amd = AMD x86_64 RH Enterprise Linux AS4
  1095. i64 OK i64 = Intel IA64, RH 2.1AS
  1096. Tru Tru = Tru64 Unix 4.0F Alpha
  1097. (The other combinations are difficult to test for logistical reasons.)
  1098. Tried sending the same long file with Kermit's FTP client. It chugged along
  1099. for a while until I stopped it; it would have taken hours to complete.
  1100. There is no indication that it wouldn't have worked, assuming the FTP server
  1101. could also handle long files, which who knows. Anyway, Kermit showed all
  1102. the right data on the display screen. 17 Aug 2005.
  1103. On AMD x86_64 and IA64 native 64-bit Linux builds, the pty routines did not
  1104. work at all. ptsname() dumped core. If I commented out ptsname(), then the
  1105. next thing dumped core. The same code works on the other 64-bit builds.
  1106. Poking around, I see that this version of Linux has an openpty() function,
  1107. which I could try using instead of the current API -- grantpty(), etc. Then
  1108. I see that openpty() is already coded into Kermit's pty module,
  1109. conditionalized under HAVE_OPENPTY, which has never before been defined for
  1110. any build. I added a test to the makefile linux target (look for the
  1111. openpty() prototype in <pty.h>, if found define HAVE_OPENPTY as a CFLAG and
  1112. also add -lutil to LNKFLAGS). Works fine on the problem builds, and also
  1113. on previously working 32-bit builds. makefile, 17 Aug 2005.
  1114. Fixed a bug in the ASKQ echo asterisks code, which made the VMS version of
  1115. C-Kermit always echo asterisks. Turns out that some code in the main parse
  1116. loop to reset command-specific flags was in the wrong place, which had other
  1117. effects too, for example ASKQ temporarily turns off debug logging as a
  1118. security measure, but the code to turn it back on was skipped in most cases.
  1119. Some other side effects related to the DIRECTORY and CD commands might have
  1120. been possible but I haven't seen them. ckuus[56].c, 23 Aug 2005.
  1121. Problem reported when sending a file to VMS when the name in the F packet
  1122. starts with a device specification and does not include a directory field,
  1123. and PATHNAMES are RELATIVE. Example: dsk:foo.bar becomes f_oo.bar. The
  1124. code assumes that if there is a device field, it is followed by a directory
  1125. field, and it inserts a dot after the '[', which in this case is not there.
  1126. Later the dot becomes '_' because of the only-one-dot rule. Solution: only
  1127. insert the dot if there really is an opening bracket. nzrtol(): ckvfio.c,
  1128. 23 Aug 2005.
  1129. A report on the newsgroup complains that C-Kermit and K95 servers were
  1130. sending REMOTE DIR listings with only #J line terminators, rather than #M#J.
  1131. Yet all the other REMOTE xxx responses arrived with #M#J. snddir() was
  1132. neglecting to switch to text mode. ckcfns.c, 26 Aug 2005.
  1133. Back to long files. What happens if 32-bit Kermit is sent a long file?
  1134. It gets an A-packet that looks like this:
  1135. ^A_"A."U1""B8#120050815 18:28:03!'42920641*4395073536,#775-!7@ )CP
  1136. The 32-bit receiver reacts like so:
  1137. gattr length[4395073536]=100106240
  1138. the first number being the string from the A-packet, the second being the
  1139. value of the long int it was converted to by atol(). Clearly not equal in
  1140. this case. When this happens Kermit should reject the file instead of
  1141. accepting it and then getting a horrible error a long time later. Added
  1142. code to gattr() to convert the result of atol() back to a string and compare
  1143. it with the original string; if they're not equal, reject the file on the
  1144. assumption that the only reason this could happen is overflow. Also some
  1145. other code in case the sender sends the only LENGTHK attribute. Now files
  1146. whose lengths are too big for a long int are rejected right away, provided
  1147. the sender sends the length in an A packet ahead of the file itself. If
  1148. this new code should ever cause a problem, it can be bypassed with SET
  1149. ATTRIBUTE LENGTH OFF. ckcfn3.c, 26 Aug 2005.
  1150. As I recall from when I was testing this a few weeks ago, when the too-big
  1151. length is not caught at A-packet time, the transfer fails more or less
  1152. gracefully when the first attempt is made to write past the limit. I went
  1153. to doublecheck this by sending a big file from the 64-bit Solaris10 version
  1154. to a 32-bit Mac OS X version that does not have today's code. The Mac
  1155. thinks the incoming file is 2GB long when it's really 4GB+. But in this
  1156. case, something new happens! Although the percent done and transfer rate go
  1157. negative, the file keeps coming. It would seem that Mac OS X lets us create
  1158. long files without using any special APIs. The transfer runs to completion.
  1159. Mac OS X Kermit says SUCCESS (but gets the byte count and cps wrong, of
  1160. course). But then a STATUS command says FAILURE. The file was, however,
  1161. transferred successfully; it is exactly the same length and compares byte
  1162. for byte with the original. This tells me that in the Mac OS X version --
  1163. and how many others like it??? -- today's rejection code should not be
  1164. enabled. Meanwhile I put today's new code in #ifndef NOCHECKOVERFLOW..#endif,
  1165. and defined this symbol in the Mac OS X 10.4 target. Over time, I'll have
  1166. to find out what other platforms have this characteristic. And of course
  1167. I'll also have to do something about file-transfer display, statistics, and
  1168. status. makefile, ckcfn3.c, 26 Aug 2005.
  1169. From now on I'm going to bump the Dev.xx number each time I upload a new
  1170. ckdaily. This one will be Dev.02. ckckmai.c, 26 Aug 2005.
  1171. Got rid of all the extraneous FreeBSD 4 and 5 build targets. Now there's
  1172. one (freebsd) for all FreeBSD 4.1 and later. makefile, 27 Aug 2005.
  1173. Mac OS X 10.4 (Tiger) is a 64-bit OS. Building C-Kermit 0n 10.4.2 without
  1174. any special switches stilll gives a 32-bit executable. Ditto building with
  1175. -mpowerpc64. Further investigation turned up a tip sheet on MySQL that says
  1176. you have to include all of these: -mpowerpc64 -mcpu=G5 -mtune=G5 -arch
  1177. ppc64. That did the trick. New makefile target: macosx10.4_64. But the
  1178. 10.4.2 system I tried did not have 64-bit [n]curses or resolv libs, so this
  1179. build has no -DNOCURSES -DNO_DNS_SRV. makefile, 27 Aug 2005.
  1180. Created a symbol CK_64BIT to indicate true 64-bit builds at compile time.
  1181. Added 64-bit announcement to the startup herald and the VERSION text.
  1182. ckcdeb.h, ckuus[r5].c, 27 Aug 2005.
  1183. Added a built-in variable \v(bits) to indicate the size of the build
  1184. (16, 32, 64, or whatever else sizeof() might report). ckuusr.h, ckuus4.c,
  1185. 27 Aug 2005.
  1186. Got rid of all the warnings in 64-bit Mac OS X about args to getsockopt(),
  1187. getsockname(), and getpeername(), and the comparisons on the return value
  1188. of inet_addr(). ckcnet.[ch], 27 Aug 2005.
  1189. Now to check the effects on other builds...
  1190. Linux on AMD64: ok.
  1191. Linux on IA64: ok.
  1192. Linux on i386: ok.
  1193. Mac OS X 10.3.9 32-bit: ok.
  1194. Solaris 10 64-bit: ok.
  1195. Solaris 9 32-bit: ok.
  1196. Tru64 4.0F: ok.
  1197. FreeBSD 4.11: ok.
  1198. FreeBSD 5.4 ia64 (64-bit): ok.
  1199. FreeBSD 5.4 i386 (32-bit): ok.
  1200. The Tru64 5.1B build totally blew up because they have their own unique
  1201. sockopt/etc length-argument data type (int!), so I had to roll back on using
  1202. socklen_t for this in all 64-bit builds. Checked to make sure it still
  1203. builds on Tru64 4.0F after this change (it does). ckcnet.h, 27 Aug 2005.
  1204. The HP-UX 11i/ia64 build comes out to be 32-bit but thinks it's 64-bit.
  1205. CK_64BIT is set because __ia64 is defined. So how do I actually make a
  1206. 64-bit HP-UX build? I tried adding +DD64 to CFLAGS, and this generates
  1207. 64-bit object files but linking fails to find the needed 64-bit libs
  1208. (e.g. -lm). For now I added an exception for HPUX to the CK_64BIT
  1209. definition section. ckcdeb.h, 27 Aug 2005.
  1210. Took the time to verify my recollection about the "graceful failure" on a
  1211. regular Pentium Linux system when receiving a too-big file... OK, it's not
  1212. exactly graceful. It gets a "File size limit exceeded" error; the message
  1213. is printed in the middle of the file-transfer display, apparently not by
  1214. Kermit, and Kermit exits immediately. Looks like a trap... Yup. "File
  1215. size limit exceeded" is SIGXFSZ (25). What happens if we set it to SIG_IGN?
  1216. Just the right thing: The receiver gets "Error writing data" at 2147483647
  1217. bytes, sends E-packet to sender with this message, and recovers with total
  1218. grace (drains packet buffers, returns to prompt). ckutio.c, 27 Aug 2005.
  1219. Backed off from rejecting a file because its announced size overflows a
  1220. long. Now instead, I set the file size to -2 (a negative size means the
  1221. size is unknown, but we have always used -1 for this; -2 means "unknown and
  1222. probably too big"). In this case, the f-t display says:
  1223. File Size: POSSIBLY EXCEEDS LOCAL FILE SIZE LIMIT
  1224. then the user can interrupt it with X or whatever, or can let it run and
  1225. see if maybe (as in the case of Mac OS X) it will be accepted anyway. This
  1226. way, we skip all the bogus calculations of percent done, time remaining, etc.
  1227. ckcfn3.c, ckuusx.c, 27 Aug 2005.
  1228. Discovered that VMS C-Kermit on Alpha and IA64 is a 32-bit application;
  1229. sizeof(long) == sizeof(char *) == 4. Tried adding /POINTER_SIZE=64 to VMS
  1230. DECC builds on Alpha and IA64, but the results aren't great. Tons of
  1231. warnings about pointer size mismatches between Kermit pointers and RMS ones,
  1232. and the executable doesn't run. It appears that access to long files
  1233. would require a lot of hacking, similar to what's needed for 32-bit Linux.
  1234. --- Dev.02: 27 Aug 2005 ---
  1235. From Jeff, 28 Aug 2005.
  1236. . Fix SSH GLOBAL-KNOWN-HOSTS-FILE / USER-KNOWN-HOSTS-FILE parsing, ckuus3.c.
  1237. . Pick up K95STARTFLAGS from environment, ckuus4.c.
  1238. . Fix some typos in command-line processing (-q), ckuus4.c.
  1239. . Be sure to suppress herald if started with -q, ckuus7.c.
  1240. . Fix ssh command-line switches, ckuusy.c.
  1241. Eric Smutz complained that HTTP POST was adding an extraneous blank line,
  1242. which prevented his application from successfully posting. RFC 2616 states
  1243. (in Section 4.1):
  1244. In the interest of robustness, servers SHOULD ignore any empty
  1245. line(s) received where a Request-Line is expected. In other words, if
  1246. the server is reading the protocol stream at the beginning of a
  1247. message and receives a CRLF first, it should ignore the CRLF.
  1248. Certain buggy HTTP/1.0 client implementations generate extra CRLF's
  1249. after a POST request. To restate what is explicitly forbidden by the
  1250. BNF, an HTTP/1.1 client MUST NOT preface or follow a request with an
  1251. extra CRLF.
  1252. This seems pretty clear. One section of code in http_post() (just above the
  1253. postopen: label) was appending a CRLF to a buffer whose last already was
  1254. terminated by CRLF, and then appended a second CRLF; thus two empty lines.
  1255. I removed the second one. ckcnet.c, 28 Aug 2005.
  1256. I looked into the 64-bitness of NetBSD, it seems to be like Linux and
  1257. FreeBSD on 64-bit hardware, i.e. you just build it there and it works, at
  1258. least on Alpha and AMD64, going back to NetBSD 1.4 or 1.5. But I don't have
  1259. access to any of these for verification and documentation on the Web is
  1260. scanty.
  1261. Checked PeterE's complaint again of warnings in ckutio.c about parameter
  1262. list of get[ug]id() and gete[ug]id(). When I "make hpux1100o" on HP-UX
  1263. 11.11 (PA-RISC), there are definitely no warnings. He says the same thing
  1264. happens on 10.xx, but I don't have access to that any more. I also did
  1265. "make hpux1100o" on HP-UX 11.23 (11i v2) (PA-RISC), also no warnings.
  1266. (Except in both cases, a warning about a comment within a comment in
  1267. /usr/include/sys/ptyio.h). On HP-UX 11i v2 on Itanium, however, there are
  1268. TONS of warnings, mostly of the "variable set but never used" kind. Also
  1269. "dollar sign used in identifier". Tracking this last one down, I see it's
  1270. complaining about code that's in #ifdefs for other platforms, such as
  1271. Apollo Aegis. Is "aegis" defined in HP-UX 11i v2/IA64? No! (It would show
  1272. up in SHOW FEATURES if it was.) Some phase of the compiler is complaining
  1273. about code that it should be skipping (and that, in fact, it *is* skipping
  1274. it because the build is successful). It's as if cc is running lint for me
  1275. but not telling lint which macros are defined and which are not.
  1276. Verified that 64-bit linking fails in the same way for HP-UX 11i v2 on both
  1277. IA64 and PA-RISC. Sent a query to HP.
  1278. Compiling ckcnet.c and ckcftp.c got the familiar sockopt-related warnings on
  1279. HP-UX 11i v2; turns out it is just like Tru64 Unix in using an int for the
  1280. length argument. Added another special case and the warnings went away.
  1281. ckcnet.h, 28 Aug 2005.
  1282. Added some stuff to SHOW FEATURES to see what kinds of macros are exposed
  1283. (e.g. INT_MAX, LONG_MAX, LLONG_MAX, etc) and also show sizeof(long long) and
  1284. sizeof(off_t). Building this code all over the place will give me an idea
  1285. of how widespread these data types are, and to what extent I can tell
  1286. whether they are available from clues in the header files. (At first
  1287. glance, it appears that I'm not picking up <limits.h>, but adding an
  1288. #include for it is just asking for trouble.) No complaints about long long
  1289. or off_t from Solaris 9 or recent Linuxes. ckuus5.c, 28 Aug 2005.
  1290. Fixed a warning in HP-UX 10 and 11 stemming from some old-style prototypes
  1291. in ckutio.c for get[re][gu]id(). ckutio.c, 29 Aug 2005.
  1292. Updated minix3 target from Andy Tanenbaum. makefile, 29 Aug 2005.
  1293. PeterE confirms that "long long" and off_t are available in all HP-UX 10 and
  1294. 11, and in HP-UX 9 on PA-RISC but not Motorola. 30 Aug 2005.
  1295. Got 64-bit builds to work on HP-UX. According to my notes, John Bigg of HP
  1296. said (in 1999) that HP-UX 10.30 and later require PA-RISC 1.1, and do not
  1297. work on PA-RISC 1.0. But is PA 1.0 64-bit or what? Today, Alex McKale of
  1298. HP said "The 64-bit binaries will work on all machines that have the same or
  1299. later release of HP-UX (excluding PA-RISC 1.1 machines)". Still need
  1300. clarification... Maybe it's that all IA64 builds can be 64-bit but I need
  1301. dual builds for PA-RISC. Meanwhile I started transfer of a 4GB+ file from
  1302. Solaris to HP-UX 11i but it exceeded some quota on the HP long before it
  1303. approached the 2G point. It failed cleanly and up until then it was working
  1304. fine (numbers, stats, etc). 30 Aug 2005.
  1305. Support of large files in 32-bit builds began in 10.20. 64-bit application
  1306. support began in 11.00, but not all machines that run 11.00 support 64 bits.
  1307. About long files, see HP /usr/share/doc/lg_files.txt.
  1308. PeterE found that certain patterns can still make Kermit loop; example:
  1309. if match T01011-00856-21-632-073 *[abc] { echo GOOD } else { echo BAD }
  1310. if match T01011-00856-21-632-073 *[a-z] { echo GOOD } else { echo BAD }
  1311. The minimum offending pattern is * followed immediately by an [xxx]
  1312. construction, followed by anything else, including nothing. Previous
  1313. versions of Kermit handled this one correctly, without looping (but failed
  1314. certain matches that should have succeeded). The new section of code I
  1315. added on 15 June, upon failure to match, advances the string pointer and
  1316. backs up the pattern to the previous pattern, and starts again
  1317. (recursively). However, there needed to be a corresponding check at entry
  1318. for an empty target string. ckmatch(): ckclib.c, 12 Sep 2005.
  1319. PeterE discovered that "kermit -y filethatdoesnotexit" gives an erroneous
  1320. error message that names the user's customization, rather than the name
  1321. given on the command line. doinit(): ckuus5.c, 12 Sep 2005.
  1322. FREAD does not get an error if it tries to read a record or file or piece of
  1323. file that is too big for its buffer. In particular, FREAD /SIZE:xxx seems
  1324. to succeed even if less than xxx was read. It should fail unless, perhaps,
  1325. it successfully read up to the end of the file. Furthermore, if xxx is
  1326. bigger than the file buffer size, it should complain. The buffer is
  1327. line[LINBUFSIZ], 32K. The lack of failure was due to code in dofile() that
  1328. adjusted the given size silently if it was greater than the buffer size,
  1329. which I removed, and also added a check when parsing the /SIZE: switch.
  1330. dofile(): ckuus7.c, 12 Sep 2005.
  1331. That still didn't help with FREAD /SIZE:n returning less than n bytes, even
  1332. when they were available. That's because the underlying routine, z_in(),
  1333. didn't check fread()'s return code, which is the number of bytes read.
  1334. If fread() has smaller buffers, it needs to be called in a loop. z_in():
  1335. ckuus7.c, 12 Sep 2005.
  1336. Flen() fails on strings of length 8192 or more. The limitation is in the
  1337. callers of zzstring, which seem to be specifying an 8K buffer, in this case
  1338. fneval(). The operable symbols are FNVALL (max length of value returned by
  1339. a function) and MAXARGLEN (maximum length of an argument to a function). I
  1340. changed both of these for BIGBUFOK builds to be CMDBL. Buffers can never be
  1341. infinite, there has to be a limit. It's important to make everything work
  1342. consistently within that limit, and to make something useful happen when the
  1343. limit is exceeded. At this point, I can probably also increase the limits
  1344. for modern 32-bit systems, and certainly for 64-bit ones. Also there's no
  1345. point in worrying about 16-bit platforms any more; earlier C-Kermit versions
  1346. can still be used on them if necessary. ckuusr.h, 12 Sep 2005.
  1347. Special #ifdefs for finding resolv.h and nameser.h in MINIX3 from Andy
  1348. Tanenbaum. ckcnet.c, 20 Sep 2005.
  1349. PeterE noticed that ckmatch(), even though it works pretty well now, does a
  1350. lot of extra and unnecessary recursion after determining the string and
  1351. pattern do not match, at least when the pattern is of the form *[abc].
  1352. After several false starts I was able reduce this effect to a minor level
  1353. (but not eliminate it all together) by changing a while loop into a do loop.
  1354. ckmatch(): ckclib.c, 15 Oct 2005.
  1355. Added -DNOLONGLONG to HP-UX 8.00 and earlier builds, and to Motorola-based
  1356. HP-UX 9.00 builds. This is simply to inhibit the test for whether "long
  1357. long" is supported by the compiler, since when it isn't, the module
  1358. containing the test won't compile. makefile, ckuus5.c, 16 Oct 2005.
  1359. Making ASKQ always echo asterisks is a bad idea, because when it doesn't
  1360. echo, it's the perfect way to read silently from stdin, e.g. in a CGI script
  1361. (INPUT can also be used for this but it's not as straightforward). So I put
  1362. the default for ASKQ back to no echoing, then gave ASKQ its own switch
  1363. table, which is the same as for ASK with the addition of an /ECHO:x switch,
  1364. which tells what character to echo. ckucmd.c, ckuus[26].c, 17 Oct 2005.
  1365. Fixed a bug in FTP GET /COMMAND filename commandname; it always dumped core
  1366. dereferencing a null string (the nonexistent local asname). ckcftp.c,
  1367. 17 Oct 2005.
  1368. For docs: if you don't like the funny business that happens when you type
  1369. an IF command at the prompt, use XIF instead and it won't happen. Also note
  1370. that commands like "if xxx { echo blah } else { echo blah blah }" don't
  1371. work when typed at the prompt; you have to use XIF for this.
  1372. Back to ckmatch()... Under certain conditions (e.g. patterns like *[abc])
  1373. failure to match would not stop the recursion because the string and pattern
  1374. arguments are on the stack, as they must be, so there was no way for level
  1375. n-1 to know that level n had detected a definitive nonmatch and that no
  1376. further attempts at matching were required. The right way to handle this is
  1377. to recode the whole thing as coroutines, the cheap way out is with a global
  1378. static flag. Works perfectly, in the sense that the match.ksc test results
  1379. are identical to what they were before and the extra backing up and
  1380. recursion are eliminated. (The Oct 15th fix wasn't really a fix, it broke
  1381. a couple of cases.) ckclib.c, 20 Oct 2005.
  1382. ckuus7.c(2987): warning #267: the format string requires additional arguments
  1383. (in PURGE command); fixed 20 Oct 2005.
  1384. From Andy Tanenbaum, final changes for MINIX3: #ifdef out the inline
  1385. definitions for gettimeofday() and readlink(). ckutio.c, 23 Oct 2005.
  1386. From Jeff: struct gss_trials initializers changed from gss_mech_krb5 to
  1387. ck_gss_mech_krb5. ckcftp.c, 23 Oct 2005.
  1388. From Jeff: some improvements to K95 GUI SHOW TERMINAL. ckuus5.c, 23 Oct 2005.
  1389. Found and corrected some misplaced #ifdefs in shofeat(), ckuus5.c, 23 Oct 2005.
  1390. --- Dev.03 ---
  1391. Fixed a compiler warning in a debug() statement in zzstring() by adding
  1392. parens. ckuus4.c, 24 Oct 2005.
  1393. Added -DNOLONGLONG to sv68r3v6 target, makefile, 25 Oct 2005.
  1394. New makefile targets for HP-UX from PeterE to handle the 'long long'
  1395. situation. 26 Oct 2005.
  1396. From Jeff: changes to support OpenSSL 0.9.8, ck_ssl.h. ckcasc.h has had
  1397. short names defined for ASCII control characters for 20-some years but now
  1398. they are causing conflicts, so EM becomes XEM (also for OpenSSL 0.9.8).
  1399. Changed K95's default terminal type from VT320 to VT220 because VT320
  1400. termcaps/terminfos are disappearing from Unix hosts: ckuus7.c. Reorganize
  1401. the data-types section of SHOW FEATURES to add more macro tests for integral
  1402. sizes and to provide for the proper printf formatting in order to allow the
  1403. sizes to be output ("You are going to need to be careful because %llx is not
  1404. supported on all platforms. On Windows, it is the same as %lx, 32 bits"):
  1405. ckuus5.c, 26 Oct 2005.
  1406. Defined NOLONGLONG ckcdeb.h for various old platforms where we know we are
  1407. never going to need 64-bit ints (even if they support a long long datatype,
  1408. chances are pretty slim they supported 64-bit file sizes). ckcdeb.h,
  1409. 26 Oct 2005.
  1410. PeterE noticed that GOTO targets can only be 50 characters long. This was
  1411. by design, a long time ago, on the assumption that nobody would make longer
  1412. labels. But in SWITCH statements, case labels can be variables that expand
  1413. to anything at all. If we chop them off at 50, we might execute the wrong
  1414. case. Changed the maximum label size to be 8K, and added code to dogoto()
  1415. to check when a label or target is too long and fail, to prevent spurious
  1416. GOTO or SWITCH results. ckuusr.h, ckuus[r6].c, 26 Oct 2005.
  1417. Testing revealed there was still a problem with SWITCH case labels that were
  1418. variables that expanded into long strings. Turns out that I was being
  1419. too clever when I decided that, if the SWITCH macro was n1 characters long
  1420. and the case-label search target was n2 characters long, I only had to
  1421. search the first n1-n2+1 characters of the macro definition. That was true
  1422. before I allowed case labels to be variables, but not any more! Fixed in
  1423. dogoto(): ckuus5.c, 26 Oct 2005.
  1424. --- Dev.04 ---
  1425. Dev.04 didn't actually contain Jeff's data-type changes to shofeat(),
  1426. I think I saved the wrong buffer in EMACS... Fixed now. 27 Oct 2005.
  1427. PeterE corrected a typo in the HP-UX 7.00 makefile target. 27 Oct 2005.
  1428. PeterE had been reporting problems stress-testing the new SWITCH code, but
  1429. only on HP-UX 9, primarily stack overrun. Turns out to be the HP-UX 9
  1430. optimizing compiler's fault. No optimization, no problems.
  1431. PeterE found that even when dogoto() detects a string that is too long
  1432. and fails, this does not stop SWITCH from producing a result, which can not
  1433. possibly be trusted. Changed the part of dogoto() that handles this to
  1434. not just fail, but also to exit the script immediately and return to top
  1435. level. ckuus6.c, 28 Oct 2005.
  1436. An idea popped into my head after having typed too many commands like "dir
  1437. ck[cuw]*.[cwh]" to check the list of matching files, and then having to
  1438. retype the same filespec in a SEND command: Why not unleash some unused
  1439. control character such as Ctrl-K to spit out the most recently entered input
  1440. filespec? It was easy, just a few lines in cmifi2() and gtword(), plus a
  1441. couple declarations. To see all the changes, search for "lastfile" (all the
  1442. new code is protected by #ifndef NOLASTFILE). ckucmd.c, 28 Oct 2005.
  1443. I added a new variable \v(lastfilespec) that expands to the same last
  1444. filespec, for use in scripts. ckuusr.h, ckuus4.c, 28 Oct 2005.
  1445. The Unix version of C-Kermit failed to put anything in the session log if
  1446. SET TERMINAL DEBUG ON. Rearranged the pertinent clause so logging happens
  1447. independent of TERMINAL DEBUG. For now, since the user who noticed this
  1448. wanted debug format to go into the session log, that's what I do. The
  1449. alternative would be to just log the raw incoming stream as usual, or to add
  1450. Yet Another SET Command to choose. ckucns.c, 11 Nov 2005.
  1451. Fixed HELP INTRO text. ckuus2.c, 11 Nov 2005.
  1452. Added NOLONGLONG for SV68. ckcdeb.h, 11 Nov 2005.
  1453. --- Dev.05 ---
  1454. Added a debug() statement in FTP secure_getbyte() to see what's going on
  1455. with Muhamad Taufiq Tajuddin's 205-byte-per-second FTP/SSL downloads.
  1456. --- Dev.06 ---
  1457. Result: nothing, SSL_get_error() does not report any errors. Suggested
  1458. testing SSL_read()'s return code, if 0 don't update the screen.
  1459. Created a new data type CK_OFF_T in ckcdeb.h that will eventually resolve
  1460. to whatever each platform uses for file sizes and offsets. ckcdeb.h,
  1461. 17 Nov 2005.
  1462. Made a new library routine ckfstoa() that converts a file size or offset to
  1463. a string. This is to solve the problem with having to use different
  1464. printf() formats for different representations of file size (int, long, long
  1465. long, off_t, signed, unsigned, etc). Replaced a few printf("%l",size) with
  1466. printf("%s",ckfstoa(size)) with the expected results. This is just a start,
  1467. the definitions will need adjustment for many platforms, variables need to
  1468. be redeclared, and all the offending printf's (and printw's) will have to
  1469. hunted down and converted. ckclib.[ch], ckuus4.c, 17 Nov 2005.
  1470. Built a minimal version on Linux with:
  1471. make linux "KFLAGS=-DNOLOCAL -DNOICP -DNOCSETS -DNODEBUG"
  1472. Worked fine, result was 260K on i686. 21 Nov 2005.
  1473. Discovered that Kermit's date parser, contrary to the documentation, failed
  1474. to handle strings like "Wed, 13 Feb 2002 17:43:02 -0800 (PST)", which are
  1475. commonly found in email. This was because of an overzealous and misguided
  1476. check in the code; once removed, all was well. ckucmd.c, 26 Nov 2005.
  1477. Added a new format code 4 to \fcvtdate() to emit asctime() format, used in
  1478. BSD-format email message envelopes (i.e. the "From " line). shuffledate(),
  1479. ckucmd.c, ckuus[24].c, 26 Nov 2005.
  1480. Added a new function \femailaddress(). Given a From: or Sender: header line
  1481. from an RFC2822-format email address, extracts and returns the actual email
  1482. address, such as kermit@columbia.edu. ckuusr.h, ckuus[42].c, 26 Nov 2005.
  1483. Using the new functions, I wrote a script to fetch mail from a POP3 server
  1484. over a TLS connection. But the line-at-a-time input (needed for changing
  1485. line terminators and byte-stuffing text lines that start with "From ") is
  1486. slow, 17 sec to read 29 messages totaling 175K.
  1487. Added INPUT /CLEAR so INPUT can be started with a clean buffer without
  1488. requiring a separate CLEAR INPUT command. ckuusr.h, ckuus[r24].c,
  1489. 27 Nov 2005.
  1490. One thing that INPUT was never able to do well was read and save the
  1491. complete incoming data stream. That's because, while waiting for its
  1492. target, the buffer might overflow wrap around. Yet there was never a way to
  1493. tell it to stop when its buffer fills up and let me save it. I added a
  1494. /NOWRAP switch that does this. If the buffer fills up before any other
  1495. completion criterion is met, INPUT returns failure, but with \v(instatus)
  1496. set to 6 (the next available instatus value). Thus a program that wants to
  1497. read and save (say) an email message from a POP server, which could be any
  1498. length at all, and which terminates with <CRLF>.<CRLF> could do this:
  1499. set flag off
  1500. while open connection {
  1501. input /nowrap 10 \13\10.\13\10 # Wait for <CRLF>.<CRLF>
  1502. if success {
  1503. frwrite /string \%o {\freplace(\v(input),\13\10.\13\10,\13\10)}
  1504. set flag on
  1505. break
  1506. } else if ( == \v(instatus) 6 || == \v(instatus) 1 ) {
  1507. frwrite /string \%o {\v(input)}
  1508. continue
  1509. }
  1510. break
  1511. }
  1512. if flag (handle success)
  1513. Note carefully the braces around the FWRITE text; without them, trailing
  1514. spaces would be lost.
  1515. Previously the only way to INPUT an entire data stream without losing
  1516. anything (assuming it was ordinary lines of text that were not "too long"),
  1517. was line-by-line:
  1518. while open connection {
  1519. input /clear 10 \13\10
  1520. if fail break
  1521. if eq "\v(input)" "$ \13\10" break
  1522. fwrite /string \%o {\freplace(\v(input),\13\10,\10)}
  1523. }
  1524. The new code is 3 times faster using the default INPUT buffer length of 4K.
  1525. Raising it to 16K makes it 3.6 times faster (not worth it). Changing the
  1526. POP3 script to use INPUT /NOWRAP makes it about twice as fast (it does more;
  1527. it has to do all the byte-stuffing and unstuffing). 27 Nov 2005.
  1528. Changed ssl_display_xxx() to just return if SET QUIET ON. Otherwise there
  1529. is no way to suppress the messages. Also protected a previously unprotected
  1530. printf("[SSL - OK]\r\n"); by if ( ssl_verbose_flag ). ck_ssl.c,
  1531. 28 Nov 2005.
  1532. Discovered that FOPEN /APPEND doesn't work if the file doesn't exist. It
  1533. uses cmiofi() which is a super-hokey front end to cmifi2(). I had code to
  1534. call it but for some reason it was commented out, with a note to the effect
  1535. it didn't work. I uncommented it but that didn't help much. So I wrote an
  1536. entirely new cmiofi() that works exactly as it should, using chained FDBs,
  1537. _CMIFI to _CMOFI (I think the original cmiofi() predated chained FDBs).
  1538. ckuus7.c, ckucmd.c, 29 Nov 2005.
  1539. Getting rid of the awful hacks required to call cmiofi() meant I also had to
  1540. change the EDIT command, which is the only other place where it's used.
  1541. Unfortunately now it's no longer possible to give EDIT without a filename
  1542. (to just start an empty editor) but I doubt anyone will notice. ckuusr.c,
  1543. 29 Nov 2005.
  1544. IF KERBANG didn't always work right. If a kerbang script TAKEs another
  1545. kerbang script, the second one should have IF KERBANG false, but it didn't.
  1546. Added a check for \v(cmdlevel) == 1. Now you can write a wrapper that runs
  1547. a kerbang script in a loop, and the latter can use IF KERBANG to know
  1548. whether to EXIT (if called at top level) or END (if called by another
  1549. script, thus allowing -- in this case -- the loop to continue). ckuus6.c,
  1550. 29 Nov 2005.
  1551. Changed \flop() and flopx() functions to take a third argument, a number
  1552. signifying at which occurrence of the break character to lop, so:
  1553. \flopx(sesame.cc.columbia.edu) = edu
  1554. \flopx(sesame.cc.columbia.edu,,2) = columbia.edu
  1555. ckuus[24].c, 1 Dec 2005.
  1556. Built OK on VMS 7.2-1 with MultiNet 4.4. Built with and without OpenSSL on
  1557. Linux OK, ditto Solaris 9. Built OK on RH Linux AS4 on X86_64 (64-bit);
  1558. "show var fsize" (using new ckfstoa()) works OK there. Also Mac OS X 10.3.9
  1559. (32-bit), Tru64 UNIX 4.0F (64-bit), HP-UX 11iv2 (64-bit) (picky new compiler
  1560. spews out tons of useless warnings), FreeBSD 6.0 on ia64 (64-bit).
  1561. --- Dev.07 ---
  1562. Changed "make netbsd" to be a synonym for "make netbsd2" because the
  1563. original netbsd target was ancient. Renamed it to netbsd-old. makefile,
  1564. 3 Dec 2005.
  1565. Updated INPUT and MINPUT help text. ckuus2.c, 3 Dec 2005.
  1566. Discovered that on a SET PORT /SSL connection, Kermit treats incoming
  1567. 0xff data bytes (e.g. sent from the POP server) as IACs and goes into Telnet
  1568. negotiations. Jeff says "You will need to implement NP_SSLRAW and NP_TLSRAW
  1569. that do the same as NP_TCPRAW but negotiate SSL or TLS as appropriate."
  1570. This was not as easy as it sounded, because apparently a lot of the Telnet
  1571. code is used by SSL and TLS even when Telnet protocol is not being executed.
  1572. I wound up doing this as follows: I added /SSL-RAW and /TLS-RAW to the
  1573. switch table. Rather than disable Telnet, they do exactly what the /SSL and
  1574. /TLS switches do, but also set a special flag. This flag is checked in only
  1575. two place: netclos() (to prevent Kermit from sending TELNET LOGOUT when
  1576. closing the connection), and tn_doop() (to prevent Kermit from reacting to
  1577. incoming IACs; it makes tn_doop() return(3), which means "quoted IAC", which
  1578. causes the caller to keep the IAC as data). ckcnet.h, ckctel.h, ckctel.c,
  1579. ckuus7.c, 4 Dec 2005.
  1580. The INPUT command did not account for tn_doop() returning 3. Fixed in
  1581. doinput(), ckuus4.c, 4 Dec 2005.
  1582. Added another debug() statement in FTP secure_getbyte() to see what's going on
  1583. with Muhamad Taufiq Tajuddin's 205-byte-per-second FTP/SSL downloads, plus
  1584. new code to test SSL_read()'s return code (byte count); if 0 don't update
  1585. the screen. ckcftp.c, 4 Dec 2005.
  1586. --- Dev.08 ---
  1587. Fixed a typo in the non-ANSIC definition of ckfstoa(). ckclib.c, 7 Dec 2005.
  1588. Our Ctrl-C trap (the ON_CTRLC macro) wasn't working for kerbang files.
  1589. Rearranged some code to make it work. ckcmai.c, 8 Dec 2005.
  1590. Started converting code to use CK_OFF_T for file sizes and offsets, and
  1591. all [s]printf's to replace "%ld" or whatever with "%s", and the size
  1592. variable with a call to ckfstoa(). Since I haven't actually changed the
  1593. definition of CK_OFF_T from what all the size variables were to begin
  1594. with (i.e. long), it shouldn't do any harm. So far just ckcfn3.c
  1595. 10 Dec 2005.
  1596. An updated HP-UX 9.xx makefile target from PeterE to fix a core dump that
  1597. happens on that platform due to insufficient resources. 14 Dec 2005.
  1598. Added debug() statements to http_blah() routines to tell whether the
  1599. connection is "chunked". There seems to be a bad performance problem.
  1600. ckcnet.c, 14 Dec 2005.
  1601. PeterE complained about ugly DIRECTORY error message, ?No files match -
  1602. "{blah}". The braces are used internally in case the user typed more than
  1603. one filespec. I changed the error message to remove them. Ditto DELETE.
  1604. ckuus6.c, 15 Dec 2005.
  1605. The problem with HTTP downloads is that Kermit always does single-character
  1606. read() or socket_read() calls (or the SSL equivalent); see http_inc(). I
  1607. added buffering code for non-SSL connections only but it's gross because it
  1608. has to swap ttyfd and httpfd before calling nettchk(). I tried making a
  1609. nettchk() clone that accepts a file descriptor as an argument but it didn't
  1610. work because too many other routines that are invoked directly or implicitly
  1611. by nettchk() (such as in_chk()) are still hardwired to use ttyfd. HTTP GETs
  1612. are now 20 times faster on the local network (the improvement is less
  1613. dramatic over a clogged Internet). ckcnet.[ch], 15 Dec 2005.
  1614. --- Dev.09 ---
  1615. HTTP file-descriptor swapping is not thread safe. Doing it right, of
  1616. course, is a big deal, so for now I just don't define HTTP_BUFFERING for
  1617. Windows. ckcnet.c, 15 Dec 2005.
  1618. Noticed that HTTP not included in FreeBSD and OpenBSD builds. Fixed in
  1619. ckcdeb.h, 22 Dec 2005.
  1620. Fleshed out 32/64-bit data type definitions and changed struct zattr
  1621. (file attribute structure) members length and lengthk to have the new
  1622. CK_OFF_T type. Changed final arguments of debug() and tlog() to be the new
  1623. LONGLONG type. ckcdeb.h, 22 Dec 2005.
  1624. Changed ckfstoa() to return a signed number in string form, rather than an
  1625. unsigned one. That's because off_t is signed (thank goodness). Added the
  1626. inverse function, ckatofs() so we can convert file sizes and offsets back
  1627. and forth between binary number and string. ckclib.c, 22 Dec 2005.
  1628. Changed Attribute Packet reader to convert incoming file size attribute
  1629. with ckatofs() rather than atol(). ckcfn3.c, 22 Dec 2005.
  1630. Converted debug(), tlog(), ckscreen(), etc, to handle potentially "long long"
  1631. arguments by making their "n" argument CK_OFF_T. ckuusx.c, ckcdeb.h,
  1632. 22 Dec 2005.
  1633. Converted the rest of the source files to use CK_OFF_T for all file size
  1634. and offset and byte-count related variables, and converted all references to
  1635. these variables in printfs to go through ckfstoa(). Then I built it on
  1636. Linux/i386 with:
  1637. make linux "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
  1638. which makes off_t be 64 bits and magically makes all the regular file APIs
  1639. use 64-bit sizes and offsets without changing the API calls in the source
  1640. code. It's going to be a lot of work to get through all the kinks but I was
  1641. able to send a long file, do directory listings of long files, do
  1642. \fsize(longfile), etc. When it sends a file, the length is shown correctly
  1643. in the A packet. If the receiver does not support big numbers, it receives
  1644. the file OK anyway, without showing the size, the thermometer, or percent
  1645. done (and then will get an error when the file keeps coming after the 2G
  1646. mark). Kermit 95 actually refuses long files for "Size", but only if the
  1647. announced is less than 2^63 bytes. When today's Linux version receives a
  1648. file, it shows the length correctly in the file-transfer display, as well as
  1649. percent done, thermometer, etc. Also built this version on true 64-bit
  1650. Linux, and it worked fine. Many files changed, 22 Dec 2005.
  1651. For the record, this API is specified in X/Open's Single UNIX Specification
  1652. Version 2, which is branded as UNIX 98. It is called Large File Support, or
  1653. LFS, and was developed at the Large File Summit.
  1654. It looks like the operative feature-test macro in glibc for transitional
  1655. large file support is __USE_LARGEFILE64. So if this is defined, we can also
  1656. supply _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64 automatically for 32-bit
  1657. Linux builds. But there's a Catch-22, you don't know if this is defined
  1658. until you read the header files, but you have to define _LARGEFILE_SOURCE
  1659. and _FILE_OFFSET_BITS before you read the header files. Maybe it's good
  1660. enough to grep through <features.h> for __USE_LARGEFILE64. makefile,
  1661. 23 Dec 2005.
  1662. Checked this on true 64-bit Linux. The same symbols are defined in CFLAGS,
  1663. but they do no harm; it builds without complaint and works fine. 24 Dec 2005.
  1664. Built it on Red Hat Linux 6.1 from 1999. This picked up the long file
  1665. support too. Guess 6.1 isn't old enough to not have it! Kermit seems to
  1666. work OK on regular files but I don't have enough disk space to create a long
  1667. file, and my bigfile.c program (which creates a long file containing only 1
  1668. byte) doesn't work ("fseeko: invalid argument"). It looks like parts of
  1669. this API were visible in Linux before they were actually working.
  1670. 24 Dec 2005.
  1671. Converted all fseek() and ftell() to macros that expand to fseek() and ftell()
  1672. or fseeko() and ftello() depending on whether _LARGEFILE_SOURCE is defined.
  1673. ckufio.c, ckuus7.c, ckuusx.c, 24 Dec 2005.
  1674. Made a CK_OFF_T version of cmnum(). It would be a very big deal to just
  1675. change cmnum() to return a new type, so another idea is to rename cmnum() to
  1676. something else, cmnumw(), change its result argument to CK_OFF_T, and then
  1677. make a stub cmnum() to call it to get an int, then call cmnumw() explicitly
  1678. any time we need a big number. ckucmd.c, 24 Dec 2005.
  1679. Calling cmnumw() directly requires changes to each routine that uses it.
  1680. The INCREMENT and DECREMENT commands, for example, required changes to
  1681. doincr(), varval(), and incvar(), and all references to them. ckuusr.[ch],
  1682. ckuus[56].c, 24 Dec 2005.
  1683. Calling cmnumw() in chained FDBs required defining a new function code,
  1684. _CMNUW, adding a new member to the OFDB struct for returning wide results,
  1685. and adding a new case to cmfdb(). ckucmd.[ch], 24 Dec 2005.
  1686. Changed FSEEK and FCOUNT to use the new chained FDB interface, now we can
  1687. seek and look past 2GB. ckuus7.c, 24 Dec 2005.
  1688. Next come switches, which store their results in a struct stringint. This
  1689. struct was defined in each module where it was used (ckuus[r367].c, ckcftp.c).
  1690. I moved the definition to ckuusr.h and added a wval member, which can be
  1691. referenced by any switch-parsing code that calls cmnumw(). 24 Dec 2005.
  1692. Changed SEND /CALIBRATE:n to allow big values of n. This makes it possible
  1693. to test the protocol aspects of long-file transfer without actually having a
  1694. long file handy. ckuusr.c, 24 Dec 2005.
  1695. SEND /SMALLER-THAN:n, SEND /LARGER-THAN:n, and and SEND /START:n also now
  1696. allow large values of n. ckuusr.c, 24 Dec 2005.
  1697. Changed the algebraic expression evaluator to use wide values.
  1698. ckuus5.c, 24 Dec 2005.
  1699. Fixed ckfstoa() to handle the case when n is negative and (0 - n) is also
  1700. negative, which happens for numbers 2^(n-1) or greater, where n is the
  1701. number of bits in the word size we're dealing with, e.g. 64, in which case
  1702. 2^63 has its sign bit set so seems to be negative. In such cases, ckfstoa()
  1703. returns "OVERFLOW" instead of a numeric string. We'll have to see how this
  1704. plays out but I think it's better to cause a parse error and stop things
  1705. dead than to return a spurious number. ckclib.c, 24 Dec 2005.
  1706. Converted the S-Expression handler to use wide integers. ckuus3.c, 24 Dec 2005.
  1707. Took all the LONGLONG stuff out of ckcdeb.h, we don't need it.
  1708. All of these changes result in 64-bit arithmetic (more or less) on 32-bit
  1709. Linux, as well as on true 64-bit platforms.
  1710. Rebuilt today's code on Solaris 9 in the 32-bit and 64-bit worlds, on Red
  1711. Hat 6.1, Red Hat AS4.2. I haven't bothered trying a 32/64 hybrid build for
  1712. Solaris, since I can build a pure 64-bit version there. Quick tests show
  1713. the large-number arithmetic works OK in all cases except, of course, on pure
  1714. 32-bit builds (unfortunately I can't find a running Linux system old enough
  1715. to verify this for Linux, but it's true for other 32-bit platforms).
  1716. 24 Dec 2005.
  1717. Tried building a hybrid version on Solaris 9 after all since the LFS API is
  1718. ostensibly the same as for Linux:
  1719. make solaris9 "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
  1720. It built smoothly and the resulting binary is 2.5MB compared to 3.4MB for
  1721. the 100% 64-bit version. Looks like a keeper. For now, added solaris9lfs
  1722. and solaris10lfs entries to the makefile but if these work on PCs we can
  1723. make these the regular entries for Solaris 9 and 10. 27 Dec 2005.
  1724. Built on Mac OS X 10.4 with the regular target. It seems that in that case,
  1725. off_t is 64 bits anyway. Noticed that a lot of stuff didn't work, like
  1726. exponentiation in S-Expressions. Tried building it as above, which worked,
  1727. and now CK_OFF_T is 64 bits instead of 32, but (^ 2 30) is still 2.0. In
  1728. fact 2-to-the-any-power is 2.0. It seems that the Mac OS X version did not
  1729. have FNFLOAT defined. It also seems that every test in dosexp() like:
  1730. if (result != fpresult) fpflag++;
  1731. should have been protected by #ifdef FNFLOAT..#endif /* FNFLOAT */ -- a
  1732. double-ended break, as they say in the nuclear power industry. ckuus3.c,
  1733. 27 Dec 2005.
  1734. Added GREP /EXCEPT:pattern. ckuus[26].c, 27 Dec 2005.
  1735. Fixed a problem with uninitialized pv[].wval (switch-parsing parameter-value)
  1736. members that showed up on certain platforms or with certain compilers. Now
  1737. the Mac OS X 10.4 version works. ckuus[r367].c, ckcftp.c, 28 Dec 2005.
  1738. Built on Unixware 7.1.1, a pure 32-bit build, seems fine. Rebuilt on Red
  1739. Hat AS 4.2 just to make sure I didn't break anything, it's OK. No testing
  1740. on HP-UX, etc, because HP testdrive file system is full, can't upload
  1741. anything. 29 Dec 2005.
  1742. Commented out the SHOW FEATURES section that displays constants like
  1743. INT_MAX, CHAR_MAX, etc, because printing each value in the appropriate
  1744. format is too tricky, and we don't need them anyway. ckuus5.c, 29 Dec 2005.
  1745. Updated ckvfio.c to use CK_OFF_T for the relevant variables. Built and
  1746. tested on VMS/Alpha 7.2: file transfer in remote mode; making a Telnet
  1747. connection and then local-mode file transfer; S-Expressions, all OK. Also
  1748. built a no-net version OK. 29 Dec 2005.
  1749. Built and tested on Red Hat AS4 AMD X86_64, used it to upload new sources to
  1750. FreeBSD 4.11. Built on FreeBSD 4.11/i386. Here's another one where off_t
  1751. is 64 bits, even though long is 32 bits. But it seems to work ok, not sure
  1752. why, when CK_OFF_T is 32 bits. There is no _LARGEFILE_SOURCE stuff in the
  1753. header files. 29 Dec 2005.
  1754. Built on Mac OS X 10.3.9 using the new macosx10.4 target to pick up LFS.
  1755. Works fine.
  1756. Built on Red Hat Linux 4WS on IA64 (64-bit). Now this one is odd, stat()
  1757. fails on big files. It happens also if I use the "linuxnolfs" target, which
  1758. does not define _USE_LARGEFILE or _FILE_OFFSET_BITS=64. DIRECTORY BIGFILE
  1759. shows the size as -1, but if "log debug", it says "no files match", i.e.
  1760. different behavior, observer effect. I hate when that happens.
  1761. Let's see if that's an anomaly... Built on Tru64 Unix 4.0F (64-bit Alpha).
  1762. It sees long files just fine. Rebuilt and checked on x86_64 again... fine.
  1763. OK, let's not worry about IA64 yet.
  1764. Another small fix to the HP-UX 9.0 target from PeterE. makefile, 29 Dec 2005.
  1765. ---Dev.10---
  1766. Code adjustments from Jeff, mainly to the SSL and TLS Raw mode code from
  1767. several weeks ago, plus changing some data types in the security code to
  1768. CK_OFF_T, plus a different data type for CK_OFF_T for K95 because Windows
  1769. size_T isn't signed. This presumably will allow large-number arithmetic but
  1770. it will not give large file access because that will require replacing all C
  1771. library file i/o calls (esp. in ckofio.c) with native Windows APIs. Build
  1772. on Solaris 9 with and without SSL and on Linux RH AS4.2 with and without
  1773. SSL. ck_crp.c, ck_ssl.c, ck_ssl.h, ckcdeb.h, ckcftp.c, ckcmai.c, ckcnet.c,
  1774. ckcnet.h, ckctel.c, ckuat2.h, ckuus4.c, ckuus7.c, ckuusr.c, 30 Dec 2005.
  1775. It was reported that WRITE SESSION always returned a failure status, even
  1776. when it succeeded. The problem was that Unix versions of zsout() and
  1777. zsoutl(), for the session log only, were using write() and returning
  1778. write()'s return code, which is different from what zsout() and zsoutl() are
  1779. documented to return. Also plugged a couple potential holes in zsoutx()
  1780. that I noticed while I was in the neighborhood. ckufio.c, 30 Dec 2005.
  1781. Added FSEEK /FIND:pattern. This form of FSEEK accepts all the other
  1782. switches and arguments and performs the desired seek. Then, if the seek was
  1783. successful, it starts from that point and reads through the file, line by
  1784. line, searching for the first line that contains the given string or matches
  1785. the given (unanchored) pattern and, if found, sets the file pointer to the
  1786. beginning of that line. Useful, e.g., for very long timestamped logs, where
  1787. you want to start processing at a certain date or time; searching for a
  1788. particular string is much faster than doing date comparisons on each line.
  1789. ckuus[27].c, 30 Dec 2005.
  1790. It was annoying me that FILE STATUS (FSTATUS) required a channel number to
  1791. be given even if only one file was open, so I supplied the correct default
  1792. in that case. ckuus7.c, 30 Dec 2005.
  1793. INPUT /NOWRAP, added recently, is used for efficiently copying the INPUT
  1794. stream intact, but it's not good for matching because if the INPUT target is
  1795. broken between the end of the previous buffer and the beginning of the next
  1796. one, the context is lost and the match does not occur. I thought of several
  1797. ways around this, but they all involve saving a huge amount of context --
  1798. old input buffers, the arrays of target strings and corresponding match
  1799. positions, etc. The alternative is fairly simple but it's not transparent
  1800. to the user. Here's what I did in a POP script:
  1801. .eom := "\13\10.\13\10"
  1802. set flag off # FLAG ON = success
  1803. while ( open connection && not flag ) {
  1804. .oldinput := \fright(\v(input),8) # Save tail of previous INPUT buffer
  1805. input /clear /nowrap 4 \m(eom) # Get new INPUT buffer
  1806. if success { # INPUT matched - good
  1807. .s := {\freplace(\v(input),\m(eom),\13\10)}
  1808. set flag on
  1809. } else { # No match
  1810. .s := \v(input) # Check if target crossed the border
  1811. .oldinput := \m(oldinput)\fsubstr(\v(input),1,8)
  1812. if \findex(\m(eom),\m(oldinput)) set flag on
  1813. }
  1814. ...
  1815. }
  1816. I think this will be easier to explain than any dangerous and grotesque
  1817. magic I might put into doinput() itself. For now, added a few words about
  1818. this to HELP INPUT. ckuus2.c, 30 Dec 2005.
  1819. Back to the pattern matcher. Noticed that "IF MATCH index.html [a-hj-z]*"
  1820. succeeded when it should have failed. In ckmatch(), the clist section
  1821. needed one more clause: it can't float the pattern if an asterisk does not
  1822. occur in the pattern before the clist. This change fixes the problem
  1823. without breaking any other cases that weren't already broken, most of which
  1824. involve slists, i.e. {string,string,string,...}. ckclib.c, 30 Dec 2005.
  1825. Tried FSEEK /FIND: on a largish file (over 100,000 lines), using it to seek
  1826. to a line near the end. It took 0.756 seconds, compared with Unix grep,
  1827. which did the same thing in 0.151 sec. That's because C-Kermit is using
  1828. ckmatch(). But if the search target is not a pattern, it should be a bit
  1829. faster to use ckindex(). Yup, 0.554 sec, a 36% improvement. Can't expect
  1830. to compete with grep, though; it's highly tuned for its single purpose.
  1831. ckclib.[ch], ckuus7.c, 1 Jan 2006.
  1832. Updated visible copyright dates to 2006: ckcmai.c, ckuus2.c, ckuus5.c,
  1833. 1 Jan 2006.
  1834. Noticed that NetBSD 2.0.3 has 64-bit off_t, and that _LARGEFILE_SOURCE is
  1835. mentioned in <stdio.h>. Tried building Kermit with _LARGEFILE_SOURCE added
  1836. to CFLAGS, it's good. Added it to the netbsd target. makefile, 1 Jan 2006.
  1837. Fixed typo, #ifdef CK_NOLONGLONG in ckuus5.c should have been #ifndef
  1838. CK_LONGLONG (which, it turns out, we don't use anyway). 2 Jan 2005.
  1839. Observed that FreeBSD 4.x has a 64-bit off_t, but does not use the
  1840. _LARGEFILE_SOURCE convention. Reasoning that all versions of FreeBSD have
  1841. off_t (I was able to check back to FreeBSD 3.3), I simply #define CK_OFF_T
  1842. to be off_t in ckcdeb.h within #ifdef __FreeBSD__ .. #endif. Another one
  1843. down. This can be done for any platform that is guaranteed to have off_t.
  1844. Turns out FreeBSD 3.3 has 64-bit off_t too. 2 Jan 2005.
  1845. OpenBSD, same as FreeBSD. Also, added OS-version-getting thing to makefile
  1846. target for the program herald, as in the other BSDs. Built on OpenBSD 2.5
  1847. from 1998, it has 64-bit off_t too. ckcdeb.h, makefile, 2 Jan 2005.
  1848. Dumping the command stack every time there's an error is really too much.
  1849. I added SET COMMAND ERROR-DISPLAY {0,1,2,3} to set the verbosity level of
  1850. error messages. Only level 3 dumps the stack. ckuus[235].c, 2 Jan 2005.
  1851. Built on HP-UX 11.11 with _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64. The
  1852. result works fine as far as I can tell. It sees big files, it can open
  1853. them, seek to positions past the 2^31 boundary. It can send large files.
  1854. It can do large-number arithmetic (^ 2 62). The only problem is that during
  1855. compilation, every single modules warns:
  1856. cc: "/usr/include/sys/socket.h", line 504: warning 562: Redeclaration of
  1857. "sendfile" with a different storage class specifier: "sendfile" will have
  1858. internal linkage.
  1859. cc: "/usr/include/sys/socket.h", line 505: warning 562: Redeclaration of
  1860. "sendpath" with a different storage class specifier: "sendpath" will have
  1861. internal linkage.
  1862. These warnings should be perfectly harmless since they are not coming from
  1863. C-Kermit code, nor does C-Kermit use either one of those functions. These
  1864. warnings don't come out in HP-UX 11i v2, but on that one we get tons and tons
  1865. of picky compiler warnings (variables set but not used, defined but not
  1866. referenced, etc). A couple, however, turned out to be valid; one case of
  1867. "expression has no effect", and two of "string format incompatible with
  1868. data type" (I missed a couple file-size printfs).
  1869. There were also numerous warnings about signedness mismatch or sign
  1870. conversion of constants like IAC (0xff). Does the HP-UX Optimizing Compiler
  1871. have a compiler flag to make all chars unsigned? Yes, +uc, but the man page
  1872. says "Be careful when using this option. Your application may have problems
  1873. interfacing with HP-UX system libraries and other libraries that do not use
  1874. this option". Sigh, better not use it.
  1875. After reviewing "HP-UX Large Files White Paper Version 1.4" and HP's
  1876. "Writing Portable Code" documents, I added -D_LARGEFILE_SOURCE
  1877. -D_FILE_OFFSET_BITS=64 to the hpux1000 target, which is the basis for all
  1878. HP-UX 10.00 and later builds. Large files are available in HP-UX 10.20 and
  1879. later. 10.00 and 10.10 were not real releases, and anyway these flags
  1880. should be harmless there unless the large-file implementation was only
  1881. partly done. Built OK on both PA-RISC and IA64, optimized and plain.
  1882. makefile, 4 Jan 2006.
  1883. Built on FreeBSD 6.0 on IA64. All OK except I got a warning about the
  1884. argument passed to time() in logwtmp() in ckufio.c. This section had
  1885. already been partially fixed; thus I put the improved version into
  1886. #ifdef CK_64BIT, which is our newly available symbol that should be
  1887. automatically defined for any true 64-bit build. ckufio.c, 4 Jan 2006.
  1888. Finally got around to testing Jeff's changes to SSL/TLS RAW mode from
  1889. December 30th against our POP server. It didn't work, couldn't log in.
  1890. Tried backing off the ckctel.c changes first; that allowed login and
  1891. communication, but it did not suppress activation of Telnet protocol
  1892. whenever a 0xff byte arrived. Backed off the rest of the changes and now
  1893. all is OK again. ckctel.c, ckcnet.c, ckuus7.c, 9 Jan 2006.
  1894. Built on NetBSD 1.4.1 (1999), found that it did not like the large file
  1895. assumption -- fseeko() and ftello() do not exist; added a clause to the
  1896. netbsd target to check for fseeko and not define _LARGEFILE_SOURCE if not
  1897. found. Oddly enough, off_t is 64 bits anyway, but it doesn't look like the
  1898. APIs are half-done. For example, stat() uses off_t (64 bits) for the file
  1899. length, but fseek() uses long (32 bits) and there is no 64-bit analog.
  1900. Anyway the new netbsd target works on both 1.4.1 and 1.5.2 (no large files)
  1901. and on 2.0.3 (large files). makefile, 9 Jan 2006.
  1902. Built on QNX-32 4.25, which has no large file support. Got a few strange
  1903. compiler (WatCom) warnings, but it built and runs OK. Noticed that file
  1904. transfers into QNX over a Telnet connection can't use streaming, but that's
  1905. nothing new to this version; same thing happens with C-Kermit 7.0. 9 Jan 2006.
  1906. Built on IRIX 6.5. I didn't bother with large files there because it does
  1907. not support the _LARGEFILE_SOURCE interface; you have to change all the APIs
  1908. at the source level from blah() to blah64(). Seems to work fine as a 32-bit
  1909. app even though its off_t is 64 bits. Tried a pure 64-bit IRIX 6.5 build
  1910. but it dies in ckcnet.c when it hits SOCKOPT_T and GSOCKNAME_T with "The
  1911. identifier 'socklen_t' is undefined".
  1912. Looks like I no longer have access to SCO OSR5.
  1913. Made a pure 32-bit build on SCO UnixWare 7.1.4, all OK. Found that this
  1914. version also supports LFS, added it to the uw7 target. makefile, 9 Jan 2006.
  1915. --- Dev.11 ---
  1916. Evidently the HP-UX bundled (non-ANSI non-optimizing) compiler doesn't like
  1917. long integers in switch expressions. Changed three examples of these in the
  1918. S-expression code. ckuus3.c, 10 Jan 2006.
  1919. A section of tstats() where GFTIMER isn't defined (e.g. on Motorola
  1920. sv68r3v6) was garbled. Fixed in ckcfn2.c, 10 Jan 2006.
  1921. A fix for setting 921600 bps on Linux from Paul Fulghum, Microgate Systems Ltd.
  1922. ttgspd(): ckutio.c, 11 Jan 2006.
  1923. Noticed that when I changed the compact substring notation code back on
  1924. August 9th, I broke the ability to use arithmetic expressions within the
  1925. brackets, which explains some rather odd behavior I saw with some of my
  1926. scripts. Looking more deeply into this, I also see that all the parsers I
  1927. have been using up to now for this, as well as for array bounds pairs, have
  1928. been inadequate because they never allowed for nested constructions, such as
  1929. a member of a bounds pair that itself was an array element, possibly with
  1930. another array element as a subscript. I wrote a new routine for this,
  1931. called boundspair(), which is like arraybounds() except it accepts an extra
  1932. argument, an array of characters that can serve as bounds-pair delimiters,
  1933. and it returns the pair separator that was encountered in another new
  1934. argument. For the alternative substring notation for [startpos-endpos] I
  1935. had to change the delimiter from '-' to '_' because '-' can be used in
  1936. arithmetic but '_' is not a recognized operator. This is so I can parse,
  1937. e.g. [a:b] or [a_b] in the same context, and then find out which form was
  1938. used, e.g. \s(line[9:12]) or \s(line[9_12]); the first string is 4 bytes
  1939. long, the second is 12. Everything seems to be OK now. \s(line[10]) gives
  1940. everything starting at 10, but \s(line[10:0]) gives the null string. Bad
  1941. syntax in the bounds pairs results in a null string; missing pieces of the
  1942. bounds pair result in defaults that should be compatible with previous
  1943. behavior. ckuus[45].c, ckuusr.h, 13 Jan 2005.
  1944. Changed arraybounds() to call boundspair(). This was a rather drastic
  1945. change, not strictly necessary, but I think I got all the kinks out.
  1946. ckuus5.c, 13 Jan 2005.
  1947. Changes from PeterE to the makefile for HP-UX 6 and 7, to accommodate bigger
  1948. symbol tables, etc. 19 Jan 2005.
  1949. Determined that SCO OSR5.0.6 (and earlier) do(es) not support large files.
  1950. Don't know about 5.0.7. 30 Jan 2005.
  1951. Created a new build target for SCO OSR6.0.0. Gets the exact 6.x.x version
  1952. dynamically. Supports large files and big-number arithmetic via CK_OFF_T.
  1953. The sockopt() family of functions changed the data types of some of their
  1954. arguments since OSR5. It was already possible to define SOCKOPT_T and
  1955. GSOCKNAME_T from the command line but I had to add code to also allow this
  1956. for GPEERNAME_T too. ckcnet.c, makefile, 30 Jan 2005.
  1957. Apparently, ever since C-Kermit 7.0 was released, it has never been possible
  1958. to use a variable for the as-name in a RECEIVE command in Kermit 95. This
  1959. is because evaluation of the as-name field was deferred until after we could
  1960. check whether it might be a directory name (which, in Windows, could start
  1961. with a backslash). This little bit of magic was not a good idea, magic
  1962. hardly ever is. I changed the code to evaluate both as-name fields in the
  1963. normal way. If they want to receive to a directory called "\%1", they'll
  1964. just have to spell it differently. The workaround is to turn the whole
  1965. command into a macro and evaluate it before executing it, e.g.:
  1966. assign xx receive /as-name:\%1
  1967. do xx
  1968. ckuus6.c, 1 Feb 2006.
  1969. Built OK on FreeBSD 6.1 on AMD64. Adjusted some copyrights and date stamps.
  1970. ckcmai.c, makefile, 8 Feb 2006.
  1971. --- Dev.12 ---
  1972. Fixed a signed/unsigned char warning in the new boundspair() calling code
  1973. in the compact substring notation handler. ckuus4.c, 9 Feb 2006.
  1974. Removed a spurious extra linux+openssl label from the makefile, added
  1975. solaris10g_64 synonym. 9 Feb 2006.
  1976. Satisfied myself that LFS is OK on Solaris 10 i386, and I'm going to assume
  1977. it's also OK on Solaris 9. Made LFS standard for all Solaris 9 and 10
  1978. builds (including the secure ones) except the explicitly 64-bit ones, and
  1979. made the provisional solarisXXlfs targets into synonyms. makefile, 9 Feb 2006.
  1980. --- Dev.13 ---
  1981. Further attempts at SSL/TLS message suppression when QUIET is ON.
  1982. ck_ssl.c, 16 Feb 2006.
  1983. From J.Scott Kasten: (quote...) I just uploaded a patch to /kermit/incoming.
  1984. The file name is "jsk-patch-for-cku211.diff". I have also included the
  1985. patch as ASCII text in this email below. This patch may be applied to the
  1986. cku211.tar.gz source code via:
  1987. cd cku211, patch -p1 <../jsk-patch-for-cku211.diff
  1988. The patch adds 4 new build targets:
  1989. netbsdwoc - a stripped no curses target for iksd used.
  1990. netbsdse - security enhanced target with srp, ssl, and zlib.
  1991. irix65gcc - build on SGI Irix 6.5 platform using gcc.
  1992. irix65se - security enhanced target with srp, ssl, and zlib.
  1993. The patch fixes one build target:
  1994. irix64gcc - The "-s" option is not supported by gcc under Irix.
  1995. I thank all of you in the Kermit Project for such a fine utility. I
  1996. recently had to get a 16 MB file overseas across a spotty communications
  1997. link to repair a computer remotely. Kermit was the only thing that could do
  1998. the job, so I wanted to contribute these patches back to the mainstream to
  1999. say thanks. This digitally signed email is a binding contract that
  2000. officially assigns the rights to the source code patch (shown below) that I
  2001. developed to the Kermit Project at Columbia University. (...end quote)
  2002. ck_ssl.c, makefile, 23 Feb 2006.
  2003. Changed the new NetBSD target names to be consistent with the conventions
  2004. used in most other targets:
  2005. netbsdwoc -> netbsdnc
  2006. netbsdse -> netbsd+ssl+srp+zlib
  2007. irix65se -> irix65+ssl+srp+zlib
  2008. and removed old, now superfluous, NetBSD targets (old-netbsd, netbst15,
  2009. netbst16), leaving synonym labels in their place. Also updated (crudely)
  2010. the Linux target variations (curses instead of nocurses, no curses at all)
  2011. to be (appropriately modified) copies of the current linux target. It would
  2012. be nicer to combine them, but this gets the job done. makefile, 23 Feb 2006.
  2013. --- Dev.14 ---
  2014. Fixed the HELP command when used with tokens like @, ^, #, and ;. The first
  2015. two had been omitted from the table. The second two required a new path
  2016. into the guts of the parser, since comments are normally stripped at a very
  2017. low level. ckuus[r2].c, ckucmd.c, 24 Feb 2006.
  2018. Built on AIX 5.1 ("make aix51") without incident. Then I tried:
  2019. make aix51 "KFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
  2020. This had no effect. I found the relevant document ath the IBM website. It
  2021. says to use -D_LARGE_FILES instead. I added this to the AIX 4.2 target
  2022. since (a) IBM says large files are supported by AIX 4.2 and later, and (b)
  2023. all Kermit AIX targets past 4.2 use the 4.2 one. Plus a clause to make
  2024. sure CK_OFF_T is defined appropriately. ckcdeb.h, makefile, 6 Mar 2006.
  2025. Added a 32-bit aix51+openssl target. Builds OK, works fine (tested against
  2026. our SSL POP server). Tried I tried adding -D_LARGE_FILES. It seems to work
  2027. fine, so we'll keep it. Cleaned up the other aix5blah entries a bit also.
  2028. makefile, 6 Mar 2006.
  2029. Fixes from J. Scott Kasten to the IRIX 6.4 and 6.5 makefile targets. They
  2030. were badly wrong. makefile, 6 Mar 2006.
  2031. The reason Kermit was looping on directories in IRIX was a classic
  2032. "double-ended break". The makefile targets failed to define DIRENT so
  2033. Kermit was open/read on directories rather than opendir()/readdir(). But
  2034. then it was also failing to account for the fact that read() would return -1
  2035. on error. The makefile fix adds -DDIRENT, and the read() case in traverse()
  2036. now properly terminates its loop on error. ckufio.c, 6 Mar 2006.
  2037. --- Dev.14 ---
  2038. In response to a complaint that C-Kermit would not build on HP-UX 11 with
  2039. OpenSSL, I tried it myself on both 11.11/PA-RISC and 11i v2/Itanium. It built
  2040. OK on both but I had to add a new target (hpux1000o+openssl-nozlib) for no
  2041. Zlib since these boxes did not have it installed. makefile, 9 Mar 2006.
  2042. Added OpenSSL version number display to SHOW FEATURES. ckuus5.c, 9 Mar 2006.
  2043. Gavin Graham noticed that FTP [M]GET /DELETE /MOVE-TO: was rejected with
  2044. "?Sorry, /DELETE conflicts with /MOVE or /RENAME". This check belongs in the
  2045. PUT code but not in the GET code. Commented it out and tested the result.
  2046. The combination is now accepted but then Kermit refuses the incoming file as
  2047. if it had been given a /SMALLER-THAN: or /LARGER-THAN: switch, which it didn't
  2048. happen. Turns out there was one more place where I wasn't initializing the
  2049. new "wide int" member of the switch-parsing pv[] struct. Once this was fixed,
  2050. the /MOVE-TO part still didn't work. Turned out the /DELETE case was part of
  2051. a long if-else-if-else- chain, which effectively made /DELETE and /MOVE-TO: or
  2052. /RENAME-TO: mutually exclusive. Fixed this, now it works fine. ckcftp.c,
  2053. 13 Mar 2006.
  2054. Got access to AIX 5.3, built there, all OK, including large files. 13 Mar 2006.
  2055. --- Dev.16 ---
  2056. Patches from Mark Sapiro to suppress getsockopt() and getsockname() warnings
  2057. in Mac OS X. ckcnet.[ch], 18 Mar 2006.
  2058. In response to a complaint from Clarence Dold, tried "make redhat9" (which
  2059. is the rather dated target that tried to include all forms of security) on
  2060. RH Linux AS4.3, it failed miserably. I made a new makefile target, removing
  2061. Kerberos IV and got a lot farther. But then in ckcftp.c, the following
  2062. struct definition:
  2063. struct {
  2064. CONST gss_OID_desc * CONST * mech_type;
  2065. char *service_name;
  2066. } gss_trials[] = {
  2067. { &ck_gss_mech_krb5, "ftp" },
  2068. { &ck_gss_mech_krb5, "host" },
  2069. };
  2070. refers to a variable, ck_gss_mech_krb5, that is not defined anywhere. Up
  2071. above, however, is a static definition for gss_mech_krb5, so I changed the
  2072. struct definition to match. Next, in ckuath.c, the compiler could not find
  2073. the com_err.h file. Turns out in Linux this is in a subdirectory, et, so we
  2074. have to add a -I clause to the makefile target for this. Made a target for
  2075. Linux+SSL only. Made a target for Linux+Krb5 only; this required moving an
  2076. #ifdef in ckuus7.c to prevent an unguarded reference to SSLEAY_VERSION.
  2077. New targets: linux+krb5+ssl, linux+krb5, linux+krb5. ckcftp.c, ckuus7.c,
  2078. makefile, 27 Mar 2006.
  2079. New targets of HP-UX 10/11 with OpenSSL from PeterE. makefile, 27 Mar 2006.
  2080. Added large file/integer support to SHOW FEATURES. ckuus5.c, 27 Mar 2006.
  2081. Built OK on Solaris 9 and 10 with gcc (someone was complaining that this
  2082. didn't work, but that was 8.0.211).
  2083. Started build on a Sun 3/80 mc68030 with NetBSD 2.0 and gcc 3.3.3. But it
  2084. died with an assembler error in ckcfn2.c (compiler bug). 27 Mar 2006.
  2085. --- Dev.17 ---
  2086. NebBSD 2.0 build completed by turning off optimization on ckcfn2.c
  2087. ("KFLAGS=-O0"). Result supports 64-bit ints and, presumably, large files.
  2088. uname -p = "m68k", -m = "sun3". 29 Mar 2006.
  2089. Corrected an omission in applying PeterE's updates to the HP-UX targets.
  2090. makefile, 28 Mar 2006.
  2091. solaris2xg+krb5+krb4+openssl+shadow:
  2092. Tried resurrecting the solaris2xg+krb5+krb4+openssl+shadow target. It asks
  2093. to link with libdes but there is no libdes. Removed -ldes from the target,
  2094. now at least it builds and runs wart. The compilation blows up in ckcftp.c
  2095. for missing header files:
  2096. ckcftp.c:462: kerberosIV/krb.h: No such file or directory
  2097. ckcftp.c:500: gssapi/gssapi_generic.h: No such file or directory
  2098. ckcftp.c:501: gssapi/gssapi_krb5.h: No such file or directory
  2099. Got a bit farther by adding appropriate -I's and -L's to KFLAGS but it still
  2100. dies compiling (or linking?) ckcftp.c, but it doesn't say exactly why. OK,
  2101. deferred.
  2102. Added SET SEXPRESSION TRUNCATE-ALL-RESULTS { ON, OFF }. This can be used
  2103. for force integer arithmetic in any kind of calculation that requires it,
  2104. such as date calculations. This is a global setting, not on any kind of
  2105. stack. Also, updated SHOW SEXP and added HELP SET SEXP which wasn't there
  2106. before. ckuus[23].c, 30 Mar 2006.
  2107. To make the RENAME command a bit more useful, need to add some switches.
  2108. But it shares a switch table, qvswtab[], with some other commands. Broke
  2109. this off into its own switch table. ckuus6.c, 17 Apr 2006.
  2110. Added RENAME switch values that can be used in the same table with the DELETE
  2111. switch values, which are shared by many commands. ckuusr.h, 17 Apr 2006.
  2112. Discovered that the RENAME command could be entered without any arguments
  2113. and it would still succeed. Fixed in dorenam(): ckuus6.c, 17 Apr 2006.
  2114. Added parsing for RENAME /UPPER:option (to uppercase the file name(s)),
  2115. /LOWER:option (to lowercase), and /REPLACE:{{s1}{s2}} (to do string
  2116. replacement on the filename(s)), but not the semantics. When any of these
  2117. switches is given, the target ("to") name is not parsed; they act on the
  2118. source name. The /LOWER: switch takes keyword args to specify whether it
  2119. should act only only files that have all UPPER case latters, or on ALL files
  2120. (i.e., including files with mixed-case names); similarly for the /UPPER:
  2121. switch. There is some creative parsing allowing these to be given with or
  2122. without a colon and keyword argument, which works fine except if you include
  2123. the colon but no argument, execute the command (which works fine), and then
  2124. recall the command. I haven't yet decided about the interaction among these
  2125. switches. Clearly if /UPPER is given after /LOWER, it overrides. But if
  2126. /UPPER (or /LOWER) is given with /REPLACE, what should happen? ckuus6.c,
  2127. 17 Apr 2006.
  2128. Filled in actions for RENAME /UPPER: and /LOWER: for the single file case,
  2129. and tested all combinations of switch values and filename configurations.
  2130. Once that was OK, moved the code out into a separate routine, renameone(),
  2131. and then called it from both the single-file case and the multifile case.
  2132. ckuus6.c, 19 Apr 2006.
  2133. Added RENAME /SIMULATE. Filled in the code for string replacement, needs
  2134. testing. ckuus6.c, 20 Apr 2006.
  2135. Changed /REPLACE options to allow a negative number to specify an occurrence
  2136. from the right, so -1 means the last occurrence, -2 means the next-to-last,
  2137. etc. ckuus6.c, 24 Apr 2006.
  2138. Added RENAME /COLLISION:{OVERWRITE,PROCEED,FAIL}. This is implemented but
  2139. not tested. ckuus6.c, 24 Apr 2006.
  2140. Worked on RENAME /COLLISION:FAIL. I decided it was less than useful to ...
  2141. Added SET RENAME { COLLISION, LIST } to let user change default collision
  2142. and listing actions. ckuusr.[ch], ckuus[36].c, 25 Apr 2006.
  2143. Experimented with parsing for /CONVERT:cset1:cset2. The problem here is
  2144. that there is no straightforward way for a switch to have multiple
  2145. arguments. Or is there...? If I parse cset1 with cmswi() rather than
  2146. cmkey(), it almost works; the only problem is that the character-set
  2147. keywords don't have CM_ARG set, so they don't know to stop on, and ignore, a
  2148. colon. If I make a copy of the table and set CM_ARG in the flags field for
  2149. each keyword, it works fine: if I Tab in the first name, it fills itself
  2150. out, supplies a colon, and waits for the second name. So in the code, the
  2151. first time that RENAME /CONVERT is invoked, I put code to copy fcstab[] and
  2152. set CM_ARG in each flags field. Works fine, and now we know how to make a
  2153. switch that takes multiple arguments. ckuus6.c, 24 Apr 2006.
  2154. I thought I had a function to convert the character set of a string but I
  2155. don't, so actually implementing /CONVERT: will be difficult.
  2156. Actually the parsing wasn't that easy either. It works OK interactively,
  2157. but not in a TAKE file. To make a long story short, I had to change
  2158. gtword() and cmkey2() to not require "/" at the beginning of a switch, and
  2159. then to parse arguments-that-are-followed-by-other-arguments as if they were
  2160. switches, so that they can end with colon rather than space. This might
  2161. seem dangerous, but switches always have "/" at the beginning, so the check
  2162. is superfluous. ckucmd.c, 26 Apr 2006.
  2163. Back to /CONVERT... Once I was able to get the code to call cvtstring() I
  2164. was able to debug it (at first it was skipping every second character). And
  2165. now we have a general-purpose string-translating function we can call from
  2166. anywhere. Requires that C-Kermit be built with Unicode support.
  2167. ckuus6.c, 26 Apr 2006.
  2168. Added SHOW RENAME. ckuusr.h, ckuus[r5].c, 26 Apr 2006.
  2169. Conditionalized some Unix/Windows assumptions in renameone() so the code
  2170. could work in VMS. ckuus6.c, 2 May 2006.
  2171. Added RENAME /FIXSPACES to change all spaces in the filename(s) to
  2172. underscore or any other character or string that is given. This is just a
  2173. special case of RENAME /REPLACE:{{ }{x}} with easier syntax.
  2174. ckuusr.h, ckuus6.c, 2 May 2006.
  2175. Added an "all-but" control to the /REPLACE options:
  2176. /REPLACE:{{.}{_}{~1}} means replace all but the first (this one works);
  2177. /REPLACE:{{.}{_}{~-1}} means replace all but the last (this one not yet).
  2178. ckuus6.c, 2 May 2006.
  2179. Filled in the second one ("all but" the given occurrence). The algorithm is
  2180. simply to reverse the three strings and then use the same code as we use in
  2181. the left-right-case, and then unreverse the result. At first I used
  2182. yystring() for this but yikes, what a bad design! So I made a better
  2183. string-reversal routine, gnirts(), for this (luckily yystring() is only used
  2184. in one place, for which its design is appropriate). ckuus6.c, 3-4 May 2006.
  2185. Added code to handle the case where the file being renamed includes a path
  2186. specification. In this case we separate the path, apply the renaming
  2187. functions to the filename only, and then at the end rejoin the original
  2188. filename with the path, and join the new name with same path or, if a
  2189. destination directory was given, with that. ckuus6.c, 4 May 2006.
  2190. Added HELP SET RENAME and updated HELP RENAME. ckuus2.c, 4 May 2006.
  2191. "Tom Violin" (Tom Hansen) noticed that the first time you FOPEN a file,
  2192. Kermit's memory consumption goes way up. In fact there's a warning to that
  2193. effect in the code, where, upon first open, a potentially big array of
  2194. potentially big structs is allocated. I rewrote the code to allocate each
  2195. array member (struct ckz_file) as needed, i.e. when a file is opened, and to
  2196. free it when the file is closed (or the open fails). This was actually
  2197. quite a lot of work, which is why I didn't do it the first time around:
  2198. every single "." had to be changed to "->". Every check for a valid
  2199. channel first had to check if the channel's struct was allocated and every
  2200. other reference to z_file[i]->anything had to be prechecked that z_file[i]
  2201. was not a NULL pointer. Also I made some improvements to FILE STATUS, and I
  2202. fixed FILE CLOSE to default the channel number if only one channel was open,
  2203. as I did for FILE STATUS a while back. ckuus7.c, Cinco de mayo 2006.
  2204. Ran my old BUILDS script that builds C-Kermit with about 100 different
  2205. combinations of feature-selection switches. Fixed a few small glitches so
  2206. now they all build OK (except can't do NOANSI builds any more on recent
  2207. Linuxes because of varargs()). ckuus3.c, ckuus5.c, ckuus6.c, ckuus7.c,
  2208. ckucmd.c, ckcfns.c, 6 May 2006.
  2209. Fixed RENAME /LOWER and /UPPER, when given with no colon or argument, to
  2210. default to ALL. ckuus6.c, 13 May 2006.
  2211. Built on VMS 7.2-1, tested new RENAME command there; seems to be OK.
  2212. 13 May 2006.
  2213. --- Dev.18 ---
  2214. I wanted to test large files against RESEND but I don't have access to any
  2215. system that can run C-Kermit and that also has enough space for a large
  2216. file. I created a "fake" large file on Linux (3G hole plus 1 byte), and
  2217. sent it over a localhost connection, and interrupted it repeatedly and then
  2218. initiated a RESEND at the sender. In each case, it picked up where it left
  2219. off. But before the 2G boundary was crossed the disk filled up.
  2220. Inconclusive. 14 May 2006.
  2221. PeterE got a warning in the new FILE OPEN code when building in HP-UX 9.
  2222. I added a cast, built on HP-UX 11, no more complaint. However there
  2223. are warnings about internal vs external bindings of sendpath and sendfile
  2224. in every module. Too bad, these are not Kermit tokens, it's a conflict in
  2225. HP's header files. Marc Sapiro doesn't see them; probably it's something
  2226. on the HP testdrive site. ckuus7.c, 17 May 2006.
  2227. Fixed the tru64-51b+openssl target -- the terminating doublequote of KFLAGS
  2228. was missing -- and also the osf target, which failed to import the LIBS
  2229. definition from whatever other target invoked it. Now the SSL build goes OK
  2230. on Tru64 5.1B. Replaced x.tar.z in the download areas without declaring a
  2231. new Dev number. The new one has a makefile with today's date. Software
  2232. engineering at its best! makefile, 18 May 2006.
  2233. Scott Kasten noted that the estimated-time-remaining calculation would go
  2234. bonkers on LFS systems when RESENDing a large file. It looks like the
  2235. shocps() and shoetl() functions escaped the CK_OFF_T conversion. I made
  2236. what seemed to be the right adjustments, and then was lucky enough to find a
  2237. computer that had enough free disk space for me to send a large file,
  2238. interrupt it several times, resend it, all seems to be OK. 28 May 2006.
  2239. Later Scott verified these changes independently for Linux, but the problems
  2240. in IRIX remain.
  2241. Patches from Scott Kasten for large files on IRIX 6.5: ckcdeb.h, makefile,
  2242. 12 Jun 2006.
  2243. --- Dev.19 ---
  2244. Added a new function for dealing with JPGs and GIFs:
  2245. \fpicture(filename,&a)
  2246. returns 0 if file not recognized or can't be opened;
  2247. returns 1 if landscape, 2 if portrait or square.
  2248. If array given, element 1 is width, element 2 is height.
  2249. ckuusr.h, ckuus4.c, 19 Jun 2006.
  2250. Scott Kasten reports that the FTP client can transfer large files OK, at
  2251. least in Linux, but has trouble with recovery:
  2252. . Kermit takes a very long time to start the transfer, sometimes over
  2253. 30 minutes. Suspect the ftp server is counting the bytes in a long file?
  2254. Or maybe it's a text-mode transfer and it's counting the lines? Probably
  2255. in response to Kermit's SIZE command.
  2256. . The size shown in the FT display is wrong by a random amount. And of
  2257. course so are the progress bar, percent done, and time remaining.
  2258. . The file, however, is transferred correctly. REGET works correctly too.
  2259. I tried setting up a test scenario locally but our Solaris FTP server does
  2260. not support large files:
  2261. FTP SENT [SIZE BIGFILE]
  2262. FTP RCVD [550 BIGFILE: not a plain file.]
  2263. FTP SENT [PASV]
  2264. FTP RCVD [227 Entering Passive Mode (128,59,48,24,246,37)]
  2265. FTP SENT [RETR BIGFILE]
  2266. FTP RCVD [550 BIGFILE: Value too large for defined data type.]
  2267. Created the same 3GB on a Tru64 Unix system that allows FTP access. Made
  2268. the connection from C-Kermit on Solaris (32-bit with LFS):
  2269. 16:46:12.908 FTP SENT [SIZE BIGFILE]
  2270. 16:46:12.947 FTP RCVD [213 3000000001]
  2271. Note that it takes less than half a second to get the reply. Now I start
  2272. the download and then interrupt it at about 2%:
  2273. 16:46:12.979 FTP SENT [TYPE I]
  2274. 16:46:13.174 FTP RCVD [200 Type set to I.]
  2275. 16:46:13.226 FTP SENT [PASV]
  2276. 16:46:13.262 FTP RCVD [227 Entering Passive Mode (15,170,178,171,11,37)]
  2277. 16:46:13.299 FTP SENT [RETR BIGFILE]
  2278. 16:46:13.337 FTP RCVD [150 Opening BINARY mode data connection for BIGFILE..]
  2279. 16:47:24.895 FTP RCVD [426 Transfer aborted. Data connection closed.]
  2280. 16:47:24.934 FTP RCVD [226 Abort successful]
  2281. 16:47:24.991 FTP SENT [MDTM BIGFILE]
  2282. 16:47:25.028 FTP RCVD [213 20060706204458]
  2283. Now I do a REGET:
  2284. 16:51:55.321 FTP SENT [PASV]
  2285. 16:51:55.357 FTP RCVD [227 Entering Passive Mode (15,170,178,171,11,43)]
  2286. 16:51:55.394 FTP SENT [REST 122736640]
  2287. 16:51:55.430 FTP RCVD [350 Restarting at 122736640. Send STORE or RETRIEVE..]
  2288. 16:51:55.431 FTP SENT [RETR BIGFILE]
  2289. 16:51:55.469 FTP RCVD [150 Opening BINARY mode data connection for BIGFILE..]
  2290. This worked perfectly, as far as I can tell; the FT display picked up in the
  2291. right place; the thermometer, percent done, and estimated time remaining
  2292. were the same as when we left off last time. I did the same thing several
  2293. more times, everything was OK. It would have taken a really long time to
  2294. let this run to completion, but I think this demonstrates that Scott's
  2295. symptoms are server-dependent. No changes. 6 July 2006.
  2296. Checked current code on VMS 8.2-1 on IA64 / UCX 5.5, builds fine.
  2297. No changes. Updated listing at HP. 6 July 2006.
  2298. Checked FTP GET of large file in ASCII mode against Tru64 FTP server. It
  2299. was fine, and there was no delay in the server's response to our SIZE command
  2300. (as there would be if it were scanning the entire file to count how many
  2301. bytes would be required to send it in text mode). 7 Jul 2006.
  2302. Tested FTP PUT big file against Tru64, OK. Ditto FTP RESEND big file:
  2303. C-Kermit>resend BIGFILE
  2304. PUT BIGFILE (binary) (3000000001 bytes)---> PASV
  2305. 227 Entering Passive Mode (15,170,178,171,13,186)
  2306. ---> SIZE BIGFILE
  2307. 213 343211280
  2308. ---> MDTM BIGFILE
  2309. 213 20060707141243
  2310. ---> APPE BIGFILE
  2311. 150 Opening BINARY mode data connection for BIGFILE (128.59.59.56,45470).
  2312. Made REPUT a synonym for RESEND. ckuusr.c, 7 Jul 2006.
  2313. Added FTP REPUT and FTP RESEND since previously there was no FTP-prefixed
  2314. command for recovering uploads, only the regular RESEND command, which might
  2315. not have been obvious to people. ckcftp.c, 7 Jul 2006.
  2316. Added help text for FTP RESEND and REPUT and amended RESEND help text.
  2317. ckcftp.c, ckuus2.c, 7 Jul 2006.
  2318. Changed name of \fpicture() to \fpictureinfo() and added help text. By the
  2319. way, ImageMagick can do this too: identify -format "%w %h" dscf0520.jpg.
  2320. The advantage of having it in Kermit is that not everybody has ImageMagick.
  2321. ckuus[24].c, 7 Jul 2006.
  2322. Changed the numeric comparisons = < > <= >= != to allow long integers by
  2323. changing the data type to CK_OFF_T, etc. ckuus6.c, 7 Jul 2006.
  2324. Noticed that \fkeywordvalue(foo=this is a string) only kept the first word.
  2325. Fixed it to keep the whole definition. Also added \fkwvalue() as a briefer
  2326. synonym. ckuus4.c, 7 Jul 2006
  2327. Sometimes we want to check if a file's status before we've FOPEN'd it, in
  2328. which case the channel variable is likely to be empty and \f_status(\%c)
  2329. would get an error. Making the obvious change didn't fix this, however. It
  2330. turns out that the function evaluator failed to adjust argn (argument count)
  2331. when trailing arguments were empty, and argn was being used in this case,
  2332. and probably others, to test whether an argument existed. I added code to
  2333. adjust argn to reflect the number of arguments up to and including the
  2334. rightmost non-empty one. ckuus4.c, 7 Jul 2006.
  2335. Fixed \fstripb() to not dump core if second argument is missing.
  2336. ckuus4.c, 7 Jul 2006.
  2337. Discovered that it was not obvious what pattern to use to match strings
  2338. enclosed in square brackets. "if match [abc] \[*\]" didn't work. Neither
  2339. did various other tricks like NCRs for the brackets. However, "if match
  2340. [abc] \\[*\\]" does work. Trying to fix this would no doubt break 100 other
  2341. things, so let's call it a feature. 7 Jul 2006.
  2342. Added \fgetpidinfo(n) to return info about a process ID; for now it simply
  2343. returns 1 if the process is alive and 0 if not (or -1 if the argument is
  2344. bad or missing or on any kind of error). ckuusr.h, ckuus[24].c, 7 Jul 2006.
  2345. The "where-did-my-file-go" message seemed to be ending with a LF rather
  2346. than CRLF, probably because the terminal modes had not yet been restored,
  2347. leaving the next prompt hanging below it, rather than on the left margin,
  2348. if C-Kermit exited immediately after the transfer. Fixed by changing
  2349. all \n's to \r\n's in wheremsg(): ckcpro.w, 8 Jul 2006.
  2350. Added \v(lastkwval) so we can retrieve programmatically the keyword most
  2351. recently processed by \fkeywordval(). ckuusr.h, ckuus4.c, 9 Jul 2006.
  2352. --- Dev.20 ---
  2353. Added #ifdef SV68, #include <unistd.h>, #endif because Unix System V/68 on
  2354. Motorola choked on the SEEK_CUR reference without it. ckuus4.c, 10 Jul 2006.
  2355. Make \fkeywordval(xxx) undefine xxx (i.e. when a keyword is given with no
  2356. value). This way command-line keywords will always override preexisting
  2357. default definitions, whether they have a value or not, which makes it easier
  2358. to parse command lines like "foo=bar blah xx=yy". ckuus[24].c, 12 Jul 2006.
  2359. On 29 Nov 2005 I changed IF KERBANG to solve a problem (see entry for that
  2360. date), but introduced a new one; namely that you can't have (e.g.) a FATAL
  2361. macro that uses IF KERBANG to decide whether to EXIT all the way or STOP
  2362. back to the prompt. Changed it again, this time to require not that the
  2363. command level be 1, but that the command *file* level be 0 (i.e. that we are
  2364. in the top-level command file, irrespective of the command or macro level,
  2365. but not in a subfile). ckuus6.c, 12 Jul 2006.
  2366. It is unhelpful when Kermit gets a syntax error in the middle of a big
  2367. compound statement block (e.g. FOR or WHILE loop) and dumps out the whole
  2368. thing in an error message. I changed the two places where this can happen
  2369. to call a new routine that, instead of dumping out the entire cmdbuf,
  2370. checks its length first and if it's more than a line long, truncates it
  2371. and adds an ellipsis. ckuus6.c, 12 Jul 2006.
  2372. The new RENAME command didn't give very good error messages, e.g. if the
  2373. filespec didn't match any files. Fixed in dorenam(): ckuus6.c, 12 Jul 2006.
  2374. Fixed DIR /TOP to work if the /TOP:n argument was omitted, defaulting
  2375. to 10. domydir(): ckuus6.c, 12 Jul 2006.
  2376. Added DIR /COUNT:v to count the number of files that match the given
  2377. criteria and store result in the variable v. ckuusr.h, ckuus[r26].c,
  2378. 24 Aug 2006.
  2379. Added HDIRECTORY as an invisible synonym for DIR /SORT:SIZE /REVERSE.
  2380. Can be used with other switches, of course, so (e.g.) HD /TOP shows the
  2381. ten biggest files. ckuusr.h, ckuus[r26].c, 24 Aug 2006.
  2382. DIR /FOLLOWLINKS and /NOFOLLOWLINKS always did the same thing; the switch
  2383. was ignored, a symlink is always followed. Fixed in ckuus6.c, 24 Aug 2006.
  2384. Added DIR /NOLINKS, which means don't show or count symlinks at all.
  2385. ckuusr.h, ckuus[r26].c, 24 Aug 2006.
  2386. Build on Solaris 9 and NetBSD 3.0, 24 Aug 2006.
  2387. Added a missing definition for LOCK_DIR in the Linux HAVE_BAUDBOY case,
  2388. suggested by Gerry Belanger. ckutio.c, 6 Oct 2006.
  2389. Suggested by Jim Crapuchettes: \v(dialmessage) is the text string
  2390. corresponding to \v(dialstatus). ckuusr.h, ckuus4.c, 6 Oct 2006.
  2391. Soewono Effendi sent code for exit sequence to leave DTR on; this amounted
  2392. to unsetting HPUCL in c_cflag. I did it a simpler way, hopefully portable
  2393. to all Unixes, but who knows at this late date. The code is inside
  2394. #ifndef CK_NOHUPCL..#endif in case it causes trouble. It is executed if
  2395. SET EXIT HANGUP is OFF and a serial port was open at the time Kermit exits
  2396. (or closes it explicitly). ttclos(): ckutio.c, 6 Oct 2006.
  2397. Built on Solaris9/Sparc; FreeBSD 6.2/AMD64; NetBSD 3.0/i386; HP-UX 11i v2;
  2398. SCO OSR6.00.
  2399. --- Dev.21 ---
  2400. Added netbsd+openssl target to makefile. Built OK (NetBSD 3.0, OpenSSL
  2401. 0.9.7d) except with some warnings in ck_crp.c. Connects and logs in OK to a
  2402. secure site. 10 Oct 2006.
  2403. Added a debug statement to ftp_hookup() to record the TCP port that was used.
  2404. ckcftp.c, 11 Oct 2006.
  2405. Built with OpenSSL 0.9.7l on Solaris 9. Built with OpenSSL 0.9.8d on
  2406. Solaris 9; connects and logs in to a secure site. 11 Oct 2006.
  2407. The new RENAME command didn't work if both the source and destination names
  2408. included directory segments, e.g. "rename /tmp/foo ~/bar" (see notes of
  2409. 4 May 2006). This was fixed in renameone() by a special case in which
  2410. the second argument is given but it is a filename, not a directory name.
  2411. ckuus6.c, 11 Oct 2006.
  2412. Fixed unguarded reference to dialmsg[] for \fdialmessage(), noticed by
  2413. Gerry Belanger. ckuus4.c, 12 Oct 2006.
  2414. Added a TOUCH command that does what UNIX touch does: creates the file if it
  2415. does not exist, updates the timestamp if it does. If a wildcard is given,
  2416. it operates only on existing files. It shares the DIRECTORY command parser,
  2417. so all the same file selection switches can be given. ckuusr.[ch],
  2418. ckuus[26].c, 12 Oct 2006.
  2419. PeterE noticed that if you FOPEN a file, do some seeks or reads, then FCLOSE
  2420. it, then FOPEN it again (or open a different one), some of the old
  2421. information is still there (e.g. current line number). This is an artifact
  2422. of the changes of May 4th. Now the file closing and opening routines are a
  2423. bit more careful about scrubbing and initializing the file info struct.
  2424. ckuus7.c, 12 Oct 2006.
  2425. --- Dev.22 ---
  2426. Built OK on Red Hat Linux AS4 with both "make linux" and "make linuxnc".
  2427. 15 Oct 2006.
  2428. DIRECTORY /BRIEF ignored file selection switches and always listed all
  2429. files. This was because of how I cleverly called filhelp() (the routine
  2430. that lists matching files when ? is typed in a filename field) and, of
  2431. course, filhelp() doesn't know anything about the DIRECTORY command's file
  2432. selections. Changed filhelp() to accept all the args needed for passing
  2433. along to fileselect(), renamed it to xfilhelp(), and made a filhelp() stub
  2434. that chains to xfilhelp() with null selections. ckcker.h, ckucmd.[ch],
  2435. ckuus6.c, 29 Nov 2006.
  2436. SHOW CONNECTION for an SSH connection said the connection type was "NET"
  2437. rather than "SSH". Fixed in dolognet(): ckuus3.c, 29 Nov 2006.
  2438. SHOW CONNECTION didn't show the TCP port number. This command works by
  2439. parsing the current connection log entry string, which doesn't have a field
  2440. for this, but which sometimes shows the port number as part of the hostname
  2441. (but more often not). Added code to dolognet() to log the TCP port number,
  2442. if known. This involved adding a gettcpport() function to ckcnet.c.
  2443. ckcnet.[ch], ckuus3.c, 29 Nov 2006.
  2444. This was impossible: def \%1 upper, echo \f\%1(abc) -- i.e. to "compose" a
  2445. function name. Fixed in zzstring(). But note that it's still not possible
  2446. to do this: def \%1 \fupper, echo \%1(abc) -- because at the point where
  2447. "\fupper" is encountered, which is automatically fed to fneval(), the
  2448. argument list hasn't been read yet. ckuus4.c, 29 Nov 2006.
  2449. The meaningless Lisp command (=) would cause Kermit to hang. Due to some
  2450. idiosyncracy in the parser, it would see this as ((=) and would go into
  2451. "wait for the closing paren" mode. There was already a hack in the code to
  2452. compensate for this, but it didn't work. I fixed the hack but I don't
  2453. understand the real problem. Anyway, comparing Kermit with real (Franz)
  2454. Lisp I discovered that comparison operators do not require two arguments, as
  2455. Kermit has been doing, although they do require at least one. I changed
  2456. Kermit to not require two, so now all the comparison predicates behave
  2457. exactly like Franz Lisp, including getting an error if there are no args).
  2458. ckuus[r3].c, 29 Nov 2006.
  2459. From to-do list: Make a way to inhibit pattern matching in SWITCH labels.
  2460. It's already there; just quote the wildcard characters; the only trick is
  2461. that for some reason (such as that SWITCH is really an internally defined
  2462. macro), a double quote is needed:
  2463. switch \%1 {
  2464. :a\\*z, echo literally "a*z", break
  2465. :abcxyz, echo literally "abcxyz", break
  2466. :a*z, echo a...z, break
  2467. :default, echo NO MATCH
  2468. }
  2469. In first case, the asterisk is taken literally; in the third it's a
  2470. metacharacter and the label matches any string that starts with 'a' and
  2471. ends with 'z'.
  2472. Array initialization would quit early if any initializers were undefined,
  2473. e.g. "decl \&a[] = \%a \%b \%c" would stop at the first element if \%b
  2474. was not defined, even though \%c might be defined. Fixed in dodcl():
  2475. ckuusr.c, 30 Nov 2006.
  2476. DIR /ARRAY:a filespec, when the filespec does not match any files,
  2477. terminates with the array undeclared. It would be better to return a
  2478. declared but empty array (\&a[0] = 0). The code is already there to do
  2479. that, but isn't working. And yet "declare \&a[0]" does indeed create a
  2480. 0-element array ("show array" shows a dimension of 0). Turns out there were
  2481. two problems; one was the careless recycling of a local variable ("array"),
  2482. resulting in failure to create \&a[] (but not any other array). Fixed in
  2483. domydir(): ckuus6.c, 30 Nov 2006.
  2484. The other problem was that dclarray(), when called with an array name and a
  2485. dimension of zero, does two different things depending on whether the array
  2486. already existed. There is still a fair amount of confusion about whether a
  2487. dimension of 0 indicates an array with 1 element (as it should) or a
  2488. nonexistent array. We call dclarray() with a size of 0 to undeclare an
  2489. array but we also need to able able to declare an array with only element 0.
  2490. I changed dclarray() to treat a negative dimension as a command to destroy
  2491. the array, and 0 or positive as a command to create the array with the given
  2492. dimension. ckuus[r56].c, 30 Nov 2006.
  2493. Next problem: when chkarray() returns 0, this should not be interpreted to
  2494. mean the array does not exist. Looks like the only place this happened was
  2495. in \fcontents(); fixed in ckuus4.c, 30 Nov 2006.
  2496. If we include file selectors with DIR /ARRAY:&a and some of the files that
  2497. match the given filespec but don't fit the selectors, the array's dimension
  2498. is bigger than its number of elements. Added code at the end of domydir()
  2499. to resize the array so \fdim() returns the number of filenames in the array,
  2500. and also made sure that element 0 contains that number too. ckuus6.c,
  2501. 30 Nov 2006.
  2502. This would be a nice elegant way to loop over a bunch of files, if it worked:
  2503. for \%i 1 \ffiles(*) 1 { rename \fnextfile() xxx_\flpad(\%i,3,0) }
  2504. But in this loop, Kermit skips every other file (beginning with the first)
  2505. and then runs out of files halfway through the loop. Why? Because in
  2506. commands like RENAME and DELETE, the filename parser is in a chained FDB
  2507. with the switch parser. First the switch parser, cmswi(), gets its hands on
  2508. \fnextfile(), passing it through the evaluator and thus getting the first
  2509. filename, which it then sees is not a switch, so now the field is parsed by
  2510. the next parser in the chain, cmifi(), which causes \fnextfile() to be
  2511. executed again. In fact, the FOR loop has nothing to do with; the same
  2512. thing happens like this:
  2513. void \ffiles(*)
  2514. delete \fnextfile()
  2515. This deletes not the first file, but the second one. Obviously users can be
  2516. told not to refer to \fnextfile() in chained-fdb fields:
  2517. for \%i 1 \ffiles(*) 1 { .f := \fnextfile(), delete \m(f) }
  2518. but this is hardly intuitive. I had some clever ideas of how to make
  2519. \fnextfile() work as expected in this context but it's way too much magic.
  2520. Better to simply document that \fnextfile() is "deprecated" and the array
  2521. format should be used:
  2522. for \%i 1 \ffiles(*,&a) 1 { delete \&a[\%i] }
  2523. The difference is, an array element doesn't change every time it's referred to!
  2524. Added a /PRESERVE switch to the COPY command to preserve the timestamp and
  2525. permissions of the file. I did this using the Kermit APIs so it should work
  2526. for any version of C-Kermit or K95. ckuus[26].c, 30 Nov 2006.
  2527. Added COPY /OVERWRITE:{ALWAYS,NEVER,OLDER,NEWER} to control name collisions
  2528. when copying across directories. ckuus[26].c, 1 Dec 2006.
  2529. --- Dev.23 ---
  2530. Fixed a bug in SET TELNET PROMPT-FOR-USERID, SET AUTH KERBEROS[45] PROMPT,
  2531. and SET AUTH SRP PROMPT in which the user's string was compared with a
  2532. literal (s == ""), reported by Pavol Rusnak. Worse, empty strings (if the
  2533. test succeeded) were turned into null pointers, and then fed to strlen().
  2534. Fixed in ckuus3.c, 5 Dec 2006.
  2535. Added an optional 4th argument to \findex(), \frindex(), \fsearch(), and
  2536. \frsearch(): the desired occurrence number of the searched-for string.
  2537. \frsearch() was a bit tricky. ckuus[24].c, 7 Dec 2006.
  2538. Added \fcount(s1,s2) to tell the number of occurrences of s1 in s2.
  2539. ckuus[24].c, 8 Dec 2006.
  2540. Added \ffunction(s1) to tell if a given built-in function is available.
  2541. ckuus[24].c, 8 Dec 2006.
  2542. Changed RENAME /COLLISION:PROCEED to be /COLLISION:SKIP, which is clearer.
  2543. ckuus[26].c, 8 Dec 2006.
  2544. For communication protocols: INPUT /COUNT:n to read exactly n characters
  2545. without any matching. Can be used, for example, with CONTENT_LENGTH in CGI
  2546. scripts; NUL characters are counted but not collected. ckuusr.[ch],
  2547. ckuus4.c, 8 Dec 2006.
  2548. There was a bad bug in the date-parsing routines; it's been there for years.
  2549. If a date string includes a timezone, e.g. "Sat, 9 Dec 2006 19:26:23 EST",
  2550. and converting to GMT changes the date, the variables for day, month, and
  2551. year (which are used later) were not updated, and the final result was a day
  2552. off. Fixed in cmcvtdate(): ckucmd.c, 10 Dec 2006.
  2553. Built OK with SSL/TLS. Tested with the POP script, found that I broke INPUT
  2554. when adding the /COUNT feature; there was a path through the code that could
  2555. leave the "anychar" variable unset and therefore random. Fixed in
  2556. doinput(). The POP script, which does not use /COUNT, works again and so
  2557. does a new CGI script, which does use /COUNT. ckuus4.c, 10 Dec 2006.
  2558. Supplied a missing comma in the help-text array for HELP SET TERMINAL, which
  2559. resulted in bad formatting in K95 around SET SNI-FIRMWARE-VERSIONS.
  2560. ckuus2.c, 10 Dec 2006.
  2561. Made "help locus" a synonym for "help set locus". ckuusr.[ch], ckuus2.c,
  2562. 11 Dec 2006.
  2563. This morning the Columbia FTP server was malfunctioning in a perfect way
  2564. for me to implement and test an FTP timeout mechanism. The server would
  2565. close the data connection after sending the file, but the client never saw
  2566. the close and was stuck forever in a recv(). I added code to do a select()
  2567. on the data connection prior to entering the recv(), with a timeout on the
  2568. select() that the user can establish with SET FTP TIMEOUT. Built and tested
  2569. on Solaris 9, clear-text FTP. Also built cleanly for FTPS and tested
  2570. against a server that does not hang; I don't have access to an FTPS server
  2571. that would tickle the timeout code. ckcftp.c, 11 Dec 2006.
  2572. --- Dev.24 ---
  2573. Fixed a bug in the INPUT /COUNT: parser: the array of search strings was
  2574. never initialized, which didn't matter before, but with /COUNT:, if the
  2575. first element was not a NULL pointer, we'd treat it as a search string, and
  2576. then if it happened to match something in the input stream, the operation
  2577. would stop before the count was exhausted. Fixed by (a) initializing the
  2578. array, and (b) ignoring any search strings if /COUNT: was given. ckuusr.c,
  2579. 13 Dec 2006.
  2580. Removed a debug() statement from zsattr() that suddenly started making some
  2581. version of gcc complain, reported by Gerry Belanger. ckufio.c, 13 Dec 2006.
  2582. --- Dev.25 ---
  2583. Some casts for the 3 interior args of the new select() call in ckcftp.c
  2584. for HP-UX 9. 14 Dec 2006.
  2585. Changed \fkeywordvalue() to accept a string rather than a single word
  2586. as its second argument, so that more than one separator could be specified,
  2587. and to return -1 on error, 0 if it found nothing, 1 if given a keyword but
  2588. no value, and 2 if there was a keyword and a value. dokwval(): ckuus[24].c,
  2589. 14 Dec 2006.
  2590. Checked FTP timeout on command channel with FTP DIRECTORY of a big directory
  2591. using a path into our ftp server that preserves the hanging behavior. The
  2592. timeout was actually working, but the failure condition wasn't propagating
  2593. back to the user, and there was no error message. Fixed in doftprecv2() and
  2594. failftprecv2(): ckcftp.c, 15 Dec 2006.
  2595. Added the obvious timeout checks for FTP uploads, but I have no way to test
  2596. the code since our misbehaving FTP server does not hang when receiving
  2597. files, only when sending them. But uploads work both with and without a
  2598. timeout set, so at least no harm is done. ckcftp.c, 17 Dec 2006.
  2599. When downloading with FILE DESTINATION NOWHERE (= /CALIBRATE), Kermit still
  2600. checked the size of the incoming file and refused it if there wasn't enough
  2601. free disk space, on platforms (such as VMS) where zchkspa()) actually works;
  2602. reported by Bob Gezelter. ckcfn3.c, 18 Dec 2006.
  2603. Built on Mac OS X 10.4.8 and NetBSD 3.1_RC3, all OK. 19 Dec 2006.
  2604. --- Dev.26 ---
  2605. Built on VMS 7.3-2/Alpha. Had to squelch a couple compiler warnings by
  2606. changing some ints in the new \fpictureinfo() code from unsigned to signed,
  2607. and fix a typo in the prototype for the new gettcpport() function.
  2608. ckcnet.h, ckuus4.c, 22 Dec 2006.
  2609. --- Dev.27 ---
  2610. Parameterized pty routines and all references to them for file descriptor,
  2611. rather than to use global ttyfd, thus allowing ptys to be created for
  2612. different purposes. Tested on Solaris 9 and Mac OS X 10.4.8, with "set host
  2613. /connect /pty emacs" (fine in both cases), and (more to the point) "set host
  2614. /connect /pty kermit" -- here we make a connection from one Kermit process
  2615. to another and transfer a file; works fine and wasn't especially slow either;
  2616. a good sign. ckcdeb.h, ckutio.c, ckupty.c, 22 Dec 2006.
  2617. Created a new version of ttruncmd() called ttyptycmd(), which works by
  2618. calling do_pty() to get a pty to run the command on, and then in a loop,
  2619. reads from the pty and writes to the net and reads from the net and writes
  2620. to the pty, using select() to which of those it should do on each pass.
  2621. First cut just uses single-byte reads and writes. Tested using Kermit
  2622. itself as an external protocol. Works but slowly: 6000cps. Zmodem doesn't
  2623. work at all. ckutio.c, 24 Dec 2006.
  2624. Changed single-character read() and write() to buffered reads and writes,
  2625. with ttxin() and ttol() used for network i/o. Using Kermit as the external
  2626. protocol, this gives 450Kcps (about 1/3 normal on this connection).
  2627. But now there's a problem: the loop doesn't know when to stop. How does it
  2628. know when the process that is running on the pty has exited? With single
  2629. character read()'s that are executed unconditionally when select() says the
  2630. pty has data waiting, as in the first pass, I get EIO if there actually
  2631. isn't any, and can exit the loop. But now, to avoid blocking, I call
  2632. in_chk() to see how much data is waiting, and I don't try to read anything
  2633. if it says nothing is waiting. If the process associated with the pty file
  2634. descriptor has terminated, in_chk() would presumably get some kind of error,
  2635. but it doesn't. I changed do_pty to return the pid of the fork where it
  2636. execs its command so we can check the pid with kill(pid,0) when in_chk() of
  2637. the pty says 0, but this doesn't help either; it seems like the process is
  2638. not exiting, but of course it is.
  2639. I could not find any legitimate way to test when the pty fork terminated.
  2640. Select() always says the pty file descriptor was ready, no matter what.
  2641. Select() never reports an exception on the pty file descriptor;
  2642. in_chk(ptyfd) returns 0 and not an error. read(ptyfd,...) gets 0 but not an
  2643. error. fcntl(ptyfd,...) doesn't get an error. Finally I tried
  2644. write(ptyfd,c,0) and this indeed gets EIO (i/o error). With this, using
  2645. Kermit as the external protocol works fine in Solaris but I tend to think
  2646. this trick will not be very portable (it isn't). 24 Dec 2006.
  2647. Made ttptycmd() use a more intelligent buffering scheme, fixed a few things
  2648. about how I was setting up the select() call that should address some of
  2649. yesterday's problems. Still doesn't work but it's progress. A: 25 Dec 2006.
  2650. Debugging yesterday's code... Still, the error conditions are never set,
  2651. we never detect when the pty closes. In Solaris, if select() says ptyfd is
  2652. ready to read but in_chk() says there are no characters there, we can treat
  2653. this as a loop-exit condition. But in NetBSD, in_chk() always says 0 when
  2654. used on a pty (but works OK on a serial or net connection).
  2655. Realized I could not use in_chk() on the pty because there is too much
  2656. baggage with the communication path -- myread(), etc etc) -- so I replaced
  2657. this with a simple ioctl(ptyfd,FIONREAD,&n). This works fine in Solaris but
  2658. always returns 0 in NetBSD, despite what the man page says (i.e. that this
  2659. function can be used on any file descriptor).
  2660. OK, let's see.... select() does not return useful results. It says
  2661. characters are waiting on ptyfd when they are not, and it never detects the
  2662. closure of the pty..... Well of course not, because we are the ones who
  2663. have to close it. Just because the process has stopped doesn't mean the pty
  2664. is closed. So we're back to square one, how do we know when to close it?
  2665. ckupty.c seems to keep the process ID in a global variable, pty_fork_pid
  2666. (which is not the same as the pid now returned by do_pty(), which is
  2667. useless, but I don't understand why). But it doesn't matter because when we
  2668. kill(pty_fork_pid,0), we still get no error of any kind, even after we know
  2669. the process has exited. I am completely flummoxed. select() lies, and even
  2670. if it didn't, there is simply no completion criterion. In the loop,
  2671. select() always says that the pty is ready to read. To be continued.
  2672. 26 Dec 2006.
  2673. Back to Square One, single-byte reads and writes.
  2674. . This works for both ripple and Kermit.
  2675. . Doesn't work for Zmodem but we'll deal with that later.
  2676. . In this case FD_ISSET(ptyfd) is still true after pty closes.
  2677. But the ensuing read() gets EIO so we know the pty is gone. That means the
  2678. same thing should happen in the buffered version, no? Yes; I went back to
  2679. the buffered version and replaced all the other nonworking tests by a
  2680. blocking read of 1 byte on the pty and this detects the termination. Now:
  2681. . ripple works perfectly (of course it's only one-way).
  2682. . Kermit fails
  2683. Let's call the remote, forked, redirected, external Kermit A and its
  2684. local partner B. A sends its S-packet, B receives it OK and Acks.
  2685. A apparently does not receive the ACK in time, so sends the S again, but OK.
  2686. followed immediately by the F. B Acks the F. A sends the A, B Acks it.
  2687. But now A sends a piece of the previous F packet and the the first piece
  2688. of a D packet.
  2689. Clearly the buffering is messed up. Sure enough, there was an extraneous
  2690. statement incrementing a read pointer in a write section. Removing that
  2691. cleared up the problems with Kermit, now we can send and receive substantial
  2692. files efficiently in remote mode. Zmodem seems to work too, except that at
  2693. the beginning a bunch of "**B0800000000022d"'s are stuffed into Kermit's
  2694. command buffer, so after the transfer we get some error messages.
  2695. In local mode, over a Telnet connection, Kermit works fine. Zmodem works
  2696. OK too except it doesn't finish right, so at the very end rz on the far end
  2697. is still waiting for something; if I cancel out of it with ^X^X^X^X^X, it
  2698. deletes the file. So there still is something wrong with the termination
  2699. test.
  2700. Also you don't see anything on your screen when running Kermit or Zmodem
  2701. this way. That's to be expected, since they are using stdio for the
  2702. transfer, so they can't also be displaying progress or other messages.
  2703. Built this on NetBSD again... Seems to work this time, but has trouble
  2704. finishing, like Zmodem. Hmmm, on closer examination, it turns out that
  2705. since in_chk() always returns 0 on the ptyfd, we fall into our new
  2706. single-byte read code, so it's really slow, like 10K cps on a connection
  2707. where 1M is the norm. 27 Dec 2006.
  2708. Switched the pty from buffer peeking (FIONREAD) and blocking reads to to
  2709. nonblocking reads (O_NONBLOCK / O_NDELAY). Works just fine on NetBSD except
  2710. now we no longer get EIO at the end when trying to read from the pty process
  2711. that has exited. In fact, we're back to square one again. not ioctl(), not
  2712. fcntl(), not select(), not even read() gets an i/o error after the pty
  2713. process exits. But in NetBSD, we have to use nonblocking reads because ...
  2714. Hmmmm, maybe switch the fd between blocking and nonblocking for the test...
  2715. Nope, NetBSD seems to be hopeless (later, Ed Ravin confirmed that similar
  2716. problems have been observed with other applications that try to do this).
  2717. Switching to Linux, I see that yesterday's Solaris code (blocking reads)
  2718. works exactly the same way on Linux.
  2719. Tried today's O_NDELAY method on Solaris. It works perfectly. And then I
  2720. moved this one to Linux and it works perfectly there too. Except in both
  2721. cases we have the weird thing with Zmodem at the end, but I think that's
  2722. because rz/sz don't use standard i/o. On NetBSD, it still hangs at the end.
  2723. Turns out that testing the pid works in NetBSD, even though it didn't in
  2724. Solaris. Turns out read() gets an i/o error in Solaris and Linux but not
  2725. in NetBSD. So checking the read result first, and then checking the pid
  2726. if read() got zero bytes catches all three. 28 Dec 2006.
  2727. Now the question of return code. In the original ttruncmd() function, we do
  2728. a fork() and a wait(). When the external protocol program finishes, wait()
  2729. gives us its return code and we can pass it on through \v(pexitstat) as well
  2730. ttruncmd's own return code. But ttptycmd() has to interact with the pty
  2731. continuously, so it can't just sit back and wait() for it. Instead we have
  2732. to detect when the process has exited and then call waitpid() on the fork
  2733. pid, before shutting down the pty. Tested on Solaris using Kermit as the
  2734. external protocol and then inducing failure, or letting it run to
  2735. completion. FAILURE and SUCCESS set appropriately in each case. Tested
  2736. with Zmodem too, works OK except for the aforementioned cosmetic glitch at
  2737. the end. Tested on NetBSD, all OK.
  2738. To make K5 connection to Panix from Spam:
  2739. set telnet debug on
  2740. authenticate K5 init /realm:PANIX.COM /password:xxxxx
  2741. set host shell.panix.com 23 /k5login
  2742. Good... Now I try to send a file from Spam to Panix over the K5 connection
  2743. using Kermit itself as the external protocol. It fails. Inspection of the
  2744. debug log on the far side shows that the S-Packet was received correctly,
  2745. good! This means we are reading the clear-text S-Packet from the external
  2746. Kermit program, and that ttol() is encrypting appropriately.
  2747. The remote Kermit sends the Ack and goes to read the next packet: ttinl()
  2748. calls myfillbuf() and:
  2749. SVORPOSIX myfillbuf calling read()
  2750. SVORPOSIX myfillbuf=0 <-- read returns 0
  2751. SVORPOSIX myfillbuf ttcarr=2
  2752. SVORPOSIX myfillbuf errno=0 <-- and reports no error
  2753. HEXDUMP: mygetbuf read (-3 bytes)
  2754. mygetbuf errno=0
  2755. ttinl myread failure, n=-3
  2756. ttinl myread errno=0
  2757. ttinl non-EINTR -3[closing]
  2758. This happens because myfillbuf() deliberately returns -3 when read() gets 0
  2759. bytes. I don't understand why this happens but the real problem is yet to
  2760. come. The local Kermit (the one that has made the secure connection and is
  2761. running the external protocol through ttptycmd()) eventually figures out
  2762. that the transfer failed and when we reconnect, we get total garbage -- the
  2763. encryption either stopped happening, or got out of sync.
  2764. Looking at the local debug log, ttol() is doing its job, converting the
  2765. initial "kermit -r\13" from plaintext to cyphertext, as shown by the
  2766. hexdumps. Then it enters ttptycmd()... Hmmmm, wait, how can it send the
  2767. "kermit -r" before it starts the external protocol? Never mind, worry about
  2768. that later... Anyway, ttptycmd() says:
  2769. ttptycmd loop top have_pty=1
  2770. ttptycmd loop top have_net=1
  2771. ttptycmd FD_SET ptyfd in
  2772. ttptycmd FD_SET ttyfd in
  2773. ttptycmd nfds=5
  2774. ttptycmd select=1
  2775. ttptycmd FD_ISSET ttyfd in
  2776. ...
  2777. ttptycmd in_chk(ttyfd) n=11
  2778. ttptycmd ttxin n=11
  2779. ttxin() asks for 11 bytes, myfillbuf() gets 11 bytes, and hexdump() shows
  2780. the cyphertext, there doesn't seem to be any decrypting going on. Hmmm, it
  2781. looks like the regular code calls ttinc() in a loop, rather than ttxin().
  2782. Maybe ttxin() doesn't have decryption hooks. No, that's not it, the code is
  2783. there, but the Kermit packet reader does not use ttxin(), it uses ttinl().
  2784. But of course we can't use that for external protocols because it's designed
  2785. only to read Kermit packets. Substituting a loop of ttinc()s for the ttxin()
  2786. call fixes things (and strangely enough, it seems to be faster). And now we
  2787. have our first external protocol transfer over a secure connection (external
  2788. Kermit program, Linux over Kerberos 5 to NetBSD). Zmodem worked too for a
  2789. short file but "something happens" with longer ones. 29 Dec 2006.
  2790. New makefile target for Linux with Kerberos 5, linux+krb5, that doesn't
  2791. include anything extra from SSL or other security methods (but apparently it
  2792. is still necessary to include -DOPENSSL_097 in order to get the right names
  2793. for the DES routines?). Ditto netbsd+krb5 for NetBSD, except in this case
  2794. -DOPENSSL_097 is not necessary. makefile, 30 Dec 2006.
  2795. Note to myself: On Panix:
  2796. export LD_LIBRARY_PATH=/usr/local/kerblib
  2797. make netbsd+krb5 "K5LIB=-L/usr/local/kerblib" "K5INC=-I/usr/local/include"
  2798. Can't telnet-k5 from newly built Kermit on NetBSD; partway through the
  2799. negotiations, just after "TELNET RCVD SB ENCRYPTION SUPPORT DES_CFB64
  2800. DES_OFB64 IAC SE" it dumps core. The last two lines in debug.log after
  2801. this are:
  2802. tn_sb[len]=5
  2803. encrypt_support[cnt]=2
  2804. Rebuilding with -DOPENSSL_097 doesn't change anything. Ed Ravin said they
  2805. have two different Kerberos installations, Heimdal and MIT; maybe some
  2806. mixup between the two explains the problem (Jeff concurs). The core dump
  2807. occurs in ck_crp: encrypt_support():
  2808. debug(F100,"XXX ep not NULL","",0);
  2809. type = ep->start ? (*ep->start)(DIR_ENCRYPT, 0) : 0; <-- Here
  2810. debug(F101,"XXX new type","",type);
  2811. Anyway, I can log in with Kerberos 5 to Panix OK from Columbia (sesame)
  2812. using 8.0.201. So let's try to resurrect the Solaris version with everything:
  2813. solaris9g+krb5+krb4+openssl+shadow+pam+zlib
  2814. I hunted around to find where the current library and header file
  2815. directories were... Last time I tried this (March 2006) it bombed, not
  2816. finding libdes. Instead we have /opt/kerberos5125/lib/libdes425.a. Made a
  2817. new cu-specific target that includes this; now we get farther; it blows up
  2818. in ckcftp.c with tons of errors and warnings, which we can worry about
  2819. later. Building again with -DNOFTP, it gets to ckuath.c (the first security
  2820. module) and:
  2821. ckuath.c:151:18: error: krb5.h: No such file or directory
  2822. ckuath.c:152:21: error: profile.h: No such file or directory
  2823. ckuath.c:153:21: error: com_err.h: No such file or directory
  2824. ckuath.c:176:28: error: kerberosIV/krb.h: No such file or directory
  2825. In file included from /opt/openssl-0.9.8d/include/openssl/des.h:101,
  2826. from ckuath.c:219:
  2827. Found krb5.h in /opt/kerberos5125/include/krb5.h, added a -I for this
  2828. directory ... Now we get lots of warnings in ckuath.c, but it completes OK,
  2829. then we wind up bombing out in ck_crp.c; I don't know why -- there are all
  2830. the same warnings (related to argument passing to DES functions), but no
  2831. errors. I have no clue.
  2832. Tried to resurrect the solaris2x+krb4 target; this required changing -lkrb
  2833. to -lkrb4 and -ldes to -ldes425. Lots of warnings in ckutio.c, ckcnet.c,
  2834. ckctel.c, then it bombs out in ckcftp.c because it can't find krb.h. I
  2835. found it, adjusted the -I flags, but now it bombs because krb.h itself
  2836. #includes <kerberosIV/des.h>, which of course it can't find because the
  2837. brackets mean it's looking in /usr/include/kerberosIV/, which, of course,
  2838. the sys folks have removed. Giving up on Solaris again. Later, Jeff said
  2839. "Solaris does not publicly export the krb5 libraries. You need to build
  2840. the MIT Kerberos libraries separately and link to them." 30 December 2006.
  2841. Changed copyright date to 2007. ckcmai.c, 1 Jan 2007.
  2842. With Ed Ravin's help, successfully built C-Kermit with Kerberos 5 and
  2843. OpenSSL (netbsd+krb5+openssl+zlib), but it does not make K5 connections; it
  2844. gets hung up in the Telnet negotiations. 3 Jan 2007.
  2845. Downloaded MIT Kerberos 5 v1.4.4 to Solaris 9, 54MB worth. This is just so
  2846. I can build a Kerberized C-Kermit for testing ttyptycmd(). Ran the
  2847. configure program, got a few warnings but it didn't fail (should it?) Did
  2848. "make install", specifying a private directory but it failed immediately
  2849. with "cannot stat libkrb5support.so.0.0: No such file or directory".
  2850. OK, I tried. 3 Jan 2007.
  2851. Made a new makefile target for Mac OS X, macosx10.4+krb5+ssl, ran it on Mac
  2852. OS X 10.4.8. It bombs out in ckcftp.c with: ckcftp.c:551: error: static
  2853. declaration of 'gss_mech_krb5' follows non-static declaration
  2854. /usr/include/gssapi/gssapi_krb5.h:76: error: previous declaration of
  2855. 'gss_mech_krb5' was here". Ditto for gss_mech_krb5_old, gss_nt_krb5_name,
  2856. and gss_nt_krb5_principal. Tried again with -DNOFTP. We get lots of
  2857. warnings in the network modules, but they complete. But ck_ssl.c bombed
  2858. with a conflict between its own declarations of encrypt_output and
  2859. decrypt_input and the ones in ckuat2.h; removed the prototypes from the
  2860. latter (as Jeff advised) it built OK and it works OK too. Built with FTP
  2861. too, but with link-time warnings about the aforementioned gss_* symbols.
  2862. #ifdef'd them out (gss_mech_krb5, gss_mech_krb5_old, gss_mech_name, and
  2863. gss_mech_principal) for MACOSX, where these symbols are exported by the
  2864. library. Now it all compiles and links OK, and runs OK too. 3 Jan 2007.
  2865. Spent a day hunting around for a version of Zmodem that would build and
  2866. execute on Mac OS X, finally found one. Now at last I could try a Zmodem
  2867. external-protocol transfer over a secure connection. But phooey, C-Kermit's
  2868. pty support didn't work on this box. Kermit finds master /dev/ptypa OK,
  2869. then in ptyint_void_association() tries to open /dev/tty but gets ERRNO=6
  2870. "device not configured" (which is apparently OK, because the same thing
  2871. happens on other platforms where this works), then tries to open slave
  2872. /dev/ttypa and gets ERRNO=13 "permission denied" because, indeed, I don't
  2873. have r/w permission on the device. Left a message. 4 Jan 2007.
  2874. Changed TRANSMIT /BINARY output buffer size from 252 to 508 to avoid
  2875. TCP fragmentation. Need to add a SET command for this later.
  2876. ckuus4.c, 5 Jan 2007.
  2877. Found another Mac where the ptys weren't protected against me, make a K5
  2878. connection and transferred a largish file with Zmodem with zero glitches,
  2879. except it was kind of slow, 84K cps. Well, we're doing single-character
  2880. reads on the net (ttinc()'s instead of ttxin()). Hmmm, but then I did it
  2881. again and got 2.2Mcps. Success was reported, but it actually didn't work;
  2882. it only sent the first quarter of the file.... Oh well, at least now we
  2883. have a testbed. 5 Jan 2007.
  2884. Tried again, saw that the file is actually transferred instantly but then
  2885. we're not picking up the protocol at the end. Theory: after the transfer
  2886. finishes, we come back to the prompt on the remote host, which means we have
  2887. something to read from the net and write to the pty, but the pty has already
  2888. exited. AFTER THE PTY IS GONE, WE DO NOT WANT TO READ FROM THE NET ANY
  2889. MORE. Adding this test makes Kermit succeed right away when sending the
  2890. same largish file, with a transfer rate of 4M cps, that's better. But the
  2891. rz program on the far end is evidently not receiving the goodbye handshake
  2892. from the receiver, because it sits there foreever in its *B09002402009418
  2893. mode until I ^X^X^X^X^X out of it, at which point it deletes the file it
  2894. already received, not very helpful. In the code, I read from the pty if the
  2895. pty is open and there is room in the buffer. This means that when we get to
  2896. the end, either there is no room in the buffer (unlikely) or the last bit
  2897. sent by sz before exiting was cut off when the fork closed. Why do we get
  2898. in this fix only with Zmodem and not with Kermit?
  2899. In Mac OS X, after sz exits, we get ERRNO=5 if we try to write to the pty,
  2900. but we still get no errors after that if we try to read from it. Still,
  2901. prior to this we did more than 20 unproductive nonblocking reads from the
  2902. pty (no error, no bytes) without incident; there did not seem to be anything
  2903. waiting. In fact, the last thing we read from the pty were the text
  2904. messages that are issued at the end of the transfer: "rz 3.73 1-30-03
  2905. finished." After which it pauses a second and spits out a message about
  2906. UNREGISTERED COPY.
  2907. Figured out how to build lrzsz, in hopes that the previous problems were
  2908. with rzsz and crzsz's fiddling with file descriptors, but I get the same
  2909. behavior. Which is good, I guess, because if I can fix one, I fix them all.
  2910. Or not... Testing lrz by itself (not under C-Kermit), I see that it doesn't
  2911. work at all with Kermit's own Zmodem implementation.
  2912. OK, here's one problem: at the end of the transfer, the Omen Zmodems print
  2913. stuff like "Please read the license agreement", Kermit dutifully reads this
  2914. from the pty and sends it to the host, the host shell says "Please: command
  2915. not found", issues its prompt again, which Kermit reads, feeds to the pty,
  2916. and apparently the pty echoes it, so we send it back to the host, and there
  2917. ensues an infinite loop of getty babble until the pty closes. Now, there
  2918. ought to be a way to make the external protocol shut up, like Kermit's
  2919. -q(uiet) flag, but these are unregistered versions so you can't shut up the
  2920. messages. In fact, the transfer works, but the getty babble at the end
  2921. ruins the experience. Now I'm beginning to wonder how any of these programs
  2922. ever worked as external protocols. Hmmm, now that I try it, I see the
  2923. same thing happens the old way, when using ttruncmd() rather than ttptycmd().
  2924. Reading the crzsz documentation I see it says that messages come out on
  2925. stderr. OK, that's progress. In ckupty.c I try redirecting 2 to /dev/null.
  2926. Well good, this filters out the messages from csz, but we still get getty
  2927. babble on the prompt. In the debug log, we read the last bunch of stuff
  2928. from net, 618 bytes of Zmodem stuff... Now what happens?
  2929. Zmodem on the remote exits, the host prints its prompt. Kermit, of course,
  2930. reads the prompt from the net, now come to the bottom of the loop and we
  2931. have 7 bytes to write to the pty, and no error condition, so we continue the
  2932. loop. select() says that the pty is ready for writing. We write the 7
  2933. bytes and and get no error. Loop again, this time select() says the pty has
  2934. data waiting. Sure enough we get the prompt back, and send it to the net,
  2935. and thus begins the getty babble. There are two causes for this:
  2936. 1. crzsz does not exit immediately; it sleeps for 10 seconds after
  2937. printing its nag message.
  2938. 2. During this interval the pty seems to be echoing what is sent to it.
  2939. csz is not echoing; I checked. Anyway, removing the pause doesn't
  2940. seem to make a difference.
  2941. ttptycmd() needs to:
  2942. . TELL the pty module to redirect stderr to /dev/null
  2943. . SET PTY TO NOECHO (master or slave?)
  2944. Tried setting the pty to noecho:
  2945. termbuf.c_lflag &= ~(ECHO|ECHOE|ECHOK);
  2946. and this seemed to stop the getty babble. After the file transfer, I read
  2947. back the prompt from the host shell, I write the prompt bytes to the pty;
  2948. there is no error. And now select() simply hangs forever (or times out if
  2949. a timeout is set). The question here is: why didn't writing to the pty
  2950. produce an error? And, because we never detect the pty has exited, we can't
  2951. set a good return code. 5 Jan 2007.
  2952. Moved pty fork testing to a separate routine, pty_get_status(), and
  2953. added a call to it from the place where we time out, in case the fork
  2954. terminated; then we can get and return its status. 6 Jan 2007.
  2955. Added calls to pty_get_status() to every place where we suspect a pty error,
  2956. tried again with lrzsz, crzsz, and regular rzsz. All three work, but in
  2957. each case waitpid() indicates that the sz program gave exit code 1 (failure).
  2958. ckutio.c, 7 Jan 2007.
  2959. Changing the subject... On my test system, every time I execute ttptycmd(),
  2960. I get "permission denied" on /dev/ttyp3. Then I run it again and get to
  2961. ttyp4 which is OK. I wanted to skip past any pty for which I lack
  2962. permission and try the next without raising an error. Added debugging code:
  2963. 16:25:23.524 pty_getpty() pty master open error[/dev/ptyp0]=5
  2964. 16:25:23.524 pty_getpty() pty master open error[/dev/ptyp1]=5
  2965. 16:25:23.524 pty_getpty() pty master open error[/dev/ptyp2]=5
  2966. 16:25:23.524 pty_getpty() found pty master[/dev/ptyp3]
  2967. 16:25:23.524 pty_getpty() slavebuf [2][/dev/ttyp3]
  2968. So it already was skipping past open errors; ttyp3 was opened successfully.
  2969. The problem is that ptyp3 is rw-rw-rw-, but the corresponding master,
  2970. ttyp3, is rw--r----. It seems the code assumes that if the master can be
  2971. opened, then so can the corresponding slave. Unfortunately, the code is
  2972. not structured to allow us to skip ahead to the next master if the slave
  2973. can't be opened. 7 Jan 2007.
  2974. Spent a couple hours trying to rearrange the code in the pty module to skip
  2975. past inaccessible slaves but it was a rabbit hole, not worth it, backed off.
  2976. 8 Jan 2008.
  2977. Tried an upload over a secure connection using lsz. Unexpectedly, this time
  2978. it worked; not only was the file (about 0.5MB) transferred correctly, but
  2979. Kermit detected the fork's termination and got the pid's exit status, and,
  2980. for the first time, correctly reported a successful transfer. I have no
  2981. idea why this works today and not yesterday. More tests; it works most of
  2982. the time. It works with csz and with regular sz too.
  2983. (days later...)
  2984. ckucns.c seems to do the right thing; it recognize the ZSTART string,
  2985. activates the Zmodem-Receive APC, and returns. doconect() sees the APC and
  2986. begins to execute it. The RECEIVE command results in a call to the GET
  2987. command parser, doxget() (IS THAT RIGHT?), then comes a ttflui(), which
  2988. throws away a bunch of stuff. Finally we get to ttptycmd(), we get a pty
  2989. and run lrz in it, select() says stuff is waiting from the pty, but read
  2990. returns 0, errno 0. Skipping the ttflui() in doxget() if the protocol was
  2991. not Kermit didn't seem to make difference. ckuus6.c, 8 Jan 2007.
  2992. The problem is that in this case, reads from the pty never get anything (no
  2993. data, no error), write always gets an error. It's as if the pty was not
  2994. being set up right, or we're using the wrong file descriptor. And if we
  2995. skip the autodownload? Same thing.
  2996. OK, putting downloads aside for a moment, let's get uploads working as well
  2997. as possible. At this point we have the odd situation (at least in this
  2998. configuration) that the upload succeeds, but now for some reason we are
  2999. unable to read the exit status from the process, even though this was
  3000. working before, so ttptycmd() returns 0 (failure), yet Kermit reports
  3001. success.
  3002. Well, it turns out that kill(pty_fork_pid,0) was gumming up the works.
  3003. If we use only waitpid() all is well, I think. waitpid() with WNOHANG
  3004. returns -1 with status -1 errno 0 if the pid has not exited, and it returns
  3005. the pid and status > -1 if the process has exited. Fixed pty_get_status()
  3006. to do it this way. ckutio.c, 7 Jan 2007.
  3007. Let's move this from Mac OS to NetBSD and see how it works. Well, the file
  3008. transfer was just fine, but then I used some sexps to calculate the elapsed
  3009. time and transfer rate, and Kermit hung in dosexp(). Fine, ignoring that...
  3010. The debug log shows that ttptycmd() gets the pty OK, master and slave, the
  3011. i/o goes smoothly, and waitpid() does its job perfectly. Solaris, same
  3012. deal; ttruncmd() goes smoothly, but then the sexps afterward get "Arithmetic
  3013. exception". Turns out there was a BAD bug in dosexp() that allowed an
  3014. integer division by 0 to occur under certain circumstances; it's always been
  3015. there. Fixed in dosexp(): ckuus3.c, 8 Jan 2007.
  3016. After noticing a few problems running the pop.ksc script in production over
  3017. the past year, rewrote \femailaddress() to be more reliable and a lot
  3018. simpler. ckuus4.c, 9 Jan 2007.
  3019. Back to ttptycmd()... When we left off, we could send but not receive. Set
  3020. up a test case using Kermit as the external protocol for receiving a short
  3021. file. If I SET STREAMING OFF and use short packets, it actually does work,
  3022. so it's not a complete failure to function, but apparently a lack of flow
  3023. control for the pty. Began by completing the parameterization of the pty
  3024. module, so it can be called for interactive use (fc 0) or for running
  3025. protocols (1). Confirmed that everything works at least as well as before
  3026. (e.g. "set host /pty emacs" vs external protocols). ckcdeb.h, ckutio.c,
  3027. ckupty.c, 9 Jan 2007.
  3028. Found in HP-UX "man 7 pty" a description of ioctl(fd,TIOCTTY,fc) which is
  3029. exactly what we want: fc 0 turns off all termio processing and guarantees an
  3030. uninterrupted, unmolested, flow-controlled stream of bytes in both
  3031. directions. This function also exists in Linux, but not in Solaris, NetBSD,
  3032. or Mac OS X (TIOCNOTTY is not what we want, it does something else entirely).
  3033. Another possibility is TIOCREMOTE, which "causes input to the pseudoterminal
  3034. to be flow controlled and not input edited, regardless of the terminal
  3035. mode". This one exists in at least HPUX, NetBSD, Solaris, and Mac OS X.
  3036. Solaris: builds OK, but at runtime we get ENOTTY ("Inappropriate ioctl for
  3037. device"). By the time this happens, it's hard to tell from the code whether
  3038. the fd we're using is for the master or the slave; TIOCREMOTE can be used
  3039. only on the master. Close inspection shows that I am indeed doing that;
  3040. ptyfd as seen by ttptycmd() is truly the master, i.e. the /dev/ptyXX device,
  3041. not the /dev/ttyXX device (the slave fd can't be seen at all, as it exists
  3042. only in a separate fork). OK, so now we know that TIOCREMOTE can't be used
  3043. on Solaris.
  3044. NetBSD: Somehow, whether as a result of today's fiddling or the phase of the
  3045. moon, the code in pty_open_slave() that tries to open /dev/tty started
  3046. failing on NetBSD ("Device not configured"). Changing it to be run only if
  3047. fc == 0 (which doesn't seem to hurt anything), once again I get ENOTTY on
  3048. the TIOCREMOTE ioctl. Zmodem works but Kermit totally fails (the fork exits
  3049. immediately with an exit code of 0, even though it didn't do anything).
  3050. Mac OS X: Exactly the same sequence and results as NetBSD.
  3051. Linux: It did not execute the new ioctl at all; apparently the TIOC symbols
  3052. are hidden or not exported or something.
  3053. Where we stand:
  3054. . Downloads don't work
  3055. . Uploads got slow again
  3056. . Kermit doesn't work at all as an external protocol
  3057. Actually if I take the debugging out it goes fast, but it doesn't finish.
  3058. All today's work on ttptycmd() looks like a dead end. To roll back to
  3059. yesterday:
  3060. cp ckutio.c-20070108 ckutio.c
  3061. cp ckupty.c-20070108 ckupty.c
  3062. cp ckupty.h-20070108 ckupty.h
  3063. or to continue with today's:
  3064. cp ckutio.c-20070109 ckutio.c
  3065. cp ckupty.c-20070109 ckupty.c
  3066. cp ckupty.h-20070109 ckupty.h
  3067. Comparing Monday's and Tuesday's pty-related code, the differences are:
  3068. 1. Passing of function code to and among pty modules.
  3069. 2. Skipping the TIOCSCTTY ioctl and the open("/dev/tty") test.
  3070. 3. Attempting to put pty in TIOCTTY or TIOCREMOTE mode.
  3071. Commenting out 2 and 3 should put us back where we were on Monday if the
  3072. parameterization was done right. And with this, on Solaris, downloading
  3073. with Kermit external protocol works but slowly, 8K cps, with or without
  3074. debugging. Debug log does not show any obvious bottlenecks; select() takes
  3075. anywhere between no time at all and 0.1 seconds to return. If I increase
  3076. the pty-net buffer size from 1K to 4K, the rate goes up to 55K cps. If I
  3077. make it 8K I get 136K cps. With 16K I get 346K cps. 32K: 395K cps -- this
  3078. last one isn't worth the doubling. But at 24K I get 490K cps, sometimes
  3079. twice that. Let's stick with 24K for now. Downloading with Zmodem (rzsz)
  3080. works at the same rate, but now we're back to seeing the getty babble
  3081. (Several "**B0800000000022d") at the end. 10 Jan 2007.
  3082. Moving to Mac OS X, everything works the same as on Solaris, except I don't
  3083. get the Zmodem getty babble there, not even with Omen rzsz. Tested sends
  3084. in both remote and local mode, the latter over a secure Kerberos 5 Telnet
  3085. connection, using C-Kermit, rzsz, lrzsz, and crzsz, all good. 10 Jan 2007.
  3086. Now we're back where we were yesterday morning, but with better throughput.
  3087. The big issue then was receiving files. But yikes, now it works! Not only
  3088. that, I got a transfer rate of 2.1M cps. That's using Kermit protocol,
  3089. streaming, and big (4K) packets. Which didn't work before. Not a fluke
  3090. either, I uploaded bigger and bigger files up to 6MB, they all went
  3091. smoothly, at rates between 1 and 2 MBps. 10 Jan 2007.
  3092. Not so great in Zmodem land, however. If I start the external-protocol
  3093. receiver on the far end, escape back and start a Zmodem send... nothing.
  3094. If I leave the remote C-Kermit at its prompt (where it supposed to recognize
  3095. the Zmodem start string), still nothing. On the other hand, if I do it
  3096. with a script instead of by hand:
  3097. def xx output take blah\13, send /proto:zmodem \%1
  3098. it works, at least intermittently. But that's in remote mode. We won't be
  3099. using this in remote mode. In local mode, where we have a secure connection
  3100. to another computer, it seems we can read from the pty and write to the net,
  3101. but we time out waiting to read from the net; nothing arrives. Well, we
  3102. know that i/o works both ways, so there is some kind of screwup with the
  3103. Zmodem protocol start itself. Increasing the (still hardwired timeout) from
  3104. 5 to 22sec and driving the whole process with a script so as to avoid
  3105. autodownload as well as manual dexterity effects... It just sits there
  3106. forever, way longer than 22 sec. ^C'ing out, I see that sz was indeed
  3107. started on the far end and the protocol was executing. But it looks like
  3108. the receiver (the one running under ttptycmd()) is getting trashed packets,
  3109. because (a) it seems to be sending the same thing over and over again, and
  3110. (b) sometimes it waits as long as 10 seconds before anything arrives from
  3111. the remote. Maybe I was too impatient; I interrupted it after 4 minutes but
  3112. it seems to have been making some progress. Whenever there was data
  3113. available to read from the net, it was always 65 bytes, and it was not
  3114. actually the same data over and over. This is using lrz as the external
  3115. protocol. crz gets a bit farther. In this case we read up to 24K at a
  3116. gulp, but the amount varies a lot. It looks like we took in about 1.2MB of
  3117. Zmodem protocol data, but were only able to output the first 20K of the
  3118. file. Clearly there were lots of errors. In the end, the crz exits with
  3119. status 1 (failure).
  3120. Anyway it looks like we're back at needing to find a way to accomplish
  3121. something like TIOCREMOTE on the pty, which is where we came in. 10 Jan 2007.
  3122. Without any way to make the pty transparent and flow controlled, it would
  3123. seem to make sense to write to the pty in smaller chunks than we do to the
  3124. net. I left the read-from-pty-write-to-net buffer at 24K and changed the
  3125. read-from-net-write-to-pty buffer to 48 bytes.
  3126. Upload using lsz worked but took about 3 minutes. Actually it didn't work.
  3127. On the local end it seemed to work, but the file did not appear on the
  3128. remote end. Tried this several times, each time with different results,
  3129. adding more debugging each time. The problem this time was that the pty
  3130. read could get EWOULDBLOCK. Changed the code to not treat this as an error,
  3131. now Zmodem uploads are solid again except I never got EWOULDBLOCK again
  3132. either, even though I repeated the same upload about 1000 times (with
  3133. throughput of over 2MBps even with debugging on), so the test for it has
  3134. not been exercised.
  3135. OK, uploads still work. Back to downloading... The very first pty read
  3136. gets 0 bytes, followed by the fork test that shows that it exited with
  3137. exit status 2.
  3138. Next we try starting sz with some different options on the far end:
  3139. -q: quiet (no messages):
  3140. for some reason this gets totally stuck.
  3141. it looks as if this option is misdocumented;
  3142. sz seems to be sending the letter C (as in Xmodem 1K or whatever)
  3143. -e: escape (all control chars):
  3144. first attempt to read pty finds the process gone with exit status 2.
  3145. -k: send 1k blocks:
  3146. this one didn't stop immediately. It reads 48 bytes from net, writes
  3147. 48 to the pty with no error. Then reads 21 bytes from the pty, writes
  3148. them to the net OK. Then reads 48 bytes from net, writes them to pty OK,
  3149. reads 21 from pty, writes to net OK, etc etc... It appears to have
  3150. worked but (final read from pty returned 0, fork test showed lrz exited
  3151. with status 0), but only 754 bytes were received from the net when the
  3152. file is 420K...
  3153. Well this only goes to show that the faster we shove stuff into the pty, the
  3154. worse it gets. Zmodem downloads won't work unless we can make the pty
  3155. transparent and flow-controlled. So to summarize today's developments:
  3156. . separated in/out buffer sizes
  3157. . handled EWOULDBLOCK
  3158. . found out that sz options don't help much
  3159. 11 Jan 2007.
  3160. Next day. This has got to be the most delicate code ever, it's like
  3161. Whack-A-Mole, fix A and B pops up. Even without touching it, something that
  3162. worked perfectly a 2:00 doesn't work at all an hour later. Maybe I could
  3163. have used pipes instead of ptys, but pipes have problems of their own.
  3164. There has to be a way to do this. The telnet server, the SSH server, etc --
  3165. they all run on ptys, and we can upload files to them with Kermit. Why?
  3166. Because Kermit puts its terminal into all the right modes using the
  3167. time-honored methods of ttpkt() and ttvt(). Perhaps all we need is a copy
  3168. of ttpkt() that operates on the pty.
  3169. On that theory, let's go back to Kermit as the external protocol.
  3170. It's important to suppress all messages and displays. With that,
  3171. uploads work fine, no hitches.
  3172. Downloads: We fail right away. The debug log shows the Kermit program that
  3173. we are starting in the pty says:
  3174. "" - Invalid command-line option, type "kermit -h" for help.
  3175. But of course we are not giving it an invalid command-line option.
  3176. Switching to gkermit for the external protocol, now we see that no matter
  3177. command-line options we use, we read 0d 0d 0a from the pty and then the
  3178. next time we go to read from the pty we get 0 bytes and waitpid() says the
  3179. program has exited with status 1.
  3180. Why should downloading be different from uploading? ttptycmd has no idea,
  3181. it does everything the same. The only difference would seem to be which
  3182. side sends first, but even that tends to get washed out by each program's
  3183. startup messages.
  3184. Downloading with Kermit worked 2 days ago, what's different now? The buffer
  3185. sizes. Putting the net-to-pty back up to 24K (from 48 bytes)... Now it
  3186. works again.
  3187. Conclusion: Kermit conditions the pty correctly, Zmodem does not. Therefore
  3188. ttruncmd() must duplicate what ttpkt() does.
  3189. Or not. Because rz works fine on ssh/telnet ptys too. But not on our pty.
  3190. lrz exits immediately with status code 2 = 01000 but there are no clues in
  3191. the lrz.c source code, I don't even see this exit status set anywhere.
  3192. Unredirecting stderr, I see that the error is "lrz: garbage on command line".
  3193. Why do both Kermit and Zmodem sometimes think they are receiving an invalid
  3194. command line? If I could capture the garbage...
  3195. Side trip #1: ("pty.log",O_WRONLY) gives "no such file or directory".
  3196. Changed this to ("pty.log",O_CREAT,0644) and now it doesn't get an error,
  3197. and it creates the file, but not with 0644 permissions, and with nothing
  3198. written in it. How come nothing works?
  3199. Fine, the debug log shows that ttptycmd() receives the correct string
  3200. (e.g. "lrz -v"). It passes it to do_pty() correctly, and do_pty() passes it
  3201. to exec_cmd(), which runs cksplit() on it, coming up (in this case) with
  3202. "lrz" and "-v", which is right, and then:
  3203. args = q->a_head + 1;
  3204. execvp(args[0],args);
  3205. execvp() wants the args array to have a null element at the end. cksplit()
  3206. does indeed do that, or at least the code is there. Added code to exec_cmd()
  3207. to verify the argument list and that it is null-terminated. So far it is.
  3208. Anyway, we have traffic between the Zmodem partners, but no joy.
  3209. Commenting out the bit that redirects stderr, now I can see it on my screen
  3210. in real time:
  3211. lrz waiting to receive.Retry 0: Bad CRC
  3212. Retry 0: Got ERROR
  3213. Retry 0: TIMEOUT
  3214. Retry 0: TIMEOUT
  3215. Retry 0: TIMEOUT
  3216. Retry 0: TIMEOUT
  3217. etc etc, forever. Trying sz -e on the far end, I get:
  3218. Retry 0: Bad CRC
  3219. Retry 0: Garbage count exceeded
  3220. Retry 0: Garbage count exceeded
  3221. Retry 0: Garbage count exceeded
  3222. Retry 0: Garbage count exceeded
  3223. Retry 0: Garbage count exceeded
  3224. Retry 0: Garbage count exceeded
  3225. Retry 0: Garbage count exceeded
  3226. ...
  3227. Retry 0: Got ERROR
  3228. Retry 0: Bad CRC
  3229. Retry 0: Got ERROR
  3230. Retry 0: Got ERROR
  3231. lrz: xxufio.c removed.
  3232. So apparently it's not a matter of escaping. Trying some other stuff, I
  3233. caught the command-line problem in the act:
  3234. lrz: garbage on commandline
  3235. Try `lrz --help' for more information.
  3236. Debug log shows:
  3237. cksplit result[lrz]=1
  3238. cksplit result[-v]=2
  3239. exec_cmd arg[lrz]=0
  3240. exec_cmd arg[-v]=1
  3241. exec_cmd arg[]=2
  3242. An empty string at the end instead of a null pointer. I really do not see
  3243. any way that could happen, but rather than dig into cksplit() again after
  3244. all these years I added a test for this in exec_cmd(), which, of course
  3245. after adding it, never encountered this behavior again.
  3246. Fiddled with pty buffer size again. Made it 512 bytes instead of 24K.
  3247. Zmodem downloads are the same (Rety 0: TIMEOUT, over and over). But I don't
  3248. see what the problem is -- every time we receive n bytes from the net, we
  3249. write n bytes successfully to the pty and there are no errors. But it also
  3250. looks like the remote sender is sending the file header over and over
  3251. because it's not receiving an acknowledgment. If we're not losing data,
  3252. then maybe it's a transparency problem.
  3253. Tried uncommenting the TIOCblah stuff I commented out before. Now instead
  3254. of only timeouts I get:
  3255. lrz waiting to receive.Retry 0: Bad CRC
  3256. Retry 0: Got ERROR
  3257. Retry 0: Bad CRC
  3258. Retry 0: Got ERROR
  3259. Retry 0: Bad CRC
  3260. Retry 0: Got ERROR
  3261. Retry 0: TIMEOUT
  3262. which is odd because the TIOCREMOTE ioctl failed with errno 14, EFAULT,
  3263. bad address, which should indicate it had no effect. We're still receiving
  3264. data from the remote in tiny chunks (from 12 to 65 bytes), apparently the
  3265. same stuff (file header), and writing them to the pty successfully but
  3266. nothing...
  3267. Looked at cloning ttpkt() for the pty, but these stupid routines use global
  3268. tty mode structs so it's not going to be easy.
  3269. Well, we got exactly nowhere today, but I think I'll leave stderr as it is
  3270. so users will see some feedback; no reason not to.
  3271. WHY DO KERMIT DOWNLOADS WORK AND ZMODEM NOT?
  3272. Is it 8-bit transparency? Up til now I've been testing with text files.
  3273. If I try to download a binary what happens? Fails after 99 seconds. Packet
  3274. log from the far end shows that as soon as the first packet containing 8-bit
  3275. data is sent, everything stops. At least I got one of these:
  3276. 17:23:56.475 exec_cmd arg[gkermit]=0
  3277. 17:23:56.475 exec_cmd arg[-qr]=1
  3278. 17:23:56.475 exec_cmd arg[]=2
  3279. 17:23:56.475 exec_cmd SUBSTITUTING NULL=2 <-- the code I just added
  3280. Doing this again shows the same thing on the near end. All the 7-bit-only
  3281. packets are sent and acknowledged OK. Three 8-bit data packets arrive and
  3282. nothing else happens after that. This is with G-Kermit.
  3283. The same thing happens with C-Kermit receiving. But if I change C-Kermit's
  3284. .kermrc to turn off streaming and use a short packet length:
  3285. The transfer works, even though it's sending 8-bit bytes. So the problem is
  3286. not 8-bit data after all, per se. Facts:
  3287. . Kermit can receive streaming transfers of 7-bit files.
  3288. . Kermit can not receive streaming transfers of 8-bit files.
  3289. . Kermit can receive nonstreaming transfers of 8-bit files with short packets.
  3290. . Kermit can receive nonstreaming transfers of 8-bit files with 1K packets.
  3291. . Kermit can receive nonstreaming transfers of 8-bit files with 4K packets.
  3292. So it's the combination of streaming and 8-bit data? 12 Jan 2007.
  3293. As a test I made a new routine pty_make_raw() that does cfmakeraw() (a
  3294. nonportable "POSIX-like" function known to be used on ptys in applications
  3295. that do approximately what we're attempting). Results:
  3296. Solaris: errno 25 - inappropriate ioctl for device.
  3297. This happens even when we try to get the terminal modes with tcgetattr(),
  3298. which is completely nuts. We pass it the file descriptor of the pty master,
  3299. which is supposed to work. But in Mac OS X, there are no errors. But
  3300. downloads still don't work; lots of errors but the pattern is different.
  3301. Using a very small buffer:
  3302. Retry 0: Bad CRC
  3303. Retry 0: Garbage count exceeded
  3304. Retry 0: Garbage count exceeded
  3305. Retry 0: Got TIMEOUT
  3306. Retry 0: TIMEOUT
  3307. Retry 0: Bad CRC
  3308. Retry 0: Bad CRC
  3309. Retry 0: Garbage count exceeded
  3310. Retry 0: Garbage count exceeded
  3311. Retry 0: TIMEOUT
  3312. Retry 0: Got ERROR
  3313. Retry 0: TIMEOUT
  3314. Retry 0: Garbage count exceeded
  3315. Retry 0: Garbage count exceeded
  3316. Retry 0: Bad CRC
  3317. Using a bigger buffer:
  3318. Retry 0: Garbage count exceeded
  3319. Retry 0: Garbage count exceeded
  3320. Retry 0: Garbage count exceeded
  3321. Retry 0: Garbage count exceeded
  3322. Retry 0: Garbage count exceeded
  3323. Retry 0: Garbage count exceeded
  3324. (several screensful)
  3325. Various other combinations... Nothing seems to work.
  3326. Insight: telnetd does exactly what we want to do, sort of.
  3327. But it uses TIOCPKT, so every time it reads from pty, it receives
  3328. one control byte and then the data bytes, which would complicate our
  3329. buffering scheme considerably. Anyway the TIOCPKT ioctl() fails on
  3330. Mac OS X with 14 "Bad address".
  3331. Also see: snoopserver.c (found in Google). It seems to do things in a
  3332. slightly different way -- it sets stdout to raw and then dups it to the
  3333. slave side of the pty?
  3334. Maybe it's a mistake to use the ckupty.c routines. They are designed for
  3335. creating and accessing an interactive session. Maybe just copy one of the
  3336. other programs.
  3337. 18 Jan 2007. Tried going back to blocking rather than nonblocking reads
  3338. to see if it would make a difference, after all the other changes. Nope.
  3339. OK, let's look at some of these other programs...
  3340. snoopserver.c. I don't know exactly what this is or where it's from or what
  3341. platform it runs on and there are no comments to speak of, but it does
  3342. approximately what ttptycmd() does. To get a pty it uses openpty():
  3343. if (openpty(&pty, &tty, NULL, NULL, NULL) == -1)
  3344. then creates a fork. In the fork, it closes the pty (master) and
  3345. manipulates the modes of the tty (slave), dups tty to be stdio, and then
  3346. doex execv() on the command. Meanwhile the upper fork closes the tty
  3347. (slave), gets the attributes of stdin, using atexit() to have them
  3348. automatically restored on exit. Then it sets stdin to raw mode and enters
  3349. the select() loop on stdin, the pty master, and the net. It uses regular
  3350. blocking reads. It does not use TIOCPKT or anything like it.
  3351. openpty() is supported on: Linux, Mac OS X, NetBSD, FreeBSD, ...
  3352. openpty() is NOT supported on: Solaris, HP-UX, ...
  3353. 1. Try copying the pty code, but keep everything else the same.
  3354. I did this; it compiles and starts OK, upper fork (ttptycmd) debug log shows
  3355. no errors, but nothing happens. Logs show that the Kermit program that is
  3356. started in the subfork seems to die as soon as it reaches eof on its init
  3357. file. The good news, at least, is that select() doesn't report report that
  3358. the pty is ready to be read. Clearly the file descriptors aren't being
  3359. assigned as expected, or as before.
  3360. In ckupty.c getptyslave() dup2's the slave fd to 0 and 1. The new code
  3361. does exactly the same thing. Debug log makes it look like the forked kermit
  3362. is not receiving its command line. But now I'm not even sure that the
  3363. forked kermit started at all. ps from another terminal doesn't show it.
  3364. 19 Jan 2007: Noticed that in snoopserver, the select() calls use standard
  3365. input and output file descriptors, rather than the pty master. Made that
  3366. change... In doing that I had to look at every file descriptor in every
  3367. line of code and discovered a couple mistakes, fixed them, put back the
  3368. original code but with the fixes, tried it, but no change; can upload OK but
  3369. still can't download with Zmodem without lots of errors and ultimate
  3370. failure. Going back to the alternative version and trying to get the the
  3371. file descriptors sorted out, now it appears that the external Kermit program
  3372. never even starts in the lower fork. After a bit more fiddling I sort that
  3373. out, but now when the lower Kermit program goes to open "/dev/tty" it gets
  3374. errno 6 "Device not configured". Forcing it to use stdio with "-l 0", it
  3375. gets past this and actually sends its first packet. But the Kermit on top
  3376. reads nothing from the pty.
  3377. Next, I change the pty fd from STDIN_FILENO and STDOUT_FILENO to slavefd.
  3378. No difference. Next I comment out the dup2() calls. This time I get some
  3379. action. The transfer starts, but only one packet comes. Log shows that
  3380. the lower Kermit sends its S packet. The upper Kermit receives the ACK
  3381. but the lower Kermit never gets it. The write to the pty succeeds, no
  3382. error. Different combinations give different results. If write to master
  3383. and read from the slave, I get packets in both directions but tons of
  3384. errors.... This happens only if I comment out the dup2()'s.
  3385. 25 Jan 2007: After leaving it sit for a while, and realizing that what I'm
  3386. trying to do has to be possible because so much other software does the same
  3387. thing (e.g. Telnet servers), I put things back to how they were originally
  3388. -- the upper fork (Kermit) uses the master and the lower fork the slave.
  3389. The upper fork puts the master in raw mode, the lower fork puts the slave in
  3390. raw mode. The lower fork dup2's the slave fd to stdin/out. Send file in
  3391. remote mode using external Kermit: works OK but select() times out at the
  3392. end. This means that the self-contained pty code in ttptycmd() is sorted
  3393. out -- all the file descriptors go to the right place, etc, and now we can
  3394. use this routine as a testbed, rather than the original ckupty.c-based one.
  3395. But send with lsz, csz, and regular rz: Nothing happens, times out after 0
  3396. bytes of i/o. Once again, Kermit works, Zmodem doesn't. The reason for
  3397. running Zmodem in a pty is so its i/o will work as it does on a terminal,
  3398. no matter how it may fiddle the file descriptors. So why don't we see a
  3399. single byte come out?
  3400. Commenting out pty_make_raw(), I get a successful Zmodem send using lsz.
  3401. csz manages to get the filename across, but then gets stuck. regular sz, on
  3402. the other hand, works perfectly. Testing csz by itself (not under Kermit),
  3403. I see it fails in exactly the same way ("Got phony ZEOF", etc). OK, forget
  3404. crzsz.
  3405. OK, let's move to local mode over a Kerberized Telnet connection...
  3406. Uploading (sending) with external Kermit protocol... works.
  3407. Downloading (receiving) with external Kermit protocol... works.
  3408. Uploading with sz... works.
  3409. Downloading with lrz... Gets tons of errors and fails.
  3410. Running pty_make_raw() on the slave but not on the master: no difference.
  3411. Running pty_make_raw() on the master but not on the slave: no difference.
  3412. Back where we started... Either:
  3413. . Zmodem is overdriving the pty, no matter what modes we put it in.
  3414. . It's a transparency problem.
  3415. Theoretically we should be able to test these by using different sz switches:
  3416. -q: quiet (should always use this)
  3417. -e: escape all control characters
  3418. -B n: Buffer n bytes (rather than whole file)
  3419. -L n: Packet length
  3420. -l n: Frame length (>= packet length)
  3421. -w n: Window size
  3422. -4: 4K blocksize (doesn't help)
  3423. -q by itself doesn't help.
  3424. -q -e, this one worked but still got about 100 errors and was very slow.
  3425. -q -e -l 200 -L 100, failed fast and bad.
  3426. -q -e -w 1. Failed quickly.
  3427. -q -e -w 1 -B 100. Eventually failed.
  3428. -q -w 1, Eventually failed.
  3429. -q -l 1024, this gets much more errors, definitely need -e.
  3430. -q -e -l 1024, got pretty far before failing.
  3431. -q -e -w 1 -l 1024, also got pretty far before failing.
  3432. -q -e, this one got farthest of all, about 48K, before getting errors.
  3433. In the latter combinations that work somewhat better, we always get up to
  3434. 16K, or 32K, or 48K, before the errors start coming out and piling up.
  3435. Sometimes the errors are recoverable and we receive as much as 300K
  3436. successfully before giving up.
  3437. Now that we have data flowing pretty well (but not well enough), tried
  3438. reinstating pty_make_raw(), but it hurt more than helped.
  3439. As a sanity check, I tried transferring from the same host over the same
  3440. kind of connection (Kerberized Telnet) directly to K95's built-in Zmodem
  3441. protocol, and that worked fine. So the problem is definitely in the pty.
  3442. Or more precisely, where Kermit writes incoming net data to the pty master.
  3443. 26 Jan 2007: Tried changing the size of the net-to-pty buffer from 24K to
  3444. 1K. Result: total failure. Set both buffers to 1K. Still total failure.
  3445. Set both to 4K: now we get about 45K of data, then failure. Put them both
  3446. back to 24K, still fails totally -- the same code that worked pretty well
  3447. yesterday. Actually, no downloads work, not even Kermit, not even of
  3448. text files.
  3449. 27 Jan 2007: Since I have not been able to find a way to make ptys work for
  3450. this, I made a third copy of this routine, this time using pipes instead of
  3451. ptys. The disadvantage here is that if the external protocol does not use
  3452. stdio, the pipes won't work, but one thing a time...
  3453. Inferior Kermit starts in lower fork, but when it tries to send its first
  3454. packet it gets errno=9 EBADF, Bad File Descriptor. Substituting G-Kermit as
  3455. the external protocol, which is simpler, reveals that the problem is that
  3456. the external protocol gets errors when it tries to manipulate the its stdio
  3457. file descriptors with ioctls, etc; these are not valid for a pipe. The pipe
  3458. mechanism itself works. If I take out the test for ttpkt() failing in
  3459. gkermit, the file transfer works OK. Trying Zmodem... Sending works OK;
  3460. receiving works a lot better than with ptys (it got 360K into the file
  3461. before failing). Making the buffers smaller, doesn't help.
  3462. I'm starting to wonder if the problem might be in my buffering code, rather
  3463. than in the pty or pipe interface... Try making a version that does
  3464. single-character reads and writes.
  3465. This one reads the first packet from the lower Kermit and sends it. It is
  3466. recognized by the other Kermit, which sends an ACK. We see the ^A of the
  3467. ACK, but then select() times out on the next character -- OF COURSE: because
  3468. at a lower level, it has already been read. We have to check the myread
  3469. buffer, and then call select() only if it's empty. Making this change:
  3470. . SEND with G-Kermit works (but very slowly).
  3471. . SEND with lsz works but gets a lot of errors, eventually succeeds.
  3472. Let's work our way back... With the same changes to the buffered pipe version:
  3473. . SEND with G-Kermit/streaming works (fast).
  3474. . SEND with lsz works too (fast), but we get gubbish at the end.
  3475. . RECEIVE with Kermit fails because "/dev/tty is not a terminal device".
  3476. . RECEIVE with rsz... lots of errors ("garbage count exceeded") but succeeded.
  3477. But maybe now we're seeing pipe artifacts, so going back one more step to
  3478. the version that gets its own pty and starts its own fork:
  3479. . SEND with G-Kermit/Streaming works (fast) but select() times out at the end.
  3480. Another breakthrough: Moved the write pieces to below the read pieces. This
  3481. is what was preventing the buffer reset code from working -- with the writes
  3482. done before the reads, we never catch up and can never reset the buffers.
  3483. . SEND with G-Kermit/streaming works (fast) (but there's a pause at the end)
  3484. . SEND with lsz works (fast) (but there's a pause at the end)
  3485. . RECEIVE with rsz... lots of errors ("garbage count exceeded") and fails.
  3486. . RECEIVE with Kermit -- nothing happens (it thinks it succeeded), then we
  3487. reconnect, terminal sees S packet and goes into autodownload
  3488. From the log it looks like ttpkt() fails in the lower Kermit. Switching
  3489. this with the hacked G-Kermit... it gets "transmission error on reliable
  3490. link". Tried again with real Kermit below, this time with "-l 0" and not
  3491. streaming. This was actually working, but slowly, I don't see any NAKs in
  3492. the packet log, but then select() timed out.
  3493. 28 Jan 2007: Restored both the calls to pty_make_raw():
  3494. . SEND with C-Kermit streaming works, but slow (54Kcps)
  3495. . Ditto, but with debugging off -- hangs forever.
  3496. . Ditto, but using G-Kermit instead of C-Kermit -- also hangs forever.
  3497. Backed off on calling pty_make_raw(). Same thing.
  3498. Reduced size of net-to-pty buffer. Same thing.
  3499. 15 Feb 2007... Decided to give up on this and publish it as is, in hopes
  3500. that somebody with more experience with ptys can make it work, because I'm
  3501. just going in circles. So today I just have to get the code into shape so
  3502. people could choose among the three alternative routines. The second one,
  3503. yttyptycmd(), is the one that uses openpty(), which is not portable, so it
  3504. can be enabled only for Mac OS X, NetBSD, FreeBSD, and Linux, or by also
  3505. defining HAVE_OPENPTY at compile time. Anyway, if you build Kermit in the
  3506. normal way, you get the regular behavior -- ttruncmd() is used to execute
  3507. external protocols. If you build it with -DXTTPTYCMD, you get the first
  3508. version of ttptycmd(); with -DYTTPTYCMD the second, and with -DZTTPTYCMD the
  3509. third.
  3510. (Then some interruptions, then...)
  3511. From Jeff, fix hostname comparison in X.509 certificate checking to work
  3512. right in the case of names that contain no periods. dNSName_cmp(): cl_ssl.c,
  3513. 21 Feb 2007.
  3514. John Dunlap noticed some strange behavior when transferring files between
  3515. home base and the EM-APEX oceanographic floats via satellite... long story,
  3516. but every so often the transfer would get stuck for a long time, and it
  3517. happened only when C-Kermit was sending a file and received two or more
  3518. packets (Ack or Nak) back to back from the float. Years ago I added some
  3519. lookahead code to ttinl() to clear the input buffer of any interpacket junk
  3520. so that, in the windowing case, we wouldn't be tricked next time around into
  3521. thinking a packet was waiting to be read when there wasn't. The code, which
  3522. has been there for a while, was a bit fractured; luckily, it would be
  3523. executed only when the debug log was active so it didn't have much effect.
  3524. The problem was that if the SOP came immediately after the EOP, it could be
  3525. missed because the loop read the next character before checking the current
  3526. one. Fixed by rearranging the loop. Also I changed it so it would execute
  3527. in all cases, not only when the debug log was active. Also, cleaned up a
  3528. bunch of confusing #ifdefs and removed some chunks that had been commented
  3529. out for years, decades maybe. ttinl(): ckutio.c, 21-22 Feb 2007.
  3530. Added NOW keyword info to HELP DATE, plus a tip about how to convert to UTC;
  3531. suggested by Arthur Marsh. ckuus2.c, 22 Feb 2007.
  3532. When an FTP client sends NLST to the server and no matching files are found,
  3533. the server is supposed to respond with an error message on the control
  3534. channel and nothing on the data channel. However it seems that at least one
  3535. server sends the error message back on the data channel, as if it were a
  3536. filename ("/bin/ls: blah: No such file or directory"), and on the control
  3537. channel there is no error indication ("226 ASCII Transfer complete"). At
  3538. this point remote_files() has a listfile and, if a match pattern was given,
  3539. it looks through list to see if any of the lines match the given filename,
  3540. e.g. "blah". This makes FTP CHECK give false positives. The problem
  3541. (diagnosed by Jeff) is that the match pattern was not given in this case, so
  3542. it takes some random default action, resulting in the spurious success
  3543. return. Fixed by using the user's string as the pattern. Not tested,
  3544. however, since I don't have access to a server that behaves this way.
  3545. ckcftp.c, 22 Feb 2007.
  3546. If an external-protocol file transfer fails, don't print Kermit-specific
  3547. hints. ckuus5.c, 22 Feb 2007.
  3548. One more time with ttinl(). Got rid of the "csave" junk, which never could
  3549. have worked (which is no doubt why it was in a debugging section). The
  3550. problem was that saving the beginning of the next packet locally did not
  3551. synchronize with the buffer clearing (ttflui()) done at a higher level,
  3552. between calls to ttinl(). So now, the lookahead code, if it finds the
  3553. beginning an as-yet unread packet, puts it back at the head of the input
  3554. queue. This way, if the protocol engine clears the input buffer, it will
  3555. get the whole packet, not just the part after the SOH. ckutio.c, 24 Feb 2007.
  3556. From Steven M Schweda, Saint Paul, MN: adaptation of large file support to
  3557. VMS (it was already possible to transfer large files in VMS C-Kermit but the
  3558. file-transfer display and statistics were wrong). And a minimal adaptation
  3559. of the FTP client to VMS -- no RMS, no special VMS file stuff, Stream_LF and
  3560. binary files only, developed and tested only with UCX. SSL/TLS is
  3561. supported. The source-code changes are minimal; most have nothing to do
  3562. with VMS, but with header files, prototypes, and data types (e.g. ftp_port
  3563. int rather than short, various signed/unsigned conflicts) to shut up
  3564. compiler warnings. Some of these could be dangerous in terms of
  3565. portability; I've marked them with /* SMS 2007/02/15 */. ckcfns.c,
  3566. ckcnet.h, ck_ssl.h, ckuus3.c, ckuus4.c, ckvfio.c, ckcftp.c, ckvker.mms
  3567. (which was rewritten to actually reflect the source module dependencies),
  3568. ckvker.com (also heavily modified). ckvker.com (the "makefile" for VMS
  3569. C-Kermit) now includes "F" and "I" option flags for the large File and
  3570. Internal ftp features, plus better handling of Vax/Alpha/IA64 distinction.
  3571. 26 Feb 2007.
  3572. Changed NetBSD targets to include -DHAVE_OPENPTY and -lutil, so they
  3573. can use openpty(). makefile, 26 Feb 2007.
  3574. Built on Solaris without and with SSL OK.
  3575. Built on NetBSD with Kerberos 5, OK.
  3576. Built on Mac OS X 10.4, regular version, OK.
  3577. Built on Mac OS X 10.4 with SSL and Kerberos 5, OK.
  3578. On VMS 7.2-1/Alpha with MultiNet 4.4A-X...
  3579. 'CC' 'CCOPT' KSP:ckuus3
  3580. %DCL-W-TKNOVF, command element is too long - shorten
  3581. \CKUUS4.OBJ "'CC' 'CCOPT' KSP:ckuus4" "KSP:ckuus4.c KSP:ckcsym.h KSP:ckcdeb.h
  3582. KSP:ckclib.h" "KSP:ckcasc.h KSP:ckcker.h KSP:ckcnet.h KSP:ckvioc.h"
  3583. "KSP:ckctel.h KSP:ckuusr.h KSP:ckucmd.h KSP:ckuver.h" "KSP:ckcxla.h
  3584. KSP:ckuxla.h KSP:ckcuni.h KSP:ckuath.h"
  3585. The new rule for ckuus4.c was too long. I removed one file from the
  3586. dependency list (ckcxla.h, which will probably never change again) and that
  3587. made it OK. Built Nonet and Net versions OK, but this is without the new
  3588. stuff.
  3589. "make f" (large-file support) on VMS 7.2-1...
  3590. 'CC' 'CCOPT' KSP:ckuus4
  3591. if (CKFSEEK(fp,(CK_OFF_T)j,SEEK_CUR) != 0) {
  3592. ........................^
  3593. %CC-I-IMPLICITFUNC, In this statement, the identifier "fseeko" is implicitly
  3594. declared as a function.
  3595. Ditto for ftello and fseeko in various other places, and then fseeko and
  3596. ftello come up up undefined at link time.
  3597. The rule for ckcftp in "make i" (Internal FTP support) had the same problem.
  3598. I removed ckcxla.h from its dependency list too, but "utime" comes up
  3599. undeclared at compile time and undefined at link time.
  3600. Verdict: neither one of the two new features can be used in VMS 7.2 or
  3601. earlier, but the code still builds OK if you don't ask for them.
  3602. VMS 8.3 on IA64... Can't build anything:
  3603. %MMS-F-BADTARG, Specified target (WERMIT) does not exist in description file
  3604. 27 Feb 2007: Changed CKVKER.COM to keep all its dependencies but use a
  3605. shorter logical name (Steven M Schweda). The problem on VMS 8.3 is that MMS
  3606. now supports case-sensitive file systems, and so it can't find anything.
  3607. Workaround: bypass MMS (include "m" in P1). With this, "@ckvker.com ifm"
  3608. builds OK on HP Testdrive, but I can't test the new features since outbound
  3609. connections are not allowed there. As for fseeko(), ftello(), and utime(),
  3610. they simply are not available prior to VMS 7.3. It would probably be a good
  3611. idea to test for this in CKVKER.COM, but actually it is possible to install
  3612. newer C's and CRTLs on older VMS versions, so don't stand in their way.
  3613. 28 Feb 2007: With additional changes from SMS, and then some further
  3614. adjustments, I was able to build the FTP version on VMS 7.2-1. First I
  3615. tested it with GET of a binary file, but it transferred it in text mode.
  3616. After a few more attempts with PUT and GET, it crashed with "floating/decimal
  3617. divide by zero" in ckscreen, ckuusx.c line 27859. Of course, that's the
  3618. listing line, not the source line, and I don't have a listing.
  3619. To get a listing, I deleted CKUUSX.OBJ and then did:
  3620. $ make i "" "" "/LIST"
  3621. Surprisingly, it recompiled everything.
  3622. Anyway, the divide by zero happened in a section of code where the divisor
  3623. was not checked, but it was a section of code we should not have been
  3624. executing at all, since the file-transfer display was fullscreen, and this
  3625. was in the "brief" section. Anyway, I added the needed check. Again, it
  3626. recompiles everything. Maybe there's no MMS on grumpy -- right, there isn't.
  3627. ANYWAY... Try to GET a binary file like this:
  3628. binary
  3629. ---> TYPE I
  3630. 200 Type set to I.
  3631. get gkermit
  3632. ---> TYPE A
  3633. 200 Type set to A.
  3634. ---> SIZE gkermit
  3635. 550 gkermit: file too large for SIZE.
  3636. GET gkermit (text) (-1 bytes)---> TYPE A
  3637. Anyway... "get /binary gkermit" downloads it, seemingly correctly (the byte
  3638. count is right).
  3639. But "put /binary gkermit.;1" results in a 0-length GKERMIT file being sent.
  3640. Here's the debug log:
  3641. FTP PUT gnfile[DISK$MSA4:[C.FDC.NET]gkermit.;1]=1
  3642. ftp putfile flg[DISK$MSA4:[C.FDC.NET]gkermit.;1]=0
  3643. zltor fncnv[DISK$MSA4:[C.FDC.NET]gkermit.;1]=-1
  3644. FTP PUT nzltor[GKERMIT]
  3645. zfnqfp 1[DISK$MSA4:[C.FDC.NET]gkermit.;1]=675
  3646. zfnqfp 2[DISK$MSA4:[C.FDC.NET]GKERMIT.;1]=31
  3647. zfnqfp 3[DISK$MSA4:[C.FDC.NET]GKERMIT.;1]=31
  3648. zrelnam result 2[gkermit.;1]
  3649. ftp sendrequest restart[DISK$MSA4:[C.FDC.NET]gkermit.;1]=0
  3650. openi name[DISK$MSA4:[C.FDC.NET]gkermit.;1]
  3651. openi sndsrc=-1
  3652. openi file number=2
  3653. zopeni[DISK$MSA4:[C.FDC.NET]gkermit.;1]=2
  3654. zopeni fp=0
  3655. chkfn=2
  3656. chkfn return=0
  3657. zopeni fixed file format - using blk I/O
  3658. zopeni binary flag at open=1
  3659. zopeni ifile_bmode=1
  3660. zopeni binary=1
  3661. zopeni RMS operations completed ok
  3662. openi zopeni 1[DISK$MSA4:[C.FDC.NET]gkermit.;1]=1
  3663. ftpcmd cmd[PASV]
  3664. FTP SENT [PASV]
  3665. FTP RCVD [227 Entering Passive Mode (166,84,1,2,233,216)]
  3666. initconn connect ok
  3667. FTP SENT [STOR GKERMIT]
  3668. FTP RCVD [150 Opening BINARY mode data connection for 'GKERMIT'.]
  3669. doftpsend2 ftpcode[STOR]=150
  3670. Here is where the file is supposed to be read and sent but there is nothing
  3671. in the log between the "doftpsend2 ftpcode" line and the following line.
  3672. rftimer status=1
  3673. gftimer status 1=1
  3674. gftimer status 2=1409025
  3675. gftimer status 3=1409025
  3676. gftimer s[0.000000]
  3677. zclose n=2
  3678. chkfn=2
  3679. chkfn return=1
  3680. zclose ZIFILE RMS operations completed ok
  3681. ftp getreply lcs=0
  3682. ftp getreply rcs=-1
  3683. ftp getreply fc=0
  3684. FTP RCVD [226 Transfer complete.]
  3685. ftp getreply[226 Transfer complete.]=2
  3686. doftpsend2 ok=0
  3687. Everything is OK up until we go to send the file, then it behaves as if we
  3688. got EOF immediately and so closes the data connection, and reports success;
  3689. an empty copy of the file is left on the far end.
  3690. Starting over with a text file.... PUT LOGIN.COM gets another divide by
  3691. zero. But it happened in the code I just fixed, which is impossible. Swell.
  3692. I recompiled everything and this time the upload worked, and downloading it
  3693. again worked too.
  3694. But a binary file still can't be uploaded. Trying to upload a text file
  3695. after doing this seems to succeed (reports the right number of bytes sent)
  3696. but nothing appears on the far side.
  3697. SUMMARY:
  3698. To download a text file: GET /ASCII blah.txt (/ASCII is optional)
  3699. To download a binary file: GET /BINARY blah.bin (/BINARY is required)
  3700. To upload a text file: PUT blah.txt (/ASCII switch not needed)
  3701. To upload a binary file: PUT /BINARY blah.bin (doesn't work)
  3702. Problems:
  3703. . Why doesn't BINARY "stick"?
  3704. . Why don't binary uploads work?
  3705. The culprit seems to be the VMS version of zxin(). In the FTP module,
  3706. zxin() is called only when sending binary files. In VMS, zxin() is just
  3707. a front end for C-Library fread(). It probably needs to do just do
  3708. zminchar() in a loop, like binary mode does, but calling zzout instead
  3709. of xxout. Or something like that. FINISH THIS TOMORROW (debug on grumpy).
  3710. 2 Mar 2007: New logs from John Dunlap.
  3711. ema-1636-log-0175.dbg: C-Kermit uploads a short file. It receives an Ack for
  3712. the Z packet it just sent, tailgated by the beginning of a Nak for the next
  3713. packet. When the second SOH is encountered, it is put back in the myread
  3714. queue. Then the protocol engine, to which we return the Ack, says, "I have
  3715. the packet I wanted so I'm clearing the buffer", and away go the first two
  3716. bytes of the Nak from the myread buffer. Then, having just received the Ack
  3717. of our Z packet, we send our B, and go to read the reply. in_chk finds 0 in
  3718. the myread buffer (which we just cleared) and 6 waiting to be read from the
  3719. comms channel, which it does, obtaining the remaining 6 bytes of the Nak,
  3720. which it properly discards. (The reason this is proper is that, having
  3721. already received the Ack for the last packet it sent, no Ack or Nak that
  3722. arrives subsequently -- in the non-windowing case -- could possibly affect
  3723. what it does next.) Since it hasn't yet found a good packet, it keeps
  3724. reading, and now it finds the Ack to the B, as soon as it showed up. This
  3725. is how it's supposed to work. No time was lost because of anything that
  3726. C-Kermit did.
  3727. ema-1636-log-0174.dbg: C-Kermit uploads a short file. It sends Data packet
  3728. #3 and receives the Ack followed immediately by the first 3 bytes of a Nak
  3729. for packet 4. When it gets to the SOH of the second packet, it pushes it
  3730. back in the queue. Again, input() flushes the input buffer (myread queue
  3731. and device buffer). C-Kermit detects EOF on the file it is sending, and
  3732. sends the Z packet. Then it reads the remaining bytes of the Nak,
  3733. which it discards, and then it finds the Ack for Z which comes in 23 seconds
  3734. later, sends the B, gets a Nak for the B, sends the B again, gets the Ack
  3735. for the B 4 seconds later, and done. Again, it's working right and losing
  3736. no time.
  3737. The question remains: what would happen if the protocol engine did not clear
  3738. the buffer? Would ttinl() retrieve all packets in sequence even when they
  3739. come back to back? To test this, I had C-Kermit send a file using 30 window
  3740. slots and observed the stream of Acks in the reverse direction:
  3741. HEXDUMP: mygetbuf read (16 bytes)
  3742. 01 25 23 59 2f 52 39 0d | 01 25 24 59 2b 26 31 0d .%#Y/R9. .%$Y+&1.
  3743. ttinl lookahead my_count=9
  3744. ttinl lookahead removed=^M
  3745. ttinl lookahead pushback SOP=^A
  3746. HEXDUMP: ttinl got (7 bytes)
  3747. 01 25 23 59 2f 52 39 | .%#Y/R9
  3748. RECEIVE BUFFERS:
  3749. buffer inuse address length data type seq flag retries
  3750. 0 1 29212 9667 0 Y 3 0
  3751. [%#Y]
  3752. ...
  3753. in_chk my_count=8
  3754. ...
  3755. ttinl lookahead my_count=1
  3756. ttinl lookahead removed=^M
  3757. HEXDUMP: ttinl got (7 bytes)
  3758. 01 25 24 59 2b 26 31 | .%$Y+&1
  3759. RECEIVE BUFFERS:
  3760. buffer inuse address length data type seq flag retries
  3761. 0 1 29212 9667 0 Y 4 0
  3762. [%$Y]
  3763. Here we can see that the pushed-back SOH was properly retrieved next time
  3764. around, and the tailgating Ack was not lost. This scenario repeats itself
  3765. 212 times in the log, and there are no screwups.
  3766. Back to VMS FTP... The problem with sending binary files is that zxin()
  3767. uses C-Library fopen()/fread() instead of RMS, so it can't access the input
  3768. file, which was opened by zopeni(), which is totally RMS-ified in VMS
  3769. C-Kermit. For VMS only, I replaced the zxin() loop by a zminchar() loop
  3770. like the one used in text mode, except without the character set or
  3771. record-format conversion. Tested by PUT /BINARY of some binary files, which
  3772. worked fine. ckcftp.c, 2 Mar 2007.
  3773. Next problem... VMS C-Kermit ftp client sending binary files in text mode.
  3774. Variation 1: We just send the file. zopeni() is supposed to detect that
  3775. it's a binary file and automatically set the mode. And it does:
  3776. zopeni fixed file format - using blk I/O
  3777. zopeni binary flag at open=0
  3778. zopeni ifile_bmode=1
  3779. zopeni binary=0
  3780. zopeni autoswitch from TEXT to BINARY
  3781. zopeni RMS operations completed ok
  3782. but then in gnfile():
  3783. if (!server || (server && ((whatru & WMI_FLAG) == 0)))
  3784. binary = gnf_binary; /* Restore prevailing transfer mode */
  3785. Well, since VMS sets text/binary mode automatically when sending files,
  3786. this code can (and should) be skipped in VMS. gnfile(): ckcfns.c, 2 Mar 2007.
  3787. Variation 2: BINARY or SET FILE TYPE BINARY doesn't force binary mode. But
  3788. SET FTP TYPE BINARY does. But BINARY does indeed call doftptyp() so what's
  3789. the problem? We do indeed set ftp_typ to 1 but it gets reset somewhere
  3790. before we call zopeni(). But then zopeni() puts it back to 1. Tracing
  3791. through a transfer, it looks like all of this works right, it's only that
  3792. the file transfer display says TEXT when the transfer is really in binary
  3793. mode. This is because screen() is called before openi(). I wonder if we
  3794. can call scrft() from the ftp module... No, that would be too easy. OK,
  3795. sendrequest calls openi() and sets the file mode; putfile() calls
  3796. screen(SCR_FN), which prints the transfer mode. But putfile calls
  3797. sendrequest() after it puts up the screen that says the file type. So it
  3798. looks like sendrequest() has to call screen(SCR_FN) again if it changes the
  3799. file type. OK, that did it. ckuusx.c, ckcftp.c, 2 Mar 2007.
  3800. The BINARY and TEXT (ASCII) commands do not inhibit automatic type switching
  3801. in VMS. They don't in Unix either. They never have. Should they? I think
  3802. so, otherwise what good are they? Plus we want the Kermit FTP client to
  3803. behave like the others. I added code for this but it doesn't work, due to
  3804. the layers and layers of text/binary detection and switching and
  3805. if-this-but-then-if-that... Anyway, no harm done. The normal rule is:
  3806. when you PUT a file, Kermit figures out on a per-file basis whether to use
  3807. text or binary mode unless you include a /TEXT (/ASCII) or /BINARY switch
  3808. in the PUT (or MPUT) command. ckuus[r3].c, ckcftp.c, 2 Mar 2007.
  3809. Wed Mar 7 16:21:13 2007 WROTE SHORT TEST PROGRAM for ttruncmd (the openpty
  3810. version) on Mac OS X. On dulce: ~/kermit/ttpty.c / ttpty.sh. It starts the
  3811. external protocol in the lower fork. The command to run is a command-line
  3812. argument. Sending and receiving files with Kermit works OK. But again, the
  3813. standalone program totally fails when I use sz or lsz as the external
  3814. protocol. So it looks like we can rule out any environmental effects of
  3815. running the code inside C-Kermit.
  3816. Mon Mar 12 16:52:20 2007: Put some effort into making ttpty.c more useful;
  3817. added a debug log. Found that for some reason, at least on Mac OS X,
  3818. select() always timed out at the the end. I added a SIGCHLD alarm and that
  3819. seems to handle the fork exit condition very nicely. Now we can send (say)
  3820. a 3MB file at good speed on Ethernet (1Mcps) considering the debugging, etc,
  3821. and it terminates instantly. But when sending a file into ttptycmd (with
  3822. "gkermit -r"), things go wrong at the end -- the Z packet is never
  3823. acknowledged. This is reproducible. Maybe this is a good lead.... The log
  3824. shows that select() timed out, even though the gkermit fork had not yet
  3825. exited (or finished). It looks like gkermit sent the Ack, ttpty.c read it
  3826. from the pty and sent it out the net:
  3827. 0003: read pty=8 <-- read Ack from pty
  3828. 0003: loop top have_pty=1
  3829. 0003: loop top have_net=1
  3830. 0003: FD_SET pty_in
  3831. 0003: FD_SET ttyfd in
  3832. 0003: FD_SET ttyfd out=8
  3833. 0003: nfds=5
  3834. 0003: select=1
  3835. 0003: FD_ISSET ttyfd out
  3836. 0003: write net=8 <-- send ack to net
  3837. 0003: loop top have_pty=1
  3838. 0003: loop top have_net=1
  3839. 0003: FD_SET pty_in
  3840. 0003: FD_SET ttyfd in
  3841. 0003: nfds=5
  3842. 0009: select=0
  3843. 0009: select timeout - have_pty=1
  3844. But Ack never arrived. This is a streaming transfer. But nope, streaming
  3845. is not the problem. If I disable streaming ("gkermit -Sr"), we hang in in
  3846. the middle of sending the data. If I use small packets, we don't hang:
  3847. 1000 is OK, 2000 is not. In fact, the cutoff is 1024. OK, TBC...
  3848. Wed 14 Mar 2007: Receiving a file thru ttpty "gkermit -e 1200 -Srd"
  3849. produces a debug log that shows that gkermit gets a lot of EAGAIN errors
  3850. when it tries to read from its stdin. In fact, it takes 6 tries (read()
  3851. calls) to read the S packet (27 bytes). Then when the first data packet
  3852. arrives (1200 bytes), read() never returns even one single byte. The
  3853. timeout interval is 15 seconds and it times out repeatedly. Added a
  3854. primitive hex dump to the ttpty debug log for each read/write (showing only
  3855. the first 24 characters and the last character, so it fits on one line).
  3856. Tried uploading a file. The S, F, and A packets (short) are received and
  3857. Ack'd OK, but then ttpty select() times out, never receiving even one byte
  3858. from the D packet. Clearly, when the pty driver receives a burst of > 1K
  3859. bytes, stops working. As before, if I limit the packets to < 1K, it works
  3860. fine.
  3861. Can I send an 8-bit binary file? Nope. ttpty reads the binary data just
  3862. fine from the net and writes it exactly as it was received to the pty, but
  3863. the first time we write an 8-bit byte, we never hear back from the PTY
  3864. again. But the log shows that when the initial 7-bit packets from the pty,
  3865. it looks like the PTY is not in rawmode, because these packets end with ^J
  3866. rather than ^M. Calling pty_make_raw() on the masterfd and slavefd
  3867. explicitly, however, doesn't change anything. It doesn't matter if I do
  3868. this in the lower fork or the upper fork. So maybe it's the actual
  3869. semantics of pty_make_raw() that are wrong.
  3870. Thu 15 Mar 2007: Went thru all the terminal mode flags in Mac OS X; didn't
  3871. help. Changed hex dump to show whole packet. Put hex dump routine in a
  3872. private copy of G-Kermit. Tried to transfer an 8-bit file, logging both
  3873. ttpty and gkermit. Compared what ttpty received on stdin with what it sent
  3874. to the pty (same) and what was received by G-Kermit (same). Then I realized
  3875. that my little test program was not putting its controlling terminal into
  3876. raw mode; when I did that, I could upload binary files (streaming, 2MB/sec).
  3877. And with Zmodem too (with rz; lrz doesn't work for some reason). Looking
  3878. back at the original in ckutio.c, I see that ttptycmd() never called
  3879. ttpkt(). Maybe that was the trouble all along. (Yup, but maybe not the
  3880. whole trouble.)
  3881. Moving back to C-Kermit and the original ttptycmd() routine, adding the call
  3882. to ttpkt(), and stripping out a lot of cruft, and moving the pty_make_raw()
  3883. code to ckupty.c, Kermit uploads and downloads (streaming) work fine in
  3884. Solaris. Zmodem sends a file, but then the transfer hangs at the very end,
  3885. as if the signoff protocol were lost. This happens on Solaris. If I move
  3886. back to Mac OS X, everything works just fine. Then, making a Kerberized
  3887. connection from the Mac to NetBSD, I can send files from the Mac with both
  3888. Zmodem and Kermit. Receiving... Kermit OK. Zmodem... Nope. "rz:
  3889. Persistent CRC or other ERROR" (and created a 265MB debug.log!)
  3890. Fri 16 Mar 2007: ttptycmd() was for sending files with Zmodem across
  3891. encrypted connections. But it occurred to me that it's necessary for
  3892. clear-text connections too; e.g. Telnet, where 0xff has to be doubled. Of
  3893. course Zmodem doesn't do that itself, so there's no way Zmodem external
  3894. protocol could work when executed over a Telnet connection, and in fact
  3895. it doesn't. I wonder why I ever thought it did.
  3896. Wed 21 Mar 2007: Back to where we left off a week ago. Trying C-Kermit's
  3897. ttptycmd() on the Mac again, in remote mode:
  3898. . G-Kermit send txt (kst): OK 832Kcps
  3899. . G-Kermit recv txt (kr): OK 425Kcps
  3900. . G-Kermit send bin (ksb): OK 1000Kcps
  3901. . G-Kermit recv bin (kr): OK 188Kcps
  3902. And Zmodem:
  3903. . sz txt (zst): OK 563Kcps
  3904. . sz bin (zsb): OK 714Kcps
  3905. . rz txt (zr): OK 863Kcps
  3906. . rz bin (zr): OK 198Kcps
  3907. So in remote mode, everything works. Now let's try a clear-text Telnet
  3908. connection...
  3909. . G-Kermit send txt (kst): OK 841Kcps
  3910. . G-Kermit recv txt (krt): OK 391Kcps
  3911. . G-Kermit send bin (ksb): OK 811Kcps
  3912. . G-Kermit recv bin (krb): OK 171Kcps
  3913. And Zmodem over the same clear-text telnet connection:
  3914. . sz txt (zst): OK 91Kcps (*)
  3915. Kermit is sending sz messages like "sz 3.73 1-30-03 finished." to the
  3916. host, which tries to execute them, after the transfer is finished.
  3917. Of course "sz" is a command, but:
  3918. sz: cannot open 3.73: No such file or directory
  3919. sz: cannot open 1-30-03: No such file or directory
  3920. sz: cannot open finished.: No such file or directory
  3921. Did I lose that code that dis-redirects stderr when I went back to using the
  3922. pty code from the ckupty module? No, it's there and it's being executed.
  3923. Apparently the copy of sz I have is writing its "finished" message to stdout
  3924. because "sz blah 2> /dev/null" does not suppress it. Starting again with
  3925. lsz instead of sz:
  3926. . sz txt (lzst): OK 413Kcps
  3927. . sz bin (lzsb): OK FAILED (*)
  3928. . rz txt (lzrt): OK
  3929. . rz bin (lzrb): OK
  3930. (*) Sigh. Using lsz, we get "garbage count exceeded" errors and eventual
  3931. failure. But using regular sz, we get the extraneous message that starts
  3932. sz on the far tend, and the resulting getty babble.
  3933. But even without changing the code, it will work one minute, and then fail
  3934. consistently the next. For example, I was able to send files with sz
  3935. successfully over and over, but with the getty babble at the end. Then,
  3936. after trying lsz and then going back to sz, every attempt at sending a file
  3937. quits with "Got ZCAN". The difference has to be that Kermit always does at
  3938. least some minimal encoding of C0/C1 control characters such NUL and DEL and
  3939. IAC, and I doubt that Zmodem does.
  3940. http://zssh.sourceforge.net/ says:
  3941. If file transfer is initiated but never completes (ie a line like :
  3942. Bytes Sent: 0/ 513 BPS:0 ETA 00:00 Retry 0: Got ZCAN
  3943. can be seen, but transfer never completes), chances are the pty/tty on one
  3944. of the systems are not 8-bit clean. (Linux is 8-bit clean, NetBSD is not).
  3945. Using the -e (escape) option of rz should solve this problem.
  3946. It doesn't, at least not with lrz. And yes, the receiving end happens to be
  3947. NetBSD. But it looks like the zssh people have been down this road too.
  3948. But with rz and sz, it worked. Once. Twice. Three times. But of course,
  3949. with the getty babble at the end. This can be taken care of by doing:
  3950. rz -eq ; cat > foo
  3951. which puts "sz 3.73 1-30-03 finished" and any other messages in foo (but you
  3952. have to type ^D to finish the cat). Using this method I was also able to
  3953. send an 8K binary file that contained a test pattern of all 256 possible byte
  3954. values. Then I tried a 3MB binary executable. All OK. So here we go again:
  3955. . sz txt (zst): OK
  3956. . sz bin (zsb): OK
  3957. . rz txt (zrt):
  3958. . rz bin (zrb):
  3959. Downloading fails about halfway through a fairly large file. I tried an
  3960. even bigger file, guaranteed to be 100% ASCII; same thing -- halfway
  3961. through: "rz: Persistent CRC or other ERROR". But it worked with a smaller
  3962. version of the same file (82K versus 2MB). Tried again with the bigger
  3963. version, it failed in exactly the same way at exactly the same spot: byte
  3964. number 1048320. But this is just ASCII text so it can't be a transparency
  3965. problem. Substituting another plain ASCII file of the same size but totally
  3966. different contents, it doesn't fail (2.36MB). Back to the previous file, it
  3967. fails again, but in a different spot (832960). So it's not totally
  3968. deterministic.
  3969. To round things out, I tried downloading the binary test-pattern file; it's
  3970. only 8K. This failed.
  3971. -4, --try-4k go up to 4K blocksize
  3972. -B, --bufsize N buffer N bytes (N==auto: buffer whole file)
  3973. -e, --escape escape all control characters (Z)
  3974. -E, --rename force receiver to rename files it already has
  3975. -L, --packetlen N limit subpacket length to N bytes (Z)
  3976. -l, --framelen N limit frame length to N bytes (l>=L) (Z)
  3977. Tried again with "sz -L 256 -B 256 -4aeq". Doesn't change anything.
  3978. NOTE: Mac OS X rz 3.73 1-30-03 does not support -e.
  3979. NetBSD rz 0.12.20 does support -e.
  3980. Thu 22 Mar 2007: It occurs to me that ttpkt() might still be a problem;
  3981. maybe it's the network connection and not the pty that is not transparent
  3982. enough. To test this theory I did "stty raw ; stty -a" and then copied all
  3983. of the flag values into ttpkt in the BSD44ORPOSIX section:
  3984. . rz txt (zrt): OK (2.36MB file, worked 2 out of 3 times)
  3985. . rz bin (zrb): "rz: Persistent CRC or other ERROR"
  3986. A little more fiddling with the flags and I got the 8K binary test pattern
  3987. to SEEM to download OK (in the sense that rz gave a 0 return code) but the
  3988. file itself was truncated, always at 224. If I changed the test pattern
  3989. file to not include any bytes with value 224 (0xe0) or 255 (0xff), the
  3990. download worked. So we have a transparency problem somewhere. The debug
  3991. log shows that all byte values are being received from the network correctly
  3992. so the problem has to occur when we try to feed them to the pty.
  3993. But no amount of twiddling with the termios flags seems to let these
  3994. characters pass through. Of course, since they are not in the C0 or C1
  3995. control range, "sz -e" doesn't quote them (which it does by prefixing with
  3996. Ctrl-X and then adding 0x40 to the byte value so (e.g.) NUL becomes ^X@.
  3997. Note that 255 does not cause problems because it coincides with the IAC
  3998. character; the remote Telnet server doubles outbound IACs, and Kermit's
  3999. ttinc() undoubles them automatically (as the log shows).
  4000. Trying to send a different file (a C-Kermit binary) shows that 255 is the
  4001. real killer; the file is truncated where the first one appears (at about
  4002. 6K), even though some 224's precede it. Going back to the remote-mode test,
  4003. I see the same thing happens with the binary test-pattern file, if I send it
  4004. from K95 direct to rz-under-C-Kermit-in-remote-mode. So it has nothing to
  4005. do with C-Kermit having a network connection. Yet if I send the same file
  4006. direct from K95 to rz, it goes OK and the result is not truncated, so it's
  4007. not Zmodem either. The data arrives to C-Kermit intact, so the failure is
  4008. definitely in writing it to the rz process through the slave and master ptys.
  4009. BUT if I send the same file from K95 to rz-under-ttpty, that works. What's
  4010. the difference? Suppose I just transplant ttpty literally into C-Kermit...
  4011. It makes no difference. When receiving the test-pattern, it truncates it
  4012. in exactly the same place.
  4013. Well, all this is on Mac OS X. What if I move it to a different platform?
  4014. OK, building on Solaris and following the exact same procedure, ttptycmd()
  4015. doesn't even use the network connection. I think that's because rzsz on
  4016. Solaris is hardwired to use the controlling terminal and can't be
  4017. redirected, even in a pty?
  4018. Moved to NetBSD.
  4019. . sz txt (zst): Failed ("Got ZCAN")
  4020. . sz bin (zsb):
  4021. . rz txt (zrt): OK
  4022. . rz bin (zrb):
  4023. Well, this is a big mess. Sending doesn't work (or sometimes it does but
  4024. reports that it didn't). Receiving... well, actually it's the same thing;
  4025. the file is completely transferred but then the final protocol handshake is
  4026. lost. The local C-Kermit returns to its prompt, but rz is still running:
  4027. Retry 0: Got TIMEOUT
  4028. Retry 0: TIMEOUT
  4029. Retry 0: Got TIMEOUT
  4030. Retry 0: TIMEOUT
  4031. Retry 0: Got TIMEOUT
  4032. Retry 0: TIMEOUT
  4033. Retry 0: Got TIMEOUT
  4034. Retry 0: TIMEOUT
  4035. Retry 0: Got TIMEOUT
  4036. Retry 0: TIMEOUT
  4037. Retry 0: Got TIMEOUT
  4038. I don't see how that is even possible. Even after I exit from Kermit the
  4039. messages keep coming, even though ps doesn't show the rz process anywhere.
  4040. Looking at the code, I see a place where end_pty() was still commented out
  4041. from the ttpty.c episode, I uncommented it. But still:
  4042. . sz txt (zst): Fails ("Got ZCAN")
  4043. . sz bin (zsb): Fails instantly (but with no diagnostic)
  4044. . rz txt (zrt): OK
  4045. . rz bin (zrb): Fails with tons of "Bad CRC", "Garbage Count exceeded"
  4046. Conclusion for the day: I think this is hopeless. Even if I can get it to
  4047. work somewhere, the results depend on the exact Zmodem software, how it uses
  4048. stdin/out vs stderr versus getting its own nonredirectable file descriptor,
  4049. versus the Zmodem version on the other end and which options are available
  4050. on each, versus the pty and select() quirks on each platform, and on and on.
  4051. It will be so hard to explain and to set up that nobody would ever use it.
  4052. It would be better to just implement Zmodem internally.
  4053. Fri 23 Mar 2007: Went back to the small test program, ttpty.c. Tried
  4054. setting both the master and the slave pty to rawmode, even though I have
  4055. never seen any other software that did this. I had it receive the binary
  4056. test pattern file; it worked. I made a bigger test-pattern file, 3MB,
  4057. containing single, double, and triple copies of each byte in byte order and
  4058. in random order, this one was accepted too.
  4059. So it would seem that the ckupty.c module is something to avoid after all.
  4060. It's full of stuff I don't understand and probably should not undo. So
  4061. changing C-Kermit's ttptycmd() to manage its own pty again, using openpty()
  4062. (which is not portable), I got it all to work in remote mode: Kermit
  4063. text/binary up/down and Zmodem text/binary up/down. But in local mode on
  4064. the client side of a Telnet connection...
  4065. zst: OK, but we still get the getty babble at the end that starts sz.
  4066. zsb: OK, ditto. This is with the 3MB test-pattern file.
  4067. zrt: Not OK -- "Persistent CRC or other ERROR"
  4068. zrb: Not OK -- got the cutoff at 224 again "Persistent CRC or other ERROR"
  4069. It's close. But actually this was still with USE_CKUPTY_C defined. When I
  4070. undefined it, it was back to being totally broken. Start over. (Check the
  4071. new cfmakeraw() code.)
  4072. Tue 27 Mar 2007: Starting over. Back to ttpty.c. Let's verify, VERY
  4073. CAREFULLY, that it really does work, using the most stressful of the four
  4074. tests: sending the big (3.2768MB) binary test pattern from K95 into rz
  4075. through ttpty, logging everything. ttpty definitely receives the big file
  4076. smoothly with no errors or hiccups when I have it set to use the master side
  4077. of the pty for i/o. The application program (Zmodem in this case) runs on
  4078. the slave, and the network and/or control program communicates with the
  4079. master. This implies that Zmodem controls the terminal modes of the slave,
  4080. and ttpty should be concerned with those of the master. Doing it this way
  4081. in ttpty confirms this.
  4082. Fine. But if I tell ttpty to SEND a file with sz, nothing happens. Ditto
  4083. with lsz. Select times out waiting for input from the pty. But if I
  4084. manually tell K95 to RECEIVE /PROTOCOL:ZMODEM it works OK. Somehow sz's
  4085. initial B000000 string is being swallowed somewhere, and it's waiting for
  4086. a reply from the receiver. sigh... But "ttpty gkermit -s filename" works
  4087. fine. What's the difference? It has nothing to do with stdout vs stderr;
  4088. sz is not writing to stderr at all. Is it some timing thing between the
  4089. forks? Aha. It's that I change the modes of the pty master in one fork
  4090. while sz is already starting in the other fork.
  4091. OK, good, now for the first time we have Kermit and Zmodem both able to
  4092. upload and download a large worst-case binary test-pattern file... in
  4093. remote mode. Now taking today's lessons and fitting them back into
  4094. C-Kermit so I can try it local mode...
  4095. Using G-Kermit as the external protocol, first in remote mode... All good:
  4096. text/binary up/down. The "halting problem" is solved by SIGCHLD, which
  4097. catches fork termination instantly and lets ttptycmd() know there is no more
  4098. pty. Zmodem:
  4099. zst: OK
  4100. zsb: OK
  4101. zrt: OK
  4102. zrb: OK
  4103. That's a first. Next, repeat in local mode, in which C-Kermit is the client
  4104. and has made a Telnet connection to another host over a secure (Kerberos V)
  4105. connection:
  4106. kst: OK zst: ...
  4107. ksb: OK
  4108. krt: OK
  4109. krb: OK
  4110. It seems we can never end a day on a high note. Somehow I seem to have
  4111. broken regular internal Kermit protocol transfers over encrypted connections
  4112. -- the en/decryption engine loses sync. But they still work OK over a
  4113. clear-text Telnet connection.
  4114. Today's code in ~/80/dulce.tar (27 Mar 2007).
  4115. Added makefile target solaris10g+openssl. Gathered all the standard CFLAGS
  4116. for Solaris into cdcdeb.h so they don't have to be included in every single
  4117. makefile target for Solaris. On local Solaris 10 host OpenSSL is in
  4118. /opt/openssl-0.9.8e/. Tried the new makefile target, works OK. Also made
  4119. solaris10+openssl for Sun CC, but couldn't test it because I can't find any
  4120. Solaris 10 host that has Sun CC. Built with gcc at another site that has
  4121. OpenSSL 0.9.8f-dev, all OK. ckcdeb.h, makefile, 24 Jun 2007.
  4122. It occurs to me that Kermit transfers on secure connections might have been
  4123. broken by the changes I made back in February to ttinl() for John Dunlap.
  4124. Here, for the first time, we invoke myunrd() to push a byte back into the
  4125. input queue, and there is also some funny business with "csave", which
  4126. changed, and which an old comment notes that it has to be treated specially
  4127. when encrypting. So it could be that the broken Kermit transfer has nothing
  4128. to do with the work on external protocols, and that putting back the
  4129. previous ttinl() will fix it. But now I can't seem to make a Kerberized
  4130. connection from Panix to Panix, even though I can make one from Columbia to
  4131. Panix. This means I have to build a Kerberized binary from the current
  4132. source code on either Solaris or Mac OS X. Trying Solaris
  4133. first... [~/solaris9k5/mk5.sh] This didn't work the first time due to
  4134. undefined krb5_init_ets, which is referenced if MIT_CURRENT is not defined
  4135. (it should be for Kerberos 5 1.05 and later and we have 1.42 here), tried
  4136. again with -DMIT_CURRENT=1... Nope, that one totally blew up in ck_crp.c.
  4137. Later, Jeff says krb5_init_ets is a no-op in Kerberos 1.4.x and later,
  4138. so I added an #ifdef (NO_KRB5_INIT_ETS) for skipping it; now it builds and
  4139. runs OK. ckuath.c, makefile, 9 Jul 2007.
  4140. Meanwhile, using C-Kermit on Mac OS X, which makes the Kerberized connection
  4141. just fine, but still has the problem transferring files over it. Packet log
  4142. shows:
  4143. s-00-01-^A9 Sz/ @-#Y3~Z! z0___F"U1@A^M
  4144. r-00-01-^A9 Y~/ @-#Y3~^>J)0___J"U1@I
  4145. s-01-01-^A(!Fx.x)(V^M
  4146. r-xx-08-<timeout>
  4147. S-01-08-^A(!Fx.x)(V^M
  4148. r-xx-08-<timeout>
  4149. S-01-08-^A(!Fx.x)(V^M
  4150. r-xx-16-<timeout>
  4151. Note that S packet is sent, received, and Ack'd OK. The F packet is sent but
  4152. is never Ack'd. Tried this several times and noticed that it's just
  4153. receiving that is screwed up, not sending. After ^C'ing out of the
  4154. transfer, I can still type commands, and they are executed on the far end,
  4155. but the results coming back are gibberish. Mon Jul 9 16:08:22 2007 (come
  4156. back to this later... substitute Dev.27 ttinl for current one and see if
  4157. the problem goes away, and if so, conditionalize the new code for clear-text
  4158. connections).
  4159. Built C-Kermit with Kerberos 5 on Solaris with a version of ckutio.c that
  4160. uses the old ttinl() and transferred a file OK over a Kerberized connection.
  4161. So now it's just a matter of reconciling the old and new ttinl. The easiest
  4162. way to do this is to have new ttinl() chain to old ttinl() if the connection
  4163. is encrypted, which is what I did and it works fine. At some point the two
  4164. versions of ttinl() should be reconciled. ckutio.c, 12 Aug 2007.
  4165. There was a function, islink(), used in only one place (ckuus6.c) that had
  4166. the same name as a commonly used scalar variable, and it was missing a
  4167. prototype. Changed its name to isalink() and added the prototype (Unix
  4168. only), ckuus6.c, ckufio.c, ckcdeb.h. 12 Aug 2007.
  4169. Revisiting the ASCII and BINARY top-level commands, which are supposed to
  4170. be like in other FTP clients, but don't seem to have any effect. I added a
  4171. new routine to the FTP module, doftpglobaltype(), that sets the global,
  4172. sticky, permanent transfer mode (ASCII or BINARY) (TENEX could be added to
  4173. if anybody asks). These commands (now that they work) are different from
  4174. SET FTP TYPE { ASCII, BINARY }, which set the *default* transfer mode when
  4175. automatic switching fails for a given file. ckuusr.c, ckcftp.c, 12 Aug 2007.
  4176. (notify: Matt <mlist@cmcflex.com>)
  4177. Even though the code hasn't changed, suddenly we're getting:
  4178. "ckuusx.c", line 5682: warning: implicit function declaration: tgetent
  4179. "ckuusx.c", line 6183: warning: implicit function declaration: tgetstr
  4180. "ckuusx.c", line 6262: warning: implicit function declaration: tputs
  4181. "ckuusx.c", line 6266: warning: implicit function declaration: tgoto
  4182. in ckuusx.c on Solaris 9. <curses.h> is still in /usr/include, dated 2002.
  4183. A quick search shows the missing functions are hiding in <term.h>, which
  4184. until now was included only in Linux. Added a USE_TERM_H clause. No, that
  4185. doesn't help, the prototypes are not selected at compile time; there are
  4186. #ifdefs in that file that skip over these prototypes. I had to put them in
  4187. the code under #ifdef BUG999..#endif (I could have used a longer name like
  4188. #ifdef ADD_PROTOTYPES_FOR_CURSES_FUNCTIONS, but that would not be portable).
  4189. ckuusx.c, 12 Aug 2007.
  4190. Also:
  4191. "ckuusx.c", line 9232: warning: implicit function declaration: creat
  4192. This is called in the IKSD database code, used for getting a lockfile.
  4193. creat() is a Unixism in code that is supposed to be portable. But IKSD only
  4194. runs on Unix and Windows, so I assume the Windows C library has a creat()
  4195. function. Anyway, suddenly the Solaris header files seem to have blocked
  4196. whatever path previously existed to the creat() prototype (which is in
  4197. <fcntl.h>), so I added an #include in the appropriate spot. ckuusx.c,
  4198. 12 Aug 2007.
  4199. Kermit functions for converting the number base -- \fradix(), \fhexify(),
  4200. \unfhexify() -- did not work with big numbers; ckradix() was missed in the
  4201. CK_OFF_T conversion. Fixed in ckclib.c, 12 Aug 2007.
  4202. Updated the help text for ASCII, BINARY, and SET FTP TYPE to clarify the
  4203. semantics. ckuus2.c, ckcftp.c, 12 Aug 2007.
  4204. Error messages were printed upon failure to open any of the four log file,
  4205. even with SET QUIET ON. Fixed in ckuus4.c, 12 Aug 2007.
  4206. Built OK on NetBSD 1.3_RC3. Tried to build secure version but the libraries
  4207. had disappeared. 13 Aug 2007.
  4208. Built OK on Mac OS X 10.4.9. Tried the secure version, macosx10.4+krb5+ssl.
  4209. Here we get the usual pile of "pointer targets in passing argument 1 of
  4210. (function name) differ in signedness", regarding security functions, but it
  4211. built OK. 13 Aug 2007.
  4212. Reconciling the two ttinl's... On encrypted connections myread() returns
  4213. encrypted bytes; ttinl() has to decrypt them; it wasn't doing this in the
  4214. lookahead section so I fixed it. The new code works on both encrypted and
  4215. clear-text connections. I removed the chaining to oldttinl(), and
  4216. oldttinl() itself. ckutio.c, 13 Aug 2007.
  4217. (Wouldn't it make more sense and be more efficient and less confusing
  4218. for myfillbuf() to do the decrypting?)
  4219. When C-Kermit uses Zmodem as an external protocol, it doesn't seem to scan
  4220. files before sending them to set text or binary mode appropriately. It's
  4221. that external protocols bypass Kermit's whole "get next file" mechanism; the
  4222. (possibly wild) filespec is simply passed to the external protocol program.
  4223. Changing this would be a very big deal. But if only one file is being sent
  4224. (the filespec is not wild) it's easy enough to check. I added this to the
  4225. external protocols section of the protocol module. It can be overridden in
  4226. any of the regular ways (/TEXT or /BINARY switch on SEND command, SET
  4227. PATTERNS OFF, SET TRANSFER MODE MANUAL, etc). ckcpro.w, 13 Aug 2007.
  4228. [FTP SEND /RECURSIVE]
  4229. Peter Crowley reported a problem with FTP recursive uploads getting the
  4230. directory tree wrong when the previous pathname was a left substring of the
  4231. new pathname (e.g. foo/bar/ and foo/bar2/). The logic did not handle this
  4232. case and created the bar2 directory as a subdirectory of bar, rather than as
  4233. a parallel directory. Fixed in syncdir() and tested with various edge cases.
  4234. ckcftp.c 14 Aug 2007.
  4235. notify <peter.crowley@alumni.utexas.net>
  4236. Added CD messages to FTP BRIEF display to track the ups and downs of
  4237. recursive uploads. ckcftp.c, 14 Aug 2007.
  4238. The OUTPUT command gave a misleading error message ("Connection to xxx not
  4239. open") when used on a serial port that was, indeed, open but was not
  4240. presenting the Carrier signal, when CARRIER-WATCH was not OFF. Added a new
  4241. message for this, and some others. ckuus5.c, 14 Aug 2007.
  4242. Sending from the command line, e.g. kermit -s foo, did not give an
  4243. informative error message if the file could not be found or opened. Fixed
  4244. in ckuusy.c, 14 Aug 2007.
  4245. OK, back to ttptycmd.... It seems that back on March 27th, I got everything
  4246. working but I thought that there was still something wrong with it because
  4247. an unrelated problem so I put it aside. The version of ttpty.c from that
  4248. date worked OK, and it looks like I updated ckutio.c from it, but that
  4249. version of ckutio.c was put aside. Since then I have been working on the
  4250. ckutio.c version that was NOT put aside and so now I have to reconcile the
  4251. two:
  4252. ~/80/ttypty/20070327/ckutio.c
  4253. ~/80/ckutio.c
  4254. As a first cut I did this simply by replacing the contents of the #ifdef
  4255. CK_REDIR section of the latter with that of the former. Of course in
  4256. Solaris this comes up with openpty() implicitly declared at compile time and
  4257. unresolved at link time. So the first task is to get HAVE_OPENPTY defined
  4258. for platforms that have it and have the others use the ttruncmd(). For
  4259. starters I put an #ifdef block in ckcdeb.h that defines HAVE_OPENPTY for
  4260. Linux, FreeBSD, NetBSD, OpenBSD, and Mac OS X. Ones that don't have
  4261. openpty() include AIX, HP-UX, and Solaris. Others like SCO I don't know but
  4262. I doubt it. The real solution is to get the ckupty.c module to work but one
  4263. thing at a time... This version is supposed work with secure builds on the
  4264. openpty() platforms, and on the others like Solaris, if an external protocol
  4265. is attempted on a secure (encrypted) connection, an error message is
  4266. printed and the command fails. ckutio.c, 14 Aug 2007.
  4267. How to test? Apparently I did all my testing on Panix before, and that's
  4268. where all my Zmodem builds are, but now when I build a Kerberized version
  4269. (which works if I do it on the right pool host), it won't make a local
  4270. connection, and there is no other place I can connect to that has a
  4271. Kerberized Telnet server. I can, however, connect to Panix from here, using
  4272. the same code, but on Mac OS X...
  4273. Slight detour: Got access to AIX again (5.3.0.0). Picky compiler, some
  4274. things needed fixing.... Also it says "1506-507 (W) No licenses available.
  4275. Contact your program supplier to add additional users. Compilation will
  4276. proceed shortly" and of course it goes kind of slow. For some reason, I
  4277. can't do streaming transfers into AIX over a local network (to its SSH
  4278. server), but windowed transfers are OK. Anyway, noting that we've been
  4279. using the same basic makefile target since AIX 4.2, changing nothing but the
  4280. version herald, I made a new target, simply "aix", that picks up the AIX
  4281. version automatically and sets the herald from it. Ditto for aix+openssl,
  4282. but on this host requires setting SSLINC and SSLLIB to /opt/ssl/include and
  4283. /opt/ssl/lib. Also the make program here was extremely sensitive to spacing
  4284. so I had to make some minor edits to get the link step to work for the SSL
  4285. version. ckuusy.c, makefile, 14-15 Aug 2007.
  4286. Got rid of the special Panix secure NetBSD target, replaced it with a
  4287. regular one, which is invoked in the normal way by defining K5INC and K5LIB
  4288. to point to to where the stuff is hidden. Cleaned up and modernized the
  4289. comments in the makefile a bit. makefile 15 Aug 2007.
  4290. Changed some data types and added some casts to ckctel.c to do away with
  4291. tons of "pointer targets in passing argument 1 of 'xxx' differ in signedness"
  4292. warnings. 15 Aug 2007.
  4293. Set up Mac OS X as the testbed for ttptycmd(), with Panix as the remote
  4294. partner over a Kerberos 5 connection. The first test is to send a 300K
  4295. text file with gkermit as the external protocol. It worked fine, and the
  4296. debug log showed all the right components were active (namely encryption and
  4297. ttptycmd) [kermit/zmodem send/receive text/binary]:
  4298. Kermit Zmodem
  4299. kst OK zst OK
  4300. ksb OK zsb OK
  4301. krt OK zrt OK
  4302. krb OK zrb Failed "rz: Persistent CRC or other ERROR"
  4303. We've seen this before. The problem is 0xff, Telnet IAC, as I proved to
  4304. myself by constructing a 3MB file that contained every byte but 0xff in every
  4305. mixture and order and transferring it successfully over the same connection.
  4306. Presumably the Telnet server is doubling IACs, whereas of course rz is not
  4307. undoubling, thus the CRC error. This is progress. 15 Aug 2007.
  4308. Log shows that indeed every IAC in the source file arrives doubled. Adding
  4309. code to remove the first IAC of every adjacent pair, a small test file with
  4310. different-length runs of IACs transfers OK. The 3MB all.bin file does not.
  4311. Starting over... I can receive a big text file with Zmodem OK. The 3.2MB
  4312. binary test pattern that contains no IACs failed after 1.8MB, but the part
  4313. that it transferred was OK. A second try, almost the whole thing arrived,
  4314. it stopped just 584 bytes short of the end. Could be that file size is a
  4315. separate problem. Making a new copy exactly 1MB long... Well, that's
  4316. interesting, this one too stopped just short of the end. And again, the
  4317. same thing. When connecting back to the host, the last Zmodem packet can
  4318. be seen on the screen; it's as if the local Zmodem exited before reading
  4319. the last packet... But OK, if I change the options on the remote sz
  4320. sender to use small blocks, etc, then it works.
  4321. Now, changing from the 1MB no-IAC-binary test pattern, to the 1MB all-values
  4322. test pattern, we fail after 81K. But the part that was transferred is
  4323. correct. Second try, same thing, but 57K. Third: 40K. Each time, upon
  4324. connecting back, the session is completely dead.
  4325. IF I HAVE TO undouble IACs for incoming files, don't I have to double them
  4326. going out? To send a block to net we just call ttol(), but ttol() doesn't
  4327. do any doubling (because Kermit protocol always quotes 0xff). To see what
  4328. happens, I changed the ttol() call to ttoc() in a loop that doubles IACs. I
  4329. tested this by sending the full 3.2MB test pattern, which worked fine.
  4330. For receiving, it's slow but it works OK with files that don't contain IACs
  4331. (my concern was that IACs might appear in outbound files or in Zmodem
  4332. protocol messages). It receives the 1MB no-IAC test pattern, so there are
  4333. no problems with protocol or timing. But the full test pattern always gets
  4334. cut off, but at different points, as before, with the remote session dead.
  4335. Changing the Zmodem receiver from rz to lrz on the local end (since the
  4336. sender on the remote end is lsz) does not change the behavior.
  4337. Anyway, I went back and replaced the byte loop with something more
  4338. efficient, and it goes about 20 times faster. But this doesn't help either,
  4339. it only makes it fail faster. But aha, what if a doubled IAC is broken
  4340. across successive pty reads -- we have to make the "previous character"
  4341. memory persistent. Well, that was a good insight, but it still didn't fix
  4342. it. The log shows the IAC handling code is working fine.
  4343. What does sz say? Capturing its stderr to a file... "Retry 1: Got ZCAN".
  4344. Next time: "Retry 1: Got TIMEOUT". Next time: Got ZCAN.
  4345. Trying different Zmodem options... apparently I don't need to use short
  4346. blocks. But I do need to use -e, probably because of Telnet NVT treatment
  4347. of carriage return; without -e, there is a "persistent CRC error". -O
  4348. disables timeouts, but this makes no difference.
  4349. OK, we still have two Big Problems:
  4350. 1. When a long file has no IACs, the final < 1K of the file is not received.
  4351. 2. When a long file has IACs, the transfer generally stops very early.
  4352. Problem 1: the transfer consistently fails less than 1K from the end of the
  4353. file. Upon CONNECT back to the host, a big Zmodem packet is sitting there
  4354. waiting to be read, which means ttptycmd()'s copy of rz is terminating
  4355. early. Can we catch it in the debug log? Doing this takes forever and
  4356. writes a GB to the disk... And then the problem doesn't happen. Also, I
  4357. can receive a HUGE text file almost instantly with no errors at all.
  4358. Switching to lrz on the receiving end, now I see the error messages, about
  4359. 300 lines like this:
  4360. Retry 0: Garbage count exceeded
  4361. Bytes received: 872352/1000000 BPS:85464 ETA 00:01 Retry 0: Bad CRC
  4362. Bytes received: 892448/1000000 BPS:86690 ETA 00:01 Retry 0: Bad CRC
  4363. Retry 0: Garbage count exceeded
  4364. Retry 0: Garbage count exceeded
  4365. Retry 0: Garbage count exceeded
  4366. Retry 0: Garbage count exceeded
  4367. Retry 0: Garbage count exceeded
  4368. Retry 0: Garbage count exceeded
  4369. Retry 0: Got ERROR
  4370. Bytes received: 898336/1000000 BPS:84293 ETA 00:01 Retry 0: Bad CRC
  4371. Retry 0: Garbage count exceeded
  4372. Retry 0: Garbage count exceeded
  4373. Bytes received: 900384/1000000 BPS:83751 ETA 00:01 Bad escape sequence
  4374. 2fRe
  4375. try 0: Bad data subpacket
  4376. Bytes received: 941472/1000000 BPS:86191 ETA 00:00 Retry 0: Bad CRC
  4377. Retry 0: Garbage count exceeded
  4378. Even when it succeeds, it gets these. But if I receive a text file, no
  4379. matter how big, no errors or retries or timeouts at all. So it appears that
  4380. there is only one problem: a big-time lack of transparency regarding 8-bit
  4381. and/or control characters. The odd thing is, it's not that the characters
  4382. can't get through -- they all can -- but they seem to cause transitory
  4383. blockages. 16 Aug 2007.
  4384. Cleaned up the remaining pointer signedness warnings in ckutio.c, but this
  4385. was a mistake, it broke Kerberos connections completely. Undid the changes.
  4386. ckutio.c, 17 Aug 2007.
  4387. Changed all return() in the fork()==0 section of ttptycmd() to exit().
  4388. ckutio.c, 17 Aug 2007.
  4389. Tried explicitly setting the slave pty to rawmode. Makes no difference.
  4390. Tried using the Mac OS X (curses) raw() function, and also system("stty
  4391. raw"); still no difference. Tried doing all of these in different
  4392. combinations and orders. I found one combination that cuts the errors about
  4393. in half, and the transfer of the no-IAC test pattern almost always succeeds
  4394. (but it's slow). Anyway, it doesn't help much with the test pattern that
  4395. contains IACs. Well, the code is more solid than it was before but
  4396. functionally we have not advanced much if we can't download a binary file
  4397. with Zmodem! On the other hand, we can upload them, and we can transfer
  4398. text files in both directions, which is an improvement over the previous
  4399. situation, in which the entire session would hang due to loss of
  4400. synchronization of the encryption stream.
  4401. Tried adding -funsigned-char to CFLAGS of Mac OS X target. It does not
  4402. make the "signedness" warnings go away and it doesn't change the runtime
  4403. symptoms.
  4404. I tried a simpler version of pty_make_raw(), the one from Serg Iakovlev, but
  4405. it was a total failure. That's encouraging though, because it indicates
  4406. that pty_make_raw() is the right place to be working.
  4407. Then I made pty_make_raw() set or unset every single terminal flag
  4408. explicitly. This made no difference, but didn't hurt anything either.
  4409. Then I made pty_make_raw() explicitly set all the c_cc[] characters to 0
  4410. (but left c_cc[VMIN] as 1). This made no difference either.
  4411. I checked pty_make_raw() against ttpkt() and the only difference I found in
  4412. the terminal flags is that ttpkt() sets IGNPAR thinking it means "ignore
  4413. parity errors" when really it means "discard any character that has a parity
  4414. error" (at least according to Iakovlev) -- exactly the opposite. But I
  4415. tried it both ways, no difference. 17 Aug 2007.
  4416. I noticed that even Zmodem text receives can fail. They don't get any
  4417. errors, they just get cut off shortly before the end. (But usually they
  4418. succeed, and fast too, like 500K cps).
  4419. What if I don't call pty_make_raw() at all on the slave pty?
  4420. zrt: EESSSSSSSS: 80% good (E = stopped just before end but no other errors)
  4421. zrb no-IAC test pattern, short blocks:
  4422. 1. S/5 (success with 5 screens of errors.
  4423. 2. S/7
  4424. 3. S/7
  4425. 4. S/6
  4426. 5. E/7 (failed just before end)
  4427. 6. S/7
  4428. 7. S/6
  4429. 8. S/6
  4430. 9. S/6
  4431. 10. S/4
  4432. So, lots of errors, but it recovered 90% of the time.
  4433. Next, same thing, but without requesting short blocks:
  4434. 1. E/5
  4435. 2. S/5
  4436. 3. E/4
  4437. 4. S/5
  4438. 5. S/5
  4439. 6. S/5
  4440. 7. X/0 (hard failure right away: "Got ZCAN"
  4441. 8. S/5
  4442. 9. S/5
  4443. 10. S/5
  4444. So it doesn't look like short blocks make that much difference. Now what if
  4445. I turn off prefixing? Bad CRC, fails immediately every time. Putting back
  4446. pty_make_raw(slave), it still fails hard.
  4447. Tried a new strategy with pty_make_raw(): rather than modify existing flags,
  4448. I set all flags to 0, and then turn on only those few that we need like CS8.
  4449. Now we get only 2.5 screens of errors instead 4-7 and the transfer rate is
  4450. higher for binary files (all of the previous ones were under 100K CPS, while
  4451. for text files it was 400-500K CPS):
  4452. 1. S/2 195669 CPS
  4453. 2. S/2 194720
  4454. 3. E/3
  4455. 4. S/2 192550
  4456. 5. S/3 192325
  4457. 6. S/3 145066
  4458. 7. S/2 200689
  4459. 8. S/3 188948
  4460. 9. S/2 209461
  4461. 10. S/3 181991
  4462. I noticed that there was no TIOCSTTY ioctl in the pty/fork setup sequence,
  4463. which is recommended somewhere, so I tried that and it was a disaster; the
  4464. entire session hung. I took it back out. 18 Aug 2007.
  4465. Tried some transfers over a clear-text (not encrypted) connection with the
  4466. same results: smooth, fast transfer of a big text file (400K cps); rocky but
  4467. successful transfer of the no-IAC binary pattern file (135K cps). Switching
  4468. back to ttruncmd(), the same binary file is received at 1.5M cps, and the
  4469. no-IAC binary file totally fails after too many "Bad CRC"s; and we already
  4470. know that any file that contains IACs will fail. One might say that
  4471. ttptycmd() is better in every respect than ttruncmd() except in speed
  4472. (when it works).
  4473. Let's see if ttyptycmd still works in remote mode (to local K95):
  4474. . sz / text works, but slowly.
  4475. . lsz / text works but some weird errors are reported.
  4476. . lsz / binary / no IAC doesn't work at all (CRC-32 mismatch for a header;
  4477. Unexpected control character ignored: 13, etc).
  4478. . sz / binary / no IAC works OK but slow.
  4479. . sz / binary / full test pattern with IAC works OK but slow.
  4480. . Sending text into rz fails completely.
  4481. What about ttruncmd() in remote mode?
  4482. . send /text works, fast.
  4483. . send /binary works, fast.
  4484. . receive /text works, not so fast but not bad.
  4485. . receive /binary works, not so fast but not bad.
  4486. So we use ttruncmd() for remote mode, and we use it for local mode
  4487. serial-port and modem connections, and we use ttptycmd() on network
  4488. connections because (a) they might be encrypted, and (b) even if they are
  4489. not, they use some protocol that we have to handle, e.g. Telnet, Rlogin.
  4490. 19 Aug 2007.
  4491. Discovered that Sending binary files no longer works. Text is OK, binary
  4492. transfers don't even start. This happens on both encrypted and clear-text
  4493. connections. ttptycmd() is being used in both cases. But oddly enough,
  4494. receiving binary still works as before. What did I break, and when?
  4495. Oh, it was just the script, when I changed it from using sz to lsz. Putting
  4496. it back to sz makes it work, even with the full 3.2MB binary pattern with
  4497. IACs.
  4498. I backed off the changes I made to ckctel.c to suppress some warnings, in
  4499. view of the fact that similar changes to ckutio.c broke things so badly.
  4500. 19 Aug 2007.
  4501. If sz is not given the -e flag, it sends control characters bare, except ^P,
  4502. ^Q, ^S, and ^X. ^X is the control prefix, so ^A is sent ^X followed by A.
  4503. With -e, all C0 control chars are prefixed, but with ^X, which is, of
  4504. course, a control character. Interestingly, the C1 analogs of ^P, ^Q, ^S
  4505. (but not ^X and, unfortunately, not IAC) are also prefixed. -e makes no
  4506. difference for 8-bit characters.
  4507. If we have a Telnet connection and the server is in ASCII (NVT) mode, CR is
  4508. always followed by LF or NUL. Well, it seems the server is putting us
  4509. (Kermit) in binary mode in this case, but staying in ASCII mode itself.
  4510. Added code to handle NVT byte stuffing and unstuffing in each direction
  4511. independently, according to the TRANSMIT_BINARY state in that direction. I
  4512. made a file containing just the bytes 0-31 and 127 and 128-159 and 255 (66
  4513. bytes all together) and sending it from the host to C-Kermit, the local log
  4514. shows that every control character was received correctly and all TELNET
  4515. conversions were done right -- NUL removed after CR (and only after CR); IAC
  4516. removed after IAC (and only after an IAC meant as a quote). For the first
  4517. time, I can receive the 1MB all-values test pattern, but there are still
  4518. tons of (correctable) CRC errors, so the transfer rate is really awful, like
  4519. about 5% of what we get with a text file (25Kcps instead of 500).
  4520. Further experimentation shows that the fundamental transparency problem is
  4521. fixed; we can receive short files (say, 1K or less) containing absolutely
  4522. any byte values in any combination with no errors at all. But once the file
  4523. size reaches (say) 10K, we get CRC errors, like one every 2 or 3K of data.
  4524. These are not deterministic. In successive transfers of the same file, they
  4525. come in different spots. It's tempting to blame pty buffer overruns, but
  4526. then text files would show the same behavior. When a binary file size
  4527. exceeds, say, 1MB, the chances of successful completion go way down,
  4528. independent of whether my external protocol is rz or lrz. I like lrz better
  4529. because the error reports come out on the screen as the transfer is going
  4530. on. Trying to download a real-world binary file -- a 2.2MB C-Kermit
  4531. executable -- I get 4500 error messages but the transfer eventually succeeds,
  4532. with an effective throughput of 21Kcps.
  4533. Actually it turns out that "sz -a somebigtextfile" (2.2MB) also gets a lot
  4534. of CRC errors. The -e flag (escape all control characters) makes the same
  4535. big text file transfer with few or no errors. It's not sure-fire.
  4536. Sometimes no errors, sometimes one or two, and sometimes a fatal error that
  4537. kills the transfer.
  4538. With binary files... a 32K binary file seems to make it every time. 40K
  4539. fails about 50% of the time. 48K fails 60% and every time it fails, it has
  4540. created a partial file of exactly 32K (32768 bytes). 96K fails 9 out of 10
  4541. times, when it fails, the partial file is always 0 bytes, or 32768, or
  4542. 65536, but that just means that rz's file output buffer is 32K.
  4543. Why, then, do binary files cause trouble if it is not a solid transparency
  4544. problem? If a certain file can get through once, why can't it get through
  4545. every time? When a character arrives at the pty, the pty driver probably
  4546. takes a different path through its code, checking the terminal flags that
  4547. would affect that character. I tried making Kermit's network read buffers
  4548. very small but, surprisingly, this made things worse. I also tried making
  4549. them very much bigger, which didn't help either. 24K still seems to be the
  4550. right size.
  4551. So, is it that some characters take longer to process than others? So long
  4552. that data is lost due to lack of flow control between TCP and the pty? One
  4553. way to test this theory is to slow Zmodem down. I tried "-l 32" which,
  4554. according to the man page, tells sz to "wait for the receiver to acknowledge
  4555. correct data every N (32 <= N <= 1024) characters. This may be used to
  4556. avoid network over-run when XOFF flow control is lacking." Makes no
  4557. difference. I also tried the -w (Window) switch, ditto. In fact there are
  4558. all sorts of options to set the "window size", "packet length", "block
  4559. size", and "frame length", but with no explanation of what these mean or how
  4560. they are related. If I crank everything down to minimum value:
  4561. lsz q -L 32 -l 32 -w 1
  4562. I get 50% success with the 96K file instead of 10%. Adding -e, oddly
  4563. enough, made it worse. I also tried setting the environment variable
  4564. ZNULLS to different numbers like 512, no help there either.
  4565. I tried making the read-from-net-write-to-pty buffer small (1K) but leaving
  4566. the pty-to-net one big. This improves chances of success, but it's
  4567. intolerably slow (3Kcps when the connection is capable of 500K).
  4568. I also changed the write-to-pty operation from a single write() call of
  4569. possibly many K characters to a byte loop, one write() per byte. Same
  4570. result: success (but still about 300 recoverable errors), throughput 3Kcps.
  4571. 20 Aug 2007.
  4572. With ttptycmd() configured to write to the pty in a byte loop, it is
  4573. possible to delay each write. Adding a 10msec delay per character results
  4574. in a transfer that runs at about 20 cps and (for the 96K test file) would
  4575. take about 80 minutes to complete. And yet it still gets just as many
  4576. errors. So it's not a matter of timing either. The errors come, on
  4577. average, every file 388 bytes, but not at regular intervals.
  4578. I tried the TIOCREMOTE ioctl on the pty master, as discussed somewhat
  4579. obliquely in the Mac OS X "man pty" page; "This mode causes input to the
  4580. pseudo terminal to be flow controlled and not input edited (regardless of
  4581. the terminal mode)" -- sounds like just the ticket but it made no
  4582. difference. Actually, looking at a man page on another OS (Solaris), it
  4583. says this is only for lines of text, EOLs are supplied, so that would mess
  4584. up the protocol. So remember: don't use this.
  4585. Tried without O_NDELAY; the behavior was the same but the speed was much
  4586. slower.
  4587. Tried switching back to the ckupty.c routines on Mac OS X and found that it
  4588. works now the same as with openpty(), except that I seem to get more getty
  4589. babble at the end. But this means I can run some tests on Solaris. I moved
  4590. the entire test environment from Mac OS X 10.4.9 to Solaris 9. But it
  4591. doesn't work at all.
  4592. Trying to figure out the ckupty.c modules again.
  4593. . do_pty() calls pty_getpty() which returns in arg1 the fd of the pty master.
  4594. . Then it creates a pipe as a way to tell when the child dies
  4595. . Then it creates a fork:
  4596. - The parent does a blocking read from the pipe
  4597. - The child calls getptyslave() to get the pty slave
  4598. and writes one byte to the pipe
  4599. and then execs the command it's supposed to run
  4600. Note that the file descriptor of the slave is known only to the lower fork.
  4601. Therefore the lower fork is the one that has to set all the tty modes, etc.
  4602. I took care of all that but the ckupty.c method doesn't work at all on
  4603. Solaris. But it works "fine" on Mac OS X (the 32K all-bytes test file
  4604. transfers instantly with no errors, but the 96K one errors out).
  4605. The problem on Solaris is that pty_make_raw() fails on the masterfd (but not
  4606. on the slavefd) with errno 25 "ioctl inappropriate for device". It doesn't
  4607. matter whether I do it in ckupty.c or ckutio.c. I found a web page on
  4608. kde.org that says Solaris does not allow tcget/setattr() on a pty master.
  4609. But the Sun "knowledge base" is not open to the public. Well, presumably
  4610. changes made to the slave are reflected in the master (comments in Solaris
  4611. telnetd seem to confirm this...) Let's come back to Solaris later.
  4612. Moving to a Linux with lrzsz installed... Built a Kerberos 5 version with
  4613. USE_CKUPTY_C. Like on Mac OS X, it transfers short files OK and chokes on
  4614. longer ones. Switched to openpty(), it behaves the same. So the problems
  4615. on Mac OS X are evidently not OS-specific, which is good I guess, since that
  4616. means finding the way around them will apply to more than one platform.
  4617. 21 Aug 2007.
  4618. Look into TIOCSCTTY again. On System V based OS's, opening a pty acquires a
  4619. controlling terminal automatically. On BSD-based OS's, no; you have to use
  4620. the TIOCSCTTY on the slave file descriptor to give it one. I'm not sure why
  4621. a controlling terminal would be needed, except that without one, the virtual
  4622. device "/dev/tty" does not exist for the process that runs on the pty, and
  4623. maybe the application that runs there (e.g. rzsz) checks for it. On the
  4624. downside, having a controlling terminal opens the process up to terminal
  4625. interrupts like SIGINT and SIGQUIT. Until now I have not been using this
  4626. ioctl(). Results (in Linux):
  4627. With TIOCSCTTY: 96K all-bytes test: 11 screens of errors, then success
  4628. Without TIOCSCTTY: exactly the same.
  4629. Tried the same thing with TIOCNOTTY instead of TIOCSCTTY, with exactly the
  4630. same results (no effect whatsoever).
  4631. There has to be a way to make this work, because Zmodem works through
  4632. telnetd, which basically the same thing as ttptycmd(): a relay between the
  4633. network and a pty. ttptycmd() is like telnetd backwards. Modern telnetds
  4634. are not much help; they don't access ptys or the network directly, they go
  4635. through "mux" devices so I can't see what they're doing to get transparency
  4636. and flow control. An old BSD telnetd uses packet mode but that would be a
  4637. big deal...
  4638. I tried ignoring various signals like SIGTTOU and SITSTP, since some Telnet
  4639. clients do this. No effect, no difference. Anyway, in Linux the transfers
  4640. almost always finish OK despite the many errors. There is just some trick
  4641. I'm missing to make the pty accept a stream of arbitrary bytes without
  4642. hiccuping.
  4643. What about Solaris, which uses ckupty.c? In streams-based OS's, where line
  4644. disciplines and whatnot are pushed on top of the pty, it looks like the pty
  4645. module saves the file descriptor of the "bare" slave pty (as 'spty') before
  4646. pushing things onto it, and then later uses spty rather than the regular
  4647. slave pty file descriptor when getting/setting terminal modes. I'm not sure
  4648. what this is all about but it's definitely SysVish... It happens if
  4649. STREAMSPTY is defined, but I noticed that STREAMSPTY is never defined
  4650. anywhere. I tried defining it so we take an entirely different path through
  4651. the code. It made absolutely no difference.
  4652. Then I noticed that HAVE_STREAMS is not defined for Solaris either. Tried
  4653. defining it, but the session didn't work at all, no i/o. Removing the
  4654. HAVE_STREAMS definition but keeping the STREAMSPTY defined, I rebuilt and
  4655. tried "set host /connect /pty emacs". I got an EMACS screen but could not
  4656. type anything into it, which means that STREAMSPTY should not be defined
  4657. either. Removed the definition and "set host /pty" works again. So what's
  4658. the problem with ttptycmd()?
  4659. In fact, ttptycmd() works on Solaris with Kermit as the external protocol,
  4660. but not with Zmodem, not even with text files. So again, there is no
  4661. fundamental problem with the code or the logic, it's Just A Matter Of
  4662. Transparency to control and/or 8-bit characters -- some trick I don't know
  4663. about.
  4664. Looking at the Solaris debug log... I see that ckupty.c is calling
  4665. init_termbuf() to set the tty modes of the master, not the slave, and
  4666. set_termbuf() to set them, but you can't do that in Solaris, error 25. This
  4667. is in getptyslave(). Shouldn't getptyslave() be setting the tty modes of
  4668. the slave, not the master? I changed it to do this, but like all other
  4669. changes, it made no difference. I checked to make sure that after the change,
  4670. "set host /pty /connect emacs" still worked and it did.
  4671. And then what... I had some code to redirect stderr in ckupty.c that was
  4672. not being executing due to a typo. When I fixed the typo, poof, Zmodem
  4673. binary transfers started working, or working as well as they work in Linux
  4674. and Mac OS X. It turns out that if I don't redirect stderr, sz and rz
  4675. just don't work. But lsz and lrz do. But if I do redirect it, I don't see
  4676. the progress messages from lsz/lrz. 22 Aug 2007.
  4677. Built on HP-UX 11i v3 (B.11.31 U ia64) with optimizing compiler, got tons of
  4678. picky warnings, but it finished and linked and runs OK. Many of the
  4679. warnings were like this:
  4680. "ckucns.c", line 1606: warning #2068-D: integer conversion resulted in a
  4681. change of sign: tnopt[0] = (CHAR) IAC;
  4682. IAC is defined as 255 in ckctel.h. If I define it as 0xff, I don't get the
  4683. warnings. I changed the definitions of all the Telnet commands to be in hex
  4684. notation rather than decimal. If cuts way down on the HP-UX warnings and
  4685. doesn't seem to cause problems elsewhere. ckctel.h, 23 Aug 2007.
  4686. Now it looks like Solaris is working but then it hangs at the end. It
  4687. appears as if the ckupty.c module is blocking SIGCHLD. Debug log shows that
  4688. when the transfer is complete, we received IAC DM (Telnet Data Mark) after
  4689. sz's last gasp and before the shell prompt is printed. But calling
  4690. tn_doop() in this case is a mistake because we are reading the number of
  4691. bytes that we know are available in a counted loop, but tn_doop() would
  4692. consume an unknown number of bytes and we would never know when to exit the
  4693. loop. Anyway, C-Kermit doesn't do anything with DM. Skipping over
  4694. tn_doop() (and not writing out the Telnet command bytes) fixes the hanging
  4695. condition at the end, even though SIGCHLD is never raised. ckutio.c,
  4696. 23 Aug 2007.
  4697. Some tests, Solaris to NetBSD over K5.
  4698. zst sends ascii.txt, a 2.36MB ascii text file (Kcps / Errors).
  4699. zrt receives the same file:
  4700. zst 587/0 526/0 542/0 434/0 423/0
  4701. zrt 827/0 800/0 847/0 FAIL 610/0
  4702. So text is good. Binary not so good. Here we transfer the 1MB all-bytes
  4703. pattern file. zrb receives it successfully, but with 1248 errors, at only
  4704. 15Kcps. Sending the same file out always fails:
  4705. Begin 20070823 16:32:07: SEND BINARY all2.bin [sz]
  4706. Sending: all2.bin
  4707. Bytes Sent: 5600/1000000 BPS:12446 ETA 01:19 FAILURE
  4708. End 20070823 16:32:13
  4709. Elapsed time: 6.617992999999842
  4710. cps = 151103.2121067556
  4711. lsz: caught signal 1; exiting
  4712. Decided to move to Linux but found that something is screwed up in Linux
  4713. C-Kermit with tilde expansion:
  4714. send ~/testfiles/all.bin
  4715. doesn't expand at all (but it did yesterday!). The problem was in the
  4716. ancient, ancient realuid/setuid handling code; real_uid() no longer works in
  4717. Linux. I worked around this in whoami() by setting ruid to getuid() if
  4718. real_uid() returned a negative number. Maybe dangerous, worry about it
  4719. later. ckufio.c, 23 Aug 2007.
  4720. ANYWAY... after fixing that, I tested zsb on Linux, and it's broken there
  4721. too, using openpty(), so it's nothing to do with ckupty.c. After sending
  4722. the first Zmodem data packet, it just hangs, nothing comes back. In text
  4723. mode it gets farther, but then the same thing happens. Captured stderr from
  4724. rz on the far end:
  4725. Bytes received: 608/1000000 BPS:21137 ETA 00:47 Retry 0: Bad CRC
  4726. Bytes received: 864/1000000 BPS:23540 ETA 00:42 Retry 0: Bad CRC
  4727. Bytes received: 1120/1000000 BPS:25003 ETA 00:39 Retry 0: Bad CRC
  4728. Bytes received: 5696/1000000 BPS:56988 ETA 00:17 Retry 0: Bad CRC
  4729. Bytes received: 9120/1000000 BPS:62227 ETA 00:15 Retry 0: Bad CRC
  4730. Bytes received: 9376/1000000 BPS:60766 ETA 00:16 Retry 0: Bad CRC
  4731. Bytes received: 9632/1000000 BPS:60361 ETA 00:16 Retry 0: Got TIMEOUT
  4732. Retry 0: Sender Canceled
  4733. Retry 0: Got ZCAN
  4734. The local sz, however, doesn't give any error message. ZCAN means: "other
  4735. end canceled session by sending 5 ^X's" (or user typed them). What actually
  4736. happens is that ttptycmd()'s select() times out waiting for something from
  4737. the Zmodem partner and ttptycmd() itself kills the sz fork with SIGHUP.
  4738. When lsz receives SIGHUP it sends the ZCAN. So the real problem is that
  4739. after some point we're not receiving anything.
  4740. I changed the timeout from 4 seconds to 30 seconds and now I see it just
  4741. stops for long periods of time and then resumes. The lrz log on the
  4742. receiving end shows tons of timouts, CRC errors, and other errors. The
  4743. local log shows that lsz wound up sending ZCAN (2 x (10 x ^H, 10 x ^X)).
  4744. Moving on to another problem... Turns out Ctrl-C (SIGINT) is working right
  4745. after all. Since I'm using my test scripts like kerbang scripts, Ctrl-C
  4746. exits through trap(), as it should, closing the connection and cleaning up.
  4747. If I start Kermit and tell it to TAKE the script, then Ctrl-C brings me back
  4748. to the prompt with the connection still open (as it should). However, until
  4749. now I haven't done anything about the fork or the ptys. Added code to
  4750. trap() to kill the fork and close the master pty. ckuusx.c, 24 Aug 2007.
  4751. Added code to try to break the deadlock. If select() times out, but we have
  4752. stuff to write either to the pty or the net, try to do it anyway, even
  4753. though select() did not say we could. But this doesn't help because when
  4754. select() times out we don't have anything to write. The problem is that
  4755. after receiving that last packet from the remote rz, the local lsz doesn't
  4756. seem to do anything, as if the lower fork wasn't running (and to confirm
  4757. this hypothesis, sometimes I noticed that when I Ctrl-C'd out of this, the
  4758. transfer would take off again).
  4759. Backing up and testing with gkermit rather than zmodem:
  4760. kst ripple.txt [824K] OK
  4761. kst ascii.txt [1359K] OK
  4762. krt ripple.txt -- FAILED
  4763. It seems that we can't handle streaming. If I set up krt to disable
  4764. streaming on receipt, it works OK.
  4765. krt ripple.txt [824K] OK
  4766. krb all2.bin [1000K] OK
  4767. So here we have no trouble sending but big trouble receiving unless we
  4768. disable streaming. Whereas with Zmodem we have trouble receiving.
  4769. But this wasn't happening before, what changed? Using C-Kermit on the far
  4770. end to receive the file with debug log on, I see that it is sending 4K data
  4771. packet after 4K data packet, with the local gkermit silent, as expected.
  4772. About midway through the transfer, the local Kermit sends an error packet
  4773. "Transmission error on reliable link". Looking at G-Kermit's debug log...
  4774. It receives the first five 4K data packets OK, but gets a CRC error on the
  4775. fifth one, and sends the Error packet. So it has received a stream of
  4776. 20-some thousand bytes OK and then messes up. That number sounds a lot like
  4777. ttptycmd()'s buffer size. I changed the buffer sizes to be different:
  4778. Read from pty and write to net: 4K
  4779. Read from net and write to pty: 1K
  4780. This time it received the first 4K packet and failed on the second one.
  4781. Then I increased the buffers to 98K each, expecting to receive lots more
  4782. packets successfully but it bombed out on the 5th one. But that's good, it
  4783. confirms there's no logic error in the buffer management. Just to make
  4784. sure, though, let's set the buffer size smaller than the packet size and
  4785. disable streaming. In this case we get 4 good data packets and a CRC error
  4786. on the 5th one and so we request retransmission, and the next 8 times it
  4787. arrives it gets a different CRC error, but the 9th copy is OK. Then the
  4788. next packet comes and it gets a CRC error every time. And this is nothing
  4789. but plain ASCII text.
  4790. Switching to remote mode:
  4791. REMOTE=1 kk kst
  4792. (after tricking myself because it was using ttruncmd() for this...) I see
  4793. that nothing works at all. What did I break? 24 Aug 2007.
  4794. Fixed ttptycmd() to restore console modes after a remote-mode transfer.
  4795. ckutio.c, 25 Aug 2007.
  4796. Noticed that error codes like ESRCH are not available in all modules.
  4797. That's because of some complicated in #ifdefs in ckcdeb.h that wind up not
  4798. always #including <errno.h>. But I notice that ckutio.c includes it
  4799. unconditionally with no ill effects, and so does ckvfio.c. Does any version
  4800. of Unix at all not have <errno.h>? Added a catch-all clause to ckcdeb.h to
  4801. #include <errno.h> (in UNIX only) if, after the other clauses, ESRCH was
  4802. still not defined. ckcdeb.h, 25 Aug 2007.
  4803. Now back to debugging ttptycmd()... Remote-mode transfers with ttptycmd()
  4804. were broken in two places, maybe as long as 2 weeks ago (this would have
  4805. affected non-network transfers too, which I can't test any more).
  4806. The logic was missing in a couple places for the non-network and/or
  4807. non-Telnet and/or non-encrypting connections (if statements with no else
  4808. parts). Fixed in ckutio.c, 25 Aug 2007.
  4809. Testing remote mode:
  4810. kst OK zst OK
  4811. ksb OK zsb OK
  4812. krt OK zrt OK
  4813. krb OK zrb OK
  4814. Functionally it all works but there are hitches with Zmodem as always.
  4815. When sending to K95:
  4816. . If I send with lsz, there are hundreds of "Subpacket too long" errors,
  4817. and the transfer is very slow, but it succeeds.
  4818. . If I send with the 1994 Omen version of sz, transmission is instantaneous
  4819. and without errors, but then it hangs at the end.
  4820. . If I bypass C-Kermit and send direct from lsz or sz, both work fine.
  4821. So clearly the ptys are getting in the way. The hanging at the end would be
  4822. caused by the sz process closing before its last output reached the master
  4823. pty. It would need to do some form of flushing and/or pausing at the end
  4824. but there's nothing I can do about that; these programs were not designed to
  4825. be used in this way. Anyway, it only seems to happen with files longer than
  4826. 100K.
  4827. For local mode, testing in Solaris over our Kerberos 5 connection again:
  4828. gkermit lrzsz
  4829. kst OK zst FAIL
  4830. ksb OK zsb FAIL
  4831. krt OK zrt OK but with errors
  4832. krb OK zrb FAIL
  4833. If I use Omen rzsz as the external protocol (e.g. with zst), it blocks
  4834. redirection and it sends the file to my terminal, rather than over the
  4835. connection. This would probably be because it finds out the device name of
  4836. the job's controlling terminal and opens it, to prevent redirection. This
  4837. is hard to prevent in Solaris because there is no TIOCSTTY ioctl().
  4838. Supposedly the same thing is accomplished by closing and reopening the slave
  4839. pty after doing setsid(). I added code to do this, but it made no
  4840. difference. (If I use lsz instead of sz, it is indeed redirected, but jams
  4841. up after about 15K.) ckupty.c, 27 Aug 2007.
  4842. On Mac OS X with sz 3.73 1-30-03, however, the redirection works, so I
  4843. assume it would also work in Linux, FreeBSD, NetBSD, etc, too. Doing the
  4844. full test suite on Mac OS X:
  4845. gkermit lrzsz rzsz
  4846. kst OK zst FAIL (1) OK
  4847. ksb OK zsb FAIL (2) OK
  4848. krt OK zrt OK (3) OK for 100K file, fails for longer.
  4849. krb OK zrb FAIL (4) OK (1MB all-bytes test pattern)
  4850. (1) 64K file OK every time; 100K file fails every time.
  4851. (2) 10K file fails every time.
  4852. (3) Succeeds with 800K file but gets a few recoverable errors.
  4853. (4) Succeeds with 48K binary file with some errors, fails with longer ones.
  4854. So actually it looks pretty good, it's just that lrzsz messes up. When
  4855. sending with lsz if I include -L 512 it sends the 100K test file with no
  4856. errors, but still chokes on longer ones.
  4857. Testing on Mac OS X again, but this time over a clear-text Telnet connection:
  4858. gkermit lrzsz rzsz
  4859. kst OK zst FAIL(1) OK
  4860. ksb OK zsb FAIL(2) OK
  4861. krt OK zrt OK(3) OK
  4862. krb OK zrb FAIL(4) OK
  4863. (1) Almost worked, finished 777K out of 824K without errors.
  4864. (2) Got tons of errors, failed in first 30K out of 1000K.
  4865. (3) OK for 100K file but fails for larger.
  4866. (4) OK for 48K binary fail but fails for larger.
  4867. Maybe see if we can do without the OPENPTY part.
  4868. TOMORROW -- just clean up the code, add some SET / SHOW / HELP commands,
  4869. document it, and move on.
  4870. Note: In K95, SET WINDOW sets the Zmodem packet length, 32 - 1024, multiple
  4871. of 64.
  4872. SEE ~/80/external.txt
  4873. Changed ftp port from int to unsigned int. ckcftp.c, 30 Aug 2007.
  4874. Tried again to build KRB4/KRB5/SSL/TLS version for Solaris 9. Had to update
  4875. the build procedure again, of course, because of new file and directory
  4876. names, but ran into problems anyway because the
  4877. cu-solaris9g+krb5+krb4+openssl+shadow+pam+zlib target was calling another
  4878. target that did not know about the hardwired pathnames. Integrated the two
  4879. targets and tried building again. It actually compiled ok (but with lots of
  4880. warnings from the security modules), but failed at link time with
  4881. krb5_init_ets not found; fixed that with an #ifdef NO_KRB5_INIT_ETS, now it
  4882. builds OK but without the ftp client. Tried building it WITH the FTP and
  4883. that was OK too, no changes needed except to the build procedure. 12 Feb
  4884. 2008, that is: C-Kermit 8.0.212 : 20080212.
  4885. Tried to build with -DCK_SRP and -lsrp but:
  4886. hash_supported ckcftp.o
  4887. hash_getdescbyname ckcftp.o
  4888. hash_getdescbyid ckcftp.o
  4889. cipher_getdescbyname ckcftp.o
  4890. krypto_delete ckcftp.o
  4891. krypto_new ckcftp.o
  4892. cipher_supported ckcftp.o
  4893. krypto_msg_priv ckcftp.o
  4894. krypto_msg_safe ckcftp.o
  4895. hash_getlist ckcftp.o
  4896. cipher_getlist ckcftp.o
  4897. cipher_getdescbyid ckcftp.o
  4898. Sent mail to Tom Wu and backed off for now. makefile, 14 Feb 2008.
  4899. (Tom Wu never answered; seems like SRP is defunct.)
  4900. The ".blah = xxx" form of variable assignment only worked for variables
  4901. names of length 22 or less, noticed and fixed by Wolfram Sang. ckucmd.c,
  4902. 5 Mar 2008.
  4903. In "set host /pty ssh ..." connections, the INPUT command suddenly stopped
  4904. working. This is in Solaris 9. It happens with all 8.0.* versions of
  4905. C-Kermit, so it's nothing to do with ttptycmd(). Added some debug()
  4906. statements but they don't show anything. Turns out there wasn't a problem
  4907. after all. Wed Mar 26 16:04:53 2008
  4908. Changed cmifi() to not print "?No files match" (or whatever) if SET QUIET ON.
  4909. ckucmd.c, 26 Mar 2008.
  4910. Added \v(remoteip) for the IP address of the host we're connected to,
  4911. and \v(inmessage) for INPUT status messages corresponding to \v(instatus).
  4912. ckuusr.h, ckcmai.c, ckuus[24].c, 26 Mar 2008.
  4913. Made \fkeywordval() strip braces/quotes from the right-hand side so we can
  4914. handle things like:
  4915. password="stringwithspaceatend "
  4916. ckuus4.c, 6 Aug 2008.
  4917. Added invisible PUTENV command for UNIX only. Value should not be enclosed
  4918. in doublequotes. Requires lge \v(buildid) 20080826. ckuusr.[ch], 26 Aug 2008.
  4919. Added SET VARIABLE-EVALUATION { RECURSIVE, SIMPLE }. This is highly
  4920. experimental, but also highly desirable if it works out. SIMPLE inhibits
  4921. the default recursive method of evaluating \%x and \&x[] variables, which
  4922. is, quite frankly, nuts and makes programming in Kermit at best
  4923. counterintuitive. I made an exception in the case of array subscripts,
  4924. because changing how they are evaluated could break a lot of scripts, and
  4925. anyway there should never be any harm in evaluating them recursively because
  4926. their final value is always (or should be) numeric, not some string that
  4927. might contain backslashes. The SET VAR setting is on the stack, just like
  4928. SET QUIET (it follows the quiet/xquiet code in ckuus[356].c), so macros or
  4929. command files that change it can't break the script that invokes them.
  4930. Added \frecurse() to force recursive evaluation of a \%x or \&x[] variable
  4931. regardless of the VARIABLE-EVALUATION setting. Added \v(vareval) to allow
  4932. programmatic setting to current setting. Tested on Solaris 9 but should be
  4933. totally portable. ckuusr.[ch], ckuus[356].c, 11 Sep 2008.
  4934. From Günter Knauf: 64-bit builds were failing on SuSE Linux because
  4935. libresolv and libcrypt were in lib64 rather than lib; updated the tests in
  4936. the linux makefile target to find them. makefile, 12 Jan 2009.
  4937. Tried building on Red Hat Enterprise Linux Server release 5.3 64-bit.
  4938. There is no curses or ncurses. "make linuxnc" compiled OK but collapsed at
  4939. link time looking for crypt(), res_search(), and dn_expand(). Turned out
  4940. the linuxnc (and linuxc) targets needed the same treatment as the Linux one
  4941. for 64-bit Linuxes. makefile, 3 Mar 2009.
  4942. Consolidated the linux targets so we no longer need three separate ones for
  4943. curses, ncurses, and no curses. "make linux" works ok on computers with and
  4944. without (n)curses. "make linux+ssl", ditto. "linux+krb5+ssl builds OK but
  4945. needs -DNO_KRB5_INIT_ETS". Makefile, 3 Mar 2009.
  4946. Fixed copyright date announced in herald, ckuus5.c, 3 Mar 2009.
  4947. Patch from Seth Theriault to avoid deprecation warning for utmp references
  4948. in ckufio.c in Mac OS X 10.5 (later, this became a consolidated makefile
  4949. target that works automatically for at least Mac OS X 10.3.9 through
  4950. 10.5.6). makefile, ckufio.c, 28 April 2009.
  4951. zshcmd() (the function used by RUN and ! to run external commands) was not
  4952. falling back as expected in Linux RHEL4/5 if SHELL was not defined in the
  4953. environment. Also in all Unix versions, there was no indication if a RUN/!
  4954. command failed (other than the return code) because the specified shell
  4955. didn't exist or was not executable (e.g. the SHELL environment variable was
  4956. misdefined). Now it prints the name of the offending shell and the reason
  4957. it couldn't be executed (Not found, Permission denied, etc). ckufio.c,
  4958. 28 April 2009.
  4959. There is no easy way to get the last field of string; for example, the
  4960. extension from a filename, which might have any number of fields. In
  4961. general we want to be able to get "word number n" counting from the right;
  4962. \fword() lacks this ability. Now if you give it a negative word number,
  4963. that says to count from the right; for example \fword(one two three four
  4964. five, -2) returns "four". ckclib.c, ckuusr.c, 14 May 2009.
  4965. Fixed a typo in the aix51+openssl (SSLLIBS should have been SSLLIB).
  4966. From Jason Lehr. makefile, 27 May 2009.
  4967. Updated the linux+openssl+zlib+shadow+pam target to chain to the new main
  4968. Linux target. A bunch of other ones remain un-updated. makefile, 12 Jun 2009.
  4969. Updates to the new Mac OS X 10.5 target from Seth Theriault (which is
  4970. supposed to work on all Mac OS 10-point-anything) to avoid warnings
  4971. that came up on on Mac OS 10.4.11/Intel. Once this one is proven we should
  4972. be able to remove/consolidate lots of other ones. makefile, 12 Jun 2009.
  4973. C-Kermit disables SSL with the message "?OpenSSL libraries do not match
  4974. required version." if the version of OpenSSL that Kermit was built with is
  4975. not exactly the same as the version that is loaded dynamically at runtime.
  4976. This is actually the proper behavior, since APIs are not guaranteed not to
  4977. change between OpenSSL versions prior to 1.0.0. Made the error message more
  4978. informative. ck_ssl.c, 26 Aug 2009, and again 28 Aug 2009.
  4979. AIX 6.1 is out, it is really just a new name for AIX 5.4. Added makefile
  4980. targets, plus for the first I made AIX 4.2 and later figure out its version
  4981. number in the makefile target so we don't have to keep adding new -DAIXnn
  4982. sections to the code, and also get its hardware name (e.g. "powerpc") from
  4983. uname at make time, rather than hardwiring "rs6000" as I did before.
  4984. Consolidated all AIX 4.2 and later targets so now just "make aix" or "make
  4985. aix+ssl" can be used. Except not the gcc ones as they have some quirks so
  4986. I'd rather not disturb them. Tested this on AIX 5.3.
  4987. makefile, 28 Aug 2009.
  4988. From Kinjal Shah, a correction to the Linux makefile entry that allows it
  4989. find the 64-bit curses or ncurses library. makefile, 29 Aug 2009.
  4990. Renamed aix4[23]: to oldaix4[23]: in makefile to fix the warning messages
  4991. I didn't notice before. I didn't want to remove them because they have
  4992. some special things that might still be needed, if anybody still has these
  4993. AIX versions. makefile, 29 Aug 2009.
  4994. Built on RHEL 5.3 64-bit, regular and with OpenSSL 0.9.8e. 31 Aug 2009.
  4995. Built on NetBSD 5.0.1/i386, regular and with OpenSSL 0.9.9-dev, 1 Sep 2009.
  4996. Changed SSL message to mention LD_LIBRARY_PATH (Solaris), SHLIB_PATH (HP-UX),
  4997. LIBPATH (AIX), or LD_LIBRARY_PATH (Linux). ck_ssl.c, 3 Sep 2009
  4998. Noticed that "make linux+openssl" fails to include -lutil a link time, which
  4999. it needs for openpty(). That's because this target is obsolete. I renamed
  5000. it to be oldlinux+openssl and added linux+openssl as a synonym for
  5001. linux+ssl. makefile, 3 Sep 2009.
  5002. Tested linux+openssl+zlib+shadow+pam, it's OK. Also linux+krb5. Also
  5003. linux+krb5+ssl. makefile, 3 Sep 2009.
  5004. Tried building on Solaris 9 with OpenSSL 0.9.8k with
  5005. solaris9g+openssl+shadow+pam+zlib, it failed like so:
  5006. ck_ssl.c:2875: error: conflicting types for 'inet_aton'
  5007. /usr/include/arpa/inet.h:52: previous declaration of 'inet_aton' was here
  5008. make[2]: [ck_ssl.o] Error 1
  5009. make[2]: Leaving directory hmt/sirius1/prv0/kd/fdc/solaris9ssl'
  5010. make[1]: [solaris2xg+openssl+zlib+pam+shadow] Error 2
  5011. make[1]: Leaving directory hmt/sirius1/prv0/kd/fdc/solaris9ssl'
  5012. make: [solaris9g+openssl+shadow+pam+zlib] Error 2
  5013. The problem was caused by including an inet_aton() function ck_ssl.c for
  5014. the benefit of platforms that don't have one in their libraries. This is
  5015. defeated by including NO_DCL_INET_ATON in KFLAGS. I added this, but then
  5016. I thought it would be a good idea to automatically sense the OpenSSL
  5017. version so we can automatically set OPENSSL_097 or OPENSSL_098 rather than
  5018. bombing out, so I added code to do that too, and also to set the Solaris
  5019. version number: 9, 10, or 11. The new entry is solaris9g+openssl.
  5020. ckcdeb.h, makefile, 3 Sep 2009.
  5021. Fixed a complaint in ckufio.c about implicit declaration of initgroups.
  5022. ckufio.c, 4 Sep 2009.
  5023. Built on Solaris 10 with gcc and Sun CC using new solaris{9,10,11} target
  5024. that is like the new solaris{9,10,11}g one but without the gccisms.
  5025. makefile, 4 Sep 2009.
  5026. Changed solaris{9,10,11}g+ssl target to set only the SSL-specific things and
  5027. then chain to the main solaris{9,10,11}g target. Tested OK on Solaris 9 and
  5028. 10. makefile, 4 Sep 2009.
  5029. Created solaris{9,10,11}+ssl target that is exactly like the
  5030. solaris{9,10,11}g+ssl except it chains to the solaris{9,10,11} target
  5031. instead of the solaris{9,10,11}g one. That is, it builds an SSL version of
  5032. C-Kermit using Sun CC rather than gcc. makefile, 4 Sep 2009.
  5033. Tried building on HP-UX 10.20, bundled (non-ANSI) compiler ("make
  5034. hpux1000"). This failed until I:
  5035. . Moved a struct initialization out of setextern(), ckuus3.c.
  5036. . Removed an ANSIism from the declaration of sigchld_handler() in ckutio.c
  5037. . Added a cast to strcmp() in zvuser(), ckufio.c.
  5038. Builds OK now. Built OK with "hpux1000o" (the ANSI compiler) too.
  5039. And with "hpux1000gcc". Couldn't test "hpux1000o+openssl". 21 Sep 2009.
  5040. The Sony Playstation 2 and 3 are 64-bit PowerPC platforms that can run Linux
  5041. if it is installed as an "other OS" on its hard disk; and the Linux kernel
  5042. since 2.6.21 supports the PS3 without any patching required. Pawel Rogocz
  5043. reported that "make linuxppc" (one of the old targets that has not yet been
  5044. integrated into the main "linux" target) compiles OK on 2.6.29-ydl61.3
  5045. (Yellow Dog Linux release 6.2 'Pyxis'), but fails at link time because
  5046. 'openpty' isn't found, because -lutil was not included, because that part
  5047. was added only to the main linux target. I asked him to try "make linux"
  5048. and he sent back a transcript in which there were thousands of errors from
  5049. the curses code ckuusx.c. Later I tried it myself and it built without a
  5050. hitch. My theory is that between then and now, a missing piece of the
  5051. ncurses library (/usr/include/ncursesw) was installed. 21 Sep 2009.
  5052. HP-UX 9.05 on PA-RISC 9000/712 building with hpux0900 (bundled compiler):
  5053. . ckutio.c compilation failed with PENDIN and FLUSHO not defined in
  5054. pty_make_raw(). I dummied definitions for them to handle this situation
  5055. on this or any other platform where it might crop up.
  5056. ckutio.c, 24 Sep 2009.
  5057. . Ditto for the PTY module, + IMAXBEL. ckupty.c, 24 Sep 2009.
  5058. . References to endusershell() were fatal in the bundled compiler. Changed
  5059. the hpux0900 target to define NODCLENDUSERSHELL, and put a special case
  5060. in ckufio.c to not put a cast in front of the call if NODCLENDUSERSHELL
  5061. is defined. Now it builds and links OK. makefile, ckufio.c, 24 Sep 2009.
  5062. HP-UX 9.05 on PA-RISC 9000/712 building with hpux0900o (optimizing compiler):
  5063. . Warnings in ckutio.c at line 14860 about arguments to select (pointers
  5064. are not assignment-compatible). "man select" says arguments are ints.
  5065. Defining INTSELECT fixes these warnings but results in fatal errors later
  5066. around line 14881 and others in the area involving FD_SET. This was too
  5067. involved so I put it back as it was. 24 Sep 2009.
  5068. Built OK on Solaris 10 with Sun CC. A couple warnings about implicit
  5069. function declarations for curses routines because apparently they aren't
  5070. declared in curses.h. Tuff. 25 Sep 2009.
  5071. Tried building on Solaris 10 with Sun CC and OpenSSL 0.9.8k, and this
  5072. uncovered various loose ends in the solaris9+openssl target, which I fixed.
  5073. makefile, 25 Sep 2005.
  5074. Fixed four typos in printfs in ck_ssl.c, \% instead of just %. 25 Sep 2009.
  5075. Squelched 20-some complaints about a character array being referred to
  5076. directly instead of by a pointer, plus several other similar nits to get rid
  5077. of all the compilation warnings on Solaris 10 with Sun C 5.8 Patch 121015-06
  5078. 2007/10/03. ckctel.c, ckctel.h, 25 Sep 2009.
  5079. Built the result on the same Solaris 10 system with gcc 4.2.4 using the
  5080. new solari10g+openssl target, working out a few kinks here too.
  5081. makefile, 25 Sep 2009.
  5082. Made consolidated Solaris 9/10/11 64-bit targets for gcc, solaris9g64,
  5083. solaris10g64, solaris11g64, tested on Solaris 10 Sparc. makefile, 25 Sep 2009.
  5084. Made consolidated Solaris 9/10/11 64-bit targets for Sun cc: solaris9_64,
  5085. solaris10_64, solaris11_64. These simply set a couple flags and chain to
  5086. the main solaris9 target. makefile, 25 Sep 2009.
  5087. Removed a bunch of old superfluous Solaris 9 and 10 targets: oldsolaris9,
  5088. oldsolaris9lfs, solaris9g64 solaris9g_64, oldsolaris10 old solaris10lfs,
  5089. oldsolaris10+openssl, oldsolaris10g+openssl, solaris10_64, oldsolaris10g,
  5090. solaris10g_64, solaris10g64. There are still plenty more to prune but it's
  5091. a start. makefile, 25 Sep 2009.
  5092. Added or fixed some missing prototypes in ckctel.h:
  5093. fwdx_send_xauth_to_xserver(), fwdx_parse_displayname. 25 Sep 2009.
  5094. Improved the instructions for building secure versions in the makefile,
  5095. using this example:
  5096. make solaris9+openssl "SSLINC=-I/opt/openssl-0.9.8k/include" \
  5097. "SSLLIB=-L/opt/openssl-0.9.8k/lib"
  5098. makefile, http://kermit.columbia.edu/security.html, 25 Sep 2009.
  5099. Built on HP-UX 11.11, 26 Sep 2009:
  5100. . make hpux1100 (ok)
  5101. . make hpux1100gcc (ok)
  5102. . make hpux1100o (gets a lot of warnings about sendpath and sendfile,
  5103. because they are also declared in <sys/socket.h>, but builds OK)
  5104. . make hpux1000gcc+openssl \
  5105. SSLINC=-I/opt/openssl/include SSLLIB=-L/opt/openssl/lib
  5106. Note: sendpath and sendfile are not Kermit symbols. The warnings are coming
  5107. from socket.h: 'Redeclaration of "sendfile" with a different storage class
  5108. specifier'. This is nothing new; see notes of 2-4 Jan 2005.
  5109. From Peter Eichhorn:
  5110. . Update to makefile to make current code build OK on HP-UX 8.00.
  5111. . Changes to format of some hints to make them more copy-and-pastable.
  5112. makefile, ckuu5.c, 28 Sep 2009.
  5113. From Peter Eichhorn: Changes to HP-UX 7.0 target to increase the switch table
  5114. stack size, which was overflowing. makefile, 30 Sep 2009
  5115. HP-UX 6.5 (1989), "make hpux0650tcpc"... (8:19...) Needed to not include
  5116. arpa/inet.h (which doesn't exist) and not use host address lists (add
  5117. -DNOHADDRLIST), which gets us past ckcnet.c, but in ckcftp.c we bomb out on
  5118. FD_SETSIZE undefined. Somehow we worked around this in ckcnet.c. Patched
  5119. in a definition in ckcftp.c, and also added -DINTSELECT to compiler flags.
  5120. Compiles ok, bombs at link time on bcopy, bzero, FD_ZERO, FD_SET, FD_ISSET.
  5121. Now it compiles and links OK but dumps core when started. Added
  5122. -DNOCKGETFQHOST, rebuilt from scratch (takes 35 minutes). It starts OK, but
  5123. it dumps core when given a "telnet xxx" command, where xxx is a hostname.
  5124. However, it works OK if an IP address is used: "telnet 123.45.6.78". It
  5125. took all day to track this down, but now it's fixed (see the #ifdef HPUX6
  5126. sections of ckcnet.c). So now (for the first time, I think) we have both
  5127. telnet and ftp in HP-UX 6.x, if anyone cares. ckcnet.[ch], ckcftp.c,
  5128. makefile, 2 Oct 2009.
  5129. Changed default SET TERMINAL TYPE type for K95 from vt320 to vt220. This is
  5130. because Unix OS's such as Solaris have dropped vt320 as a terminal type.
  5131. settrmtyp(), ckuus7.c, 5 Oct 2009.
  5132. I moved the PUTENV command code, which was inline, to a function, doputenv().
  5133. ckuus[r7].c, ckuusr.h, 5 Oct 2009.
  5134. Changed the UNIX version of SET TERMINAL TYPE to take a value and then do
  5135. the equivalent of "export TERM=value" by calling doputenv(). This sets
  5136. \$(TERM) correctly and passes its value along to inferior processes.
  5137. However, to make this take effect within Kermit itself (for the fullscreen
  5138. file transfer display and for the SCREEN command, Ctrl-L, etc) I also had to
  5139. reinitialize the curses database, which is tricky because normally if you
  5140. feed it an unknown terminal name, it just exits. ckuus7.c, 5 Oct 2009.
  5141. Changed the little-known and little-used RESET command (which closes all
  5142. open files) to also put command echoing back to normal in case it got
  5143. messed up somehow (as in HP-UX 6.5, upon returning from PUSH).
  5144. ckuusx.c, 5 Oct 2009.
  5145. For Unix, increased string buffer sizes for wildcard expansion for all
  5146. platforms that have BIGBUFOK defined from 500000 (0.5M) to 10000000 (10M)
  5147. bytes, and for 64-bit builds to 2000000000 (2G) bytes. No point making
  5148. it bigger than that because malloc's argument is a size_t, which is an int.
  5149. ckufio.c, 5 Oct 2009.
  5150. Built on Mac OS X 10.4.11, required one minor adjustment to the makefile
  5151. (-DNODCLINITGROUPS). This was using the macosx10.5 target, which is
  5152. supposed to be universal like the linux and netbsd targets, but not yet
  5153. proven. Also built a 64-bit version (-mpowerpc64 -mcpu=G5 -mtune=G5
  5154. -arch ppc64); it compiles and links OK but won't start: "Bad CPU Type
  5155. in executable". Fix later... makefile, 5 Oct 2009.
  5156. Changes from Seth Theriault to suppress signed vs unsigned char warnings in
  5157. Mac OS 10.5.8 from gcc4, and a new makefile target for Mac OS X (presumably
  5158. 10.3.9 or later) + Kerberos 5 and OpenSSL. ckutio.c, ckuath.c, ckctel.c,
  5159. ckcnet.c, ckcftp.c, ck_crp.c, makefile, 6 Oct 2009.
  5160. Later I had to back out of these, because although it made for a
  5161. clean build, in the resulting executable SSL connections didn't work.
  5162. Tue Oct 6 17:23:27 2009
  5163. FTP address resolution is broken, but ftp_hookup() hasn't changed.
  5164. So... (see the #ifdef HPUX6 sections of ckcnet.c) (I did, and I rolled
  5165. back some of the changes from the other day, but it made no difference.)
  5166. Putting back the ckcftp.c from a few weeks ago makes no difference.
  5167. Putting back the ckcnet.c from a few weeks ago makes no difference.
  5168. Added patches from Seth Theriault so macosx10.5+krb5+openssl would build
  5169. on Mac OS X 10.3.9. makefile, ckcftp.c, 7 Oct 2009.
  5170. Built today's code on Linux RHEL4, NetBSD 5.0.1, Solaris 9, and Mac OS X
  5171. 10.4.11, both with and without SSL. The NetBSD system has OpenSSL 0.9.9-dev.
  5172. 7 Oct 2009.
  5173. In Mac OS X 10.6, the following symbols are unresolved at link time:
  5174. _des_key_sched, _des_new_random_key, _des_ecb_encrypt,
  5175. _des_init_random_number_generator, _des_fixup_key_parity. This is
  5176. with OpenSSL 0.9.8k. But it doesn't happen on other platforms that
  5177. have 0.9.8k.
  5178. Added SET SESSION-LOG NULL-TERMINATED-TEXT. This is for the benefit of a
  5179. speech synthesizer that will speak a line of text only after receiving a
  5180. NUL character. A more general solution would be to define a filter or
  5181. whatever, but who has time. ckuus[23x].c, 7 Oct 2009.
  5182. Consolidated Mac OS X targets, and removed experimental 64-bit ones, because
  5183. they never could work in 10.5 and earlier because 64-bit libs are missing,
  5184. and 10.6 and later are 64-bit automatically. makefile, 8 Oct 2009.
  5185. Built on Mac OS X 10.6.1. It came out automatically as a 64-bit build
  5186. because __LP64__ is defined somewhere that I can't find. But this explains
  5187. why the 0.9.8k on 10.6 comes up with missing symbols when the 0.9.8k lib
  5188. 10.5 (or on Solaris or on Linux) does not: it's a different library: "Mach-O
  5189. 64-bit dynamically linked shared library x86_64", rather than "Mach-O
  5190. dynamically linked shared library ppc". Probably the 64-bit version has
  5191. some things #ifdef'd out. Added -m32 to the CFLAGS and LNKFLAGS for the
  5192. macosx+krb5+openssl targets, and it built OK one time. But then the errors
  5193. came back. makefile, 8 Oct 2009.
  5194. Updated C-Kermit installation for Mac OS X in ckuwr.html on the website.
  5195. 8 Oct 2009.
  5196. Tried some things to get around the problem with OpenSSL in Mac OS X 10.6,
  5197. to no avail. Asked Jeff. He said, "MacOS X no longer includes DES anywhere
  5198. on the system. Not for SSL, not for Kerberos, not for anything. This will
  5199. increasingly become the situation on new operating systems. Windows 7 and
  5200. 2008 R2 will also ship with no DES." Sure enough, the Mac OS X Server
  5201. Upgrading and Migrating document for 10.6 says, "Mac OS X Server v10.6 does
  5202. not support single DES encryption. It supports AES 128 and 256 encryption
  5203. types. However, during a migration or upgrade from v10.4 to v10.6, servers
  5204. that were Kerberized by the v10.5 Open Directory server will not use the AES
  5205. 128 or 256 encryption types. To use the AES 128 or 256 encryption types you
  5206. must re-Kerberize all servers." 12 Oct 2009.
  5207. DES and 3DES encryption can be excluding removing the -DCK_DES flag. I
  5208. removed this one and -DLIBDES (and -m32) and this makes a working 64-bit
  5209. version. Then I added code to the macosx+krb5+openssl target to use these
  5210. flags if the Mac OS X version was 10.5 or less and leave them out for 10.6
  5211. or later. Tested on 10.4.11 and 10.6.1. A better way to do it might have
  5212. been "nm -gj libssl.dylib | grep des_", but that gives the same results on
  5213. 10.4 and 10.6. Also, 10.6 still has /usr/include/ssl/des.h.
  5214. makefile, 13 Oct 2009.
  5215. Next issue:
  5216. In file included from ckutio.c:15674:
  5217. /usr/lib/gcc/i386-redhat-linux/3.4.6/include/varargs.h:4:2: #error "GCC no
  5218. longer implements <varargs.h>."
  5219. /usr/lib/gcc/i386-redhat-linux/3.4.6/include/varargs.h:5:2: #error "Revise
  5220. your code to use <stdarg.h>."
  5221. The problem occurs when trying to force a non-ANSIC build with GCC.
  5222. Changing the source file to include <stdarg.h> instead of <varargs.h>
  5223. doesn't help because evidently <stdarg.h> requires an ANSI C compiler.
  5224. Nothing can be done about this. 13 Oct 2009.
  5225. Next issue: Can't compile ckcftp.c with -DNOCSETS or -DNOSPL; some
  5226. #ifdef/#endif doesn't match up. Sigh, this is the hardest kind of thing to
  5227. debug. There's 17,622 lines of code in this module and no tool that I know
  5228. of.... Wait, I wrote one. But it shows all the #if/#ifdef/#ifndef's and
  5229. #endifs matching up just fine. Backing off to ckcftp.c of a few days ago
  5230. (before char / unsigned char casts were added), I see that it builds OK, so
  5231. I backed off to that one, but put back the special case #ifdef for MACOSX103
  5232. declaring CONST gss_OID_desc, and it builds OK (the other stuff was purely
  5233. cosmetic, when will I learn?). ckcftp.c, 13 Oct 2009.
  5234. Protected cvtstring() and related functions with #ifdef NOCSETS..#endif,
  5235. and ditto for the character-set conversion code in dorename().
  5236. ckuus6.c, 13 Oct 2009.
  5237. Fixed an #endif /* TNCODE */ that was a line too low in ttptycmd(),
  5238. causing -DNONET builds to fail. ckutio.c, 13 Oct 2009.
  5239. There was a reference to doputenv() that wasn't guarded by #ifndef NOPUTENV,
  5240. fixed in ckuus7.c, 13 Oct 2009.
  5241. Moved doputenv() and settermtyp() out of an #ifdef NOLOCAL section because
  5242. these are useful even when not making connections. ckuus7.c, 13 Oct 2009.
  5243. Moved havelfs declaration outside of #ifdef NOXFER because it was also used
  5244. for other things. ckcmai.c, 13 Oct 2009.
  5245. COPY /PRESERVE depended on code from the Kermit protocol module, which
  5246. is omitted in -DNOXFER builds. Disabled COPY /PRESERVE in -DNOXFER
  5247. builds. ckuus6.c, 14 Oct 2009.
  5248. SHOW PROTOCOL code for external protocols had to be #ifdef'd out for
  5249. -DNOPUSH builds. ckuus4.c, 14 Oct 2009.
  5250. There was some confusion between "No XYZMODEM" and "No external protocols";
  5251. cleared up in ckuus3.c, 14 Oct 2009.
  5252. After all that, 86 different combinations of feature selections built OK on
  5253. Linux. And the Kerberized version (K5) works OK on Linux for Telnet and FTP.
  5254. 14 Oct 2009.
  5255. Changed version number to 9.0. All modules, 16 Oct 2009.
  5256. Need to make LOG SESSION log to a tty. Right now "log session
  5257. /dev/ttyKeySerial1" says "Write permission denied" even though the device is
  5258. crw-rw-rw-. This happens in zchko(), which is called by cmofi(). The
  5259. problem is that /dev/ is not writeable. I added a Unix-only clause that
  5260. attempts to open the file for write access using open(), in order to get a
  5261. file descriptor, which then can be passed to isatty() to check if it's a
  5262. tty, and if so, to allow access. And then close it. I tested this on Mac
  5263. OS X as follows:
  5264. log session /dev/ttyKeySerial1
  5265. telnet somehost
  5266. The Mac's serial port was connected to the serial port of another computer
  5267. where Kermit displayed the incoming characters in CONNECT mode. Glitches:
  5268. 1. The port has to be set up as desired in advance, outside of Kermit.
  5269. 2. log session /dev/ttyKeySerial1 will hang if any required modem signals
  5270. are not present when the port is opened.
  5271. 3. Bypasses lockfile mechanism - so we do this only if -DNOUUCP.
  5272. For (2), I tried setting O_NDELAY / O_NONBLOCK, and this allowed zchko() to
  5273. continue, but then it freezes in the subsequent fopen(). So I changed
  5274. zopeno() to also check if the device is a serial port, and if so, to open()
  5275. it with O_NDELAY / O_NONBLOCK, and then convert the file descriptor into a
  5276. file pointer with fdopen().
  5277. Now for the speaking device that needs lines to be terminated by NUL...
  5278. set session-log binary <-- need to put these in SHOW LOG
  5279. set session-log null-padded (and in HELP SET LOG)
  5280. set line /dev/ttyKeySerial1
  5281. This part works.
  5282. This feature is enabled only for -DNOUUCP builds because serial ports aren't
  5283. like other Unix files; we would have to create a lockfile, but we can't do
  5284. that... actually, ttlock() takes a name as an argument, but ttunlck() does
  5285. not, so there would be no way to remove the lock. Anyway, there is only one
  5286. API for configuring the port (speed, flow control, etc) and it only works
  5287. with the SET LINE device, not any random file. To fix this would require
  5288. massive redesign and changes. ckuus[23].c, ckufio.c, 19-20 Oct 2009.
  5289. I made -DNOUUCP the default for Mac OS X, since everybody winds up building
  5290. it that way anyhow. To undo this, do "make macosx KFLAGS=-UNOUUCP".
  5291. makefile, 21 Oct 2009.
  5292. Changed SET SESSION-LOG TEXT to strip out ANSI escape sequences;
  5293. previously there wasn't that much difference between TEXT and BINARY logs.
  5294. It's still not perfect; for example it doesn't delete characters that the
  5295. user erased. (Made sure this still builds with -DNOESCSEQ.)
  5296. ckucns.c, 22 Oct 2009.
  5297. Changed SHOW LOG to show the SET SESSION-LOG settings, as well as
  5298. SET DEBUG, which was not shown before. ckuus5.c, 22 Oct 2009.
  5299. If a series of PUTENV commands is given, each new one undoes the previous
  5300. one, so only the last definition is seen by the new fork (or by Kermit
  5301. itself). Turns out you can't feed automatic variables to putenv(); they
  5302. have to be static, so to allow for multiple PUTENV commands Kermit has to
  5303. maintain an array of static strings. ckuus7.c, 6 Nov 2009.
  5304. From Seth Theriault, a better way for the makefile to determine the
  5305. Mac OS X version number; there's a program for this, sw_ver. makefile,
  5306. 6 Nov 2009.
  5307. Peter Eichhorn reported that file-transfer failure hints were not coming
  5308. out since Dev.27. The only change I made since then was to skip them if
  5309. the file-transfer protocol was not Kermit. I was using the wrong variable
  5310. in the tests, 'proto' instead of 'protocol'. ckuus5.c, 6 Nov 2009.
  5311. Changed Mac OS X targets to correctly extract the Mac OS major version
  5312. from uname -r in order to choose correctly between utmp and utmpx; this
  5313. wasn't working in 10.6.1. makefile, 6 Nov 2009.
  5314. Fix from Seth T. for an oversight in the previous edit. Also add
  5315. MACOSX103 to "show features" display. makefile, ckuus5.c, 10 Nov 2009.
  5316. Added REJECT as a synonym for DISCARD in SET FILE COLLISION; it's more
  5317. intuitive and more accurate. ckuus[27].c, 15 Nov 2009.
  5318. \fsplit() and \fword() always break on 8-bit characters unless you explicitly
  5319. put every single 8-bit value into the include set, e.g. (for a TSV file):
  5320. undef include
  5321. for \%i 128 255 1 {
  5322. if == \%i 9 continue
  5323. .include := \m(include)\fchar(\%i)
  5324. }
  5325. .\%n := \fsplit(\m(line),&a,\9,\m(include))
  5326. I changed cksplit() to treat all 8-bit bytes 128-255 as non-break characters
  5327. by default. It might have made more sense to do this for 160-255 (since
  5328. 128-159 are traditionally C1 control characters) but thanks to Microsoft
  5329. tradition is out the window. To treat one or more 8-bit characters as break
  5330. characters, put them in the break set. This might break some scripts, but I
  5331. doubt it because this flaw was so awful that if anyone had come up against
  5332. they would have let me know. ckclib.c, 16 Nov 2009.
  5333. Changed the netbsd target to set -funsigned-char, since cc on NetBSD is
  5334. actually gcc. makefile, 16 Nov 2009.
  5335. Changed macosx targets to get the CPU type from the HOSTTYPE environment
  5336. variable. Also added getenv("HOSTTYPE") as a last-resort method to set the
  5337. \v(cpu) variable at runtime (maybe it should be the first resort?)...
  5338. ckuus4.c, makefile, 16 Nov 2009.
  5339. Made sure the solaris9_64 and solaris10 targets still work. 16 Nov 2009.
  5340. Made sure the current source package builds OK on HP-UX 10.20... Got a lot
  5341. of "warning 6062: Optdriver: Exceeding compiler resource limits in xxx; some
  5342. optimizations skipped. Use +Onolimit if override desired" but it builds OK.
  5343. Tested long file transfer; works OK. 17 Nov 2009.
  5344. Built on FreeBSD 7.2 with and without OpenSSL, all OK. 17 Nov 2009.
  5345. Built on NetBSD 5.0.1 with and without OpenSSL, all OK, but netbsd+krb5
  5346. fails with "can't find -lgssapi_krb5"; worked around this with
  5347. "K5LIB=-L/usr/local/kerblib" (where the lib actually is on this host) but
  5348. then it failed with "ckcftp.c:13868: error: 'gss_nt_service_name' undeclared".
  5349. 17 Nov 2009.
  5350. I found a VMS 6.2 system... Takes a loooong time to build there. In
  5351. ckuusy.c, DEC C didn't like the prototypes and declarations of dorlgarg()
  5352. and dotnarg() as static so I made them not static. But that didn't help,
  5353. now it fails at the very end, saying the final #ifdef is an invalid
  5354. statement. It looks like an #ifdef mismatch that affects only VMS. I ran
  5355. my #ifdef matcher, it turned up nothing. I substituted a copy of ckuusy.c
  5356. from 2007, it comes up with the same errors. Then I substituted the copy
  5357. from 8.0.211 from 2004, and this one compiled OK and, miraculously, the
  5358. whole mess even linked OK and runs OK. The Alpha binary is 2.84MB. Now I
  5359. have 4500 lines of code to compare.... I went through the two files line by
  5360. line and I can't see a single thing wrong. I gave up and tried building the
  5361. TCP/IP version. It builds fine except for ckuusy.c, with the utterly
  5362. useless error message:
  5363. #endif /* NOCMDL */
  5364. ...................^
  5365. %CC-E-BADSTMT, Invalid statement.
  5366. Indicating the last line in the file. Just for the heck of it, I put
  5367. another line after that one:
  5368. /* This is a test */
  5369. and got:
  5370. /* This is a test */
  5371. ....................^
  5372. %CC-E-BADSTMT, Invalid statement.
  5373. So it is not objecting to anything in the file. Trying the old LISP trick,
  5374. I put an extraneous closing bracket after that. Success! Honestly, I don't
  5375. see anything wrong with file. It's DEC C V5.3-006. I suspect a C bug.
  5376. I'll leave it like this for now until I get access to some other VMS
  5377. versions. Another clue is that when building the network version I get a
  5378. horrible warning I never saw before from a module that hasn't been touched
  5379. in a very long time (ckvrtl.c). Also, in the network version, I note that
  5380. the FTP code is not compiled in. We have to try this again with some
  5381. command-line switches, but it'll do for now. ckuusy.c, 18 Nov 2009.
  5382. ---C-Kermit 9.0 Alpha.01---
  5383. From Steven Schweda (SMS), the real solution for the VMS closing brace
  5384. problem, it wasn't a DECC bug, it was a me bug. ckuusy.c, 20 Nov 2009.
  5385. Rediscovered the new VMS build options: f for Long Files, i for Internal
  5386. FTP. "make mnf" doesn't work on VMS 6.2, it looks like the VMS definition
  5387. for CK_OFF_T got lost. Same thing with "make mfi". Come back to this later.
  5388. From Gerry Belanger, a fix to INPUT /COUNT:n. ckuus4.c, 26 Nov 2009.
  5389. Added \fsqueeze(s), returns string s with leading and trailing whitespace
  5390. removed, Tabs converted to Spaces, and multiple spaces converted to single
  5391. spaces. For now, ASCII only, no options. ckuusr.h, ckuus[24].c, 27 Nov 2009.
  5392. I wrote a Kermit script to read a big file of addresses on Solaris 9,
  5393. \fsqueeze()ing each line. After about 14000 lines, there was a malloc
  5394. failure in getnct() (the command-file reader). There's nothing wrong with
  5395. \fsqueeze(), the failure is on a deeper level, because the same thing
  5396. happens if I use \fupper() (which is structurally identical to \fsqueeze())
  5397. in the same script. The problem is not in getnct() either, because every
  5398. malloc() is freed (I checked). On the other hand, the same script (with
  5399. \fupper() instead of \fsqueeze() completes OK in C-Kermit 8.0.201. If I
  5400. remove the function call (\fsqueeze() or \fupper()) from the script, it also
  5401. runs OK in 9.0. This seems to point the finger at fnevel(), which contains
  5402. countless malloc's and free's. But comparing fneval() between 8.0.211 and
  5403. 9.0, I don't see any difference that would explain this behavior -- nothing
  5404. at all that involves malloc(), makstr(), or free(). Nor any pertinent
  5405. change in the caller (zzstring) of fneval(). 27 Nov 3009.
  5406. Another problem is that when this happens, the error is not caught (e.g. by
  5407. the IF FAIL statement after the command that contains the function call);
  5408. instead, C-Kermit returns immediately to its prompt. 27 Nov 2009.
  5409. It could simply be that some of the buffers we allocate are much bigger now.
  5410. But again, I don't see much difference between 8.0.211 and 9.0; we were
  5411. already allocating 32K command-related buffers (malloc() takes a size_t, and
  5412. size_t is an int almost everywhere). I built the same source on NetBSD and
  5413. ran the same script (with \fqueeze()), and it worked fine. Let's worry
  5414. about this later, if it comes up. 27 Nov 2009.
  5415. Built OK on Silicon Graphics IRIX 6.5 R10000; regular build OK, SSL and
  5416. Kerberos builds failed. 30 Nov 3009.
  5417. Tried to build on Digital Unix 4.0F but it blew up in ckutio.c, apparently
  5418. not recognizing any of the terminal struct symbols from termios.h. Tried
  5419. again with gcc, same thing. Tried explicitly #including <sys/termios.h>
  5420. within #ifdef TRU64, same thing. What could have changed? 30 Nov 2009.
  5421. Built OK on Linux RHEL5.4/Itanium-2, make linux. The secure build
  5422. required "FLAGS=-DNO_KRB5_INIT_ETS" and built OK. 30 Nov 2009.
  5423. Built OK on Digital Unix 4.0F using "make osf" instead of "make tru64-40f".
  5424. I don't know why the specific target doesn't work, but it's not worth
  5425. chasing down. 2 Dec 2009.
  5426. Built OK on MirBSD 10, despite a lot of gratuitous compiler warnings. Built
  5427. OK on MirBSD 10, OpenBSD 4.5, and Fedora 10. 3 Dec 2009.
  5428. (Various other successful Unix builds in these weeks...)
  5429. Built on VMS 7.2 and 8.3 with and without TCP/IP, no problems. 11 Jan 2010.
  5430. Built on VMS 8.3 with "make fi" to include the FTP client and long-file
  5431. support (mid Jan 2010).
  5432. Built on VMS 8.3 with UXC 5.6 and HP SSL 1.3, which is OpenSSL 0.9.7e.
  5433. It compiled and linked OK but when I tried to make an FTP SSL connection
  5434. it crashed in SSL$LIBSSL_SHR, which is called from ssl_auth(), after having
  5435. had TLS accepted as an authentication type, but before actually
  5436. authenticating. In Unix:
  5437. 19. ftp open ftp.somecompany.com /user:pge.com/test_quota /password:xxxxxx
  5438. Connected to ftp.somecompany.com.
  5439. 220-Somecompany FTP v6.0 for WinSock ready...
  5440. 220 Welcome to the online storage FTP server. Please check the main web
  5441. site for system announcements and AUP. (O)
  5442. ---> AUTH TLS
  5443. 234 AUTH command OK. Initializing SSL connection.
  5444. TLS accepted as authentication type
  5445. SSL DEBUG ACTIVE
  5446. =>START SSL/TLS connect on COMMAND
  5447. In VMS:
  5448. 19. ftp open ftp.somecompany.com /user:pge.com/test_quota /password:xxxxxx
  5449. Connected to ftp.somecompany.com.
  5450. 220 Somecompany FTP v6.0 for WinSock ready...
  5451. ---> AUTH TLS
  5452. 234 AUTH command OK. Initializing SSL connection.
  5453. TLS accepted as authentication type
  5454. SSL DEBUG ACTIVE
  5455. %SYSTEM-F-ACCVIO, access violation, reason mask=04, virtual
  5456. address=FFFFFFFF8001A120, PC=000000000068B118, PS=0000001B
  5457. Note: The Unix version received the second 220 response, the VMS version did
  5458. not. That's odd, it's the same code... 25 Jan 2010.
  5459. Added some essential details to the HELP FSEEK text. ckuus2.c, 25 Jan 2010.
  5460. Discovered that the result returned by \fsearch() is totally unreliable.
  5461. This is probably too hard to fix.
  5462. FSEEK did not pay attention to SET CASE, searches were always case sensitive.
  5463. Fixed in ckuus7.c, 26 Jan 2010.
  5464. FSEEK failed to find anything if the search pattern was matched in the first
  5465. line of the file. Fixed in ckuus7.c, 26 Jan 2010.
  5466. \fword() and \fsplit().... Another change, but not backwards-incompatible.
  5467. One may now put the word ALL (just like that, all uppercase) as the include
  5468. set (4th argument) to indicate that there will be no break characters other
  5469. than those explicitly given in the break set, e.g. \fsplit(\m(xx),&a,:,ALL)
  5470. breaks a line only on a colon (:), nothing else. The original rules for
  5471. cksplit() were more than a little counterintuitive: the default break set is
  5472. all non alphanums, and the default include set is all alphanums, so if you
  5473. wanted to parse (say) a CSV file, breaking only on comma, you had to think
  5474. of all the characters you wanted to keep. This way you just say ALL.
  5475. ckclib.c, 26 Jan 2010.
  5476. Speaking of CSV files... How can you put comma as a function argument when
  5477. comma is the function-argument separator? Use one of these forms:
  5478. \fsplit(\m(xx),&a,",",ALL)
  5479. \fsplit(\m(xx),&a,{,},ALL)
  5480. \fsplit(\m(xx),&a,\44,ALL)
  5481. \fsplit(\m(xx),&a,\fchar(44),ALL)
  5482. From John Dunlap, U. of Washington Applied Physics Lab: 'When "stty -a <
  5483. /dev/ttyS0 | grep crtscts" shows "crtscts" (not "-crtscts") and when using a
  5484. three wire serial interface and when asking kermit to not use flow control
  5485. (set flow none) then "ckutio.c1" (see attachments) fails while "ckutio.c"
  5486. works. The result of "diff -u ckutio.c1 ckutio.c" is attached as "diffs"'.
  5487. ckutio.c, 26 Jan 2010.
  5488. Changed the year from 2009 to 2010 in the modules I worked on today and in
  5489. the heralds, etc. ckckmai.c, ckuus5.c, ckutio.c, ckclib.c, ckuus7.c,
  5490. 26 Jan 2010.
  5491. Built on Linux Fedora Core 3, regular and with OpenSSL 0.9.7a. Built on
  5492. Ubuntu 9.4 OK, but SSL and Kerberos builds failed due to not finding libs
  5493. and/or header files. I'm sure this could be fixed... 27 Jan 2010.
  5494. Added SSL, KRB4, and KRB5 to the startup herald for versions that were
  5495. built with SSL, Kerberos 4, or Kerberos 5. Built OK on Fedora 3 with
  5496. linux+krb5+ssl and new banner shows correctly. ckuus5.c, 27 Jan 2010.
  5497. Set NO_KRB5_INIT_ETS by default in ckuath.h since krb5_init_ets() is a no-op
  5498. in Kerberos 1.4.x and later and in some installations it can't be found,
  5499. which clobbers the build. ckuath.h, 27 Jan 2010.
  5500. Adapted to MINIX 3 1.5, the first version that has virtual memory according
  5501. to Andy T, who should know. On earlier versions (e.g. MINIX 3 1.2) any
  5502. attempt to build C-Kermit causes the compiler to crash. Now the compiler
  5503. doesn't crash but it spews out countless warnings about old-fashioned
  5504. function declarations that I don't get anywhere else. The real problems
  5505. came in ckutio.c where numerous symbols were undefined at compile time and
  5506. the POSIX function tcgetpgrp() was not found at link time, even though there
  5507. is a prototype for it in the MINIX header files, and there is no alternative
  5508. (since POSIX doesn't let us use ioctl()). Also note that there is some
  5509. confusion over the compile-time symbols MINIX, MINIX2, MINIX3, and MINIX315.
  5510. You would expect MINIX to mean "any version of MINIX" but in some parts of
  5511. ckutio.c it means MINIX 1.0. I sincerely doubt that C-Kermit 9.0 can be
  5512. built on any version of Minix before 3.1.5 so I removed the confusion and
  5513. made MINIX mean "any Minix". It builds on 3.1.5 OK now, except for the FTP
  5514. client. This can probably be fixed but... Modules changed: ckcdeb.h,
  5515. ckuver.h, ckcmai.c, ckuus5.c, ckutio.c, 1 Feb 2010.
  5516. Later.. Andy says MINIX does not support job control, so no program is ever
  5517. in the background. That settles that! 1 Feb 2010.
  5518. Built OK on Minix, Linux, Mac OS X, Solaris 9, NetBSD 5.0.1... 1 Feb 2010.
  5519. ---C-Kermit 9.0 Alpha.02---
  5520. From Christian Corti at Uni-Stuttgart.de: fixes to allow building on SunOS
  5521. 4.1, which once was my main development platform but which is long-gone from
  5522. here. ckupty.c, ckutio.c, 9 Feb 2010. (He says it is also necessary to
  5523. comment out the "struct winsize" and "struct ttysize" in sys/ioctl.h;
  5524. otherwise there will be a conflict with sys/ttycom.h (included by termios.h)
  5525. which also declares these structs. But you need both includes.')
  5526. From John Dunlap, a fix for Kermit protocol fixed packet-timeout interval
  5527. going to a unexpected value (missing else clause in two places).
  5528. ckcfn2.c, 9 Feb 2010.
  5529. Added an aixg target to build on AIX with gcc when gcc is not installed as
  5530. cc, and also added CC=$(CC) CC2=$(CC) clauses to the aix and aix+ssl
  5531. targets. Wow, AIX really loses bigtime when receiving files through its ssh
  5532. server. Streaming can't be used, sliding windows recover from errors but
  5533. there are tons of them using the default 4K packets; 500 works much better.
  5534. Built with IBM cc and gcc, and also tested (successfully) the new aix+ibmssl
  5535. target, in which the OpenSSL headers and libs are in a standard place.
  5536. makefile, 9 Feb 2010.
  5537. In ckupty.h, make the #include <sys/ioctl.h> be #ifndef SUNOS41.
  5538. From Christian Corti. 10 Feb 2010.
  5539. Built on VMS E8.4. 12 Feb 2010.
  5540. Tried to build on a real VAX-11/785 but the machine seems to be seriously
  5541. wedged. 12-15 Feb 2010.
  5542. Added note to CKVKER.COM to the effect the the 'f' option has no effect
  5543. on VAX architecture. 15 Feb 2010.
  5544. Moved the #include "ckvrtl.h" in the FTP module to below the include for
  5545. utime.h, because building the VMS version with the 'i' option (meaning
  5546. "include internal ftp client") results in "struct utimbuf tp" erroring out
  5547. because struct utimbuf is not defined yet (at least in some version of VMS
  5548. with some version of C). From Rob Brown, ckcftp.c, 20 Feb 2010.
  5549. From Martin Vorlaender: new code in VMS C-Kermit build procedure to detect
  5550. OpenSSL version automatically. ckvker.com, 22 Feb 2010.
  5551. Added code to INPUT command to strip ANSI escape sequences. It's activated
  5552. by SET SESSION-LOG TEXT. ckuusr.h: added prototype for chkaes();
  5553. ckucon.c, ckucns.c: made inesc[] and oldesc[] global instead of static;
  5554. ckuus4.c: doinput() code for skipping escape sequences. 1 Mar 2010.
  5555. Peter Eichhorn complained that if you make an ssh connection with Kermit,
  5556. then log out from the ssh host, and then use a "connect" command to
  5557. make a new connection to the same host (which you can do with Telnet),
  5558. Kermit says (e.g.):
  5559. DNS Lookup... Can't get address for ssh -e none somehostname
  5560. Sorry, can't open ssh -e none somehostname: Error 0
  5561. I added code to detect and handle this case and it seems to work OK, even
  5562. though it's kind of a hack. ckuusr.[ch], ckuus7.c, 1 Mar 2010.
  5563. There has never been a clean way to put debugging messages (ECHO commands)
  5564. in a script which are executed only if debugging is desired and ignored
  5565. otherwise. You'd have to set a random variable and test it, or define a
  5566. macro or whatever. To make this more straightforward, I added SET DEBUG
  5567. MESSAGE ON/OFF/STDERR, and added a new MESSAGE (syn: MSG) command for printing
  5568. debugging messages to stdout if SET DEBUG MESSAGE is ON or to stderr if SET
  5569. DEBUG MESSAGE is STDERR. ckcmai.c, ckuus[r23].c, 12 Mar 2010.
  5570. Also for debugging and error messages, I added \v(lastcommmand) so that
  5571. the command that failed can be included in an IF FAIL or DEBUG error message.
  5572. This works even for commands that have syntax errors.
  5573. ckuusr.h, ckuus5.c, ckucmd.c, 12 Mar 2010.
  5574. From SMS for VMS: 'Added/documented P3 options INTSELECT, OLDFIB, OLDIP.
  5575. Disabled (commented out) automatic definition of NOSETTIME for VMS before
  5576. V7.2 (vms_ver .lts. "VMS_V72").' ckcdeb.h, ckcftp.c, ckcnet.c, ckuus[2567].c,
  5577. ckvfio.c, ckvker.com, ckvrtl.[ch], 15 Mar 2010.
  5578. Exposed inesc[] and oldesc[] for VMS, so new INPUT command escape-sequence
  5579. stripping can work (really, chkaes() and related global variables should be
  5580. moved out of ck[uvd]con.c/ckucns.c and into a common module; do that later).
  5581. ckuusr.h, ckvcon.c, 15 Mar 2010.
  5582. Built OK on Solaris9, Mac OS X 10.4.11, RHEL4 (32-bit), RHEL5 (64-bit),
  5583. AIX 5.3, SCO OpenServr 6.0.0... 15 Mar 2010.
  5584. Not so good on VMS, turns out I made a typo in one of the VMS updates
  5585. (#ifndef OLDIP instead of #ifdef...). ckcnet.c, 16 Mar 2010.
  5586. More from SMS for VMS, 16 Mar 2010:
  5587. . Set MAXPATH correctly for VMS, ckcdeb.h.
  5588. . NAM -> NAML, QIO replaces system( "SET PROTECTION"), bugfixes in
  5589. cvtdir() and nzltor(), ... (See comments): ckvfio.c, new ckvrms.h.
  5590. (The RMS code in ckvfio.c was almost totally rewritten)
  5591. . Moved "NAMX$*" (and related) macros to ckvrms.h, and renamed to
  5592. "NAMX_*" (and similar "$" -> "_"), moved "FIB_*" macros from ckvrtl.c.
  5593. These changes are mainly to accommodate the ODS5 file system, which has
  5594. longer and mixed-case filenames, and also to execute certain commands
  5595. (e.g. for setting file protection, deleting directories) directly instead
  5596. of using a system() command.
  5597. Built OK on VMS 8.3 (with and without network support). 16 Mar 2010.
  5598. Failed to build on VMS 6.2. 16 Mar 2010.
  5599. FreeBSD 8.0 <libutil.h> has a hexdump() prototype that conflicts with the
  5600. hexdump macro defined in ckcdeb.h. Since the same thing is likely to happen
  5601. elsewhere, I changed the Kermit macro to ckhexdump as well all references to
  5602. it: ckcdeb.h, ckcftp.c, ckcnet.c, ckctel.c, ckuath.c, ckutio.c, 16 Mar 2010.
  5603. Built OK on Digital Unix Tru-64 4.0E using "make osf", 16 Mar 2010.
  5604. Tried again to build Digital Unix Tru64 4.0E using "make tru64-40e", but
  5605. something prevents it from picking up the termios symbols and it blows up in
  5606. ckutio.c, whereas this used to work in earlier C-Kermit versions. This is
  5607. the only Tru64 system I still have access to, so I can't tell if it's a
  5608. local peculiarity or what. Note that POSIX is not defined for this build.
  5609. But if I define it, I get into trouble with "struct timeval". Tried again
  5610. with "KFLAGS=-DPOSIX -DNOTIMEVAL" but that doesn't help. Tried "make
  5611. dec-osf" and that worked OK but oddly enough it makes a Kermit with less
  5612. features than "make osf". 16 Mar 2010.
  5613. To go with MESSAGE and SET DEBUG MESSAGE, I added IF DEBUG, which is true
  5614. if SET DEBUG MESSAGE is not OFF and false otherwise. ckuusr.h, ckuus6.c,
  5615. 16 Mar 2010.
  5616. From SMS: Corrections to my merging of SMS's changes, ckcftp.c, ckvrtl.h.
  5617. Builds OK on VMS 6.2 now. Also did an SSL build on VMS 8.3 with OpenSSL
  5618. m0.9.7e and "OPENSSL_DISABLE_OLD_DES_SUPPORT" was included in P3
  5619. automatically by Martin V's addition to ckvker.com. 17 Mar 2010.
  5620. From SMS: #include <types.h> earlier for VMS in ckcdeb.h to pick up off_t
  5621. before it is referenced. This allows C-Kermit to compile on VMS/Alpha 6.2
  5622. but linking fails on fseeko() and ftello() (and yet, a functional executable
  5623. is created, and FSEEK works right). Builds the same way with no problems at
  5624. all on VMS 8.3 / Alpha. In this case we get the full 64-bit arithmetic...
  5625. Well, 62 bits:
  5626. ATLAS::C-Kermit>( ^ 2 63)
  5627. 9223372036854775000.0
  5628. ATLAS::C-Kermit>( ^ 2 62)
  5629. 4611686018427387904
  5630. whereas on VMS 6.2 we get integers only up to (^ 2 30). 17 Mar 2010.
  5631. Changed the VMS build procedure to enable large file support automatically
  5632. for non-VAX and VMS 7.3 or greater. No reason not to include this feature.
  5633. Changed the sense of the F option to DISABLE large file support in the
  5634. unlikely case that C-Kermit is being built on a suitable platform but the
  5635. C library is older than VMS73_ACRTL-V0200, in which case fseeko() and
  5636. ftello() will come up missing at link time. ckvker.com, 18 Mar 2010.
  5637. Changed VMS build procedure to include the FTP client in any network build
  5638. by default. Changed the sense of the I option to exclude the FTP client,
  5639. in case anybody would want to do that. ckvker.com, 18 Mar 2010.
  5640. From SMS: updated dependencies in CKVKER.COM, fix the "don't reinclude me"
  5641. clause in CKVRTL.H. 19 Mar 2010.
  5642. Built OK on VMS 6.2 and 8.3 with and without networking. Large file support
  5643. included automatically in VMS 8.3 FTP client included automatically in both
  5644. network builds. 19 Mar 2010.
  5645. Changed hexdump() to ckhexdump() in ck_crp.c, which I missed before.
  5646. 19 Mar 2010.
  5647. ---C-Kermit 9.0 Alpha.03---
  5648. In HP-UX with the bundled-non ANSI compiler, we get warnings about functions
  5649. such as endusershell(), which are declared void in the header files. But in
  5650. non-ANSI builds we defind VOID to be int rather than void, so our prototypes
  5651. are wrong. I checked that HP-UX 9, 10, and 11 all have void datatype and
  5652. changed the definition of VOID to void in those cases. ckcdeb.h, 29 Mar 2010.
  5653. Fixed a typo in a debug() statement in cksplit() that was causing some
  5654. warnings. ckclib.c, 29 Mar 2010.
  5655. Ditto in tls_load_certs(). ck_ssl.c, 29 Mar 2010.
  5656. "make hpux1000o+ssl" files with:
  5657. /usr/ccs/bin/ld: Unsatisfied symbols:
  5658. __umoddi3 (code)
  5659. __udivdi3 (code)
  5660. __eprintf (code)
  5661. It appears that OpenSSL (0.9.7c in this case) requires -lgcc.
  5662. And indeed hpux1000gcc+ssl builds fine. 29 Mar 2010.
  5663. There are various warnings in the SSL code in ckutio.c, ckcftp.c, and
  5664. ckcnet.c about pointers not being assignment compatible, but I have learned
  5665. from experience not to try to fix these (see notes from 6 Oct 2009).
  5666. 29 Mar 2010.
  5667. connect(s, (struct sockaddr *)&hisctladdr, sizeof (hisctladdr)): In FTP,
  5668. this doesn't work on RHEL5 / Mac OX X 6.1/2 64-bit. But the connect() in
  5669. Telnet works. On Mac OS X 6.2 I tried changing the socket() call to be like
  5670. the one in ckcnet.c for Telnet, but it made no difference. On a RHEL5.4
  5671. system on i386, FTP works fine, so it's not the Red Hat version. On Digital
  5672. Unix 4.0E 64-bit, same thing:
  5673. 11:23:10.722 ftp_hookup[kermit.columbia.edu]=21
  5674. 11:23:10.722 ftp hookup A[kermit.columbia.edu]
  5675. 11:23:10.722 ftp hookup C[kermit.columbia.edu]
  5676. 11:23:10.722 ftp hookup socket=4
  5677. 11:23:10.722 ftp hookup HADDRLIST
  5678. 11:23:10.723 ftp hookup connect failed=13
  5679. 11:23:10.723 ftp hookup bad
  5680. 13 = Permission denied:
  5681. [EACCESS] Search permission is denied for a component of the path prefix;
  5682. or write access to the named socket is denied.
  5683. On Gentoo Linux, also on Alpha, the errno is 51: Network is unreachable.
  5684. Clearly some data type in the sockets structs is out of whack.
  5685. The third connect() argument is "address length". The address is a
  5686. struct sockaddr. About the third argument, RHEL5 "man connect" says:
  5687. The third argument of connect() is in reality an int (and this is what
  5688. 4.x BSD and libc4 and libc5 have). Some POSIX confusion resulted in
  5689. the present socklen_t, also used by glibc. See also accept(2).
  5690. Building on RHEL5 on x86_64, where size_t is 8 and socklen_t is 4, I get a
  5691. warning:
  5692. ckcftp.c: In function 'ftp_hookup':
  5693. ckcftp.c:14667: warning:
  5694. comparison is always true due to limited range of data
  5695. Referring to:
  5696. if (hisctladdr.sin_addr.s_addr != (unsigned long) -1)
  5697. This seems to be the problem; if I remove the (unsigned long) cast (in two
  5698. places), the problem goes away. Actually what I should be comparing it with
  5699. is INADDR_NONE, which is defined appropriately in some header file, e.g. as
  5700. 0xffffffff. Also I define it explicitly as -1 if it is not defined in any
  5701. header file (as is the case in Solaris 9). Tested OK on 64-bit RHEL5,
  5702. 32-bit RHEL5, Digital Unix 4.0E 64-bit, Solaris 9 32-bit, Mac OS X 10.4.11
  5703. 32-bit, Mac OS X 10.6.3 64-bit, AIX 5.3, Gentoo Linux 2.6.31 on Alpha
  5704. 64-bit, NetBSD 5.0.1 32-bit.... ckcftp.c, 29 Mar 2010.
  5705. ---C-Kermit 9.0 Alpha.04---
  5706. Yesterday's VOID redefinition caused problems for HP-UX in ckuusx.c, in the
  5707. curses section where VOID is undef'd and not used to avoid a conflict with
  5708. curses.h. As a workaround I defined a new macro CKVOID with the same
  5709. definition as VOID and used it in the offending section of ckuusx. The real
  5710. solution is to replace all references to VOID with CKVOID (since VOID is
  5711. increasingly likely to cause conflicts), but a mass search and replace is
  5712. not without risks. ckcdeb.h, ckuusx.c, 30 Mar 2010.
  5713. Changed VOID and CKVOID definition to be 'void' for all HP-UX (verified by
  5714. PeterE back to HP-UX 6.5, 1989). Still need to check this on HP-UX 5.21;
  5715. if that's an exception it can be done in the makefile. ckcdeb.h, 30 Mar 2010.
  5716. The change I made to allow CONNECT to reestablish a previous SSH connection
  5717. prevented a new SSH connection to a different host to be made. Fixed in
  5718. ckuus7.c, 30 Mar 2010.
  5719. Fixed mistaken extern declarations of krb4_errno and krb5_errno as strings
  5720. in nvlook(); they are ints. Built OK on Mac OS X 10.6.3. ckuus4.c, 30 Mar 2010.
  5721. A fix to Trusted HP-UX makefile target from PeterE, to account for the
  5722. equivalence of +openssl and +ssl as target suffixes. 30 Mar 2010.
  5723. Added a new function \fcvtcsets(string,cset1,cset1) that converts a string
  5724. from one character set to another. The csets are File Character-Set names.
  5725. ckuus4.c, 31 Mar 2010.
  5726. Added a new function \fdecodehex(string,prefix) that decodes a string
  5727. containing prefixed hex bytes. Default prefix is %%, but any prefix of
  5728. one of two chars (such as % or 0x) can be specified. ckuusr.h, ckclib.h,
  5729. ckclib.c, ckuusr.c, 31 Mar 2010.
  5730. Richard Nolde reports that Kermit can't find -lpam on Fedora 12 because it's
  5731. in /lib rather than /usr/lib. RHEL5 has symlinks, FC12 should too. Added a
  5732. note to the makefile. 1 Apr 2010.
  5733. Build on Solaris 11 for the first time. Had to adjust ckuver.h to get the
  5734. version herald right. This was on a box that reported its architecture as
  5735. i86pc. 1 Apr 2010.
  5736. Added MIME character-set names as invisible synonyms in the file and
  5737. terminal character-set tables, fcstab[] and tcstab[]. Note that not all the
  5738. character sets known to Kermit are registered in MIME. But at least now
  5739. MIME-registered character sets can be referred to by their MIME names, e.g.
  5740. ISO-8859-1, ISO646-ES, IBM437, WINDOWS-1252. These are not listed if you
  5741. type ? in a field that is parsing them, unless you type a letter first,
  5742. e.g. "i?" lists ISO- and IBM set names. Later maybe I'll make parallel
  5743. tables, or keyword attribute bit that says whether a name is MIME or not.
  5744. The real benefit of this change is that now Kermit can take its
  5745. character-set names from external sources like email headers or web logs.
  5746. ckuxla.c, 1 Apr 2010.
  5747. Changed the IF command to accept a bare macro name its condition. This will
  5748. parse and execute correctly if the macro is defined and if it has a numeric
  5749. value, or if it is not defined, in which case it evaluates to 0 (FALSE). If
  5750. it is defined but has a non-numeric value, a parse error occurs. ckuus6.c,
  5751. 2 Apr 2010.
  5752. Added \fstringtype() function. Given a string argument, it tells whether
  5753. the string is 7bit, 8bit, utf8, binary, etc. ckuusr.h, ckuus[4x].c,
  5754. 2 Apr 2010.
  5755. Did a few builds to make sure there were no booboos. Solaris 9, NetBSD
  5756. 5.01, Linux RHEL4, HP-UX 10.20 (non-ANSI compiler and ANSI optimizing
  5757. compiler), Mac OS X 10.4.11, SCO OSR 6.00. 5 Apr 2010.
  5758. ---C-Kermit 9.0 Alpha.05---
  5759. Increased maximum variable name length from 4K to 16K. Verified that
  5760. too-long names are caught and recovered from correctly. ckuusr.h, 6 Apr 2010.
  5761. Implemented a new \fsplit() option for parsing CSV files, which turns out to
  5762. be a little complicated, because the separator is not just a comma, but a
  5763. comma and all its surrounding spaces. Also there are special quoting rules
  5764. for fields with embedded commas and fields with embedded quotes. ckclib.c,
  5765. 7 Apr 2010.
  5766. ---C-Kermit 9.0 Alpha.06---
  5767. VMS changes from SMS. They build OK, Kermit file transfers are still OK,
  5768. but FTP text-mode GETs always hang on the 10th 8K network read. Couldn't
  5769. get a debug log this time. ckcmai.c, ckvfio.c, ckvrms.h, ckvker.com.
  5770. 8 Apr 2010.
  5771. Changing VNAML from 4K to 16K broke the build on HP-UX 9. Put it back to
  5772. 4K. 9 Apr 2010.
  5773. John Dunlap, running days-long stress tests between E-Kermit and C-Kermit,
  5774. found a bug in the packet-reading and -decoding code: If a NAK packet
  5775. arrives with its length field corrupted to indicate a bigger size, and there
  5776. are enough bytes following in the pipeline, ttinl() will return a too-long
  5777. packet (if there are not enough bytes waiting to be read, then ttinl() will
  5778. properly time out). In the bad case rpack() trusts the packet length, uses
  5779. it as the basis for computation of the block-check length, which is then
  5780. used to access memory that might not be there, causing (at least on John's
  5781. Linux system) a segmentation fault. John added the normal clause to check
  5782. the result of the block-check calculation, and I changed ttinl() to always
  5783. break on the eol character (normally carriage return), since this can never
  5784. appear in a packet, even if we "set control unprefix all". Also added a
  5785. check to ttinl() to protect against length fields corrupted into illegal
  5786. values. ckcfn2.c, ckutio.c, 13 Apr 2010.
  5787. From Lewis McCarthy:
  5788. Based on code inspection, C-Kermit appears to have an SSL-related security
  5789. vulnerability analogous to that identified as CVE-2009-3767 (see e.g.
  5790. http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3767).
  5791. I'm attaching a patch for this issue relative to the revision of ck_ssl.c
  5792. obtained from a copy of http://www.columbia.edu/kermit/ftp/test/tar/x.zip
  5793. downloaded on 2010/07/30, which I believe is the latest.
  5794. When this flaw was first widely publicized at last year's Black Hat
  5795. conference, it was claimed that some public certificate authorities had
  5796. indeed issued certificates that could be used to exploit this class of
  5797. vulnerability. As far as I know they have not revealed specifically which
  5798. public CA(s) had been found issuing such certificates.
  5799. Some references: http://www.mseclab.com/?p=180
  5800. http://www.theregister.co.uk/2009/07/30/universal_ssl_certificate/
  5801. Patches added to ck_ssl.c, 4 Aug 2010.
  5802. Peter Eichhorn reported that "RENAME ../x ." didn't work. This is a side
  5803. effect of the changes of 2006 to the RENAME command, there was a little
  5804. confusion in the renameone() routine; fixed in ckuus6.c, 4 Aug 2010.
  5805. If only one file is FOPEN'd, FCLOSE given with no arguments would close it.
  5806. Turns out to be a bad idea. Example: program with an input and output file,
  5807. try to close the output file before it is opened by just typing FCLOSE; this
  5808. can mess up the input file. For safety FCLOSE has to require a channel
  5809. number or ALL. ckuus7.c, 4 Aug 2010.
  5810. Added \fstrcmp(s1,s2,case,start,length), which has the advantage over IF
  5811. EQU,LGT,LLT that case sensitivity can be specified as a function arg, and
  5812. also substrings can be specified. ckuusr.h, ckuus[24].c, 5 Aug 2010.
  5813. The CSV feature of Alpha.06 had a subtle flaw, namely that if the last item
  5814. in a comma separated list was enclosed within doublequotes with a trailing
  5815. space after the closing doublequote, a spurious empty final element would be
  5816. created in the result array. Fixed in cksplit(), ckclib.c, 5 Aug 2010.
  5817. ---Alpha.07---
  5818. The CSV feature of \fsplit() splits a comma-separated list into an array.
  5819. To turn the array back into a comma separated list, \fjoin(&a,\44,1) almost
  5820. works, except for elements contain literal doublequotes, such as:
  5821. Mohammad "The Greatest" Ali
  5822. This calls for making a symbolic CSV argument for \fjoin() like the one that
  5823. was made for \fsplit(): \fjoin(&a,CSV). Also \fjoin(&a,TSV) for
  5824. Tab-separated list. Thus if Kermit reads a record in CSV format, splits it
  5825. into an array, and then joins the array back into a CSV record, the result
  5826. will be equivalent to the original, according to the CSV definition. It
  5827. might not be identical, because if the result had extraneous spaces before
  5828. or after the separating commas, these are discarded, but that does not
  5829. affect the elements themselves. Furthermore it is now possible to convert
  5830. a comma-separated list into a tab-separated list, and vice versa (which is
  5831. not a simple matter of changing commas to tabs or vice versa). ckuus4.c,
  5832. 12 Aug 2010.
  5833. From Joop Boonen 26 Juli 2010: "Added HAVE_LOCKDEV as openSuSE >= 11.3 uses
  5834. lockdev but not baudboy. They use ttylock directly. The program code has
  5835. been added so the the program works without a problem." makefile, ckcdeb.h,
  5836. ckutio.c, ckuus5.c, 23 Aug 2010.
  5837. ---Alpha.08---
  5838. From Gary Mills at the U of Manitoba: convert Solaris version from BSD ptys
  5839. to streams ptys because there are only 48 BSD-style ptys and he was running
  5840. out. No code changes needed, the only change necessary was to add the
  5841. following flags to the makefile target:
  5842. -DHAVE_STREAMS -DHAVE_GRANTPT -DHAVE_PTSNAME
  5843. -DPUSH_PTEM -DPUSH_LDTERM -DPUSH_TTCOMPAT
  5844. makefile, ckcmai.c, 21 Sep 2010.
  5845. Testing this in Solaris 9 I see that the DES library disappeared. Added
  5846. code to the solaris9 targets (also used by Solaris 10 and 11) to check for
  5847. this. makefile, 21 Sep 2010.
  5848. The Solaris target checked the OpenSSL version automatically to set the
  5849. right flag, the Linux target didn't. Put the OpenSSL-version testing code
  5850. in the Linux target too. makefile, 21 Sep 2010.
  5851. A couple minor changes to the tru64-51b makefile targets from Steven Schweda
  5852. but there still are some problems with the Tru64 Unix builds.
  5853. makefile, 21 Sep 2010.
  5854. ---Alpha.09---
  5855. \fcontents(\&a[3]) got an error if the array was declared but its dimension
  5856. was less than 3, which is bad when dealing with (say) an array created
  5857. dynamically by \fsplit(), which might or might not have a third element.
  5858. In case it doesn't -- i.e. in case we are referring to an out of range
  5859. element of any array that is declared -- we should just return a null
  5860. string, as we do with other types of variables that are not defined.
  5861. For that matter, ditto even if the array is not declared; what useful
  5862. purpose is served by throwing an error in this case?
  5863. ckuus4.c, 30 Dec 2010.
  5864. cksplit() treats \ as a quoting character. If the source string contains
  5865. backslashes, they are swallowed (or, if doubled, one is kept). That's not
  5866. good for parsing external data, such as lines read from files, where there
  5867. are no quoting rules. This came up when parsing CSV files; as a workaround,
  5868. I made \fsplit() treat backslash as an ordinary character for CSV and TSV
  5869. splitting (a better solution might be yet another argument that specifies
  5870. a quote character). ckclib.c, 30 Dec 2010.
  5871. Began converting C-Kermit to Open Source with the Simplified 3-Clause BSD
  5872. license. Updated the text for the INTRO, LICENSE, NEWS, and SUPPORT
  5873. commands. Fixed things so the copyright year to be displayed is defined in
  5874. one place (ck_cryear in ckcmai.c), rather than hardwired into text strings
  5875. all over the place. COPYING.TXT, ckcmai.c, ckuus[256].c, 2 Jun 2011.
  5876. When I added MIME synonyms for Kermit character-set names, I left a bogus
  5877. entry in the tables ("windows-1251") that was in the wrong place
  5878. alphabetically, thus preventing most references to file character-set names
  5879. from working right. Removed the bogus entry. ckuxla.c, 2 Jun 2011.
  5880. Most combinations work OK, but not translating Cyrillic text from UTF-8
  5881. to Latin/Cyrillic, and probably the same would be true for any case of
  5882. converting from UTF-8 or UCS-2 to anything else. The problem was in
  5883. xgnbyte(), which converts the input stream from the specified character to
  5884. UCS2; it needed to make a special case for when the input file was already
  5885. Unicode. Believe it or not, this problem occurred at least as far back as
  5886. 8.0.201 (9.5 years ago) and nobody noticed. So if the fix isn't perfect
  5887. probably nobody will notice that either. ckcfns.c, 3 Jun 2011.
  5888. The SET BLOCK CHECK command did not parse all the items in its keyword
  5889. list. Fixed in ckuus3.c, 3 Jun 2011.
  5890. For EM-APEX ocean floats project, where buoys in stormy waters have to
  5891. transmit data through an earth satellite using non-error-correcting modems,
  5892. John Dunlap ran exhaustive stress tests of Kermit protocol transfers through
  5893. a simulated connection that injected errors and delays and identified a
  5894. weakness in Kermit protocol when it is used under extremely bad conditions:
  5895. If a data byte of the S packet (or its Ack) is corrupted and the 1-byte
  5896. checksum is also corrupted in such a way that that the checksum matches the
  5897. corrupted data, the two Kermit programs will disagree as to the negotiated
  5898. parameters. For example, if file Sender's RPT field is changed from '~' to
  5899. '^', the receiver will decode the packet incorrectly. Ditto for most of the
  5900. other parameters. The result is that a corrupted file is received but
  5901. reported correct. John suggested a new mode of operation in which the Type
  5902. 3 block check is used for all packets. Such a mode can not be negotiated
  5903. because the negotiation packet itself is assumed by all Kermit programs to
  5904. have a 1-byte checksum. Added SET BLOCK-CHECK 5 to the parser (with
  5905. invisible synonym FORCE-3". ckuus3.c, 3 Jun 2011.
  5906. Added supporting code for SET BLOCK 5: ckcfn[23].c, ckcpro.w, ckcmai.c,
  5907. ckuus3.c, 3 Jun 2011.
  5908. Added code to skip the heuristic that S and I packets always have block
  5909. check type 1. File transfer OK between two C-Kermits with SET BLOCK 5.
  5910. rpack(): ckcfn2.c, 5 Jun 2011.
  5911. Made the file receiver put "5" in the block-check-type in its ACK to the
  5912. S-Packet. spar(): ckcfns.c, 5 Jun 2011.
  5913. Now the question is: Can we make the file receiver automatically and safely
  5914. recognize a three-byte block check on an incoming S or I packet? It's
  5915. tricky because the block check field is not self-identified, it's just the
  5916. last "n" characters of string indicated by the length field, so correct
  5917. decoding of the packet depends on stateful knowledge of "n". How about this:
  5918. rpack() already knows what type of packet it is, so if it's an S or I packet
  5919. and the 8th byte of the data field is "5" and last 3 bytes, when interpreted
  5920. as the CRC, match the packet contents, then we accept the packet and switch
  5921. to BLOCK 5 mode.
  5922. On the other hand, if the "5" was put there by corruption, the CRC should
  5923. catch the error. In that case we NAK the packet and presumably get a
  5924. different version back. There would be no reason to try to re-read the same
  5925. packet with a different block check, because the "5" could not possibly be
  5926. there legitimately unless it had a 3-byte CRC. To be clear, this is
  5927. cheating. We read the packet contents before we know the packet is correct,
  5928. then we check that it *is* correct. I made the 4-line change to rpack()
  5929. and it works OK in the absence of transmission errors. ckcfn2.c, 3 Jun 2011.
  5930. So the various combinations should work as desired:
  5931. . Sender and receiver both support and are told to SET BLOCK 5 ("SB5").
  5932. . Sender SB5, but receiver doesn't support it (errors out).
  5933. . Sender SB5, receiver supports it but wasn't told (auto-recognizes it).
  5934. . Receiver SB5 but sender no (errors out).
  5935. Note in the last case, the receiver should NOT automatically fall back to
  5936. standard behavior because if the user said SET BLOCK 5 that means every
  5937. packet MUST be protected by CRC to prevent the I/S packets from being
  5938. corrupted.
  5939. Installed new HELP SET BLOCK-CHECK text. ckuus2.c, 5 Jun 2011.
  5940. Autodownload didn't work when the S or I packet had a 3-byte block check
  5941. because kstart() checked it for a 1-byte checksum. Fixed in kstart(),
  5942. ckcfn2.c, 6 Jun 2011. However, older Kermit versions and programs that
  5943. claim to do "autodownload" will never recognize this type of packet. No
  5944. big deal since even if they did, the transfer would fail anyway.
  5945. Added 'FORCE 3' to E-Kermit, called it EK 1.7. The option is "-b 5". Works
  5946. OK for sending and receiving, both with and without the new option. Also
  5947. works with "-b 5" if you send an S packet to it with '5' in the BCT field.
  5948. Changes were minimal, I have them all in ek17.diff.
  5949. I could probably also make a new G-Kermit in about 10 minutes, but who cares
  5950. about G-Kermit... We already have two useful Kermit programs that
  5951. interoperate with the new protocol. 6 Jun 2011.
  5952. Replaced the very inadequate help texts for functions \fword() and
  5953. \fsplit() with new ones. ckuus2.c, 6 Jun 2011.
  5954. There were a couple reports of file corruption that I was saving for later.
  5955. Now that now is later I dug up the messages, files, and logs and it turns
  5956. out that nobody had reported a reproducible case of Kermit corrupting a
  5957. file. There have been non-reproducible cases though, almost certainly due
  5958. to corruption of the S or I packet or its ACK, which is why we now have SET
  5959. BLOCK 5. Even with BLOCK CHECK 5, there is no guarantee that the same thing
  5960. won't happen, it is just far less likely. Even if we added a 32-bit CRC or
  5961. even 64-bit one, there would still be a small chance it could happen.
  5962. 7 Jun 2011:
  5963. Corrected various #ifdefs (or lack of them) when building C-Kermit with
  5964. different combinations of feature-selection options such as NOCSETS, NOICP,
  5965. NOLOCAL, NOSPL, NOUNICODE, etc. ckcfns.c ckcmai.c ckcxla.h ckuus2.c
  5966. ckuus4.c ckuus5.c ckuus6.c ckuusr.c, 7 Jun 2011. After running the script
  5967. that does all these builds (84 of them) I ran it again to make sure that
  5968. none of the changes broke builds that succeeded before the changes were made.
  5969. Built OK on Solaris9 ("make solaris9")
  5970. Ditto with Krb5 and OpenSSL 0.9.8q ("make solaris9g+openssl+shadow+pam+zlib")
  5971. Built OK on Mac OS X 10.4.11 ("make macosx").
  5972. Also "make macosx+krb5+openssl.
  5973. Built OK on Linux RHEL4 ("make linux").
  5974. Built OK on Linux RHEL4 with OpenSSL 0.9.7a ("make linux+ssl").
  5975. Built OK on Linux RHEL5 ("make linux").
  5976. "make linux+ssl" fails on RHEL5 because of DES, even though the target
  5977. tests for the presence or absence of the DES libraries. In this case the
  5978. libraries are there but they lack the functions des_ecb3_encrypt,
  5979. des_random_seed, and des_set_odd_parity. The build succeeds as:
  5980. make linux+ssl KFLAGS=-UCK_SSL
  5981. Since DES is now considered harmful, Jeff Altman suggests that all OpenSSL
  5982. builds, even for old versions, should omit it ("If you are building with
  5983. openssl and no kerberos or srp, just disable DES. Disabling DES will impact
  5984. telnet and rlogin but it won't matter if you have no ability to negotiate a
  5985. session key").
  5986. From Ian Beckwith, patches for Debian Linux:
  5987. . Change all '-' to '\(hy' in man page (new pedantry): ckuker.nr.
  5988. . Make IKSD authentication (using PAM) ask for a password when an invalid
  5989. username has been given, to avoid disclosing which account names are valid:
  5990. ckufio.c, ckuus7.c.
  5991. . Fix spelling errors: ckcftp.c, ckuus2.c, ckuker.nr, ckcpro.w, ckuusr.h.
  5992. . Patch makefile to support install to a staging area with DESTDIR.
  5993. . Some other patches (mainly for typos) were for plain-text documentation
  5994. files that were generated from Web pages; I updated the web pages.
  5995. A big corporate C-Kermit user has an application where a local C-Kermit
  5996. makes a connection to a remote one, uploads some files, and then if the
  5997. server has any new patch files for the local, it sends the patches and
  5998. does a REMOTE HOST command to run the patch program. This stopped working
  5999. in C-Kermit 6.0 or 7.0 when I put a check to prevent it, because "it makes
  6000. no sense to send REMOTE commands to the local end, because the results are
  6001. sent back to the remote to be displayed on its screen but it has no screen".
  6002. That may be true, but if the user needs to control the local from the
  6003. remote, they should be able to. I removed the checks. This doesn't solve
  6004. the problem of where the output goes; ideally it would go to the local
  6005. screen but I don't see any elegant and simple way to make that change.
  6006. However the output redirectors can still be used with the REMOTE command
  6007. so the results can be captured to a remote file, which could then be sent.
  6008. ckuus7.c, 7 Jun 2011.
  6009. Changed SET VARIABLE-EVALUATION to SET COMMAND VARIABLE-EVALUATION, but left
  6010. the former version available. ckuusr.c, 9 Jun 2011.
  6011. Documented the SET COMMAND VARIABLE-EVALUATION command, which I added in
  6012. 2008. ck90.html, 9 Jun 2011.
  6013. Renamed all old Mac OS X makefile targets to have the prefix "old" to avoid
  6014. confusing them with the current targets, and made macosx10 a synonym for
  6015. macosx, so those who used previous makefiles will get a current target
  6016. without having to know the new name. makefile, 9 Jun 2011.
  6017. Added XMESSAGE, which is to MESSAGE as XECHO is ECHO: prints the text
  6018. without a line terminator, so it can be continued by subsequent [X]MESSAGE
  6019. commands. ckuusr.[ch], 9 Jun 2011.
  6020. Back to "make linux+ssl" on RHEL5... I took the coward's way out and added
  6021. code to the makefile target to check whether the build worked (somebody let
  6022. me know if there is a better way to check), and if not to give a message
  6023. suggesting they "make clean ; make linux+ssl KFLAGS=-UCK_DES". makefile,
  6024. 9 Jun 2011.
  6025. Noticed that \frecurse() would dump core if called with no arguments.
  6026. Fixed in ckuus4.c, 9 Jun 2011.
  6027. Added \q() as an alternative to the more verbose \fliteral() for quoting
  6028. strings that contain characters (like \) that would otherwise be significant
  6029. to Kermit. It's more efficient because it isn't a function call, and 'q'
  6030. is an intuitive letter to mean 'quote'. It also works better than
  6031. \fliteral() because functions treat commas and braces specially. ckuus4.c,
  6032. 10 Jun 2011.
  6033. Built OK on VMS 8.3 on Alpha, no net. DEC C caught a couple glitches in the
  6034. new code that gcc didn't catch, which I fixed. ckuus[25].c, 10 Jun 2011.
  6035. Built OK on VMS 8.3 on Alpha with Multinet 5.3. The SSL build failed but
  6036. I'm not going to worry about it. 10 Jun 2011.
  6037. Built OK on NetBSD 5.1. 10 Jun 2011.
  6038. Tried to resurrect my old "build-all" machine, an IBM Netfinity 3500 from
  6039. 1997 with 20-some mountable bootable hard disks with lots of 1990s OS's on
  6040. them. No dice. I can see the BIOS but not the hard disks. The
  6041. configuration is still correct because it tries to boot from the mountable
  6042. hard disk, but it fails (I tried six different ones).
  6043. Tried to resurrect my old Siemens Nixdorf RM 200 MIPS machine. Booted OK,
  6044. headless even, but makes a hellish high-pitched whine, like a dentist drill.
  6045. It's pretty slow too. "make sinix542" (for SINIX 5.4.2) bombed at link
  6046. time on no rdchk(). Fixed by #including <sys/filio.h>. ckutio.c, 10 Jun 2011.
  6047. Tried to resurrect my old SCO Xenix 2.3.4 machine, also headless. Amazingly
  6048. it still works; it can't use a monitor but I can Telnet to it. Had to tweak
  6049. some #ifdefs but I got a no-net version built successfully. According to my
  6050. notes, it hasn't been possible to build with TCP/IP since C-Kermit 8.0,
  6051. but how many people ever had SCO Xenix 2.3.4 with TCP/IP anyway? Anyway we
  6052. still have the binaries for C-Kermit 7.0. ckuus4.c, 10 Jun 2011.
  6053. Built OK on AIX 5.3. Built OK on Solaris 10. 11 Jun 2011.
  6054. Tried harder to revive the build-all machine, now it sort of works, but not
  6055. all of the bootable OS's work. Built C-Kermit 9.0 OK on OpenBSD 3.0. Built
  6056. OK on QNX 4.25 but had to #ifdef references to IXANY in ckutio.c and ckupty.
  6057. Built OK on NetBSD 1.5.1 (2000). Tried "make netbsd+ssl" on this one, it's
  6058. OpenSSL 0.9.5a 1 Apr 2000, but it bombs out in ckuath.c, no big deal.
  6059. Another problem in NetBSD 1.5.2 is that even though off_t is 8, CK_OFF_T
  6060. is 4. Worth noting but not worth fixing unless someone else notices.
  6061. 13 Jun 2011.
  6062. SuSE 7.0... boots OK but telnet server doesn't work. Can telnet out but
  6063. it's too flaky, connection drops if I try to transfer a file.
  6064. OpenBSD 2.5 [1999] OK. Red Hat 7.1 OK. Red Hat 7.1 with OpenSSL 0.9.6
  6065. not OK, same error as with 0.9.5a:
  6066. ckuath.c
  6067. In file included from ck_ssl.h:48,
  6068. from ckuath.c:225:
  6069. /usr/include/openssl/des.h:77: warning: redefinition of `Block'
  6070. ckuat2.h:86: warning: `Block' previously declared here
  6071. /usr/include/openssl/des.h:83: redefinition of `struct des_ks_struct'
  6072. /usr/include/openssl/des.h:91: warning: redefinition of `Schedule'
  6073. ckuat2.h:90: warning: `Schedule' previously declared here
  6074. So it appears that OpenSSL support is broken for pre-0.9.7. Tried
  6075. building it again with -UCK_SSL (since the errors are originating from
  6076. from des.h)... But it still failed exactly the same way. I found
  6077. #includes for des.h in ckuath.c and and ck_ssl.h and #ifdef'd them out,
  6078. but it still fails:
  6079. In file included from /usr/include/openssl/evp.h:89,
  6080. from /usr/include/openssl/x509.h:67,
  6081. from /usr/include/openssl/ssl.h:69,
  6082. from ck_ssl.h:51,
  6083. from ckuath.c:227:
  6084. /usr/include/openssl/des.h:77: warning: redefinition of `Block'
  6085. ckuat2.h:86: warning: `Block' previously declared here
  6086. /usr/include/openssl/des.h:83: redefinition of `struct des_ks_struct'
  6087. /usr/include/openssl/des.h:91: warning: redefinition of `Schedule'
  6088. ckuat2.h:90: warning: `Schedule' previously declared here
  6089. Built OK on Debian 2.1. 13 Jun 2011.
  6090. On FreeBSD 4.4, it blows up with:
  6091. ckufio.c: In function vpass':
  6092. ckufio.c:8201: conflicting types for 'initgroups'
  6093. /usr/include/unistd.h:154: previous declaration of 'initgroups'
  6094. ckufio.c:8201: warning: extern declaration of 'initgroups' doesn't match global
  6095. one. Fixed by defining NODCLINITGROUPS for FreeBSD in ckufio.c. It might not
  6096. be the right fix, but I don't have a lot of other FreeBSD versions to
  6097. compare with. Anyway now it builds OK on 4.4, and also on FreeBSD 3.3.
  6098. ckufio.c, 13 Jun 2011.
  6099. Tried to build on SCO Open Server 5.0.7 but it fails at link time because
  6100. it can't find rdchk(). But it's supposed to be there! Come back to this
  6101. later...
  6102. Red Hat 6.1 i386 32/64 linux 2332545
  6103. Red Hat 7.1 i386 32/64 linux 2368528
  6104. Red Hat EL4 i386 32/74 linux 2363067
  6105. Red Hat EL5.6 i386 64 linux 2371279
  6106. Solaris9 sparc 32/64 solaris9 2849896
  6107. Solaris9+ssl sparc 32/64 solaris9 5021764
  6108. Solaris10 sparc 32/64 solaris10 2855776
  6109. QNX i386 32 qnx32 2012323
  6110. NetBSD 1.5.1 i386 32/64 netbsd 2198055
  6111. NetBSD 5.1 i386 32/64 netbsd 2159863
  6112. OpenBSD 2.5 i386 32/64 openbsd 2236036
  6113. Mac OS X 10.6.7 x86_64 64 macosx 2.7M
  6114. Mac OS X 10.4.11 ppc 32/64 macosx 2496304
  6115. Debian 2.1 i386 32/64 linux 2213221
  6116. FreeBSD 4.4 i386 32/64 freebsd 2291333
  6117. FreeBSD 3.3 i386 32/64 freebsd 2147370
  6118. SINIX 5.42 mips 32 sinix542 3319325 (1995)
  6119. SCO Unixware 2.1.3 i386 32 uw213 2242176
  6120. SCO OSR6.0.0 i386 32/64 sco_osr600 2368300
  6121. More builds, 14 June 2011:
  6122. VMS 6.2 alpha 32 make mn 2556928 No TCP/IP
  6123. VMS 6.2 alpha 32 make m 3112960 UCX 4.0
  6124. Solaris 11 i386 32/64 solaris11 2823860
  6125. Solaris 11 i386 32/64 solaris11+ssl 2993660 OpenSSL 0.9.8l
  6126. NetBSD 5.1 i386 32/64 netbsd+krb5 2307855 Kerberos 5
  6127. Linux Slackware 12.1.0 i386 32/65 linux 2175754
  6128. Linux Fedora 14 i386 32/64 linux 2256514
  6129. Linux Fedora 14 i386 32/64 linux+ssl ....... OpenSSL 1.0.0d
  6130. Linux Fedora 14 i386 32/64 linux+krb 2449614 (*)
  6131. (*) make linux+krb5 "LIBS=$LIBS /lib/libk5crypto.so.3 /lib/libcom_err.so.2"
  6132. Noticed that netbsd+ssl build on NetBSD 5.1 said "NetBSD 1.5" in its banner.
  6133. Fixed by replacing the old hardwired target with the new "subroutinized"
  6134. target a'la linux+ssl and adapting it to NetBSD. makefile, 15 Jun 2011.
  6135. Same deal for Kerberos 5, make a new netbsd+krb5 target and it builds ok,
  6136. at least once one figures out where the Kerberos headers and libs are.
  6137. makefile, 15 Jun 2011.
  6138. Same deal for the netbsdnc target, now it simply defined NOCURSES and
  6139. chains to the main netbsd target. makefile, 15 Jun 2011.
  6140. Tried to build with Kerberos 5 on Solaris, fails because the DES library
  6141. no longer exists. This one is beyond me, sorry.
  6142. Made new targets for MirBSD, mirbsd and mirbsd+ssl, makefile 15 Jun 2011.
  6143. In OpenSUSE 11.2 with OpenSSL 0.9.8r we bomb on undefined references from
  6144. various DES library routines. Builds OK without DES.
  6145. Various linux+krb5 builds fail because can't find -lgssapi_krb5
  6146. SSL builds with OpenSSL < 0.9.7 fail even though there is code to support
  6147. the older SSL.
  6148. Fixed some printf %ld vs int instances in the sizeofs section of SHOW FEATURES.
  6149. ckuus5.c, 15 Jun 2011.
  6150. Fixed the new linux+ssl target to actually use the SSLINC and SSLLIBS
  6151. definitions, oops. makefile, 15 Jun 2011.
  6152. 15 June 2011 builds (Beta.01):
  6153. AIX 5.3 ppc 32/64 aix+ssl 3283846 OpenSSL 0.9.8m
  6154. NetBSD 5.1 i386 32/64 netbsd 2159863
  6155. NetBSD 5.1 i386 32/64 netbsd+ssl 2350274 OpenSSL 0.9.9-dev
  6156. NetBSD 5.1 i386 32/64 netbsd+krb5 2349627 MIT Krb5 1.6.3
  6157. FreeBSD 8.2 i386 32/64 freebsd 2298414
  6158. FreeBSD 8.2 i386 32/64 freebsd+ssl 2448961 OpenSSL 0.9.8q
  6159. OpenBSD 4.7 i386 32/64 openbsd 2266132
  6160. OpenBSD 4.7 i386 32/64 openbsd+ssl 2409263 OpenSSL 0.9.8k
  6161. MirBSD 10 i386 32/64 mirbsd 2216601
  6162. MirBSD 10 i386 32/64 mirbsd+ssl 2358318 OpenSSL 0.9.8r
  6163. OpenSuse 11.2 x86_64 64 linux 2348468
  6164. OpenSuse 11.2 x86_64 64 linux+ssl (*) 2546540 OpenSSL 0.9.8r
  6165. RHEL 5.6 ia64 64 linux 4390687
  6166. RHEL 5.6 ia64 64 linux+ssl (*) 4775007 OpenSSL 0.9.8e
  6167. Ubuntu 9.10 i386 32/64 linux 2275523
  6168. Ubuntu 9.10 i386 32/64 linux+ssl 2466708 OpenSSL 0.9.8r
  6169. Gentoo 1.12.13 ppc 32/64 linux 2386597
  6170. Gentoo 1.12.13 ppc64 64 linux 2749015
  6171. Gentoo 1.12.13 ppc64 64 linux+ssl 3002150 OpenSSL 0.9.8r
  6172. Gentoo 1.12.13 sparc 32/64 linux 2478382
  6173. Gentoo 1.12.13 sparc 32/64 linux+ssl 2690499 OpenSSL 0.9.8r
  6174. Solaris 9 sparc 32/64 solaris9 2849896
  6175. Solaris 10 i386 32/64 solaris10 2837620
  6176. IRIX 6.5 R10000 32/64 irix65 2869704
  6177. * and KFLAGS=-UCK_DES
  6178. Tried building on NetBSD 5.1 with Heimdal Kerberos using:
  6179. make netbsd+krb5 \
  6180. "KFLAGS=-DHEIMDAL" \
  6181. "K5INC=-I/usr/include" \
  6182. "K5LIB=-L/usr/lib"
  6183. It found all its headers OK, but it blew up in ckuath.c. Small wonder,
  6184. ckccfg.html says:
  6185. HEIMDAL
  6186. Should be defined if Kerberos V support is provided by HEIMDAL. Support
  6187. for this option is not complete in C-Kermit 8.0. Anyone interested in
  6188. working on this should contact kermit-support.
  6189. 'krb5-config --version' gives the MIT Kerberos 5 version number.
  6190. Make a new netbsd+krb5+ssl target based on the combination of the new
  6191. netbsd+ssl and netbsd+krb5 targets. There were lots of warnings in the
  6192. compilation but no errors, but it produced an executable that starts and
  6193. does normal things but I have no idea if the SSL or Kerberos functions work.
  6194. makefile, 16 Jun 2011.
  6195. Changed the cu-solaris9-krb5 target to test for the presence of DES because
  6196. DES isn't there, to see if this would allow a Kerberos build to proceed.
  6197. And it worked, amazing. At least the build completed, I have no way to test
  6198. the Kerberos part. makefile, 16 Jun 2011.
  6199. Updated the solaris9+ssl target to do the DES testing. makefile, 16 Jun 2011.
  6200. Updated cu-solaris+krb5 target to test whether the GSSAPI library is called
  6201. libgassapi or libgassapi_krb5. makefile, 16 Jun 2011.
  6202. Added lots of tests to the Linux Kerberos 5 entries, linux+krb5 and
  6203. linux+krb5+ssl, because some have libk5crypto and some don't; some have
  6204. libcom_err and some don't; and some have libgssapi_krb5 (e.g. RHEL5,
  6205. OpenSuse 11.2) whereas others have libgssapi (Gentoo).
  6206. 16 June 2011 builds (Beta.01):
  6207. NetBSD 5.1 i386 32/64 netbsd+krb5+ssl 2451757 OpenSSL 0.9.9 MIT Krb5 1.6.3
  6208. Solaris 9 sparc 32/64 solaris9+krb5 2543036 MIT Kerberos 5 1.7.1
  6209. Solaris 9 sparc 32/64 solaris9+ssl 5021544 OpenSSL 0.9.8q (gcc)
  6210. Gentoo... ppc 32/64 linux 2386597
  6211. Gentoo... ppc 32/64 linux+ssl 2593561 OpenSSL 0.9.8r
  6212. Gentoo... ppc64 64 linux 2749015
  6213. Gentoo... ppc64 64 linux+ssl 3002150 OpenSSL 0.9.8r
  6214. RHEL5 x86_64 64 linux+krb5 (*) 2563878 MIT Kerberos 5 1.6.1
  6215. RHEL5 x86_64 64 linux+krb5+ssl(*) 2563878 MIT Kerberos 5 1.6.1
  6216. Fedora 14 i386 32/64 linux+krb5+ssl 2539891 MIT Krb5 + OpenSSL 0.9.8r
  6217. * KFLAGS=-UCK_DES
  6218. --- C-Kermit 9.0.299 Beta.01 ---
  6219. sizeof() can return a long or an int, so neither printf("%d",sizeof(blah));
  6220. or printf("%ld",sizeof(blah)); can be used everywhere. Changed the
  6221. "sizeofs" section of SHOW FEATURES in the dumbest (and therefore most
  6222. portable) way to squelch the warnings. ckuus5.c, 17 Jun 2011.
  6223. From John Dunlap: "Watching the server screen led me to offer a cosmetic
  6224. patch for ckuusx.c. I noticed that the server screen said it was
  6225. "RESENDING" when it really wasn't. The attached patch emits blanks to
  6226. insure that old labels are completely erased." ckuusx.c, 17 Jun 2011.
  6227. Nelson Beebe found two places where I had SSLLIBS in the makefile instead of
  6228. SSLLIB. makefile, 18 Jun 2011.
  6229. More important he knew how to force gcc to load the right header files for
  6230. OpenSSL 1.0.0d (by using '-isystem' rather than '-I'). Previously it was
  6231. using the 0.9.8r header files but linking with the 1.0.0d libraries. This
  6232. is not in the sources or makefile; it's done when giving the 'make' command:
  6233. export PATH=/usr/bin:$PATH
  6234. export SSLINC=-isystem/usr/include
  6235. export "SSLLIB=-L/usr/lib -Wl,-rpath,/usr/lib"
  6236. make linux+ssl
  6237. Folded the previous linux+openssl+zlib+shadow+pam and linux+openssl+shadow
  6238. targets into linux+ssl. Checked the linuxso (scripting only) target, builds
  6239. OK, 600K. Made new subroutinized linux+krb5+krb4 target but can't find
  6240. anyplace to test it. Made new subroutinized linux+shadow+pam target, works
  6241. fine on RHEL4. Revised comments and lists again. makefile, 18 Jun 2011.
  6242. For the pluggable-disk OS's that boot OK but lack a working network, I
  6243. rigged up a serial connection using a DB9-FF null modem cable, and then a
  6244. DB9-MF modem cable to make it reach. I don't see any modem signals on
  6245. either end, but the data goes through OK. COM1 on the desktop PC,
  6246. /dev/ttyS1 or whatever on Lab. Since there are no modem signals, can't use
  6247. RTS/CTS. At 57600bps with Xon/Xoff, 500-byte packets and sliding windows,
  6248. transfers work OK at about 5000cps using 5 window slots; takes 8 minutes to
  6249. transfer the gzipped C-Kermit tarball. Kermit to the rescue. 19 Jun 2011.
  6250. Transferred the tarball over serial ports to SCO OSR5.0.5 at 38.4Kbps, the
  6251. highest speed supported, 12 minutes, no errors, 3300cps. Unpack, make
  6252. sco32v505udk, OK. Also built the TCP/IP version and it almost made an
  6253. outbound connection, but only once (not a Kermit problem but something with
  6254. the TCP/IP stack). 19 Jun 2011.
  6255. Ditto for Solaris 2.6/i386, except 57.6Kbps, 4K-byte packets, no problem.
  6256. Solaris 8/i386, ditto. 19 Jun 2011.
  6257. SCO OpenServer 5.0.5 i386 32 sco32v505udk 1940964 No TCP/IP
  6258. SCO OpenServer 5.0.5 i386 32 sco32v505udknet 2314668 With TCP/IP
  6259. Sun Solaris 2.6 i386 32 solaris26g 4661368
  6260. Sun Solaris 8 i386 32 solaris8g 4675432
  6261. When using compact substring notation, \s(xx[4]) returns the whole string
  6262. xx starting at position 4, but \s(xx[4:]) returns an empty string. Fixed
  6263. the latter to be like the former. ckuus5.c, 20 Jun 2010.
  6264. Really it would have been nicer if \s(xx[4]) returned a single character,
  6265. the 4th character of xx, but it's too late now. Added another "separator"
  6266. character '.' (period) for that: \s(xx[4.]) is the 4th character of xx.
  6267. ckuus4.c, 20 Jun 2010.
  6268. Back to SCO OSR5.0.7... This failed before because 'rdchk' came up unknown
  6269. at link time, unlike all previous OSR5's, that used rdchk() in place of the
  6270. FIONREAD ioctl. Added #ifdefs to make a special case for 5.0.7. I'm not
  6271. sure this is the best way, but this is the minimal change to get it to work.
  6272. If anybody cares, maybe the same can be done for previous OSR5 releases.
  6273. ckutio.c, 20 Jun 2010 (search for SCO_OSR507).
  6274. SCO OpenServer 5.0.7 i386 32 sco32v507 1895724 No TCP/IP
  6275. SCO OpenServer 5.0.7 i386 32 sco32v507net 2246792 With TCP/IP
  6276. Checked current code on RHEL4, found that my GSSAPI-lib finding makefile
  6277. target didn't look in enough places; added some more. makefile, 21 Jun 2011.
  6278. Got reports back on HPUX from Peter Eichhorn, almost all good on HP-UX 7, 8,
  6279. 9, 10, and 11. 21-22 Jun 2011.
  6280. Got access to Debian 5.0 and 7-to-be ("Wheezy/Sid"). Regular 'make linux' is
  6281. OK in Debian 5, but in 7 can't find crypt, res_search, or dn_expand; had
  6282. to add more library search clauses to 'make linux'. makefile, 21 Jun 2011.
  6283. In Debian 7.0, libk5crypto could not be found without adding another clause
  6284. to 'make linux+krb5'. That done, the SSL build (1.0.0d) was OK, as well as
  6285. the krb5+ssl one. makefile, 21 Jun 2011.
  6286. I found a Linux box that had both Kerberos 4 and 5 installed and tried 'make
  6287. linux+krb5+krb4', which failed because of missing DES functions. Tried
  6288. 'make linux+krb5+krb4 KFLAGS=-UCK_DES', but that fails too, even though it
  6289. doesn't fail for Kerberos 5 alone, so probably some Krb4 code is making
  6290. unguarded calls to the DES routines. What is really needed is a way to
  6291. completely strip all DES references from any given build, code and makefile,
  6292. a big deal. 21 Jun 2011.
  6293. Fixed some typos in COPYING.TXT (noticed by Ian Beckwith). 24 Jun 2011.
  6294. Got access to perhaps the last living 4.3BSD VAX system. It doesn't have
  6295. SEEK_CUR so I had to #ifdef out the \fpicture() function. Aside from that,
  6296. no problems. ckuus4.c, 24 Jun 2011.
  6297. I had been wanting the S-Expression (ROUND x) to allow a second argument n,
  6298. which, if given, tells where the rounding should occur. If n is positive,
  6299. the number is rounded to n decimal places. If zero, it is rounded to the
  6300. nearest integet. If positive, the number is rounded to the nearest power of
  6301. 10; e.g. -2 means "to the nearest hundred". If ROUND is used as before,
  6302. with one argument, it works as before. ckclib.c, ckuus3.c, 25 Jun 2011.
  6303. From Arthur Marsh, a few more directories to test for libresolv in Linux.
  6304. makefile, 26 Jun 2011.
  6305. From Martin Vorlaender, a fix for the VMS file-transfer display and
  6306. statistics, a place where a file length wasn't being cast to CK_OFF_T
  6307. in zchki(). ckvfio.c, 28 Jun 2011.
  6308. Updated version to 9.0.300 and removed the Beta designation.
  6309. ckcmai.c, makefile, 28 Jun 2011.
  6310. Removed solaris9_64 target from makefile. It builds but it doesn't work
  6311. at all. 30 Jun 2011.
  6312. --- C-Kermit 9.0.300 ---
  6313. On Solaris 10 and 11, DNS lookups don't work. It seems these Solaris
  6314. versions have INADDRX and INADDRX_NONE defined, thus triggering the code in
  6315. ckcnet.c, ckucns.c, and ckcftp.c #ifdef'd on these symbols, but that code
  6316. doesn't work in this case. This happens building with gcc as well as with
  6317. Sun cc. Put #ifdefs in ckcnet.h to undefine these symbols (if they are
  6318. defined after including all the header files) for Solaris. I didn't bother
  6319. trying to differentiate the Solaris versions because the symbols are not
  6320. defined in Solaris 9 or earlier, and they should not be used in Solaris 10
  6321. or 11. ckcnet.h, 6 July 2011.
  6322. From SMS: To avoid the %CC-W-PTRMISMATCH1 complaints from ck_ssl.c, add
  6323. two (harmless) type casts at lines 2460 and 2773, 6 July 2011.
  6324. Built and tested on Solaris 9, Solaris 10, and RHEL5. 6 July 2011.
  6325. --- C-Kermit 9.0.301 Beta.01 ---
  6326. Updated version text and date. ckcmai.c, makefile, 11 July 2011.
  6327. --- C-Kermit 9.0.301 ---
  6328. After the initial release I made some small changes that affect only HP-UX
  6329. 5.x: added -DVOID=void and -DCKVOID=void to the hpux0500 makefile targets,
  6330. and put #ifdefs around #include <errno.h>, which (in the WinTCP case) didn't
  6331. protect itself against multiple inclusion (which is happening in other
  6332. header files, not in Kermit). makefile, ckucmd.c, ckucon.c, ckutio.c,
  6333. ckufio.c, ckcnet.c, ckcftp.c, 14 July 2011.
  6334. In the new copyright notice, copied from the BSD license template,
  6335. one instance of "the <ORGANIZATION>" was not replaced by "Columbia
  6336. University". Fixed in ckcmai.c, 19 July 2011.
  6337. Added another search term for lk5crypto in the linux+krb5 targets.
  6338. makefile, 20 July 2011.
  6339. Added and successfully used a new solaris9+krb5+ssl target.
  6340. makefile, 8 Aug 2011.
  6341. FreeBSD 9 switched from utmp to utmpx, which broke compilation of Kermit on
  6342. that version. Furthermore, the UUCP lockfile convensions changed in FreeBSD
  6343. 8, which did not prevent C-Kermit from compiling, but any attempt to lock a
  6344. terminal or pty device would fail. Thanks to Alexey Dokuchaev "danfe" for
  6345. finding and patching the problems. I undid the patches and fixed the code
  6346. so it didn't need to be patched, except for some declarations in the
  6347. ck_crp.c module, which I felt had better not be changed without thoroughly
  6348. testing the changes on dozens of different platforms, which I don't have
  6349. time to do (in any case, it builds OK on FreeBSD 9 without the patch). In
  6350. particular I made completely new makefile targets for FreeBSD 4.0 and later,
  6351. which automatically detect FreeBSD 8 and FreeBSD 9 to enable the appropriate
  6352. feature tests in the code, for a regular build and a build with OpenSSL.
  6353. These changes should affect only FreeBSD. ckutio.c, ckufio.c, ck_crp.c,
  6354. ckuus5.c, makefile, 20 Aug 2011.
  6355. Changed the version to 9.0.302, ckcmai.c, 20 Aug 2011.
  6356. Fixed freebsd+ssl and netbsd+ssl, netbsd+krb5, and netbsd+krb5+ssl targets
  6357. to have CC=$(CC) instead of CC=gcc; ditto for CC2, and adjusted line breaks
  6358. in freebsd and freebsd+ssl targets. makefile, 21 Aug 2011.
  6359. --- 9.0.302 ---
  6360. ---------------------------------
  6361. ***************************