kai_yang2008
2010-Feb-22 09:45 UTC
ld: Unsatisfied symbol "options" in file ./libssh.a[hostfile.o]
Hi All, I have want to add a option in ssh_config to co-work with ldap.But when I am compiling , i was encountered a ld error, which says "cc -o ssh-keygen ssh-keygen.o -Wl,+nodefaultrpath -L. -Lopenbsd-compat/ -lssh -lopenbsd-compat -lz -lnsl -lxnet -lsec -lgssapi_krb5 -lkrb5 -lpthread ld: Unsatisfied symbol "options" in file ./libssh.a[hostfile.o] 1 errors." The following is my codes: I have externed Options options like " extern Options options" in hostfile.c .......... extern Options options .......... static HostStatus check_host_in_hostfile_by_key_or_type(const char *filename, const char *host, const Key *key, int keytype, Key *found, int *numret) { FILE *f; char line[8192]; int linenum = 0; u_int kbits; char *cp, *cp2, *hashed_host; HostStatus end_return; debug3("check_host_in_hostfile: filename %s", filename); /* Open the file containing the list of known hosts. */ f = fopen(filename, "r"); if (!f) { if(options.usesshldaphostkey) return check_hostkey_in_ldap(host,key,HOST_NEW); else return HOST_NEW; } ....... So any ideas about this? Thanks! Kai Yang
Damien Miller
2010-Feb-23 22:43 UTC
ld: Unsatisfied symbol "options" in file ./libssh.a[hostfile.o]
ssh-keygen doesn't have a config file, so it doesn't link against anything that provides an options struct. You need to pass your new flag in as an argument. On Mon, 22 Feb 2010, kai_yang2008 wrote:> Hi All, > I have want to add a option in ssh_config to co-work with ldap.But when I am compiling , i was encountered a > ld error, which says "cc -o ssh-keygen ssh-keygen.o -Wl,+nodefaultrpath -L. -Lopenbsd-compat/ -lssh -lopenbsd-compat -lz -lnsl -lxnet -lsec -lgssapi_krb5 -lkrb5 -lpthread > ld: Unsatisfied symbol "options" in file ./libssh.a[hostfile.o] > 1 errors." > The following is my codes: > I have externed Options options like " extern Options options" in hostfile.c > > .......... > extern Options options > .......... > static HostStatus > check_host_in_hostfile_by_key_or_type(const char *filename, > const char *host, const Key *key, int keytype, Key *found, int *numret) > { > FILE *f; > char line[8192]; > int linenum = 0; > u_int kbits; > char *cp, *cp2, *hashed_host; > HostStatus end_return; > debug3("check_host_in_hostfile: filename %s", filename); > /* Open the file containing the list of known hosts. */ > f = fopen(filename, "r"); > if (!f) > { > if(options.usesshldaphostkey) > return check_hostkey_in_ldap(host,key,HOST_NEW); > else > > return HOST_NEW; > } > ....... > > So any ideas about this? > Thanks! > > Kai Yang > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >
kai_yang2008
2010-Feb-24 02:04 UTC
ld: Unsatisfied symbol "options" in file ./libssh.a[hostfile.o]
Hi Miller, Oh, thank you very much. I shoud pass the option "usesshldaphostkey" as a argument to the function "check_host_in_hostfile_by_key_or_type". Best regards, Kai Yang ?2010-02-24?06:43:20?"Damien?Miller"?<djm at mindrot.org>????>ssh-keygen?doesn't?have?a?config?file,?so?it?doesn't?link?against >anything?that?provides?an?options?struct.?You?need?to?pass?your?new >flag?in?as?an?argument. > >On?Mon,?22?Feb?2010,?kai_yang2008?wrote: > >>?Hi?All, >>?I?have?want?to?add?a?option?in?ssh_config?to?co-work?with?ldap.But?when?I?am?compiling?,?i?was?encountered?a >>?ld?error,?which?says?"cc?-o?ssh-keygen?ssh-keygen.o?-Wl,+nodefaultrpath?-L.?-Lopenbsd-compat/?-lssh?-lopenbsd-compat??-lz?-lnsl?-lxnet?-lsec?-lgssapi_krb5?-lkrb5?-lpthread >>?ld:?Unsatisfied?symbol?"options"?in?file?./libssh.a[hostfile.o] >>?1?errors." >>?The?following?is?my?codes: >>?I?have?externed?Options?options?like?"?extern?Options?options"?in?hostfile.c >>?? >>?.......... >>?extern?Options?options >>?.......... >>?static?HostStatus >>?check_host_in_hostfile_by_key_or_type(const?char?*filename, >>?????const?char?*host,?const?Key?*key,?int?keytype,?Key?*found,?int?*numret) >>?{ >>?????????FILE?*f; >>?????????char?line[8192]; >>?????????int?linenum?=?0; >>?????????u_int?kbits; >>?????????char?*cp,?*cp2,?*hashed_host; >>?????????HostStatus?end_return; >>?????????debug3("check_host_in_hostfile:?filename?%s",?filename); >>?????????/*?Open?the?file?containing?the?list?of?known?hosts.?*/ >>?????????f?=?fopen(filename,?"r"); >>?????????if?(!f) >>?????????{ >>?????????????????if(options.usesshldaphostkey) >>?????????????????????????return?check_hostkey_in_ldap(host,key,HOST_NEW); >>?????????????????else >>? >>?????????????????return?HOST_NEW; >>?} >>?....... >>?? >>?So?any?ideas?about?this? >>?Thanks! >>?? >>?Kai?Yang >>?_______________________________________________ >>?openssh-unix-dev?mailing?list >>?openssh-unix-dev at mindrot.org >>?https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >>
Possibly Parallel Threads
- [PATCH] hostfile: list known names (if any) for new hostkeys
- [patch] tell user about hosts with same key
- [PATCH] allow user to update changed key in known_hosts
- Proposal: Allow HostKeyAlias to be used in hostname check against certificate principal.
- Dom0 NETTX, NETRX alway are 0