[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [Feature request] `ls -g'
From:       Denis Vlasenko <vda.linux () googlemail ! com>
Date:       2007-03-30 20:35:10
Message-ID: 200703302235.10352.vda.linux () googlemail ! com
[Download RAW message or body]

On Thursday 29 March 2007 03:49, Meihui Fan wrote:
> 
> Currently `-g' option is ignored in ls command, that make it doesn't
> work for ftpd.

ls prints user/group names (or ids) here:

                case LIST_ID_NAME:
#if ENABLE_FEATURE_LS_USERNAME
                        printf("%-8.8s %-8.8s",
                                get_cached_username(dn->dstat.st_uid),
                                get_cached_groupname(dn->dstat.st_gid));
                        column += 17;
                        break;
#endif
                case LIST_ID_NUMERIC:
                        column += printf("%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid);
                        break;


Here is where -g option handling is specified:

        LIST_LONG | STYLE_LONG,     /* l - remember LS_DISP_HR in mask! */
        LIST_SHORT | STYLE_SINGLE,  /* 1 */
        0,                          /* g - ingored */
        LIST_ID_NUMERIC,            /* n */

In order to make -g work, LIST_ID_NAME and LIST_ID_NUMERIC
should be split into LIST_UID_NAME / LIST_GID_NAME (and same for NUMERIC),
printing code should be modified accordingly.

Then replace 0 above with appropriate mask.
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic