Fedora 9 + CIFS issue

sgb no-reply-gw at fcp.surfsite.org
Fri May 30 09:58:11 UTC 2008


Thanks for the tip on strlcpy.
> 
> My solution was to ensure that my credentials file does not terminate with a new-line character.  I used a hex editor to delete the final new-line character that vi sticks in there, and I was able to use my credentials file at that point.
> 
> However, it looks like the same thing is happening in the domain parameter, so if you include both a domain and a password, you need to have a new-line character to separate them, and I am not sure how to workaround that.
Here are a couple of alternative workarounds if you need to supply both domain and username in the credentials file. The trick is to help strlcpy to terminate the string, by explicitly inserting a NULL character.

1) If using a hex-editor insert a NULL character (00) just before the newline on each row.

2) or wash/fix an existing credentials file like this:

cat credentials_file | tr -d ' t' | awk -- '{printf "%sn", $0}' > new_credetials_file

This also take care of the space problem, since any spaces (or tabs) are deleted.

3) or create a brand new credentials file like this:

echo -en "domain=xxxnusername=xxxnpassword=xxxn" > credentials_file

Cheers
/S-G


-- 
This is an email sent via The Fedora Community Portal https://fcp.surfsite.org
https://fcp.surfsite.org/modules/newbb/viewtopic.php?post_id=268232&topic_id=56359&forum=10#forumpost268232
If you think, this is spam, please report this to webmaster at fcp.surfsite.org and/or blame sgb at systemasis.com.




More information about the fedora-list mailing list