]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - usertab.c
Update the Russian translation
[thirdparty/sarg.git] / usertab.c
index 4e0a58084ad20ff5b75bcc09c57c8b93a774f8cc..639920c5b2caac22374462aa62b9fcff62141f70 100644 (file)
--- a/usertab.c
+++ b/usertab.c
@@ -76,25 +76,25 @@ static void init_file_usertab(const char *UserTabFile)
        int z1, z2;
 
        if((fp_usr=fopen(UserTabFile,"r"))==NULL) {
-               debuga(_("Cannot open file \"%s\": %s\n"),UserTabFile,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),UserTabFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        if (fseek(fp_usr, 0, SEEK_END)==-1) {
-               debuga(_("Failed to move till the end of file \"%s\": %s\n"),UserTabFile,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Failed to move till the end of file \"%s\": %s\n"),UserTabFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        nreg = ftell(fp_usr);
        if (nreg<0) {
-               debuga(_("Cannot get the size of file \"%s\"\n"),UserTabFile);
+               debuga(__FILE__,__LINE__,_("Cannot get the size of file \"%s\"\n"),UserTabFile);
                exit(EXIT_FAILURE);
        }
        nreg += 100;
        if (fseek(fp_usr, 0, SEEK_SET)==-1) {
-               debuga(_("Failed to rewind file \"%s\": %s\n"),UserTabFile,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Failed to rewind file \"%s\": %s\n"),UserTabFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        if((userfile=(char *) malloc(nreg))==NULL){
-               debuga(_("ERROR: Cannot load. Memory fault\n"));
+               debuga(__FILE__,__LINE__,_("ERROR: Cannot load. Memory fault\n"));
                exit(EXIT_FAILURE);
        }
        userfile[0]='\t';
@@ -105,7 +105,7 @@ static void init_file_usertab(const char *UserTabFile)
                z1=0;
                while(buf[z1] && (unsigned char)buf[z1]>' ') {
                        if (z2+3>=nreg) { //need at least 3 additional bytes for the minimum string "\n\t\0"
-                               debuga(_("The list of users is too long in file \"%s\"\n"),UserTabFile);
+                               debuga(__FILE__,__LINE__,_("The list of users is too long in file \"%s\"\n"),UserTabFile);
                                exit(EXIT_FAILURE);
                        }
                        userfile[z2++]=buf[z1++];
@@ -114,7 +114,7 @@ static void init_file_usertab(const char *UserTabFile)
                userfile[z2++]='\n';
                while(buf[z1] && (unsigned char)buf[z1]>=' ') {
                        if (z2+2>=nreg) { //need at least 2 additional bytes for "\t\0"
-                               debuga(_("The list of users is too long in file \"%s\"\n"),UserTabFile);
+                               debuga(__FILE__,__LINE__,_("The list of users is too long in file \"%s\"\n"),UserTabFile);
                                exit(EXIT_FAILURE);
                        }
                        userfile[z2++]=buf[z1++];
@@ -124,7 +124,7 @@ static void init_file_usertab(const char *UserTabFile)
        }
        userfile[z2]='\0';
        if (fclose(fp_usr)==EOF) {
-               debuga(_("Read error in \"%s\": %s\n"),UserTabFile,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Read error in \"%s\": %s\n"),UserTabFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 }
@@ -164,31 +164,31 @@ static void init_ldap_usertab(void) {
        url.lud_scope = LDAP_SCOPE_DEFAULT;
        ldapuri = ldap_url_desc2str(&url);
        if (ldapuri==NULL) {
-               debuga(_("Cannot prepare ldap URI for server %s on port %d\n"),LDAPHost,LDAPPort);
+               debuga(__FILE__,__LINE__,_("Cannot prepare ldap URI for server %s on port %d\n"),LDAPHost,LDAPPort);
                exit(EXIT_FAILURE);
        }
 
        rc = ldap_initialize(&ldap_handle, ldapuri);
        if (rc != LDAP_SUCCESS) {
-               debuga(_("Unable to connect to LDAP server %s on port %d: %d (%s)\n"), LDAPHost, LDAPPort, rc, ldap_err2string(rc));
+               debuga(__FILE__,__LINE__,_("Unable to connect to LDAP server %s on port %d: %d (%s)\n"), LDAPHost, LDAPPort, rc, ldap_err2string(rc));
                exit(EXIT_FAILURE);
        }
        ldap_memfree(ldapuri);
 
        if (ldap_set_option(ldap_handle, LDAP_OPT_REFERRALS, LDAP_OPT_OFF) != LDAP_OPT_SUCCESS) {
-               debuga(_("Could not disable LDAP_OPT_REFERRALS\n"));
+               debuga(__FILE__,__LINE__,_("Could not disable LDAP_OPT_REFERRALS\n"));
                exit(EXIT_FAILURE);
        }
        int ldap_protocol_version = LDAPProtocolVersion;
        if (ldap_set_option(ldap_handle, LDAP_OPT_PROTOCOL_VERSION, &ldap_protocol_version) != LDAP_SUCCESS) {
-               debuga(_("Could not set LDAP protocol version %d\n"), ldap_protocol_version);
+               debuga(__FILE__,__LINE__,_("Could not set LDAP protocol version %d\n"), ldap_protocol_version);
                exit(EXIT_FAILURE);
        }
 
        /* Bind to the LDAP server. */
        rc = ldap_simple_bind_s( ldap_handle, LDAPBindDN, LDAPBindPW );
        if ( rc != LDAP_SUCCESS ) {
-               debuga(_("Cannot bind to LDAP server: %s\n"), ldap_err2string(rc));
+               debuga(__FILE__,__LINE__,_("Cannot bind to LDAP server: %s\n"), ldap_err2string(rc));
                exit(EXIT_FAILURE);
        }
 
@@ -197,7 +197,7 @@ static void init_ldap_usertab(void) {
        if (LDAPNativeCharset[0]!='\0') {
                ldapiconv = iconv_open( LDAPNativeCharset, "UTF-8" );
                if (ldapiconv==(iconv_t)-1) {
-                       debuga(_("iconv cannot convert from UTF-8 to %s: %s\n"),LDAPNativeCharset,strerror(errno));
+                       debuga(__FILE__,__LINE__,_("iconv cannot convert from UTF-8 to %s: %s\n"),LDAPNativeCharset,strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
@@ -225,7 +225,7 @@ const char * charset_convert( const char * str_in, const char * charset_to )
                ldapconvbuffersize=str_out_len;
                str_out = realloc(ldapconvbuffer,ldapconvbuffersize);
                if (!str_out) {
-                       debuga(_("Not enough memory to convert a LDAP returned string: %lu bytes required\n"),(unsigned long int)str_out_len);
+                       debuga(__FILE__,__LINE__,_("Not enough memory to convert a LDAP returned string: %lu bytes required\n"),(unsigned long int)str_out_len);
                        exit(EXIT_FAILURE);
                }
                ldapconvbuffer = str_out;
@@ -237,20 +237,20 @@ const char * charset_convert( const char * str_in, const char * charset_to )
        return_value = iconv(ldapiconv, (ICONV_CONST char **)&str_in, &str_in_len, &str_out, &str_out_len );
        if ( return_value == ( size_t ) -1 ) {
                /* TRANSLATORS: The message is followed by the reason for the failure. */
-               debuga(_("iconv failed on string \"%s\":\n"),str_in_orig);
+               debuga(__FILE__,__LINE__,_("iconv failed on string \"%s\":\n"),str_in_orig);
                switch ( errno ) {
                        /* See "man 3 iconv" for an explanation. */
                        case EILSEQ:
-                               debuga(_("Invalid multibyte sequence.\n"));
+                               debuga(__FILE__,__LINE__,_("Invalid multibyte sequence.\n"));
                                break;
                        case EINVAL:
-                               debuga(_("Incomplete multibyte sequence.\n"));
+                               debuga(__FILE__,__LINE__,_("Incomplete multibyte sequence.\n"));
                                break;
                        case E2BIG:
-                               debuga(_("No more room.\n"));
+                               debuga(__FILE__,__LINE__,_("No more room.\n"));
                                break;
                        default:
-                               debuga(_("Error: %s.\n"),strerror( errno ));
+                               debuga(__FILE__,__LINE__,_("Error: %s.\n"),strerror( errno ));
                }
                exit(EXIT_FAILURE);
        }
@@ -313,8 +313,7 @@ static void get_ldap_name(const char *userlogin,char *mappedname,int namelen)
        attrs[1]=NULL;
        rc= ldap_search_ext_s(ldap_handle, LDAPBaseSearch, LDAP_SCOPE_SUBTREE, filtersearch, attrs, 0, NULL, NULL, NULL, -1, &result);
        if (rc != LDAP_SUCCESS) {
-               debuga(_("LDAP search failed: %s\n"), ldap_err2string(rc));
-               debuga(_("looking for \"%s\" at or below \"%s\"\n"),filtersearch,LDAPBaseSearch);
+               debuga(__FILE__,__LINE__,_("LDAP search failed: %s\nlooking for \"%s\" at or below \"%s\"\n"), ldap_err2string(rc),filtersearch,LDAPBaseSearch);
                safe_strcpy(mappedname,userlogin,namelen);
                return;
        }
@@ -347,18 +346,18 @@ void init_usertab(const char *UserTabFile)
        if (strcmp(UserTabFile, "ldap") == 0) {
                if(debug) {
                        /* TRANSLATORS: The %s may be the string "ldap" or a file name.*/
-                       debuga(_("Loading User table from \"%s\"\n"),UserTabFile);
+                       debuga(__FILE__,__LINE__,_("Loading User table from \"%s\"\n"),UserTabFile);
                }
 #ifdef HAVE_LDAP_H
                which_usertab=UTT_Ldap;
                init_ldap_usertab();
 #else
-               debuga(_("LDAP module not compiled in sarg\n"));
+               debuga(__FILE__,__LINE__,_("LDAP module not compiled in sarg\n"));
                exit(EXIT_FAILURE);
 #endif //HAVE_LDAP_H
        } else if (UserTabFile[0] != '\0') {
                if(debug)
-                       debuga(_("Loading User table from \"%s\"\n"),UserTabFile);
+                       debuga(__FILE__,__LINE__,_("Loading User table from \"%s\"\n"),UserTabFile);
                which_usertab=UTT_File;
                init_file_usertab(UserTabFile);
        } else {