Comments (7)
Interesting! Do you know of a more authoritative source of knowledge distributive could pull from? You mentioned both "validating with ID" and "groups commands", could you expand on those? I guess the problem is I just didn't understand how groups worked enough when I implemented this 😛
from distributive.
The commands id
or groups
will work, however the format is different. One might be easier to parse but both commands will get all groups a user is associated with.
id testuser
uid=40274(testuser) gid=100(users) groups=100(users),20(games),99(nobody)
or
groups testuser
testuser : users games nobody
from distributive.
That's true, but then distributive would have to log in as that user, which often will not be possible or desirable. Would parsing /etc/passwd in addition to /etc/groups provide a complete picture?
from distributive.
Any user should be able to run id
or groups
. Parsing both /etc/passwd and /etc/group will also work. /etc/passwd will contain the primary group and /etc/group will contain all secondary groups. Either approach will get the job done!
whoami
testuser
id root
uid=0(root) gid=0(root) groups=0(root)
groups root
root : root
id testuser
uid=40274(testuser) gid=100(users) groups=100(users),20(games),99(nobody)
groups testuser
testuser : users games nobody
grep testuser /etc/passwd
testuser:x:40274:100::/home/testuser:/bin/bash
The primary group is 100 which is users.
grep testuser /etc/group
games:x:20:testuser
nobody:x:99:testuser
users:x:100:testuser
testuser:x:40274:
The secondary groups are listed in /etc/group.
from distributive.
Great, thanks for enlightening me :) I'll get to work on this ASAP! If you'd like to contribute as well, I'm happy to help you get started!
from distributive.
Sure, send any info my way. I wouldn't mind contributing.
from distributive.
Here's where the action is. If you can provide an equivalent way to parse /etc/passwd and merge the results, that would fix the issue! It could almost definitely be based on tabular
's functions as well.
To start work, you can just clone the repo and make a new branch, push your changes to your clone, and then make a pull request and I'll review it! Make sure to use go fmt
on your changes.
from distributive.
Related Issues (20)
- Sample checklists should all work in Docker HOT 3
- Merge distributive and goss HOT 15
- Check for ulimit for root user HOT 2
- Add support for inode checks
- inodeUsageByMountpoint HOT 1
- UserInGroup errors when validating groups. HOT 1
- 'Port' check does not check for ipv6 ports HOT 4
- DockerRunning and DockerRunningRegexp fail on containers without ports HOT 1
- Unit tests failing
- "real" releases
- Release 0.2.5 rpm name HOT 1
- Switch to glide/vendoring
- Check connection latency HOT 1
- Crash when using TCPTimeout
- Use YAML for configuration
- build release binaries in CI
- Docker daemon latency
- Unable to find the file size. HOT 2
- This project has moved to Mantl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distributive.