Пример #1
0
        private static Native.Group CopyGroup(Native.Group group)
        {
            Native.Group g = new Native.Group();

            g.gr_gid    = group.gr_gid;
            g.gr_mem    = group.gr_mem;
            g.gr_name   = group.gr_name;
            g.gr_passwd = group.gr_passwd;

            return(g);
        }
Пример #2
0
        public UnixGroupInfo(long group)
        {
            this.group = new Native.Group();
            Native.Group?gr;
            int          r = Native.Syscall.getgrgid_r(Convert.ToUInt32(group), this.group, out gr);

            if (r != 0 || gr == null)
            {
                throw new ArgumentException(Locale.GetText("invalid group id"), "group");
            }
        }
Пример #3
0
        public UnixGroupInfo(string group)
        {
            this.group = new Native.Group();
            Native.Group?gr;
            int          r = Native.Syscall.getgrnam_r(group, this.group, out gr);

            if (r != 0 || gr == null)
            {
                throw new ArgumentException(Locale.GetText("invalid group name"), "group");
            }
        }
Пример #4
0
 public UnixGroupInfo(Native.Group group)
 {
     this.group = CopyGroup(group);
 }