gebn / members Goto Github PK
View Code? Open in Web Editor NEWAn improved implementation of members(1)
Home Page: https://tracker.debian.org/pkg/members
License: GNU General Public License v3.0
An improved implementation of members(1)
Home Page: https://tracker.debian.org/pkg/members
License: GNU General Public License v3.0
Similar to ls
's -1
option, to make it easier to pipe into other programs.
First, members
scans passwd
looking for primary members, and prints them. Then it retrieves the group from groups
and prints all secondary members.
If a user has a given group as their primary group, and are also secondary members of the same group, their username will be printed twice.
Is this a bug or a feature? I'd argue a bug: being a member twice makes no difference to how membership functions. However, it is a breaking change.
Given members
only accepts a single argument, autocomplete should stop providing suggestions after a group name has been provided.
ls
sorts output by name. We should too. This is a tool for humans, and alphabetical order eases readability.
There is no hope of it being integrated unless its interface is indistinguishable from the current implementation.
This would make it easy to pipe output into other tools.
[cca-ug04-13060:/tmp/members-master]$ cat /etc/*os-release
CentOS Linux release 7.3.1611 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
[cca-ug04-13060:/tmp/members-master]$ valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all ./members audio
==19272== Memcheck, a memory error detector
==19272== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==19272== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==19272== Command: ./members audio
==19272==
==19272==
==19272== HEAP SUMMARY:
==19272== in use at exit: 88 bytes in 1 blocks
==19272== total heap usage: 68 allocs, 67 frees, 9,233 bytes allocated
==19272==
==19272== 88 bytes in 1 blocks are still reachable in loss record 1 of 1
==19272== at 0x4C29E2D: memalign (vg_replace_malloc.c:858)
==19272== by 0x40010D8: tls_get_addr_tail (in /usr/lib64/ld-2.17.so)
==19272== by 0x580D23E: ???
==19272== by 0x4F3D258: __nss_getent_r (in /usr/lib64/libc-2.17.so)
==19272== by 0x4EF0606: getpwent_r@@GLIBC_2.2.5 (in /usr/lib64/libc-2.17.so)
==19272== by 0x4F3CD8D: __nss_getent (in /usr/lib64/libc-2.17.so)
==19272== by 0x4EF0091: getpwent (in /usr/lib64/libc-2.17.so)
==19272== by 0x400A47: print_primary_members (group.c:44)
==19272== by 0x400CFA: handle_all_members (main.c:128)
==19272== by 0x400EE4: main (main.c:209)
==19272==
==19272== LEAK SUMMARY:
==19272== definitely lost: 0 bytes in 0 blocks
==19272== indirectly lost: 0 bytes in 0 blocks
==19272== possibly lost: 0 bytes in 0 blocks
==19272== still reachable: 88 bytes in 1 blocks
==19272== suppressed: 0 bytes in 0 blocks
==19272==
==19272== For counts of detected and suppressed errors, rerun with: -v
==19272== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
[cca-ug04-13060:/tmp/members-master]$ echo $?
4
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=851205
May not affect this package - can follow the latest conventions detailed here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.