Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

Thursday, April 10, 2014

Nasty MacPorts bug (sudo not working right)

If you are regular reader of this blog, this post is on a different topic just skip it.

I'm posting this here because this was a hard to find MacPorts bug that comes with the latest version of dbus.  dbus is a KDE utility that's a dependency for lots of packages.

dbus creates a user called "Message Bus" whose shortname is "root".  Which of course trashes sudo, su and creates all sorts of other problems.  To tell if you have been hit by this you can either you will get password errors with sudo and su.

To see if you have this problem do a
dscl . -read /Users/root

If you just get an error you are fine.  If you got hit with the bug you should see something like this:

dsAttrTypeNative:_writers_passwd: root
AppleMetaNodeLocation: /Local/Default
AuthenticationAuthority: deleted

GeneratedUID: deleted
NFSHomeDirectory: /var/empty
Password: ********
PasswordPolicyOptions:




failedLoginCount
0
failedLoginTimestamp
2001-01-01T00:00:00Z
lastLoginTimestamp
2001-01-01T00:00:00Z
passwordLastSetTime
2014-04-10T17:54:50Z



PrimaryGroupID: 80
RealName:
 Message Bus
RecordName: root
RecordType: dsRecTypeStandard:Users
UniqueID: 507
UserShell: /usr/bin/false



Notice the 507, that needs to be 0.  OK now to fix this bug:


  1. Open Users & Groups preferences, click Login Options, then click the lock icon to unlock it. If necessary, type your password, then click Unlock.
  2. In the Network Account Server section, click Join or Edit.
  3. Click Open Directory Utility.
  4. Click the lock icon to unlock it, then enter your administrator name and password.
  5. Change Viewing to Users and look for "Message Bus"
  6. If you have more than one delete the one currently set to root
  7. If you have only one change the RecordName from "root" to "messagebus" 


And now open another shell sudo and su should be working fine.  I'm going to go report this bug into MacPorts but for I couldn't find anything when I Googled so I'm posting this because it was nasty.  


Saturday, February 26, 2011

Sco v. IBM, what happens to a political case

The "save Amanda Knox" cause that has recently consumed this blog, is undergoing a shift.  Initially the core group standing behind Amanda Knox were people who knew her.  People who simply couldn't conceive of her being the sort of person Mignini described.  People who paid their own airfare to testify in her trial.   Then a small group of people examined the evidence and found it wanting.  So while there was publicity, it was mostly directed in the early days by Mignini towards villifying Amanda Knox and Raffaele Sollecito so as to generate false statements (see Amanda Knox and prosecutorial abuse for more on this).   As the cause is broadening out to a few thousand people, its beginning to look more like a small political movement. Fewer and fewer people involved knew Amanda or any of the main parties involved personally.

So what we have here is a structure: a core group of people involved in the formal legal case, surrounded by a web support group who are gathering "evidence" in parallel with the actual trial, surrounded by a broader political movement. There are lots of criminal cases with the broader political movement. There are lots of political cases with a web based investigation but no broad political support. This triple is rare. And the best analogy is a civil suit that occurred recently SCO v. IBM that I was involved with in much the same way as this case.  And the point of this post is to examine this earlier case for what is instructive about it.

SCO was a market leader in x86 (PC) based Unixes during the 1980s  and 90s, and arguably along with Microsoft one of the few companies that believed there was money in the operating system's business as opposed to operating systems being a lost liter for selling hardware.     As Linux came in they moved onto more of a legacy support role and eventually saw their value eroded, eventually being merging with a Unix company (see Caldera OpenLinux on wikipedia for more details).

The public controversy started when the SCO Group's CEO, Darl McBride, initiated a media campaign arguing that the Linux kernel contained "hundreds of lines" of code from SCO's version of UNIX, and that SCO would reveal the code to other companies under NDA in July.  The Linux development process is public, and the kernel team has always been aggressive in attempting to ensure compliance with copyright law.  The SCO code copyright violations, if they existed most likely were in the IPX module which had been funded by Caldera, the predecessor to the SCO group.  And so this media campaign led to public outrage by a small group of people who were involved with Linux.  But this outrage quickly moved onto the broader community of people involved in the Linux community.  In much the same way that Mignini's media leaks to British and Italian tabloids originally offended just Amanda's family and friends but later generated the public interest in Seattle regarding Amanda Knox.

With a high level of public interest the initial filing in their lawsuit against IBM was heavily scrutinized.  I was typical in noticing dozens of incorrect and false statement.    I caught a lot of statements about the history of SCO, which I had been a fan of during the early 1990s, which were false.    There were also provably false statements about the history of Linux.   So in the discussions on the case I started raising these points.  And this was nothing more than internet blather.  What was different in this case, than so many others was I wasn't alone.  Dozens of people were doing the same thing.  And very quickly a site, Groklaw, was set up which organized this counter information.  Playing much the same role as Injustice in Perugia and Friends of Amanda do for the Knox case.  A central collection of information about the case as if the broader public had a vote.

Its hard to give examples on a general purpose blog since: most of the readers don't know what an operating system is, Linux / SCO has to do with operating systems kernels and the debates about things like IPX have to do with kernel libraries.  So I'll pick an example, which while trite gives an example of how misleading and dishonest the entire filling was.  Point 75, reads (points are mine)
The name "Linux" is commonly understood in the computing industry to be a combination of the word "UNIX" (referring to the UNIX operating system) and the name "Linus." The name "Linus" was taken from the person who introduced Linux to the computing world, Linux Torvalds.
Which of course is false in a whole bunch of ways. The name of the original programmer was Linus Torvalds, not Linux Torvalds. His name for the system was Freax which was a combination of Free, Freak and X. The name "Linix" (not a typo) was Ari Lemmke's abbreviation of "Linus' Minix".  Ari ran the site where Linux was first uploaded and first distributed from.    Minix was a reference to Andrew S. Tanenbaum  Operating system he wrote as a companion to his standard text, Operating Systems: Design and Implementation (link is to the late 1980s version, current is here).

And these details are important in context.  The point of 75 was to argue that even the name Linux is evidence for their theory of the derivation of Linux  While in reality the origin of the name shows the opposite.  The reference to Minix shows that the early version of the code came from the educational / academic community and not the commercial community, product lines with the AT&T code.      As an aside, the name Linux was a failed attempt at unifying the pronunciation using Linus name. American's were pronouncing Linix (Linn-ks) rather than 'Lee-nuks' (Len-uxs) and since Linus pronounces his name 'Lee-nus' the assumption was Linux would be pronounced that way; however Americans pronounce Linus as 'lye-nus' and Lye-nuks was the natural connection which also wasn't right and just added to the confusion.

So again while that point may sound nitpicky, and it is, this is meant to be an example that doesn't require background of how wrong SCO was on its many many points.   And there were hundreds of these.  All like the Harry Potter book, the blood on the knife, the bloody footprints... evidence that simply didn't exist.  And just as guilters today in the Knox case encourage everyone to ignore the specific facts that virtually ever piece of evidence that is not irrelevant has been refuted, SCO's defenders encouraged the people hearing about these nonsensical claims to focus on the big picture.   But of course the big picture was just an amalgamation of innuendo.   But unlike in the Knox case the judiciary didn't feel it appropriate to create their own theories from SCO's claims, filling in the blanks with "it is possible and in fact probable".   Rather they focused on the evidence as presented by the plaintiff:

Viewed against the backdrop of SCO's plethora of public statements concerning IBM's and others' infringement of SCO's purported copyrights to the UNIX software, it is astonishing that SCO has not offered any competent evidence to create a disputed fact regarding whether IBM has infringed SCO's alleged copyrights through IBM's Linux activities.

The interest and controversy, fed by these sites continued to build.  Journalists covering these sorts of things, typically rewrite a press release throw in a line or two of their own and move on after a few hours.  For serious cases of course everything needs to be carefully fact checked, reputations can be made or lost based on how evidence was handled.  And journalists soon found that this case was not going to be treated the same way as a minor lawsuit.    The level of controversy and heat, was more like writing about the Israeli / Palestinian crisis or a major political case.  There were expected to check and double check every line they wrote.  Years later journalists faced criticism for what they had written in SCO v. IBM; and almost all who had done little more than regurgitate press releases had to write detailed apology / retractions admitting it, to maintain their credibility.

But journalists were not the only ones effected.  The legal system itself was substantially influenced.  They were people in IBM that originally been inclined to settle cheaply.  The PR campaign and the community reaction to the SCO PR campaign put those ideas to rest.  IBM knew the community reaction to anything short of total victory would be devastatingly negative publicity.  Conversely the ongoing case was a net positive in terms of marketing, IBM's got to be the good guys among a large chunk of their potential customer base all for the cost of a minor lawsuit, SCO's PR campaign backfired.  And again the analogy of Mignini's original vilification campaign leading to a dozen books and at least 3 movies works well in this analogy.

And as the case continued the people involved who were deposing themselves to assist IBM were not secondary players like myself but primaries.  For example the project manager who had negotiated parts of the project Monterey contract for SCO with IBM came forward to contradict SCO's claims about what their intent had been at the time.  The estate of John Lions, whom both sides knew had died of old age, came forward publicly to forward to contradict SCO's claims, and provide evidence to IBM about having gotten parts of Lions' Commentary on UNIX from AT&T that Lions hadn't.  IBM's lawyers had the effect of an infinite investigative budget.   Even SCO admitted how effective Groklaw was and tried to create a connection with IBM to put an end to their activities, which failed.

In terms of the Judges, most couldn't believe that this "BS lawsuit" was the case they were going to be famous for.  None had experienced this level of public scrutiny where every motion was discussed publicly and in detail.  It caused them to go more slowly and more carefully.  It is my hope that the publicity for the Knox case similarly effects the Italian judges.  The Italian judiciary is being attacked from the right within Italy, from the British with the EU it doesn't need to further alienate America where  Italy has consistently taken the position that justice must meet international standards and shouldn't be a one country affair, (see Italy the EU and the international standards of justice).

Finally business partners and contributors to the lawsuit like like Yarro, Microsoft and Sun were affected.   Negative PR for Linux had been a boon for Microsoft and Sun.  Positive PR for SCO had been a boon for Yarro.  But once this case became really hot everyone backed off.  Microsoft while seen as unavoidably hostile to Linux needed to avoid being truly detested the way SCO was.  SUN wanted credibility in the open source world.  Conversely people on the other side like Novell and IBM who had often been mixed earned a lot street cred by being on the side of the angels.  Perguia was shocked when Seattle rejected Perugia park.  Rocco Girlanda has a US reputation now, and contacts with average Americans.

While the Knox case is not nearly as big as the SCO v. IBM case, I do think its an instructive example.

Monday, January 17, 2011

windowserver.log, Raffaele Sollecito's alibi witness

In the Massei report there is a ton of wild conjecture that passes for proven fact.  In the section dealing with the computer forensics however we run into statements that are reproducibly falsifiable.  That is Massei has findings of fact in his report which are not only contrary to literally thousands of pages of documentation published by Apple computer on how their operating systems work, but in fact can be falsified easily with every Macintosh computer sold in the last decade.  This is the very height of exculpatory evidence, it is evidence that can be infinitely attested to.  It is from an empiricist definition the very definition of a false statement.  Now this attack on the computer forensics, may sound like me getting on a high horse and nitpicking.  You might say something like "sure Massei is an arrogant buffoon for claiming as a matter of law that he understands OSX better than Apple computer, but he was deciding a murder case not a computer case" and you would be right.   But the computer forensics came up for very good reasons.  The false forensics were the means by which the police convinced Raffaele to give an alternate alibi to his original one.  That is without the computer forensics there is no reason to suppose that Raffaele and Amanda were not in his apartment watching Amelie at 11:00 when the prosecution believes that Meredith Kercher was killed.  They have an alibi again and we can go back to trying to decide this case on the facts on not on Mignini's hunch.    Moreover, if Raffaele has his 11:00 PM alibi then the prosecution doesn't have to argue their own medical examiner botched the autopsy to get their theory of the timeline to match what they consider the key material evidence.  Suddenly we are back to the murder happening at 9:00, Amanda and Raffaele being blocks away, and if they were involved at all only being involved in the clean up.   So this is a very big deal.  I'm going to do my best to try and make the debate between the prosecution and the defense on the computer forensics understandable, so you can follow as much of this as you can take and at least people have a reference they link off of.  The actual documentation submitted is very difficult to read because, IMHO, whoever wrote the documentation is parroting things they heard rather than understanding what they are writing.

The core argument between the prosecution and the defense has been regarding the use of Encase which is a computer forensics tool.  Encase was used to interact with Macs, running the OSX operating system on the POSIX level, the stuff common to every UNIX.  So the prosecution did not look at anything which is OSX specific, for example the defense objected to the fact that the prosecution only examined the 3 types of timestamps used by POSIX vs. all 5 types of timestamps that OSX supports.  The defense argues that there is evidence in some of the OSX files and flags showing signs of human activity, and that these signs are not present in the POSIX things that the prosecution examined.  To give you an analogy  If I were describing a book in Chinese I might have to talk about its color, its weight, the front cover illustration if there is one, the number of pages.  That's a limited amount of information.    While if I were talking about a book in English I could talk about its title, the description on the back or dust jacket, other books by the same author.  And the defense's argument is that they have found evidence in that additional information proving human activity at the time of the murder.

Getting more specific the defense argues that there is exactly the kind of exculpatory evidence that could have been missed via. inappropriate methodologies in the windowserver.log file.  Windowserver.log is part of OSX's NeXTSTEP heritage.  On most POSIX systems the sorts of messages in the Windowserver.log file would have been caught at the X11 level, not by the windowserver and thus wouldn't have been logged.   Since this is one of the  key points in the appeal it is worth answering the questions:
  1. What does the Mac's windowserver do?
  2. What sorts of things does it log?

Take a quick peek at this diagram to the left.  You can see basic I/O actions like typing on your keyboard or moving your mouse get dealt with at the lowest level by Kernel drivers these can also basic translations So user hold shift - a - release shift - n - g - e - l - space - f becomes user types "Angel f".  Then  the system needs context if the system is booting or in some sort of single user mode you don't want to send messages to a complicated GUI.  The context determination is done by "Core Services".   For hardware actions that are going to require interaction with end user applications, like spreadsheets, web browsers or games the message is passed through to the Windows Server.  It then can handle the message itself, which is generally the case with mouse movements; or it can pass the message onto the correct application depending on where various things are on the screen, which is generally the case with keyboard input.   Lets see an example of both.  Microsoft Windows machines also have window servers and while things don't work quite the same, but close enough for this demonstation.

I want you to grab another window other than this web browser and move your mouse really quickly so that you keep covering and uncovering this line from various angles.  Next I'd like you to reload this webpage and have the browser's rendering engine redraw everything. The first kind of redraw was fast.  What happened was your window server saw the two windows were going to overlap, had already buffered what the applications wanted in their windows broke everything down into primitives and fed it to the your graphics card.  When you changed your mouse direction the window server used the relative eternity of those hundredths of a second to repeat this process and the two windows passed smoothly.  The second time we had the application actually redraw everything and let the window server know what was needed.  Orders of magnitude slower.

So hopefully I've convinced you:
  • To be grateful to your window server for the years of eye strain it has saved you from suffering
  • Why the window server is a very credible witness to a human interaction with a computer. Exactly the sort of process that would know when Raffaele (or another user) was clicking his mouse or banging on his keyboard.
So you might think "perfect, we just ask the WindowServer what it was doing at the time of the murder and we either confirm or refute Raffaele's alibi".  Oh if only it was that easy.  WindowServer listened to your childhood coach about focusing on this play "keeping your head in the game".  It is fast it lives unencumbered by the past, existing in a permanent now.  Your obnoxiousness with the mouse  and the two windows is forgotten.  WindowServer itself is the perfect witness with an amazingly bad case of Alzheimer's.  Oh but it does keep a log book a place where it writes down some important stuff, called windowserver.log.
    I've highlighted where the Window Server sits on the OS side. This is just like our other picture but with more stuff on it, you still see hardware, kernel, core services, the window server, the application environments and the applications themselves.   The point I wanted to make is where this plugs into on the OS side, the Quartz system, if you are a Mac user this is probably not your first time hearing about "Quartz" the part of the OS that handles graphics for applications and hopefully seeing Window Server in this context helps you make the mental shift to thinking of this from the application's perspective.  If you start to think in terms of Quartz then you can think of this as the applications make calls to the Window server to draw, resize, hide, and move windows using Quartz graphics primitives.   It also handles extraneous interactions like the screen passing over, from the previous example.  What you would expect Quartz to do.  If you haven't heard of Quartz don't worry about it,  The main thing you need to understand is that it sits in the Quartz layer that most applications use to handle the screen.    If you look directly above WindowServer, you'll see references to Carbon, Classic...  the various applications environments.

    Cocoa has the best support for Window Server so lets look at this from Cocoa's perspective rather than the Window Server's as we switch over to the logging.
    I've highlighted the NSWindow binding which is where Window Server interactions will occur.  You can see it is inside of NSResponder, which makes sense, this is how the system is going to pass events to you as an application that it believes you need to respond to.  Conversely creating a Window needs to create a reference with Window Server so it can manage it....

    It is this interaction between NSWindow as an abstract binding and WindowServer as an actual entity that will generate log.  Anytime for example an application requests something impossible, like a window bigger than the screen it is on, if an applications reports that it has no idea what do with a message that was passed to it, etc... Window Server writes a short message in windowserver.log recording this failure and then "uses its judgement" about how to handle the problem.  If you look at your own windowserver.log (if you are on a mac) you'll see that depending on your applications somewhere from every few seconds to every ten minutes something like this happens and a note is recorded.  They may seem a bit cryptic but they are designed for the applications programmers to see where and when these times when windowserver had to guess occurred.  Apple's documentation for the NSWindow class, discusses in detail what sorts of events specifically will generate log.  For example in the section on setBackingType Apple indicates that if buffering is changed after initialization that will generate an error, a log entry in windowserver.log.  I don't see any advantage in going another level deep but I hope the discussion above makes it clear what the connection is between NSWindow and Window Server, and why that documentation should be taken as authoritative on Cocoa applications generating windowserver.log entries.

    For the other environments:
    • Carbon the default is to register windows and get messages more or less like the OS9 windowserver unless kOSAModeNeverInteract is set.
    • Java the interaction happens at the JRE level.
    • Quartz-wm: handles the interaction for X11 applications.
    • Quicktime has a lower level primitive that can peer with windowserver (this is complex)
    • Classic didn't run on Raffaele's computer so we can ignore.
    And that's basically it.  Most every application uses Quartz, Quartz uses Window Server to manager the windows, Window Server logs all errors or anytime an application doesn't know how to respond to but mostly when they make an invalid request.  Common invalid requests are documented.  That is the defense's theory and it is fully 100% supported by Apple.  I leave it to you whether you consider Apple or Massei/Mignini more credible on what generates log.   Needless to say everything in this post is reproducible and verifiable on any Apple computer running OSX.

    _

    Let me move away for teaching for a second, and do a pure editorial. I've never personally done forensics in a case involving violence; when I've done it has always been theft or fraud or mostly just trying to figure out and reverse the cause of corrupted data that is driving the investigation. That being said a programmer's laptop should be analyzed more like you would a server and less like you would a general end user's. Encase is fine for Amanda or Meredith's laptops had the prosecution not "accidentally" destroyed them. I don't think it is appropriate at all for Raffaele's.   Since he was doing a computer science thesis he's a programmer it is going to require a skilled operator to do the investigation things are not going to in most obvious places or setup in the most obvious way and your typical forensic analysis will be wrong. For example the prosecution focuses heavily on cache data, and that is exactly the sort of thing you would typically check on an end user's laptop to look for activity. I agree with the prosecution's thinking. Most end users on a Mac would have their cache's in /Users/[Raf's username]/Library/Caches and /Library/Caches. But on Raf's machine I'd want to check places like /opt/local/var/cache (Apple's Darwinports default cache location), /sw/var/cache (Fink's default cache location) and he might even have a personal one like ~/caches. Encase won't check for those sorts of caches and thus the investigators won't find these in a cache's report. I agree with Raffaele's defense's intuitively, professionally, the examination the defense argues should have occurred, is exactly what I would have done were I investigating. I do consider this to have been a mistake.

    Moreover, I'll say it is the sort of mistake that a forensic accountant / examiner is likely to make; so at least on this point I don't see evidence of an intent to mislead the court. I think the prosecution is innocently incorrect.  I hate to take Mignini off the hook ever, but I don't see signs of the prosecution deliberately lying on this point.

    There is one another bad news for the defense.  Raffaele being a programmer cuts both ways.  Because he programs we can assume he knows or can easily learn how to have programs generate events that look like interactions with hardware.  He also knows how to change the windowserver.log file.  Which means on his system we have to consider the contents of these files less definitive than they otherwise would be.  I'd want to look at samples of his code from that time to get a grasp on whether the computer is telling me is likely to be true at worst or highly likely to be true at best.    I would scratch definite however in either direction.

    Monday, September 7, 2009

    Fixing MacPorts for Snow Leopard

    This is off topic so if you are one of my regular readers you probably don't care. This isn't anywhere else on the web though so I figured I'd add it to my blog so people can find the information.

    OK so from here on out I'm assuming you were a Tiger or Leopard MacPorts user who has upgraded to Snow Leopard and is getting an error message that looks like:

    dlopen(/opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib, 10): no suitable image found.  Did find:
    /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib: mach-o, but wrong architecture
    while executing
    "load /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib"
    ("package ifneeded Pextlib 1.0" script)
    invoked from within
    "package require Pextlib 1.0"
    (file "/opt/local/bin/port" line 40)
    What's happening is you have a PowerPC version of this TCL library. You need an Intelx86 version to run port. Rather than reinstall you can just fix this. I've put a zip file of the correct version on the associated website.


    download and unzip this to /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib
    replacing the broken one then you can do your
    sudo port -d selfupdate 
    and everything will be fine.


    Sunday, January 20, 2008

    Greenspun's 10 Laws

    Well.... my latest posts have been angry and serious. Maybe time for a change of pace. One of my little pet peeves is that Greenspun only had a 10th law and never did the other 9. So time to create a fake set of the 10 laws. I not even sure who among my readers is going to get the joke but its not a rant so enjoy:

    Oh and please feel free to add any good ones to help co-create this.

    Law 10 (Greenspun's 10th law): Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp.

    Law 9 (Norvig's variant): Any sufficiently complicated Common Lisp program contains an ad-hoc, informally-specified bug-ridden slow implementation of Prolog.

    Law 8 (Haskell version): Any sufficiently advanced type system includes an incomplete and twisted subset of Scheme

    Law 7 (Strong's version of the 10th): Any sufficiently complex data will be organized to contain a functional programming language

    Law 6 (Ozen's refutation): Anyone who teaches and practices in a field still in its infancy has an informally specified, ad-hoc and bug-ridden collection of rules that often amuse but rarely enlighten.

    Law 5 (Bone's Law): To fully understand any programming language, you must first implement a Lisp in it

    Law 4 (Python Law): Most successful programming languages were invented by a brilliant programmer, Lisp is built into of the structure of the Universe.

    Law 3 (Clarke's 3rd law): Any sufficiently advanced technology is indistinguishable from magic.

    Law 2 (Law of variables): On a long enough time scale, all variables are temporary

    Law 1 (Zawinski's Expansion Law): Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.