quota/0040775000567100000120000000000007662101426011701 5ustar jcameronwheelquota/images/0040755000567100000120000000000007635467610013156 5ustar jcameronwheelquota/images/icon.gif0100644000567100000120000000051607060351555014564 0ustar jcameronwheelGIF89a00fff!,00..Hwd pn֣ w |5^dH[hM! aRt=t S hTm7Xg|񎷢2haاƑ3hWt FH*%Jšw {s6RZ[(1j[%9LZGƜgx+y-]b*ޭJ~û<{.^<-׎/{Q&x_S@j5ȇ ֱE@9aAJ0 ("di 3̙4k;quota/images/smallicon.gif0100664000567100000120000000035007635467610015623 0ustar jcameronwheelGIF87asssfff,PIs7D,E-FXbGr9L.'#"M(%H0 V ޒ# !${RrAN͗־aoquotacheck se est ejecutando ahora para revisar el bloque y uso de archivo en $1. Esto puede llevar un largo tiempo si el sistema de archivos es muy grande... check_done=... Hecho. check_rgroup=grupo check_ruser=usuario cgroup_efail=No pude copiar las cuotas cgroup_ecannot=No puedes copiar las cuotas cgroup_egallow=No ests autorizado a copiar las cuotas de este grupo cgroup_enogroup=No hay grupos a donde copiar cgroup_eallowto=No ests autorizado a copiar cuotas a '$1' cgform_title=Copiar Cuotas cgform_return=Cuota de grupo cgform_ecannot=No puedes copiar cuotas cgform_egroup=No ests autorizado a copiar las cuotas de este grupo cgform_copyto=Copiar cuotas para $1 en TODOS los sistemas de archivo a.. cgform_all=Todos los grupos en tu sistema cgform_select=Grupos seleccionados cgform_contain=Grupos conteniendo usuarios cgform_doit=Copiar cuser_efail=No pude copiar cuotas cuser_ecannot=No puedes copiar cuotas cuser_euallow=No ests autorizado a copiar las cuotas de este usuario cuser_enouser=No hay usuarios a donde copiar cuser_eallowto=No esta autorizado a copiar cuotas a '$1' cuform_title=Copiar Cuotas cuform_return=cuota de usuario cuform_ecannot=No puedes copiar cuotas cuform_euallow=No ests autorizado a copiar las cuotas de este usuario cuform_copyto=Copiar cuotas para $1 en TODOS los sistemas de archivo a... cuform_all=Todos los usuarios en tu sistema cuform_select=Usuarios seleccionados cuform_members=Miembros del grupos selectos cuform_doit=Copiar egroup_title=Editar Cuota egroup_freturn=lista de sistemas de archivo egroup_greturn=lista de grupos egroup_eallowgr=No ests autorizado a editar cuotas para '$1' egroup_eallowfs=No ests autorizado a editar cuotas en este sistema de archivos egroup_quotas=Cuota para $1 en $2 egroup_bused=Bloques Usados egroup_sblimit=Lmite de Bloques por Soft egroup_hblimit=Lmite de Bloques por Hard egroup_fused=Archivos Usados egroup_sflimit=Lmite de Archivos por Soft egroup_hflimit=Lmite de Archivos por Hard egroup_update=Actualizar egroup_listall=Listar Todas las Cuotas euser_title=Editar Cuota euser_freturn=lista de sistemas de archivo euser_ureturn=lista de usuarios euser_eallowus=No ests autorizado a editar cuotas para '$1' euser_eallowfs=No ests autorizado a editar cuotas en este sistema de archivos euser_quotas=Cuota para $1 en $2 euser_bused=Bloques Usados euser_bdisk=Bloques Disponibles en Disco euser_sblimit=Lmite de Bloques por Soft euser_hblimit=Lmite de Bloques por Hard euser_fused=Archivos Usados euser_fdisk=Archivos Disponibles en Disco euser_sflimit=Lmite de Archivos por Soft euser_hflimit=Lmite de Archivos por Hard euser_update=Actualizar euser_listall=Listar Todas las Cuotas gfilesys_title=Cuotas de Grupo gfilesys_return=lista de sistemas de archivo gfilesys_ecannot=No puedes editar cuotas para '$1' gfilesys_all=Todas las Cuotas para gfilesys_blocks=Bloques gfilesys_files=Archivos gfilesys_fs=Sistema de Archivos gfilesys_used=Usado gfilesys_soft=Lmite por Soft gfilesys_hard=Lmite por Hard gfilesys_nogquota=El grupo $1 no tiene cuotas en ningn sistema de archivos gfilesys_edit=Editar Cuota En: gfilesys_copy=Copiar Cuotas ggracef_title=Tiempos de Gracia ggracef_return=lista de grupos ggracef_ecannot=No puedes editar tiempos de gracia en este sistema de archivos ggracef_info=Cada sistema de archivos tiene un tiempo de gracia para las cuotas de bloques y archivos. El tiempo de gracia determina cunto puede un grupo permanecer sobre el lmite de soft antes de que no se le permita crear ms archivos. ggracef_graces=Tiempos de Gracia de Grupo para $1 ggracef_block=Para cuota de bloque ggracef_file=Para cuota de archivo ggracef_update=Actualizar ggraces_esave=No pude salvar tiempos de gracia ggraces_eedit=No puedes editar tiempos de gracia en este sistema de archivos ggraces_enumber='$1' no es un nmero index_quser=Cuotas de Usuario index_qgroup=Cuotas de Grupo index_qboth=Cuotas de Usuario y Grupo index_active= Activa index_disable=Desactivar Cuotas index_inactive= Inactiva index_enable=Activar Cuotas index_title=Cuotas de Disco index_fs=Sistema de Archivos index_type=Tipo index_mount=Montado Desde index_status=Estado index_action=Accin index_return=ndice index_euser=Editar Cuotas de Usuario: index_egroup=Editar Cuotas de Grupo: index_nosupport=No hay sistemas de archivo locales que puedan soportar cuotas index_mountonly=Slo se puede activar durante el montaje lgroups_failed=No pude listar grupos lgroups_eallow=No ests autorizado a editar cuotas en este sistema de archivos lgroups_title=Cuotas de Sistema de Archivos lgroups_return=listar sistema de archivos lgroups_toomany=Demasiados grupos tienen cuotas en $1 para mostrarlas en una pgina lgroups_quotas=Todas las Cuotas de Grupo en $1 lgroups_blocks=Bloques lgroups_files=Archivos lgroups_group=Grupos lgroups_used=Usado lgroups_soft=Lmite por Soft lgroups_hard=Lmite por Hard lgroups_noquota=No hay grupos que tengan cuotas en $1 lgroups_equota=Editar Cuota Para: lgroups_egrace=Editar Tiempos de Gracia lgroups_check=Revisar Cuotas lgroups_grace=Editar Tiempos de Gracia sgroup_egroup=No ests autorizado a editar las cuotas para este grupo sgroup_efs=No ests autorizado a editar las cuotas en este sistema de archivos ssync_ecannot=No puedes poner la cuota por defecto para este sistema de archivos suser_euser=No ests autorizado a editar las cuotas de este usuario suser_efs=No ests autorizado a editar las cuotas en este sistema de archivos suser_emaxblocks=No tiene permiso para conceder lmites de bloques superiores a $1 suser_emaxfiles=No tiene permiso para conceder lmites de ficheros superiores a $1 ufilesys_title=Cuotas de Usuario ufilesys_return=lista de sistema de archivos ufilesys_ecannot=No puedes editar cuotas para '$1' ufilesys_all=Todas las Cuotas para $1 ufilesys_blocks=Bloques ufilesys_files=Archivos ufilesys_fs=Sistema de Archivos ufilesys_used=Usado ufilesys_soft=Lmite por Soft ufilesys_hard=Lmite por Hard ufilesys_nouquota=El usuario $1 no tiene cuotas en este sistema de archivos ufilesys_edit=Editar Cuota En: ufilesys_copy=Copiar Cuotas ugracef_title=Tiempos de Gracia ugracef_return=lista de usuarios ugracef_ecannot=No puedes editar tiempos de gracia en este sistema de archivos ugracef_info=Cada sistema de archivos tiene un tiempo de gracia para las cuotas de bloque y de archivo. El tiempo de gracia determina cunto puede permanecer un usuario sobre el lmite de soft antes de que no se le permita crear ms archivos. ugracef_graces=Tiempos de Gracia de Usuario $1 ugracef_block=Para cuota de bloque ugracef_file=Para cuota de archivo ugracef_update=Actualizar ugraces_esave=No pude salvar tiempos de gracia ugraces_eedit=No puedes editar tiempos de gracia en este sistema de archivos ugraces_enumber='$1' no es un nmero lusers_failed=No pude listar usuarios lusers_eallow=No ests autorizado a editar cuotas en este sistema de archivos lusers_title=Cuotas de Sistema de Archivos lusers_return=lista de sistemas de archivo lusers_toomany=Demasiados usuarios tiene cuotas aqu $1 para ser mostradas en una pgina lusers_qoutas=Todas las Cuotas de Usuario aqu $1 lusers_blocks=Bloques lusers_files=Archivos lusers_user=Usuario lusers_used=Usado lusers_soft=Lmite por Soft lusers_hard=Lmite por Hard lusers_noquota=No hay usuarios que tengan cuotas lusers_equota=Editar Cuota Para: lusers_egrace=Editar Tiempos de Gracia lusers_check=Revisar Cuotas lusers_info=Webmin puede ser configurado para poner automticamente las cuotas en este sistema de archivos cada vez que un nuevo usuario de Unix sea creado. Esto slo funcionar cuando los $1 el mdulo de Webmin es utilizado para aadir usarios. lusers_useradmin=Usuarios y Grupos lusers_newuser=Nuevas Cuotas de Usuario lusers_sblimit=Lmite de Bloque por Soft lusers_hblimit=Lmite de Bloque por Hard lusers_sflimit=Lmite de Archivo por Soft lusers_hflimit=Lmite de Archivo por Hard lusers_apply=Aplicar grace_seconds=Segundos grace_minutes=Minutos grace_hours=Horas grace_days=Das grace_weeks=Semanas grace_months=Meses log_activate_u=Cuotas de usuario activadas en $1 log_activate_g=Cuotas de grupo activadas en $1 log_activate_ug=Cuotas de usuario y grupo activadas en $1 log_deactivate_u=Cuotas de usuario desactivadas en $1 log_deactivate_g=Cuotas de grupo desactivadas en $1 log_deactivate_ug=Cuotas de usuario y grupo desactivadas en $1 log_save=Cuotas cambiadas para $1 en $2 log_sync=Cuotas de nuevo usuario cambiadas en $1 log_grace_u=Cambiados perodos de gracia de usuario en $1 log_grace_g=Cambiados perodos de gracia de grupo en $1 log_check=Revisadas cuotas en $1 log_copy_u=Copiadas cuotas de usuario $1's log_copy_g=Copiadas cuotas de grupo $1's quota/lang/sv0100644000567100000120000002044707202162047013173 0ustar jcameronwheelquota_unlimited=Obegrnsad acl_fss=Filsystem som denna anvndare fr ndra i acl_fall=Alla filsystem acl_fsel=Angivna ... acl_quotaon=Kunna sl p och av quota? acl_quotanew=Kunna stlla in quota fr nya anvndare? acl_ugrace=Kunna ndra tidsintervall fr anvndare? acl_vtotal=Kunna se totalt diskutrymme? acl_ggrace=Kunna ndra tidsintervall fr grupper? acl_uquota=Anvndare som denna anvndare fr ndra quota fr acl_gquota=Grupper som denna anvndare fr ndra quota fr acl_uall= Alla anvndare acl_uonly= Endast anvndarna acl_uexcept= Alla anvndare utom acl_ugroup= Anvndare med primr grupp acl_gall= Alla grupper acl_gnone= Inga grupper acl_gonly= Endast grupperna acl_gexcept= Alla grupper utom activate_eallow=Du fr inte sl p och av quota p detta filsystem activate_eon=Det gick inte att sl p quota activate_eoff=Det gick inte att sl av quota check_title=Kontrollera quota check_return=Lista ver $1 check_ecannot=Du fr inte kontrollera quota p detta filsystem check_running=Kommandot quotacheck krs nu fr att kontrollera block- och filanvndningen p $1. Om det r ett stort filsystem kan detta ta en stund ... check_done=... Klart. check_rgroup=grupp check_ruser=anvndare cgroup_efail=Det gick inte att kopiera quota cgroup_ecannot=Du fr inte kopiera quota cgroup_egallow=Du fr inte kopiera denna grupps quota cgroup_enogroup=Du har inte angivit ngon grupp att kopiera till cgroup_eallowto=Du fr inte kopiera quota till '$1' cgform_title=Kopiera quota cgform_return=gruppquota cgform_ecannot=Du fr inte kopiera quota cgform_egroup=Du fr inte kopiera denna grupps quota cgform_copyto=Kopiera quota fr $1 p ALLA filsystem till ... cgform_all=Alla grupper p ditt system cgform_select=Angivna grupper cgform_contain=Grupper med fljande anvndare cgform_doit=Kopiera cuser_efail=Det gick inte att kopiera quota cuser_ecannot=Du fr inte kopiera quota cuser_euallow=Du fr inte kopiera denna anvndares quota cuser_enouser=Du har inte angivit ngon anvndare att kopiera till cuser_eallowto=Du fr inte kopiera quota till '$1' cuform_title=Kopiera quota cuform_return=anvndarquota cuform_ecannot=Du fr inte kopiera quota cuform_euallow=Du fr inte kopiera denna anvndares quota cuform_copyto=Kopiera quota fr $1 p ALLA filsystem till ... cuform_all=Alla anvndare p ditt system cuform_select=Angivna anvndare cuform_members=Medlemmar i angivna grupper cuform_doit=Kopiera egroup_title=ndra quota egroup_freturn=filsystemslista egroup_greturn=grupplista egroup_eallowgr=Du fr inte ndra quota fr '$1' egroup_eallowfs=Du fr inte ndra quota p detta filsystem egroup_quotas=Quota fr $1 p $2 egroup_bused=Anvnda block egroup_sblimit=Mjuk blockgrns egroup_hblimit=Hrd blockgrns egroup_fused=Anvnda filer egroup_sflimit=Mjuk filgrns egroup_hflimit=Hrd filgrns egroup_update=Uppdatera egroup_listall=Lista alla quota euser_title=ndra quota euser_freturn=filsystemslista euser_ureturn=anvndarlista euser_eallowus=Du fr inte ndra quota fr '$1' euser_eallowfs=Du fr inte ndra quota p detta filsystem euser_quotas=Quota fr $1 p $2 euser_bused=Anvnda block euser_sblimit=Mjuk blockgrns euser_hblimit=Hrd blockgrns euser_fused=Anvnda filer euser_sflimit=Mjuk filgrns euser_hflimit=Hrd filgrns euser_update=Uppdatera euser_listall=Lista alla quota gfilesys_title=Gruppquota gfilesys_return=filsystemslista gfilesys_ecannot=Du fr inte ndra quota fr '$1' gfilesys_all=Alla quota fr gfilesys_blocks=Block gfilesys_files=Filer gfilesys_fs=Filsystem gfilesys_used=Anvnda gfilesys_soft=Mjuk grns gfilesys_hard=Hrd grns gfilesys_nogquota=Gruppen $1 har ingen quota p ngot filsystem gfilesys_edit=ndra quota p: gfilesys_copy=Kopiera quota ggracef_title=Tidsintervall ggracef_return=grupplista ggracef_ecannot=Du fr inte ndra tidsintervall p detta filsystem ggracef_info=Varje filsystem har ett tidsintervall fr block- och filquota. Detta tidsintervall anger hur lnge en grupp fr verskrida sin mjuka grns innan den hindras att skapa fler filer. ggracef_graces=Grupptidsintervall fr $1 ggracef_block=Fr blockquota ggracef_file=Fr filquota ggracef_update=Uppdatera ggraces_esave=Det gick inte att spara tidsintervall ggraces_eedit=Du fr inte ndra tidsintervall p detta filsystem ggraces_enumber='$1' r inte ett antal index_quser=Anvndarquota index_qgroup=Gruppquota index_qboth=Anvndar- och gruppquota index_active=Aktiv index_disable=Sl av quota index_inactive=Inaktiv index_enable=Sl p quota index_title=Diskquota index_fs=Filsystem index_type=Typ index_mount=Monterad frn index_status=Status index_action=Funktion index_return=index index_euser=ndra anvndarquota: index_egroup=ndra gruppquota: index_nosupport=Inget lokalt filsystem stdjer quota lgroups_failed=Det gick inte att lista grupper lgroups_eallow=Du fr inte ndra quota p detta filsystem lgroups_title=Filsystemsquota lgroups_return=filsystemslista lgroups_toomany=Det r fr mnga grupper som har quota p $1 fr att det ska g att visa p en sida lgroups_quotas=Alla gruppquota p $1 lgroups_blocks=Block lgroups_files=Filer lgroups_group=Grupp lgroups_used=Anvnd lgroups_soft=Mjuk grns lgroups_hard=Hrd grns lgroups_noquota=Ingen grupp har quota p $1 lgroups_equota=ndra quota fr: lgroups_grace=ndra tidsintervall lgroups_check=Kontrollera quota sgroup_egroup=Du fr inte ndra quota fr denna grupp sgroup_efs=Du fr inte ndra quota p detta filsystem ssync_ecannot=Du fr inte stlla in standardquota fr detta filsystem suser_euser=Du fr inte ndra quota fr denna anvndare suser_efs=Du fr inte ndra quota p detta filsystem ufilesys_title=Anvndarquota ufilesys_return=filsystemslista ufilesys_ecannot=Du fr inte ndra quota fr '$1' ufilesys_all=All quota fr $1 ufilesys_blocks=Block ufilesys_files=Filer ufilesys_fs=Filsystem ufilesys_used=Anvnd ufilesys_soft=Mjuk grns ufilesys_hard=Hrd grns ufilesys_nouquota=Anvndare $1 har ingen quota p ngot filsystem ufilesys_edit=ndra quota p: ufilesys_copy=Kopiera quota ugracef_title=Tidsintervall ugracef_return=anvndarlista ugracef_ecannot=Du fr inte ndra tidsintervall p detta filsystem ugracef_info=Varje filsystem har ett tidsintervall fr block- och filquota. Detta tidsintervall anger hur lnge en anvndare fr verskrida sin mjuka grns innan den hindras att skapa fler filer. ugracef_graces=Anvndartidsintervall fr $1 ugracef_block=Fr blockquota ugracef_file=Fr filquota ugracef_update=Uppdatera ugraces_esave=Det gick inte att spara tidsintervall ugraces_eedit=Du fr inte ndra tidsintervall p detta filsystem ugraces_enumber='$1' r inte ett antal lusers_failed=Det gick inte att lista anvndare lusers_eallow=Du fr inte ndra quota p detta filsystem lusers_title=Filsystemsquota lusers_return=filsystemslista lusers_toomany=Det r fr mnga anvndare som har quota p $1 fr att det ska g att visa p en sida lusers_qoutas=All anvndarquota p $1 lusers_blocks=Block lusers_files=Filer lusers_user=Anvndare lusers_used=Anvnd lusers_soft=Mjuk grns lusers_hard=Hrd grns lusers_noquota=Ingen anvndare har quota p $1 lusers_equota=ndra quota fr: lusers_egrace=ndra tidsintervall lusers_check=Kontrollera quota lusers_info=Webmin kan stllas in att automatiskt stta quota p detta filsystem nr en ny Unix-anvndare skapas. Detta fungerar endast d Webmin-modulen $1 anvnds fr att lgga till anvndare. lusers_useradmin=Anvndare och grupper lusers_newuser=Quota fr nya anvndare lusers_sblimit=Mjuk blockgrns lusers_hblimit=Hrd blockgrns lusers_sflimit=Mjuk filgrns lusers_hflimit=Hrd filgrns lusers_apply=Ta i drift grace_seconds=Sekunder grace_minutes=Minuter grace_hours=Timmar grace_days=Dagar grace_weeks=Veckor grace_months=Mnader log_activate_u=Slog p anvndarquota p $1 log_activate_g=Slog p gruppquota p $1 log_activate_ug=Slog p anvndar- och gruppquota p $1 log_deactivate_u=Slog av anvndarquota $1 log_deactivate_g=Slog av gruppquota p $1 log_deactivate_ug=Slog av anvndar- och gruppquota p $1 log_save=ndrade quota fr $1 p $2 log_sync=ndrade quota fr nya anvndare p $1 log_grace_u=ndrade tidsintervall fr anvndare p $1 log_grace_g=ndrade tidsintervall fr grupper p $1 log_check=Kontrollerade quota p $1 log_copy_u=Kopierade anvndaren $1s quota log_copy_g=Kopierade gruppen $1s quota quota/lang/zh_CN0100644000567100000120000001545507630064656013563 0ustar jcameronwheelquota_unlimited= acl_fss=ûɱ༭ļϵͳ acl_fall=ļϵͳ acl_fsel=ѡ.. acl_quotaon=Ƿúͽô acl_quotanew=ǷΪûô acl_ugrace=Ƿɱ༭û޴ acl_vtotal=Ƿɲ鿴ܿռ䣿 acl_ggrace=Ƿɱ༭޴ acl_uquota=ûԱ༭û acl_gquota=ûԱ༭ acl_uall=û acl_uonly=Ψһû acl_uexcept=û acl_ugroup=еû acl_gall= acl_gnone=û acl_gonly=Ψһ acl_gexcept= acl_uuid=UIDûΧ acl_maxblocks=ĿȨ acl_maxfiles=Ȩļ acl_unlimited= activate_eallow=ûڱļϵͳúͽôȨ activate_eon=ʧ activate_eoff=رʧ check_title= check_return=$1 б check_ecannot=ûм鱾ļϵͳȨ check_running=quotacheckԼ$1ϵĴ̿ļڴļϵͳҪܳʱ.. check_done=... ɡ check_rgroup= check_ruser=û cgroup_efail=ʧ cgroup_ecannot=ûпȨ cgroup_egallow=ûпȨ cgroup_enogroup=ûпɿ鵽 cgroup_eallowto=ûп '$1'Ȩ cgform_title= cgform_return= cgform_ecannot=޷ cgform_egroup=ûпȨ cgform_copyto=ļϵͳ$1 cgform_all=ϵͳϵ cgform_select=ѡ cgform_contain=û cgform_doit= cuser_efail=ʧ cuser_ecannot=ûпȨ cuser_euallow=ûпûȨ cuser_enouser=ûû cuser_eallowto=ûп'$1'Ȩ cuform_title= cuform_return=û cuform_ecannot=޷ cuform_euallow=ûпûȨ cuform_copyto=$1ļϵͳ ... cuform_all=ϵͳϵû cuform_select=ѡû cuform_members=ѡijԱ cuform_doit= egroup_title=༭ egroup_freturn=ļϵͳб egroup_greturn=б egroup_eallowgr=ûб༭ '$1'Ȩ egroup_eallowfs=ûб༭ļϵͳϵȨ egroup_quotas=$1$2ϵ egroup_bused=ÿ egroup_sblimit=Կ egroup_hblimit=ӲԿ egroup_fused=ʹõļ egroup_sflimit=ļ egroup_hflimit=Ӳļ egroup_update= egroup_listall=г euser_title=༭ euser_freturn=ļϵͳб euser_ureturn=ûб euser_eallowus=ûб༭'$1'Ȩ euser_eallowfs=ûб༭ļϵͳȨ euser_quotas=$1$2ϵ euser_bused=ÿ euser_bdisk=ϿõĿ euser_sblimit=Կ euser_hblimit=ӲԿ euser_fused=ļ euser_fdisk=Ͽõļ euser_sflimit=ļ euser_hflimit=Ӳļ euser_update= euser_listall=б gfilesys_title= gfilesys_return=ļб gfilesys_ecannot=ûб༭'$1'ļȨ gfilesys_all=$1 gfilesys_blocks= gfilesys_files=ļ gfilesys_fs=ļϵͳ gfilesys_used= gfilesys_soft= gfilesys_hard=Ӳ gfilesys_nogquota= $1 κļϵͳ϶û gfilesys_edit=༭޶ڣ gfilesys_copy= ggracef_title=ʱ ggracef_return=б ggracef_ecannot=ûб༭ļϵͳʱȨ ggracef_info=ÿļϵͳжԿļĿʱ䡣ʱһ鱻ֹļ֮ǰ״̬ʱ䳤̡ ggracef_graces=$1ʱ ggracef_block=Կ ggracef_file=ļ ggracef_update= ggraces_esave=ʱʧ ggraces_eedit=ûб༭ļϵͳĿʱȨ ggraces_enumber='$1' index_quser=û index_qgroup= index_qboth=û index_active= index_disable= index_inactive= index_enable= index_mountonly=ڼʱ index_title= index_fs=ļϵͳ index_type= index_mount= index_status=״̬ index_action= index_return= index_euser=༭û index_egroup=༭ index_nosupport=ļϵͳ֧ lgroups_failed=гʧ lgroups_eallow=ûб༭ļϵͳϵȨ lgroups_title=ļϵͳ lgroups_return=ļϵͳб lgroups_toomany=$1̫࣬һҳ޷ȫʾ lgroups_quotas=$1ϵ lgroups_blocks= lgroups_files=ļ lgroups_group= lgroups_used= lgroups_soft= lgroups_hard=Ӳ lgroups_noquota=û$1 lgroups_equota=༭Ϊ lgroups_grace=༭ʱ lgroups_check= sgroup_egroup=ûб༭Ȩ sgroup_efs=ûб༭ļϵͳȨ ssync_ecannot=ûļϵͳĬȨ suser_euser=ûб༭ûȨ suser_efs=ûб༭ļϵͳȨ suser_emaxblocks=ûȨ$1ƵȨ suser_emaxfiles=ûȨ$1ļƵȨ ufilesys_title=û ufilesys_return=ļϵͳб ufilesys_ecannot=ûб༭'$1'Ȩ ufilesys_all=$1 ufilesys_blocks= ufilesys_files=ļ ufilesys_fs=ļϵͳ ufilesys_used= ufilesys_soft= ufilesys_hard=Ӳ ufilesys_nouquota=û$1 κļϵͳû ufilesys_edit=༭ڣ ufilesys_copy= ugracef_title=ʱ ugracef_return=ûб ugracef_ecannot=ûб༭ļϵͳĵĿʱȨ ugracef_info=ÿļϵͳжԿļĿʱ䡣ʱһûֹļ֮ǰ״̬ʱ䳤̡ ugracef_graces=$1ûʱ ugracef_block=Ϊ ugracef_file=ļ ugracef_update= ugraces_esave=ʱʧ ugraces_eedit=ûб༭ļϵͳϵĿʱȨ ugraces_enumber='$1' lusers_failed=гûʧ lusers_eallow=ûб༭ļϵͳϵȨ lusers_title=ļϵͳ lusers_return=ļϵͳб lusers_toomany=$1û̫࣬һҳ޷ȫʾ lusers_qoutas=$1ϵû lusers_blocks= lusers_files=ļ lusers_user=û lusers_used= lusers_soft= lusers_hard=Ӳ lusers_noquota=ûû$1 lusers_equota=༭ԣ lusers_egrace=༭ʱ lusers_check= lusers_info= Unix ûWebmin ԱԶڱļϵͳֻʹ $1 Webmin ģûʱ˹ܲЧ lusers_useradmin=û lusers_newuser=û lusers_sblimit=Կ lusers_hblimit=ӲԿ lusers_sflimit=ļ lusers_hflimit=Ӳļ lusers_apply=Ӧ grace_seconds= grace_minutes= grace_hours=Сʱ grace_days= grace_weeks= grace_months= log_activate_u= $1 û log_activate_g= $1 log_activate_ug= $1 û log_deactivate_u= $1 Ͻû log_deactivate_g= $1 Ͻ log_deactivate_ug= $1 Ͻû log_save= $2 ϸı $1 log_sync= $1 ϸıû log_grace_u= $1 ϸıûʱ log_grace_g= $1 ϸıʱ log_check= $1 ϼ log_copy_u=û $1 log_copy_g= $1 quota/lang/en0100644000567100000120000002056607440573627013165 0ustar jcameronwheelquota_unlimited=Unlimited acl_fss=Filesystems this user can edit acl_fall=All filesystems acl_fsel=Selected.. acl_quotaon=Can enable and disable quotas? acl_quotanew=Can configure quotas for new users? acl_ugrace=Can edit user grace times? acl_vtotal=Can view total disk space? acl_ggrace=Can edit group grace times? acl_uquota=Users this user can edit quotas for acl_gquota=Groups this user can edit quotas for acl_uall= All users acl_uonly= Only users acl_uexcept= All except users acl_ugroup= Users with primary group acl_gall= All groups acl_gnone= No groups acl_gonly= Only groups acl_gexcept= All except groups acl_uuid=Users with UID in range acl_maxblocks=Maximum grantable block quota acl_maxfiles=Maximum grantable file quota acl_unlimited=Unlimited activate_eallow=You are not allowed to enable or disable quotas on this filesystem activate_eon=Failed to turn on quotas activate_eoff=Failed to turn off quotas check_title=Check Quotas check_return=$1 list check_ecannot=You cannot check quotas on this filesystem check_running=The quotacheck command is now being run to check the block and file usage on $1. This may take a long time for a very large filesystem... check_done=... Done. check_rgroup=group check_ruser=user cgroup_efail=Failed to copy quotas cgroup_ecannot=You cannot copy quotas cgroup_egallow=You are not allowed to copy the quotas of this group cgroup_enogroup=No groups to copy to cgroup_eallowto=You are not allowed to copy quotas to '$1' cgform_title=Copy Quotas cgform_return=group quota cgform_ecannot=You cannot copy quotas cgform_egroup=You are not allowed to copy the quotas of this group cgform_copyto=Copy quotas for $1 on ALL filesystems to ... cgform_all=All groups on your system cgform_select=Selected groups cgform_contain=Groups containing users cgform_doit=Copy cuser_efail=Failed to copy quotas cuser_ecannot=You cannot copy quotas cuser_euallow=You are not allowed to copy the quotas of this user cuser_enouser=No users to copy to cuser_eallowto=You are not allowed to copy quotas to '$1' cuform_title=Copy Quotas cuform_return=user quota cuform_ecannot=You cannot copy quotas cuform_euallow=You are not allowed to copy the quotas of this user cuform_copyto=Copy quotas for $1 on ALL filesystems to ... cuform_all=All users on your system cuform_select=Selected users cuform_members=Members of selected groups cuform_doit=Copy egroup_title=Edit Quota egroup_freturn=filesystem list egroup_greturn=group list egroup_eallowgr=You are not allowed to edit quotas for '$1' egroup_eallowfs=You are not allowed to edit quotas on this filesystem egroup_quotas=Quota for $1 on $2 egroup_bused=Blocks Used egroup_sblimit=Soft Block Limit egroup_hblimit=Hard Block Limit egroup_fused=Files Used egroup_sflimit=Soft File Limit egroup_hflimit=Hard File Limit egroup_update=Update egroup_listall=List All Quotas euser_title=Edit Quota euser_freturn=filesystem list euser_ureturn=user list euser_eallowus=You are not allowed to edit quotas for '$1' euser_eallowfs=You are not allowed to edit quotas on this filesystem euser_quotas=Quota for $1 on $2 euser_bused=Blocks Used euser_bdisk=Available Blocks on Disk euser_sblimit=Soft Block Limit euser_hblimit=Hard Block Limit euser_fused=Files Used euser_fdisk=Available Files on Disk euser_sflimit=Soft File Limit euser_hflimit=Hard File Limit euser_update=Update euser_listall=List All Quotas gfilesys_title=Group Quotas gfilesys_return=filesystems list gfilesys_ecannot=You cannot edit quotas for '$1' gfilesys_all=All Quotas for $1 gfilesys_blocks=Blocks gfilesys_files=Files gfilesys_fs=Filesystem gfilesys_used=Used gfilesys_soft=Soft Limit gfilesys_hard=Hard Limit gfilesys_nogquota=Group $1 does not have quotas on any filesystem gfilesys_edit=Edit Quota On: gfilesys_copy=Copy Quotas ggracef_title=Grace Times ggracef_return=group list ggracef_ecannot=You cannot edit grace times on this filesystem ggracef_info=Each filesystem has a grace time for block and file quotas. The grace time determines how long a group can remain over the soft limit before no more files are allowed to be created. ggracef_graces=Group Grace Times for $1 ggracef_block=For block quota ggracef_file=For file quota ggracef_update=Update ggraces_esave=Failed to save grace times ggraces_eedit=You cannot edit grace times on this filesystem ggraces_enumber='$1' is not a number index_quser=User Quotas index_qgroup=Group Quotas index_qboth=User and Group Quotas index_active=Active index_disable=Disable Quotas index_inactive=Inactive index_enable=Enable Quotas index_mountonly=Can only enable at mount index_title=Disk Quotas index_fs=Filesystem index_type=Type index_mount=Mounted From index_status=Status index_action=Action index_return=index index_euser=Edit User Quotas: index_egroup=Edit Group Quotas: index_nosupport=No local filesystems can support quotas lgroups_failed=Failed to list groups lgroups_eallow=You are not allowed to edit quotas on this filesystem lgroups_title=Filesystem Quotas lgroups_return=filesystems list lgroups_toomany=Too many groups have quotas on $1 to display on one page lgroups_quotas=All Group Quotas on $1 lgroups_blocks=Blocks lgroups_files=Files lgroups_group=Group lgroups_used=Used lgroups_soft=Soft Limit lgroups_hard=Hard Limit lgroups_noquota=No groups have quotas on $1 lgroups_equota=Edit Quota For: lgroups_grace=Edit Grace Times lgroups_check=Check Quotas sgroup_egroup=You are not allowed to edit quotas for this group sgroup_efs=You are not allowed to edit quotas on this filesystem ssync_ecannot=You cannot set the default quota for this filesystem suser_euser=You are not allowed to edit quotas for this user suser_efs=You are not allowed to edit quotas on this filesystem suser_emaxblocks=You are not allowed to grant block limits above $1 suser_emaxfiles=You are not allowed to grant file limits above $1 ufilesys_title=User Quotas ufilesys_return=filesystems list ufilesys_ecannot=You cannot edit quotas for '$1' ufilesys_all=All Quotas for $1 ufilesys_blocks=Blocks ufilesys_files=Files ufilesys_fs=Filesystem ufilesys_used=Used ufilesys_soft=Soft Limit ufilesys_hard=Hard Limit ufilesys_nouquota=User $1 does not have quotas on any filesystem ufilesys_edit=Edit Quota On: ufilesys_copy=Copy Quotas ugracef_title=Grace Times ugracef_return=user list ugracef_ecannot=You cannot edit grace times on this filesystem ugracef_info=Each filesystem has a grace time for block and file quotas. The grace time determines how long a user can remain over the soft limit before no more files are allowed to be created. ugracef_graces=User Grace Times for $1 ugracef_block=For block quota ugracef_file=For file quota ugracef_update=Update ugraces_esave=Failed to save grace times ugraces_eedit=You cannot edit grace times on this filesystem ugraces_enumber='$1' is not a number lusers_failed=Failed to list users lusers_eallow=You are not allowed to edit quotas on this filesystem lusers_title=Filesystem Quotas lusers_return=filesystems list lusers_toomany=Too many users have quotas on $1 to display on one page lusers_qoutas=All User Quotas on $1 lusers_blocks=Blocks lusers_files=Files lusers_user=User lusers_used=Used lusers_soft=Soft Limit lusers_hard=Hard Limit lusers_noquota=No users have quotas on $1 lusers_equota=Edit Quota For: lusers_egrace=Edit Grace Times lusers_check=Check Quotas lusers_info=Webmin can be configured to automatically set the quotas on this filesystem when a new Unix user is created. This will only work when the $1 Webmin module is used to add users. lusers_useradmin=Users and Groups lusers_newuser=New User Quotas lusers_sblimit=Soft Block Limit lusers_hblimit=Hard Block Limit lusers_sflimit=Soft File Limit lusers_hflimit=Hard File Limit lusers_apply=Apply grace_seconds=Seconds grace_minutes=Minutes grace_hours=Hours grace_days=Days grace_weeks=Weeks grace_months=Months log_activate_u=Enabled user quotas on $1 log_activate_g=Enabled group quotas on $1 log_activate_ug=Enabled user and group quotas on $1 log_deactivate_u=Disabled user quotas on $1 log_deactivate_g=Disabled group quotas on $1 log_deactivate_ug=Disabled user and group quotas on $1 log_save=Changed quotas for $1 on $2 log_sync=Changed new user quotas on $1 log_grace_u=Changed user grace times on $1 log_grace_g=Changed group grace times on $1 log_check=Checked quotas on $1 log_copy_u=Copied user $1's quotas log_copy_g=Copied group $1's quotas quota/lang/pt0100644000567100000120000000003207060351556013161 0ustar jcameronwheelquota_unlimited=Ilimitado quota/lang/pl0100644000567100000120000002331207366415362013164 0ustar jcameronwheelquota_unlimited=Brak acl_fss=Systemy plikw, ktre ten uytkownik moe zmienia acl_fall=Wszystkie acl_fsel=Wybrane.. acl_quotaon=Moe wcza i wycza quota? acl_quotanew=Moe zmienia ustawienia quota dla nowych uytkownikw? acl_ugrace=Moe zmienia czasy ulgi dla uytkownikw? acl_vtotal=Moe oglda czn ilo miejsca na dysku? acl_ggrace=Moe zmienia czasy ulgi dla grup? acl_uquota=Moe zmienia quota dla uytkownikw dla acl_gquota=Moe zmienia quota dla grup dla acl_uall= Wszystkich uytkownikw acl_uonly= Tylko dla uytkownikw acl_uexcept= Wszystkich oprcz uytkownikw acl_ugroup= Uytkownikw z grup gwn acl_gall= Wszystkich grup acl_gnone= adnej grupy acl_gonly= Tylko dla grup acl_gexcept= Wszystkich oprcz grup acl_uuid=Uytkownikw o nrach UID z zakresu acl_maxblocks=Maksymalna nadawana warto quota dla blokw acl_maxfiles=Maksymalna nadawana warto quota dla plikw acl_unlimited=Nieograniczona activate_eallow=Nie masz uprawnie do wczania ani wylczania quota dla tego systemu plikw activate_eon=Nie udao si wczy quota activate_eoff=Nie udao si wyczy quota check_title=Sprawd Quota check_return=listy $1 check_ecannot=Nie masz uprawnie do weryfikacji poprawnoci quota na tym systemie plikw check_running=Zosta uruchomiony program quotacheck w celu zbadania wykorzystania blokw i plikw na $1. Na duym systemie plikw moe to zaj sporo czasu... check_done=... Zakoczono. check_rgroup=grup check_ruser=uytkownikw cgroup_efail=Nie udao si skopiowa quota cgroup_ecannot=Nie masz uprawnie do kopiowania quota cgroup_egallow=Nie masz uprawnie do kopiowania quota tej grupy cgroup_enogroup=Nie podano grup, do ktrych kopiowa cgroup_eallowto=Nie masz uprawnie do kopiowania quota do '$1' cgform_title=Kopiuj quota cgform_return=quota dla grupy cgform_ecannot=Nie masz uprawnie do kopiowania quota cgform_egroup=Nie masz uprawnie do kopiowania quota tej grupy cgform_copyto=Kopiuj quota dla $1 na WSZYSTKICH systemach plikw do ... cgform_all=Wszystkich grup w systemie cgform_select=Wybranych grup cgform_contain=Grup zawierajcych uytkownikw cgform_doit=Kopiuj cuser_efail=Nie udao si skopiowa quota cuser_ecannot=Nie masz uprawnie do kopiowania quota cuser_euallow=Nie masz uprawnie do kopiowania quota tego uytkownika cuser_enouser=Nie podano uytkownikw, do ktrych kopiowa cuser_eallowto=Nie masz uprawnie do kopiowania quota do '$1' cuform_title=Kopiuj quota cuform_return=quota dla uytkownika cuform_ecannot=Nie masz uprawnie do kopiowania quota cuform_euallow=Nie masz uprawnie do kopiowania quota tego uytkownika cuform_copyto=Kopiuj quota dla $1 na WSZYSTKICH systemach plikw do ... cuform_all=Wszystkich uytkownikw systemu cuform_select=Wybranych uytkownikw cuform_members=Czonkw wybranych grup cuform_doit=Kopiuj egroup_title=Zmie quota egroup_freturn=listy systemw plikw egroup_greturn=listy grup egroup_eallowgr=Nie masz uprawnie do zmiany quota dla '$1' egroup_eallowfs=Nie masz uprawnie do zmiany quota na tym systemie plikw egroup_quotas=Quota dla $1 na $2 egroup_bused=Blokw uywanych egroup_sblimit=Mikki limit dla blokw egroup_hblimit=Twardy limit dla blokw egroup_fused=Plikw uywanych egroup_sflimit=Mikki limit dla plikw egroup_hflimit=Twardy limit dla plikw egroup_update=Aktualizuj egroup_listall=Poka wszystkie quota euser_title=Zmie quota euser_freturn=listy systemw plikw euser_ureturn=listy uytkownikw euser_eallowus=Nie masz uprawnie do zmiany quota dla '$1' euser_eallowfs=Nie masz uprawnie do zmiany quota na tym systemie plikw euser_quotas=Quota dla $1 na $2 euser_bused=Blokw uywanych euser_bdisk=Blokw dostpnych na dysku euser_sblimit=Mikki limit dla blokw euser_hblimit=Twardy limit dla blokw euser_fused=Plikw uywanych euser_fdisk=Plikw dostpnych na dysku euser_sflimit=Mikki limit dla plikw euser_hflimit=Twardy limit dla plikw euser_update=Aktualizuj euser_listall=Poka wszystkie quota gfilesys_title=Quota dla grup gfilesys_return=lista systemw plikw gfilesys_ecannot=Nie masz uprawnie do zmiany quota dla '$1' gfilesys_all=Wszystkie quota dla gfilesys_blocks=Blokw gfilesys_files=Plikw gfilesys_fs=System plikw gfilesys_used=Uywane gfilesys_soft=Mikki limit gfilesys_hard=Twardy limit gfilesys_nogquota=Grupa $1 nie posiada quota na adnym systemie plikw gfilesys_edit=Zmie quota na: gfilesys_copy=Kopiuj quota ggracef_title=Czasy ulgi ggracef_return=listy grup ggracef_ecannot=Nie masz uprawnie do zmiany czasw ulgi dla tego systemu plikw ggracef_info=Kady system plikw posiada czas ulgi dla blokw i dla plikw. Czas ulgi ukrela jak dugo mikki limit moe by przekroczony przez grup, zanim zostanie zablokowana moliwo tworzenia nowych plikw. ggracef_graces=Czasy ulgi dla grupy dla $1 ggracef_block=Dla quota dla blokw ggracef_file=Dla quota dla plikw ggracef_update=Aktualizuj ggraces_esave=Nie udao si zapisa czasw ulgi ggraces_eedit=Nie masz uprawnie do zmiany czasw ulgi dla tego systemu plikw ggraces_enumber='$1' nie jest liczb index_quser=Quota dla uytkownikw index_qgroup=Quota dla grup index_qboth=Quota dla uytkownikw i grup index_active=wczone index_disable=Wycz quota index_inactive=wyczone index_enable=Wcz quota index_title=Quota na dyskach index_fs=System plikw index_type=Rodzaj index_mount=Rezydujcy na index_status=Stan index_action=Dziaanie index_return=indeksu index_euser=Zmie quota dla uytkownika: index_egroup=Zmie quota dla grupy: index_nosupport=aden lokalny system plikw nie obsuguje quota lgroups_failed=Nie udao si pokaza listy grup lgroups_eallow=Nie masz uprawnie do zmiany quota na tym systemie plikw lgroups_title=Quota na systemie plikw lgroups_return=listy systemw plikw lgroups_toomany=Zbyt wiele grup posiada quota na $1, aby wywietli je na jednej stronie lgroups_quotas=Quota wszystkich grup na $1 lgroups_blocks=Blokw lgroups_files=Plikw lgroups_group=Grup lgroups_used=Uywane lgroups_soft=Mikki limit lgroups_hard=Twardy limit lgroups_noquota=adna grupa nie posiada quota na $1 lgroups_equota=Zmie quota dla: lgroups_grace=Zmie czasy ulgi lgroups_check=Sprawd quota sgroup_egroup=Nie masz uprawnie do zmiany quota dla tej grupy sgroup_efs=Nie masz uprawnie do zmiany quota na tym systemie plikw ssync_ecannot=Nie masz uprawnie do ustawiania domylnych limitw quota dla tego systemu plikow suser_euser=Nie masz uprawnie do zmiany quota dla tego uytkownika suser_efs=Nie masz uprawnie do zmiany quota na tym systemie plikw suser_emaxblocks=Nie masz uprawnie do ustawiania ograniczenia quota dla blokw ponad $1 suser_emaxfiles=Nie masz uprawnie do ustawiania ograniczenia quota dla plikw ponad $1 ufilesys_title=Quota dla uytkownikw ufilesys_return=listy systemw plikw ufilesys_ecannot=Nie masz uprawnie do zmiany quota dla '$1' ufilesys_all=Wszystkie quota dla $1 ufilesys_blocks=Blokw ufilesys_files=Plikw ufilesys_fs=System plikw ufilesys_used=Uywane ufilesys_soft=Mikki limit ufilesys_hard=Twardy limit ufilesys_nouquota=Uytkownik $1 nie posiada quota na zadnym systemie plikw ufilesys_edit=Zmie quota na: ufilesys_copy=Kopiuj quota ugracef_title=Czasy ulgi ugracef_return=listy uytkownikw ugracef_ecannot=Nie masz uprawnie do zmiany czasw ulgi dla tego systemu plikw ugracef_info=Kady system plikw posiada czas ulgi dla blokw i plikw. Czas ulgi ukrela jak dugo mikki limit moe by przekroczony przez uytkownika, zanim zostanie zablokowana moliwo tworzenia nowych plikw. ugracef_graces=Czasy ulgi dla uytkownika dla $1 ugracef_block=Dla quota dla blokw ugracef_file=Dla quota dla plikw ugracef_update=Aktualizuj ugraces_esave=Nie udao si zapisa czasw ulgi ugraces_eedit=Nie masz uprawnie do zmiany czasw ulgi dla tego systemu plikw ugraces_enumber='$1' nie jest liczb lusers_failed=Failed to list users lusers_eallow=Nie masz uprawnie do zmiany quota dla tego systemu plikw lusers_title=Quota dla systemu plikw lusers_return=listy systemw plikw lusers_toomany=Zbyt wielu uytkownikw posiada quota na $1, aby wywietli ich na jednej stronie lusers_qoutas=Quota wszystkich uytkownikw na $1 lusers_blocks=Blokw lusers_files=Plikw lusers_user=Uytkownik lusers_used=Uywane lusers_soft=Mikki limit lusers_hard=Twardy limit lusers_noquota=aden uytkownik nie ma quota na $1 lusers_equota=Zmie quota dla: lusers_egrace=Zmie czasy ulgi lusers_check=Sprawd quota lusers_info=Webmina mona skonfigurowa tak, aby automatycznie ustawia quota na tym systemie plikw podczas tworzenia nowego uytkownika Uniksa. Bdzie to dziaa jedynie gdy uytkownicy bd dodawani przy uyciu moduu Webmina $1. lusers_useradmin=Uytkownicy i grupy lusers_newuser=Quota dla nowego uytkownika lusers_sblimit=Mikki limit dla blokw lusers_hblimit=Twardy limit dla blokw lusers_sflimit=Mikki limit dla plikw lusers_hflimit=Twardy limit dla plikw lusers_apply=Zastosuj grace_seconds=Sekund grace_minutes=Minut grace_hours=Godzin grace_days=Dni grace_weeks=Tygodni grace_months=Miesicy log_activate_u=Wczono quota dla uytkownikw na $1 log_activate_g=Wczono quota dla grup na $1 log_activate_ug=Wczono quota dla uytkownikw i grup na $1 log_deactivate_u=Wyczono quota dla uytkownikw na $1 log_deactivate_g=Wyczono quota dla grup na $1 log_deactivate_ug=Wyczono quota dla uytkownikw i grup na $1 log_save=Zmieniono quota dla $1 na $2 log_sync=Zmieniono quota dla nowych uytkownikw na $1 log_grace_u=Zmieniono czasy ulgi dla uytkownikw na $1 log_grace_g=Zmieniono czasy ulgi dla grup na $1 log_check=Sprawdzono quota na $1 log_copy_u=Skopiowano quota uytkownika $1 log_copy_g=Skopiowano quota grupy $1 quota/lang/tr0100644000567100000120000002205707164752076013205 0ustar jcameronwheelquota_unlimited=Limitsiz acl_fss=Dosya sistemleri bu kullanc tarafndan deitirilebilir acl_quotaon=Kotalar ap kapatabilsin? acl_quotanew=Yeni kullanclar iin kotalar yaplandrabilsin? acl_ugrace=Kullanc gecikme zamanlarn deitirebilsin? acl_vtotal=Toplan disk kapasitesini grebilsin? acl_ggrace=Grup gecikme zamanlarn deitirebilsin? acl_uquota=Bu kullancnn kotalarn deitirebilecei kullanclar acl_gquota=Bu grubun kotalarn deitirebilecei kullanclar acl_uall= Btn kullanclar acl_uonly= Sadece bu kullanclar acl_uexcept= Bu kullanclar hari acl_ugroup= Birincil grubundaki kullanclar acl_gall= Btn gruplar acl_gnone= Hibir grup acl_gonly= Sadece bu gruplar acl_gexpect= Bu gruplar hari activate_eallow=Bu dosya sistemindeki kotalar ap kapamak iin izininiz yoktur activate_eon=Kotalarn aktif hale getirilmesinde hata olutu activate_eoff=Kotalarn kapatlmasnda hata olutu check_title=Kotalar kontrol et check_return=$1 listesi check_ecannot=Bu dosya sistemindeki kotalar kontrol ettiremezsiniz check_running=quotacheck komutu imdi $1'deki dosya ve blok kullanmlarn aratryor. ok byk dosya sistemlerinde bu uzun zaman alabilir... check_done=... Bitti. check_rgroup=grup check_ruser=kullanc cgroup_efail=Kotalarn kopyalanmasnda hata olutu cgroup_ecannot=Kotalar kopyalayamazsnz cgroup_egallow=Bu grubun kotalarn kopyalamak iin izininiz yoktur cgroup_enogroup=Kopyalanacak grup yok cgroup_eallowto='$1''e kotalar kopyalamak iin izininiz yoktur cgform_title=Kotalar Kopyala cgform_return=grup kotas cgform_ecannot=Kotalar kopyalayamazsn cgform_egroup=Bu grubun kotalarn kopyalamak iin izininiz yoktur cgform_copyto=Btn dosya sistemlerinde $1 iin kotalar kopyalanyor ... cgform_all=Sistemdeki btn gruplar cgform_select=Seili gruplar cgform_contain=Kullanc ieren gruplar cgform_doit=Kopyala cuser_efail=Kotalarn kopyalanmasnda hata olutu cuser_ecannot=Kotalar kopyalayamazsnz cuser_euallow=Bu kullancnn kotalarn kopyalamak iin izininiz yoktur cuser_enouser=Kopyalanacak kullanc yok cuser_eallowto='$1'e kotalar kopyalamak iin izininiz yoktur cuform_title=Kotalar Kopyala cuform_return=kullanc kotas cuform_ecannot=Kotalar kopyalayamzsnz cuform_euallow=Bu kullanc iin kopyalar kopyalamak iin izininiz yoktur cuform_copyto=Btn dosya sistemlerinde $1 iin kotalar kopyalanyor ... cuform_all=Sistemdeki btn kullanclar cuform_select=Seili kullanclar cuform_members=Seili grubun yeleri cuform_doit=Kopyaa egroup_title=Kotay Deitir egroup_freturn=dosya sistemi listesi egroup_greturn=grup listesi egroup_eallowgr='$1'in kotalarn deitirmek iin izininiz yoktur egroup_eallowfs=Bu dosya sistemindeki kotalar deitirmek iin izininiz yoktur egroup_quotas=$2deki $1 iin Kota egroup_bused=Kullanlan Blok egroup_sblimit=Soft Blok Limiti egroup_hblimit=Hard Blok Limiti egroup_fused=Kullanlan Dosya egroup_sflimit=Soft Dosya Limiti egroup_hflimit=Hard Dosya Limiti egroup_update=Gncelle egroup_listall=Btn kotalar listele euser_title=Kotay Deitir euser_freturn=dosya sistemi listesi euser_ureturn=kullanc listesi euser_eallowus='$1in kotalarn deitirmek iin izininiz yoktur' euser_eallowfs=Bu dosya sistemindeki kotalar deitirmek iin izininiz yoktur euser_quotas=$2deki $1 iin Kota euser_bused=Kullanlan Blok euser_sblimit=Soft Blok Limiti euser_hblimit=Hard Blok Limiti euser_fused=Kullanlan Dosya euser_sflimit=Soft Dosya Limiti euser_hflimit=Hard Dosya Limiti euser_update=Gncelle euser_listall=Btn Kotalar Listele gfilesys_title=Grup Kotalar gfilesys_return=dosyasistemi listesi gfilesys_ecannot='$1' iin kotalar deitiremezsiniz gfilesys_all=Btn Kotalar gfilesys_blocks=Blok gfilesys_files=Dosya gfilesys_fs=Dosa sistemi gfilesys_used=Kullanlan gfilesys_soft=Soft Limit gfilesys_hard=Hard Limit gfilesys_nogquota=Grup $1 bu dosya sisteminde kotaya sahip deil gfilesys_edit=Burada Kota Deitir: gfilesys_copy=Kotalar Kopyala ggracef_title=Gecikme Zamanlar ggracef_return=grup listesi ggracef_ecannot=Bu dosya sistemindeki gecikme zamanlarn deitiremezsiniz. ggracef_info=Her dosya sistemi blok ve dosya iin bir gecikme zamanna sahiptir. Gecikme zaman kullancnn soft limiti atnda daha fazla dosya oluturamadan nceki sreyi belirler. ggracef_graces=$1 iin Grup Gecikme Zamanlar ggracef_block=Blok kotas iin ggracef_file=Dosya kotas iin ggracef_update=Gncelle ggraces_esave=Gecikme zamanlarnn kaydedilmesinde hata olutu ggraces_eedit=Bu dosya sistemindeki gecikme zamanlarn deitiremezsiniz ggraces_enumber='$1' bir numara deildir index_quser=Kullanc Kotalar index_qgroup=Grup Kotalar index_qboth=Kullanc ve Grup Kotalar index_active=Aktif index_disable=Kotalar Kapat index_inactive=Inaktif index_enable=Kotalar A index_title=Disk Kotalar index_fs=Dosya sistemi index_type=Tip index_mount=Baland index_status=Durum index_action=lem index_index=indeks index_euser=Kullanc Kotalarn Deitir: index_egroup=Grup Kotalarn Deitir: index_nosupport=Yerel dosya sisteminde desteklenen kota yok lgroups_failed=Gruplarn listelenmesinde hata olutu lgroups_eallow=Bu dosya sisteminde kotalar deitirmek iin izininiz yoktur lgroups_title=Dosya sistemi kotalar lgroups_return=dosya sistemi listesi lgroups_toomany=$1'de 1 sayfada gsterilemeyecek kadar ok kotaya sahip grup var lgroups_quotas=$1'deki Btn Grup Kotalar lgroups_blocks=Blok lgroups_files=Dosya lgroups_group=Grup lgroups_used=Kullanlan lgroups_soft=Soft Limit lgroups_hard=Hard Limit lgroups_noquota=$1'de kotaya sahip grup yok lgroups_equota=Bunun iin kotay deitir: lgroups_grace=Gecikme Zamanlarn Deitir lgroups_check=Kotalar Kontrol Et sgroup_egroup=Bu grubun kotalar deitirmek iin izininiz yoktur sgroup_efs=Bu dosya sistemindeki kotalar deitirmek iin izininiz yoktur. save_sync_0=Bu dosya sisteminde ntanml kota oluturamazsnz suser_euser=Bu kullancnn kotalarn deitirmek iin izininiz yoktur suser_efs=Bu dosya sistemindeki kotalar deitirmek iin izininiz yoktur. ufilesys_title=Kullanc Kotalar ufilesys_return=dosya sistemleri listesi ufilesys_ecannot='$1' iin kotalar deitiremezsiniz ufilesys_all=$1 iin Btn Kotalar ufilesys_blocks=Blok ufilesys_files=Dosya ufilesys_fs=Dosya Sistemi ufilesys_used=Kullanlan ufilesys_soft=Soft Limit ufilesys_hard=Hard Limit ufilesys_nouquota=$1 kullancs bu dosya sisteminde herhangi bir kotaya sahip deildir ufilesys_edit=Buradaki Kotalar Deitir: ufilesys_copy=Kotalar Kopyala ugracef_title=Gecikme Zamanlar ugracef_return=kullanc listesi ugracef_ecannot=Bu dosya sistemindeki gecikme srelerini deitiremezsiniz ugracef_info=Her dosya sistemi blok ve dosya iin bir gecikme zamanna sahiptir. Gecikme zaman kullancnn soft limiti atnda daha fazla dosya oluturamadan nceki sreyi belirler. ugracef_graces=$1 iin Kullanc Gecikme Sreleri ugracef_block=Blok kotalar iin ugracef_file=Dosya kotalar iin ugracef_update=Gncelle ugraces_esave=Gecikme srelerinin kaydedilmesinde hata olutu ugraces_eedit=Bu dosya sistemindeki gecikme srelerini deitiremezsiniz ugraces_enumber='$1' bir say deildir lusers_failed=Kullanclarn listelenmesinde hata olutu lusers_eallow=Bu dosya sistemindeki kotalar deitirmek iin izininiz yoktur lusers_title=Dosya sistemi kotalar lusers_return=dosya sistemleri listesi lusers_toomany=Burada bir sayfada gsterilmeyecek kadar fazla kotaya sahip kullanc var lusers_qoutas=$1'deki Btn Kullanc Kotalar lusers_blocks=Blok lusers_files=Dosya lusers_user=Kullanc lusers_used=Kullanlan lusers_soft=Soft Limit lusers_hard=Hard Limit lusers_noquota=Burada kotaya sahip kullanc yok lusers_equota=Kotalar Deitir: lusers_egrace=Gecikme Srelerini Deitir lusers_check=Kotalar Kontrol Et lusers_info=Webmin yeni bir Unix kullancs oluturulduunda bu dosya sistemindeki kotasnn otomatik olarak ayarlanmas iin yaplandrlabilir.Bu sadece kullanc eklenirken Webmin Kullanclar ve Gruplar Modl kullanldnda geerlidir lusers_useradmin=Kullanclar ve Gruplar lusers_newuser=Yeni Kullanc Kotalar lusers_sblimit=Soft Blok Limiti lusers_hblimit=Hard Blok Limiti lusers_sflimit=Soft Dosya Limiti lusers_hflimit=Hard Dosya Limiti lusers_apply=Uygula grace_seconds=Saniye grace_minutes=Dakika grace_hours=Saat grace_days=Gn grace_weeks=Hafta grace_months=Ay log_activate_u=$1'de kullanc kotalar aktif hale getirildi log_activate_g=$1'de grup kotalar aktif hale getirildi log_activate_ug=$1'de kullanc ve grup kotalar aktif hale getirildi log_deactivate_u=$1'de kullanc kotalar kapatld log_deactivate_g=$1'de grup kotalar kapatld log_deactivate_ug=$1'de kullanc ve grup kotalar kapatld log_save=$2'de $1 iin kotalar deitirildi log_sync=$1'de yeni kullanc kotalar deitirildi log_grace_u=$1'de kullanc gecikme zamanlar deitirildi log_grace_g=$1'de grup gecikme zamanlar deitirildi log_check=$1'de kotalar kontrol edildi log_copy_u=Kullanc $1'in kotalar kopyaland log_copy_g=Grup $1'in kotalar kopyaland quota/lang/ja_JP.euc0100664000567100000120000002132407530572341014304 0ustar jcameronwheelquota_unlimited=̵ acl_fss=Υ桼ԽǤե ƥ acl_fall=٤ƤΥե ƥ acl_fsel=.. acl_quotaon=ͭ/̵ˤǤ褦ˤޤ acl_quotanew=桼˥ǽˤޤ acl_ugrace=桼ͱͽ֤Խǽˤޤ acl_vtotal=ץǥΰɽǽˤޤ acl_ggrace=롼פͱͽ֤Խǽˤޤ acl_uquota=Υ桼Խǽʥ桼 acl_gquota=Υ桼Խǽʥ롼 acl_uall= ٤ƤΥ桼 acl_uonly= Υ桼Τ acl_uexcept= Υ桼ʳ٤ acl_ugroup= ץ饤ޥ 롼פΥ桼 acl_gall= ٤ƤΥ롼 acl_gnone= 롼פʤ acl_gonly= 롼פΤ acl_gexcept= 롼װʳ٤ activate_eallow=Υե ƥǤϥͭ/̵ˤǤޤ activate_eon=򥢥ƥ֤ˤǤޤǤ activate_eoff=󥢥ƥ֤ˤǤޤǤ check_title=θ check_return=$1 ꥹ check_ecannot=Υե ƥǤϥ򸡺Ǥޤ check_running=quotacheck ޥɤ¹Ԥ$1Υ֥åȥեΨĴ٤ޤե ƥब礭Ϥʤ֤ޤ... check_done=... λޤ check_rgroup=롼 check_ruser=桼 cgroup_efail=򥳥ԡǤޤǤ cgroup_ecannot=򥳥ԡǤޤ cgroup_egallow=Υ롼פΥϥԡǤޤ cgroup_enogroup=ԡ륰롼פޤ cgroup_eallowto='$1' ˥ϥԡǤޤ cgform_title=Υԡ cgform_return=롼 cgform_ecannot=򥳥ԡǤޤ cgform_egroup=Υ롼פΥϥԡǤޤ cgform_copyto=٤ƤΥե ƥ$1 Υ򥳥ԡ... cgform_all=ƥΤ٤ƤΥ롼 cgform_select=򤵤줿롼 cgform_contain=桼ޤ॰롼 cgform_doit=ԡ cuser_efail=򥳥ԡǤޤǤ cuser_ecannot=򥳥ԡǤޤ cuser_euallow=Υ桼Υ򥳥ԡǤޤ cuser_enouser=ԡ桼ޤ cuser_eallowto='$1' ˥ϥԡǤޤ cuform_title=Υԡ cuform_return=桼 cuform_ecannot=򥳥ԡǤޤ cuform_euallow=Υ桼Υ򥳥ԡǤޤ cuform_copyto=٤ƤΥե ƥ$1 Υ򥳥ԡ... cuform_all=ƥΤ٤ƤΥ桼 cuform_select=򤵤줿桼 cuform_members=򤵤줿롼פΥС cuform_doit=ԡ egroup_title=Խ egroup_freturn=ե ƥΥꥹ egroup_greturn=롼 ꥹ egroup_eallowgr='$1' ΥԽǤޤ egroup_eallowfs=Υե ƥǤϥԽǤޤ egroup_quotas=$1Υ($2) egroup_bused=Ѥ줿֥å egroup_sblimit=ե ֥å egroup_hblimit=ϡ ֥å egroup_fused=Ѥ줿ե egroup_sflimit=ե ե egroup_hflimit=ϡ ե egroup_update= egroup_listall=٤ƤΥꥹ euser_title=Խ euser_freturn=ե ƥΥꥹ euser_ureturn=桼 ꥹ euser_eallowus='$1' ΥԽǤޤ euser_eallowfs=Υե ƥǤϥԽǤޤ euser_quotas=$1Υ($2) euser_bused=Ѥ줿֥å euser_bdisk=ǥǻѲǽʥ֥å euser_sblimit=ե ֥å euser_hblimit=ϡ ֥å euser_fused=Ѥ줿ե euser_fdisk=ǥǻѲǽʥե euser_sflimit=ե ե euser_hflimit=ϡ ե euser_update= euser_listall=٤ƤΥꥹ gfilesys_title=롼 gfilesys_return=ե ƥΥꥹ gfilesys_ecannot='$1' ΥԽǤޤ gfilesys_all=٤ƤΥ gfilesys_blocks=֥å gfilesys_files=ե gfilesys_fs=ե ƥ gfilesys_used=Ѻ gfilesys_soft=ե gfilesys_hard=ϡ gfilesys_nogquota=롼$1 ϤΥե ƥǤ⥯ޤ gfilesys_edit=Խ: gfilesys_copy=Υԡ ggracef_title=ͱͽ ggracef_return=롼 ꥹ ggracef_ecannot=Υե ƥǤͱͽ֤ԽǤޤ ggracef_info=ƥե ƥˤϥ֥åȥե ͱͽ֤ޤͱͽ֤ϡʾեǤʤե¾ǥ롼פ¸³Ǥ֤ޤ ggracef_graces=$1 Υ롼ͱͽ ggracef_block=֥å ggracef_file=ե ggracef_update= ggraces_esave=ͱͽ֤¸ǤޤǤ ggraces_eedit=Υե ƥǤͱͽ֤ԽǤޤ ggraces_enumber='$1' ϿǤϤޤ index_quser=桼 index_qgroup=롼 index_qboth=桼ȥ롼 index_active=ƥ index_disable=̵ index_inactive=󥢥ƥ index_enable=ͭ index_title=ǥ index_fs=ե ƥ index_type= index_mount=ޥȸ index_status=ơ index_action= index_return=ǥå index_euser=桼 Խ: index_egroup=롼 Խ: index_nosupport= ե ƥϥ򥵥ݡȤǤޤ lgroups_failed=롼פꥹȤǤޤǤ lgroups_eallow=Υե ƥǤϥԽǤޤ lgroups_title=ե ƥ lgroups_return=ե ƥΥꥹ lgroups_toomany=1 ڡɽˤ$1 ǥĥ롼פ¿ޤ lgroups_quotas=$1 Τ٤ƤΥ롼 lgroups_blocks=֥å lgroups_files=ե lgroups_group=롼 lgroups_used=Ѻ lgroups_soft=ե lgroups_hard=ϡ lgroups_noquota=$1 ǥĥ롼פϤޤ lgroups_equota=Խ: lgroups_grace=ͱͽ֤Խ lgroups_check=򸡺 sgroup_egroup=Υ롼פΥԽǤޤ sgroup_efs=Υե ƥǤϥԽǤޤ ssync_ecannot=Υե ƥǤϥǥե Ǥޤ suser_euser=Υ桼ΥԽǤޤ suser_efs=Υե ƥǤϥԽǤޤ ufilesys_title=桼 ufilesys_return=ե ƥΥꥹ ufilesys_ecannot='$1' ΥԽǤޤ ufilesys_all=٤ƤΥ $1 ufilesys_blocks=֥å ufilesys_files=ե ufilesys_fs=ե ƥ ufilesys_used=Ѻ ufilesys_soft=ե ufilesys_hard=ϡ ufilesys_nouquota=桼$1 ϤΥե ƥǤ⥯ޤ ufilesys_edit=Խ: ufilesys_copy=Υԡ ugracef_title=ͱͽ ugracef_return=桼 ꥹ ugracef_ecannot=Υե ƥǤͱͽ֤ԽǤޤ ugracef_info=ƥե ƥˤϥ֥åȥե ͱͽ֤ޤͱͽ֤ϡʾեǤʤե¾ǥ桼¸³Ǥ֤ޤ ugracef_graces=$1 Υ桼ͱͽ ugracef_block=֥å ugracef_file=ե ugracef_update= ugraces_esave=ͱͽ֤¸ǤޤǤ ugraces_eedit=Υե ƥǤͱͽ֤ԽǤޤ ugraces_enumber='$1' ϿǤϤޤ lusers_failed=桼ꥹȤǤޤǤ lusers_eallow=Υե ƥǤϥԽǤޤ lusers_title=ե ƥ lusers_return=ե ƥΥꥹ lusers_toomany=1 ڡɽˤ$1ǥĥ桼¿ޤ lusers_qoutas=$1 Τ٤ƤΥ桼 lusers_blocks=֥å lusers_files=ե lusers_user=桼 lusers_used=Ѻ lusers_soft=ե lusers_hard=ϡ lusers_noquota=$1 ǥĥ桼Ϥޤ lusers_equota=Խ: lusers_egrace=ͱͽ֤Խ lusers_check=θ lusers_info= Unix 桼줿ȤˤΥե ƥ˼ưŪ˥ꤹ褦 Webmin Ǥޤϡ桼ɲä뤿 $1 Webmin ⥸塼뤬Ѥ줿ȤˤΤưޤ lusers_useradmin=桼ȥ롼 lusers_newuser=Υ桼 lusers_sblimit=ե ֥å lusers_hblimit=ϡ ֥å lusers_sflimit=ե ե lusers_hflimit=ϡ ե lusers_apply=Ŭ grace_seconds= grace_minutes=ʬ grace_hours= grace_days= grace_weeks= grace_months= log_activate_u=$1 ǥ桼Υͭˤޤ log_activate_g=$1 ǥ롼פΥͭˤޤ log_activate_ug=$1 ǥ桼ȥ롼פΥͭˤޤ log_deactivate_u=$1 ǥ桼Υ̵ˤޤ log_deactivate_g=$1 ǥ롼פΥ̵ˤޤ log_deactivate_ug=$1 ǥ桼ȥ롼פΥ̵ˤޤ log_save=$2 $1 Υѹޤ log_sync=$1 ǿΥ桼 ѹޤ log_grace_u=$1 ǥ桼ͱͽ֤ѹޤ log_grace_g=$1 ǥ롼ͱͽ֤ѹޤ log_check=$1 ǥ򸡺ޤ log_copy_u=桼 $1 Υ򥳥ԡޤ log_copy_g=롼 $1 Υ򥳥ԡޤ quota/lang/ko_KR.euc0100664000567100000120000002033607305563347014336 0ustar jcameronwheelquota_unlimited= acl_fss= ڰ ִ ý acl_fall= ý acl_fsel= ý.. acl_quotaon=Ҵ緮 / Ҵ ֽϱ? acl_quotanew= Ҵ緮 ֽϱ? acl_ugrace= Ⱓ ֽϱ? acl_vtotal= ũ ֽϱ? acl_ggrace=׷ Ⱓ ֽϱ? acl_uquota= ڿ Ҵ緮 acl_gquota= ڿ Ҵ緮 ׷ acl_uall= acl_uonly= ڸ acl_uexcept= ڸ acl_ugroup= ׷ ִ acl_gall= ׷ acl_gnone= ׷ acl_gonly= ׷츸 acl_gexcept= ׷ activate_eallow= ýۿ Ҵ緮 / Ҵ ϴ activate_eon=Ҵ緮 Ȱȭ ߽ϴ activate_eoff=Ҵ緮 Ȱȭ ߽ϴ check_title=Ҵ緮 ˻ check_return=$1 check_ecannot= ýۿ Ҵ緮 ˻ ϴ check_running=$1 ˻ϴ quotacheck ǰ ֽϴ. ýۿ ð ɸ ֽϴ... check_done=... ϷǾϴ. check_rgroup=׷ check_ruser= cgroup_efail=Ҵ緮 ߽ϴ cgroup_ecannot=Ҵ緮 ϴ cgroup_egallow= ׷ Ҵ緮 ϴ cgroup_enogroup= ׷ ϴ cgroup_eallowto='$1' Ҵ緮 ϴ cgform_title=Ҵ緮 cgform_return=׷ Ҵ緮 cgform_ecannot=Ҵ緮 ϴ cgform_egroup= ׷ Ҵ緮 ϴ cgform_copyto= ý $1 Ҵ緮 ... cgform_all=ý ׷ cgform_select= ׷ cgform_contain=ڰ Ե ׷ cgform_doit= cuser_efail=Ҵ緮 ߽ϴ cuser_ecannot=Ҵ緮 ϴ cuser_euallow= Ҵ緮 ϴ cuser_enouser= ڰ ϴ cuser_eallowto='$1' Ҵ緮 ϴ cuform_title=Ҵ緮 cuform_return= Ҵ緮 cuform_ecannot=Ҵ緮 ϴ cuform_euallow= Ҵ緮 ϴ cuform_copyto= ý $1 Ҵ緮 ... cuform_all=ý cuform_select= cuform_members= ׷ cuform_doit= egroup_title=Ҵ緮 egroup_freturn= ý egroup_greturn=׷ egroup_eallowgr='$1' Ҵ緮 ϴ egroup_eallowfs= ýۿ Ҵ緮 ϴ egroup_quotas=$1 $2 Ҵ緮 egroup_bused= egroup_sblimit=Ʈ egroup_hblimit=ϵ egroup_fused= egroup_sflimit=Ʈ egroup_hflimit=ϵ egroup_update=Ʈ egroup_listall= Ҵ緮 euser_title=Ҵ緮 euser_freturn= ý euser_ureturn= euser_eallowus='$1' Ҵ緮 ϴ euser_eallowfs= ýۿ Ҵ緮 ϴ euser_quotas=$1 $2 Ҵ緮 euser_bused= euser_bdisk= ũ euser_sblimit=Ʈ euser_hblimit=ϵ euser_fused= euser_fdisk= ũ euser_sflimit=Ʈ euser_hflimit=ϵ euser_update=Ʈ euser_listall= Ҵ緮 gfilesys_title=׷ Ҵ緮 gfilesys_return= ý gfilesys_ecannot='$1' Ҵ緮 ϴ gfilesys_all= Ҵ緮 gfilesys_blocks= gfilesys_files= gfilesys_fs= ý gfilesys_used= gfilesys_soft=Ʈ gfilesys_hard=ϵ gfilesys_nogquota=׷ $1() ƹ ýۿ Ҵ緮 ʽϴ gfilesys_edit=Ҵ緮 : gfilesys_copy=Ҵ緮 ggracef_title= Ⱓ ggracef_return=׷ ggracef_ecannot= ý Ⱓ ϴ ggracef_info= ý۸ Ҵ緮 Ⱓ ֽϴ. Ⱓ ۼ ׷ Ʈ · Ǵ ⰣԴϴ. ggracef_graces=$1 ׷ Ⱓ ggracef_block= Ҵ緮 ggracef_file= Ҵ緮 ggracef_update=Ʈ ggraces_esave= Ⱓ ߽ϴ ggraces_eedit= ý Ⱓ ϴ ggraces_enumber='$1'() ڰ ƴմϴ index_quser= Ҵ緮 index_qgroup=׷ Ҵ緮 index_qboth= ׷ Ҵ緮 index_active=Ȱ Դϱ? index_disable=Ҵ緮 Ҵ index_inactive=Ȱ index_enable=Ҵ緮 index_title=ũ Ҵ緮 index_fs= ý index_type= index_mount=Ʈ ҽ index_status= index_action= index_return=ε index_euser= Ҵ緮 : index_egroup=׷ Ҵ緮 : index_nosupport=Ҵ緮 ִ ý ϴ lgroups_failed=׷ ߽ϴ lgroups_eallow= ýۿ Ҵ緮 ϴ lgroups_title= ý Ҵ緮 lgroups_return= ý lgroups_toomany=$1 Ҵ緮 ִ ׷ ʹ ǥ ϴ lgroups_quotas=$1 ׷ Ҵ緮 lgroups_blocks= lgroups_files= lgroups_group=׷ lgroups_used= lgroups_soft=Ʈ lgroups_hard=ϵ lgroups_noquota=$1 Ҵ緮 ִ ׷ ϴ lgroups_equota=Ҵ緮 : lgroups_grace= Ⱓ lgroups_check=Ҵ緮 ˻ sgroup_egroup= ׷ Ҵ緮 ϴ sgroup_efs= ý Ҵ緮 ϴ ssync_ecannot= ý ⺻ Ҵ緮 ϴ suser_euser= Ҵ緮 ϴ suser_efs= ý Ҵ緮 ϴ ufilesys_title= Ҵ緮 ufilesys_return= ý ufilesys_ecannot='$1' Ҵ緮 ϴ ufilesys_all=$1 Ҵ緮 ufilesys_blocks= ufilesys_files= ufilesys_fs= ý ufilesys_used= ufilesys_soft=Ʈ ufilesys_hard=ϵ ufilesys_nouquota= $1() ƹ ýۿ Ҵ緮 ʽϴ ufilesys_edit=Ҵ緮 : ufilesys_copy=Ҵ緮 ugracef_title= Ⱓ ugracef_return= ugracef_ecannot= ý Ⱓ ϴ ugracef_info= ý۸ Ҵ緮 Ⱓ ֽϴ. Ⱓ ۼ ڰ Ʈ · Ǵ ⰣԴϴ. ugracef_graces=$1 Ⱓ ugracef_block= Ҵ緮 ugracef_file= Ҵ緮 ugracef_update=Ʈ ugraces_esave= Ⱓ ߽ϴ ugraces_eedit= ý Ⱓ ϴ ugraces_enumber='$1'() ڰ ƴմϴ lusers_failed=ڸ ߽ϴ lusers_eallow= ý Ҵ緮 ϴ lusers_title= ý Ҵ緮 lusers_return= ý lusers_toomany=$1 Ҵ緮 ִ ׷ ʹ Ƽ ǥ ϴ lusers_qoutas=$1 Ҵ緮 lusers_blocks= lusers_files= lusers_user= lusers_used= lusers_soft=Ʈ lusers_hard=ϵ lusers_noquota=$1 Ҵ緮 ִ ڰ ϴ lusers_equota=Ҵ緮 : lusers_egrace= Ⱓ lusers_check=Ҵ緮 ˻ lusers_info= н ۼ ýۿ Ҵ緮 ڵ ǵ Webmin ֽϴ. ̷ $1 Webmin ڸ ߰ϴ մϴ. lusers_useradmin= ׷ lusers_newuser= Ҵ緮 lusers_sblimit=Ʈ lusers_hblimit=ϵ lusers_sflimit=Ʈ lusers_hflimit=ϵ lusers_apply= grace_seconds= grace_minutes= grace_hours= grace_days= grace_weeks= grace_months= log_activate_u=$1 Ҵ緮 log_activate_g=$1 ׷ Ҵ緮 log_activate_ug=$1 ׷ Ҵ緮 log_deactivate_u=$1 Ҵ緮 Ҵ log_deactivate_g=$1 ׷ Ҵ緮 Ҵ log_deactivate_ug=$1 ׷ Ҵ緮 Ҵ log_save=$2 $1 Ҵ緮 log_sync=$1 Ҵ緮 log_grace_u=$1 Ⱓ log_grace_g=$1 ׷ Ⱓ log_check=$1 Ҵ緮 ˻ log_copy_u= $1 Ҵ緮 log_copy_g=׷ $1 Ҵ緮 quota/lang/ca0100644000567100000120000002342207652367416013142 0ustar jcameronwheelquota_unlimited=Illimitada acl_fss=Sistemes de fitxers que aquest usuari pot editar acl_fall=Tots els sistemes de fitxers acl_fsel=Seleccionats... acl_quotaon=Pot activar i desactivar quotes acl_quotanew=Pot configurar quotes per als usuaris nous acl_ugrace=Pot editar els perodes de grcia dels usuaris acl_vtotal=Pot veure el total d'espai al disc acl_ggrace=Pot editar els perodes de grcia dels grups acl_uquota=Usuaris dels quals aquest usuari pot modificar quotes acl_gquota=Grups dels quals aquest usuari pot modificar quotes acl_uall=Tots els usuaris acl_uonly=Noms els usuaris acl_uexcept=Tots excepte els usuaris acl_ugroup=Els usuaris amb grup primari acl_gall=Tots els grups acl_gnone=Cap grup acl_gonly=Noms els grups acl_gexcept=Tots excepte els grups acl_uuid=Usuaris amb UID en el rang acl_maxblocks=Quota mxima de blocs concedible acl_maxfiles=Quota mxima de fitxers concedible acl_unlimited=Illimitada activate_eallow=No tens perms per activar o desactivar quotes en aquest sistema de fitxers activate_eon=No he pogut activar les quotes activate_eoff=No he pogut desactivar les quotes check_title=Comprovaci de Quotes check_return=a la llista $1 check_ecannot=No pots verificar les quotes d'aquest sistema de fitxers check_running=Ara s'est executant l'ordre quotacheck per verificar l's dels blocs i els fitxers a $1. Aix pot trigar molt si el sistema de fitxers s molt gran... check_done=...Fet. check_rgroup=grup check_ruser=usuari cgroup_efail=No he pogut copiar les quotes cgroup_ecannot=No pots copiar quotes cgroup_egallow=No tens perms per copiar les quotes d'aquest grup cgroup_enogroup=No ha cap grup de destinaci cgroup_eallowto=No tens perms per copiar quotes a '$1' cgform_title=Cpia de Quotes cgform_return=a la quota de grup cgform_ecannot=No pots copiar quotes cgform_egroup=No tens perms per copiar les quotes d'aquest grup cgform_copyto=Copia les quotes de $1 de TOTS els sistemes de fitxers a... cgform_all=Tots els grups del sistema cgform_select=Grups seleccionats cgform_contain=Grups que contenen els usuaris cgform_doit=Copia cuser_efail=No he pogut copiar les quotes cuser_ecannot=No pots copiar quotes cuser_euallow=No tens perms per copiar les quotes d'aquest usuari cuser_enouser=No ha cap usuari de destinaci cuser_eallowto=No tens perms per copiar quotes a '$1' cuform_title=Cpia de Quotes cuform_return=a la quota d'usuari cuform_ecannot=No pots copiar quotes cuform_euallow=No tens perms per copiar les quotes d'aquest usuari cuform_copyto=Copia les quotes de $1 de TOTS els sistemes de fitxers a... cuform_all=Tots els usuaris del sistema cuform_select=Usuaris seleccionats cuform_members=Membres dels grups seleccionats cuform_doit=Copia egroup_title=Edici de Quota egroup_freturn=llista de sistemes de fitxers egroup_greturn=llista de grups egroup_eallowgr=No tens perms per editar les quotes de '$1' egroup_eallowfs=No tens perms per editar les quotes d'aquest sistema de fitxers egroup_quotas=Quota de $1 a $2 egroup_bused=Blocs Usats egroup_sblimit=Lmit Lax de Blocs egroup_hblimit=Lmit Estricte de Blocs egroup_fused=Fitxers Usats egroup_sflimit=Lmit Lax de Fitxers egroup_hflimit=Lmit Estricte de Fitxers egroup_update=Actualitza egroup_listall=Llista Totes les Quotes euser_title=Edici de Quota euser_freturn=llista de sistemes de fitxers euser_ureturn=llista d'usuaris euser_eallowus=No tens perms per editar les quotes de '$1' euser_eallowfs=No tens perms per editar les quotes d'aquest sistema de fitxers euser_quotas=Quota de $1 a $2 euser_bused=Blocs Usats euser_bdisk=Blocs Disponibles al Disc euser_sblimit=Lmit Lax de Blocs euser_hblimit=Lmit Estricte de Blocs euser_fused=Fitxers Usats euser_fdisk=Fitxers Disponibles al Disc euser_sflimit=Lmit Lax de Fitxers euser_hflimit=Lmit Estricte de Fitxers euser_update=Actualitza euser_listall=Llista Totes les Quotes gfilesys_title=Quotes de Grup gfilesys_return=a la llista de sistemes de fitxers gfilesys_ecannot=No pots editar les quotes de '$1' gfilesys_all=Totes les Quotes de $1 gfilesys_blocks=Blocs gfilesys_files=Fitxers gfilesys_fs=Sistema de fitxers gfilesys_used=Usat gfilesys_soft=Lmit Lax gfilesys_hard=Lmit Estricte gfilesys_nogquota=El grup $1 no t quotes a cap sistema de fitxers gfilesys_edit=Edita la Quota a: gfilesys_copy=Copia les Quotes ggracef_title=Perodes de Grcia ggracef_return=a la llista de grups ggracef_ecannot=No pots editar els perodes de grcia en aquest sistema de fitxers ggracef_info=Cada sistema de fitxers t un periode de grcia per a les quotes de blocs i fitxers. El periode de grcia determina quant temps pot estar un grup per damunt del lmit de programari abans no se li permeti de seguir creant fitxers. ggracef_graces=Perodes de Grcia de Grup de $1 ggracef_block=De la quota de blocs ggracef_file=De la quota de fitxers ggracef_update=Actualitza ggraces_esave=No he pogut desar els perodes de grcia ggraces_eedit=No pots editar els perodes de grcia d'aquest sistema de fitxers ggraces_enumber='$1' no s un nmero index_quser=Quotes d'Usuari index_qgroup=Quotes de Grup index_qboth=Quotes d'Usuari i Grup index_active=Activa index_disable=Desactiva les Quotes index_inactive=Inactiva index_enable=Activa les Quotes index_mountonly=Noms es pot activar en muntar index_title=Quotes de Disc index_fs=Sistema de fitxers index_type=Tipus index_mount=Muntat des de index_status=Estat index_action=Acci index_return=a l'ndex index_euser=Edita les Quotes d'Usuari: index_egroup=Edita les Quotes de Grup: index_nosupport=No hi ha cap sistema de fitxers local que suporti quotes lgroups_failed=No he pogut llistar els grups lgroups_eallow=No tens perms per editar les quotes d'aquest sistema de fitxers lgroups_title=Quotes de Sistema de Fitxers lgroups_return=a la llista de sistemes de fitxers lgroups_toomany=Hi ha massa grups amb quotes a $1 per mostrar-los en una sola pgina lgroups_quotas=Totes les quotes de grups de $1 lgroups_blocks=Blocs lgroups_files=Fitxers lgroups_group=Grup lgroups_used=Usat lgroups_soft=Lmit Lax lgroups_hard=Lmit Estricte lgroups_noquota=No hi cap grup amb quotes a $1 lgroups_equota=Edita la Quota de: lgroups_grace=Edita els Perodes de Grcia lgroups_check=Comprova les Quotes sgroup_egroup=No tens perms per editar les quotes d'aquest grup sgroup_efs=No tens perms per editar les quotes d'aquest sistema de fitxers ssync_ecannot=No tens perms per establir la quota per defecte d'aquest sistema de fitxers suser_euser=No tens perms per editar les quotes d'aquest usuari suser_efs=No tens perms per editar les quotes d'aquest sistema de fitxers suser_emaxblocks=No tens perms per concedir lmits de blocs per sobre de $1 suser_emaxfiles=No tens perms per concedir lmits de fitxers per sobre de $1 ufilesys_title=Quotes d'Usuari ufilesys_return=a la llista de sistemes de fitxers ufilesys_ecannot=No pots editar les quotes de '$1' ufilesys_all=Totes les Quotes de $1 ufilesys_blocks=Blocs ufilesys_files=Fitxers ufilesys_fs=Sistema de fitxers ufilesys_used=Usat ufilesys_soft=Lmit Lax ufilesys_hard=Lmit Estricte ufilesys_nouquota=L'usuari $1 no t quotes a cap sistema de fitxers ufilesys_edit=Edita la Quota de: ufilesys_copy=Copia les Quotes ugracef_title=Perodes de Grcia ugracef_return=a la llista d'usuaris ugracef_ecannot=No pots editar els perodes de grcia d'aquest sistema de fitxers ugracef_info=Cada sistema de fitxers t un periode de grcia per a les quotes de blocs i fitxers. El periode de grcia determina quant temps pot estar un usuari per damunt del lmit de programari abans no se li permeti de seguir creant fitxers. ugracef_graces=Perodes de Grcia d'Usuari de $1 ugracef_block=De la quota de blocs ugracef_file=De la quota de fitxers ugracef_update=Actualitza ugraces_esave=No he pogut desar els perodes de grcia ugraces_eedit=No pots editar els perodes de grcia d'aquest sistema de fitxers ugraces_enumber='$1' no s un nmero lusers_failed=No he pogut llistar els usuaris lusers_eallow=No tens perms per editar les quotes d'aquest sistema de fitxers lusers_title=Quotes de Sistema de Fitxers lusers_return=a la llista de sistemes de fitxers lusers_toomany=Hi ha massa usuaris amb quotes a $1 per mostrar-los en una sola pgina lusers_qoutas=Totes les quotes d'usuaris de $1 lusers_blocks=Blocs lusers_files=Fitxers lusers_user=Usuari lusers_used=Usat lusers_soft=Lmit Lax lusers_hard=Lmit Estricte lusers_noquota=No hi ha cap usuari amb quotes a $1 lusers_equota=Edita la Quota de: lusers_egrace=Edita els Perodes de Grcia lusers_check=Comprova les Quotes lusers_info=Webmin es pot configurar per establir automticament les quotes d'aquest sistema de fitxers quan es crea un nou usuari Unix. Aix funcionar noms quan es faci servir el mdul $1 de Webmin per afegir usuaris. lusers_useradmin=Usuaris i Grups lusers_newuser=Noves Quotes d'Usuari lusers_sblimit=Lmit Lax de Blocs lusers_hblimit=Lmit Estricte de Blocs lusers_sflimit=Lmit Lax de Fitxers lusers_hflimit=Lmit Estricte de Fitxers lusers_apply=Aplica grace_seconds=Segons grace_minutes=Minuts grace_hours=Hores grace_days=Dies grace_weeks=Setmanes grace_months=Mesos log_activate_u=He activat les quotes d'usuari a $1 log_activate_g=He activat les quotes de grup a $1 log_activate_ug=He activat les quotes d'usuari i grup a $1 log_deactivate_u=He desactivat les quotes d'usuari a $1 log_deactivate_g=He desactivat les quotes de grup a $1 log_deactivate_ug=He desactivat les quotes d'usuari i grup a $1 log_save=He canviat les quotes de $1 a $2 log_sync=He canviat les noves quotes d'usuari a $1 log_grace_u=He canviat els perodes de grcia d'usuari a $1 log_grace_g=He canviat els perodes de grcia de grup a $1 log_check=He comprovat les quotes de $1 log_copy_u=He copiat les quotes de l'usuari $1 log_copy_g=He copiat les quotes del grup $1 quota/lang/fr0100644000567100000120000002426407354734747013177 0ustar jcameronwheelquota_unlimited=Illimit acl_fss=Systmes de fichiers que cet utilisateur peut diter acl_fall=Tous les systmes de fichiers acl_fsel=Slctionns ... acl_quotaon=Peut activer et dsactiver les quotas ? acl_quotanew=Peut configurer les quotas pour les nouveaux utilisateurs ? acl_ugrace=Peut diter les dlais des utilisateurs ? acl_vtotal=Peut voir l'espace disque total ? acl_ggrace=Peut diter les dlais des groupes ? acl_uquota=Utilisateurs pour lesquels cet utilisateur peut diter les quotas acl_gquota=Groupes pour lesquels cet utilisateur peut diter les quotas acl_uall= Tous les utilisateurs acl_uonly= Seulement les utilisateurs acl_uexcept= Tous les utilisateurs excepts acl_ugroup= Utilisateurs avec le groupe primaire acl_gall= Tous les groupes acl_gnone= Aucun goupe acl_gonly= Seulement les groupes acl_gexcept= Tous les groupes excepts acl_uuid=Utilisateurs avec l'UID dans l'intervalle acl_maxblocks=Quota blocs accordables maximum acl_maxfiles=Quota fichiers accordables maximum acl_unlimited=Illimit activate_eallow=Vous n'avez pas le droit d'activer ou de dsactiver les quotas sur ce systme de fichiers activate_eon=Echec de l'activation des quotas activate_eoff=Echec de la dsactivation des quotas check_title=Vrifier les quotas check_return=liste $1 check_ecannot=Vous ne pouvez pas vrifier les quotas sur ce systme de fichiers check_running=La commande quotacheck est maintenant lance pour vrifier l'utilisation des blocs et fichiers sur $1. Cela peut prendre longtemps pour un systme de fichiers trs grand ... check_done=... Fait. check_rgroup=groupe check_ruser=utilisateur cgroup_efail=Echec de la copie des quotas cgroup_ecannot=Vous ne pouvez pas copier les quotas cgroup_egallow=Vous n'avez pas le droit de copier les quotas de ce groupe cgroup_enogroup=Pas de groupes vers lesquels copier cgroup_eallowto=Vous n'avez pas le droit de copier les quotas vers '$1' cgform_title=Copier les quotas cgform_return=quota de groupe cgform_ecannot=Vous ne pouvez pas copier les quotas cgform_egroup=Vous n'avez pas le droit de copier les quotas de ce groupe cgform_copyto=Copier les quotas de $1 sur TOUS les systmes de fichiers vers ... cgform_all=Tous les groupes sur votre systme cgform_select=Groupes slectionns cgform_contain=Groupes contenant les utilisateurs cgform_doit=Copier cuser_efail=Echec de la copie des quotas cuser_ecannot=Vous ne pouvez pas copier les quotas cuser_euallow=Vous n'avez pas le droit de copier les quotas de cet utilisateur cuser_enouser=Pas d'utilisateurs vers lesquels copier cuser_eallowto=Vous n'avez pas le droit de copier les quotas vers '$1' cuform_title=Copier les quotas cuform_return=quota utilisateur cuform_ecannot=Vous ne pouvez pas copier les quotas cuform_euallow=Vous n'avez pas le droit de copier les quotas de cet utilisateur cuform_copyto=Copier les quotas de $1 sur TOUS les systmes de fichiers vers ... cuform_all=Tous les utilisateurs sur votre systme cuform_select=Utilisateurs slectionns cuform_members=Membres des groupes slectionns cuform_doit=Copier egroup_title=Editer le quota egroup_freturn=liste des systmes de fichiers egroup_greturn=liste des groupes egroup_eallowgr=Vous n'tes pas autoris diter les quotas de '$1' egroup_eallowfs=Vous n'tes pas autoris diter les quotas sur ce systme de fichiers egroup_quotas=Quota de $1 sur $2 egroup_bused=Blocs utiliss egroup_sblimit=Limite douce de blocs egroup_hblimit=Limite dure de blocs egroup_fused=Fichiers utiliss egroup_sflimit=Limite douce de fichiers egroup_hflimit=Limite dure de fichiers egroup_update=Mise jour egroup_listall=Afficher tous les quotas euser_title=Editer le quota euser_freturn=liste des systmes de fichiers euser_ureturn=liste des utilisateurs euser_eallowus=Vous n'tes pas autoris diter les quotas de '$1' euser_eallowfs=Vous n'tes pas autoris diter les quotas sur ce systme de fichiers euser_quotas=Quota de $1 sur $2 euser_bused=Blocs utiliss euser_bdisk=Blocs disponibles sur le disque euser_sblimit=Limite douce de blocs euser_hblimit=Limite dure de blocs euser_fused=Fichiers utiliss euser_fdisk=Fichiers disponibles sur le disque euser_sflimit=Limite douce de fichiers euser_hflimit=Limite dure de fichiers euser_update=Mise jour euser_listall=Afficher tous les quotas gfilesys_title=Quotas de groupe gfilesys_return=liste des systmes de fichiers gfilesys_ecannot=Vous n'tes pas autoris diter les quotas de '$1' gfilesys_all=Tous les quotas pour gfilesys_blocks=Blocs gfilesys_files=Fichiers gfilesys_fs=Systme de fichiers gfilesys_used=Utilis gfilesys_soft=Limite douce gfilesys_hard=Limite dure gfilesys_nogquota=Le groupe $1 n'a de quota sur aucun systme de fichiers gfilesys_edit=Editer les quotas sur: gfilesys_copy=Copier les quotas ggracef_title=Dlais ggracef_return=liste de groupes ggracef_ecannot=Vous ne pouvez pas diter les dlais sur ce systme de fichiers ggracef_info=Chaque systme de fichiers a un dlai pour les quotas de blocs et de fichiers. Le dlai dtermine combien de temps un groupe peut rester au-dessus de la limite douce avant qu'aucun fichier ne puisse plus tre crer. ggracef_graces=Dlais de groupe de $1 ggracef_block=Pour quota bloc ggracef_file=Pour quota fichier ggracef_update=Mise jour ggraces_esave=Echec de la sauvegarde des dlais ggraces_eedit=Vous ne pouvez pas diter les dlais sur ce systme de fichiers ggraces_enumber='$1' n'est pas un nombre index_quser=Quotas utilisateurs index_qgroup=Quotas groupes index_qboth=Quotas utilisateurs et groupes index_active=Actifs index_disable=Dsactiver les quotas index_inactive=Inactifs index_enable=Activer les quotas index_title=Quotas disques index_fs=Systme de fichiers index_type=Type index_mount=Mont depuis index_status=Statut index_action=Action index_return=index index_euser=Editer les quotas utilisateur: index_egroup=Editer les quotas groupe: index_nosupport=Aucun systme de fichiers local ne peut supporter de quotas lgroups_failed=Echec du listage des groupes lgroups_eallow=Vous n'tes pas autoris diter les quotas sur ce systme de fichiers lgroups_title=Quotas des systmes de fichiers lgroups_return=liste des systmes de fichiers lgroups_toomany=Trop de groupes ont des quotas sur $1 pour tre affichs sur une page lgroups_quotas=Tous les quotas de groupe sur $1 lgroups_blocks=Blocs lgroups_files=Fichiers lgroups_group=Groupe lgroups_used=Utiliss lgroups_soft=Limite douce lgroups_hard=Limite dure lgroups_noquota=Aucun groupe n'a de quotas sur $1 lgroups_equota=Editer le quota de: lgroups_grace=Editer les dlais lgroups_check=Vrifier les quotas sgroup_egroup=Vous n'tes pas autoris diter les quotas de ce groupe sgroup_efs=Vous n'tes pas autoris diter les quotas de ce systme de fichiers ssync_ecannot=Vous ne pouvez pas rgler le quota par dfaut de ce systme de fichiers suser_euser=Vous n'tes pas autoris diter les quotas pour cet utilisateur suser_efs=Vous n'tes pas autoris diter les quotas sur ce systme de fichiers suser_emaxblocks=Vous n'tes pas autoris accorder des limites de blocs au-dessus de $1 suser_emaxfiles=Vous n'tes pas autoris accorder des limites de fichiers au-dessus de $1 ufilesys_title=Quotas utilisateur ufilesys_return=liste de systmes de fichiers ufilesys_ecannot=Vous ne pouvez pas diter les quotas de '$1' ufilesys_all=Tous les quotas de $1 ufilesys_blocks=Blocs ufilesys_files=Fichiers ufilesys_fs=Systme de fichiers ufilesys_used=Utiliss ufilesys_soft=Limite douce ufilesys_hard=Limite dure ufilesys_nouquota=L'utilisateur $1 n'a de quotas sur aucun systme de fichiers ufilesys_edit=Editer le quota sur: ufilesys_copy=Copier les quotas ugracef_title=Dlais ugracef_return=liste d'utilisateurs ugracef_ecannot=Vous ne pouvez pas diter les dlais sur ce systme de fichiers ugracef_info=Chaque systme de fichiers a un dlai pour les quotas blocs et fichiers. Le dlai dtermine combien de temps un utilisateur peut rester au-dessus de la limite douce avant qu'il ne soit plus autoris crer de fichiers. ugracef_graces=Dlais utilisateur pour $1 ugracef_block=Pour le quota blocs ugracef_file=Pour le quota fichiers ugracef_update=Mettre jour ugraces_esave=Echec de la sauvegarde des dlais ugraces_eedit=Vous ne pouvez pas diter les dlais sur ce systme de fichiers ugraces_enumber='$1' n'est pas un nombre lusers_failed=Echec du listage des utilisateurs lusers_eallow=Vous n'avez pas le droit d'diter les quotas sur ce systme de fichiers lusers_title=Quotas des systmes de fichiers lusers_return=liste des systmes de fichiers lusers_toomany=Trop d'utilisateurs ont des quotas sur $1 pour tre affichs sur une page lusers_qoutas=Tous les quotas utilisateur sur $1 lusers_blocks=Blocs lusers_files=Fichiers lusers_user=Utilisateur lusers_used=Utiliss lusers_soft=Limite douce lusers_hard=Limite dure lusers_noquota=Aucun utilisateur n'a de quotas sur $1 lusers_equota=Editer le quota pour: lusers_egrace=Editer les dlais lusers_check=Vrifier les quotas lusers_info=Webmin peut tre configur pour rgler automatiquement les quotas sur ce systme de fichiers quand un nouvel utilisateur Unix est cr. Ceci fonctionnera seulement si le modules Webmin $1 est utilis pour ajouter des utilisateurs. lusers_useradmin=Utilisateurs et groupes lusers_newuser=Nouveau quota utilisateur lusers_sblimit=Limite douce de blocs lusers_hblimit=Limite dure de blocs lusers_sflimit=Limite douce de fichiers lusers_hflimit=Limite dure de fichiers lusers_apply=Appliquer grace_seconds=Secondes grace_minutes=Minutes grace_hours=Heures grace_days=Jours grace_weeks=Semaines grace_months=Mois log_activate_u=Quotas utilisateur activs sur $1 log_activate_g=Quotas groupe activs sur $1 log_activate_ug=Quotas utilisateur et groupe activs sur $1 log_deactivate_u=Quotas utilisateur dsactivs sur $1 log_deactivate_g=Quotas groupe dsactivs sur $1 log_deactivate_ug=Quotas utilisateur et groupe dsactivs sur $1 log_save=Quotas modifis pour $1 sur $2 log_sync=Nouveaux quotas utilisateur modifis sur $1 log_grace_u=Dlais utilisateur modifis sur $1 log_grace_g=Dlais groupe modifis sur $1 log_check=Quotas vrifis sur $1 log_copy_u=Quotas de l'utilisateur $1 copis log_copy_g=Quotas du groupe $1 copis quota/lang/nl0100644000567100000120000002252107432705645013163 0ustar jcameronwheelquota_unlimited=Onbeperkt acl_fss=Bestandsystemen die deze gebruiker kan wijzigen acl_fall=Alle bestandsystemen acl_fsel=Geselecteerd.. acl_quotaon=Kan quota aan- en uitzetten? acl_quotanew=Kan quotum configureren voor nieuwe gebruikers? acl_ugrace=Kan waarschuwingstijd van gebruiker wijzigen? acl_vtotal=Kan totale schijfcapaciteit zien? acl_ggrace=Kan waarschuwingstijd van groepen wijzigen? acl_uquota=Gebruikers, waarvan deze gebruiker het quotum kan wijzigen acl_gquota=Groepen, waarvan deze gebruiker het quotum kan wijzigen acl_uall= Alle gebruikers acl_uonly= Alleen gebruikers acl_uexcept= Alle gebruikers behalve acl_ugroup= Gebruikers met primaire groep acl_gall= Alle groepen acl_gnone= Geen groepen acl_gonly= Alleen groepen acl_gexcept= Alle groepen behalve acl_uuid=Gebruikers met UID binnen bereik acl_maxblocks=Maximum toe te wijzen blokquotum acl_maxfiles=Maximum toe te wijzen bestandsquotum acl_unlimited=Onbeperkt activate_eallow=U bent niet gerechtigd quota voor dit bestandssyteem aan- of uit te zetten activate_eon=Het aanzetten van quota is mislukt activate_eoff=Het uitzetten van quota is mislukt check_title=Controleer Quotum check_return=$1 lijst check_ecannot=U mag de quota voor dit bestandssyteem niet controleren check_running=Het quotacheck commando wordt nu uitgevoerd om het verbruik aan blokken en bestanden te controleren op $1. Dit kan een geruime tijd duren voor een groot bestandssyteem... check_done=... Klaar. check_rgroup=groep check_ruser=gebruiker cgroup_efail=Kopieren van quotum mislukt cgroup_ecannot=U kunt geen quotum kopieren cgroup_egallow=U mag het quotum van deze groep niet kopieren cgroup_enogroup=Geen groepen om naar te kopieren cgroup_eallowto=U mag geen quotum kopieren naar '$1' cgform_title=Kopier Quotum cgform_return=groep quotum cgform_ecannot=U kunt geen quotum kopieren cgform_egroup=U mag het quotum van deze groep niet kopieren cgform_copyto=Kopieren van quotum voor $1 op ALLE bestandsystemen naar ... cgform_all=Alle groepen op uw systeem cgform_select=Geselecteerde groepen cgform_contain=Groepen met gebruikers cgform_doit=Kopier cuser_efail=Kopieren van quotum mislukt cuser_ecannot=U kunt geen quotum kopieren cuser_euallow=U mag het quotum van deze gebruiker niet kopieren cuser_enouser=Geen gebruikers om naar te kopieren cuser_eallowto=U mag geen quotum kopieren naar '$1' cuform_title=Kopier Quotum cuform_return=gebruiker quotum cuform_ecannot=U kunt geen quotum kopieren cuform_euallow=U mag het quotum van deze gebruiker niet kopieren cuform_copyto=Kopieren van quotum voor $1 op ALLE bestandsystemen naar ... cuform_all=Alle gebruikers op uw systeem cuform_select=Geselecteerde gebruikers cuform_members=Leden van geselecteerde groepen cuform_doit=Kopier egroup_title=Wijzig Quotum egroup_freturn=lijst van bestandsysteem egroup_greturn=groep lijst egroup_eallowgr=U mag geen quotum wijzigen voor '$1' egroup_eallowfs=U mag geen quotum wijzigen op dit bestandsysteem egroup_quotas=Quotum voor $1 op $2 egroup_bused=Gebruikte blokken egroup_sblimit=Zachte Bloklimiet egroup_hblimit=Harde Bloklimiet egroup_fused=Gebruikte Bestanden egroup_sflimit=Zachte Bestandslimiet egroup_hflimit=Harde Bestandslimiet egroup_update=Wijzig egroup_listall=Lijst Alle Quota euser_title=Wijzig Quotum euser_freturn=bestandsysteem lijst euser_ureturn=gebruikers lijst euser_eallowus=U mag geen quotum wijzigen voor '$1' euser_eallowfs=U mag geen quotum wijzigen op dit bestandsysteem euser_quotas=Quotum voor $1 op $2 euser_bused=Gebruikte blokken euser_bdisk=Beschikbare Blokken op Disk euser_sblimit=Zachte Bloklimiet euser_hblimit=Harde Bloklimiet euser_fused=Gebruikte Bestanden euser_fdisk=Beschikbare Bestanden op Disk euser_sflimit=Zachte Bestandslimiet euser_hflimit=Harde Bestandslimiet euser_update=Wijzig euser_listall=Lijst Alle Quota gfilesys_title=Groep Quota gfilesys_return=bestandsystemen lijst gfilesys_ecannot=U kan geen quotum wijzigen voor '$1' gfilesys_all=Alle Quota voor gfilesys_blocks=Blokken gfilesys_files=Bestanden gfilesys_fs=Bestandsysteem gfilesys_used=Gebruikt gfilesys_soft=Zachte Limiet gfilesys_hard=Harde Limiet gfilesys_nogquota=Groep $1 quota op geen enkel bestandsysteem gfilesys_edit=Wijzig Quotum Op: gfilesys_copy=Kopier Quota ggracef_title=Waarschuwingstijd ggracef_return=groepslijst ggracef_ecannot=U mag de waarschuwingstijd niet wijzigen op dit bestandsysteem ggracef_info=Elk bestandsysteem heeft een waarschuwingstijd voor blok- and bestandsquota. De waarschuwingstijd bepaalt hoe lang een groep boven de zachte limiet kan zijn voordat er geen bestanden meer kunnen worden aangemaakt. ggracef_graces=Groeps waarschuwingstijd voor $1 ggracef_block=Voor Blokquotum ggracef_file=Voor Bestandsquotum ggracef_update=Wijzigen ggraces_esave=Opslaan waarschuwingstijd mislukt ggraces_eedit=U kunt de waarschuwingstijd niet wijzigen op dit bestandsysteem ggraces_enumber='$1' is geen getal index_quser=Gebruikers Quota index_qgroup=Groeps Quota index_qboth=Gebruikers- and Groeps Quota index_active=Aktief index_disable=Quota Uitzetten index_inactive=Inaktief index_enable=Quota Aanzetten index_title=Disk Quota index_fs=Bestandsysteem index_type=Type index_mount=gemount vanaf index_status=Status index_action=Aktie index_return=index index_euser=Wijzig Gebruikers Quota: index_egroup=Wijzig Groeps Quota: index_nosupport=Geen enkel lokaal bestandsysteem ondersteunt quota lgroups_failed=Lijst van groepen mislukt lgroups_eallow=U mag geen quotum wijzigen op dit bestandsysteem lgroups_title=Bestandsysteem Quota lgroups_return=bestandsystemen lijst lgroups_toomany=Te veel groepen hebben quota op $1 om op n pagina te tonen lgroups_quotas=Alle Groeps Quota op $1 lgroups_blocks=Blokken lgroups_files=bestanden lgroups_group=Groep lgroups_used=gebruikt lgroups_soft=Zachte Limiet lgroups_hard=Harde Limiet lgroups_noquota=Er zijn geen groepen met quota op $1 lgroups_equota=Wijzig Quotum For: lgroups_grace=Wijzig Waarschuwingstijd lgroups_check=Controleer Quota sgroup_egroup=U mag geen quotum wijzigen voor deze groep sgroup_efs=U mag geen quotum wijzigen op dit bestandsysteem ssync_ecannot=U mag het 'default' quotum voor dit bestandsysteem niet wijzigen suser_euser=U mag geen quotum wijzigen voor deze gebruiker suser_efs=U mag het quotum voor dit bestandsysteem niet wijzigen suser_emaxblocks=U mag geen bloklimiet boven $1 instellen suser_emaxfiles=U mag geen bestandenlimiet boven $1 instellen ufilesys_title=Gebruikers Quota ufilesys_return=bestandsystemen lijst ufilesys_ecannot=U kan geen quotum wijzigen voor '$1' ufilesys_all=All Quota voor $1 ufilesys_blocks=Blokken ufilesys_files=Bestanden ufilesys_fs=Bestandssysteem ufilesys_used=Gebruikt ufilesys_soft=Zachte Limiet ufilesys_hard=Harde Limiet ufilesys_nouquota=Gebruiker $1 heeft quota op geen enkel bestandssysteem ufilesys_edit=Wijzig Quotum Op: ufilesys_copy=Kopier Quota ugracef_title=Waarschuwingstijd ugracef_return=gebruiker lijst ugracef_ecannot=U kunt de waarschuwingstijd op dit bestandssysteem niet wijzigen ugracef_info=Elk bestandsysteem heeft een waarschuwingstijd voor blok- and bestandsquota. De waarschuwingstijd bepaalt hoe lang een groep boven de zachte limiet kan zijn voordat er geen bestanden meer kunnen worden aangemaakt. ugracef_graces=Gebruiker Waarschuwingstijd voor $1 ugracef_block=Voor blokquotum ugracef_file=Voor bestandsquotum ugracef_update=Wijzigen ugraces_esave=Opslaan waarschuwingstijd mislukt ugraces_eedit=U kunt de waarschuwingstijd op dit bestandssysteem niet wijzigen ugraces_enumber='$1' is geen getal lusers_failed=Gebruikerslijst mislukt lusers_eallow=U mag geen quotum wijzigen op dit bestandsysteem lusers_title=Quota Bestandssysteem lusers_return=bestandsystemen lijst lusers_toomany=Te veel gebruikers hebben quotum op $1 om op n pagina te tonen lusers_qoutas=Quota alle gebruikers op $1 lusers_blocks=Blokken lusers_files=Bestanden lusers_user=Gebruiker lusers_used=Gebruikt lusers_soft=Zachte Limiet lusers_hard=Harde Limiet lusers_noquota=Er zijn geen gebruikers met quota op $1 lusers_equota=Wijzig Quotum voor: lusers_egrace=Wijzig Waarschuwingstijd lusers_check=Controleer Quota lusers_info=Webmin kan worden geconfigureerd om automatisch de quota te zetten op dit bestandssysteem als een nieuwe Unix gebruiker wordt aangemaakt. Dit werkt alleen als het $1 Webmin module wordt gebruikt om gebruikers aan te maken. lusers_useradmin=Gebruikers and Groepen lusers_newuser=Nieuw Gebruikers Quotum lusers_sblimit=Zachte Blok Limiet lusers_hblimit=Harde Blok Limiet lusers_sflimit=Zachte Bestands Limiet lusers_hflimit=Harde Bestands Limiet lusers_apply=Toepassen grace_seconds=Seconden grace_minutes=Minuten grace_hours=Uren grace_days=Dagen grace_weeks=Weken grace_months=Maanden log_activate_u=Gebruikersquota op $1 aangezet log_activate_g=Groepsquota op $1 aangezet log_activate_ug=Gebruikers- en groepsquota op $1 aangezet log_deactivate_u==Gebruikersquota op $1 uitgezet log_deactivate_g=Groepsquota op $1 uitgezet log_deactivate_ug=Gebruikers- en groepsquota op $1 uitgezet log_save=Quota voor $1 op $2 gewijzigd log_sync=Nieuw gebruikersquotum op $1 gewijzigd log_grace_u=Gebruikers waarschuwingstijd op $1 gewijzigd log_grace_g=Groeps waarschuwingstijd op $1 gewijzigd log_check=Quota op $1 gecontroleerd log_copy_u=Quota van gebruiker $1 gekopierd log_copy_g=Quota van groep $1 gekopierd quota/lang/en.bak0100644000567100000120000002055607440573627013720 0ustar jcameronwheelquota_unlimited=Unlimited acl_fss=Filesystems this user can edit acl_fall=All filesystems acl_fsel=Selected.. acl_quotaon=Can enable and disable quotas? acl_quotanew=Can configure quotas for new users? acl_ugrace=Can edit user grace times? acl_vtotal=Can view total disk space? acl_ggrace=Can edit group grace times? acl_uquota=Users this user can edit quotas for acl_gquota=Groups this user can edit quotas for acl_uall= All users acl_uonly= Only users acl_uexcept= All except users acl_ugroup= Users with primary group acl_gall= All groups acl_gnone= No groups acl_gonly= Only groups acl_gexcept= All except groups acl_uuid=Users with UID in range acl_maxblocks=Maximum grantable block quota acl_maxfiles=Maximum grantable file quota acl_unlimited=Unlimited activate_eallow=You are not allowed to enable or disable quotas on this filesystem activate_eon=Failed to turn on quotas activate_eoff=Failed to turn off quotas check_title=Check Quotas check_return=$1 list check_ecannot=You cannot check quotas on this filesystem check_running=The quotacheck command is now being run to check the block and file usage on $1. This may take a long time for a very large filesystem... check_done=... Done. check_rgroup=group check_ruser=user cgroup_efail=Failed to copy quotas cgroup_ecannot=You cannot copy quotas cgroup_egallow=You are not allowed to copy the quotas of this group cgroup_enogroup=No groups to copy to cgroup_eallowto=You are not allowed to copy quotas to '$1' cgform_title=Copy Quotas cgform_return=group quota cgform_ecannot=You cannot copy quotas cgform_egroup=You are not allowed to copy the quotas of this group cgform_copyto=Copy quotas for $1 on ALL filesystems to ... cgform_all=All groups on your system cgform_select=Selected groups cgform_contain=Groups containing users cgform_doit=Copy cuser_efail=Failed to copy quotas cuser_ecannot=You cannot copy quotas cuser_euallow=You are not allowed to copy the quotas of this user cuser_enouser=No users to copy to cuser_eallowto=You are not allowed to copy quotas to '$1' cuform_title=Copy Quotas cuform_return=user quota cuform_ecannot=You cannot copy quotas cuform_euallow=You are not allowed to copy the quotas of this user cuform_copyto=Copy quotas for $1 on ALL filesystems to ... cuform_all=All users on your system cuform_select=Selected users cuform_members=Members of selected groups cuform_doit=Copy egroup_title=Edit Quota egroup_freturn=filesystem list egroup_greturn=group list egroup_eallowgr=You are not allowed to edit quotas for '$1' egroup_eallowfs=You are not allowed to edit quotas on this filesystem egroup_quotas=Quota for $1 on $2 egroup_bused=Blocks Used egroup_sblimit=Soft Block Limit egroup_hblimit=Hard Block Limit egroup_fused=Files Used egroup_sflimit=Soft File Limit egroup_hflimit=Hard File Limit egroup_update=Update egroup_listall=List All Quotas euser_title=Edit Quota euser_freturn=filesystem list euser_ureturn=user list euser_eallowus=You are not allowed to edit quotas for '$1' euser_eallowfs=You are not allowed to edit quotas on this filesystem euser_quotas=Quota for $1 on $2 euser_bused=Blocks Used euser_bdisk=Available Blocks on Disk euser_sblimit=Soft Block Limit euser_hblimit=Hard Block Limit euser_fused=Files Used euser_fdisk=Available Files on Disk euser_sflimit=Soft File Limit euser_hflimit=Hard File Limit euser_update=Update euser_listall=List All Quotas gfilesys_title=Group Quotas gfilesys_return=filesystems list gfilesys_ecannot=You cannot edit quotas for '$1' gfilesys_all=All Quotas for $1 gfilesys_blocks=Blocks gfilesys_files=Files gfilesys_fs=Filesystem gfilesys_used=Used gfilesys_soft=Soft Limit gfilesys_hard=Hard Limit gfilesys_nogquota=Group $1 does not have quotas on any filesystem gfilesys_edit=Edit Quota On: gfilesys_copy=Copy Quotas ggracef_title=Grace Times ggracef_return=group list ggracef_ecannot=You cannot edit grace times on this filesystem ggracef_info=Each filesystem has a grace time for block and file quotas. The grace time determines how long a group can remain over the soft limit before no more files are allowed to be created. ggracef_graces=Group Grace Times for $1 ggracef_block=For block quota ggracef_file=For file quota ggracef_update=Update ggraces_esave=Failed to save grace times ggraces_eedit=You cannot edit grace times on this filesystem ggraces_enumber='$1' is not a number index_quser=User Quotas index_qgroup=Group Quotas index_qboth=User and Group Quotas index_active=Active index_disable=Disable Quotas index_inactive=Inactive index_enable=Enable Quotas index_mountonly=Enabled at mount index_title=Disk Quotas index_fs=Filesystem index_type=Type index_mount=Mounted From index_status=Status index_action=Action index_return=index index_euser=Edit User Quotas: index_egroup=Edit Group Quotas: index_nosupport=No local filesystems can support quotas lgroups_failed=Failed to list groups lgroups_eallow=You are not allowed to edit quotas on this filesystem lgroups_title=Filesystem Quotas lgroups_return=filesystems list lgroups_toomany=Too many groups have quotas on $1 to display on one page lgroups_quotas=All Group Quotas on $1 lgroups_blocks=Blocks lgroups_files=Files lgroups_group=Group lgroups_used=Used lgroups_soft=Soft Limit lgroups_hard=Hard Limit lgroups_noquota=No groups have quotas on $1 lgroups_equota=Edit Quota For: lgroups_grace=Edit Grace Times lgroups_check=Check Quotas sgroup_egroup=You are not allowed to edit quotas for this group sgroup_efs=You are not allowed to edit quotas on this filesystem ssync_ecannot=You cannot set the default quota for this filesystem suser_euser=You are not allowed to edit quotas for this user suser_efs=You are not allowed to edit quotas on this filesystem suser_emaxblocks=You are not allowed to grant block limits above $1 suser_emaxfiles=You are not allowed to grant file limits above $1 ufilesys_title=User Quotas ufilesys_return=filesystems list ufilesys_ecannot=You cannot edit quotas for '$1' ufilesys_all=All Quotas for $1 ufilesys_blocks=Blocks ufilesys_files=Files ufilesys_fs=Filesystem ufilesys_used=Used ufilesys_soft=Soft Limit ufilesys_hard=Hard Limit ufilesys_nouquota=User $1 does not have quotas on any filesystem ufilesys_edit=Edit Quota On: ufilesys_copy=Copy Quotas ugracef_title=Grace Times ugracef_return=user list ugracef_ecannot=You cannot edit grace times on this filesystem ugracef_info=Each filesystem has a grace time for block and file quotas. The grace time determines how long a user can remain over the soft limit before no more files are allowed to be created. ugracef_graces=User Grace Times for $1 ugracef_block=For block quota ugracef_file=For file quota ugracef_update=Update ugraces_esave=Failed to save grace times ugraces_eedit=You cannot edit grace times on this filesystem ugraces_enumber='$1' is not a number lusers_failed=Failed to list users lusers_eallow=You are not allowed to edit quotas on this filesystem lusers_title=Filesystem Quotas lusers_return=filesystems list lusers_toomany=Too many users have quotas on $1 to display on one page lusers_qoutas=All User Quotas on $1 lusers_blocks=Blocks lusers_files=Files lusers_user=User lusers_used=Used lusers_soft=Soft Limit lusers_hard=Hard Limit lusers_noquota=No users have quotas on $1 lusers_equota=Edit Quota For: lusers_egrace=Edit Grace Times lusers_check=Check Quotas lusers_info=Webmin can be configured to automatically set the quotas on this filesystem when a new Unix user is created. This will only work when the $1 Webmin module is used to add users. lusers_useradmin=Users and Groups lusers_newuser=New User Quotas lusers_sblimit=Soft Block Limit lusers_hblimit=Hard Block Limit lusers_sflimit=Soft File Limit lusers_hflimit=Hard File Limit lusers_apply=Apply grace_seconds=Seconds grace_minutes=Minutes grace_hours=Hours grace_days=Days grace_weeks=Weeks grace_months=Months log_activate_u=Enabled user quotas on $1 log_activate_g=Enabled group quotas on $1 log_activate_ug=Enabled user and group quotas on $1 log_deactivate_u=Disabled user quotas on $1 log_deactivate_g=Disabled group quotas on $1 log_deactivate_ug=Disabled user and group quotas on $1 log_save=Changed quotas for $1 on $2 log_sync=Changed new user quotas on $1 log_grace_u=Changed user grace times on $1 log_grace_g=Changed group grace times on $1 log_check=Checked quotas on $1 log_copy_u=Copied user $1's quotas log_copy_g=Copied group $1's quotas quota/lang/zh_TW.Big50100644000567100000120000001573507504537633014403 0ustar jcameronwheelquota_unlimited=L acl_fss=oӨϥΪ̥is誺ɮרt acl_fall=Ҧɮרt acl_fsel=w.. acl_quotaon=O_iҥΩMκϺаtBH acl_quotanew=O_sϥΪ̰tmϺаtBH acl_ugrace=O_isϥΪ̼eơH acl_vtotal=O_idݺϺ`ŶH acl_ggrace=O_issռeơH acl_uquota=oӨϥΪ̥iHsϺаtBϥΪ̤ acl_gquota=oӨϥΪ̥iHsϺаtBs acl_uall= ҦϥΪ acl_uonly= ȨϥΪ acl_uexcept= ҦϥΪ̡AF acl_ugroup= DsըϥΪ acl_gall= Ҧs acl_gnone= Ss acl_gonly= ȸs acl_gexcept= ҦsաAF acl_uuid=ϥΪ̦b UID dO acl_maxblocks=̤jiΰ϶tB acl_maxfiles=̤jiɮװtB acl_unlimited=L activate_eallow=zSvbɮרtΤWҥΩMκϺаtB activate_eon=}tB activate_eoff=tB check_title=ˬdtB check_return=$1 C check_ecannot=zSvˬdɮרtΪtB check_running={bbquotacheckROHˬd$1WϺа϶MɮתϥαpCjɮרtΡAoݭnܪɶC check_done=... C check_rgroup=s check_ruser=ϥΪ cgroup_efail=ƻstB cgroup_ecannot=zSvƻstB cgroup_egallow=zSvƻsoӸsժtB cgroup_enogroup=Ssեiƻs cgroup_eallowto=zSvƻstB '$1' cgform_title=ƻstB cgform_return=sհtB cgform_ecannot=zSvƻstB cgform_egroup=zSvƻsoӸsժtB cgform_copyto=ƻsҦɮרtΤW$1tB cgform_all=tΤWҦs cgform_select=s cgform_contain=]tϥΪ̪s cgform_doit=ƻs cuser_efail=ƻstB cuser_ecannot=zSvƻstB cuser_euallow=zSvƻsoӨϥΪ̪tB cuser_enouser=SϥΪ̽ƻs cuser_eallowto=zSvƻstB'$1' cuform_title=ƻstB cuform_return=ϥΪ̰tB cuform_ecannot=zSvƻstB cuform_euallow=zSvƻsoӨϥΪ̪tB cuform_copyto=ƻs$1bҥɮרtΪtB ... cuform_all=tΤWҥΨϥΪ cuform_select=ϥΪ cuform_members=sժ cuform_doit=ƻs egroup_title=stB egroup_freturn=ɮרtΦC egroup_greturn=sզC egroup_eallowgr=zSvs '$1'tB egroup_eallowfs=zSvs覹ɮרtΤWtB egroup_quotas=$1b$2WtB egroup_bused=wΰ϶ egroup_sblimit=nɮ׭ egroup_hblimit=wɮ׭ egroup_fused=ϥΪɮ egroup_sflimit=nɮ׭ egroup_hflimit=wɮ׭ egroup_update=s egroup_listall=CXҦtB euser_title=stB euser_freturn=ɮרtΦC euser_ureturn=ϥΪ̦C euser_eallowus=zSvs'$1'tB euser_eallowfs=zSvs襻ɮרtΪtB euser_quotas=$1b$2WtB euser_bused=wΰ϶ euser_bdisk=bϺФWiΪ϶ euser_sblimit=nʰ϶ euser_hblimit=wʰ϶ euser_fused=wɮ euser_fdisk=bϺФWiΪɮ euser_sflimit=nɮ׭ euser_hflimit=wɮ׭ euser_update=s euser_listall=CҥΰtB gfilesys_title=sհtB gfilesys_return=ɮצC gfilesys_ecannot=zSvs'$1'ɮװtB gfilesys_all=ҦtB gfilesys_blocks=϶ gfilesys_files=ɮ gfilesys_fs=ɮרt gfilesys_used=w gfilesys_soft=nʭ gfilesys_hard=wʭ gfilesys_nogquota=s $1 bɮרtΤWStB gfilesys_edit=s譭BG gfilesys_copy=ƻstB ggracef_title=eɶ ggracef_return=sզC ggracef_ecannot=zSvs覹ɮרtΪeɶ ggracef_info=Cɮרtγ϶MɮװtBeɶCeɶMw@ӸsեiBnʭAh[AMAQTsWhɮסC ggracef_graces=$1sռeɶ ggracef_block=϶tB ggracef_file=ɮװtB ggracef_update=s ggraces_esave=Oseɶ ggraces_eedit=zSvs覹ɮרtΪeɶ ggraces_enumber='$1' OƦr index_quser=ϥΪ̰tB index_qgroup=sհtB index_qboth=ϥΪ̩MsհtB index_active=B@ index_disable=ΰtB index_inactive=SB@ index_enable=ҥΰtB index_mountonly=iHubɱҥ index_title=ϺаtB index_fs=ɮרt index_type= index_mount= index_status=A index_action=ʧ@ index_return= index_euser=sϥΪ̰tBG index_egroup=ssհtBG index_nosupport=aɮרtΤ䴩tB lgroups_failed=CXsե lgroups_eallow=zSvsoɮרtΤWtB lgroups_title=ɮרtΰtB lgroups_return=ɮרtΦC lgroups_toomany=b$1WtBsդӦhALkܦb@WC lgroups_quotas=Ҧsզb$1WtB lgroups_blocks=϶ lgroups_files=ɮ lgroups_group=s lgroups_used=w lgroups_soft=nʭ lgroups_hard=wʭ lgroups_noquota=Ssզb$1WtB lgroups_equota=stBG lgroups_grace=seɶ lgroups_check=ˬdtB sgroup_egroup=zSvsoӸsժtB sgroup_efs=zSvsoɮרtΪtB ssync_ecannot=zSv]moɮרtΪʬٰtB suser_euser=zSvsoӨϥΪ̪tB suser_efs=zSvsoɮרtΪtB suser_emaxblocks=zSv϶b$1W suser_emaxfiles=zSvɮ׭b$1W ufilesys_title=ϥΪ̰tB ufilesys_return=ɮרtΦC ufilesys_ecannot=zSvs'$1'tB ufilesys_all=$1ҦtB ufilesys_blocks=϶ ufilesys_files=ɮ ufilesys_fs=ɮרt ufilesys_used=w ufilesys_soft=nʭ ufilesys_hard=wʭ ufilesys_nouquota=ϥΪ$1 bɮרtγStB ufilesys_edit=stBbG ufilesys_copy=ƻstB ugracef_title=eɶ ugracef_return=ϥΪ̦C ugracef_ecannot=zSvs襻ɮרtΪeɶ ugracef_info=Cɮרtγ϶MɮװtBeɶCeɶMw@ӨϥΪ̥iBnʭAh[AMAQTsWhɮסC ugracef_graces=$1ϥΪ̼eɶ ugracef_block=϶tB ugracef_file=ɮװtB ugracef_update=s ugraces_esave=Oseɶ ugraces_eedit=zSvs襻ɮרtΤWeɶ ugraces_enumber='$1' OƦr lusers_failed=CXϥΪ̥ lusers_eallow=zSvs襻ɮרtΤWtB lusers_title=ɮרtΰtB lusers_return=ɮרtΦC lusers_toomany=b$1WtBϥΪ̤ӦhALkܦb@WC lusers_qoutas=$1WҦϥΪ̰tB lusers_blocks=϶ lusers_files=ɮ lusers_user=ϥΪ lusers_used=w lusers_soft=nʭ lusers_hard=wʭ lusers_noquota=SϥΪ̦b$1 WtB lusers_equota=stBwG lusers_egrace=seɶ lusers_check=ˬdtB lusers_info=Webmin iHtmbsWs Unix ϥΪ̮ɦ۰ʦbɮרtΤW]wtBCubϥ $1 Webmin ҸsեΨӷsWϥΪ̮ɤ~o˰C lusers_useradmin=ϥΪ̩Ms lusers_newuser=sϥΪ̰tB lusers_sblimit=nʭ lusers_hblimit=wʭ lusers_sflimit=nɮ׭ lusers_hflimit=wɮ׭ lusers_apply=M grace_seconds= grace_minutes= grace_hours=p grace_days= grace_weeks=P grace_months= log_activate_u=wb $1 WҥΨϥΪ̰tB log_activate_g=wb $1 WҥθsհtB log_activate_ug=wb $1 WҥΨϥΪ̩MsհtB log_deactivate_u=wb $1 WΨϥΪ̰tB log_deactivate_g=wb $1 WθsհtB log_deactivate_ug=wb $1 WΨϥΪ̩MsհtB log_save=b $2 W $1 tB log_sync=b $1 WܷsϥΪ̪tB log_grace_u=b $1 WܨϥΪ̼eɶ log_grace_g=b $1 Wܸsռeɶ log_check=b $1 WˬdtB log_copy_u=ƻsϥΪ $1 tB log_copy_g=ƻss $1 tB quota/lang/ru_SU0100644000567100000120000002365407614222654013613 0ustar jcameronwheelquota_unlimited= acl_fss= , acl_fall= acl_fsel=.. acl_quotaon= ? acl_quotanew= ? acl_ugrace= ? acl_vtotal= ? acl_ggrace= ? acl_uquota=, acl_gquota=, acl_uall= acl_uonly= acl_uexcept= acl_ugroup= acl_gall= acl_gnone= acl_gonly= acl_gexcept= , acl_uuid= UID acl_maxblocks= acl_maxfiles= acl_unlimited= activate_eallow= activate_eon= activate_eoff= check_title= check_return= $1 check_ecannot= check_running= $1 quotacheck. ... check_done=... . check_rgroup= check_ruser= cgroup_efail= cgroup_ecannot= cgroup_egallow= cgroup_enogroup= cgroup_eallowto= '$1' cgform_title= cgform_return= cgform_ecannot= cgform_egroup= cgform_copyto= $1 ... cgform_all= cgform_select= cgform_contain=, cgform_doit= cuser_efail= cuser_ecannot= cuser_euallow= cuser_enouser= cuser_eallowto= '$1' cuform_title= cuform_return= cuform_ecannot= cuform_euallow= cuform_copyto= $1 ... cuform_all= cuform_select= cuform_members= cuform_doit= egroup_title= egroup_freturn= egroup_greturn= egroup_eallowgr= '$1' egroup_eallowfs= egroup_quotas= $1 $2 egroup_bused= egroup_sblimit= egroup_hblimit= egroup_fused= egroup_sflimit= egroup_hflimit= egroup_update= egroup_listall= euser_title= euser_freturn= euser_ureturn= euser_eallowus= '$1' euser_eallowfs= euser_quotas= $1 $2 euser_bused= euser_bdisk= euser_sblimit= euser_hblimit= euser_fused= euser_fdisk= euser_sflimit= euser_hflimit= euser_update= euser_listall= gfilesys_title= gfilesys_return= gfilesys_ecannot= '$1' gfilesys_all= $1 gfilesys_blocks= gfilesys_files= gfilesys_fs= gfilesys_used= gfilesys_soft= gfilesys_hard= gfilesys_nogquota= $1 gfilesys_edit= : gfilesys_copy= ggracef_title= ggracef_return= ggracef_ecannot= ggracef_info= . , . ggracef_graces= $1 ggracef_block= ggracef_file= ggracef_update= ggraces_esave= ggraces_eedit= ggraces_enumber='$1' index_quser= index_qgroup= index_qboth= index_active= index_disable= index_inactive= index_enable= index_mountonly= index_title= index_fs= index_type= index_mount= index_status= index_action= index_return= index_euser= : index_egroup= : index_nosupport= , lgroups_failed= lgroups_eallow= lgroups_title= lgroups_return= lgroups_toomany= $1, lgroups_quotas= $1 lgroups_blocks= lgroups_files= lgroups_group= lgroups_used= lgroups_soft= lgroups_hard= lgroups_noquota= $1 lgroups_equota= : lgroups_grace= lgroups_check= sgroup_egroup= sgroup_efs= ssync_ecannot= suser_euser= suser_efs= suser_emaxblocks= , $1 suser_emaxfiles= , $1 ufilesys_title= ufilesys_return= ufilesys_ecannot= '$1' ufilesys_all= $1 ufilesys_blocks= ufilesys_files= ufilesys_fs= ufilesys_used= ufilesys_soft= ufilesys_hard= ufilesys_nouquota= $1 ufilesys_edit= : ufilesys_copy= ugracef_title= ugracef_return= ugracef_ecannot= ugracef_info= . , . ugracef_graces= $1 ugracef_block= ugracef_file= ugracef_update= ugraces_esave= ugraces_eedit= ugraces_enumber='$1' lusers_failed= lusers_eallow= lusers_title= lusers_return= lusers_toomany= $1, lusers_qoutas= $1 lusers_blocks= lusers_files= lusers_user= lusers_used= lusers_soft= lusers_hard= lusers_noquota= $1 lusers_equota= : lusers_egrace= lusers_check= lusers_info=Webmin Unix. , $1. lusers_useradmin= lusers_newuser= lusers_sblimit= lusers_hblimit= lusers_sflimit= lusers_hflimit= lusers_apply= grace_seconds= grace_minutes= grace_hours= grace_days= grace_weeks= grace_months= log_activate_u= $1 log_activate_g= $1 log_activate_ug= $1 log_deactivate_u= $1 log_deactivate_g= $1 log_deactivate_ug= $1 log_save= $1 $2 log_sync= $1 log_grace_u= $1 log_grace_g= $1 log_check= $1 log_copy_u= $1 log_copy_g= $1 quota/lang/ru_RU0100664000567100000120000002362407614360513013606 0ustar jcameronwheellusers_apply= lgroups_check= euser_sblimit= acl_uuid= UID gfilesys_soft= egroup_sblimit= cuform_ecannot= lgroups_group= index_type= ggracef_return= ugracef_return= lgroups_eallow= index_mount= ggracef_file= egroup_eallowgr= '$1' cuform_doit= ufilesys_nouquota= $1 ggracef_title= gfilesys_blocks= acl_ugrace= ? lusers_noquota= $1 suser_efs= cuser_euallow= index_mountonly= ufilesys_used= gfilesys_copy= ugraces_eedit= check_title= lusers_hard= ggraces_esave= cgform_select= check_return= $1 acl_gquota=, log_deactivate_ug= $1 index_inactive= lgroups_grace= index_egroup= : lusers_blocks= index_status= grace_minutes= gfilesys_files= log_grace_g= $1 ugracef_file= lusers_toomany= $1, acl_fall= cuser_ecannot= lusers_title= ufilesys_soft= ufilesys_files= check_rgroup= lgroups_failed= egroup_update= acl_fsel=.. grace_weeks= gfilesys_return= log_grace_u= $1 cgroup_egallow= ugracef_title= gfilesys_all= $1 acl_uonly= acl_vtotal= ? cuform_select= egroup_quotas= $1 $2 lusers_qoutas= $1 index_fs= acl_fss= , ufilesys_copy= lusers_used= lgroups_title= acl_gnone= lusers_newuser= activate_eoff= log_check= $1 ugraces_esave= cuform_title= log_copy_g= $1 egroup_greturn= lusers_return= ggracef_ecannot= lusers_info=Webmin Unix. , $1. lusers_user= lusers_hflimit= cgform_all= ggracef_block= cgroup_eallowto= '$1' log_copy_u= $1 activate_eon= acl_quotanew= ? euser_hflimit= ggracef_graces= $1 egroup_hflimit= check_ecannot= ugraces_enumber='$1' gfilesys_edit= : acl_quotaon= ? log_activate_ug= $1 ufilesys_all= $1 lusers_soft= ugracef_graces= $1 ufilesys_fs= suser_euser= check_running= $1 quotacheck. ... index_nosupport= , lusers_useradmin= lusers_files= grace_seconds= euser_ureturn= acl_ggrace= ? cgform_copyto= $1 ... cgform_title= index_euser= : check_ruser= suser_emaxblocks= , $1 acl_gonly= cgform_return= ggracef_info= . , . cgform_contain=, lgroups_noquota= $1 gfilesys_nogquota= $1 lusers_sflimit= cgroup_enogroup= grace_days= lgroups_files= grace_months= lusers_equota= : activate_eallow= lgroups_blocks= gfilesys_fs= euser_sflimit= index_qboth= egroup_sflimit= ugracef_block= egroup_title= log_deactivate_g= $1 index_title= ufilesys_blocks= egroup_bused= lusers_eallow= ufilesys_edit= : acl_gexcept= , log_save= $1 $2 cuform_copyto= $1 ... euser_update= lgroups_toomany= $1, sgroup_efs= log_deactivate_u= $1 ugracef_info= . , . lgroups_hard= acl_maxblocks= cuform_return= ufilesys_ecannot= '$1' acl_uall= gfilesys_hard= euser_freturn= egroup_freturn= egroup_fused= euser_title= acl_unlimited= cuser_eallowto= '$1' acl_uquota=, euser_quotas= $1 $2 euser_eallowus= '$1' euser_bused= euser_bdisk= lgroups_quotas= $1 euser_eallowfs= index_quser= index_return= cgform_doit= euser_listall= index_enable= egroup_listall= lgroups_return= acl_uexcept= lusers_hblimit= index_active= cgform_ecannot= euser_fused= gfilesys_ecannot= '$1' log_activate_g= $1 euser_fdisk= ufilesys_return= cuser_efail= euser_hblimit= cuser_enouser= egroup_hblimit= lusers_failed= log_sync= $1 ggraces_enumber='$1' lgroups_used= log_activate_u= $1 cuform_all= acl_maxfiles= gfilesys_used= ssync_ecannot= lusers_check= index_action= cuform_euallow= ggraces_eedit= ufilesys_hard= index_disable= egroup_eallowfs= acl_ugroup= ggracef_update= lusers_egrace= cgform_egroup= quota_unlimited= ugracef_update= ugracef_ecannot= suser_emaxfiles= , $1 gfilesys_title= index_qgroup= cgroup_efail= lusers_sblimit= ufilesys_title= cgroup_ecannot= sgroup_egroup= acl_gall= grace_hours= check_done=... . lgroups_equota= : lgroups_soft= cuform_members= quota/quota-lib.pl0100664000567100000120000000023007461462147014132 0ustar jcameronwheel# quota-lib.pl # Functions for getting user quotas do '../web-lib.pl'; &init_config(); &switch_to_remote_user(); do "$gconfig{'os_type'}-lib.pl"; 1; quota/module.info0100664000567100000120000000042307662533716014052 0ustar jcameronwheelname=Quotas desc=Disk Quotas os_support=solaris redhat-linux mandrake-linux slackware-linux debian-linux suse-linux united-linux hpux freebsd open-linux unixware turbo-linux openbsd corel-linux cobalt-linux msc-linux generic-linux gentoo-linux netbsd usermin=1 version=1.021 quota/cobalt-linux-lib.pl0100644000567100000120000003156707660023544015414 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/corel-linux-lib.pl0100644000567100000120000003156707660023544015254 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/debian-linux-lib.pl0100644000567100000120000003156707660023544015372 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/freebsd-lib.pl0100644000567100000120000002174407660024613014417 0ustar jcameronwheel# openbsd-lib.pl # Quota functions for openbsd # quotas_init() sub quotas_init { return undef; } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $ENV{'BLOCKSIZE'} = 1024; `df -i $_[0]` =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)\s+\S+\s+(\d+)\s+(\d+)/; return ($1, $2, $3+$4, $4); } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /userquota/ ? 1 : 0) + ($_[1]->[3] =~ /groupquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active sub quota_now { return $_[0]->[3] =~ /quota/ ? 3 : 0; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags); if ($_[1]%2 == 1) { # turn on user quotas $qf = "$_[0]/quota.user"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("$config{'quotacheck_command'} $_[0]"); } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas $qf = "$_[0]/quota.group"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("$config{'quotacheck_command'} $_[0]"); } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { local($n, $_, %mtab); open(QUOTA, "$config{'user_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $1; =~/^.{15}(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^(.{15})(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} = $1; $filesys{$n,'filesys'} =~ s/^\s+//g; $n++; } } close(QUOTA); return $n; } # group_filesystems(group) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { local($n, $_, %mtab); open(QUOTA, "$config{'group_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $1; =~/^.{15}(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^(.{15})(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} = $1; $filesys{$n,'filesys'} =~ s/^\s+//g; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { local($rep, @rep, $n, $what); $rep = `$config{'user_repquota_command'} $_[0] 2>&1`; if ($?) { return -1; } @rep = split(/\n/, $rep); @rep = grep { !/^root\s/ } @rep[3..$#rep]; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /(\S+)\s*[\-\+]{2}\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || $rep[$n] =~ /(\S+)\s+..(.{8})(.{8})(.{8}).{7}(.{8})(.{8})(.{8})/) { $user{$n,'user'} = $1; $user{$n,'ublocks'} = int($2); $user{$n,'sblocks'} = int($3); $user{$n,'hblocks'} = int($4); $user{$n,'ufiles'} = int($5); $user{$n,'sfiles'} = int($6); $user{$n,'hfiles'} = int($7); } } return $n; } # filesystem_groups(filesystem) # Fills the array %group with information about all groups with quotas # on this filesystem. This may not be all groups on the system.. sub filesystem_groups { local($rep, @rep, $n, $what); $rep = `$config{'group_repquota_command'} $_[0] 2>&1`; if ($?) { return -1; } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /(\S+)\s*[\-\+]{2}\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || $rep[$n] =~ /(\S+)\s+..(.{8})(.{8})(.{8}).{7}(.{8})(.{8})(.{8})/) { $group{$n,'group'} = $1; $group{$n,'ublocks'} = int($2); $group{$n,'sblocks'} = int($3); $group{$n,'hblocks'} = int($4); $group{$n,'ufiles'} = int($5); $group{$n,'sfiles'} = int($6); $group{$n,'hfiles'} = int($7); } } return $n; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): (blocks|kbytes) in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $1 eq $_[1]) { # found lines to change $rv .= "$1: $2 in use: $3, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { local(@rv, %mtab, @m); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'user_grace_command'} $_[0] |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[0]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } } close(GRACE); return @rv; } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { local(@rv, %mtab, @m); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'group_grace_command'} $_[0] |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[0]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/generic-linux-lib.pl0100644000567100000120000003156707660023544015564 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/hpux-lib.pl0100644000567100000120000001421207660024514013761 0ustar jcameronwheel# hpux-lib.pl # Quota functions for HPUX # quotas_init() sub quotas_init { return undef; } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 1; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local($out); $out = `df -t $_[0]`; $out =~ /(\d+) blocks\s+(\d+) files\n.*\s+(\d+) blocks\s+(\d+) files/; return ($3, $1, $4, $2); } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return $_[0]->[2] eq "hfs" || $_[0]->[2] eq "vxfs" ? 1 : 0; } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active sub quota_now { return $_[0]->[3] =~ /,quota/ || $_[0]->[3] =~ /^quota/ ? 1 : 0; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { local($rep, @rep, $n, $newfmt); $rep = `$config{'user_repquota_command'} $_[0] 2>&1`; if ($?) { return -1; } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; `uname -r` =~ /(\d+)\.(\d+)/; if ($1 > 10 || $1 == 10 && $2 >= 20) { $newfmt = 1; } for($n=0; $n<@rep; $n++) { if ($newfmt && $rep[$n] =~ /(\S+)\s+..(.{7})(.{7})(.{7}).{13}(.{7})(.{7})(.{7})/ || !$newfmt && $rep[$n] =~ /(\S+)\s+..(\d+)\s+(\d+)\s+(\d+)\s+.{11}(\d+)\s+(\d+)\s+(\d+)/) { $user{$n,'user'} = $1; $user{$n,'ublocks'} = int($2); $user{$n,'sblocks'} = int($3); $user{$n,'hblocks'} = int($4); $user{$n,'ufiles'} = int($5); $user{$n,'sfiles'} = int($6); $user{$n,'hfiles'} = int($7); $user{$n,'user'} =~ s/^#//g; } } return $n; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^fs (\S+) blocks \(soft = (\d+), hard = (\d+)\) inodes \(soft = (\d+), hard = (\d+)\)$/ && $1 eq $_[1]) { # found line to change $line = "fs $_[1] blocks (soft = $_[2], hard = $_[3]) inodes (soft = $_[4], hard = $_[5])"; } $rv .= "$line\n"; } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota file for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($qf, $out); $qf = "$_[0]/quotas"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystems some user has # quotas on sub user_filesystems { local($n, $_); open(QUOTA, "$config{'user_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line! $filesys{$n,'filesys'} = $1; local $nl = ; if ($nl =~ /^\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || $nl =~ /^.{13}(.{7})(.{7})(.{7}).{12}(.{7})(.{7})(.{7})/) { $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } } elsif (/^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || /^(.{13})(.{7})(.{7})(.{7}).{12}(.{7})(.{7})(.{7})/) { $filesys{$n,'filesys'} = $1; $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} =~ s/\s+$//g; $n++; } } close(QUOTA); return $n; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day, 4=week, 5=month sub get_user_grace { local(@rv); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'user_grace_command'} |"); while() { if (/^fs (\S+) blocks time limit = ([0-9\.]+) (\S+), files time limit = ([0-9\.]+) (\S+)/ && $1 eq $_[0]) { if ($2 == 0) { push(@rv, 0, 0); } else { push(@rv, $2, $name_to_unit{$3}); } if ($4 == 0) { push(@rv, 0, 0); } else { push(@rv, $4, $name_to_unit{$5}); } } } close(GRACE); return @rv; } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 1; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^fs (\S+) blocks time limit = ([0-9\.]+) (\S+), files time limit = ([0-9\.]+) (\S+)/ && $1 eq $_[1]) { # replace this line $line = "fs $_[1] blocks time limit = $_[2] $unit_to_name{$_[3]}, files time limit = $_[4] $unit_to_name{$_[5]}"; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}, $text{'grace_weeks'}, $text{'grace_months'}); } %name_to_unit = ( "sec", 0, "secs", 0, "min", 1, "mins", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, "week", 4, "weeks", 4, "month", 5, "months", 5 ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/linux-lib.pl0100644000567100000120000003156707660023544014152 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/mandrake-linux-lib.pl0100644000567100000120000003156707660023544015732 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/msc-linux-lib.pl0100644000567100000120000003156707660023544014732 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/netbsd-lib.pl0100644000567100000120000002174407660024613014264 0ustar jcameronwheel# openbsd-lib.pl # Quota functions for openbsd # quotas_init() sub quotas_init { return undef; } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $ENV{'BLOCKSIZE'} = 1024; `df -i $_[0]` =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)\s+\S+\s+(\d+)\s+(\d+)/; return ($1, $2, $3+$4, $4); } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /userquota/ ? 1 : 0) + ($_[1]->[3] =~ /groupquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active sub quota_now { return $_[0]->[3] =~ /quota/ ? 3 : 0; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags); if ($_[1]%2 == 1) { # turn on user quotas $qf = "$_[0]/quota.user"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("$config{'quotacheck_command'} $_[0]"); } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas $qf = "$_[0]/quota.group"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("$config{'quotacheck_command'} $_[0]"); } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { local($n, $_, %mtab); open(QUOTA, "$config{'user_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $1; =~/^.{15}(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^(.{15})(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} = $1; $filesys{$n,'filesys'} =~ s/^\s+//g; $n++; } } close(QUOTA); return $n; } # group_filesystems(group) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { local($n, $_, %mtab); open(QUOTA, "$config{'group_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $1; =~/^.{15}(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^(.{15})(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} = $1; $filesys{$n,'filesys'} =~ s/^\s+//g; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { local($rep, @rep, $n, $what); $rep = `$config{'user_repquota_command'} $_[0] 2>&1`; if ($?) { return -1; } @rep = split(/\n/, $rep); @rep = grep { !/^root\s/ } @rep[3..$#rep]; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /(\S+)\s*[\-\+]{2}\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || $rep[$n] =~ /(\S+)\s+..(.{8})(.{8})(.{8}).{7}(.{8})(.{8})(.{8})/) { $user{$n,'user'} = $1; $user{$n,'ublocks'} = int($2); $user{$n,'sblocks'} = int($3); $user{$n,'hblocks'} = int($4); $user{$n,'ufiles'} = int($5); $user{$n,'sfiles'} = int($6); $user{$n,'hfiles'} = int($7); } } return $n; } # filesystem_groups(filesystem) # Fills the array %group with information about all groups with quotas # on this filesystem. This may not be all groups on the system.. sub filesystem_groups { local($rep, @rep, $n, $what); $rep = `$config{'group_repquota_command'} $_[0] 2>&1`; if ($?) { return -1; } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /(\S+)\s*[\-\+]{2}\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || $rep[$n] =~ /(\S+)\s+..(.{8})(.{8})(.{8}).{7}(.{8})(.{8})(.{8})/) { $group{$n,'group'} = $1; $group{$n,'ublocks'} = int($2); $group{$n,'sblocks'} = int($3); $group{$n,'hblocks'} = int($4); $group{$n,'ufiles'} = int($5); $group{$n,'sfiles'} = int($6); $group{$n,'hfiles'} = int($7); } } return $n; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): (blocks|kbytes) in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $1 eq $_[1]) { # found lines to change $rv .= "$1: $2 in use: $3, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { local(@rv, %mtab, @m); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'user_grace_command'} $_[0] |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[0]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } } close(GRACE); return @rv; } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { local(@rv, %mtab, @m); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'group_grace_command'} $_[0] |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[0]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/open-linux-lib.pl0100644000567100000120000003156707660023544015111 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/openbsd-lib.pl0100644000567100000120000002174407660024613014437 0ustar jcameronwheel# openbsd-lib.pl # Quota functions for openbsd # quotas_init() sub quotas_init { return undef; } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $ENV{'BLOCKSIZE'} = 1024; `df -i $_[0]` =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)\s+\S+\s+(\d+)\s+(\d+)/; return ($1, $2, $3+$4, $4); } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /userquota/ ? 1 : 0) + ($_[1]->[3] =~ /groupquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active sub quota_now { return $_[0]->[3] =~ /quota/ ? 3 : 0; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags); if ($_[1]%2 == 1) { # turn on user quotas $qf = "$_[0]/quota.user"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("$config{'quotacheck_command'} $_[0]"); } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas $qf = "$_[0]/quota.group"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("$config{'quotacheck_command'} $_[0]"); } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { local($n, $_, %mtab); open(QUOTA, "$config{'user_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $1; =~/^.{15}(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^(.{15})(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} = $1; $filesys{$n,'filesys'} =~ s/^\s+//g; $n++; } } close(QUOTA); return $n; } # group_filesystems(group) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { local($n, $_, %mtab); open(QUOTA, "$config{'group_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $1; =~/^.{15}(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^(.{15})(.{8}).(.{7})(.{8}).{8}(.{8}).(.{7})(.{8})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} = $1; $filesys{$n,'filesys'} =~ s/^\s+//g; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { local($rep, @rep, $n, $what); $rep = `$config{'user_repquota_command'} $_[0] 2>&1`; if ($?) { return -1; } @rep = split(/\n/, $rep); @rep = grep { !/^root\s/ } @rep[3..$#rep]; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /(\S+)\s*[\-\+]{2}\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || $rep[$n] =~ /(\S+)\s+..(.{8})(.{8})(.{8}).{7}(.{8})(.{8})(.{8})/) { $user{$n,'user'} = $1; $user{$n,'ublocks'} = int($2); $user{$n,'sblocks'} = int($3); $user{$n,'hblocks'} = int($4); $user{$n,'ufiles'} = int($5); $user{$n,'sfiles'} = int($6); $user{$n,'hfiles'} = int($7); } } return $n; } # filesystem_groups(filesystem) # Fills the array %group with information about all groups with quotas # on this filesystem. This may not be all groups on the system.. sub filesystem_groups { local($rep, @rep, $n, $what); $rep = `$config{'group_repquota_command'} $_[0] 2>&1`; if ($?) { return -1; } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /(\S+)\s*[\-\+]{2}\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || $rep[$n] =~ /(\S+)\s+..(.{8})(.{8})(.{8}).{7}(.{8})(.{8})(.{8})/) { $group{$n,'group'} = $1; $group{$n,'ublocks'} = int($2); $group{$n,'sblocks'} = int($3); $group{$n,'hblocks'} = int($4); $group{$n,'ufiles'} = int($5); $group{$n,'sfiles'} = int($6); $group{$n,'hfiles'} = int($7); } } return $n; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): (blocks|kbytes) in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $1 eq $_[1]) { # found lines to change $rv .= "$1: $2 in use: $3, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { local(@rv, %mtab, @m); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'user_grace_command'} $_[0] |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[0]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } } close(GRACE); return @rv; } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { local(@rv, %mtab, @m); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'group_grace_command'} $_[0] |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[0]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $1 eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/redhat-linux-lib.pl0100644000567100000120000003156707660023544015417 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/slackware-linux-lib.pl0100644000567100000120000003156707660023544016124 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/solaris-lib.pl0100755000567100000120000001470407660024330014456 0ustar jcameronwheel# solaris-lib.pl # Quota functions for solaris 2.5+ # quotas_init() sub quotas_init { return undef; } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 1; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local($out); $out = `df -t $_[0]`; $out =~ /(\d+) blocks\s+(\d+) files\n.*\s+(\d+) blocks\s+(\d+) files/; return ($3, $1, $4, $2); } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return $_[0]->[2] eq "ufs" ? 1 : 0; } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active sub quota_now { return $_[0]->[3] =~ /,quota/ || $_[0]->[3] =~ /^quota/ ? 1 : 0; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { local($rep, @rep, $n, %hasu, $u); $rep = `$config{'user_repquota_command'} $_[0] 2>&1`; if ($?) { return -1; } setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /(\S+)\s+[\-\+]{2}\s+(\d+)\s+(\d+)\s+(\d+)\s+.{0,15}\s+(\d+)\s+(\d+)\s+(\d+)/ || $rep[$n] =~ /(\S+)\s+[\-\+]{2}(.{7})(.{7})(.{7}).{13}(.{7})(.{7})(.{7})/) { $user{$n,'user'} = $1; $user{$n,'ublocks'} = int($2); $user{$n,'sblocks'} = int($3); $user{$n,'hblocks'} = int($4); $user{$n,'ufiles'} = int($5); $user{$n,'sfiles'} = int($6); $user{$n,'hfiles'} = int($7); $user{$n,'user'} =~ s/^#//g; if ($user{$n,'user'} !~ /^\d+$/ && !$hasu{$user{$n,'user'}}) { # Username was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($user{$n,'user'})) eq $user{$n,'user'}) { # found him.. $user{$n,'user'} = $u; last; } } } } } return $n; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^fs (\S+) blocks \(soft = (\d+), hard = (\d+)\) inodes \(soft = (\d+), hard = (\d+)\)$/ && $1 eq $_[1]) { # found line to change $line = "fs $_[1] blocks (soft = $_[2], hard = $_[3]) inodes (soft = $_[4], hard = $_[5])"; } $rv .= "$line\n"; } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota file for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($qf, $out); $qf = "$_[0]/quotas"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystems some user has # quotas on sub user_filesystems { local($n, $_); open(QUOTA, "$config{'user_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|Filesystem)/i) { next; } if (/^(\S+)$/) { # Bogus wrapped line! $filesys{$n,'filesys'} = $1; local $nl = ; if ($nl =~ /^\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || $nl =~ /^.{13}(.{7})(.{7})(.{7}).{12}(.{7})(.{7})(.{7})/) { $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } } elsif (/^(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s.{0,15}\s(\d+)\s+(\d+)\s+(\d+)/ || /^(.{13})(.{7})(.{7})(.{7}).{12}(.{7})(.{7})(.{7})/) { $filesys{$n,'filesys'} = $1; $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} =~ s/\s+$//g; $n++; } } close(QUOTA); return $n; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day, 4=week, 5=month sub get_user_grace { local(@rv); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'user_grace_command'} |"); while() { if (/^fs (\S+) blocks time limit = ([0-9\.]+) (\S+), files time limit = ([0-9\.]+) (\S+)/ && $1 eq $_[0]) { if ($2 == 0) { push(@rv, 0, 0); } else { push(@rv, $2, $name_to_unit{$3}); } if ($4 == 0) { push(@rv, 0, 0); } else { push(@rv, $4, $name_to_unit{$5}); } } } close(GRACE); return @rv; } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 1; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^fs (\S+) blocks time limit = ([0-9\.]+) (\S+), files time limit = ([0-9\.]+) (\S+)/ && $1 eq $_[1]) { # replace this line $line = "fs $_[1] blocks time limit = $_[2] $unit_to_name{$_[3]}, files time limit = $_[4] $unit_to_name{$_[5]}"; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}, $text{'grace_weeks'}, $text{'grace_months'}); } %name_to_unit = ( "sec", 0, "secs", 0, "min", 1, "mins", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, "week", 4, "weeks", 4, "month", 5, "months", 5 ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/suse-linux-lib.pl0100644000567100000120000003156707660023544015127 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/turbo-linux-lib.pl0100644000567100000120000003156707660023544015303 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/unixware-lib.pl0100744000567100000120000001442707660024334014650 0ustar jcameronwheel# unixware-lib.pl # Quota functions for UnixWare 7 # quotas_init() sub quotas_init { return undef; } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 1; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local($out); $out = `df -t $_[0]`; $out =~ /(\d+) blocks\s+(\d+) files\n.*\s+(\d+) blocks\s+(\d+) files/; return ($3, $1, $4, $2); } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return $_[0]->[2] eq "ufs" || $_[0]->[2] eq "vxfs" ? 1 : 0; } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active sub quota_now { return $_[0]->[3] =~ /,quota/ || $_[0]->[3] =~ /^quota/ ? 1 : 0; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { local($rep, @rep, $n, %hasu, $u); $rep = &backquote_logged("$config{'user_repquota_command'} $_[0] 2>&1"); if ($?) { return -1; } setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /(\S+)\s+..\s+(\d+)\s+(\d+)\s+(\d+).*(\d+)\s+(\d+)\s+(\d+)/ || $rep[$n] =~ /(\S+)\s+..(.{7})(.{7})(.{7}).{13}(.{7})(.{7})(.{7})/) { $user{$n,'user'} = $1; $user{$n,'ublocks'} = int($2); $user{$n,'sblocks'} = int($3); $user{$n,'hblocks'} = int($4); $user{$n,'ufiles'} = int($5); $user{$n,'sfiles'} = int($6); $user{$n,'hfiles'} = int($7); $user{$n,'user'} =~ s/^#//g; if ($user{$n,'user'} !~ /^\d+$/ && !$hasu{$user{$n,'user'}}) { # Username was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($user{$n,'user'})) eq $user{$n,'user'}) { # found him.. $user{$n,'user'} = $u; last; } } } } } return $n; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^fs (\S+) blocks \(soft = (\d+), hard = (\d+)\) inodes \(soft = (\d+), hard = (\d+)\)$/ && $1 eq $_[1]) { # found line to change $line = "fs $_[1] blocks (soft = $_[2], hard = $_[3]) inodes (soft = $_[4], hard = $_[5])"; } $rv .= "$line\n"; } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota file for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($qf, $out); $qf = "$_[0]/quotas"; if (!(-r $qf)) { open(QUOTAFILE, "> $qf"); close(QUOTAFILE); chmod(0600, $qf); } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { return $out; } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystems some user has # quotas on sub user_filesystems { local($n, $_); open(QUOTA, "$config{'user_quota_command'} ".quotemeta($_[0])." |"); $n=0; while() { chop; if (/^(Disk|Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line! $filesys{$n,'filesys'} = $1; =~ /^.{13}(.{7})(.{7})(.{7}).{12}(.{7})(.{7})(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^(.{13})(.{7})(.{7})(.{7}).{12}(.{7})(.{7})(.{7})/) { $filesys{$n,'filesys'} = $1; $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $filesys{$n,'filesys'} =~ s/\s+$//g; $n++; } } close(QUOTA); return $n; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day, 4=week, 5=month sub get_user_grace { local(@rv); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$config{'user_grace_command'} |"); while() { if (/^fs (\S+) blocks time limit = ([0-9\.]+) (\S+), files time limit = ([0-9\.]+) (\S+)/ && $1 eq $_[0]) { if ($2 == 0) { push(@rv, 0, 0); } else { push(@rv, $2, $name_to_unit{$3}); } if ($4 == 0) { push(@rv, 0, 0); } else { push(@rv, $4, $name_to_unit{$5}); } } } close(GRACE); return @rv; } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 1; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line); foreach $line (split(/\n/, $_[0])) { if ($line =~ /^fs (\S+) blocks time limit = ([0-9\.]+) (\S+), files time limit = ([0-9\.]+) (\S+)/ && $1 eq $_[1]) { # replace this line $line = "fs $_[1] blocks time limit = $_[2] $unit_to_name{$_[3]}, files time limit = $_[4] $unit_to_name{$_[5]}"; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}, $text{'grace_weeks'}, $text{'grace_months'}); } %name_to_unit = ( "sec", 0, "secs", 0, "min", 1, "mins", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, "week", 4, "weeks", 4, "month", 5, "months", 5 ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/config-cobalt-linux0100644000567100000120000000102507431063507015462 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-corel-linux0100644000567100000120000000102507431063511015315 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-debian-linux0100644000567100000120000000102507431063512015434 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-freebsd0100644000567100000120000000101707431063513014471 0ustar jcameronwheeluser_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_copy_command=edquota -g -p quotacheck_command=quotacheck user_quota_command=quota -v -u group_grace_command=edquota -t -g user_repquota_command=repquota -u -v user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g group_quotaon_command=quotaon -g group_quota_command=quota -v -g user_copy_command=edquota -u -p group_repquota_command=repquota -g -v display_max=100 group_edquota_command=edquota -g user_grace_command=edquota -t -u sort_mode=0 quota/config-generic-linux0100644000567100000120000000102507443307076015637 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-hpux0100644000567100000120000000041407431063515014045 0ustar jcameronwheeldisplay_max=100 user_quotaoff_command=quotaoff user_quotaon_command=quotaon user_repquota_command=repquota -v user_grace_command=edquota -t user_quota_command=quota -v quotacheck_command=quotacheck user_edquota_command=edquota user_copy_command=edquota -p sort_mode=0 quota/config-mandrake-linux0100644000567100000120000000102507431063516016000 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-msc-linux0100644000567100000120000000102507431063520014773 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-netbsd0100644000567100000120000000101707431063521014335 0ustar jcameronwheeluser_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_copy_command=edquota -g -p quotacheck_command=quotacheck user_quota_command=quota -v -u group_grace_command=edquota -t -g user_repquota_command=repquota -u -v user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g group_quotaon_command=quotaon -g group_quota_command=quota -v -g user_copy_command=edquota -u -p group_repquota_command=repquota -g -v display_max=100 group_edquota_command=edquota -g user_grace_command=edquota -t -u sort_mode=0 quota/config-open-linux0100644000567100000120000000102507431063523015155 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-openbsd0100644000567100000120000000101707431063524014513 0ustar jcameronwheeluser_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_copy_command=edquota -g -p quotacheck_command=quotacheck user_quota_command=quota -v -u group_grace_command=edquota -t -g user_repquota_command=repquota -u -v user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g group_quotaon_command=quotaon -g group_quota_command=quota -v -g user_copy_command=edquota -u -p group_repquota_command=repquota -g -v display_max=100 group_edquota_command=edquota -g user_grace_command=edquota -t -u sort_mode=0 quota/config-redhat-linux0100644000567100000120000000102507431063526015466 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/module.info.bak0100664000567100000120000000003507526070344014575 0ustar jcameronwheelname=Quotas desc=Disk Quotas quota/config-united-linux0100644000567100000120000000102507536033147015511 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/united-linux-lib.pl0100644000567100000120000003156707660023544015440 0ustar jcameronwheel# linux-lib.pl # Quota functions for all linux version # quotas_init() sub quotas_init { if (&has_command("quotaon") && &has_command("quotaoff")) { return undef; } else { return "The quotas package does not appear to be installed on ". "your system\n"; } } # quotas_supported() # Returns 1 for user quotas, 2 for group quotas or 3 for both sub quotas_supported { return 3; } # free_space(filesystem) # Returns an array containing btotal, bfree, ftotal, ffree sub free_space { local(@out, @rv); $out = `df $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); $out = `df -i $_[0]`; $out =~ /Mounted on\n\S+\s+(\d+)\s+\d+\s+(\d+)/; push(@rv, ($1, $2)); return @rv; } # quota_can(&mnttab, &fstab) # Can this filesystem type support quotas? # 0 = No quota support (or not turned on in /etc/fstab) # 1 = User quotas only # 2 = Group quotas only # 3 = User and group quotas sub quota_can { return ($_[1]->[3] =~ /usrquota/ ? 1 : 0) + ($_[1]->[3] =~ /grpquota/ ? 2 : 0); } # quota_now(&mnttab, &fstab) # Are quotas currently active? # 0 = Not active # 1 = User quotas active # 2 = Group quotas active # 3 = Both active # Adding 4 means they cannot be turned off (such as for XFS) sub quota_now { local $rv = 0; local $dir = $_[0]->[0]; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab local %opts; map { $opts{$_}++ } split(/,/, $_[0]->[3]); $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || $opts{'uqnoenforce'}); $rv += 2 if ($opts{'grpquota'} || $opts{'gqnoenforce'}); return $rv + 4; } if ($_[0]->[4]%2 == 1) { # test user quotas if (-r "$dir/quota.user" || -r "$dir/aquota.user") { $out = `$config{'user_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 1; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'user_quotaoff_command'} $dir 2>&1`; } } } if ($_[0]->[4] > 1) { # test group quotas if (-r "$dir/quota.group" || -r "$dir/aquota.group") { $out = `$config{'group_quotaon_command'} $dir 2>&1`; if ($out =~ /Device or resource busy/i) { # already on.. $rv += 2; } elsif ($out =~ /Package not installed/i) { # No quota support! return 0; } else { # was off.. need to turn on again `$config{'group_quotaoff_command'} $dir 2>&1`; } } } return $rv; } # quotaon(filesystem, mode) # Activate quotas and create quota files for some filesystem. The mode can # be 1 for user only, 2 for group only or 3 for user and group sub quotaon { local($out, $qf, @qfile, $flags, $version); # Check which version of quota is being used $out = `quota -V 2>&1`; if ($out =~ /\s(\d+\.\d+)/) { $version = $1; } if ($_[1]%2 == 1) { # turn on user quotas local $qf = $version >= 2 ? "aquota.user" : "quota.user"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.user file and converting it open(QUOTAFILE, ">>$_[0]/quota.user"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -u / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.user"); } if (!$ok) { # Try to create an [a]quota.user file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'user_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { # turn on group quotas local $qf = $version >= 2 ? "aquota.group" : "quota.group"; if (!-s "$_[0]/$qf") { # Setting up for the first time local $ok = 0; if (&has_command("convertquota") && $version >= 2) { # Try creating a quota.group file and converting it open(QUOTAFILE, ">>$_[0]/quota.group"); close(QUOTAFILE); chmod(0600, $qf); &system_logged("convertquota -g / 2>&1"); $ok = 1 if (!$?); unlink("$_[0]/quota.group"); } if (!$ok) { # Try to create an [a]quota.group file open(QUOTAFILE, ">>$_[0]/$qf"); close(QUOTAFILE); chmod(0600, $qf); &run_quotacheck($_[0]) || &run_quotacheck($_[0], "-f") || &run_quotacheck($_[0], "-f -m"); } } $out = &backquote_logged("$config{'group_quotaon_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # run_quotacheck(filesys, args) sub run_quotacheck { local $out = `$config{'quotacheck_command'} $_[1] $_[0] 2>&1`; return $? || $out =~ /cannot remount|please stop/i ? 0 : 1; } # quotaoff(filesystem, mode) # Turn off quotas for some filesystem sub quotaoff { local($out); if ($_[1]%2 == 1) { $out = &backquote_logged("$config{'user_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } if ($_[1] > 1) { $out = &backquote_logged("$config{'group_quotaoff_command'} $_[0] 2>&1"); if ($?) { return $out; } } return undef; } # user_filesystems(user) # Fills the array %filesys with details of all filesystem some user has # quotas on sub user_filesystems { return &parse_quota_output("$config{'user_quota_command'} ".quotemeta($_[0])); } # group_filesystems(user) # Fills the array %filesys with details of all filesystem some group has # quotas on sub group_filesystems { return &parse_quota_output("$config{'group_quota_command'} ".quotemeta($_[0])); } sub parse_quota_output { local($n, $_, %mtab); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); open(QUOTA, "$_[0] |"); $n=0; while() { chop; if (/^(Disk|\s+Filesystem)/) { next; } if (/^(\S+)$/) { # Bogus wrapped line $filesys{$n,'filesys'} = $mtab{$1}; local $nl = ; $nl =~/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^.{15}.(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/; $filesys{$n,'ublocks'} = int($1); $filesys{$n,'sblocks'} = int($2); $filesys{$n,'hblocks'} = int($3); $filesys{$n,'ufiles'} = int($4); $filesys{$n,'sfiles'} = int($5); $filesys{$n,'hfiles'} = int($6); $n++; } elsif (/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+).{8}\s+(\S+)\s+(\S+)\s+(\S+)/ || /^(.{15}).(.{7}).(.{7}).(.{7}).{8}.(.{7}).(.{7}).(.{7})/) { $filesys{$n,'ublocks'} = int($2); $filesys{$n,'sblocks'} = int($3); $filesys{$n,'hblocks'} = int($4); $filesys{$n,'ufiles'} = int($5); $filesys{$n,'sfiles'} = int($6); $filesys{$n,'hfiles'} = int($7); $dev = $1; $dev =~ s/\s+$//g; $dev =~ s/^\s+//g; $filesys{$n,'filesys'} = $mtab{$dev}; $n++; } } close(QUOTA); return $n; } # filesystem_users(filesystem) # Fills the array %user with information about all users with quotas # on this filesystem. This may not be all users on the system.. sub filesystem_users { return &parse_repquota_output( "$config{'user_repquota_command'} $_[0]", "user"); } sub filesystem_groups { return &parse_repquota_output( "$config{'group_repquota_command'} $_[0]", "group"); } sub parse_repquota_output { local($rep, @rep, $n, $what, $u, @uinfo); $what = $_[1]; $rep = `$_[0] 2>&1`; if ($?) { return -1; } if ($what eq 'user') { setpwent(); while(@uinfo = getpwent()) { $hasu{$uinfo[0]}++; } endpwent() if ($gconfig{'os_type'} ne 'hpux'); } else { setgrent(); while(@uinfo = getgrent()) { $hasu{$uinfo[0]}++; } endgrent() if ($gconfig{'os_type'} ne 'hpux'); } @rep = split(/\n/, $rep); @rep = @rep[3..$#rep]; local $nn = 0; for($n=0; $n<@rep; $n++) { if ($rep[$n] =~ /^\s*(\S+)\s+[\-\+]{2}\s+(\S+)\s+(\S+)\s+(\S+).{7}\s+(\S+)\s+(\S+)\s+(\S+)/ || $rep[$n] =~ /([^\-\s]\S*)\s*[\-\+]{2}(.{8})(.{8})(.{8}).{7}(.{8})(.{6})(.{6})/) { $$what{$nn,$what} = $1; $$what{$nn,'ublocks'} = int($2); $$what{$nn,'sblocks'} = int($3); $$what{$nn,'hblocks'} = int($4); $$what{$nn,'ufiles'} = int($5); $$what{$nn,'sfiles'} = int($6); $$what{$nn,'hfiles'} = int($7); if ($$what{$nn,$what} !~ /^\d+$/ && !$hasu{$$what{$nn,$what}}) { # User/group name was truncated! Try to find him.. foreach $u (keys %hasu) { if (substr($u, 0, length($$what{$nn,$what})) eq $$what{$nn,$what}) { # found him.. $$what{$nn,$what} = $u; last; } } } $nn++; } } return $nn; } # edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles) sub edit_quota_file { local($rv, $line, %mtab, @m, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { if ($line[$i] =~ /^(\S+): blocks in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/ && $mtab{$1} eq $_[1]) { # found lines to change $rv .= "$1: blocks in use: $2, limits (soft = $_[2], hard = $_[3])\n"; $line[++$i] =~ /^\s*inodes in use: (\d+), limits \(soft = (\d+), hard = (\d+)\)$/; $rv .= "\tinodes in use: $1, limits (soft = $_[4], hard = $_[5])\n"; } elsif ($line[$i] =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # even newer-style line to change $rv .= "$line[$i]\n"; $line[++$i] =~ /^used\s+(\S+),\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1, limits: soft=$_[2] hard=$_[3]\n"; $line[++$i] =~ /^used\s+(\S+) inodes,\s+limits:\s+soft=(\d+)\s+hard=(\d+)/i; $rv .= "Used $1 inodes, limits: soft=$_[4] hard=$_[5]\n"; } elsif ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && $mtab{$1} eq $_[1]) { # new-style line to change $rv .= " $1 $2 $_[2] $_[3] $5 $_[4] $_[5]\n"; } else { $rv .= "$line[$i]\n"; } } return $rv; } # quotacheck(filesystem, mode) # Runs quotacheck on some filesystem sub quotacheck { local $out = &backquote_logged("$config{'quotacheck_command'} $_[0] 2>&1"); if ($?) { # Try with the -f and -m options $out = &backquote_logged("$config{'quotacheck_command'} -f -m $_[0] 2>&1"); return $out if ($?); } return undef; } # copy_user_quota(user, [user]+) # Copy the quotas for some user to many others sub copy_user_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'user_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # copy_group_quota(group, [group]+) # Copy the quotas for some group to many others sub copy_group_quota { for($i=1; $i<@_; $i++) { $out = &backquote_logged("$config{'group_copy_command'} ". quotemeta($_[0])." ".quotemeta($_[$i])." 2>&1"); if ($?) { return $out; } } return undef; } # get_user_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_user_grace { return &parse_grace_output($config{'user_grace_command'}, $_[0]); } # get_group_grace(filesystem) # Returns an array containing btime, bunits, ftime, funits # The units can be 0=sec, 1=min, 2=hour, 3=day sub get_group_grace { return &parse_grace_output($config{'group_grace_command'}, $_[0]); } # default_grace() # Returns 0 if grace time can be 0, 1 if zero grace means default sub default_grace { return 0; } sub parse_grace_output { local(@rv, %mtab, @m); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); $ENV{'EDITOR'} = $ENV{'VISUAL'} = "cat"; open(GRACE, "$_[0] 2>&1 |"); while() { if (/^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { @rv = ($2, $name_to_unit{$3}, $4, $name_to_unit{$5}); } elsif (/^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { if ( =~ /^block\s+grace:\s+(\S+)\s+(\S+)\s+inode\s+grace:\s+(\S+)\s+(\S+)/i) { @rv = ($1, $name_to_unit{$2}, $3, $name_to_unit{$4}); last; } } } close(GRACE); return @rv; } # edit_grace_file(data, filesystem, btime, bunits, ftime, funits) sub edit_grace_file { local($rv, $line, @m, %mtab, @line, $i); open(MTAB, "/etc/mtab"); while() { @m = split(/\s+/); $mtab{$m[0]} = $m[1]; } close(MTAB); @line = split(/\n/, $_[0]); for($i=0; $i<@line; $i++) { $line = $line[$i]; if ($line =~ /^(\S+): block grace period: (\d+) (\S+), file grace period: (\d+) (\S+)/ && $mtab{$1} eq $_[1]) { # replace this line $line = "$1: block grace period: $_[2] $unit_to_name{$_[3]}, file grace period: $_[4] $unit_to_name{$_[5]}"; } elsif ($line =~ /^\s+(\S+)\s+(\d+)(\S+)\s+(\d+)(\S+)/ && $mtab{$1} eq $_[1]) { # replace new-style line $line = " $1 $_[2]$unit_to_name{$_[3]} $_[4]$unit_to_name{$_[5 ]}"; } elsif ($line =~ /^device\s+(\S+)\s+\((\S+)\):/i && $2 eq $_[1]) { # replace even newer-style line $rv .= "$line\n"; $line = "Block grace: $_[2] $unit_to_name{$_[3]} Inode grace: $_[4] $unit_to_name{$_[5]}"; $i++; } $rv .= "$line\n"; } return $rv; } # grace_units() # Returns an array of possible units for grace periods sub grace_units { return ($text{'grace_seconds'}, $text{'grace_minutes'}, $text{'grace_hours'}, $text{'grace_days'}); } %name_to_unit = ( "second", 0, "seconds", 0, "minute", 1, "minutes", 1, "hour", 2, "hours", 2, "day", 3, "days", 3, ); foreach $k (keys %name_to_unit) { $unit_to_name{$name_to_unit{$k}} = $k; } 1; quota/config-slackware-linux0100644000567100000120000000102507431063532016170 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-solaris0100644000567100000120000000041407431063534014536 0ustar jcameronwheeldisplay_max=100 user_quotaoff_command=quotaoff user_quotaon_command=quotaon user_repquota_command=repquota -v user_grace_command=edquota -t user_quota_command=quota -v quotacheck_command=quotacheck user_edquota_command=edquota user_copy_command=edquota -p sort_mode=0 quota/config-suse-linux0100644000567100000120000000102507431063536015177 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-turbo-linux0100644000567100000120000000102507431063537015354 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/config-unixware0100644000567100000120000000041407431063540014721 0ustar jcameronwheeldisplay_max=100 user_quotaoff_command=quotaoff user_quotaon_command=quotaon user_repquota_command=repquota -v user_grace_command=edquota -t user_quota_command=quota -v quotacheck_command=quotacheck user_edquota_command=edquota user_copy_command=edquota -p sort_mode=0 quota/ulang/0040775000567100000120000000000007461463103013007 5ustar jcameronwheelquota/ulang/en0100664000567100000120000000021707461463103013331 0ustar jcameronwheelindex_title=Disk Quotas index_quotas=Disk quotas for $1 on mounted filesystems index_none=You have no disk quotas on any mounted filesystems. quota/index.cgi0100775000567100000120000000301607562052505013476 0ustar jcameronwheel#!/usr/local/bin/perl # index.cgi # Just display the current user's quotas require './quota-lib.pl'; &header($text{'index_title'}, "", undef, 0, 1); print "
\n"; @st = stat($remote_user_info[7]); # force mount of home dir $n = &user_filesystems($remote_user); if ($n) { print "

",&text('index_quotas', "$remote_user"),"

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; for($i=0; $i<$n; $i++) { $f = $filesys{$i,'filesys'}; print "\n"; print "\n"; print "\n"; &print_limit($filesys{$i,'sblocks'}); &print_limit($filesys{$i,'hblocks'}); print "\n"; &print_limit($filesys{$i,'sfiles'}); &print_limit($filesys{$i,'hfiles'}); print "\n"; } print "

$text{'ufilesys_blocks'}$text{'ufilesys_files'}
$text{'ufilesys_fs'}$text{'ufilesys_used'} $text{'ufilesys_soft'}$text{'ufilesys_hard'}$text{'ufilesys_used'} $text{'ufilesys_soft'}$text{'ufilesys_hard'}
$f$filesys{$i,'ublocks'}$filesys{$i,'ufiles'}

\n"; } else { print "

$text{'index_none'}

\n"; } print "


\n"; &footer("/", $text{'index'}); sub print_limit { if ($_[0] == 0) { print "$text{'quota_unlimited'}\n"; } else { print "$_[0]\n"; } } quota/config-gentoo-linux0100644000567100000120000000102507506777423015525 0ustar jcameronwheeldisplay_max=100 user_grace_command=edquota -u -t group_grace_command=edquota -g -t group_quotaon_command=quotaon -g user_quotaoff_command=quotaoff -u user_quotaon_command=quotaon -u group_quota_command=quota -v -g group_copy_command=edquota -g -p quotacheck_command=quotacheck -u -g user_quota_command=quota -v -u user_copy_command=edquota -u -p group_repquota_command=repquota -g -v user_repquota_command=repquota -u -v group_edquota_command=edquota -g user_edquota_command=edquota -u group_quotaoff_command=quotaoff -g sort_mode=0 quota/module.info~0100664000567100000120000000037607536610570014251 0ustar jcameronwheelname=Quotas desc=Disk Quotas os_support=solaris redhat-linux mandrake-linux slackware-linux debian-linux suse-linux united-linux hpux freebsd open-linux unixware turbo-linux openbsd corel-linux cobalt-linux msc-linux generic-linux gentoo-linux usermin=1