Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 242899 Details for
Bug 258018
mail-mta/ssmtp-2.62-r8: blank password sent if ssmtp.conf defines password containing '#'
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix values in ssmtp.conf file cannot contain '#'
ssmtp-2.62-comments.patch (text/plain), 1.69 KB, created by
davidshen
on 2010-08-14 06:58:05 UTC
(
hide
)
Description:
fix values in ssmtp.conf file cannot contain '#'
Filename:
MIME Type:
Creator:
davidshen
Created:
2010-08-14 06:58:05 UTC
Size:
1.69 KB
patch
obsolete
>From 91d4db762934f01e4ba0e32e94bf4e7aa7680db1 Mon Sep 17 00:00:00 2001 >From: David Shen <davidshen84@gmail.com> >Date: Sat, 14 Aug 2010 13:28:12 +0800 >Subject: [PATCH] fix_trim_left_space > >--- > ssmtp.c | 34 ++++++++++++++++++++++++++++------ > 1 files changed, 28 insertions(+), 6 deletions(-) > >diff --git a/ssmtp.c b/ssmtp.c >index 9d9a7f3..4bd053f 100644 >--- a/ssmtp.c >+++ b/ssmtp.c >@@ -850,6 +850,32 @@ char *firsttok(char **s, const char *delim) > } > > /* >+ * This is a simple trim function that only trim the space on the left of the string. >+ * It will not duplicate the original string. It returns a pointer of the original string which is not a space >+ * Args: >+ * char *str: >+ * Address of the pointer to the string we are going to trim. >+ * Return value: >+ * The pointer to the first none space character in the original string. >+ * You do not need to free this pointer. >+ */ >+char *trimleft(char *str) { >+ if(str == (char *)NULL) >+ return NULL; >+ >+ while(str != (char *)NULL) { >+ if(isspace(*str)) { >+ str++; >+ continue; >+ } >+ >+ break; >+ } >+ >+ return str; >+} >+ >+/* > read_config() -- Open and parse config file and extract values of variables > */ > bool_t read_config() >@@ -869,15 +895,11 @@ bool_t read_config() > } > > while(fgets(buf, sizeof(buf), fp)) { >- char *begin=buf; >+ char *begin=trimleft(buf); > char *rightside; >- /* Make comments invisible */ >- if((p = strchr(buf, '#'))) { >- *p = (char)NULL; >- } > > /* Ignore malformed lines and comments */ >- if(strchr(buf, '=') == (char *)NULL) continue; >+ if(*begin == '#' || strchr(buf, '=') == (char *)NULL) continue; > > /* Parse out keywords */ > p=firsttok(&begin, "= \t\n"); >-- >1.7.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 258018
: 242899