From owner-freebsd-arch@freebsd.org Mon May 16 18:10:27 2016 Return-Path: Delivered-To: freebsd-arch@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 5BA3FB3D34F for ; Mon, 16 May 2016 18:10:27 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (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 2A7971F5A for ; Mon, 16 May 2016 18:10:27 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22c.google.com with SMTP id g133so169817694ywb.2 for ; Mon, 16 May 2016 11:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=1u51LIF7k+Mp0bwuHDv3mklI6nC9v+CZUUtkkhPOGyQ=; b=npAEsmf+pjc0wrC4V61y9OzbvIaj4rIOO1EH460VW536HGQ/6pUow23GSIzgKMeuzF ola+Q2iMtwJmB9epXslx/zHa4pVnPC+y/oNR/jROHVzUQx5ueVufpTqqZgwsulzoVSi8 gGZn3C/2p0jPx/TBo5yLHioDjvlAS3j8zNqOC1/Z7t4GFVDj1+3hn2uKhBVJerYWNKd6 z1quBK4pe2JKCVtsztuD3s5u3Kt0bT+ax304vpJzK+YAzR+lJ54SAZEPDWZWbx/VQBs9 RezKNcM96NEYDpeWNiSiZtzQVafC9DDe83Khk7kON5xKoXlQuZRxsczWdI76IDnhPKSp Ee9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=1u51LIF7k+Mp0bwuHDv3mklI6nC9v+CZUUtkkhPOGyQ=; b=EUqnGsM0xvaLZqojigZOWec4Ks3OjJK2qW14Xo4JGIAfa/tPFM28SthEkAUMJdTGb/ cV63s0nVj1v0qtaanW9V+HT0iguJmHYc3z33df+r0yWBbgu/oK/LhfflmCvT46cvwaCE fEORjUSvsxQh49yJr0q8q6saTS9xyXQZp/EblvSixJ11Ibm5AP8/riEsTWWwgaVqbffJ 10T/4OyRCPbUmQjHdtqqy/qbbPrjlVtgIpOUyMUNBjtp5u3i2MWeMN3541hkBRXF9hbJ F/4bptAaydujlv47fSuuiMLGjSXrPfgF2SeumqsQwJ5KNnSoSooDfNhInAQAVuUWTkWI /+jg== X-Gm-Message-State: AOPr4FW6MbqE0/JbEXoc50/aqTwgqdyZTct2IsLNKpg0JW5SlP1eqx2VeNue8cY81G27lpnrNctoU7g2zzPHnQ== MIME-Version: 1.0 X-Received: by 10.37.195.133 with SMTP id t127mr7772595ybf.149.1463422226214; Mon, 16 May 2016 11:10:26 -0700 (PDT) Received: by 10.13.201.199 with HTTP; Mon, 16 May 2016 11:10:26 -0700 (PDT) In-Reply-To: <201605152307.u4FN7Gtg069070@gw.catspoiler.org> References: <201605152307.u4FN7Gtg069070@gw.catspoiler.org> Date: Mon, 16 May 2016 20:10:26 +0200 Message-ID: Subject: Re: is ut_user[] in struct utmpx NUL terminated? From: Ed Schouten To: Don Lewis Cc: freebsd-arch@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 18:10:27 -0000 Hi Don, 2016-05-16 1:07 GMT+02:00 Don Lewis : > There is a lot of code that expects ut_user[] to be NUL terminated. Our implementation of utmpx should be pretty friendly to use: - You can call pututxline() with strings that are not null terminated. - The getutx*() functions return entries in which all strings are null terminated. Keep in mind that ut_id is not a string, but a binary identifier, meaning it is not null terminated. Best regards, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717