mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-24 04:33:24 +00:00
Update to 20140824
This commit is contained in:
parent
75b430129c
commit
e776b0bb66
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=367224
@ -1,20 +1,19 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= pond
|
||||
PORTVERSION= 20140120
|
||||
PORTREVISION= 1
|
||||
PORTVERSION= 20140824
|
||||
CATEGORIES= security
|
||||
MASTER_SITES= http://c-s.li/ports/
|
||||
DISTFILES= pond-20140120.tar.gz \
|
||||
go-gtk-20131128.tar.gz \
|
||||
ed25519-20131225.tar.gz
|
||||
DISTFILES= pond-20140824.tar.gz \
|
||||
go-gtk-20140629.tar.gz \
|
||||
ed25519-20140215.tar.gz
|
||||
|
||||
MAINTAINER= cs@FreeBSD.org
|
||||
COMMENT= Forward secure, asynchronous messenger
|
||||
|
||||
LICENSE= BSD3CLAUSE
|
||||
|
||||
BUILD_DEPENDS= ${LOCALBASE}/${GO_LIBDIR}/code.google.com/p/go.crypto/bcrypt.a:${PORTSDIR}/security/go.crypto \
|
||||
BUILD_DEPENDS= ${LOCALBASE}/${GO_LIBDIR}/code.google.com/p/go.crypto/bcrypt.a>=20140828:${PORTSDIR}/security/go.crypto \
|
||||
${LOCALBASE}/${GO_LIBDIR}/code.google.com/p/goprotobuf/proto.a:${PORTSDIR}/devel/goprotobuf \
|
||||
${LOCALBASE}/${GO_LIBDIR}/code.google.com/p/go.net/dict.a:${PORTSDIR}/net/go.net
|
||||
RUN_DEPENDS= tor:${PORTSDIR}/security/tor
|
||||
@ -22,39 +21,39 @@ LIB_DEPENDS= libgtkspell.so:${PORTSDIR}/textproc/gtkspell \
|
||||
libtspi.so:${PORTSDIR}/security/trousers
|
||||
|
||||
IGNORE= Experimental. Know what you do!
|
||||
PLIST_FILES= bin/server bin/client
|
||||
PLIST_FILES= bin/pond-server bin/pond
|
||||
USE_GNOME= gtk30
|
||||
GO_PKGNAME= github.com/agl/pond
|
||||
GO_TARGET= ${GO_PKGNAME}/server \
|
||||
${GO_PKGNAME}/client
|
||||
GO_TARGET= ${GO_PKGNAME}/pond-server \
|
||||
${GO_PKGNAME}/pond
|
||||
|
||||
post-extract:
|
||||
@${MKDIR} ${GO_WRKSRC:H}
|
||||
@${CP} files/sys_freebsd.go ${WRKSRC}/client/system/sys_freebsd.go
|
||||
@${CP} files/main_freebsd.go ${WRKSRC}/client/main_freebsd.go
|
||||
@${LN} -sf ${WRKSRC} ${GO_WRKSRC}
|
||||
@${LN} -sf ${WRKDIR}/go-gtk-20131128 ${GO_WRKDIR_SRC}/github.com/agl/go-gtk
|
||||
@${LN} -sf ${WRKDIR}/ed25519-20131225 ${GO_WRKDIR_SRC}/github.com/agl/ed25519
|
||||
@${LN} -sf ${WRKSRC}/client ${WRKSRC}/pond
|
||||
@${LN} -sf ${WRKSRC}/server ${WRKSRC}/pond-server
|
||||
@${LN} -sf ${WRKDIR}/go-gtk-20140629 ${GO_WRKDIR_SRC}/github.com/agl/go-gtk
|
||||
@${LN} -sf ${WRKDIR}/ed25519-20140215 ${GO_WRKDIR_SRC}/github.com/agl/ed25519
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e 's|\<gdk|\<gtk-3.0\/gdk|g' \
|
||||
${WRKDIR}/go-gtk-20131128/gdk/gdk.go \
|
||||
${WRKDIR}/go-gtk-20131128/gdk/gdk_linux.go \
|
||||
${WRKDIR}/go-gtk-20131128/gdk/gdk_windows.go \
|
||||
${WRKDIR}/go-gtk-20131128/gtk/gtk.go
|
||||
${WRKDIR}/go-gtk-20140629/gdk/gdk.go \
|
||||
${WRKDIR}/go-gtk-20140629/gdk/gdk_linux.go \
|
||||
${WRKDIR}/go-gtk-20140629/gdk/gdk_windows.go \
|
||||
${WRKDIR}/go-gtk-20140629/gtk/gtk.go
|
||||
@${REINPLACE_CMD} -e 's|\<pango|\<pango-1.0\/pango|g' \
|
||||
${WRKDIR}/go-gtk-20131128/pango/pango.go
|
||||
${WRKDIR}/go-gtk-20140629/pango/pango.go
|
||||
@${REINPLACE_CMD} -e 's|\<gtk|\<gtk-3.0\/gtk|g' \
|
||||
${WRKDIR}/go-gtk-20131128/gtk/gtk.go \
|
||||
${WRKDIR}/go-gtk-20131128/gtkspell/gtkspell_fedora.go \
|
||||
${WRKDIR}/go-gtk-20131128/gtkspell/gtkspell_ubuntu.go
|
||||
${WRKDIR}/go-gtk-20140629/gtk/gtk.go \
|
||||
${WRKDIR}/go-gtk-20140629/gtkspell/gtkspell_fedora.go \
|
||||
${WRKDIR}/go-gtk-20140629/gtkspell/gtkspell_ubuntu.go
|
||||
@${REINPLACE_CMD} -e 's|\<glib|\<glib-2.0\/glib|g' \
|
||||
${WRKDIR}/go-gtk-20131128/glib/glib.go
|
||||
${WRKDIR}/go-gtk-20140629/glib/glib.go
|
||||
@${REINPLACE_CMD} -e 's|\<gdk-pixbuf|\<gdk-pixbuf-2.0\/gdk-pixbuf|g' \
|
||||
${WRKDIR}/go-gtk-20131128/gdkpixbuf/gdkpixbuf.go
|
||||
${WRKDIR}/go-gtk-20140629/gdkpixbuf/gdkpixbuf.go
|
||||
@${REINPLACE_CMD} -e 's|\<gtkspell|\<gtkspell-2.0\/gtkspell|g' \
|
||||
${WRKDIR}/go-gtk-20131128/gtkspell/gtkspell_fedora.go \
|
||||
${WRKDIR}/go-gtk-20131128/gtkspell/gtkspell_ubuntu.go
|
||||
${WRKDIR}/go-gtk-20140629/gtkspell/gtkspell_fedora.go \
|
||||
${WRKDIR}/go-gtk-20140629/gtkspell/gtkspell_ubuntu.go
|
||||
|
||||
do-build:
|
||||
@(cd ${GO_WRKSRC}; ${SETENV} ${GO_ENV} ${GO_CMD} install -tags nogui -v ${GO_TARGET})
|
||||
|
@ -1,6 +1,6 @@
|
||||
SHA256 (pond-20140120.tar.gz) = 22e3a69535b76d548cfec62bb18e5b33a5920fc53dbb02b1ca010741c58129ec
|
||||
SIZE (pond-20140120.tar.gz) = 1049433
|
||||
SHA256 (ed25519-20131225.tar.gz) = 6cd982fc6d93fd47b650e8922ab66fa64f40d395ddb5879497dbd8aa0c3c8c6d
|
||||
SIZE (ed25519-20131225.tar.gz) = 105671
|
||||
SHA256 (go-gtk-20131128.tar.gz) = 505452cfb7972a49e6960ad26a48c743d02598113b44e1fe0d5b9ee2a20719a4
|
||||
SIZE (go-gtk-20131128.tar.gz) = 206393
|
||||
SHA256 (pond-20140824.tar.gz) = a75a442ba36ed2baee23768cef2412355d6d96b7cdf08e3c65bb991e4147a02c
|
||||
SIZE (pond-20140824.tar.gz) = 1056699
|
||||
SHA256 (go-gtk-20140629.tar.gz) = 9ae95725a7ea0d7b0397447f36dc7f274ce17be67a7e28104bd6e08aa67143ed
|
||||
SIZE (go-gtk-20140629.tar.gz) = 206490
|
||||
SHA256 (ed25519-20140215.tar.gz) = e65f38ba055a8ce92764486a2b5b2a390793ed61c5c5b00f4e56ce88a9c03f9c
|
||||
SIZE (ed25519-20140215.tar.gz) = 105713
|
||||
|
@ -1,73 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/binary"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"code.google.com/p/go.crypto/scrypt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
stateFile := flag.String("state-file", "", "File in which to save persistent state")
|
||||
pandaScrypt := flag.Bool("panda-scrypt", false, "Run in subprocess mode to process passphrase")
|
||||
cliFlag := flag.Bool("cli", false, "If true, the CLI will be used, even if the GUI is available")
|
||||
devFlag := flag.Bool("dev", false, "Is this a development environment?")
|
||||
flag.Parse()
|
||||
|
||||
if *pandaScrypt {
|
||||
var numBytes uint32
|
||||
if err := binary.Read(os.Stdin, binary.LittleEndian, &numBytes); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if numBytes > 1024*1024 {
|
||||
panic("passphrase too large")
|
||||
}
|
||||
passphrase := make([]byte, int(numBytes))
|
||||
if _, err := os.Stdin.Read(passphrase); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
data, err := scrypt.Key(passphrase, nil, 1<<17, 16, 4, 32*3)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
os.Stdout.Write(data)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
dev := os.Getenv("POND") == "dev" || *devFlag
|
||||
runtime.GOMAXPROCS(4)
|
||||
|
||||
if len(*stateFile) == 0 && dev {
|
||||
*stateFile = "state"
|
||||
}
|
||||
|
||||
if len(*stateFile) == 0 {
|
||||
home := os.Getenv("HOME")
|
||||
if len(home) == 0 {
|
||||
fmt.Fprintf(os.Stderr, "$HOME not set. Please either export $HOME or use --state-file to set the location of the state file explicitly.\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
configDir := filepath.Join(home, ".config")
|
||||
os.Mkdir(configDir, 0700)
|
||||
*stateFile = filepath.Join(configDir, "pond")
|
||||
}
|
||||
|
||||
if !haveGUI || *cliFlag || len(os.Getenv("PONDCLI")) > 0 {
|
||||
client := NewCLIClient(*stateFile, rand.Reader, false /* testing */, true /* autoFetch */)
|
||||
client.disableV2Ratchet = true
|
||||
client.dev = dev
|
||||
client.Start()
|
||||
} else {
|
||||
ui := NewGTKUI()
|
||||
client := NewGUIClient(*stateFile, ui, rand.Reader, false /* testing */, true /* autoFetch */)
|
||||
client.disableV2Ratchet = true
|
||||
client.dev = dev
|
||||
client.Start()
|
||||
ui.Run()
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
--- client/cli-input.go.orig 2014-01-20 16:38:38.000000000 +0000
|
||||
+++ client/cli-input.go 2014-01-24 23:58:07.000000000 +0000
|
||||
@@ -350,12 +350,6 @@
|
||||
i.commands.Insert(command.name)
|
||||
}
|
||||
|
||||
- autoCompleteCallback := func(line string, pos int, key rune) (string, int, bool) {
|
||||
- return i.AutoComplete(line, pos, key)
|
||||
- }
|
||||
-
|
||||
- i.term.AutoCompleteCallback = autoCompleteCallback
|
||||
-
|
||||
var ackChan chan struct{}
|
||||
|
||||
for {
|
@ -1,33 +0,0 @@
|
||||
--- client/cli.go.orig 2014-01-20 16:38:38.000000000 +0000
|
||||
+++ client/cli.go 2014-01-24 23:57:44.000000000 +0000
|
||||
@@ -105,12 +105,6 @@
|
||||
}
|
||||
|
||||
func (c *cliClient) Start() {
|
||||
- oldState, err := terminal.MakeRaw(0)
|
||||
- if err != nil {
|
||||
- panic(err.Error())
|
||||
- }
|
||||
- defer terminal.Restore(0, oldState)
|
||||
-
|
||||
signal.Notify(make(chan os.Signal), os.Interrupt)
|
||||
|
||||
wrapper, interruptChan := NewTerminalWrapper(os.Stdin)
|
||||
@@ -119,9 +113,6 @@
|
||||
c.termWrapper = wrapper
|
||||
|
||||
c.term = terminal.NewTerminal(wrapper, "> ")
|
||||
- if width, height, err := terminal.GetSize(0); err == nil {
|
||||
- c.term.SetSize(width, height)
|
||||
- }
|
||||
|
||||
c.loadUI()
|
||||
|
||||
@@ -1883,7 +1874,6 @@
|
||||
},
|
||||
cliIdsAssigned: make(map[cliId]bool),
|
||||
}
|
||||
- c.ui = c
|
||||
|
||||
c.newMeetingPlace = func() panda.MeetingPlace {
|
||||
return &panda.HTTPMeetingPlace{
|
@ -1,138 +0,0 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func processLines(filename string, f func(line string) error) error {
|
||||
contents, err := ioutil.ReadFile(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
file := bufio.NewReader(bytes.NewBuffer(contents))
|
||||
for {
|
||||
line, isPrefix, err := file.ReadLine()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if isPrefix {
|
||||
return errors.New("file contains a line that it too long to process")
|
||||
}
|
||||
if err = f(string(line)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsSafe checks to see whether the current OS appears to be safe. Specifically
|
||||
// it checks that any swap is encrypted.
|
||||
func IsSafe() error {
|
||||
lineNo := 0
|
||||
err := processLines("/proc/swaps", func(line string) error {
|
||||
lineNo++
|
||||
if lineNo == 1 {
|
||||
// First line is just headings.
|
||||
return nil
|
||||
}
|
||||
fields := strings.Fields(line)
|
||||
if len(fields) < 1 {
|
||||
return nil
|
||||
}
|
||||
device := fields[0]
|
||||
if strings.Contains(device, "/mapper/") || strings.Contains(device, "/dm-") {
|
||||
// We don't have permissions to introspect the mapper
|
||||
// device, so we have to assume that it's encrypted.
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.New("swapping is active on " + device + " which doesn't appear to be encrypted")
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return errors.New("system: while checking /proc/swaps: " + err.Error())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
safeTempDir string
|
||||
safeTempDirErr error
|
||||
safeTempDirOnce sync.Once
|
||||
)
|
||||
|
||||
func findSafeTempDir() {
|
||||
var candidates []string
|
||||
|
||||
err := processLines("/proc/mounts", func(line string) error {
|
||||
fields := strings.Fields(line)
|
||||
if len(fields) < 1 {
|
||||
return nil
|
||||
}
|
||||
path := fields[1]
|
||||
filesystem := fields[2]
|
||||
if filesystem == "tmpfs" &&
|
||||
syscall.Access(path, 7 /* rwx ok */) == nil {
|
||||
candidates = append(candidates, path)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
if err == nil && len(candidates) == 0 {
|
||||
err = errors.New("no writable tmpfs directories found")
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
safeTempDirErr = errors.New("system: while checking /proc/mounts: " + err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
suggested := os.TempDir()
|
||||
preferred := []string{suggested}
|
||||
var otherOptions []string
|
||||
if dir := os.Getenv("XDG_RUNTIME_DIR"); len(dir) > 0 {
|
||||
otherOptions = append(otherOptions, dir)
|
||||
}
|
||||
otherOptions = append(otherOptions, "/tmp", "/var/tmp")
|
||||
for _, d := range otherOptions {
|
||||
if suggested != d {
|
||||
preferred = append(preferred, d)
|
||||
}
|
||||
}
|
||||
|
||||
for _, d := range preferred {
|
||||
for _, candidate := range candidates {
|
||||
if candidate == d {
|
||||
safeTempDir = candidate
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
safeTempDir = candidates[0]
|
||||
}
|
||||
|
||||
// SafeTempDir returns the path of a writable directory which is mounted with
|
||||
// tmpfs. As long as the swap is encrypted, then it should be safe to write
|
||||
// there.
|
||||
func SafeTempDir() (string, error) {
|
||||
safeTempDirOnce.Do(findSafeTempDir)
|
||||
if safeTempDirErr != nil {
|
||||
return "", safeTempDirErr
|
||||
}
|
||||
return safeTempDir, nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user