Installation d'une imprimante réseau Brother HL-5450DN

Au boulot j'ai hérité d'une Brother HL-5450DN, et on ne peut pas dire qu'elle marchait out of the box sur mon Archlinux. D'habitude il y a toujours un paquet AUR pour faire le job, mais dans ce cas le paquet brother-brgenml1 ne m'a pas été d'un grand secours.Il m'a donc fallu utiliser un script Brother se basant sur des .deb ou des .rpm.

préalable : installer le paquet AUR dpkg permettant d'installer un paquet deb

yaourt -S dpkg

Ensuite aller sur cette page de téléchargement de brother, accepter le CLUF et télécharger le Driver Install Tool.

Se rendre dans le dossier contenant le téléchargement, le décompacter et lancer la commande

sudo bash ./linux-brprinter-installer-2.1.1-1 
Input model name ->HL-5450DL

You are going to install following packages.
hl5450dnlpr-3.0.0-1.i386.deb
hl5450dncupswrapper-3.0.0-1.i386.deb
OK? [y/N] ->y


=========================================
Brother License Agreement

Brother retains any and all copyrights to the Software. In no case this Agreement shall be construed to assign or otherwise transfer from Brother to User any copyrights or other intellectual property rights to whole or any part of the Software.

Brother grants User a non-exclusive license: to reproduce and/or distribute (via Internet or in any other manner) the Software. Further, Brother grants User a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of the Software and to reproduce and distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works for any purpose.

The license of the Software from Brother hereunder is granted "AS IS." BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT.
Brother shall have no liability in contract, tort (including negligence or breach of statutory duty) or otherwise for any interruption of use, loss of data, or for any indirect, incidental, punitive or consequential loss or damage, or for any loss of profit, revenue, data, goodwill or anticipated savings that arises under, out of, or in contemplation of this Agreement or otherwise arises due to any error, inaccuracy or defect in the Software even if Brother has been advised of the possibility of such loss or damage.
Further, Brother shall have no liability to disclose and/or distribute the source cord of the Software to User under any circumstances. In no case shall the above license by Brother to modify, alter, translate or otherwise prepare derivative works of the Software be construed as Brother's implied agreement or undertakings to disclose and/or distribute the source cord of the Software.
=========================================
Do you agree? [Y/n] ->y

wget -T 10 -nd --no-cache http://www.brother.com/pub/bsc/linux/packages/hl5450dnlpr-3.0.0-1.i386.deb
--2016-12-08 14:31:11-- http://www.brother.com/pub/bsc/linux/packages/hl5450dnlpr-3.0.0-1.i386.deb
Résolution de www.brother.com (www.brother.com)… 92.123.227.219, 92.123.227.168
Connexion à www.brother.com (www.brother.com)|92.123.227.219|:80… connecté.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : 33734 (33K) [text/plain]
Sauvegarde en : « hl5450dnlpr-3.0.0-1.i386.deb »

hl5450dnlpr-3.0.0-1 100%[===================>] 32,94K --.-KB/s in 0,03s

2016-12-08 14:31:11 (1,17 MB/s) — « hl5450dnlpr-3.0.0-1.i386.deb » sauvegardé [33734/33734]


=========================================
GPL License Agreement

This Software may be used in accordance with GNU General Public License (GPL). Please read carefully the following GPL and click on "I Accept" button. If you cannot agree with the following terms, please click "I don't Accept" button. In case of your non-acceptance, you can not use this Software.
Note:
Please click on "I Accept" while holding down "Shift" or right click on "I Accept" and select "Save Target As,,," from the menu.

GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Preamble

The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their rights.

We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.

Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.

Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and modification follow.

GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.

b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.

c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this when it starts in an interactive mode:

Gnomovision version 69, Copyright (C) year name of author Gnomovision
comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.

<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice

This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
=========================================

Do you agree? [Y/n] ->y

wget -T 10 -nd --no-cache http://www.brother.com/pub/bsc/linux/packages/hl5450dncupswrapper-3.0.0-1.i386.deb
--2016-12-08 14:31:14-- http://www.brother.com/pub/bsc/linux/packages/hl5450dncupswrapper-3.0.0-1.i386.deb
Résolution de www.brother.com (www.brother.com)… 92.123.227.168, 92.123.227.219
Connexion à www.brother.com (www.brother.com)|92.123.227.168|:80… connecté.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : 13474 (13K) [text/plain]
Sauvegarde en : « hl5450dncupswrapper-3.0.0-1.i386.deb »

hl5450dncupswrapper 100%[===================>] 13,16K --.-KB/s in 0,006s

2016-12-08 14:31:14 (2,27 MB/s) — « hl5450dncupswrapper-3.0.0-1.i386.deb » sauvegardé [13474/13474]

./linux-brprinter-installer-2.1.1-1: ligne 1800: apt-get : commande introuvable
./linux-brprinter-installer-2.1.1-1: ligne 1804: apt-get : commande introuvable
./linux-brprinter-installer-2.1.1-1: ligne 1808: apt-get : commande introuvable
ln: impossible de créer le lien symbolique '/etc/init.d/cupsys': Aucun fichier ou dossier de ce type
ln: impossible de créer le lien symbolique '/etc/init.d/cups': Aucun fichier ou dossier de ce type
ln: impossible de créer le lien symbolique '/etc/init.d/lpd': Aucun fichier ou dossier de ce type
ln: impossible de créer le lien symbolique '/etc/init.d/lprng': Aucun fichier ou dossier de ce type
dpkg -x hl5450dnlpr-3.0.0-1.i386.deb /
dpkg -x hl5450dncupswrapper-3.0.0-1.i386.deb /
dpkg-deb: building package 'hl5450dnlpr' in 'hl5450dnlpr-3.0.0-1a.i386.deb'.
dpkg -b ./brother_driver_packdir hl5450dnlpr-3.0.0-1a.i386.deb
dpkg-deb: building package 'hl5450dncupswrapper' in 'hl5450dncupswrapper-3.0.0-1a.i386.deb'.
dpkg -b ./brother_driver_packdir hl5450dncupswrapper-3.0.0-1a.i386.deb
dpkg -i --force-all hl5450dnlpr-3.0.0-1a.i386.deb
dpkg: avertissement: problème contourné par utilisation de --force :
dpkg: avertissement: l'architecture du paquet (i386) ne correspond pas à celle du système (amd64)
Sélection du paquet hl5450dnlpr:i386 précédemment désélectionné.
(Lecture de la base de données... 0 fichier et répertoire déjà installé.)
Préparation du dépaquetage de hl5450dnlpr-3.0.0-1a.i386.deb ...
Dépaquetage de hl5450dnlpr:i386 (3.0.0-1) ...
Paramétrage de hl5450dnlpr:i386 (3.0.0-1) ...
chown: utilisateur incorrect: « lp »
dpkg -i --force-all hl5450dncupswrapper-3.0.0-1a.i386.deb
dpkg: avertissement: problème contourné par utilisation de --force :
dpkg: avertissement: l'architecture du paquet (i386) ne correspond pas à celle du système (amd64)
Sélection du paquet hl5450dncupswrapper:i386 précédemment désélectionné.
(Lecture de la base de données... 29 fichiers et répertoires déjà installés.)
Préparation du dépaquetage de hl5450dncupswrapper-3.0.0-1a.i386.deb ...
Dépaquetage de hl5450dncupswrapper:i386 (3.0.0-1) ...
Paramétrage de hl5450dncupswrapper:i386 (3.0.0-1) ...
lpadmin -p HL5450DN -E -v usb://dev/usb/lp0 -P /usr/share/ppd/brother/brother-HL-5450DN-cups-en.ppd
#
Will you specify the Device URI? [Y/n] ->


0: ipps
1: beh
2: smb
3: socket
4: http
5: lpd
6: https
7: ipp
8: dnssd://Brother%20HL-5450DN%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-30055c980637
9: dnssd://MX-2310U%20(1501035Y00)._printer._tcp.local/
10: lpd://192.168.1.150/lp
11: lpd://BRN30055C980637/BINARY_P1
12 (I): Specify IP address.
13 (A): Auto. (dnssd://Brother%20HL-5450DN%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-30055c980637)

select the number of destination Device URI. ->12

enter IP address ->192.168.1.249
lpadmin -p HL5450DN -v socket://192.168.1.249 -E
Test Print? [y/N] ->y

wait 5s.
lpr -P HL5450DN /usr/share/cups/data/testprint
Hit Enter/Return key.
[vincent@taf linux-brprinter-installer-2.1.1-1]$

l'option 8 dnssd://Brother%20HL-5450DN%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-30055c980637 aurait étée tout aussi bien.

ACL ou la gestion fine des droits sous Linux

Sur le vieux PC Dell que j'ai évoqué lors de mon précédent billet, j'ai créé un répertoire /home/commun pour que ma chère et tendre et moi-même puissions stocker quelques ressources... communes (vidéos, musique, photos etc).

Mais en matière de gestion des droits d'accès Linux, par défaut, est clairement orienté utilisateur. Gérer les droits pour un groupe n'est pas réellement prévu et donc créer un répertoire commun à tout ou partie des utilisateurs d'un même PC ne fonctionne pas "out of the box". Même si le répertoire initial est créé avec les droits qui vont bien (rwxrwx---) toute écriture à l'intérieur héritera des droits définis (par défaut) par l'auteur. C'est modifiable avec umask, mais outre que ceci ne soit pas trivial cela ne permet pas de gérer individuellement les fichiers et répertoires. Quand à gérer au cas par cas avec chmod autant ne pas en parler.

La solution c'est ACL, pour Access Control List. Comme c'est une dépendance de sytemd c'est déjà installé automatiquement sur Archlinux, ce qui ne veut pas dire qu'il n'y a rien à faire.

Options de montage

Tout d'abord il faut que la partition sur laquelle réside le répertoire concerné soit monté avec l'option ACL. À priori c'est automatiquement le cas si elle est formate en extX ou en btrfs,. Pour vous en assurer tapez la commande
# tune2fs -l /dev/sdXY | grep "Default mount options:"
Si la réponse est
Default mount options:    user_xattr acl
C'est tout bon, sinon vous pouvez modifier les options de montage par défaut en utilisant tune2fs
# tune2fs -o acl UUID=uuid (ou /dev/sdXY ou LABEL=volume_name)
vous pouver aussi modifier la ligne correspondante dans fstab en rajoutant acl à la fin des options. Par exemple :
# /dev/sda4
UUID=cfa7cb12-e2f8-4789-9003-c19489204ed9 /home ext4 rw,relatime,data=ordered,acl 0 2
mais c'est moins souple en cas de disque externe.

Gestion des droits

la commande pour modifier les droits d'un fichier ou d'un répertoire est setfacl
# setfacl option(s) <règle> <fichier/répertoire>
Lisez la page de man qui va bien pour toutes les combinaisons possibles, nous ne nous arrêterons ici que sur les cas les plus courants.
les options qui nous intéressent ici sont -m (modifie) -R (récursif) et -d (par défaut)
les règles sont construites sous la forme qui:permissions
qui est soit un utilisateur soit un groupe : u:USERNAME ou g:GROUPNAME
permission est une combinaison des caractères r,w et x (read, write et execute).

Pour notre cas concret

# setfacl -dmR g:users:rwx /home/commun

Documentation

wiki archlinux (en anglais)
doc ubuntu-fr (en français)
redhat (en anglais)

Chiffrement de son répertoire personnel

J'ai récupéré un vieux Dell sur lequel j'ai installé ma distribution et mon environnement graphique habituels (Archlinux / Openbox). L'idée est d'en faire un PC à emmener partout. Hum... et à oublier partout ! Donc il faut pour le moins protéger ses données, pour que son éventuelle perte ne permette à quiconque d'explorer nos documents et/ou mots de passe Internet. La solution est évidement le chiffrement, et tout est expliqué sur cette page du wiki d'Archlinux. Mais comme c'est en anglais et que tout ne m'était pas aussi évident que je l'espérais voici un compte rendu de cette opération.

État des lieux :

Archlinux à jour, utilisateur(s) créé(s), mots de passes définis (et solides, il serviront au chiffrement), répertoires personnels créés (et non vides, pour pouvoir tester), suffisamment de place dans la partition dans laquelle est monté /home (environ 2,5 fois plus que la taille du plus gros répertoire à chiffrer). Une bonne sauvegarde ne peut pas nuire. Même si une copie du répertoire sera faite par l'outil de migration (sous la forme /home/USERNAME.xxxxxxx) avant chiffrement, pourquoi ne pas essayer clonezilla ?

Programmes à installer :

# pacman -S ecryptfs-utils rsync lsof pam_mount

Programmes à installer :

# pacman -S ecryptfs-utils rsync lsof pam_mount

Préalable pour pouvoir se relogger facilement :

l'idée est évidement que le répertoire personnel soit monté en clair dès le login. Pour cela nous allons utiliser pam_mount :

1) éditer le fichier /etc/security/pam_mount.conf.xml

rajouter la ligne
<volume user="USERNAME" fstype="ecryptfs" path="/dev/sdXY" mountpoint="/home" options="fsck,noatime" />
un peu avant la fin, juste avant
<mkmountpoint enable="1" remove="true" />
</pam_mount>

2) éditer le fichier etc/pam.d/system-auth

après la ligne contenant 'auth required pam_unix.so' ajouter :
auth    required    pam_ecryptfs.so unwrap

Ensuite, avant la ligne contenant 'password required pam_unix.so' insérer :
password    optional    pam_ecryptfs.so

Et finalement, après la ligne contenant 'session required pam_unix.so' ajouter :
session    optional    pam_ecryptfs.so unwrap

Chiffrement proprement dit :

Démarrer le système sans se logger en tant qu'utilisateur. Depuis le gestionnaire de connexion (lightdm chez moi) passer en console (Alt Ctrl F2) et ouvrir une session root. On peut aussi se logger sur le compte d'un autre utilisateur et passer root dans une console, ce qui permet de profiter de l'environnement graphique et du copier/coller.

Monter le module ecryptfs puis lancer la commande de chiffrement

# modprobe encryptfs
# ecryptfs-migrate-home -u username
INFO: Checking disk space, this may take a few moments. Please be patient.
INFO: Checking for open files in /home/USERNAME
Enter your login passphrase [USERNAME]:

../.. (défilé des fichiers en cours de chiffrement)
Some Important Notes! 1. The file encryption appears to have completed successfully, however, USERNAME MUST LOGIN IMMEDIATELY, _BEFORE_THE_NEXT_REBOOT_ TO COMPLETE THE MIGRATION!!!
2. If USERNAME can log in and read and write their files, then the migration is complete,
and you should remove /home/USERNAME.5ZJvW3ds.
Otherwise, restore /home/USERNAME.5ZJvW3ds back to /home/USERNAME.
3. USERNAME should also run 'ecryptfs-unwrap-passphrase' and record their randomly generated
mount passphrase as soon as possible. 4. To ensure the integrity of all encrypted data on this system, you should also encrypt swap space
with 'ecryptfs-setup-swap'.

Attention :

le  mot de passe (passphrase) à indiquer ici est bien celui utilisé par l'utilisateur pour se logger. Sinon il vous faudra monter le répertoire à la main. Ensuite, comme indiqué ci-dessus, il est essentiel de se logger et de faire des essais de lecture et d'écriture dès que la migration sera terminée, en tous cas avant de redémarrer le système. Enfin lancez la commande
$ ecryptfs-unwrap-passphrase
et notez dans en endroit secret et sûr le nombre de 32 chiffres en hexadécimal qui aura été généré de façon aléatoire et qui vous servira de mot de passe de secours en cas de problème. Le moyen le plus simple est de l'envoyer à vous-même un e-mail chiffré (voir enigmail si vous utilisez Thunderbird) ou, à défaut, de l'enregistrer dans un fichier chiffré (avec GnuPG par exemple)  avant de vous l'envoyer en pièce jointe.

Considérations sur l'ordre de la procédure

Si vous suivez le wiki d'Archlinux vous noterez que contrairement à ce tuto la partie montage automatique au login est traitée dans un second temps. Cela a un avantage didactique évident mais oblige à monter la partition chiffrée "à la main", en ligne de commande. N'essayez donc pas de vous logger en mode graphique, cela ne fonctionnera pas, faites le en console.

En cas de problème

Si rien ne se passe comme prévu, si vous ne retrouvez pas vos données, pas de panique ! Il suffit de vous logger en root sur une console, de supprimer votre répertoire /home/USERNAME ainsi que le répertoire /home/.ecryptfs et enfin de renommer le répertoire de sauvegarde
rm -rf /home/USERNAME 
rm -rf /home/.ecryptfs
mv /home/USERNAME.xxxxxxxx /home/USERNAME

Si tout va bien

au bout de quelques jours (on ne sait jamais) pensez à supprimer la copie non chiffrée de votre répertoire personnel (/home/USERNAME.xxxxxxxx)

Changement de mot de passe

Si pour une raison ou une autre vous souhaitiez changer de mot de passe il faut le faire évidement à la fois pour le login et pour le déchiffrage du dossier.
#changer le mot de passe du login
passwd
#changer le mot de passe de chiffrement
ecryptfs-rewrap-passphrase ~/.ecryptfs/wrapped-passphrase
Dans les 2 cas l'ancien mot de passe sera demandé avant le nouveau.

Autres documentations

wiki.archlinux.fr - doc-ubuntu-fr

ttf-dejavu 2.37 nécessitera de forcer la mise à jour

ttf-dejavu 2.37 va changer la manière dont la configuration de fontconfig est installée. Dans les versions précédentes, la configuration était un lien symbolique décrit dans les scripts post_install/post_upgrade, la nouvelle version placera les fichiers à l’intérieur du paquet, comme cela se fait à présent dans fontconfig.

Pour plus d’informations à propos de ce changement: https://bugs.archlinux.org/task/32312

Pour mettre à niveau ttf-dejavu 2.37 il est recommandé de mettre à jour le paquet à part:

pacman -S --force ttf-dejavu

Article original

Les paquets TeXLive 2016 sont maintenant disponibles

Les paquets TeXLive ont été mis à jour en version 2016.

Le changement le plus notable est que l’utilitaire biber est maintenant fourni en tant que paquet séparé. Vous pouvez l’installer normalement en utilisant pacman.

Les hooks de pacman sont maintenant utilisés dans les paquets TeXLive de sorte que la mise à jour sera moins verbeuse que dans les années passées.

Article original

test-sec-flags: Appel à l’aide

Inspiré par des discussions sur la liste de diffusion arch-general, test-sec-flags a été créé par pid1 (avec l’aide d’anthraxx, strcat, sangy et rgacogne) pour tester l’impact sur les performances des options de lien et de compilation axés sur la sécurité. L’objectif est de déterminer si ces flags peuvent être la nouvelle valeur par défaut pour tous les paquets d’Arch Linux. Les résultats préliminaires suggèrent que l’impact sur les performances est presque inexistant comparé aux flags de compilation que nous utilisons déjà, mais nous aimerions recueillir et comparer plus de résultats avant de poursuivre.

Téléchargez la source ici et consultez le README pour les instructions d’installation et d’utilisation. Le sous-répertoire results contient des instructions sur la façon de dégager les statistiques pertinentes à partir des fichiers de résultats.

Nous recueillons des résultats dans le wiki test-sec-flags sur Github. Ajoutez-y les vôtres si vous voulez. Nous aimerions en particulier des bilans i686, compte tenu que tous les contributeurs précédents possédaient des appareils x86_64.

Patchs bienvenus.

Article original (en)

screen-4.4.0-1 incapable d’attacher d’anciennes sessions

Avec la mise à jour de screen-4.4.0-1 vous serez dans l’incapacité de rattacher des sessions ayant démarré sur des versions antérieures de screen. Veillez à vous assurer que toutes vos sessions sont fermées avant la mise à jour.

Article original (en)

Mise à jour de pacman-5.0.1 requise avant le 23-04-2016

La parution de pacman-5.0 a apporté le support des hooks transactionnels. Ceux-ci nous permettront (par exemple) des mises à jour du cache des polices une seule fois au cours d’une mise à jour plutôt qu’après chaque installation d’un paquet de police. Cela permettra à la fois d’accélérer le processus de mise à jour, mais aussi de réduire la charge de fabrication des paquets pour les Développeurs et Utilisateurs de confiance.

Dans le but de démarrer l’utilisation des hooks, nous avons besoin que tous les utilisateurs aient au moins mis à jour pacman-5.0.1 avant le 23/04/2016. Pacman-5.0.1 a été publié le 23/02/2016, donc cela donne à chacun deux mois pour mettre à jour son système.

Article original