Comment créer un patch
1 Comment cr´eer un patch
Il faut comment par cr´eer une copie du r´epertoire que nous d´esirons patcher. nuntiux@nozomi:/tmp% ls openssh-3.5p1 openssh-3.5p1-patched nuntiux@nozomi:/tmp% Nous modifions le r´epertoire ou nous voulons patcher. Une fois la modification effectu´ee il ne reste plus qu’`a taper la commande : diff -r -u -u openssh-3.5p1 openssh-3.5p1-patched > my_patch
Le fichier obtenu est le patch que nous pouvons d´esormais distribuer. Voici
`a quoi ressemble un patch simple. nuntiux@nozomi:/tmp% cat my_patch diff -r -u -u openssh-3.5p1/auth-passwd.c openssh-3.5p1-patched/auth-passwd.c
--- openssh-3.5p1/auth-passwd.c Thu Sep 26 01:14:16 2002
+++ openssh-3.5p1-patched/auth-passwd.c Tue Nov 5 14:59:29 2002
@@ -92,6 +92,7 @@ int auth_password(Authctxt *authctxt, const char *password)
{
+ printf("ceci est mon patch\n");
#if defined(USE_PAM) if (*password == ’\0’ && options.permit_empty_passwd == 0) return 0; nuntiux@nozomi:/tmp% 1
2 Comment appliquer un patch
Pour appliquer le patch, rendez vous dans le r´epertoire contenant les sources qui doivent ˆetre patch´ees et tapez la commande : nuntiux@nozomi:/tmp% cd openssh-3.5p1 nuntiux@nozomi:/tmp/openssh-3.5p1% patch -p1 -l < ../my_patch
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -r -u -u openssh-3.5p1/auth-passwd.c openssh-3.5p1-patched/auth-passwd.c
|--- openssh-3.5p1/auth-passwd.c Thu Sep 26 01:14:16 2002
|+++ openssh-3.5p1-patched/auth-passwd.c Tue Nov 5 14:59:29 2002
--------------------------
Patching file auth-passwd.c using Plan A...
Hunk #1 succeeded at 92. done nuntiux@nozomi:/tmp/openssh-3.5p1%
Voila, vos sources ont ´et´e patch´ees avec succ`es.
3 Comment enlever un patch
Il s’agit de la mˆeme commande que pour appliquer le patch : nuntiux@nozomi:/tmp/openssh-3.5p1% patch -p1 -l < ../my_patch
Hmm... Looks like a unified diff to me...
The text