From patchwork Sun Oct 4 13:31:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Hadjinlian X-Patchwork-Id: 526149 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id ED6961402B2 for ; Mon, 5 Oct 2015 00:32:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=vwE73Zja; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 394BC8D757; Sun, 4 Oct 2015 13:32:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uZIIjkSpSwIU; Sun, 4 Oct 2015 13:32:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id CF1338D58D; Sun, 4 Oct 2015 13:32:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4D66A1C1054 for ; Sun, 4 Oct 2015 13:32:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 457AC8D363 for ; Sun, 4 Oct 2015 13:31:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2yZl-cBvXpSh for ; Sun, 4 Oct 2015 13:31:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by whitealder.osuosl.org (Postfix) with ESMTPS id 92BD98D2DA for ; Sun, 4 Oct 2015 13:31:58 +0000 (UTC) Received: by wicfx3 with SMTP id fx3so86470010wic.1 for ; Sun, 04 Oct 2015 06:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aQBHGxGsNMYy1Er2pQ4JJMOUR6UOVWj8D5Y9/jyhYtk=; b=vwE73Zja7wwb5pV8mi9+GCpnP1Mkq0gzYvNG74R6GgjNyMSRv1ATbJZJihYOs67XCI OveHK8pL2EN57dRJzeeer75dUyudIj6bFdO3fdpPY6VhJUdhEIUJ1d9InKnIWihS0dAZ qm0vNRvvAqX2YdEvm5YnNveixINiIaQhpFGLZC6ovdaq8BqM16pkEylc9wHP4LHpzJi9 KKH7PwOBoE2OFBlify5cebSj31hUsybryPA9r6xltG7a15rtLfuuQwsCWS5na4Gzc+mE ynL+W4IWKFui1moHY86DrGtW52SfQsAO3vvE1Q9pGVyylSd8+uMGEP2fcTWbJKvcUP+F E3ig== X-Received: by 10.180.198.142 with SMTP id jc14mr7088747wic.32.1443965517217; Sun, 04 Oct 2015 06:31:57 -0700 (PDT) Received: from localhost.localdomain (LPoitiers-656-1-204-92.w80-11.abo.wanadoo.fr. [80.11.219.92]) by smtp.gmail.com with ESMTPSA id lj12sm9349542wic.0.2015.10.04.06.31.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Oct 2015 06:31:55 -0700 (PDT) From: Maxime Hadjinlian To: buildroot@busybox.net Date: Sun, 4 Oct 2015 15:31:34 +0200 Message-Id: <1443965495-12774-2-git-send-email-maxime.hadjinlian@gmail.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1443965495-12774-1-git-send-email-maxime.hadjinlian@gmail.com> References: <1443965495-12774-1-git-send-email-maxime.hadjinlian@gmail.com> Subject: [Buildroot] [PATCH 2/3] vsftpd: Add ftp user creation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to remove '/home/ftp' and the ftp user from the 'skeleton' package, we need to add the creation of the ftp users to the package so it still work out of the box (with an anonymous user). Signed-off-by: Maxime Hadjinlian Reviewed-by: Vicente Olivert Riera --- package/vsftpd/vsftpd.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package/vsftpd/vsftpd.mk b/package/vsftpd/vsftpd.mk index 1e48264..976d397 100644 --- a/package/vsftpd/vsftpd.mk +++ b/package/vsftpd/vsftpd.mk @@ -43,9 +43,22 @@ define VSFTPD_BUILD_CMDS LDFLAGS="$(TARGET_LDFLAGS)" LIBS="$(VSFTPD_LIBS)" -C $(@D) endef +define VSFTPD_USERS + ftp -1 ftp -1 * /home/ftp - - Anonymous FTP User +endef + define VSFTPD_INSTALL_INIT_SYSV $(INSTALL) -D -m 755 package/vsftpd/S70vsftpd $(TARGET_DIR)/etc/init.d/S70vsftpd endef +# +# VSFTPD won't work if the jail directory is writable, it has to be readable +# only +# Otherwise you get the following error: +# 500 OOPS: vsftpd: refusing to run with writable root inside chroot() +# That's why we have to chmod /home/ftp +define VSFTPD_FIX_HOME_PERMISSIONS + $(INSTALL) -d -m 555 $(TARGET_DIR)/home/ftp +endef define VSFTPD_INSTALL_TARGET_CMDS $(INSTALL) -D -m 755 $(@D)/vsftpd $(TARGET_DIR)/usr/sbin/vsftpd @@ -53,6 +66,7 @@ define VSFTPD_INSTALL_TARGET_CMDS $(INSTALL) -D -m 644 $(@D)/vsftpd.conf \ $(TARGET_DIR)/etc/vsftpd.conf $(INSTALL) -d -m 700 $(TARGET_DIR)/usr/share/empty + $(VSFTPD_FIX_HOME_PERMISSIONS) endef $(eval $(generic-package))