diff --git a/COPYING b/COPYING index a43ea212..b050f300 100755 --- a/COPYING +++ b/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 51 Franklin Street, 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. diff --git a/Makefile b/Makefile index 929a92c6..ee4e1965 100644 --- a/Makefile +++ b/Makefile @@ -116,8 +116,8 @@ endif all: $(EXECS) # put current GIT revision into header file to be included by programs -$(GIT_REVISION): src/elogd.c - echo \#define GIT_REVISION \"`git log -n 1 --pretty=format:"%ad - %h"`\" > $(GIT_REVISION) +$(GIT_REVISION): src/elogd.c src/elog.c + type git &> /dev/null; if [ $$? -eq 1 ]; then REV="unknown" ;else REV=`git log -n 1 --pretty=format:"%ad - %h"`; fi; echo \#define GIT_REVISION \"$$REV\" > $(GIT_REVISION) regex.o: src/regex.c src/regex.h $(CC) $(CFLAGS) -w -c -o regex.o src/regex.c @@ -137,7 +137,7 @@ strlcpy.o: src/strlcpy.c src/strlcpy.h elogd: src/elogd.c regex.o crypt.o auth.o mxml.o $(GIT_REVISION) $(CC) $(CFLAGS) -o elogd src/elogd.c crypt.o auth.o regex.o mxml.o $(OBJS) $(LIBS) -elog: src/elog.c crypt.o $(OBJS) +elog: src/elog.c crypt.o $(OBJS) $(GIT_REVISION) $(CC) $(CFLAGS) -o elog src/elog.c crypt.o $(OBJS) $(LIBS) debug: src/elogd.c regex.o crypt.o auth.o mxml.o diff --git a/resources/eloglang.french b/resources/eloglang.french old mode 100755 new mode 100644 index cec36098..586e961f --- a/resources/eloglang.french +++ b/resources/eloglang.french @@ -1,9 +1,8 @@ # # French translation by Fred Pacquier -# (for 2.9.1+) +# (for 3.1.1+) # A more recent version may be available at : -# http://savannah.psi.ch/viewcvs/trunk/resources/eloglang.french?root=elog -# +# https://bitbucket.org/ritt/elog/src/b4d2a375a1c1991daa94427455f57665f7497df0/resources/eloglang.french?at=master&fileviewer=file-view-default New = Créer Edit = Modifier @@ -324,19 +323,19 @@ Preview = Pr FONT = POLICE SIZE = TAILLE COLOR = COULEUR -astonished = -smiling = -happy = -winking = -big grin = -crying = -cool = -frowning = -confused = -mad = -pleased = -tongue = -yawn = +astonished = surpris +smiling = souriant +happy = heureux +winking = clin d'oeuil +big grin = grand sourire +crying = plure +cool = tranquille +frowning = fronce les sourcils +confused = perdu +mad = furieux +pleased = content +tongue = tire la langue +yawn = baille Encoding = Encodage User "%s" not found in password file = Utilisateur "%s" non trouvé dans le fichier des comptes Cannot write to file %s = Impossible d'écrire dans le fichier %s @@ -467,26 +466,22 @@ This is an automatically generated account recovery email for host %s = Ceci est Please click on following link to recover your account = Veuillez cliquer sur le lien suivant pour récupérer votre compte Email address "%s" not registered = L'adresse mail "%s" n'est pas enregistrée User name "%s" not registered = Le nom d'utilisateur "%s" n'est pas enregistré - -# -#---- please translate following items and then remove this comment ----# -# -Error accessing password file = -CSV (";" separated) + Text = -Entry can only be deleted %1.2lg hours after creation = -Drop attachments here... = -Insert Timestamp = -Pending draft available = -%d pending drafts available = -Create new entry = -If you leave this page you will lose your unsaved changes = -Edited = -All time = -Draft = -Restrict seach to last = -days = -Draft saved at = -You might however then overwrite each other's modifications = -Draft entry created on %s by %s = -Really delete this entry? = -This is a draft message, edit and submit it to make it permanent = +Error accessing password file = Problème d'accès au fichier des mots de passe +CSV (";" separated) + Text = CSV (séparateur ";") + Texte +Entry can only be deleted %1.2lg hours after creation = Une entrée ne peut être supprimée que %1.2lg heures après sa création +Drop attachments here... = Glisser les attachements ici... +Insert Timestamp = Insérer horodatage +Pending draft available = Brouillon en attente disponible +%d pending drafts available = %d brouillons en attente disponibles +Create new entry = Créer une nouvelle entrée +If you leave this page you will lose your unsaved changes = Si vous quittez cette page vos modifications non enregistrées seront perdues +Edited = Modifié +All time = Tous temps +Draft = Brouillon +Restrict seach to last = Restreindre la recherche aux +days = derniers jours +Draft saved at = Brouillon enregistré le +You might however then overwrite each other's modifications = Vous pourriez toutefois écraser mutuellement vos modifications +Draft entry created on %s by %s = Brouillon créé le %s par %s +Really delete this entry? = Supprimer cette entrée, vraiment ? +This is a draft message, edit and submit it to make it permanent = Ceci est un brouillon, modifiez-le et validez-le pour le rendre définitif diff --git a/scripts/ckeditor-config.js b/scripts/ckeditor-config.js index b8d69ce7..e3be337f 100755 --- a/scripts/ckeditor-config.js +++ b/scripts/ckeditor-config.js @@ -1,4 +1,4 @@ -/** +/** * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license */ diff --git a/src/auth.c b/src/auth.c index 03fde985..55453792 100644 --- a/src/auth.c +++ b/src/auth.c @@ -470,6 +470,13 @@ int auth_verify_password(LOGBOOK * lbs, const char *user, const char *password, error_str[0] = 0; verified = FALSE; + + /* otherwise calls with null lbs which make this procedure crash */ + if (lbs == NULL) + lbs = get_first_lbs_with_global_passwd(); + + if (lbs == NULL) + return FALSE; getcfg(lbs->name, "Authentication", str, sizeof(str)); #ifdef HAVE_KRB5 diff --git a/src/elog.c b/src/elog.c index 634a2080..cd67e541 100755 --- a/src/elog.c +++ b/src/elog.c @@ -20,12 +20,12 @@ Contents: Electronic logbook utility - $Id$ - \********************************************************************/ #include "elog-version.h" -char svn_revision[] = "$Id$"; +#include "git-revision.h" +const char *_git_revision = GIT_REVISION; + #include #include @@ -73,6 +73,17 @@ char text[TEXT_SIZE], old_text[TEXT_SIZE], new_text[TEXT_SIZE]; /*------------------------------------------------------------------*/ + +const char *git_revision() +{ + const char *p = _git_revision; + if (strrchr(p, '-')) + p = strrchr(p, '-')+2; + return p; +} + +/*------------------------------------------------------------------*/ + char *map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; void base64_encode(unsigned char *s, unsigned char *d, int size) @@ -1051,10 +1062,7 @@ int main(int argc, char *argv[]) } else { usage: printf("%s ", ELOGID); - strcpy(str, svn_revision + 13); - if (strchr(str, ' ')) - *strchr(str, ' ') = 0; - printf("revision %s\n", str); + printf("revision %s\n", git_revision()); printf("\nusage: elog\n"); printf("elog -h [-p port] [-d subdir]\n"); printf(" Location where elogd is running\n"); diff --git a/src/elogd.c b/src/elogd.c index 5afdfd4a..5ae6d3b2 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -1718,12 +1718,14 @@ int setegroup(char *str) gr = getgrnam(str); - if (gr != NULL) + if (gr != NULL) { + chown(logbook_dir, -1, gr->gr_gid); if (setregid(-1, gr->gr_gid) >= 0 && initgroups(gr->gr_name, gr->gr_gid) >= 0) return 0; else { eprintf("Cannot set effective GID to group \"%s\"\n", gr->gr_name); eprintf("setgroup: %s\n", strerror(errno)); + } } else eprintf("Group \"%s\" not found\n", str); @@ -1741,12 +1743,14 @@ int seteuser(char *str) pw = getpwnam(str); - if (pw != NULL) + if (pw != NULL) { + chown(logbook_dir, pw->pw_uid, -1); if (setreuid(-1, pw->pw_uid) >= 0) { return 0; } else { eprintf("Cannot set effective UID to user \"%s\"\n", str); eprintf("setuser: %s\n", strerror(errno)); + } } else eprintf("User \"%s\" not found\n", str); @@ -8902,7 +8906,12 @@ void show_change_pwd_page(LOGBOOK * lbs) { char str[256], config[256], old_pwd[256], new_pwd[256], new_pwd2[256], user[256], auth[32], error_str[256]; int wrong_pwd; + /* otherwise calls with null lbs which make this procedure crash */ + if (lbs == NULL) + lbs = get_first_lbs_with_global_passwd(); + if (lbs == NULL) + return; getcfg(lbs->name, "Authentication", auth, sizeof(auth)); old_pwd[0] = new_pwd[0] = new_pwd2[0] = 0; @@ -10490,7 +10499,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL /*---- add password in case cookie expires during edit ----*/ if (getcfg(lbs->name, "Password file", str, sizeof(str)) && isparam("unm")) { - rsprintf("\n", getparam("unm")); + strencode2(str, getparam("unm"), sizeof(str)); + rsprintf("\n", str); if (isparam("upwd")) strlcpy(upwd, getparam("upwd"), sizeof(upwd)); else @@ -10577,7 +10587,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("%s:", loc("Entry time")); rsprintf("%s\n", str); - rsprintf("\n", date); + + strencode2(str, date, sizeof(str)); + rsprintf("\n", str); } if (_condition[0]) @@ -11839,7 +11851,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL thumb_ref[0] = 0; if (strlen(att[index]) < 14 || att[index][6] != '_' || att[index][13] != '_') { - rsprintf("Error: Invalid attachment \"%s\"
", att); + strencode2(str, att[index], sizeof(str)); + rsprintf("Error: Invalid attachment \"%s\"
", str); } else { strlcpy(file_name, lbs->data_dir, sizeof(file_name)); @@ -11889,7 +11902,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("  \n"); /* ImageMagick available, so get image size */ - rsprintf("%s \n", att[index] + 14); + strencode2(str, att[index], sizeof(str)); + rsprintf("%s \n", str + 14); if (chkext(file_name, ".pdf") || chkext(file_name, ".ps")) sprintf(cmd, "%s -format '%%wx%%h' '%s[0]'", _identify_cmd, file_name); else @@ -12006,10 +12020,11 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n"); } + strencode2(str, att[index], sizeof(str)); if (thumb_ref[0]) - rsprintf("\n", index, thumb_ref, att[index]); + rsprintf("\n", index, thumb_ref, str); else - rsprintf("\n", index, att[index]); + rsprintf("\n", index, str); rsprintf("\n"); } else @@ -13739,7 +13754,8 @@ void show_config_page(LOGBOOK * lbs) rsprintf("