Skip to contentSkip to conversation

Add recipe mtree

PATCH New [email protected] 2 participants 4 messages May 18, 2017 – May 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add recipe mtree

From: Kai Kang <[email protected]>

Commit at:
https://github.com/parr0tr1ver/meta-security/commit/2955017982dc733233267e955295ff40b11d61f5

Kai Kang (1):
mtree: add recipe

 recipes-security/mtree/mtree/mtree-getlogin.patch | 49 +++++++++++++++++++++++
 recipes-security/mtree/mtree_1.0.3.bb             | 22 ++++++++++
 2 files changed, 71 insertions(+)
 create mode 100644 recipes-security/mtree/mtree/mtree-getlogin.patch
 create mode 100644 recipes-security/mtree/mtree_1.0.3.bb
Signature · 1 line
2.10.1
#1 lore raw

PATCH 1/1 mtree: add recipe

From: Kai Kang <[email protected]>

Add recipe mtree port from BSD. Add a patch to handle null return from getlogin.

---
 recipes-security/mtree/mtree/mtree-getlogin.patch | 49 +++++++++++++++++++++++
 recipes-security/mtree/mtree_1.0.3.bb             | 22 ++++++++++
 2 files changed, 71 insertions(+)
 create mode 100644 recipes-security/mtree/mtree/mtree-getlogin.patch
 create mode 100644 recipes-security/mtree/mtree_1.0.3.bb
recipes-security/mtree/mtree/mtree-getlogin.patch new file +49 -0
new file mode 100644
index 0000000..35b0f8d
@@ -0,0 +1,49 @@
+Upstream-Status: Pending
+
+Handle NULL return from getlogin.
+
+Signed-off-by: Kai Kang <[email protected]>
+---
+diff --git a/create.c b/create.c
+index e2d24d3..583af9b 100644
+--- a/create.c
++++ b/create.c
+@@ -77,6 +77,29 @@ static void     output(int, int *, const char *, ...) __attribute__ ((__format__
+ static int      statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *);
+ static void     statf(int, FTSENT *);
+ 
++char *my_getlogin()
++{
++        const char *s = getlogin();
++        if (s && *s)
++                return s;
++
++        struct passwd *p = getpwuid(geteuid());
++        char *ss;
++        if (p && p->pw_name) {
++                if (asprintf(&ss,"(no controlling terminal) %s",p->pw_name) < 0) {
++                        perror("asprintf");
++                        return NULL;
++                }
++        } else {
++                if (asprintf(&ss,"(no controlling terminal) #%d",geteuid()) < 0) {
++                        perror("asprintf");
++                        return NULL;
++            }
++        }
++
++        return ss;
++}
++
+ void
+ cwalk(void)
+ {
+@@ -92,7 +115,7 @@ cwalk(void)
+                 (void)gethostname(host, sizeof(host));
+                 (void)printf(
+                     "#\t   user: %s\n#\tmachine: %s\n",
+-                    getlogin(), host);
++                    my_getlogin(), host);
+                 (void)printf(
+                     "#\t   tree: %s\n#\t   date: %s",
+                     fullpath, ctime(&cl));
recipes-security/mtree/mtree_1.0.3.bb new file +22 -0
new file mode 100644
index 0000000..17d1cf7
@@ -0,0 +1,22 @@
+SUMMARY = "BSD directory hierarchy mapping tool"
+DESCRIPTION = "mtree compares a file hierarchy against a specification, creates a specification for a file hierarchy, or modifies a specification."
+
+SECTION = "utils"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bb19ea4eac951288efda4010c5c669a8"
+
+SRC_URI = "git://github.com/archiecobbs/mtree-port.git \
+           file://mtree-getlogin.patch \
+           "
+SRCREV = "172e1827c381ff3851cc99edb5fd89443cf260e9"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "openssl"
+
+inherit autotools
+
+do_configure_prepend() {
+    touch ${S}/NEWS ${S}/AUTHORS ${S}/ChangeLog
+}
Signature · 1 line
2.10.1
#2 lore raw

Re: [PATCH] mtree: add recipe

Quoted 7 lines · On Thu, May 18, 2017 at 12:22 AM, <[email protected]> wrote:

From: Kai Kang <[email protected]>

Add recipe mtree port from BSD. Add a patch to handle null return from getlogin.

Exactly what layer are you aiming for this to go to? The list you sent it to (yocto) doesn’t imply any particular layer..

Signature · 4 lines
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics
author
#3 lore raw

Re: [meta-security] [PATCH] mtree: add recipe

Quoted 6 lines · Christopher Larson

On Thu, May 18, 2017 at 12:22 AM, <[email protected] <mailto:[email protected]>> wrote:

From: Kai Kang <[email protected]
<mailto:[email protected]>>

Quoted 13 lines

Add recipe mtree port from BSD. Add a patch to handle null return from getlogin.

<mailto:[email protected]>>

Exactly what layer are you aiming for this to go to? The list you sent it to (yocto) doesn’t imply any particular layer..

Signature · 4 lines
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics

Sorry, only add the layer info in the cover letter. The pacakge is added to layer meta-security.

Thanks.

Signature · 2 lines
Regards,
Neil | Kai Kang