Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gregkh/smugbatch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ajaeger/smugbatch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 7 commits
  • 3 files changed
  • 2 contributors

Commits on Jul 17, 2008

  1. Sync to fork master

    ajaeger committed Jul 17, 2008
    Copy the full SHA
    0c7e4ce View commit details

Commits on Aug 19, 2008

  1. Copy the full SHA
    a7ffac8 View commit details

Commits on Dec 5, 2010

  1. Copy the full SHA
    e193a09 View commit details
  2. Use API 1.2.2.

    ajaeger committed Dec 5, 2010
    Copy the full SHA
    7920d1d View commit details

Commits on Mar 25, 2012

  1. Add missing prototype.

    ajaeger committed Mar 25, 2012
    Copy the full SHA
    bedaf24 View commit details
  2. Avoid buffer overflow

    get_su_cookie: Avoid buffer overflow in get_cookie and increase
    the cookie buffer since it actually did overflow. Fix a warning
    about shadowing the variable res.
    
    this was noticed when compiling with -fstack-protector
    -D_FORTIFY_SOURCE=2
    ajaeger committed Mar 25, 2012
    Copy the full SHA
    29b63b5 View commit details
  3. Merge remote-tracking branch 'upstream/master'

    Merged conflicts
    
    Conflicts:
    	smug.h
    	smug_core.c
    ajaeger committed Mar 25, 2012
    Copy the full SHA
    6751c0e View commit details
Showing with 23 additions and 5 deletions.
  1. +15 −0 HACKING
  2. +2 −0 smug.h
  3. +6 −5 smug_core.c
15 changes: 15 additions & 0 deletions HACKING
Original file line number Diff line number Diff line change
@@ -28,3 +28,18 @@ check this to ensure you are properly cleaning up.

It is safe to ignore the valgrind errors in the curl and ssl libraries, we
can't do anything about those at this time.

Basic usage with github:
* create a fork of gregkh/smugbatch at github.com
* Check it out locally: git clone git@github.com:ajaeger/smugbatch.git
* switch to the directory: cd smugbatch/
* add Greg's git as remote repository:
git remote add smugcore git://github.com/gregkh/smugbatch.git
* Fetch it:
git fetch smugcore
* This will create a branch, so merge it back:
git checkout master
git merge smugcore/master
* Sync merge back:
git commit -a -m "Sync to fork master"

2 changes: 2 additions & 0 deletions smug.h
Original file line number Diff line number Diff line change
@@ -128,6 +128,8 @@ extern int smug_get_albums(struct session *session);
extern int smug_read_images(struct session *session, struct album *album);
extern void smug_parse_configfile(struct session *session);
extern int smug_download(struct session *session, struct filename *filename);
extern char *smug_get_quicksettings_id(const char *qs_name,
struct session *session);

extern int debug;

11 changes: 6 additions & 5 deletions smug_core.c
Original file line number Diff line number Diff line change
@@ -104,15 +104,15 @@ static char *get_su_cookie(CURL *curl)
}
nc = cookies;
while (nc) {
char domain[50], p1[50], p2[50], p3[50], name[50], value[50];
char domain[50], p1[50], p2[50], p3[50], name[50], value[100];
long unsigned int t;
int res;
int res2;

/* #HttpOnly_.smugmug.com\tTRUE\t/\tFALSE\t0\tSMSESS\t99363be4c3ceb3f153f875216539524a */
res =
sscanf(nc->data, "%s\t%s\t%s\t%s\t%lu\t%s\t%s", domain, p1,
res2 =
sscanf(nc->data, "%49s\t%49s\t%49s\t%49s\t%lu\t%49s\t%99s", domain, p1,
p2, p3, &t, name, value);
if (res == 7 && strcmp(name, "_su") == 0) {
if (res2 == 7 && strcmp(name, "_su") == 0) {
cookie = valloc(strlen(value) + 1 + 4);
sprintf(cookie, "_su=%s", value);
}
@@ -295,6 +295,7 @@ struct session *session_alloc(void)
struct session *session;

session = zalloc(sizeof(*session));
session->su_cookie = NULL;
if (!session)
return NULL;
session->su_cookie = NULL;