From owner-freebsd-virtualization@freebsd.org Tue Oct 27 14:19:47 2015 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF64AA1EFD7 for ; Tue, 27 Oct 2015 14:19:47 +0000 (UTC) (envelope-from doublef.mobile@gmail.com) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F08E192F for ; Tue, 27 Oct 2015 14:19:47 +0000 (UTC) (envelope-from doublef.mobile@gmail.com) Received: by wicfx6 with SMTP id fx6so161805603wic.1 for ; Tue, 27 Oct 2015 07:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=WA+NEVFHmC/zR08ewur4FF5G8rKqerBRIOmFUKJlX6A=; b=zlYVUHXLXRJWeq7rBFONaowpqyV+efoo1qMgCN7Ft4/3TJs+orpQMKDDObH6vWeLT6 jw6iT7nWp4Pwwxd8CyJnDphFpRY9yP8EMRruZ2T8oDhXuZ55dw+A3KKdIcQkT57sJ2Of H8IjZdq0hwyLaum8o7tPC9XwFBZztefy/V2WZH9doLaCSPbePdkRZd1PoHWcgkeo9tS2 Wil/R3pVK4tpkEkuO67z8S8ilSgM8bfwh6NuDuQxLWAyUa/F9o4ayqnyqIhkZxRUqLdv axtRtD7Kx1e3wtwXLPeI4cgAqOcstDvS53Q88sk11Vgs6Nck371xK36dlO4Z+wx81Ilp jl4A== X-Received: by 10.194.61.13 with SMTP id l13mr33524657wjr.76.1445955585695; Tue, 27 Oct 2015 07:19:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.178.3 with HTTP; Tue, 27 Oct 2015 07:19:26 -0700 (PDT) From: Sergey Zakharchenko Date: Tue, 27 Oct 2015 17:19:26 +0300 Message-ID: Subject: Docker: jail: name cannot be numeric fix To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 14:19:47 -0000 Hello, This is just a quick note that the problem mentioned in the Docker wiki https://wiki.freebsd.org/Docker : > {{{ > docker run -t -i centos /bin/bash > jail: name cannot be numeric (unless it is the jid > }}} > > Unknown: Noticed when re-running a container. is not of an 'unknown' origin: it lies in sys/kern/kern_jail.c 's detection of numeric JIDs, which dates back to 2009: https://svnweb.freebsd.org/base/head/sys/kern/kern_jail.c?revision=285685&view=markup else if (*namelc == '0' || (strtoul(namelc, &p, 10) != jid && *p == '\0'))) It thinks everything that starts with a '0' is numeric, and doesn't check that it's the only character, e.g. namelc[1] == '\0'. This check is incorrect for some of the hex jail names that Docker generates. This is demonstrated by e.g. the following: ---> Running in 062a4f391fd9 jail: name cannot be numeric (unless it is the jid) Should I send a PR? Best regards, -- DoubleF