[arch-commits] Commit in deepin-daemon/repos (16 files)

Felix Yan fyan at archlinux.org
Thu Nov 26 06:54:55 UTC 2015


    Date: Thursday, November 26, 2015 @ 07:54:55
  Author: fyan
Revision: 147835

archrelease: copy trunk to community-i686, community-x86_64

Added:
  deepin-daemon/repos/community-i686/PKGBUILD
    (from rev 147834, deepin-daemon/trunk/PKGBUILD)
  deepin-daemon/repos/community-i686/deepin-daemon.install
    (from rev 147834, deepin-daemon/trunk/deepin-daemon.install)
  deepin-daemon/repos/community-i686/deepin-daemon.sysusers
    (from rev 147834, deepin-daemon/trunk/deepin-daemon.sysusers)
  deepin-daemon/repos/community-i686/fix-i686-compile.patch
    (from rev 147834, deepin-daemon/trunk/fix-i686-compile.patch)
  deepin-daemon/repos/community-i686/get-distro-info.patch
    (from rev 147834, deepin-daemon/trunk/get-distro-info.patch)
  deepin-daemon/repos/community-i686/ishuman-via-login-defs.patch
    (from rev 147834, deepin-daemon/trunk/ishuman-via-login-defs.patch)
  deepin-daemon/repos/community-x86_64/PKGBUILD
    (from rev 147834, deepin-daemon/trunk/PKGBUILD)
  deepin-daemon/repos/community-x86_64/deepin-daemon.install
    (from rev 147834, deepin-daemon/trunk/deepin-daemon.install)
  deepin-daemon/repos/community-x86_64/deepin-daemon.sysusers
    (from rev 147834, deepin-daemon/trunk/deepin-daemon.sysusers)
  deepin-daemon/repos/community-x86_64/fix-i686-compile.patch
    (from rev 147834, deepin-daemon/trunk/fix-i686-compile.patch)
  deepin-daemon/repos/community-x86_64/get-distro-info.patch
    (from rev 147834, deepin-daemon/trunk/get-distro-info.patch)
  deepin-daemon/repos/community-x86_64/ishuman-via-login-defs.patch
    (from rev 147834, deepin-daemon/trunk/ishuman-via-login-defs.patch)
Deleted:
  deepin-daemon/repos/community-i686/get-distro-info.patch
  deepin-daemon/repos/community-i686/ishuman-via-login-defs.patch
  deepin-daemon/repos/community-x86_64/get-distro-info.patch
  deepin-daemon/repos/community-x86_64/ishuman-via-login-defs.patch

-----------------------------------------------+
 /get-distro-info.patch                        |  238 +++++++++++++++++++++
 /ishuman-via-login-defs.patch                 |  264 ++++++++++++++++++++++++
 community-i686/PKGBUILD                       |   83 +++++++
 community-i686/deepin-daemon.install          |   13 +
 community-i686/deepin-daemon.sysusers         |    2 
 community-i686/fix-i686-compile.patch         |   12 +
 community-i686/get-distro-info.patch          |  119 ----------
 community-i686/ishuman-via-login-defs.patch   |  132 ------------
 community-x86_64/PKGBUILD                     |   83 +++++++
 community-x86_64/deepin-daemon.install        |   13 +
 community-x86_64/deepin-daemon.sysusers       |    2 
 community-x86_64/fix-i686-compile.patch       |   12 +
 community-x86_64/get-distro-info.patch        |  119 ----------
 community-x86_64/ishuman-via-login-defs.patch |  132 ------------
 14 files changed, 722 insertions(+), 502 deletions(-)

Copied: deepin-daemon/repos/community-i686/PKGBUILD (from rev 147834, deepin-daemon/trunk/PKGBUILD)
===================================================================
--- community-i686/PKGBUILD	                        (rev 0)
+++ community-i686/PKGBUILD	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,83 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
+# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>
+
+pkgname=deepin-daemon
+pkgver=2.93.1
+#_golibver=0.4.2
+_golibrev=238151791673412dedf333363b3a37343c461acb
+_deepinapiver=2.92.1
+_dbusfactoryver=2.92.1
+_desktopbaserev=6cd46627bb62ce820991aa53439be8142b523ad8
+pkgrel=4
+pkgdesc='Daemon handling the DDE session settings'
+arch=('i686' 'x86_64')
+url="https://github.com/linuxdeepin/dde-daemon"
+license=('GPL3')
+depends=('deepin-desktop-schemas' 'gvfs' 'libcanberra-pulse' 'metacity' 'poppler-glib'
+         'rfkill' 'acpid' 'bluez' 'deepin-notifications' 'iso-codes' 'lsb-release'
+         'mobile-broadband-provider-info' 'polkit-gnome' 'udisks2' 'upower' 'gcc-go'
+         'libxkbfile' 'accountsservice')
+makedepends=('deepin-dbus-generator' 'sqlite' 'git' 'mercurial')
+optdepends=('networkmanager: Network Management daemon'
+            'deepin-grub2-themes: deepin theme for grub menu')
+conflicts=('dde-daemon')
+replaces=('dde-daemon')
+groups=('deepin')
+install="${pkgname}.install"
+source=("git+https://github.com/linuxdeepin/dde-daemon.git#tag=$pkgver"
+        #"git+https://github.com/linuxdeepin/go-lib.git#tag=$_golibver"
+        "git+https://github.com/linuxdeepin/go-lib.git#commit=$_golibrev"
+        "git+https://github.com/linuxdeepin/dbus-factory.git#tag=$_dbusfactoryver"
+        "git+https://github.com/linuxdeepin/dde-api.git#tag=$_deepinapiver"
+        "git+https://github.com/linuxdeepin/deepin-desktop-base.git#commit=$_desktopbaserev"
+        'fix-i686-compile.patch' 'deepin-daemon.sysusers' 'ishuman-via-login-defs.patch' 'get-distro-info.patch')
+sha256sums=('SKIP'
+            'SKIP'
+            'SKIP'
+            'SKIP'
+            'SKIP'
+            '1dccf88c5ce480560a4a2d73134e69f05135703fe34ccd5d9e2e5d7fe852efc5'
+            '4482f2c82c3652040021dd43515f131184a0417e341dc37db487117012245e25'
+            '182fd299b9f222ce8f94da9137fb671f95fbd32bd28becfaf8c97b9fdd488c65'
+            '4b3f743b8cffc591ab5582aa4ba6a56f464cd7c279a3594e637fffac0a14df63')
+
+prepare() {
+  export GOPATH="$srcdir/build"
+  mkdir -p build/src/pkg.deepin.io/{lib,dde/api}
+  cp -a go-lib/* build/src/pkg.deepin.io/lib
+  cp -a dde-api/* build/src/pkg.deepin.io/dde/api/
+  
+  go get github.com/BurntSushi/xgb github.com/BurntSushi/xgbutil github.com/howeyc/fsnotify \
+         github.com/mattn/go-sqlite3 gopkg.in/alecthomas/kingpin.v2 github.com/disintegration/imaging \
+         code.google.com/p/graphics-go/graphics code.google.com/p/jamslam-freetype-go/freetype \
+         code.google.com/p/jamslam-freetype-go/freetype/truetype
+
+  cd dde-daemon
+  # TODO: a temporary solution by disable go-sqlite3 to avoid build
+  #       issue for go1.4/i686
+  # https://github.com/golang/go/issues/9510
+  if [[ $CARCH == "i686" ]]; then
+    patch -p1 -i ../fix-i686-compile.patch
+  fi
+
+  patch -p1 -i ../ishuman-via-login-defs.patch
+  patch -p1 -i ../get-distro-info.patch
+}
+
+build() {
+  cd "$srcdir/dbus-factory"
+  make install-golang
+
+  cd "$srcdir/dde-daemon"
+  make USE_GCCGO=1
+}
+
+package() {
+  cd dde-daemon
+  make USE_GCCGO=1 DESTDIR="${pkgdir}" install
+
+  install -Dm644 ../deepin-daemon.sysusers "$pkgdir/usr/lib/sysusers.d/deepin-daemon.conf"
+  install -Dm644 "${srcdir}"/deepin-desktop-base/desktop-version "${pkgdir}"/etc/deepin-version
+}

Copied: deepin-daemon/repos/community-i686/deepin-daemon.install (from rev 147834, deepin-daemon/trunk/deepin-daemon.install)
===================================================================
--- community-i686/deepin-daemon.install	                        (rev 0)
+++ community-i686/deepin-daemon.install	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,13 @@
+post_install() {
+  glib-compile-schemas --allow-any-name usr/share/glib-2.0/schemas
+  systemd-sysusers deepin-daemon.conf
+}
+
+post_upgrade() {
+  glib-compile-schemas --allow-any-name usr/share/glib-2.0/schemas
+  (( $(vercmp $2 '2.93.1-1') < 0 )) && systemd-sysusers deepin-daemon.conf || true
+}
+
+post_remove() {
+  rm -f /var/cache/deepin/mark-setup-network-services
+}

Copied: deepin-daemon/repos/community-i686/deepin-daemon.sysusers (from rev 147834, deepin-daemon/trunk/deepin-daemon.sysusers)
===================================================================
--- community-i686/deepin-daemon.sysusers	                        (rev 0)
+++ community-i686/deepin-daemon.sysusers	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,2 @@
+u deepin-daemon - "Deepin Daemon"
+g deepin-daemon -

Copied: deepin-daemon/repos/community-i686/fix-i686-compile.patch (from rev 147834, deepin-daemon/trunk/fix-i686-compile.patch)
===================================================================
--- community-i686/fix-i686-compile.patch	                        (rev 0)
+++ community-i686/fix-i686-compile.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,12 @@
+diff --git a/launcher/item/item.go b/launcher/item/item.go
+index a8ccbbe..3701968 100644
+--- a/launcher/item/item.go
++++ b/launcher/item/item.go
+@@ -4,7 +4,6 @@ import (
+ 	"path"
+ 	"strings"
+ 
+-	_ "github.com/mattn/go-sqlite3"
+ 
+ 	"pkg.deepin.io/dde/daemon/launcher/category"
+ 	. "pkg.deepin.io/dde/daemon/launcher/interfaces"

Deleted: community-i686/get-distro-info.patch
===================================================================
--- community-i686/get-distro-info.patch	2015-11-26 06:53:27 UTC (rev 147834)
+++ community-i686/get-distro-info.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -1,119 +0,0 @@
-commit a39042ae318f404ac44196cc028e234e6b01d489
-Author: Felix Yan <felixonmars at archlinux.org>
-Date:   Wed Nov 25 12:55:31 2015 +0800
-
-    Add methods to get distribution info
-    
-    Change-Id: I915fa4a5f429430e5c183ade58bd727c7d5a2478
-
-diff --git a/systeminfo/distro.go b/systeminfo/distro.go
-new file mode 100644
-index 0000000..cfd5bc5
---- /dev/null
-+++ b/systeminfo/distro.go
-@@ -0,0 +1,51 @@
-+package systeminfo
-+
-+import (
-+	"fmt"
-+)
-+
-+const (
-+	distroFileLSB    = "/etc/lsb-release"
-+
-+	distroIdKeyLSB   = "DISTRIB_ID"
-+	distroDescKeyLSB = "DISTRIB_DESCRIPTION"
-+	distroVerKeyLSB  = "DISTRIB_RELEASE"
-+	distroKeyDelim   = "="
-+)
-+
-+func getDistro() (string, string, string, error) {
-+	distroId, distroDesc, distroVer, err := getDistroFromLSB(distroFileLSB)
-+	if err == nil {
-+		return distroId, distroDesc, distroVer, nil
-+	}
-+
-+	return "", "", "", err
-+}
-+
-+func getDistroFromLSB(file string) (string, string, string, error) {
-+	ret, err := parseInfoFile(file, distroKeyDelim)
-+	if err != nil {
-+		return "", "", "", err
-+	}
-+
-+	distroId, ok := ret[distroIdKeyLSB]
-+	if !ok {
-+		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroIdKeyLSB)
-+	}
-+
-+	distroDesc, ok := ret[distroDescKeyLSB]
-+	if !ok {
-+		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroDescKeyLSB)
-+	}
-+
-+	if distroDesc[0] == '"' && distroDesc[len(distroDesc) - 1] == '"' {
-+		distroDesc = distroDesc[1:len(distroDesc) - 1]
-+	}
-+
-+	distroVer, ok := ret[distroVerKeyLSB]
-+	if !ok {
-+		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroVerKeyLSB)
-+	}
-+
-+	return distroId, distroDesc, distroVer, nil
-+}
-diff --git a/systeminfo/info.go b/systeminfo/info.go
-index c905cab..808ffb7 100644
---- a/systeminfo/info.go
-+++ b/systeminfo/info.go
-@@ -7,8 +7,14 @@ import (
- )
- 
- type SystemInfo struct {
--	// Current version, ex: "2015 Desktop"
-+	// Current deepin version, ex: "2015 Desktop"
- 	Version string
-+	// Distribution ID
-+	DistroID string
-+	// Distribution Description
-+	DistroDesc string
-+	// Distribution Version
-+	DistroVer string
- 	// CPU information
- 	Processor string
- 	// Disk capacity
-@@ -82,6 +88,11 @@ func NewSystemInfo() *SystemInfo {
- 		logger.Warning("Get version failed:", err)
- 	}
- 
-+	info.DistroID, info.DistroDesc, info.DistroVer, err = getDistro()
-+	if err != nil {
-+		logger.Warning("Get distribution failed:", err)
-+	}
-+
- 	info.MemoryCap, err = getMemoryFromFile("/proc/meminfo")
- 	if err != nil {
- 		logger.Warning("Get memory capacity failed:", err)
-diff --git a/systeminfo/info_test.go b/systeminfo/info_test.go
-index 11bffb7..56700b0 100644
---- a/systeminfo/info_test.go
-+++ b/systeminfo/info_test.go
-@@ -42,3 +42,17 @@ func TestVersion(t *testing.T) {
- 		So(err, ShouldBeNil)
- 	})
- }
-+
-+func TestDistro(t *testing.T) {
-+	Convey("Test os distro", t, func() {
-+		lang := os.Getenv("LANGUAGE")
-+		os.Setenv("LANGUAGE", "en_US")
-+		defer os.Setenv("LANGUAGE", lang)
-+
-+		distroId, distroDesc, distroVer, err := getDistroFromLSB("testdata/lsb-release")
-+		So(distroId, ShouldEqual, "Deepin")
-+		So(distroDesc, ShouldEqual, "Deepin 2014.3")
-+		So(distroVer, ShouldEqual, "2014.3")
-+		So(err, ShouldBeNil)
-+	})
-+}

Copied: deepin-daemon/repos/community-i686/get-distro-info.patch (from rev 147834, deepin-daemon/trunk/get-distro-info.patch)
===================================================================
--- community-i686/get-distro-info.patch	                        (rev 0)
+++ community-i686/get-distro-info.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,119 @@
+commit a39042ae318f404ac44196cc028e234e6b01d489
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Wed Nov 25 12:55:31 2015 +0800
+
+    Add methods to get distribution info
+    
+    Change-Id: I915fa4a5f429430e5c183ade58bd727c7d5a2478
+
+diff --git a/systeminfo/distro.go b/systeminfo/distro.go
+new file mode 100644
+index 0000000..cfd5bc5
+--- /dev/null
++++ b/systeminfo/distro.go
+@@ -0,0 +1,51 @@
++package systeminfo
++
++import (
++	"fmt"
++)
++
++const (
++	distroFileLSB    = "/etc/lsb-release"
++
++	distroIdKeyLSB   = "DISTRIB_ID"
++	distroDescKeyLSB = "DISTRIB_DESCRIPTION"
++	distroVerKeyLSB  = "DISTRIB_RELEASE"
++	distroKeyDelim   = "="
++)
++
++func getDistro() (string, string, string, error) {
++	distroId, distroDesc, distroVer, err := getDistroFromLSB(distroFileLSB)
++	if err == nil {
++		return distroId, distroDesc, distroVer, nil
++	}
++
++	return "", "", "", err
++}
++
++func getDistroFromLSB(file string) (string, string, string, error) {
++	ret, err := parseInfoFile(file, distroKeyDelim)
++	if err != nil {
++		return "", "", "", err
++	}
++
++	distroId, ok := ret[distroIdKeyLSB]
++	if !ok {
++		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroIdKeyLSB)
++	}
++
++	distroDesc, ok := ret[distroDescKeyLSB]
++	if !ok {
++		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroDescKeyLSB)
++	}
++
++	if distroDesc[0] == '"' && distroDesc[len(distroDesc) - 1] == '"' {
++		distroDesc = distroDesc[1:len(distroDesc) - 1]
++	}
++
++	distroVer, ok := ret[distroVerKeyLSB]
++	if !ok {
++		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroVerKeyLSB)
++	}
++
++	return distroId, distroDesc, distroVer, nil
++}
+diff --git a/systeminfo/info.go b/systeminfo/info.go
+index c905cab..808ffb7 100644
+--- a/systeminfo/info.go
++++ b/systeminfo/info.go
+@@ -7,8 +7,14 @@ import (
+ )
+ 
+ type SystemInfo struct {
+-	// Current version, ex: "2015 Desktop"
++	// Current deepin version, ex: "2015 Desktop"
+ 	Version string
++	// Distribution ID
++	DistroID string
++	// Distribution Description
++	DistroDesc string
++	// Distribution Version
++	DistroVer string
+ 	// CPU information
+ 	Processor string
+ 	// Disk capacity
+@@ -82,6 +88,11 @@ func NewSystemInfo() *SystemInfo {
+ 		logger.Warning("Get version failed:", err)
+ 	}
+ 
++	info.DistroID, info.DistroDesc, info.DistroVer, err = getDistro()
++	if err != nil {
++		logger.Warning("Get distribution failed:", err)
++	}
++
+ 	info.MemoryCap, err = getMemoryFromFile("/proc/meminfo")
+ 	if err != nil {
+ 		logger.Warning("Get memory capacity failed:", err)
+diff --git a/systeminfo/info_test.go b/systeminfo/info_test.go
+index 11bffb7..56700b0 100644
+--- a/systeminfo/info_test.go
++++ b/systeminfo/info_test.go
+@@ -42,3 +42,17 @@ func TestVersion(t *testing.T) {
+ 		So(err, ShouldBeNil)
+ 	})
+ }
++
++func TestDistro(t *testing.T) {
++	Convey("Test os distro", t, func() {
++		lang := os.Getenv("LANGUAGE")
++		os.Setenv("LANGUAGE", "en_US")
++		defer os.Setenv("LANGUAGE", lang)
++
++		distroId, distroDesc, distroVer, err := getDistroFromLSB("testdata/lsb-release")
++		So(distroId, ShouldEqual, "Deepin")
++		So(distroDesc, ShouldEqual, "Deepin 2014.3")
++		So(distroVer, ShouldEqual, "2014.3")
++		So(err, ShouldBeNil)
++	})
++}

Deleted: community-i686/ishuman-via-login-defs.patch
===================================================================
--- community-i686/ishuman-via-login-defs.patch	2015-11-26 06:53:27 UTC (rev 147834)
+++ community-i686/ishuman-via-login-defs.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -1,132 +0,0 @@
-commit 50844ff5338feeaa1e59af72eb3d0a624f3e4791
-Author: Felix Yan <felixonmars at archlinux.org>
-Date:   Wed Nov 25 00:27:27 2015 +0800
-
-    Add support to check login.defs for isHuman
-    
-    Change-Id: Ic18e289d02b208a4c28f64a7362a082f5280556e
-
-diff --git a/accounts/users/list.go b/accounts/users/list.go
-index 4b6d563..e5038e4 100644
---- a/accounts/users/list.go
-+++ b/accounts/users/list.go
-@@ -25,16 +25,19 @@ import (
- 	"fmt"
- 	"io/ioutil"
- 	"strings"
-+	"strconv"
- )
- 
- const (
--	userFilePasswd = "/etc/passwd"
--	userFileShadow = "/etc/shadow"
--	userFileGroup  = "/etc/group"
--
--	itemLenPasswd = 7
--	itemLenShadow = 9
--	itemLenGroup  = 4
-+	userFilePasswd    = "/etc/passwd"
-+	userFileShadow    = "/etc/shadow"
-+	userFileGroup     = "/etc/group"
-+	userFileLoginDefs = "/etc/login.defs"
-+
-+	itemLenPasswd    = 7
-+	itemLenShadow    = 9
-+	itemLenGroup     = 4
-+	itemLenLoginDefs = 2
- )
- 
- var (
-@@ -137,7 +140,7 @@ func (infos UserInfos) GetUserNames() []string {
- func (infos UserInfos) filterUserInfos() UserInfos {
- 	var tmp UserInfos
- 	for _, info := range infos {
--		if !info.isHumanUser(userFileShadow) {
-+		if !info.isHumanUser(userFileShadow, userFileLoginDefs) {
- 			continue
- 		}
- 
-@@ -147,7 +150,7 @@ func (infos UserInfos) filterUserInfos() UserInfos {
- 	return tmp
- }
- 
--func (info UserInfo) isHumanUser(config string) bool {
-+func (info UserInfo) isHumanUser(configShadow string, configLoginDefs string) bool {
- 	if info.Name == "root" {
- 		return false
- 	}
-@@ -156,7 +159,11 @@ func (info UserInfo) isHumanUser(config string) bool {
- 		return false
- 	}
- 
--	if !info.isHumanViaShadow(config) {
-+	if !info.isHumanViaShadow(configShadow) {
-+		return false
-+	}
-+
-+	if !info.isHumanViaLoginDefs(configLoginDefs) {
- 		return false
- 	}
- 
-@@ -214,3 +221,60 @@ func (info UserInfo) isHumanViaShadow(config string) bool {
- 
- 	return false
- }
-+
-+func (info UserInfo) isHumanViaLoginDefs(config string) bool {
-+	var uidMin, uidMax string
-+	content, err := ioutil.ReadFile(config)
-+	if err != nil {
-+		return false
-+	}
-+
-+	lines := strings.Split(string(content), "\n")
-+	for _, line := range lines {
-+		if len(line) == 0 {
-+			continue
-+		}
-+
-+		if line[0] == '#' {
-+			continue
-+		}
-+
-+		items := strings.Fields(line)
-+		if len(items) != itemLenLoginDefs {
-+			continue
-+		}
-+
-+		if items[0] == "UID_MIN" {
-+			uidMin = items[1]
-+		}
-+
-+		if items[0] == "UID_MAX" {
-+			uidMax = items[1]
-+		}
-+	}
-+
-+	if len(uidMax) == 0 || len(uidMin) == 0 {
-+		return false
-+	}
-+
-+	uidMinInt, err := strconv.Atoi(uidMin)
-+	if err != nil {
-+		return false
-+	}
-+
-+	uidMaxInt, err := strconv.Atoi(uidMax)
-+	if err != nil {
-+		return false
-+	}
-+
-+	uidInt, err := strconv.Atoi(info.Uid)
-+	if err != nil {
-+		return false
-+	}
-+
-+	if uidInt > uidMaxInt || uidInt < uidMinInt {
-+		return false
-+	}
-+
-+	return true
-+}
-\ No newline at end of file

Copied: deepin-daemon/repos/community-i686/ishuman-via-login-defs.patch (from rev 147834, deepin-daemon/trunk/ishuman-via-login-defs.patch)
===================================================================
--- community-i686/ishuman-via-login-defs.patch	                        (rev 0)
+++ community-i686/ishuman-via-login-defs.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,132 @@
+commit 50844ff5338feeaa1e59af72eb3d0a624f3e4791
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Wed Nov 25 00:27:27 2015 +0800
+
+    Add support to check login.defs for isHuman
+    
+    Change-Id: Ic18e289d02b208a4c28f64a7362a082f5280556e
+
+diff --git a/accounts/users/list.go b/accounts/users/list.go
+index 4b6d563..e5038e4 100644
+--- a/accounts/users/list.go
++++ b/accounts/users/list.go
+@@ -25,16 +25,19 @@ import (
+ 	"fmt"
+ 	"io/ioutil"
+ 	"strings"
++	"strconv"
+ )
+ 
+ const (
+-	userFilePasswd = "/etc/passwd"
+-	userFileShadow = "/etc/shadow"
+-	userFileGroup  = "/etc/group"
+-
+-	itemLenPasswd = 7
+-	itemLenShadow = 9
+-	itemLenGroup  = 4
++	userFilePasswd    = "/etc/passwd"
++	userFileShadow    = "/etc/shadow"
++	userFileGroup     = "/etc/group"
++	userFileLoginDefs = "/etc/login.defs"
++
++	itemLenPasswd    = 7
++	itemLenShadow    = 9
++	itemLenGroup     = 4
++	itemLenLoginDefs = 2
+ )
+ 
+ var (
+@@ -137,7 +140,7 @@ func (infos UserInfos) GetUserNames() []string {
+ func (infos UserInfos) filterUserInfos() UserInfos {
+ 	var tmp UserInfos
+ 	for _, info := range infos {
+-		if !info.isHumanUser(userFileShadow) {
++		if !info.isHumanUser(userFileShadow, userFileLoginDefs) {
+ 			continue
+ 		}
+ 
+@@ -147,7 +150,7 @@ func (infos UserInfos) filterUserInfos() UserInfos {
+ 	return tmp
+ }
+ 
+-func (info UserInfo) isHumanUser(config string) bool {
++func (info UserInfo) isHumanUser(configShadow string, configLoginDefs string) bool {
+ 	if info.Name == "root" {
+ 		return false
+ 	}
+@@ -156,7 +159,11 @@ func (info UserInfo) isHumanUser(config string) bool {
+ 		return false
+ 	}
+ 
+-	if !info.isHumanViaShadow(config) {
++	if !info.isHumanViaShadow(configShadow) {
++		return false
++	}
++
++	if !info.isHumanViaLoginDefs(configLoginDefs) {
+ 		return false
+ 	}
+ 
+@@ -214,3 +221,60 @@ func (info UserInfo) isHumanViaShadow(config string) bool {
+ 
+ 	return false
+ }
++
++func (info UserInfo) isHumanViaLoginDefs(config string) bool {
++	var uidMin, uidMax string
++	content, err := ioutil.ReadFile(config)
++	if err != nil {
++		return false
++	}
++
++	lines := strings.Split(string(content), "\n")
++	for _, line := range lines {
++		if len(line) == 0 {
++			continue
++		}
++
++		if line[0] == '#' {
++			continue
++		}
++
++		items := strings.Fields(line)
++		if len(items) != itemLenLoginDefs {
++			continue
++		}
++
++		if items[0] == "UID_MIN" {
++			uidMin = items[1]
++		}
++
++		if items[0] == "UID_MAX" {
++			uidMax = items[1]
++		}
++	}
++
++	if len(uidMax) == 0 || len(uidMin) == 0 {
++		return false
++	}
++
++	uidMinInt, err := strconv.Atoi(uidMin)
++	if err != nil {
++		return false
++	}
++
++	uidMaxInt, err := strconv.Atoi(uidMax)
++	if err != nil {
++		return false
++	}
++
++	uidInt, err := strconv.Atoi(info.Uid)
++	if err != nil {
++		return false
++	}
++
++	if uidInt > uidMaxInt || uidInt < uidMinInt {
++		return false
++	}
++
++	return true
++}
+\ No newline at end of file

Copied: deepin-daemon/repos/community-x86_64/PKGBUILD (from rev 147834, deepin-daemon/trunk/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD	                        (rev 0)
+++ community-x86_64/PKGBUILD	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,83 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
+# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>
+
+pkgname=deepin-daemon
+pkgver=2.93.1
+#_golibver=0.4.2
+_golibrev=238151791673412dedf333363b3a37343c461acb
+_deepinapiver=2.92.1
+_dbusfactoryver=2.92.1
+_desktopbaserev=6cd46627bb62ce820991aa53439be8142b523ad8
+pkgrel=4
+pkgdesc='Daemon handling the DDE session settings'
+arch=('i686' 'x86_64')
+url="https://github.com/linuxdeepin/dde-daemon"
+license=('GPL3')
+depends=('deepin-desktop-schemas' 'gvfs' 'libcanberra-pulse' 'metacity' 'poppler-glib'
+         'rfkill' 'acpid' 'bluez' 'deepin-notifications' 'iso-codes' 'lsb-release'
+         'mobile-broadband-provider-info' 'polkit-gnome' 'udisks2' 'upower' 'gcc-go'
+         'libxkbfile' 'accountsservice')
+makedepends=('deepin-dbus-generator' 'sqlite' 'git' 'mercurial')
+optdepends=('networkmanager: Network Management daemon'
+            'deepin-grub2-themes: deepin theme for grub menu')
+conflicts=('dde-daemon')
+replaces=('dde-daemon')
+groups=('deepin')
+install="${pkgname}.install"
+source=("git+https://github.com/linuxdeepin/dde-daemon.git#tag=$pkgver"
+        #"git+https://github.com/linuxdeepin/go-lib.git#tag=$_golibver"
+        "git+https://github.com/linuxdeepin/go-lib.git#commit=$_golibrev"
+        "git+https://github.com/linuxdeepin/dbus-factory.git#tag=$_dbusfactoryver"
+        "git+https://github.com/linuxdeepin/dde-api.git#tag=$_deepinapiver"
+        "git+https://github.com/linuxdeepin/deepin-desktop-base.git#commit=$_desktopbaserev"
+        'fix-i686-compile.patch' 'deepin-daemon.sysusers' 'ishuman-via-login-defs.patch' 'get-distro-info.patch')
+sha256sums=('SKIP'
+            'SKIP'
+            'SKIP'
+            'SKIP'
+            'SKIP'
+            '1dccf88c5ce480560a4a2d73134e69f05135703fe34ccd5d9e2e5d7fe852efc5'
+            '4482f2c82c3652040021dd43515f131184a0417e341dc37db487117012245e25'
+            '182fd299b9f222ce8f94da9137fb671f95fbd32bd28becfaf8c97b9fdd488c65'
+            '4b3f743b8cffc591ab5582aa4ba6a56f464cd7c279a3594e637fffac0a14df63')
+
+prepare() {
+  export GOPATH="$srcdir/build"
+  mkdir -p build/src/pkg.deepin.io/{lib,dde/api}
+  cp -a go-lib/* build/src/pkg.deepin.io/lib
+  cp -a dde-api/* build/src/pkg.deepin.io/dde/api/
+  
+  go get github.com/BurntSushi/xgb github.com/BurntSushi/xgbutil github.com/howeyc/fsnotify \
+         github.com/mattn/go-sqlite3 gopkg.in/alecthomas/kingpin.v2 github.com/disintegration/imaging \
+         code.google.com/p/graphics-go/graphics code.google.com/p/jamslam-freetype-go/freetype \
+         code.google.com/p/jamslam-freetype-go/freetype/truetype
+
+  cd dde-daemon
+  # TODO: a temporary solution by disable go-sqlite3 to avoid build
+  #       issue for go1.4/i686
+  # https://github.com/golang/go/issues/9510
+  if [[ $CARCH == "i686" ]]; then
+    patch -p1 -i ../fix-i686-compile.patch
+  fi
+
+  patch -p1 -i ../ishuman-via-login-defs.patch
+  patch -p1 -i ../get-distro-info.patch
+}
+
+build() {
+  cd "$srcdir/dbus-factory"
+  make install-golang
+
+  cd "$srcdir/dde-daemon"
+  make USE_GCCGO=1
+}
+
+package() {
+  cd dde-daemon
+  make USE_GCCGO=1 DESTDIR="${pkgdir}" install
+
+  install -Dm644 ../deepin-daemon.sysusers "$pkgdir/usr/lib/sysusers.d/deepin-daemon.conf"
+  install -Dm644 "${srcdir}"/deepin-desktop-base/desktop-version "${pkgdir}"/etc/deepin-version
+}

Copied: deepin-daemon/repos/community-x86_64/deepin-daemon.install (from rev 147834, deepin-daemon/trunk/deepin-daemon.install)
===================================================================
--- community-x86_64/deepin-daemon.install	                        (rev 0)
+++ community-x86_64/deepin-daemon.install	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,13 @@
+post_install() {
+  glib-compile-schemas --allow-any-name usr/share/glib-2.0/schemas
+  systemd-sysusers deepin-daemon.conf
+}
+
+post_upgrade() {
+  glib-compile-schemas --allow-any-name usr/share/glib-2.0/schemas
+  (( $(vercmp $2 '2.93.1-1') < 0 )) && systemd-sysusers deepin-daemon.conf || true
+}
+
+post_remove() {
+  rm -f /var/cache/deepin/mark-setup-network-services
+}

Copied: deepin-daemon/repos/community-x86_64/deepin-daemon.sysusers (from rev 147834, deepin-daemon/trunk/deepin-daemon.sysusers)
===================================================================
--- community-x86_64/deepin-daemon.sysusers	                        (rev 0)
+++ community-x86_64/deepin-daemon.sysusers	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,2 @@
+u deepin-daemon - "Deepin Daemon"
+g deepin-daemon -

Copied: deepin-daemon/repos/community-x86_64/fix-i686-compile.patch (from rev 147834, deepin-daemon/trunk/fix-i686-compile.patch)
===================================================================
--- community-x86_64/fix-i686-compile.patch	                        (rev 0)
+++ community-x86_64/fix-i686-compile.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,12 @@
+diff --git a/launcher/item/item.go b/launcher/item/item.go
+index a8ccbbe..3701968 100644
+--- a/launcher/item/item.go
++++ b/launcher/item/item.go
+@@ -4,7 +4,6 @@ import (
+ 	"path"
+ 	"strings"
+ 
+-	_ "github.com/mattn/go-sqlite3"
+ 
+ 	"pkg.deepin.io/dde/daemon/launcher/category"
+ 	. "pkg.deepin.io/dde/daemon/launcher/interfaces"

Deleted: community-x86_64/get-distro-info.patch
===================================================================
--- community-x86_64/get-distro-info.patch	2015-11-26 06:53:27 UTC (rev 147834)
+++ community-x86_64/get-distro-info.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -1,119 +0,0 @@
-commit a39042ae318f404ac44196cc028e234e6b01d489
-Author: Felix Yan <felixonmars at archlinux.org>
-Date:   Wed Nov 25 12:55:31 2015 +0800
-
-    Add methods to get distribution info
-    
-    Change-Id: I915fa4a5f429430e5c183ade58bd727c7d5a2478
-
-diff --git a/systeminfo/distro.go b/systeminfo/distro.go
-new file mode 100644
-index 0000000..cfd5bc5
---- /dev/null
-+++ b/systeminfo/distro.go
-@@ -0,0 +1,51 @@
-+package systeminfo
-+
-+import (
-+	"fmt"
-+)
-+
-+const (
-+	distroFileLSB    = "/etc/lsb-release"
-+
-+	distroIdKeyLSB   = "DISTRIB_ID"
-+	distroDescKeyLSB = "DISTRIB_DESCRIPTION"
-+	distroVerKeyLSB  = "DISTRIB_RELEASE"
-+	distroKeyDelim   = "="
-+)
-+
-+func getDistro() (string, string, string, error) {
-+	distroId, distroDesc, distroVer, err := getDistroFromLSB(distroFileLSB)
-+	if err == nil {
-+		return distroId, distroDesc, distroVer, nil
-+	}
-+
-+	return "", "", "", err
-+}
-+
-+func getDistroFromLSB(file string) (string, string, string, error) {
-+	ret, err := parseInfoFile(file, distroKeyDelim)
-+	if err != nil {
-+		return "", "", "", err
-+	}
-+
-+	distroId, ok := ret[distroIdKeyLSB]
-+	if !ok {
-+		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroIdKeyLSB)
-+	}
-+
-+	distroDesc, ok := ret[distroDescKeyLSB]
-+	if !ok {
-+		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroDescKeyLSB)
-+	}
-+
-+	if distroDesc[0] == '"' && distroDesc[len(distroDesc) - 1] == '"' {
-+		distroDesc = distroDesc[1:len(distroDesc) - 1]
-+	}
-+
-+	distroVer, ok := ret[distroVerKeyLSB]
-+	if !ok {
-+		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroVerKeyLSB)
-+	}
-+
-+	return distroId, distroDesc, distroVer, nil
-+}
-diff --git a/systeminfo/info.go b/systeminfo/info.go
-index c905cab..808ffb7 100644
---- a/systeminfo/info.go
-+++ b/systeminfo/info.go
-@@ -7,8 +7,14 @@ import (
- )
- 
- type SystemInfo struct {
--	// Current version, ex: "2015 Desktop"
-+	// Current deepin version, ex: "2015 Desktop"
- 	Version string
-+	// Distribution ID
-+	DistroID string
-+	// Distribution Description
-+	DistroDesc string
-+	// Distribution Version
-+	DistroVer string
- 	// CPU information
- 	Processor string
- 	// Disk capacity
-@@ -82,6 +88,11 @@ func NewSystemInfo() *SystemInfo {
- 		logger.Warning("Get version failed:", err)
- 	}
- 
-+	info.DistroID, info.DistroDesc, info.DistroVer, err = getDistro()
-+	if err != nil {
-+		logger.Warning("Get distribution failed:", err)
-+	}
-+
- 	info.MemoryCap, err = getMemoryFromFile("/proc/meminfo")
- 	if err != nil {
- 		logger.Warning("Get memory capacity failed:", err)
-diff --git a/systeminfo/info_test.go b/systeminfo/info_test.go
-index 11bffb7..56700b0 100644
---- a/systeminfo/info_test.go
-+++ b/systeminfo/info_test.go
-@@ -42,3 +42,17 @@ func TestVersion(t *testing.T) {
- 		So(err, ShouldBeNil)
- 	})
- }
-+
-+func TestDistro(t *testing.T) {
-+	Convey("Test os distro", t, func() {
-+		lang := os.Getenv("LANGUAGE")
-+		os.Setenv("LANGUAGE", "en_US")
-+		defer os.Setenv("LANGUAGE", lang)
-+
-+		distroId, distroDesc, distroVer, err := getDistroFromLSB("testdata/lsb-release")
-+		So(distroId, ShouldEqual, "Deepin")
-+		So(distroDesc, ShouldEqual, "Deepin 2014.3")
-+		So(distroVer, ShouldEqual, "2014.3")
-+		So(err, ShouldBeNil)
-+	})
-+}

Copied: deepin-daemon/repos/community-x86_64/get-distro-info.patch (from rev 147834, deepin-daemon/trunk/get-distro-info.patch)
===================================================================
--- community-x86_64/get-distro-info.patch	                        (rev 0)
+++ community-x86_64/get-distro-info.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,119 @@
+commit a39042ae318f404ac44196cc028e234e6b01d489
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Wed Nov 25 12:55:31 2015 +0800
+
+    Add methods to get distribution info
+    
+    Change-Id: I915fa4a5f429430e5c183ade58bd727c7d5a2478
+
+diff --git a/systeminfo/distro.go b/systeminfo/distro.go
+new file mode 100644
+index 0000000..cfd5bc5
+--- /dev/null
++++ b/systeminfo/distro.go
+@@ -0,0 +1,51 @@
++package systeminfo
++
++import (
++	"fmt"
++)
++
++const (
++	distroFileLSB    = "/etc/lsb-release"
++
++	distroIdKeyLSB   = "DISTRIB_ID"
++	distroDescKeyLSB = "DISTRIB_DESCRIPTION"
++	distroVerKeyLSB  = "DISTRIB_RELEASE"
++	distroKeyDelim   = "="
++)
++
++func getDistro() (string, string, string, error) {
++	distroId, distroDesc, distroVer, err := getDistroFromLSB(distroFileLSB)
++	if err == nil {
++		return distroId, distroDesc, distroVer, nil
++	}
++
++	return "", "", "", err
++}
++
++func getDistroFromLSB(file string) (string, string, string, error) {
++	ret, err := parseInfoFile(file, distroKeyDelim)
++	if err != nil {
++		return "", "", "", err
++	}
++
++	distroId, ok := ret[distroIdKeyLSB]
++	if !ok {
++		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroIdKeyLSB)
++	}
++
++	distroDesc, ok := ret[distroDescKeyLSB]
++	if !ok {
++		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroDescKeyLSB)
++	}
++
++	if distroDesc[0] == '"' && distroDesc[len(distroDesc) - 1] == '"' {
++		distroDesc = distroDesc[1:len(distroDesc) - 1]
++	}
++
++	distroVer, ok := ret[distroVerKeyLSB]
++	if !ok {
++		return "", "", "", fmt.Errorf("Cannot find the key '%s'", distroVerKeyLSB)
++	}
++
++	return distroId, distroDesc, distroVer, nil
++}
+diff --git a/systeminfo/info.go b/systeminfo/info.go
+index c905cab..808ffb7 100644
+--- a/systeminfo/info.go
++++ b/systeminfo/info.go
+@@ -7,8 +7,14 @@ import (
+ )
+ 
+ type SystemInfo struct {
+-	// Current version, ex: "2015 Desktop"
++	// Current deepin version, ex: "2015 Desktop"
+ 	Version string
++	// Distribution ID
++	DistroID string
++	// Distribution Description
++	DistroDesc string
++	// Distribution Version
++	DistroVer string
+ 	// CPU information
+ 	Processor string
+ 	// Disk capacity
+@@ -82,6 +88,11 @@ func NewSystemInfo() *SystemInfo {
+ 		logger.Warning("Get version failed:", err)
+ 	}
+ 
++	info.DistroID, info.DistroDesc, info.DistroVer, err = getDistro()
++	if err != nil {
++		logger.Warning("Get distribution failed:", err)
++	}
++
+ 	info.MemoryCap, err = getMemoryFromFile("/proc/meminfo")
+ 	if err != nil {
+ 		logger.Warning("Get memory capacity failed:", err)
+diff --git a/systeminfo/info_test.go b/systeminfo/info_test.go
+index 11bffb7..56700b0 100644
+--- a/systeminfo/info_test.go
++++ b/systeminfo/info_test.go
+@@ -42,3 +42,17 @@ func TestVersion(t *testing.T) {
+ 		So(err, ShouldBeNil)
+ 	})
+ }
++
++func TestDistro(t *testing.T) {
++	Convey("Test os distro", t, func() {
++		lang := os.Getenv("LANGUAGE")
++		os.Setenv("LANGUAGE", "en_US")
++		defer os.Setenv("LANGUAGE", lang)
++
++		distroId, distroDesc, distroVer, err := getDistroFromLSB("testdata/lsb-release")
++		So(distroId, ShouldEqual, "Deepin")
++		So(distroDesc, ShouldEqual, "Deepin 2014.3")
++		So(distroVer, ShouldEqual, "2014.3")
++		So(err, ShouldBeNil)
++	})
++}

Deleted: community-x86_64/ishuman-via-login-defs.patch
===================================================================
--- community-x86_64/ishuman-via-login-defs.patch	2015-11-26 06:53:27 UTC (rev 147834)
+++ community-x86_64/ishuman-via-login-defs.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -1,132 +0,0 @@
-commit 50844ff5338feeaa1e59af72eb3d0a624f3e4791
-Author: Felix Yan <felixonmars at archlinux.org>
-Date:   Wed Nov 25 00:27:27 2015 +0800
-
-    Add support to check login.defs for isHuman
-    
-    Change-Id: Ic18e289d02b208a4c28f64a7362a082f5280556e
-
-diff --git a/accounts/users/list.go b/accounts/users/list.go
-index 4b6d563..e5038e4 100644
---- a/accounts/users/list.go
-+++ b/accounts/users/list.go
-@@ -25,16 +25,19 @@ import (
- 	"fmt"
- 	"io/ioutil"
- 	"strings"
-+	"strconv"
- )
- 
- const (
--	userFilePasswd = "/etc/passwd"
--	userFileShadow = "/etc/shadow"
--	userFileGroup  = "/etc/group"
--
--	itemLenPasswd = 7
--	itemLenShadow = 9
--	itemLenGroup  = 4
-+	userFilePasswd    = "/etc/passwd"
-+	userFileShadow    = "/etc/shadow"
-+	userFileGroup     = "/etc/group"
-+	userFileLoginDefs = "/etc/login.defs"
-+
-+	itemLenPasswd    = 7
-+	itemLenShadow    = 9
-+	itemLenGroup     = 4
-+	itemLenLoginDefs = 2
- )
- 
- var (
-@@ -137,7 +140,7 @@ func (infos UserInfos) GetUserNames() []string {
- func (infos UserInfos) filterUserInfos() UserInfos {
- 	var tmp UserInfos
- 	for _, info := range infos {
--		if !info.isHumanUser(userFileShadow) {
-+		if !info.isHumanUser(userFileShadow, userFileLoginDefs) {
- 			continue
- 		}
- 
-@@ -147,7 +150,7 @@ func (infos UserInfos) filterUserInfos() UserInfos {
- 	return tmp
- }
- 
--func (info UserInfo) isHumanUser(config string) bool {
-+func (info UserInfo) isHumanUser(configShadow string, configLoginDefs string) bool {
- 	if info.Name == "root" {
- 		return false
- 	}
-@@ -156,7 +159,11 @@ func (info UserInfo) isHumanUser(config string) bool {
- 		return false
- 	}
- 
--	if !info.isHumanViaShadow(config) {
-+	if !info.isHumanViaShadow(configShadow) {
-+		return false
-+	}
-+
-+	if !info.isHumanViaLoginDefs(configLoginDefs) {
- 		return false
- 	}
- 
-@@ -214,3 +221,60 @@ func (info UserInfo) isHumanViaShadow(config string) bool {
- 
- 	return false
- }
-+
-+func (info UserInfo) isHumanViaLoginDefs(config string) bool {
-+	var uidMin, uidMax string
-+	content, err := ioutil.ReadFile(config)
-+	if err != nil {
-+		return false
-+	}
-+
-+	lines := strings.Split(string(content), "\n")
-+	for _, line := range lines {
-+		if len(line) == 0 {
-+			continue
-+		}
-+
-+		if line[0] == '#' {
-+			continue
-+		}
-+
-+		items := strings.Fields(line)
-+		if len(items) != itemLenLoginDefs {
-+			continue
-+		}
-+
-+		if items[0] == "UID_MIN" {
-+			uidMin = items[1]
-+		}
-+
-+		if items[0] == "UID_MAX" {
-+			uidMax = items[1]
-+		}
-+	}
-+
-+	if len(uidMax) == 0 || len(uidMin) == 0 {
-+		return false
-+	}
-+
-+	uidMinInt, err := strconv.Atoi(uidMin)
-+	if err != nil {
-+		return false
-+	}
-+
-+	uidMaxInt, err := strconv.Atoi(uidMax)
-+	if err != nil {
-+		return false
-+	}
-+
-+	uidInt, err := strconv.Atoi(info.Uid)
-+	if err != nil {
-+		return false
-+	}
-+
-+	if uidInt > uidMaxInt || uidInt < uidMinInt {
-+		return false
-+	}
-+
-+	return true
-+}
-\ No newline at end of file

Copied: deepin-daemon/repos/community-x86_64/ishuman-via-login-defs.patch (from rev 147834, deepin-daemon/trunk/ishuman-via-login-defs.patch)
===================================================================
--- community-x86_64/ishuman-via-login-defs.patch	                        (rev 0)
+++ community-x86_64/ishuman-via-login-defs.patch	2015-11-26 06:54:55 UTC (rev 147835)
@@ -0,0 +1,132 @@
+commit 50844ff5338feeaa1e59af72eb3d0a624f3e4791
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Wed Nov 25 00:27:27 2015 +0800
+
+    Add support to check login.defs for isHuman
+    
+    Change-Id: Ic18e289d02b208a4c28f64a7362a082f5280556e
+
+diff --git a/accounts/users/list.go b/accounts/users/list.go
+index 4b6d563..e5038e4 100644
+--- a/accounts/users/list.go
++++ b/accounts/users/list.go
+@@ -25,16 +25,19 @@ import (
+ 	"fmt"
+ 	"io/ioutil"
+ 	"strings"
++	"strconv"
+ )
+ 
+ const (
+-	userFilePasswd = "/etc/passwd"
+-	userFileShadow = "/etc/shadow"
+-	userFileGroup  = "/etc/group"
+-
+-	itemLenPasswd = 7
+-	itemLenShadow = 9
+-	itemLenGroup  = 4
++	userFilePasswd    = "/etc/passwd"
++	userFileShadow    = "/etc/shadow"
++	userFileGroup     = "/etc/group"
++	userFileLoginDefs = "/etc/login.defs"
++
++	itemLenPasswd    = 7
++	itemLenShadow    = 9
++	itemLenGroup     = 4
++	itemLenLoginDefs = 2
+ )
+ 
+ var (
+@@ -137,7 +140,7 @@ func (infos UserInfos) GetUserNames() []string {
+ func (infos UserInfos) filterUserInfos() UserInfos {
+ 	var tmp UserInfos
+ 	for _, info := range infos {
+-		if !info.isHumanUser(userFileShadow) {
++		if !info.isHumanUser(userFileShadow, userFileLoginDefs) {
+ 			continue
+ 		}
+ 
+@@ -147,7 +150,7 @@ func (infos UserInfos) filterUserInfos() UserInfos {
+ 	return tmp
+ }
+ 
+-func (info UserInfo) isHumanUser(config string) bool {
++func (info UserInfo) isHumanUser(configShadow string, configLoginDefs string) bool {
+ 	if info.Name == "root" {
+ 		return false
+ 	}
+@@ -156,7 +159,11 @@ func (info UserInfo) isHumanUser(config string) bool {
+ 		return false
+ 	}
+ 
+-	if !info.isHumanViaShadow(config) {
++	if !info.isHumanViaShadow(configShadow) {
++		return false
++	}
++
++	if !info.isHumanViaLoginDefs(configLoginDefs) {
+ 		return false
+ 	}
+ 
+@@ -214,3 +221,60 @@ func (info UserInfo) isHumanViaShadow(config string) bool {
+ 
+ 	return false
+ }
++
++func (info UserInfo) isHumanViaLoginDefs(config string) bool {
++	var uidMin, uidMax string
++	content, err := ioutil.ReadFile(config)
++	if err != nil {
++		return false
++	}
++
++	lines := strings.Split(string(content), "\n")
++	for _, line := range lines {
++		if len(line) == 0 {
++			continue
++		}
++
++		if line[0] == '#' {
++			continue
++		}
++
++		items := strings.Fields(line)
++		if len(items) != itemLenLoginDefs {
++			continue
++		}
++
++		if items[0] == "UID_MIN" {
++			uidMin = items[1]
++		}
++
++		if items[0] == "UID_MAX" {
++			uidMax = items[1]
++		}
++	}
++
++	if len(uidMax) == 0 || len(uidMin) == 0 {
++		return false
++	}
++
++	uidMinInt, err := strconv.Atoi(uidMin)
++	if err != nil {
++		return false
++	}
++
++	uidMaxInt, err := strconv.Atoi(uidMax)
++	if err != nil {
++		return false
++	}
++
++	uidInt, err := strconv.Atoi(info.Uid)
++	if err != nil {
++		return false
++	}
++
++	if uidInt > uidMaxInt || uidInt < uidMinInt {
++		return false
++	}
++
++	return true
++}
+\ No newline at end of file



More information about the arch-commits mailing list