Git Product home page Git Product logo

go-acl's Introduction

Hectane

Build Status - Linux Build status - Windows GoDoc MIT License

Hectane is both a Go package providing an SMTP queue for sending emails and a standalone application that exposes this functionality via an HTTP API.

Features

  • Ability to attach files to emails
  • Support for TLS encryption and HTTP basic auth
  • Mail queue that efficiently delivers emails to hosts
  • Emails in the queue are stored on disk until delivery
  • MX records for the destination host are tried in order of priority
  • Run the application as a service on Windows

Documentation

Documentation for Hectane can be found below:

Installation

In addition to the files on the releases page, Hectane can be installed from any of the sources below:

go-acl's People

Contributors

nathan-osman avatar ogarod avatar twpayne avatar zb140 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-acl's Issues

Chmod is broken

The Chmod function is broken, it is specific to English language installs. To be locale-independent, it needs to use SIDs.

Get User Permissions

I see how to use this to adjust a user's permissions but how could I use this to get a user's permissions? Thanks!

GetNamesSecurityInfo Limited to Paths < 260 Characters

When calling api.GetNamedSecurityInfo to identify the owner of a file, if the path and filename passed are 260 characters or longer, the call is failing. The error returned is "The operation completed successfully." but no security Descriptor or Owner SID are returned, so the owner cannot be lookup up.

In today's LAN environments, being able to lookup file information for paths that are longer than 260 characters is a must.

For now I will continue to do this in .Net but I was really hoping to move this to Go, to improve performance.

Thanks!

owner sid is not coming

I need to retrieve the owner and permissions associated with a file. I followed the example given in readme file to get the SID of owner for a file. I'm getting some value of security descriptor but not getting sid associated with the owner. Not sure if security descriptor value is coming correct or not.

Below is the output that i'm getting:
secDesc is the security descriptory handle and owner points to the sid of owner.

secDesc=== 983968
owner=== &{}

Unable to delete file after Chmod(file, 07xx)

After changing the acl for a file with Chmod(file, 07xy), I am unable to delete the file. This happens because none of the generic read, write, or execute rights include DELETE permission (https://docs.microsoft.com/en-us/windows/desktop/FileIO/file-security-and-access-rights).

I know on Unix systems delete permission is controlled by the parent directory rather than the file itself, so the analogy doesn't work 100%, but I would expect to be able to delete files if I can also write them.

Can we change Chmod to add DELETE if the write bit is set? I can submit a PR if this is a change you would accept.

Error code propagation from api incorrect

I noticed when I tried to set ACLs on a mispelled folder I got an error back which when printed said The operation completed successfully. (i.e. ERROR_SUCCESS)

Looking at the API package:

func GetNamedSecurityInfo(objectName string, objectType int32, secInfo uint32, owner, group **windows.SID, dacl, sacl, secDesc *windows.Handle) error {
	ret, _, err := procGetNamedSecurityInfoW.Call(
		uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(objectName))),
		uintptr(objectType),
		uintptr(secInfo),
		uintptr(unsafe.Pointer(owner)),
		uintptr(unsafe.Pointer(group)),
		uintptr(unsafe.Pointer(dacl)),
		uintptr(unsafe.Pointer(sacl)),
		uintptr(unsafe.Pointer(secDesc)),
	)
	if ret != 0 {
		return err
	}
	return nil
}

The 3rd parameter of the syscall-type function should only be used for functions which return a TRUE/FALSE and vend their error through the GetLastError() mechanism. In the case of GetNamedSecurityInfoW the error code is what is returned. Therefore the code should look more like:

func GetNamedSecurityInfo(objectName string, objectType int32, secInfo uint32, owner, group **windows.SID, dacl, sacl, secDesc *windows.Handle) error {
	ret, _, _ := procGetNamedSecurityInfoW.Call(
		uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(objectName))),
		uintptr(objectType),
		uintptr(secInfo),
		uintptr(unsafe.Pointer(owner)),
		uintptr(unsafe.Pointer(group)),
		uintptr(unsafe.Pointer(dacl)),
		uintptr(unsafe.Pointer(sacl)),
		uintptr(unsafe.Pointer(secDesc)),
	)
	if ret != 0 {
		return windows.Errno(ret)
	}
	return nil
}

I haven't looked at the api package more exhaustively to see if this applies to other functions, but I expect it does. If I find time I will submit an MR with a small test and hopefully fixes for these (though as a larger fix it may be worth moving to the x/sys/windows/mkwinsyscall mechanism for generating these functions?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.