remove __ on uid and gid for alpine
This commit is contained in:
parent
c5c15dae98
commit
4e3e5f2990
3 changed files with 7 additions and 7 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
COMMAND_EMPTY(groups) {
|
COMMAND_EMPTY(groups) {
|
||||||
|
|
||||||
__uid_t uid = getuid();
|
uid_t uid = getuid();
|
||||||
|
|
||||||
struct passwd* pw = getpwuid(uid);
|
struct passwd* pw = getpwuid(uid);
|
||||||
if(pw == NULL){
|
if(pw == NULL){
|
||||||
|
@ -16,7 +16,7 @@ COMMAND_EMPTY(groups) {
|
||||||
int ngroups = 0;
|
int ngroups = 0;
|
||||||
getgrouplist(pw->pw_name, pw->pw_gid, NULL, &ngroups);
|
getgrouplist(pw->pw_name, pw->pw_gid, NULL, &ngroups);
|
||||||
|
|
||||||
__gid_t groups[ngroups];
|
gid_t groups[ngroups];
|
||||||
getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
|
getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
|
||||||
|
|
||||||
for (int i = 0; i < ngroups; i++){
|
for (int i = 0; i < ngroups; i++){
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
COMMAND_EMPTY(user_id) {
|
COMMAND_EMPTY(user_id) {
|
||||||
|
|
||||||
__uid_t uid = getuid();
|
uid_t uid = getuid();
|
||||||
__gid_t gid = getgid();
|
gid_t gid = getgid();
|
||||||
|
|
||||||
struct passwd* pw = getpwuid(uid);
|
struct passwd* pw = getpwuid(uid);
|
||||||
if(pw == NULL){
|
if(pw == NULL){
|
||||||
|
@ -17,7 +17,7 @@ COMMAND_EMPTY(user_id) {
|
||||||
int ngroups = 0;
|
int ngroups = 0;
|
||||||
getgrouplist(pw->pw_name, pw->pw_gid, NULL, &ngroups);
|
getgrouplist(pw->pw_name, pw->pw_gid, NULL, &ngroups);
|
||||||
|
|
||||||
__gid_t groups[ngroups];
|
gid_t groups[ngroups];
|
||||||
getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
|
getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
|
||||||
|
|
||||||
struct group* ugr = getgrgid(gid);
|
struct group* ugr = getgrgid(gid);
|
||||||
|
|
|
@ -58,8 +58,8 @@ static void list_file(struct dirent* file, struct Flags* flags, const char* dir_
|
||||||
|
|
||||||
if (flags->more_info) {
|
if (flags->more_info) {
|
||||||
|
|
||||||
__uid_t uid = getuid();
|
uid_t uid = getuid();
|
||||||
__gid_t gid = getgid();
|
gid_t gid = getgid();
|
||||||
|
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
append_path(buf, dir_path, file);
|
append_path(buf, dir_path, file);
|
||||||
|
|
Loading…
Reference in a new issue