[Mono-list] GAC permissions

A Rafael D Teixeira rafael.teixeirabr@terra.com.br
Tue, 22 Mar 2005 14:22:08 -0300

Hi Nik,

First, you should only add things to the gac as root, never as a normal
user. We even tought of an additional user-gac, but I think the idea was

Second, everything in my gac is owned by user root and group root. And
the permissions are 


for directories /usr/lib/mono, /usr/lib/mono/gac, and for each assembly-
related directory inside /usr/lib/mono/gac and their version-pl.

Taking for example Npgsql.dll instaled in my gac we have a directory 


-rwxr-xr-x  1 root root 181760 Mar 21 15:46 Npgsql.dll
-rw-r--r--  1 root root 106152 Mar 21 15:46 Npgsql.dll.mdb

Assemblies in the GAC are shared content so they must be readable by
everyone. The execute permissions on dlls are just a reminder because
they need to be loaded and executed by mono. 

In case you don't know: the execute bits in permissions for directories
are used to mark them as "listable" (browseable), so if you take them
out the affect user/group won't be able to find/open the files, even if
the files' permissions allow.


On Tue, 2005-03-22 at 22:54 +1100, Nik Derewianka wrote: 
> Hi,
> New to linux (suse 9.2) so please bear with me:
> Using mono 1.1.4 all the files in my GAC have owner/group of root.  In 
> my code where i use the Npgsql connector, my code runs fine when 
> executed under root but under a normal user it bombs out badly:
> ** (postgres.exe:9267): WARNING **: Could not find assembly Npgsql, 
> references from /home/nik/postgres.exe (assemblyref_index=1)
>      Major/Minor: 1,0
>      Build:       5000,0
>      Token:       5d8b90d52f46fda7
> System error: No such file or directory
> ** (postgres.exe:9267): WARNING **: Missing method .ctor in assembly 
> /home/nik/postgres.exe typeref index 2
> Unhandled Exception: System.NullReferenceException: Object reference not 
> set to an instance of an object
> Likewise, when using the gacutil to install npgsql from a normal user i 
> get errors and it mentions permissions.
> So what user/group should i be setting the files in the gac to ??  If i 
> change the group to 'users' with read perms then it complains about 
> /etc/mono/machine.config
> It just doesnt feel right that i need to be opening up all the perms on 
> things - but maybe this is how linux does things... if so is there any 
> recommended set of permissions  (or have i royally botched something up 
> with the install ?).
> Any help appreciated,
> Nik
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> E-mail classificado pelo Identificador de Spam Inteligente Terra.
> Para alterar a categoria classificada, visite
> http://mail.terra.com.br/protected_email/imail/imail.cgi?+_u=rafael.teixeirabr&_l=1,1111492933.424241.11838.cabue.terra.com.br,4034,Des15,Des15
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 21/03/2005 / Versão: 4.4.00 - Dat 4451
> Proteja o seu e-mail Terra: http://mail.terra.com.br/