Re: GSoC Progress
Weltall <[email protected]>
| Newsgroups | gmane.comp.graphics.crystalspace.devel |
|---|---|
| Message-ID | <CAAR4zyRD2NtujHsQmQnRD8EiBMEHuUV+_SE9gtW619+prj=-og@mail.gmail.com> |
2012/6/16 Eunsoo Roh <[email protected]> > > > So you would mostly apply them on the current user right? But in that > case making installer with cs might be troublesome on unix systems... > > > No. Since unix permissions only consist of r/w/x permissions for each > three entity, I think one csFilePermission can encapsulate all permissions > for those. > The easiest way, for example, is: > > struct csFilePermission > { > bool user_read; > bool user_write; > bool user_execute; > bool group_read; > bool group_write; > bool group_execute; > bool other_read; > bool other_write; > bool other_execute; > > /// empty constructor > csFilePermission() { } > csFilePermission(int permission, bool octal = true) { /* .. more details > here .. */ } > }; > > This way, csFilePermission constructor can actually take something like > 777 (if decimal) or 0777 (if octal). > > I know but for system wide installs it's a bad idea to use 777 so a way to say who are group and user might be useful. (Also things like sudoid might be useful, also windows has its own "version" now, I don't know if it's easily settable from code) > One caveat I think is memory alignment issues that wastes space. Would it > be better to have something like: > > enum > { > P_EXECUTE = 1, > P_WRITE = 2, > P_READ = 4 > }; > > Probably yes but you can also keep it hidden under the hood so it's just an optimization which doesn't bother the user > struct csFilePermission > { > uint8_t user; > uint8_t group; > uint8_t other; > }; > > That is just an example. I think there could be better ways... > > Eunsoo > Maybe it's better to keep such design discussions also in the main mailing list so i'm sending it there too ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Crystal-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-develop